blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b6918dc3127e4e3cd419c9803ab54462d108fd14 | 30114f6730aac693971d826f58e46f6d158e6957 | /ComTypeLibfor7/connect/drive/predrive.cpp | 77b6ee8ae05ff3a5ad727d0d8c9e23a1005ed6dd | [] | no_license | oudream/vc_example_official | 67111751a416df93cdc4b9f1048d93f482819992 | 8075deebd4755b2a7531a8f918c19ad2e82e2b23 | refs/heads/master | 2020-06-14T08:00:01.267447 | 2019-07-03T01:03:59 | 2019-07-03T01:03:59 | 194,953,887 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 226 | cpp | // stdafx.cpp : source file that includes just the standard includes
// stdafx.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "predrive.h"
LONG g_cObjCnt = 0L; | [
"oudream@126.com"
] | oudream@126.com |
8c80979d210d550965acdf3b0562c894abe182ad | 0ba6faa4c7f94a355f4719c9d09be477a2ab58e2 | /abc061_C.cpp | f4b31ccd441d3caa16c70169a5eaaef3aedd2e8d | [] | no_license | k2font/atcoder | a97d851bae3c5ea210accd493e6e33df2869e038 | d2b7b8e6dbb843330f477b922bd4e2d2928ed810 | refs/heads/master | 2023-05-15T06:51:43.771882 | 2021-06-05T07:03:11 | 2021-06-05T07:03:11 | 278,045,287 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 839 | cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
return string(1, val);
}
int char_to_int(char val) {
return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int main() {
ll N, K; cin >> N >> K;
vector<ll> a(N), b(N);
REP(i, N) cin >> a[i] >> b[i];
map<ll, ll> m;
for(int i = 0; i < N; ++i) {
m[a.at(i)] += b.at(i);
}
ll cnt = 0;
ll ans = 0;
for(auto x : m) {
cnt += x.second;
if(cnt >= K) {
ans = x.first;
break;
}
}
cout << ans << endl;
} | [
"shoichiro.kouno@gmail.com"
] | shoichiro.kouno@gmail.com |
71ed67bdfdf48d268e3e9f852e6a2489f47fc801 | cda05670b5952f890018e54f133373912b77a4e9 | /Hackerrank/C++/Print Pretty.cpp | 3f995c8c59fb112662bf2e864d9d840991c71370 | [] | no_license | rishichawla/CompetitiveProgramming | 30bd59a7a496da7b8bbac3f8aef5b52b2a580504 | 6596938395d48dddd160294dcf1f73d064541d09 | refs/heads/master | 2020-03-31T03:43:48.832372 | 2019-10-21T10:35:08 | 2019-10-21T10:35:08 | 151,875,473 | 0 | 1 | null | 2019-10-09T14:18:41 | 2018-10-06T19:40:24 | C++ | UTF-8 | C++ | false | false | 330 | cpp | // https://www.hackerrank.com/challenges/prettyprint/problem
cout << hex << left << showbase << nouppercase;
cout << (long long)A << endl;
cout << dec << right << setw(15) << setfill('_') << showpos << fixed << setprecision(2);
cout << B << endl;
cout << scientific << uppercase << noshowpos << setprecision(9);
cout << C << endl; | [
"rishi.chawla14@gmail.com"
] | rishi.chawla14@gmail.com |
c1489022264d265c177967354403fc17cc3e95dd | 0ef4f71c8ff2f233945ee4effdba893fed3b8fad | /misc_microsoft_gamedev_source_code/misc_microsoft_gamedev_source_code/xcore/memory/memoryHeapMacros.h | 9d49f9da131d83c023757dcbf52f4dd4c0acdc9f | [] | no_license | sgzwiz/misc_microsoft_gamedev_source_code | 1f482b2259f413241392832effcbc64c4c3d79ca | 39c200a1642102b484736b51892033cc575b341a | refs/heads/master | 2022-12-22T11:03:53.930024 | 2020-09-28T20:39:56 | 2020-09-28T20:39:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,233 | h | //=============================================================================
//
// memoryHeapMacros.h
//
// Copyright (c) 2007, Ensemble Studios
//
//=============================================================================
#pragma once
//=============================================================================
// heapNew
//=============================================================================
template<class Type> inline Type* heapNew(BMemoryHeap& heap)
{
const uint align = (__alignof(Type) >= sizeof(DWORD)) ? __alignof(Type) : sizeof(DWORD);
uint size = Utils::AlignUpValue(sizeof(Type), align);
Type* p = static_cast<Type*>(heap.New(size));
BVERIFY(p);
BDEBUG_ASSERT(Utils::IsAligned(p, align));
if (!BIsBuiltInType<Type>::Flag) Utils::ConstructInPlace(p);
return p;
}
//=============================================================================
// heapNewInit
//=============================================================================
template<class Type> inline Type* heapNewInit(BMemoryHeap& heap, const Type& obj)
{
const uint align = (__alignof(Type) >= sizeof(DWORD)) ? __alignof(Type) : sizeof(DWORD);
uint size = Utils::AlignUpValue(sizeof(Type), align);
Type* p = static_cast<Type*>(heap.New(size));
BVERIFY(p);
BDEBUG_ASSERT(Utils::IsAligned(p, align));
if (!BIsBuiltInType<Type>::Flag) Utils::ConstructInPlace(p, obj);
return p;
}
//=============================================================================
// heapDelete
//=============================================================================
template<class Type> inline void heapDelete(Type* p, BMemoryHeap& heap)
{
if (!p)
return;
if (!BIsBuiltInType<Type>::Flag) Utils::DestructInPlace(p);
bool success = heap.Delete(p);
success;
BDEBUG_ASSERT(success);
}
//=============================================================================
// heapNewArray
//=============================================================================
template<class Type> inline Type* heapNewArray(unsigned int num, BMemoryHeap& heap)
{
BDEBUG_ASSERT((num > 0) && ((num * sizeof(Type)) < 2147483648));
const uint align = (__alignof(Type) >= sizeof(DWORD)) ? __alignof(Type) : sizeof(DWORD);
uint size = align + num * sizeof(Type);
size = Utils::AlignUpValue(size, align);
unsigned int* p = static_cast<unsigned int*>(heap.New(size));
BVERIFY(p);
*p = num;
Type* q = reinterpret_cast<Type*>(reinterpret_cast<uchar*>(p) + align);
BDEBUG_ASSERT(Utils::IsAligned(q, align));
if (!BIsBuiltInType<Type>::Flag) Utils::ConstructArrayInPlace(q, num);
return q;
}
//=============================================================================
// heapDeleteArray
//=============================================================================
template<class Type> inline void heapDeleteArray(Type* p, BMemoryHeap& heap)
{
if (!p)
return;
const uint align = (__alignof(Type) >= sizeof(DWORD)) ? __alignof(Type) : sizeof(DWORD);
uint* q = reinterpret_cast<uint*>(reinterpret_cast<uchar*>(p) - align);
const unsigned int num = *q;
BDEBUG_ASSERT((num > 0) && ((num * sizeof(Type)) < 2147483648));
if (!BIsBuiltInType<Type>::Flag) Utils::DestructArrayInPlace(p, num);
bool success = heap.Delete(q);
success;
BDEBUG_ASSERT(success);
}
// All new macros BFATAL_FAIL on failure
#define HEAP_NEW(type, heap) heapNew<type>(heap)
#define HEAP_NEW_INIT(type, heap, init) heapNewInit<type>(heap, init)
#define HEAP_DELETE(p, heap) heapDelete(p, heap)
#define HEAP_NEW_ARRAY(type, num, heap) heapNewArray<type>(num, heap)
#define HEAP_DELETE_ARRAY(p, heap) heapDeleteArray(p, heap)
// Use heapDelete or HEAP_DELETE to delete objects created by this overload of operator new.
// Example usage:
// uint* p = new(gSimHeap) uint;
// heapDelete(p, gSimHeap);
inline void* operator new (size_t s, BMemoryHeap& heap)
{
void* p = heap.New(static_cast<int>(s));
BVERIFY(p);
return p;
}
| [
"benjamin.barratt@icloud.com"
] | benjamin.barratt@icloud.com |
12ebf0efced6627d5f5a8f688903f559b7819f39 | 3a652b7f614cd1a524d2d25a935ace3cd292fbdf | /C++_SimulationGame/src/Retromarcia.h | a93df2a5f4d7790365cadcdfa95bbdbdf3056070 | [] | no_license | yamunamaccarana/INFO3A | 907a24db8925e2ba39a78a0e0cf49297a88ed8b7 | 80b0cfe38111f68a6dfafb838ce0f7ae02315c3d | refs/heads/master | 2021-01-02T09:14:37.963045 | 2015-06-15T07:27:20 | 2015-06-15T07:27:20 | 27,532,976 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 333 | h | /*
* Retromarcia .h
*
* Created on: 16/gen/2014
* Author: Yamuna
*/
#ifndef Retromarcia_H_
#define Retromarcia_H_
#include <iostream>
#include "Digitale.h"
using namespace std;
class Retromarcia: public Digitale {
public:
Retromarcia();
virtual ~Retromarcia();
};
#endif /* Retromarcia _H_ */
| [
"yamuna.maccarana@gmail.com"
] | yamuna.maccarana@gmail.com |
a3bade3d5ae5cd322e7198f8918c97207099cd2d | 1ee3e8c1387a0aea6011f3ee3e19ef6ccf790945 | /data/full.cpp | 35fa33a4d6047c2ac7ea8a47644918e03b032cd0 | [
"MIT"
] | permissive | ddemidov/paper_amgcl_reuse | ead25eb3644cbda5f64b86bbab5a36884372da10 | 80f40af01f079277d613c6266542b847054870bf | refs/heads/master | 2023-08-15T21:42:00.942511 | 2021-10-13T09:52:43 | 2021-10-13T09:52:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,977 | cpp | #include <iostream>
#include <sstream>
#include <memory>
#include <vector>
#include <tuple>
#include <boost/program_options.hpp>
#include <boost/property_tree/ptree.hpp>
#if defined(SOLVER_BACKEND_VEXCL)
# include <amgcl/backend/vexcl.hpp>
#else
# include <amgcl/backend/builtin.hpp>
#endif
#include <amgcl/make_solver.hpp>
#include <amgcl/amg.hpp>
#include <amgcl/relaxation/runtime.hpp>
#include <amgcl/coarsening/runtime.hpp>
#include <amgcl/solver/runtime.hpp>
#include <amgcl/adapter/crs_tuple.hpp>
#include <amgcl/profiler.hpp>
#include <amgcl/io/binary.hpp>
using amgcl::precondition;
namespace amgcl { profiler<> prof; }
using amgcl::prof;
//---------------------------------------------------------------------------
ptrdiff_t read_problem(int k,
std::vector<ptrdiff_t> &ptr,
std::vector<ptrdiff_t> &col,
std::vector<double> &val,
std::vector<double> &rhs
)
{
namespace io = amgcl::io;
std::ostringstream Afile, bfile;
Afile << "A-" << k << ".bin";
bfile << "b-" << k << ".bin";
ptrdiff_t rows, n, m;
io::read_crs(Afile.str(), rows, ptr, col, val);
io::read_dense(bfile.str(), n, m, rhs);
precondition(rows == n && m == 1, "Wrong input sizes");
return rows;
}
//---------------------------------------------------------------------------
int main(int argc, char *argv[]) {
namespace po = boost::program_options;
po::options_description desc("Options");
desc.add_options()
("help,h", "Show this help.")
(
"prm,p",
po::value<std::vector<std::string> >()->multitoken(),
"Parameters specified as name=value pairs. "
"May be provided multiple times. Examples:\n"
" -p solver.tol=1e-3\n"
" -p precond.coarse_enough=300"
)
(
"full-rebuild,f",
po::bool_switch()->default_value(false),
"Full rebuild on every iteration. "
)
(
"iter-limit,l",
po::value<int>()->default_value(10),
"Iteration limit. "
)
(
"init,i",
po::value<int>()->default_value(0),
"First input matrix"
)
(
"step,s",
po::value<int>()->default_value(1),
"Stride over input matrices"
)
;
po::positional_options_description p;
p.add("prm", -1);
po::variables_map vm;
po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);
po::notify(vm);
if (vm.count("help")) {
std::cout << desc << std::endl;
return 0;
}
boost::property_tree::ptree prm;
if (vm.count("prm")) {
for(const auto &v : vm["prm"].as<std::vector<std::string> >()) {
amgcl::put(prm, v);
}
}
int init = vm["init"].as<int>();
int step = vm["step"].as<int>();
int limit = vm["iter-limit"].as<int>();
bool rebuild = vm["full-rebuild"].as<bool>();
prm.put("precond.allow_rebuild", !rebuild);
// Define the backend and solver types:
#if defined(SOLVER_BACKEND_VEXCL)
typedef amgcl::backend::vexcl<double> Backend;
#else
typedef amgcl::backend::builtin<double> Backend;
#endif
Backend::params bprm;
#if defined(SOLVER_BACKEND_VEXCL)
vex::Context ctx(vex::Filter::Env);
bprm.q = ctx;
#endif
typedef amgcl::make_solver<
amgcl::amg<
Backend,
amgcl::runtime::coarsening::wrapper,
amgcl::runtime::relaxation::wrapper
>,
amgcl::runtime::solver::wrapper<Backend>
> Solver;
std::shared_ptr<Solver> solve;
int iters = 0;
double error;
size_t rows;
std::vector<ptrdiff_t> ptr, col;
std::vector<double> val, rhs;
for(int time = init, j = 0; ; time += step, ++j) {
// Read the next system
try {
auto t = prof.scoped_tic("reading");
rows = read_problem(time, ptr, col, val, rhs);
} catch(...) {
break;
}
auto A = std::make_shared<Solver::build_matrix>(std::tie(rows, ptr, col, val));
// Rebuild the solver, if necessary
bool full = false;
if ( rebuild || !solve || solve->size() != rows || iters > limit ) {
full = true;
auto t1 = prof.scoped_tic("amgcl");
auto t2 = prof.scoped_tic("setup");
solve = std::make_shared<Solver>(A, prm, bprm);
}
auto Ab = Backend::copy_matrix(A, bprm);
auto f = Backend::copy_vector(rhs, bprm);
auto x = Backend::create_vector(rows, bprm);
amgcl::backend::clear(*x);
// solve the problem:
{
auto t1 = prof.scoped_tic("amgcl");
auto t2 = prof.scoped_tic("solve");
std::tie(iters, error) = (*solve)(*Ab, *f, *x);
}
std::cout << time << "\t" << full << "\t" << iters << "\t" << error << std::endl;
}
std::cerr << prof << std::endl;
}
| [
"dennis.demidov@gmail.com"
] | dennis.demidov@gmail.com |
eb894c23e9a3680706b77c058643db8d89967fe9 | c84270479fbaf9318e1836132fc08ff46ab5ef16 | /mainwindow.cpp | ae2b414288a1cfb88c0203516ad7062756e50760 | [] | no_license | rybikson/QtPlanner | 8389ce7a480dfc953a133215cb817723d43ecb8a | b2607b13a275787d68f66b61b902415853c86d52 | refs/heads/master | 2021-01-22T07:28:01.643410 | 2013-09-13T01:22:30 | 2013-09-13T01:22:30 | 9,524,271 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,145 | cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
aboutWindow(0),
helpWindow(0),
settingsWindow(0),
theSet(0)
{
ui->setupUi(this);
mainlog("Start");
addEvents(ui->listWidget, 1);
addEvents(ui->listWidget_7, 7);
addEvents(ui->listWidget_30, 30);
ui->nowLabel->setText(QDateTime::currentDateTime().toString("dddd, d MMMM yyyy hh:mm"));
ui->statusBar->addWidget(ui->nowLabel);
}
void MainWindow::addEvents(QListWidget * list, int range)
{
mostCurrent = 0;
someEventInstances.clear();
if (theSet != 0)
delete(theSet);
theSet = new eventSet;
connect(theSet,SIGNAL(logmsg(QString)),this,SLOT(mainlog(QString)));
mostCurrent = theSet->fillData(someEventInstances, range);
for(unsigned int i=0; i < someEventInstances.size(); i++)
{
QListWidgetItem *item = new QListWidgetItem(list);
EventTemplate * event = new EventTemplate(someEventInstances.at(i) ,item);
connect(list,SIGNAL(destroyed()),event,SLOT(deleteLater()));
item->setSizeHint(QSize(310,70));
item->setBackgroundColor(QColor::fromRgb(250,230,230));
list->setItemWidget(item,event);
}
if (list->count() > mostCurrent) mostCurrent++;
list->setCurrentRow(mostCurrent);
theSet->deleteLater();
}
void MainWindow::mainlog(QString msg)
{
ui->textBrowser->append(msg);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_actionRefresh_triggered()
{
ui->listWidget->setCurrentRow(mostCurrent);
ui->listWidget->repaint();
}
void MainWindow::on_actionQuit_triggered()
{
QApplication::quit();
}
void MainWindow::on_actionAbout_triggered()
{
if (aboutWindow == 0)
aboutWindow = new About(this);
aboutWindow->show();
}
void MainWindow::on_actionHelp_triggered()
{
if (helpWindow == 0)
helpWindow = new Help(this);
helpWindow->show();
}
void MainWindow::on_actionSettings_triggered()
{
if (settingsWindow == 0)
settingsWindow = new Settings(this);
settingsWindow->show();
}
| [
"rybikson@gmail.com"
] | rybikson@gmail.com |
00f8914b0a81c3077347c44ac71e35b21195dc13 | e4ca4c1220e8b42e1f9a15f8425b9f5e2563e236 | /src/VisLink/VisLinkAPI.h | aa87afdd1d166abfd282b3bf07c3a8534ce5a649 | [] | no_license | dtorban/VisLink | caf295489f486beab9465457d94046e6171da7ba | 6f83ef400ae53cb021819793c1626fe82761f3e5 | refs/heads/master | 2020-12-06T04:10:57.868646 | 2020-05-05T20:26:10 | 2020-05-05T20:26:10 | 232,336,919 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 673 | h | #ifndef VISLINK_VISLINKAPI_H_
#define VISLINK_VISLINKAPI_H_
#include <iostream>
#include "VisLink/image/Texture.h"
#include "VisLink/display/TextureDisplay.h"
#include "VisLink/queue/MessageQueue.h"
#include "VisLink/sync/Semaphore.h"
namespace vislink {
class VisLinkAPI {
public:
virtual ~VisLinkAPI() {}
virtual void createSharedTexture(const std::string& name, const TextureInfo& info, int deviceIndex = 0) = 0;
virtual Texture getSharedTexture(const std::string& name, int deviceIndex = 0) = 0;
virtual MessageQueue* getMessageQueue(const std::string& name) = 0;
virtual Semaphore getSemaphore(const std::string& name, int deviceIndex = 0) = 0;
};
}
#endif | [
"dtorban@umn.edu"
] | dtorban@umn.edu |
e4318750555774e44bc5e63286f70d389c97ef89 | 986964ed8664fe7f1fa2bc718f2495c3646d7d9a | /include/slcc/matrix.hpp | 13747b9b4720e080359a5f2c8cad6a874213e363 | [] | no_license | purpleKarrot/slcc | 72d122817649f6716b4d6f2f46b751bfd70b9fc7 | 76f9ad5e24960ec6c51b2a95863c549bec2307d6 | refs/heads/master | 2021-01-19T12:04:12.262050 | 2010-04-29T06:45:48 | 2010-04-29T06:45:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,603 | hpp | /**************************************************************
* Copyright (c) 2008-2010 Daniel Pfeifer *
* *
* Distributed under the Boost Software License, Version 1.0. *
**************************************************************/
#ifndef SLCC_MATRIX_HPP
#define SLCC_MATRIX_HPP
#include "detail/matrix.hpp"
namespace sl
{
//! a 2x2 floating-point matrix
typedef sl::detail::matrix<float, 2, 2> mat2;
//! a 3x3 floating-point matrix
typedef sl::detail::matrix<float, 3, 3> mat3;
//! a 4x4 floating-point matrix
typedef sl::detail::matrix<float, 4, 4> mat4;
//! same as a mat2
typedef mat2 mat2x2;
//! a floating-point matrix with 2 columns and 3 rows
typedef sl::detail::matrix<float, 2, 3> mat2x3;
//! a floating-point matrix with 2 columns and 4 rows
typedef sl::detail::matrix<float, 2, 4> mat2x4;
//! a floating-point matrix with 3 columns and 2 rows
typedef sl::detail::matrix<float, 3, 2> mat3x2;
//! same as a mat3
typedef mat3 mat3x3;
//! a floating-point matrix with 3 columns and 4 rows
typedef sl::detail::matrix<float, 3, 4> mat3x4;
//! a floating-point matrix with 4 columns and 2 rows
typedef sl::detail::matrix<float, 4, 2> mat4x2;
//! a floating-point matrix with 4 columns and 3 rows
typedef sl::detail::matrix<float, 4, 3> mat4x3;
//! same as a mat4
typedef mat4 mat4x4;
//! a 2×2 double-precision floating-point matrix
typedef sl::detail::matrix<double, 2, 2> dmat2;
//! a 3×3 double-precision floating-point matrix
typedef sl::detail::matrix<double, 3, 3> dmat3;
//! a 4×4 double-precision floating-point matrix
typedef sl::detail::matrix<double, 4, 4> dmat4;
//! same as a dmat2
typedef dmat2 dmat2x2;
//! a double-precision floating-point matrix with 2 columns and 3 rows
typedef sl::detail::matrix<double, 2, 3> dmat2x3;
//! a double-precision floating-point matrix with 2 columns and 4 rows
typedef sl::detail::matrix<double, 2, 4> dmat2x4;
//! a double-precision floating-point matrix with 3 columns and 2 rows
typedef sl::detail::matrix<double, 3, 2> dmat3x2;
//! same as a dmat3
typedef dmat3 dmat3x3;
//! a double-precision floating-point matrix with 3 columns and 4 rows
typedef sl::detail::matrix<double, 3, 4> dmat3x4;
//! a double-precision floating-point matrix with 4 columns and 2 rows
typedef sl::detail::matrix<double, 4, 2> dmat4x2;
//! a double-precision floating-point matrix with 4 columns and 3 rows
typedef sl::detail::matrix<double, 4, 3> dmat4x3;
//! same as a dmat4
typedef dmat4 dmat4x4;
} //namespace sl
#endif /* SLCC_MATRIX_HPP */
| [
"daniel@pfeifer-mail.de"
] | daniel@pfeifer-mail.de |
3c505e6f88a9a924268d69fc397a975519a678b3 | d15eda6b4223e4cd7bf8868ee5ce37c31a1b1377 | /FaceTracker/app/src/main/cpp/DetectionBasedTracker_jni.cpp | b02718a089db4760a5d393f5f153037aa13978ef | [] | no_license | sweetdream779/FR-android-dlib-opencv | 18d76e2355f24dbd30e593cd47248015bc346cfc | 6ae2a424318e5b90880a4d988a18a7b7b97c1d00 | refs/heads/master | 2020-03-19T05:12:20.213793 | 2018-10-06T11:01:39 | 2018-10-06T11:01:39 | 135,909,239 | 0 | 0 | null | 2018-06-03T14:03:22 | 2018-06-03T14:03:21 | null | UTF-8 | C++ | false | false | 10,518 | cpp | #include "DetectionBasedTracker_jni.h"
#include <opencv2/core.hpp>
#include <opencv2/objdetect.hpp>
#include <string>
#include <vector>
#include <android/log.h>
#include <chrono>
#define LOG_TAG "OCV-DBasedT"
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
using namespace std;
using namespace cv;
inline void vector_Rect_to_Mat(vector<Rect>& v_rect, Mat& mat)
{
mat = Mat(v_rect, true);
}
class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
{
public:
CascadeDetectorAdapter(cv::Ptr<cv::CascadeClassifier> detector):
IDetector(),
Detector(detector)
{
LOGD("CascadeDetectorAdapter::Detect::Detect");
CV_Assert(detector);
}
void detect(const cv::Mat &Image, std::vector<cv::Rect> &objects)
//std::vector<Rect> detect(const cv::Mat &Image, std::vector<cv::Rect> &objects)
{
//LOGD("CascadeDetectorAdapter::Detect: begin");
//LOGD("CascadeDetectorAdapter::Detect: scaleFactor=%.2f, minNeighbours=%d, minObjSize=(%dx%d), maxObjSize=(%dx%d)", scaleFactor, minNeighbours, minObjSize.width, minObjSize.height, maxObjSize.width, maxObjSize.height);
LOGI("CascadeDetectorAdapter::Detect: begin");
//LOGI("CascadeDetectorAdapter::Detect: scaleFactor=%.2f, minNeighbours=%d, minObjSize=(%dx%d), maxObjSize=(%dx%d)", scaleFactor, minNeighbours, minObjSize.width, minObjSize.height, maxObjSize.width, maxObjSize.height);
//Detector->detectMultiScale(Image, objects, scaleFactor, minNeighbours, 0, minObjSize, maxObjSize);
//Detector->detectMultiScale(Image, objects, 1.1, 5, 0|CV_HAAR_SCALE_IMAGE, Size(), Size(1000,1000) );
//*********************************************************************
double const TH_weight=5.0;//Good empirical threshold values: 5-7
std::vector<int> reject_levels;
std::vector<double> weights;
std::vector<Rect> faces = {};
//std::vector<Rect> realfaces = {};
//Detector->detectMultiScale(Image, faces, reject_levels, weights, 1.1, 5, 0|CV_HAAR_SCALE_IMAGE, Size(), Size(1000,1000), true );
double scaleFactor = 1.1;
double minNeighbours = 5;
Detector->detectMultiScale(Image, faces, reject_levels, weights, scaleFactor, minNeighbours, 0|CV_HAAR_SCALE_IMAGE, Size(), Size(1000,1000), true );
LOGI("CascadeDetectorAdapter::Detect: scaleFactor=%.2f, minNeighbours=%d, TH_weight=%.2f", scaleFactor, minNeighbours, TH_weight);
int i=0;
for(vector<Rect>::const_iterator r = faces.begin(); r != faces.end(); r++, i++ ) {
LOGI("weights[i]:%f", weights[i]);
if (weights[i] >= TH_weight)//Good empirical threshold values: 5-7
{
//LOGI("weightsACCEPTED[i]:%f", weights[i]);
//realfaces.push_back(*r);
objects.push_back(*r);
}
}
LOGI("#realFaces: %i", (int)faces.size());
//return realfaces;*/
//*********************************************************************
//LOGD("CascadeDetectorAdapter::Detect: end");
LOGI("CascadeDetectorAdapter::Detect: end");
}
virtual ~CascadeDetectorAdapter()
{
//LOGD("CascadeDetectorAdapter::Detect::~Detect");
LOGI("CascadeDetectorAdapter::Detect::~Detect");
}
private:
CascadeDetectorAdapter();
cv::Ptr<cv::CascadeClassifier> Detector;
};
struct DetectorAgregator
{
cv::Ptr<CascadeDetectorAdapter> mainDetector;
cv::Ptr<CascadeDetectorAdapter> trackingDetector;
cv::Ptr<DetectionBasedTracker> tracker;
DetectorAgregator(cv::Ptr<CascadeDetectorAdapter>& _mainDetector, cv::Ptr<CascadeDetectorAdapter>& _trackingDetector):
mainDetector(_mainDetector),
trackingDetector(_trackingDetector)
{
CV_Assert(_mainDetector);
CV_Assert(_trackingDetector);
DetectionBasedTracker::Parameters DetectorParams;
tracker = makePtr<DetectionBasedTracker>(mainDetector, trackingDetector, DetectorParams);
}
};
JNIEXPORT jlong JNICALL Java_opencv_android_fdt_DetectionBasedTracker_nativeCreateObject
(JNIEnv * jenv, jclass, jstring jFileName, jint faceSize)
{
LOGD("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeCreateObject enter");
const char* jnamestr = jenv->GetStringUTFChars(jFileName, NULL);
string stdFileName(jnamestr);
jlong result = 0;
//LOGD("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeCreateObject");
LOGI("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeCreateObject");
try
{
cv::Ptr<CascadeDetectorAdapter> mainDetector = makePtr<CascadeDetectorAdapter>(
makePtr<CascadeClassifier>(stdFileName));
cv::Ptr<CascadeDetectorAdapter> trackingDetector = makePtr<CascadeDetectorAdapter>(
makePtr<CascadeClassifier>(stdFileName));
result = (jlong)new DetectorAgregator(mainDetector, trackingDetector);
if (faceSize > 0)
{
mainDetector->setMinObjectSize(Size(faceSize, faceSize));
trackingDetector->setMinObjectSize(Size(faceSize, faceSize));//uncommented
}
}
catch(cv::Exception& e)
{
//LOGD("nativeCreateObject caught cv::Exception: %s", e.what());
LOGI("nativeCreateObject caught cv::Exception: %s", e.what());
jclass je = jenv->FindClass("org/opencv/core/CvException");
if(!je)
je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, e.what());
}
catch (...)
{
//LOGD("nativeCreateObject caught unknown exception");
LOGI("nativeCreateObject caught unknown exception");
jclass je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, "Unknown exception in JNI code of DetectionBasedTrackerMOD.nativeCreateObject()");
return 0;
}
//LOGD("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeCreateObject exit");
LOGI("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeCreateObject exit");
return result;
}
JNIEXPORT void JNICALL Java_opencv_android_fdt_DetectionBasedTracker_nativeDestroyObject
(JNIEnv * jenv, jclass, jlong thiz)
{
LOGD("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeDestroyObject");
try
{
if(thiz != 0)
{
((DetectorAgregator*)thiz)->tracker->stop();
delete (DetectorAgregator*)thiz;
}
}
catch(cv::Exception& e)
{
LOGI("nativeDestroyObject caught cv::Exception: %s", e.what());
jclass je = jenv->FindClass("org/opencv/core/CvException");
if(!je)
je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, e.what());
}
catch (...)
{
LOGI("nativeDestroyObject caught unknown exception");
jclass je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, "Unknown exception in JNI code of DetectionBasedTrackerMOD.nativeDestroyObject()");
}
LOGI("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeDestroyObject exit");
}
JNIEXPORT void JNICALL Java_opencv_android_fdt_DetectionBasedTracker_nativeStart
(JNIEnv * jenv, jclass, jlong thiz)
{
LOGD("Java_opencv_android_fdt_DetectionBasedTracker_nativeStart");
try
{
((DetectorAgregator*)thiz)->tracker->run();
}
catch(cv::Exception& e)
{
LOGD("nativeStart caught cv::Exception: %s", e.what());
jclass je = jenv->FindClass("org/opencv/core/CvException");
if(!je)
je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, e.what());
}
catch (...)
{
LOGI("nativeStart caught unknown exception");
jclass je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, "Unknown exception in JNI code of DetectionBasedTrackerMOD.nativeStart()");
}
LOGI("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeStart exit");
}
JNIEXPORT void JNICALL Java_opencv_android_fdt_DetectionBasedTracker_nativeStop
(JNIEnv * jenv, jclass, jlong thiz)
{
LOGD("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeStop");
try
{
((DetectorAgregator*)thiz)->tracker->stop();
}
catch(cv::Exception& e)
{
LOGI("nativeStop caught cv::Exception: %s", e.what());
jclass je = jenv->FindClass("org/opencv/core/CvException");
if(!je)
je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, e.what());
}
catch (...)
{
LOGI("nativeStop caught unknown exception");
jclass je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, "Unknown exception in JNI code of DetectionBasedTrackerMOD.nativeStop()");
}
LOGI("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeStop exit");
}
JNIEXPORT void JNICALL Java_opencv_android_fdt_DetectionBasedTracker_nativeSetFaceSize
(JNIEnv * jenv, jclass, jlong thiz, jint faceSize)
{
LOGI("Java_opencv_android_fdt_DetectionBasedTrackerMOD_nativeSetFaceSize -- BEGIN");
try
{
if (faceSize > 0)
{
((DetectorAgregator*)thiz)->mainDetector->setMinObjectSize(Size(faceSize, faceSize));
((DetectorAgregator*)thiz)->trackingDetector->setMinObjectSize(Size(faceSize, faceSize));
}
}
catch(cv::Exception& e)
{
LOGI("nativeStop caught cv::Exception: %s", e.what());
jclass je = jenv->FindClass("org/opencv/core/CvException");
if(!je)
je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, e.what());
}
catch (...)
{
LOGI("nativeSetFaceSize caught unknown exception");
jclass je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, "Unknown exception in JNI code of DetectionBasedTracker.nativeSetFaceSize()");
}
LOGI("Java_opencv_android_fdt_DetectionBasedTracker_nativeSetFaceSize -- END");
}
JNIEXPORT void JNICALL Java_opencv_android_fdt_DetectionBasedTracker_nativeDetect
(JNIEnv * jenv, jclass, jlong thiz, jlong imageGray, jlong faces)
{
LOGD("Java_opencv_android_fdt_DetectionBasedTracker_nativeDetect");
auto start = std::chrono::high_resolution_clock::now();
try
{
vector<Rect> RectFaces;
((DetectorAgregator*)thiz)->tracker->process(*((Mat*)imageGray));
((DetectorAgregator*)thiz)->tracker->getObjects(RectFaces);
*((Mat*)faces) = Mat(RectFaces, true);
}
catch(cv::Exception& e)
{
LOGD("nativeCreateObject caught cv::Exception: %s", e.what());
jclass je = jenv->FindClass("org/opencv/core/CvException");
if(!je)
je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, e.what());
}
catch (...)
{
LOGD("nativeDetect caught unknown exception");
jclass je = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(je, "Unknown exception in JNI code DetectionBasedTracker.nativeDetect()");
}
LOGD("Java_opencv_android_fdt_DetectionBasedTracker_nativeDetect END");
}
| [
"Michela.DiVietro@lanit-tercom.com"
] | Michela.DiVietro@lanit-tercom.com |
3e1b2f29c4d989642f69d4fa80572ccb1bc561fa | 231c1d0f4aa22f61ba2bbd0d33a9c3bfd1f5e0b8 | /include/vvengine/engine.h | fe5859068e496a460d61c112cc74a7e8e2d33d98 | [
"MIT"
] | permissive | Yosshi999/voicevox_engine_cpp | 9baf2ebf2c12c0ffaca7bc0e554170ed02368a11 | 5fc845e7f03312791b3070754e59b43130596185 | refs/heads/main | 2023-08-31T17:49:17.528456 | 2021-09-27T13:35:01 | 2021-09-27T13:35:01 | 407,546,295 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 653 | h | #ifndef VVENGINE_ENGINE_H_
#define VVENGINE_ENGINE_H_
#ifndef MECAB_DIR
#define MECAB_DIR "./open_jtalk_dic_utf_8-1.11"
#endif
#include <memory>
#include <string>
#include <vector>
namespace vvengine {
constexpr const char* kMecabDir = MECAB_DIR;
constexpr const char* kCoreDir = "./";
class Engine {
public:
Engine();
~Engine();
bool Initialize(bool useCUDA);
void SetLogger(const std::shared_ptr<std::ostream>& os);
bool TextToSpeech(const char* textUtf8, long speakerId,
std::vector<float>& wave);
protected:
struct Impl;
std::unique_ptr<Impl> impl;
};
} // namespace vvengine
#endif // VVENGINE_ENGINE_H_ | [
"Yosshi999@users.noreply.github.com"
] | Yosshi999@users.noreply.github.com |
a69429f00ddf4168f413ea0eaabc330ab2867371 | 0b2fe9d47f98e81002423f46cf59618eef2808bf | /source/foo.cpp | 0abb5e2292c957d7ee1a8fa12f027acdf8b5d592 | [] | no_license | octopus-prime/gamma-ray | f5af0bc53db10d8aec7a14eff2ae8bcb3bd5c69d | cc179cb77ad9f6d29fcbdaef51f01ecbc79672e1 | refs/heads/master | 2020-05-30T14:04:51.265093 | 2015-10-22T17:02:55 | 2015-10-22T17:02:55 | 31,273,386 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,205 | cpp | /*
* foo.cpp
*
* Created on: 25.02.2015
* Author: mgresens
*/
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include <vector>
// --------------------------------------------------
typedef int vector_t;
typedef int ray_t;
class surface
{
public:
typedef int hit_t;
typedef std::vector<hit_t> hits_t;
protected:
virtual ~surface() noexcept = default;
public:
virtual hits_t::iterator hit(const ray_t& r, hits_t::iterator i) const noexcept = 0;
};
typedef boost::shared_ptr<surface> surface_t;
class sphere
:
public virtual surface
{
public:
virtual hits_t::iterator hit(const ray_t& r, hits_t::iterator i) const noexcept override
{
return i;
}
};
typedef boost::shared_ptr<sphere> sphere_t;
// --------------------------------------------------
template <typename T>
using basic_procedural_t = boost::function<T (vector_t)>;
typedef basic_procedural_t<double> noise_procedural_t;
typedef basic_procedural_t<vector_t> vector_procedural_t;
typedef basic_procedural_t<vector_t> color_procedural_t;
class texture
{
public:
vector_t pigment(const vector_t& point) const noexcept
{
return _pigment(point);
}
vector_t bump(const vector_t& point) const noexcept
{
return _bump(point);
}
double ambient(const vector_t& point) const noexcept
{
return _ambient(point);
}
private:
color_procedural_t _pigment;
vector_procedural_t _bump;
noise_procedural_t _ambient;
};
typedef boost::shared_ptr<texture> texture_t;
// --------------------------------------------------
class object;
typedef boost::shared_ptr<object> object_t;
class object
{
public:
typedef std::pair<int, const object*> hit_t;
typedef std::vector<hit_t> hits_t;
protected:
virtual ~object() noexcept = default;
public:
virtual hits_t::iterator hit(const ray_t& r, hits_t::iterator i) const noexcept = 0;
virtual texture_t texture() const noexcept = 0;
};
class primitive
:
public virtual object
{
public:
primitive(const surface_t& surface, const texture_t& texture) noexcept
:
_surface(surface),
_texture(texture)
{
}
virtual hits_t::iterator hit(const ray_t& r, hits_t::iterator i) const noexcept override
{
// TODO: how to delegate the space for surface hits by using the given space for the object hits.
// TODO: iterator adapter ?!
// transform
surface::hits_t h;
const auto e = _surface->hit(r, h.begin());
// transform
return std::transform(h.begin(), e, i, [this](const surface::hit_t& h){return std::make_pair(h, this);});
}
virtual texture_t texture() const noexcept override
{
return _texture;
}
private:
surface_t _surface;
texture_t _texture;
};
typedef boost::shared_ptr<primitive> primitive_t;
class csg
:
public virtual object
{
public:
virtual texture_t texture() const noexcept override
{
throw std::domain_error("foo");
}
protected:
csg(const object_t& object1, const object_t& object2) noexcept
:
_object1(object1),
_object2(object2)
{
}
object_t _object1;
object_t _object2;
};
typedef boost::shared_ptr<csg> csg_t;
class intersection
:
public csg
{
public:
intersection(const object_t& object1, const object_t& object2) noexcept
:
csg(object1, object2)
{
}
virtual hits_t::iterator hit(const ray_t& r, hits_t::iterator i) const noexcept override
{
// TODO: how to know the primitive objects here?!
const auto e1 = _object1->hit(r, i);
const auto e2 = _object2->hit(r, e1);
return e2;
}
};
typedef boost::shared_ptr<intersection> intersection_t;
void test()
{
const object_t object = boost::make_shared<intersection>
(
boost::make_shared<primitive>
(
boost::make_shared<sphere>(),
boost::make_shared<texture>()
),
boost::make_shared<primitive>
(
boost::make_shared<sphere>(),
boost::make_shared<texture>()
)
);
object::hits_t hits(100);
const object::hits_t::iterator begin = hits.begin();
const object::hits_t::iterator end = object->hit(ray_t(), begin);
std::for_each
(
begin, end,
[](const object::hit_t& hit)
{
const texture_t texture = hit.second->texture();
texture->pigment(0);
texture->bump(0);
texture->ambient(0);
}
);
}
| [
"mike.gresens@gmail.com"
] | mike.gresens@gmail.com |
64f38b8e8f78d801e20a03501d75e925b6773c4b | 7002f9baf2a838a4d148b1df221b2fb2dbcbcaaf | /MachineLearningPackage/agent/Mace_Learner.h | 80014e8589cd29f9eafe3c10981b85a5f441fd04 | [] | no_license | jainajinkya/Sejong_Dynamic_Control_Toolkit | 7edfd69696408a19fe95f4a5594e2767d25cc97e | 811d4ff64b89a06f6a8e1cc9dcf851163c8f06e1 | refs/heads/master | 2021-08-14T23:02:50.910091 | 2017-11-16T23:42:21 | 2017-11-16T23:42:21 | 111,034,351 | 0 | 0 | null | 2017-11-16T23:35:41 | 2017-11-16T23:35:41 | null | UTF-8 | C++ | false | false | 581 | h | #ifndef MACE_LEARNER
#define MACE_LEARNER
#include "Agent.h"
#include <environment/Mace.h>
#define DIM_ACTION 2
enum ActionSet{
Up = 0,
Right = 1,
Down = 2,
Left = 3,
Stay = 4,
NUM_ACT
};
class Mace_learner: public Agent{
public:
Mace_learner(Env_Mace* mace_env);
virtual ~Mace_learner();
protected:
void _DoTest(const sejong::Vector & ini_state);
void _getAction(int idx, sejong::Vector & action);
virtual double _FindMAX_Q(const sejong::Vector & state,
sejong::Vector & opt_action) = 0;
Env_Mace* mace_env_;
};
#endif
| [
"dk6587@utexas.edu"
] | dk6587@utexas.edu |
5c52a6021cc3f593b51c7195ac6c71987359713f | 8a7f709e05e2be9a184c69c174bd99cedfc1e467 | /Source/Renderer/Public/Vr/OpenVR/VrManagerOpenVR.h | 2f6ecd98dd8586b29848e384b8748fdd411abe53 | [
"MIT"
] | permissive | Just-D/unrimp | d2364c4a57f189eaf7e648410784bbf35a903cc2 | c1117cd80e2108d24a460fab48825d0441311e0f | refs/heads/master | 2021-05-22T00:47:38.523361 | 2020-01-08T11:56:46 | 2020-01-08T17:13:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,127 | h | /*********************************************************\
* Copyright (c) 2012-2020 The Unrimp Team
*
* 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.
\*********************************************************/
//[-------------------------------------------------------]
//[ Header guard ]
//[-------------------------------------------------------]
#pragma once
//[-------------------------------------------------------]
//[ Includes ]
//[-------------------------------------------------------]
#include "Renderer/Public/Vr/IVrManager.h"
#include "Renderer/Public/Resource/IResourceListener.h"
#include <Rhi/Public/Rhi.h>
#include <OpenVR/openvr.h>
// Disable warnings in external headers, we can't fix them
PRAGMA_WARNING_PUSH
PRAGMA_WARNING_DISABLE_MSVC(4774) // warning C4774: 'sprintf_s' : format string expected in argument 3 is not a string literal
#include <string>
PRAGMA_WARNING_POP
//[-------------------------------------------------------]
//[ Forward declarations ]
//[-------------------------------------------------------]
namespace Renderer
{
class SceneNode;
class IRenderer;
class OpenVRRuntimeLinking;
class IVrManagerOpenVRListener;
}
//[-------------------------------------------------------]
//[ Namespace ]
//[-------------------------------------------------------]
namespace Renderer
{
//[-------------------------------------------------------]
//[ Global definitions ]
//[-------------------------------------------------------]
typedef uint32_t MaterialResourceId; ///< POD material resource identifier
//[-------------------------------------------------------]
//[ Classes ]
//[-------------------------------------------------------]
class VrManagerOpenVR final : public IVrManager, public IResourceListener
{
//[-------------------------------------------------------]
//[ Friends ]
//[-------------------------------------------------------]
friend class RendererImpl;
//[-------------------------------------------------------]
//[ Public definitions ]
//[-------------------------------------------------------]
public:
static constexpr uint32_t TYPE_ID = STRING_ID("VrManagerOpenVR");
typedef std::vector<std::string> RenderModelNames;
//[-------------------------------------------------------]
//[ Public static methods ]
//[-------------------------------------------------------]
public:
[[nodiscard]] static AssetId albedoTextureIdToAssetId(vr::TextureID_t albedoTextureId);
//[-------------------------------------------------------]
//[ Public methods ]
//[-------------------------------------------------------]
public:
[[nodiscard]] inline IVrManagerOpenVRListener& getVrManagerOpenVRListener() const
{
// We know this pointer must always be valid
RHI_ASSERT(mRenderer.getContext(), nullptr != mVrManagerOpenVRListener, "Invalid VR manager OpenVR listener")
return *mVrManagerOpenVRListener;
}
RENDERER_API_EXPORT void setVrManagerOpenVRListener(IVrManagerOpenVRListener* vrManagerOpenVRListener); // Does not take over the control of the memory
[[nodiscard]] inline vr::IVRSystem* getVrSystem() const
{
return mVrSystem;
}
[[nodiscard]] inline MaterialResourceId getVrDeviceMaterialResourceId() const
{
return mVrDeviceMaterialResourceId;
}
[[nodiscard]] inline const RenderModelNames& getRenderModelNames() const
{
return mRenderModelNames;
}
[[nodiscard]] inline const vr::TrackedDevicePose_t& getVrTrackedDevicePose(vr::TrackedDeviceIndex_t trackedDeviceIndex) const
{
RHI_ASSERT(mRenderer.getContext(), trackedDeviceIndex < vr::k_unMaxTrackedDeviceCount, "Maximum tracked device count exceeded")
return mVrTrackedDevicePose[trackedDeviceIndex];
}
[[nodiscard]] inline const glm::mat4& getDevicePoseMatrix(vr::TrackedDeviceIndex_t trackedDeviceIndex) const
{
RHI_ASSERT(mRenderer.getContext(), trackedDeviceIndex < vr::k_unMaxTrackedDeviceCount, "Maximum tracked device count exceeded")
return mDevicePoseMatrix[trackedDeviceIndex];
}
//[-------------------------------------------------------]
//[ Public virtual Renderer::IVrManager methods ]
//[-------------------------------------------------------]
public:
[[nodiscard]] virtual VrManagerTypeId getVrManagerTypeId() const override;
[[nodiscard]] virtual bool isHmdPresent() const override;
virtual void setSceneResourceId(SceneResourceId sceneResourceId) override;
[[nodiscard]] virtual bool startup(AssetId vrDeviceMaterialAssetId) override;
[[nodiscard]] inline virtual bool isRunning() const override
{
return (nullptr != mVrSystem);
}
virtual void shutdown() override;
virtual void updateHmdMatrixPose(CameraSceneItem* cameraSceneItem) override;
[[nodiscard]] virtual glm::mat4 getHmdViewSpaceToClipSpaceMatrix(VrEye vrEye, float nearZ, float farZ) const override;
[[nodiscard]] virtual glm::mat4 getHmdEyeSpaceToHeadSpaceMatrix(VrEye vrEye) const override;
[[nodiscard]] inline virtual const glm::mat4& getHmdHeadSpaceToWorldSpaceMatrix() const override
{
return mHmdHeadSpaceToWorldSpaceMatrix;
}
[[nodiscard]] inline virtual const glm::mat4& getPreviousHmdHeadSpaceToWorldSpaceMatrix() const override
{
return mPreviousHmdHeadSpaceToWorldSpaceMatrix;
}
//[-------------------------------------------------------]
//[ Private virtual Renderer::IVrManager methods ]
//[-------------------------------------------------------]
private:
virtual void executeCompositorWorkspaceInstance(CompositorWorkspaceInstance& compositorWorkspaceInstance, Rhi::IRenderTarget& renderTarget, CameraSceneItem* cameraSceneItem, const LightSceneItem* lightSceneItem) override;
//[-------------------------------------------------------]
//[ Protected virtual Renderer::IResourceListener methods ]
//[-------------------------------------------------------]
protected:
virtual void onLoadingStateChange(const IResource& resource) override;
//[-------------------------------------------------------]
//[ Private methods ]
//[-------------------------------------------------------]
private:
explicit VrManagerOpenVR(IRenderer& renderer);
virtual ~VrManagerOpenVR() override;
explicit VrManagerOpenVR(const VrManagerOpenVR&) = delete;
VrManagerOpenVR& operator=(const VrManagerOpenVR&) = delete;
void setupRenderModelForTrackedDevice(vr::TrackedDeviceIndex_t unTrackedDeviceIndex);
//[-------------------------------------------------------]
//[ Private definitions ]
//[-------------------------------------------------------]
private:
struct Component final
{
std::string name;
SceneNode* sceneNode = nullptr; // TODO(co) No crazy raw-pointers
Component(const std::string& _name, SceneNode* _sceneNode) :
name(_name),
sceneNode(_sceneNode)
{};
};
typedef std::vector<Component> Components;
struct TrackedDeviceInformation final
{
std::string renderModelName;
Components components;
};
//[-------------------------------------------------------]
//[ Private data ]
//[-------------------------------------------------------]
private:
IRenderer& mRenderer; ///< Renderer instance, do not destroy the instance
IVrManagerOpenVRListener* mVrManagerOpenVRListener; ///< OpenVR manager listener, always valid, do not destroy the instance
bool mVrDeviceMaterialResourceLoaded;
MaterialResourceId mVrDeviceMaterialResourceId;
SceneResourceId mSceneResourceId;
SceneNode* mSceneNodes[vr::k_unMaxTrackedDeviceCount]; // TODO(co) No crazy raw-pointers
TrackedDeviceInformation mTrackedDeviceInformation[vr::k_unMaxTrackedDeviceCount];
OpenVRRuntimeLinking* mOpenVRRuntimeLinking;
vr::ETextureType mVrTextureType;
vr::IVRSystem* mVrSystem;
vr::IVRRenderModels* mVrRenderModels;
RenderModelNames mRenderModelNames;
bool mShowRenderModels;
// Transform
vr::TrackedDevicePose_t mVrTrackedDevicePose[vr::k_unMaxTrackedDeviceCount];
glm::mat4 mDevicePoseMatrix[vr::k_unMaxTrackedDeviceCount];
uint32_t mNumberOfValidDevicePoses;
glm::mat4 mHmdHeadSpaceToWorldSpaceMatrix;
glm::mat4 mPreviousHmdHeadSpaceToWorldSpaceMatrix;
// RHI resources
Rhi::ITexture2DPtr mColorTexture2D; ///< Color 2D texture, can be a null pointer
Rhi::IFramebufferPtr mFramebuffer; ///< Framebuffer object (FBO), can be a null pointer
};
//[-------------------------------------------------------]
//[ Namespace ]
//[-------------------------------------------------------]
} // Renderer
| [
"cofenberg@gmail.com"
] | cofenberg@gmail.com |
60bf68b53c7a5db746899c7242be230e55654664 | 64dd58f098af55c16a3121b2689c10893f07dc53 | /sources/sgtCore/src/log/LogSink.cpp | 0a119eda8c8ce50b5c05a9d38d4b8f5047eed351 | [] | no_license | roche-emmanuel/nervOct | 678ceb150f39ffe0e479a2532c43ef19296f721c | 75d3858599ecd7677b38061553f732dfaa8a1681 | refs/heads/master | 2021-01-11T18:26:17.539764 | 2015-02-26T19:07:59 | 2015-02-26T19:07:59 | 79,546,355 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,231 | cpp | #include <sgtcore.h>
#include "sgt/log/LogSink.h"
namespace sgt {
LogSink::LogSink(const std::string& name) {
setName(name);
_minLevel = -1;
_maxLevel = -1;
_logTraceList = false;
_enabled = true;
}
LogSink::~LogSink() {
}
/**
Set the internal level range values.
*/
void LogSink::setLevelRange(int mini, int maxi) {
_minLevel = mini;
_maxLevel = maxi;
}
/**
Add a new trace to the sink list.
*/
void LogSink::addTrace(std::string trace) {
_traceSet.insert(trace);
}
/**
Remove a given trace to the sink list.
*/
void LogSink::removeTrace(std::string trace) {
_traceSet.erase(_traceSet.find(trace));
}
void LogSink::setLogTraceList(bool enabled) {
_logTraceList = enabled;
}
/**
Process a given message on the LogSink object before output.
*/
void LogSink::process(int level, const std::string& trace, const std::string& msg) {
if(!_enabled)
return;
// check if we should process this level:
if((_minLevel >= 0 && level < _minLevel) || (_maxLevel >=0 && level > _maxLevel))
return;
bool hasTrace = (_traceSet.find(trace)!=_traceSet.end());
if((hasTrace && !_logTraceList) || (!hasTrace &&_logTraceList))
return;
// We may output the message here:
output(level,trace,msg);
}
} // namespace scLog
| [
"roche.emmanuel@gmail.com"
] | roche.emmanuel@gmail.com |
35592796de658d3f09cc55ae5cf1587897a97605 | 877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a | /app/src/main/cpp/dir521/dir3871/dir5864/file7700.cpp | db766a656a07616fac358b99e659afe8370b25e3 | [] | 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 | 111 | cpp | #ifndef file7700
#error "macro file7700 must be defined"
#endif
static const char* file7700String = "file7700"; | [
"tgeng@google.com"
] | tgeng@google.com |
b463092f13c38bdde45eda6c2e25699663831294 | ebfea37709e91365d41748f90e1831461ca7eae7 | /ClientFeederApplication.h | d897f5897b8af91a2d977690c6b162e8db0e349d | [] | no_license | ocarizr/Cpp-Project | 872e26b320e546ee1f3e978f0ea4a7ed07d77524 | d99082392559e793049b2770de557968c2a962b3 | refs/heads/master | 2021-02-16T10:03:34.081573 | 2020-03-23T21:42:12 | 2020-03-23T21:42:12 | 244,993,246 | 2 | 1 | null | 2020-03-23T21:42:13 | 2020-03-04T20:06:31 | C++ | UTF-8 | C++ | false | false | 2,181 | h | #ifndef CLIENTFEEDERAPPLICATION_H
#define CLIENTFEEDERAPPLICATION_H
#include <thread>
#include <assert.h>
#include "ChannelThreads.h"
class ClientFeederApplication
{
LogManager::Logger<std::shared_ptr<spdlog::logger>> m_logger;
ConfigManager::Configurations::AppConfig m_configs;
std::atomic_bool m_continue;
// Add others application parameters if necessary
public:
ClientFeederApplication(ClientFeederApplication&&) = delete;
ClientFeederApplication(const ClientFeederApplication&) = delete;
ClientFeederApplication &operator=(ClientFeederApplication&&) = delete;
ClientFeederApplication &operator=(const ClientFeederApplication&) = delete;
ClientFeederApplication(LogManager::Logger<std::shared_ptr<spdlog::logger>>& logger,
ConfigManager::Configurations::AppConfig& configs) :
m_logger(logger),
m_configs(configs),
m_continue(true)
{}
~ClientFeederApplication() {}
void Stop()
{
m_logger.LogInfo(m_logger.GetLogMessage("[%s] - Starting Close Application Process", __func__));
m_continue.store(false);
}
int Start()
{
int ret = 0;
try
{
auto channel_threads = ChannelThreads(m_configs.GetConfigurationMap(), m_logger);
#ifdef DEBUG_END_PROGRAM
int i = 0;
#endif
while (m_continue.load())
{
std::this_thread::sleep_for(std::chrono::seconds(10));
channel_threads.VerifyChannelHeatlh();
#ifdef DEBUG_END_PROGRAM
++i;
if(i == 10) Stop();
#endif
}
m_logger.LogInfo(m_logger.GetLogMessage("[%s] - Closing Application", __func__));
}
catch (std::exception& e)
{
char* what;
strcpy(what, e.what());
m_logger.LogError(m_logger.GetLogMessage("[%s] - %s", __func__, what));
ret = -1;
}
catch(...)
{
m_logger.LogError(m_logger.GetLogMessage("[%s] - Unknown Error", __func__));
ret = -1;
}
return ret;
}
};
#endif // CLIENTFEEDERAPPLICATION_H
| [
"rafael.ocariz90@gmail.com"
] | rafael.ocariz90@gmail.com |
d0e821f60b8ca74de607ad0928a7c80ce306e064 | 11ba676b2c8874682a93ed623bbe662ebdead91e | /c++ practice/自幂数(函数分离).cpp | 655d9b9e52e9edc727588b586daeec96af229548 | [] | no_license | lonelyhat/OI | b1bab664021763c8fdf6fb6ca89b2fb01755b78a | a7805b726eedea6a3351d5e2b0e52c14f2fe8bc7 | refs/heads/master | 2020-04-21T17:47:35.380320 | 2019-02-28T08:12:08 | 2019-02-28T08:12:08 | 169,747,509 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 467 | cpp | #include <iostream>
#include <cmath>
using namespace std;
void self(int y)
{ int start,end,m,digit,sum,_sum,i;
while(y>0)
{
start=pow(10,y-1);
end=pow(10,y)-1;
for(i=start;i<=end;i++)
{
m=i;
sum=0;
while(m!=0)
{
digit=m%10;
sum=sum+pow(digit,y);
m=m/10;
}
if(sum==i)
{
cout<<i<<" ";
}
}
break;
}
}
int main()
{
int n;
cin>>n;
self(n);
}
| [
"avalonglory@gmail.com"
] | avalonglory@gmail.com |
8d47ed583aa504886d70eab82d93d8d2eaf9bc38 | ed7d0283d086eb315d5c739dc994e60de2805d19 | /Classes/BirdFlightMenuScene.h | e0bbe233309ec24fe4964a1aa94f1436c04f7af3 | [] | no_license | rudy-alegrium/gameTest | 61b60c0c3bc91a2189d61c97680f4a230188efb1 | b1c1126f3bc34a5b3fbecd552bb341a2df7c9b95 | refs/heads/master | 2021-01-17T17:02:52.074148 | 2016-07-20T11:06:03 | 2016-07-20T11:06:03 | 63,214,592 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 324 | h | //
// BirdFlightMenuScene.h
// gameTest
//
// Created by Rudy Tan on 7/15/16.
//
//
#pragma once
#include "cocos2d.h"
class BirdFlightMenuScene : public cocos2d::Layer
{
public:
static cocos2d::Scene* createScene();
virtual bool init();
CREATE_FUNC(BirdFlightMenuScene);
void menuPlay(Ref* pSender);
}; | [
"rudy@alegrium.com"
] | rudy@alegrium.com |
9c113cb3a35bc9b1b061b4503b70ecdcb7be1838 | 814fd0bea5bc063a4e34ebdd0a5597c9ff67532b | /athena/extensions/athena_app_window_client_base.cc | ab0d5f0cafbec3da6516892da1505d61a21cec15 | [
"BSD-3-Clause"
] | permissive | rzr/chromium-crosswalk | 1b22208ff556d69c009ad292bc17dca3fe15c493 | d391344809adf7b4f39764ac0e15c378169b805f | refs/heads/master | 2021-01-21T09:11:07.316526 | 2015-02-16T11:52:21 | 2015-02-16T11:52:21 | 38,887,985 | 0 | 0 | NOASSERTION | 2019-08-07T21:59:20 | 2015-07-10T15:35:50 | C++ | UTF-8 | C++ | false | false | 1,850 | cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "athena/extensions/athena_app_window_client_base.h"
#include "athena/activity/public/activity_factory.h"
#include "athena/activity/public/activity_manager.h"
#include "athena/wm/public/window_list_provider.h"
#include "athena/wm/public/window_manager.h"
#include "extensions/common/extension.h"
#include "extensions/components/native_app_window/native_app_window_views.h"
namespace athena {
AthenaAppWindowClientBase::AthenaAppWindowClientBase() {
}
AthenaAppWindowClientBase::~AthenaAppWindowClientBase() {
}
extensions::NativeAppWindow* AthenaAppWindowClientBase::CreateNativeAppWindow(
extensions::AppWindow* app_window,
extensions::AppWindow::CreateParams* params) {
auto* native_window = new native_app_window::NativeAppWindowViews;
native_window->Init(app_window, *params);
ActivityFactory::Get()->CreateAppActivity(app_window->extension_id(),
native_window->web_view());
if (params->focused) {
// Windows are created per default at the top of the stack. If - at this
// point of initialization - it is has been moved into a different Z-order
// location we should respect this, not allowing the application activation
// to bring it to the front. This can happen as part of the resource
// manager's reloading or intelligent preloading of an application.
const aura::Window::Windows& list =
WindowManager::Get()->GetWindowListProvider()->GetWindowList();
aura::Window* native_app_window =
native_window->widget()->GetNativeWindow();
params->focused = !list.size() || list.back() == native_app_window;
}
return native_window;
}
} // namespace athena
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
267d926527f2b90a21ba2863ebde2aa203d0523e | 4c851856eb25f4d20ef95ccd98c2a331b90d22bb | /Unreal/UnTexture2.cpp | 34ed5a4480cffe0d66996848848bcfc5a19dc5e0 | [] | no_license | chaomengnan/UModel | a6d00cf768bc7ed949b94fbf3c37dd099f0279d5 | 03d2b5430cfb08eac876a149381cc4e1e851c901 | refs/heads/master | 2021-01-21T19:13:53.722324 | 2014-12-26T18:26:06 | 2014-12-26T18:26:06 | 28,818,785 | 1 | 1 | null | 2015-01-05T15:37:55 | 2015-01-05T15:37:55 | null | UTF-8 | C++ | false | false | 15,549 | cpp | #include "Core.h"
#include "UnCore.h"
#include "UnObject.h"
#include "UnMaterial.h"
#include "UnMaterial2.h"
#include "UnPackage.h"
//#define XPR_DEBUG 1
/*-----------------------------------------------------------------------------
UTexture (Unreal engine 1 and 2)
-----------------------------------------------------------------------------*/
void UTexture::Serialize(FArchive &Ar)
{
guard(UTexture::Serialize);
Super::Serialize(Ar);
#if BIOSHOCK
TRIBES_HDR(Ar, 0x2E);
if (Ar.Game == GAME_Bioshock && t3_hdrSV >= 1)
Ar << CachedBulkDataSize;
if (Ar.Game == GAME_Bioshock && Format == 12) // remap format; note: Bioshock used 3DC name, but real format is DXT5N
Format = TEXF_DXT5N;
#endif // BIOSHOCK
#if SWRC
if (Ar.Game == GAME_RepCommando)
{
if (Format == 14) Format = TEXF_CxV8U8; //?? not verified
}
#endif // SWRC
#if VANGUARD
if (Ar.Game == GAME_Vanguard && Ar.ArVer >= 128 && Ar.ArLicenseeVer >= 25)
{
// has some table for fast mipmap lookups
Ar.Seek(Ar.Tell() + 142); // skip that table
// serialize mips using AR_INDEX count (this game uses int for array counts in all other places)
int Count;
Ar << AR_INDEX(Count);
Mips.Add(Count);
for (int i = 0; i < Count; i++)
Ar << Mips[i];
return;
}
#endif // VANGUARD
#if AA2
if (Ar.Game == GAME_AA2 && Ar.ArLicenseeVer >= 8)
{
int unk; // always 10619
Ar << unk;
}
#endif // AA2
Ar << Mips;
if (Ar.Engine() == GAME_UE1)
{
// UE1
bMasked = false; // ignored by UE1, used surface.PolyFlags instead (but UE2 ignores PolyFlags ...)
if (bHasComp) // skip compressed mipmaps
{
TArray<FMipmap> CompMips;
Ar << CompMips;
}
}
#if XIII
if (Ar.Game == GAME_XIII)
{
if (Ar.ArLicenseeVer >= 42)
{
// serialize palette
if (Format == TEXF_P8 || Format == 13) // 13 == TEXF_P4
{
assert(!Palette);
Palette = new UPalette;
Ar << Palette->Colors;
}
}
if (Ar.ArLicenseeVer >= 55)
Ar.Seek(Ar.Tell() + 3);
}
#endif // XIII
#if EXTEEL
if (Ar.Game == GAME_Exteel)
{
// note: this property is serialized as UObject's property too
byte MaterialType; // enum GFMaterialType
Ar << MaterialType;
}
#endif // EXTEEL
unguard;
}
#if UC2
struct XprEntry
{
char Name[64];
int DataOffset;
int DataSize;
};
struct XprInfo
{
const CGameFileInfo *File;
TArray<XprEntry> Items;
int DataStart;
};
static TArray<XprInfo> xprFiles;
static bool ReadXprFile(const CGameFileInfo *file)
{
guard(ReadXprFile);
FArchive *Ar = appCreateFileReader(file);
int Tag, FileLen, DataStart, DataCount;
*Ar << Tag << FileLen << DataStart << DataCount;
//?? "XPR0" - xpr variant with a single object (texture) inside
if (Tag != BYTES4('X','P','R','1'))
{
#if XPR_DEBUG
appPrintf("Unknown XPR tag in %s\n", file->RelativeName);
#endif
delete Ar;
return true;
}
#if XPR_DEBUG
appPrintf("Scanning %s ...\n", file->RelativeName);
#endif
XprInfo *Info = new(xprFiles) XprInfo;
Info->File = file;
Info->DataStart = DataStart;
// read filelist
int i;
for (i = 0; i < DataCount; i++)
{
int NameOffset, DataOffset;
*Ar << NameOffset << DataOffset;
int savePos = Ar->Tell();
Ar->Seek(NameOffset + 12);
// read name
char c, buf[256];
int n = 0;
while (true)
{
*Ar << c;
if (n < ARRAY_COUNT(buf))
buf[n++] = c;
if (!c) break;
}
buf[ARRAY_COUNT(buf)-1] = 0; // just in case
// create item
XprEntry *Entry = new(Info->Items) XprEntry;
appStrncpyz(Entry->Name, buf, ARRAY_COUNT(Entry->Name));
Entry->DataOffset = DataOffset + 12;
assert(Entry->DataOffset < DataStart);
// seek back
Ar->Seek(savePos);
// setup size of previous item
if (i >= 1)
{
XprEntry *PrevEntry = &Info->Items[i - 1];
PrevEntry->DataSize = Entry->DataOffset - PrevEntry->DataOffset;
}
// setup size of the last item
if (i == DataCount - 1)
Entry->DataSize = DataStart - Entry->DataOffset;
}
// scan data
// data block is either embedded in this block or followed after DataStart position
for (i = 0; i < DataCount; i++)
{
XprEntry *Entry = &Info->Items[i];
#if XPR_DEBUG
// appPrintf(" %08X [%08X] %s\n", Entry->DataOffset, Entry->DataSize, Entry->Name);
#endif
Ar->Seek(Entry->DataOffset);
int id;
*Ar << id;
switch (id)
{
case 0x80020001:
// header is 4 dwords + immediately followed data
Entry->DataOffset += 4 * 4;
Entry->DataSize -= 4 * 4;
break;
case 0x00040001:
// header is 5 dwords + external data
{
int pos;
*Ar << pos;
Entry->DataOffset = DataStart + pos;
}
break;
case 0x00020001:
// header is 4 dwords + external data
{
int d1, d2, pos;
*Ar << d1 << d2 << pos;
Entry->DataOffset = DataStart + pos;
}
break;
default:
// header is 2 dwords - offset and size + external data
{
int pos;
*Ar << pos;
Entry->DataOffset = DataStart + pos;
}
break;
}
}
// setup sizes of blocks placed after DataStart (not embedded into file list)
for (i = 0; i < DataCount; i++)
{
XprEntry *Entry = &Info->Items[i];
if (Entry->DataOffset < DataStart) continue; // embedded data
// Entry points to a data block placed after DataStart position
// we should find a next block
int NextPos = FileLen;
for (int j = i + 1; j < DataCount; j++)
{
XprEntry *NextEntry = &Info->Items[j];
if (NextEntry->DataOffset < DataStart) continue; // embedded data
NextPos = NextEntry->DataOffset;
break;
}
Entry->DataSize = NextPos - Entry->DataOffset;
}
#if XPR_DEBUG
for (i = 0; i < DataCount; i++)
{
XprEntry *Entry = &Info->Items[i];
appPrintf(" %3d %08X [%08X] .. %08X %s\n", i, Entry->DataOffset, Entry->DataSize, Entry->DataOffset + Entry->DataSize, Entry->Name);
}
#endif
delete Ar;
return true;
unguardf("%s", file->RelativeName);
}
byte *FindXprData(const char *Name, int *DataSize)
{
// scan xprs
static bool ready = false;
if (!ready)
{
ready = true;
appEnumGameFiles(ReadXprFile, "xpr");
}
// find a file
for (int i = 0; i < xprFiles.Num(); i++)
{
XprInfo *Info = &xprFiles[i];
for (int j = 0; j < Info->Items.Num(); j++)
{
XprEntry *File = &Info->Items[j];
if (strcmp(File->Name, Name) == 0)
{
// found
appPrintf("Loading stream %s from %s (%d bytes)\n", Name, Info->File->RelativeName, File->DataSize);
FArchive *Reader = appCreateFileReader(Info->File);
Reader->Seek(File->DataOffset);
byte *buf = (byte*)appMalloc(File->DataSize);
Reader->Serialize(buf, File->DataSize);
delete Reader;
if (DataSize) *DataSize = File->DataSize;
return buf;
}
}
}
appPrintf("WARNING: external stream %s was not found\n", Name);
if (DataSize) *DataSize = 0;
return NULL;
}
#endif // UC2
#if BIOSHOCK
//#define DUMP_BIO_CATALOG 1
//#define DEBUG_BIO_BULK 1
struct BioBulkCatalogItem
{
FString ObjectName;
FString PackageName;
int f10; // always 0
int DataOffset;
int DataSize;
int DataSize2; // the same as DataSize
int f20;
friend FArchive& operator<<(FArchive &Ar, BioBulkCatalogItem &S)
{
Ar << S.ObjectName << S.PackageName << S.f10 << S.DataOffset << S.DataSize << S.DataSize2 << S.f20;
assert(S.f10 == 0);
// assert(S.DataSize == S.DataSize2); -- the same on PC, but not the same on XBox360
#if DUMP_BIO_CATALOG
appPrintf(" %s / %s - %08X:%08X %X %X %X\n", *S.ObjectName, *S.PackageName, S.f10, S.DataOffset, S.DataSize, S.DataSize2, S.f20);
#endif
return Ar;
}
};
struct BioBulkCatalogFile
{
int64 f0;
FString Filename;
TArray<BioBulkCatalogItem> Items;
friend FArchive& operator<<(FArchive &Ar, BioBulkCatalogFile &S)
{
Ar << S.f0 << S.Filename;
#if DUMP_BIO_CATALOG
appPrintf("<<< %s >>>\n", *S.Filename);
#endif
Ar << S.Items;
#if DEBUG_BIO_BULK
int minS2 = 99999999, maxS2 = -99999999, min20 = 99999999, max20 = -99999999;
for (int i = 0; i < S.Items.Num(); i++)
{
int n1 = S.Items[i].DataSize2;
if (n1 < minS2) minS2 = n1;
if (n1 > maxS2) maxS2 = n1;
int n2 = S.Items[i].f20;
if (n2 < min20) min20 = n1;
if (n2 > max20) max20 = n1;
}
appPrintf("DS2=%X..%X f20=%X..%X", minS2, maxS2, min20, max20);
#endif // DEBUG_BIO_BULK
return Ar;
}
};
struct BioBulkCatalog
{
byte Endian; //?? or Platform: 0=PC, 1=XBox360, 2=PS3?
int64 f4;
int fC;
TArray<BioBulkCatalogFile> Files;
friend FArchive& operator<<(FArchive &Ar, BioBulkCatalog &S)
{
Ar << S.Endian;
if (S.Endian) Ar.ReverseBytes = true;
Ar << S.f4 << S.fC << S.Files;
return Ar;
}
};
static TArray<BioBulkCatalog> bioCatalog;
static bool BioReadBulkCatalogFile(const CGameFileInfo *file)
{
guard(BioReadBulkCatalogFile);
FArchive *Ar = appCreateFileReader(file);
// setup for reading Bioshock data
Ar->ArVer = 141;
Ar->ArLicenseeVer = 0x38;
Ar->Game = GAME_Bioshock;
// serialize
appPrintf("Reading %s\n", file->RelativeName);
BioBulkCatalog *cat = new (bioCatalog) BioBulkCatalog;
*Ar << *cat;
// finalize
delete Ar;
return true;
unguardf("%s", file->RelativeName);
}
static void BioReadBulkCatalog()
{
static bool ready = false;
if (ready) return;
ready = true;
appEnumGameFiles(BioReadBulkCatalogFile, "bdc");
if (!bioCatalog.Num()) appPrintf("WARNING: no *.bdc files found\n");
}
static byte *FindBioTexture(const UTexture *Tex)
{
int needSize = Tex->CachedBulkDataSize & 0xFFFFFFFF;
#if DEBUG_BIO_BULK
appPrintf("Search for ... %s (size=%X)\n", Tex->Name, needSize);
#endif
BioReadBulkCatalog();
for (int i = 0; i < bioCatalog.Num(); i++)
{
BioBulkCatalog &Cat = bioCatalog[i];
for (int j = 0; j < Cat.Files.Num(); j++)
{
const BioBulkCatalogFile &File = Cat.Files[j];
for (int k = 0; k < File.Items.Num(); k++)
{
const BioBulkCatalogItem &Item = File.Items[k];
if (!strcmp(Tex->Name, Item.ObjectName))
{
if (abs(needSize - Item.DataSize) > 0x4000) // differs in 16k
{
#if DEBUG_BIO_BULK
appPrintf("... Found %s in %s with wrong BulkDataSize %X (need %X)\n", Tex->Name, *File.Filename, Item.DataSize, needSize);
#endif
continue;
}
#if DEBUG_BIO_BULK
appPrintf("... Found %s in %s at %X size %X (%dx%d fmt=%d bpp=%g strip:%d mips:%d)\n", Tex->Name, *File.Filename, Item.DataOffset, Item.DataSize,
Tex->USize, Tex->VSize, Tex->Format, (float)Item.DataSize / (Tex->USize * Tex->VSize),
Tex->HasBeenStripped, Tex->StrippedNumMips);
#endif
// found
const CGameFileInfo *bulkFile = appFindGameFile(File.Filename);
if (!bulkFile)
{
// no bulk file
appPrintf("Decompressing %s: %s is missing\n", Tex->Name, *File.Filename);
return NULL;
}
appPrintf("Reading %s mip level %d (%dx%d) from %s\n", Tex->Name, 0, Tex->USize, Tex->VSize, bulkFile->RelativeName);
FArchive *Reader = appCreateFileReader(bulkFile);
Reader->Seek(Item.DataOffset);
byte *buf = (byte*)appMalloc(max(Item.DataSize, needSize));
Reader->Serialize(buf, Item.DataSize);
delete Reader;
return buf;
}
}
}
}
#if DEBUG_BIO_BULK
appPrintf("... Bulk for %s was not found\n", Tex->Name);
#endif
return NULL;
}
#endif // BIOSHOCK
bool UTexture::GetTextureData(CTextureData &TexData) const
{
guard(UTexture::GetTextureData);
TexData.Platform = PLATFORM_PC;
TexData.OriginalFormatEnum = Format;
TexData.OriginalFormatName = EnumToName("ETextureFormat", Format);
TexData.Obj = this;
TexData.Palette = Palette;
// process external sources for some games
#if BIOSHOCK
if (Package && Package->Game == GAME_Bioshock && CachedBulkDataSize) //?? check bStripped or Baked ?
{
TexData.CompressedData = FindBioTexture(this); // may be NULL
TexData.ShouldFreeData = (TexData.CompressedData != NULL);
TexData.USize = USize;
TexData.VSize = VSize;
TexData.DataSize = CachedBulkDataSize;
TexData.Platform = Package->Platform;
}
#endif // BIOSHOCK
#if UC2
if (Package && Package->Engine() == GAME_UE2X)
{
// try to find texture inside XBox xpr files
TexData.CompressedData = FindXprData(Name, &TexData.DataSize);
TexData.ShouldFreeData = (TexData.CompressedData != NULL);
TexData.USize = USize;
TexData.VSize = VSize;
}
#endif // UC2
if (!TexData.CompressedData)
{
// texture was not taken from external source
for (int n = 0; n < Mips.Num(); n++)
{
// find 1st mipmap with non-null data array
// reference: DemoPlayerSkins.utx/DemoSkeleton have null-sized 1st 2 mips
const FMipmap &Mip = Mips[n];
if (!Mip.DataArray.Num())
continue;
TexData.CompressedData = &Mip.DataArray[0];
TexData.USize = Mip.USize;
TexData.VSize = Mip.VSize;
TexData.DataSize = Mip.DataArray.Num();
break;
}
}
ETexturePixelFormat intFormat;
//?? return old code back - UE1 and UE2 differs in codes 6 and 7 only
if (Package && (Package->Engine() == GAME_UE1))
{
// UE1 has different ETextureFormat layout
switch (Format)
{
case 0:
intFormat = TPF_P8;
break;
// case 1:
// intFormat = TPF_RGB32; // in script source code: TEXF_RGB32, but TEXF_RGBA7 in .h
// break;
// case 2:
// intFormat = TPF_RGB64; // in script source code: TEXF_RGB64, but TEXF_RGB16 in .h
// break;
case 3:
intFormat = TPF_DXT1;
break;
case 4:
intFormat = TPF_RGB8;
break;
case 5:
intFormat = TPF_BGRA8;
break;
// newer UE1 versions has DXT3 and DXT5
case 6:
intFormat = TPF_DXT3;
break;
case 7:
intFormat = TPF_DXT5;
break;
default:
appNotify("Unknown UE1 texture format: %d", Format);
return false;
}
}
else
{
// UE2
switch (Format)
{
case TEXF_P8:
intFormat = TPF_P8;
break;
case TEXF_DXT1:
intFormat = TPF_DXT1;
break;
case TEXF_RGB8:
intFormat = TPF_RGB8;
break;
case TEXF_RGBA8:
intFormat = TPF_BGRA8;
break;
case TEXF_DXT3:
intFormat = TPF_DXT3;
break;
case TEXF_DXT5:
intFormat = TPF_DXT5;
break;
case TEXF_L8:
intFormat = TPF_G8;
break;
case TEXF_CxV8U8:
intFormat = TPF_V8U8_2;
break;
case TEXF_DXT5N:
intFormat = TPF_DXT5N;
break;
case TEXF_3DC:
intFormat = TPF_BC5;
break;
default:
appNotify("Unknown UE2 texture format: %s (%d)", TexData.OriginalFormatName, Format);
return false;
}
}
TexData.Format = intFormat;
#if BIOSHOCK && SUPPORT_XBOX360
if (TexData.CompressedData && TexData.Platform == PLATFORM_XBOX360)
TexData.DecodeXBox360();
#endif
#if BIOSHOCK
if (Package && Package->Game == GAME_Bioshock)
{
// This game has DataSize stored for all mipmaps, we should compute side of 1st mipmap
// in order to accept this value when uploading texture to video card (some vendors rejects
// large values)
//?? Place code to CTextureData method?
const CPixelFormatInfo &Info = PixelFormatInfo[intFormat];
int bytesPerBlock = Info.BytesPerBlock;
int numBlocks = TexData.USize * TexData.VSize / (Info.BlockSizeX * Info.BlockSizeY); // used for validation only
int requiredDataSize = numBlocks * Info.BytesPerBlock;
if (requiredDataSize > TexData.DataSize)
{
appNotify("Bioshock texture %s: data too small; %dx%d, requires %X bytes, got %X\n",
Name, TexData.USize, TexData.VSize, requiredDataSize, TexData.DataSize);
}
else if (requiredDataSize < TexData.DataSize)
{
// appPrintf("Bioshock texture %s: stripping data size from %X to %X\n", Name, TexData.DataSize, requiredDataSize);
TexData.DataSize = requiredDataSize;
}
}
#endif // BIOSHOCK
return (TexData.CompressedData != NULL);
unguardf("%s", Name);
}
| [
"git@gildor.org"
] | git@gildor.org |
6c8af393b48e63cc786fd54e4c6fddbd55f6a173 | 00f9b1467b3f9810c1c30ef0e7917291d517d179 | /PixelArtsauceda/mainwindow.h | 7c061a213b3c50f7bbc378bcbb1d51ad34fcec46 | [] | no_license | carlosatx/pixel | 1dd4cfa766326b42eb3ab4a11e1daa60bb6300ff | 507fd2e72a2de867ac3a6863ebfb9d58cb3dc555 | refs/heads/master | 2021-01-21T20:16:14.165921 | 2017-05-23T21:55:04 | 2017-05-23T21:55:04 | 92,211,386 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,268 | h | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QFileDialog>
#include<qdebug.h>
#include <QString>
#include <QImage>
#include "pixelize.h"
#include "pixelcube.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0); //--- constructor
~MainWindow(); //--- destructor
private slots:
void on_btnLoad_clicked(); //-- click handler for load button
void on_btnSave_clicked(); //-- click handler for save button
void on_btnExit_clicked(); //-- click handler for exit button
void on_btnPixelize_clicked(); //-- click handler for pixelize button
void on_cubeSizeSlider_valueChanged(int); //--- value cahnge handler for slider
void on_btnArt_clicked(); //-- click handler for art it button
private:
Ui::MainWindow *m_pUI; //-- pointer of GUI main window
int m_cubeSize = 5; //-- input from user for the size of each pixel
QImage m_image; //-- for new image after pixelize
QImage m_initialImage; //-- for initial image
Pixelize m_pix; //-- for each new pixel size
};
#endif // MAINWINDOW_H
| [
"noreply@github.com"
] | noreply@github.com |
e2a35cb2e7d0cf20ffdcc518b430e6d2a2c65c3d | 698fdd89c39eb22930075006a438136244932f7e | /src/engine/query.cpp | 0ed34013b36b3f9f27724487c87aa3e0b7cba6ff | [] | no_license | Exr0nProjects/foxstr | f0ede39c73fcc34b7a9ff522228d586a0903ca03 | 5bf4eb8c7f2cef4aa0c643cfcb6309c719b23b12 | refs/heads/master | 2023-01-02T08:22:08.782359 | 2020-10-20T01:41:55 | 2020-10-20T01:41:55 | 305,542,955 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 63 | cpp | #include "query.hpp"
void Query::parseChar(char c) {} // TODO
| [
"spotyie@gmail.com"
] | spotyie@gmail.com |
3d25218002b2eb568458b313df0bd85f69d4894a | 0222e9cb2dea599e4bad161674d96a80686b4a3e | /LatencySample/private/ServerPositionProvider.h | 5699da24e6032e5e4016bf99a579df8dde8caf8c | [] | no_license | Ilod/enjmin-latency | 9153f765da735590abcdcb5d08abf3c63709b2b3 | 981d9398bf336d1ba15143c306f48b322627657b | refs/heads/master | 2020-05-09T19:50:20.459388 | 2019-04-13T12:01:59 | 2019-04-17T03:36:30 | 181,388,849 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,543 | h | #pragma once
#include "IPositionProvider.h"
#include "SFML/Network.hpp"
class ServerPositionProvider : public IPositionProvider
{
public:
ServerPositionProvider(std::unique_ptr<IPositionProvider> _provider, float _networkUpdateTime);
void update(float _dt) override final;
sf::Vector2f getPosition() const override final { return m_provider->getPosition(); }
sf::Color getFillColor() const override final { return m_provider->getFillColor(); }
sf::Color getBorderColor() const override final { return m_provider->getBorderColor(); }
private:
virtual void updateServer() = 0;
virtual void sendPacket(const sf::Packet& _packet) = 0;
std::unique_ptr<IPositionProvider> m_provider;
sf::Color m_previousFillColor;
sf::Color m_previousBorderColor;
float m_networkUpdateTime = 0;
sf::Clock m_networkUpdateClock;
};
class TcpServerPositionProvider : public ServerPositionProvider
{
public:
TcpServerPositionProvider(std::uint16_t _port, std::unique_ptr<IPositionProvider> _provider, float _networkUpdateTime);
private:
void updateServer() override;
void sendPacket(const sf::Packet& _packet) override;
sf::TcpListener m_listener;
std::vector<std::unique_ptr<sf::TcpSocket>> m_sockets;
};
class UdpServerPositionProvider : public ServerPositionProvider
{
public:
UdpServerPositionProvider(std::uint16_t _port, std::unique_ptr<IPositionProvider> _provider, float _networkUpdateTime);
private:
void updateServer() override;
void sendPacket(const sf::Packet& _packet) override;
sf::UdpSocket m_socket;
std::uint16_t m_port;
}; | [
"rudy.pons@ilod.org"
] | rudy.pons@ilod.org |
9fb5dd217f4a93950b38fbd12db4abfedec237cc | 0e948200ec5bbe8455035984e321ace595304a7e | /10082 - WERTYU.cpp | 0f98d00e76252339cc1dd04b5fc725bc9bc37178 | [] | no_license | MASYAM/uva-sloved | 5610ee6fb06e529eabab4d753a4ecb1219079f6f | 8f6496401b1a74331335a86415ccec9f65e53dba | refs/heads/master | 2021-01-10T17:00:33.219613 | 2020-02-23T11:50:03 | 2020-02-23T11:50:03 | 43,936,799 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 586 | cpp | #include<iostream>
using namespace std;
int main()
{
int n,i,a,b,case_no,total;
while(cin>>n)
{
case_no = 0;
while(n>0)
{
case_no++;
total = 0;
cin>>a;
cin>>b;
for(i=a;i<=b;i++)
{
if(i%2!=0)
{
total += i;
}
}
cout<<"Case "<<case_no<<": "<<total<<endl;
n--;
}
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
9e7954260de6a1139bdcef60fa8f305d0afea8d3 | 4a3ca65ba2228c20e3f04f3ab1538dd00f87e976 | /src/test/coins_tests.cpp | c35262c21083be361a3f87891b2e513aab2dc747 | [
"MIT"
] | permissive | bonoproject/Bonorum | dd5b29a80b41a8e9fc0e0311b11730b5bf6fb3c2 | d0dede6c416b812398a6c88cb2f54dad049c932e | refs/heads/master | 2020-12-20T16:41:40.978500 | 2020-06-08T12:04:16 | 2020-06-08T12:04:16 | 236,138,813 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 9,115 | cpp | // Copyright (c) 2014 The Bitcoin Core developers
// Copyright (c) 2019 The PIVX developers
// Copyright (c) 2020 The BonorumCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "coins.h"
#include "script/standard.h"
#include "uint256.h"
#include "utilstrencodings.h"
#include "test/test_bonorumcoin.h"
#include <vector>
#include <map>
#include <boost/test/unit_test.hpp>
namespace
{
class CCoinsViewTest : public CCoinsView
{
uint256 hashBestBlock_;
std::map<uint256, CCoins> map_;
public:
bool GetCoins(const uint256& txid, CCoins& coins) const
{
std::map<uint256, CCoins>::const_iterator it = map_.find(txid);
if (it == map_.end()) {
return false;
}
coins = it->second;
if (coins.IsPruned() && InsecureRandBool() == 0) {
// Randomly return false in case of an empty entry.
return false;
}
return true;
}
bool HaveCoins(const uint256& txid) const
{
CCoins coins;
return GetCoins(txid, coins);
}
uint256 GetBestBlock() const { return hashBestBlock_; }
bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock)
{
for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); ) {
map_[it->first] = it->second.coins;
if (it->second.coins.IsPruned() && InsecureRandRange(3) == 0) {
// Randomly delete empty entries on write.
map_.erase(it->first);
}
mapCoins.erase(it++);
}
mapCoins.clear();
hashBestBlock_ = hashBlock;
return true;
}
bool GetStats(CCoinsStats& stats) const { return false; }
};
}
BOOST_FIXTURE_TEST_SUITE(coins_tests, BasicTestingSetup)
static const unsigned int NUM_SIMULATION_ITERATIONS = 40000;
// This is a large randomized insert/remove simulation test on a variable-size
// stack of caches on top of CCoinsViewTest.
//
// It will randomly create/update/delete CCoins entries to a tip of caches, with
// txids picked from a limited list of random 256-bit hashes. Occasionally, a
// new tip is added to the stack of caches, or the tip is flushed and removed.
//
// During the process, booleans are kept to make sure that the randomized
// operation hits all branches.
BOOST_AUTO_TEST_CASE(coins_cache_simulation_test)
{
// Various coverage trackers.
bool removed_all_caches = false;
bool reached_4_caches = false;
bool added_an_entry = false;
bool removed_an_entry = false;
bool updated_an_entry = false;
bool found_an_entry = false;
bool missed_an_entry = false;
// A simple map to track what we expect the cache stack to represent.
std::map<uint256, CCoins> result;
// The cache stack.
CCoinsViewTest base; // A CCoinsViewTest at the bottom.
std::vector<CCoinsViewCache*> stack; // A stack of CCoinsViewCaches on top.
stack.push_back(new CCoinsViewCache(&base)); // Start with one cache.
// Use a limited set of random transaction ids, so we do test overwriting entries.
std::vector<uint256> txids;
txids.resize(NUM_SIMULATION_ITERATIONS / 8);
for (unsigned int i = 0; i < txids.size(); i++) {
txids[i] = InsecureRand256();
}
for (unsigned int i = 0; i < NUM_SIMULATION_ITERATIONS; i++) {
// Do a random modification.
{
uint256 txid = txids[InsecureRandRange(txids.size())]; // txid we're going to modify in this iteration.
CCoins& coins = result[txid];
CCoinsModifier entry = stack.back()->ModifyCoins(txid);
BOOST_CHECK(coins == *entry);
if (InsecureRandRange(5) == 0 || coins.IsPruned()) {
if (coins.IsPruned()) {
added_an_entry = true;
} else {
updated_an_entry = true;
}
coins.nVersion = InsecureRand32();
coins.vout.resize(1);
coins.vout[0].nValue = InsecureRand32();
*entry = coins;
} else {
coins.Clear();
entry->Clear();
removed_an_entry = true;
}
}
// Once every 1000 iterations and at the end, verify the full cache.
if (InsecureRandRange(1000) == 1 || i == NUM_SIMULATION_ITERATIONS - 1) {
for (std::map<uint256, CCoins>::iterator it = result.begin(); it != result.end(); it++) {
const CCoins* coins = stack.back()->AccessCoins(it->first);
if (coins) {
BOOST_CHECK(*coins == it->second);
found_an_entry = true;
} else {
BOOST_CHECK(it->second.IsPruned());
missed_an_entry = true;
}
}
}
if (InsecureRandRange(100) == 0) {
// Every 100 iterations, change the cache stack.
if (stack.size() > 0 && InsecureRandBool() == 0) {
stack.back()->Flush();
delete stack.back();
stack.pop_back();
}
if (stack.size() == 0 || (stack.size() < 4 && InsecureRandBool())) {
CCoinsView* tip = &base;
if (stack.size() > 0) {
tip = stack.back();
} else {
removed_all_caches = true;
}
stack.push_back(new CCoinsViewCache(tip));
if (stack.size() == 4) {
reached_4_caches = true;
}
}
}
}
// Clean up the stack.
while (stack.size() > 0) {
delete stack.back();
stack.pop_back();
}
// Verify coverage.
BOOST_CHECK(removed_all_caches);
BOOST_CHECK(reached_4_caches);
BOOST_CHECK(added_an_entry);
BOOST_CHECK(removed_an_entry);
BOOST_CHECK(updated_an_entry);
BOOST_CHECK(found_an_entry);
BOOST_CHECK(missed_an_entry);
}
BOOST_AUTO_TEST_CASE(ccoins_serialization)
{
// Good example
CDataStream ss1(ParseHex("0108835800816115944e077fe7c803cfa57f29b36bf87c1d35b4934b"), SER_DISK, CLIENT_VERSION);
CCoins cc1;
ss1 >> cc1;
BOOST_CHECK_EQUAL(cc1.nVersion, 1);
BOOST_CHECK_EQUAL(cc1.fCoinBase, false);
BOOST_CHECK_EQUAL(cc1.nHeight, 870987);
BOOST_CHECK_EQUAL(cc1.vout.size(), 2);
BOOST_CHECK_EQUAL(cc1.IsAvailable(0), false);
BOOST_CHECK_EQUAL(cc1.IsAvailable(1), true);
BOOST_CHECK_EQUAL(cc1.vout[1].nValue, 60000000000ULL);
BOOST_CHECK_EQUAL(HexStr(cc1.vout[1].scriptPubKey), HexStr(GetScriptForDestination(CKeyID(uint160(ParseHex("816115944e077fe7c803cfa57f29b36bf87c1d35"))))));
// Good example
CDataStream ss2(ParseHex("0111044086ef97d5790061b01caab50f1b8e9c50a5057eb43c2d9563a4eebbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa482d21f"), SER_DISK, CLIENT_VERSION);
CCoins cc2;
ss2 >> cc2;
BOOST_CHECK_EQUAL(cc2.nVersion, 1);
BOOST_CHECK_EQUAL(cc2.fCoinBase, true);
BOOST_CHECK_EQUAL(cc2.nHeight, 59807);
BOOST_CHECK_EQUAL(cc2.vout.size(), 17);
for (int i = 0; i < 17; i++) {
BOOST_CHECK_EQUAL(cc2.IsAvailable(i), i == 4 || i == 16);
}
BOOST_CHECK_EQUAL(cc2.vout[4].nValue, 234925952);
BOOST_CHECK_EQUAL(HexStr(cc2.vout[4].scriptPubKey), HexStr(GetScriptForDestination(CKeyID(uint160(ParseHex("61b01caab50f1b8e9c50a5057eb43c2d9563a4ee"))))));
BOOST_CHECK_EQUAL(cc2.vout[16].nValue, 110397);
BOOST_CHECK_EQUAL(HexStr(cc2.vout[16].scriptPubKey), HexStr(GetScriptForDestination(CKeyID(uint160(ParseHex("8c988f1a4a4de2161e0f50aac7f17e7f9555caa4"))))));
// Smallest possible example
CDataStream ssx(SER_DISK, CLIENT_VERSION);
BOOST_CHECK_EQUAL(HexStr(ssx.begin(), ssx.end()), "");
CDataStream ss3(ParseHex("0004000600"), SER_DISK, CLIENT_VERSION);
CCoins cc3;
ss3 >> cc3;
BOOST_CHECK_EQUAL(cc3.nVersion, 0);
BOOST_CHECK_EQUAL(cc3.fCoinBase, false);
BOOST_CHECK_EQUAL(cc3.nHeight, 0);
BOOST_CHECK_EQUAL(cc3.vout.size(), 1);
BOOST_CHECK_EQUAL(cc3.IsAvailable(0), true);
BOOST_CHECK_EQUAL(cc3.vout[0].nValue, 0);
BOOST_CHECK_EQUAL(cc3.vout[0].scriptPubKey.size(), 0);
// scriptPubKey that ends beyond the end of the stream
CDataStream ss4(ParseHex("0004000800"), SER_DISK, CLIENT_VERSION);
try {
CCoins cc4;
ss4 >> cc4;
BOOST_CHECK_MESSAGE(false, "We should have thrown");
} catch (const std::ios_base::failure& e) {
}
// Very large scriptPubKey (3*10^9 bytes) past the end of the stream
CDataStream tmp(SER_DISK, CLIENT_VERSION);
uint64_t x = 3000000000ULL;
tmp << VARINT(x);
BOOST_CHECK_EQUAL(HexStr(tmp.begin(), tmp.end()), "8a95c0bb00");
CDataStream ss5(ParseHex("0002008a95c0bb0000"), SER_DISK, CLIENT_VERSION);
try {
CCoins cc5;
ss5 >> cc5;
BOOST_CHECK_MESSAGE(false, "We should have thrown");
} catch (const std::ios_base::failure& e) {
}
}
BOOST_AUTO_TEST_SUITE_END()
| [
"60004952+bonoproject@users.noreply.github.com"
] | 60004952+bonoproject@users.noreply.github.com |
41577c2ac866690bd6e4ebdc8b91734824defad3 | 2870acd5ab68af43402f5f05ff9f67794b20d02e | /search.h | c22eba70eaebfd5e35e0bbda92c336d469b1464b | [] | no_license | ychen306/ubiquitous-goggles | ff03fb68e2227e5f6df1674eb7fd448a25862243 | 1d3770e884e47d9b712042806e8e1fdfd70897a3 | refs/heads/master | 2021-06-03T22:17:30.921626 | 2016-05-14T01:33:37 | 2016-05-14T01:33:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,249 | h | #ifndef _SEARCH_H_
#define _SEARCH_H_
#include <llvm/IR/Type.h>
#include <llvm/IR/DerivedTypes.h>
#include <llvm/CodeGen/MachineFunction.h>
#include "transform.h"
#include "replay_cli.h"
class Searcher {
const unsigned Signal_penalty {1000000};
// various constants controlling the search algorithm
// just read the paper dammit
const float pc {0.16};
const float po {0.5};
const float ps {0.16};
const float pi {0.16};
// probability of deletion
const float pu {0.16};
const float beta {4.0};
unsigned calculateCost(std::vector<response> &);
double rand();
protected:
llvm::Module *M;
ReplayClient *Client;
std::unique_ptr<Transformation> Transform;
llvm::FunctionType *TargetTy;
void transformRewrite();
llvm::MachineFunction *copyFunction(llvm::MachineFunction *MF);
unsigned calculateLatency(llvm::MachineFunction *MF);
public:
Searcher(llvm::TargetMachine *TM,
llvm::Module *MM,
llvm::MachineFunction *MF,
llvm::FunctionType *FnTy,
ReplayClient *Cli);
virtual llvm::MachineFunction *synthesize();
// optimize a function with the assumption that the function starts being correct
virtual llvm::MachineFunction *optimize(int MaxItrs);
};
#endif
| [
"cyt046@gmail.com"
] | cyt046@gmail.com |
33c023c2233a5cfdbe04e0d69f62e2ab289bc041 | b23141778a723169b94b8f8b0f4062b4c8c45dca | /src/alert.cpp | 2143e2bd5ab6c8084363e63b99d508af9db4a743 | [
"MIT"
] | permissive | starblocks/bicreditsnew | ffd401dceea29d1c9d2ba82b49cb331c1ea4728f | 9df0ad1aa19b0e240f600c18e0d1ff36d01dcbea | refs/heads/master | 2020-12-01T01:03:43.844830 | 2015-08-22T08:03:46 | 2015-08-22T08:03:46 | 41,471,458 | 1 | 0 | null | 2015-08-27T07:12:41 | 2015-08-27T07:12:41 | null | UTF-8 | C++ | false | false | 7,426 | cpp | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcredit Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "alert.h"
#include "chainparams.h"
#include "clientversion.h"
#include "net.h"
#include "pubkey.h"
#include "timedata.h"
#include "ui_interface.h"
#include "util.h"
#include <stdint.h>
#include <algorithm>
#include <map>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/foreach.hpp>
#include <boost/thread.hpp>
using namespace std;
map<uint256, CAlert> mapAlerts;
CCriticalSection cs_mapAlerts;
void CUnsignedAlert::SetNull()
{
nVersion = 1;
nRelayUntil = 0;
nExpiration = 0;
nID = 0;
nCancel = 0;
setCancel.clear();
nMinVer = 0;
nMaxVer = 0;
setSubVer.clear();
nPriority = 0;
strComment.clear();
strStatusBar.clear();
strReserved.clear();
}
std::string CUnsignedAlert::ToString() const
{
std::string strSetCancel;
BOOST_FOREACH(int n, setCancel)
strSetCancel += strprintf("%d ", n);
std::string strSetSubVer;
BOOST_FOREACH(std::string str, setSubVer)
strSetSubVer += "\"" + str + "\" ";
return strprintf(
"CAlert(\n"
" nVersion = %d\n"
" nRelayUntil = %d\n"
" nExpiration = %d\n"
" nID = %d\n"
" nCancel = %d\n"
" setCancel = %s\n"
" nMinVer = %d\n"
" nMaxVer = %d\n"
" setSubVer = %s\n"
" nPriority = %d\n"
" strComment = \"%s\"\n"
" strStatusBar = \"%s\"\n"
")\n",
nVersion,
nRelayUntil,
nExpiration,
nID,
nCancel,
strSetCancel,
nMinVer,
nMaxVer,
strSetSubVer,
nPriority,
strComment,
strStatusBar);
}
void CUnsignedAlert::print() const
{
LogPrintf("%s", ToString());
}
void CAlert::SetNull()
{
CUnsignedAlert::SetNull();
vchMsg.clear();
vchSig.clear();
}
bool CAlert::IsNull() const
{
return (nExpiration == 0);
}
uint256 CAlert::GetHash() const
{
return Hash(this->vchMsg.begin(), this->vchMsg.end());
}
bool CAlert::IsInEffect() const
{
return (GetAdjustedTime() < nExpiration);
}
bool CAlert::Cancels(const CAlert& alert) const
{
if (!IsInEffect())
return false; // this was a no-op before 31403
return (alert.nID <= nCancel || setCancel.count(alert.nID));
}
bool CAlert::AppliesTo(int nVersion, std::string strSubVerIn) const
{
// TODO: rework for client-version-embedded-in-strSubVer ?
return (IsInEffect() &&
nMinVer <= nVersion && nVersion <= nMaxVer &&
(setSubVer.empty() || setSubVer.count(strSubVerIn)));
}
bool CAlert::AppliesToMe() const
{
return AppliesTo(PROTOCOL_VERSION, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<std::string>()));
}
bool CAlert::RelayTo(CNode* pnode) const
{
if (!IsInEffect())
return false;
// don't relay to nodes which haven't sent their version message
if (pnode->nVersion == 0)
return false;
// returns true if wasn't already contained in the set
if (pnode->setKnown.insert(GetHash()).second)
{
if (AppliesTo(pnode->nVersion, pnode->strSubVer) ||
AppliesToMe() ||
GetAdjustedTime() < nRelayUntil)
{
pnode->PushMessage("alert", *this);
return true;
}
}
return false;
}
bool CAlert::CheckSignature() const
{
CPubKey key(Params().AlertKey());
if (!key.Verify(Hash(vchMsg.begin(), vchMsg.end()), vchSig))
return error("CAlert::CheckSignature() : verify signature failed");
// Now unserialize the data
CDataStream sMsg(vchMsg, SER_NETWORK, PROTOCOL_VERSION);
sMsg >> *(CUnsignedAlert*)this;
return true;
}
CAlert CAlert::getAlertByHash(const uint256 &hash)
{
CAlert retval;
{
LOCK(cs_mapAlerts);
map<uint256, CAlert>::iterator mi = mapAlerts.find(hash);
if(mi != mapAlerts.end())
retval = mi->second;
}
return retval;
}
bool CAlert::ProcessAlert(bool fThread)
{
if (!CheckSignature())
return false;
if (!IsInEffect())
return false;
// alert.nID=max is reserved for if the alert key is
// compromised. It must have a pre-defined message,
// must never expire, must apply to all versions,
// and must cancel all previous
// alerts or it will be ignored (so an attacker can't
// send an "everything is OK, don't panic" version that
// cannot be overridden):
int maxInt = std::numeric_limits<int>::max();
if (nID == maxInt)
{
if (!(
nExpiration == maxInt &&
nCancel == (maxInt-1) &&
nMinVer == 0 &&
nMaxVer == maxInt &&
setSubVer.empty() &&
nPriority == maxInt &&
strStatusBar == "URGENT: Alert key compromised, upgrade required"
))
return false;
}
{
LOCK(cs_mapAlerts);
// Cancel previous alerts
for (map<uint256, CAlert>::iterator mi = mapAlerts.begin(); mi != mapAlerts.end();)
{
const CAlert& alert = (*mi).second;
if (Cancels(alert))
{
LogPrint("alert", "cancelling alert %d\n", alert.nID);
uiInterface.NotifyAlertChanged((*mi).first, CT_DELETED);
mapAlerts.erase(mi++);
}
else if (!alert.IsInEffect())
{
LogPrint("alert", "expiring alert %d\n", alert.nID);
uiInterface.NotifyAlertChanged((*mi).first, CT_DELETED);
mapAlerts.erase(mi++);
}
else
mi++;
}
// Check if this alert has been cancelled
BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
{
const CAlert& alert = item.second;
if (alert.Cancels(*this))
{
LogPrint("alert", "alert already cancelled by %d\n", alert.nID);
return false;
}
}
// Add to mapAlerts
mapAlerts.insert(make_pair(GetHash(), *this));
// Notify UI and -alertnotify if it applies to me
if(AppliesToMe())
{
uiInterface.NotifyAlertChanged(GetHash(), CT_NEW);
Notify(strStatusBar, fThread);
}
}
LogPrint("alert", "accepted alert %d, AppliesToMe()=%d\n", nID, AppliesToMe());
return true;
}
void
CAlert::Notify(const std::string& strMessage, bool fThread)
{
std::string strCmd = GetArg("-alertnotify", "");
if (strCmd.empty()) return;
// Alert text should be plain ascii coming from a trusted source, but to
// be safe we first strip anything not in safeChars, then add single quotes around
// the whole string before passing it to the shell:
std::string singleQuote("'");
std::string safeStatus = SanitizeString(strMessage);
safeStatus = singleQuote+safeStatus+singleQuote;
boost::replace_all(strCmd, "%s", safeStatus);
if (fThread)
boost::thread t(runCommand, strCmd); // thread runs free
else
runCommand(strCmd);
}
| [
"bitcreditscc@gmail.com"
] | bitcreditscc@gmail.com |
8c0f098f73a463e7022f976807f5a04dd83eee39 | ece30e7058d8bd42bc13c54560228bd7add50358 | /DataCollector/mozilla/xulrunner-sdk/include/nsILoginInfo.h | c37c9cf664cd22634a6b426290e59b0905bb77e7 | [
"Apache-2.0"
] | permissive | andrasigneczi/TravelOptimizer | b0fe4d53f6494d40ba4e8b98cc293cb5451542ee | b08805f97f0823fd28975a36db67193386aceb22 | refs/heads/master | 2022-07-22T02:07:32.619451 | 2018-12-03T13:58:21 | 2018-12-03T13:58:21 | 53,926,539 | 1 | 0 | Apache-2.0 | 2022-07-06T20:05:38 | 2016-03-15T08:16:59 | C++ | UTF-8 | C++ | false | false | 13,346 | h | /*
* DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsILoginInfo.idl
*/
#ifndef __gen_nsILoginInfo_h__
#define __gen_nsILoginInfo_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsILoginInfo */
#define NS_ILOGININFO_IID_STR "c41b7dff-6b9b-42fe-b78d-113051facb05"
#define NS_ILOGININFO_IID \
{0xc41b7dff, 0x6b9b, 0x42fe, \
{ 0xb7, 0x8d, 0x11, 0x30, 0x51, 0xfa, 0xcb, 0x05 }}
class NS_NO_VTABLE nsILoginInfo : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILOGININFO_IID)
/* attribute AString hostname; */
NS_IMETHOD GetHostname(nsAString & aHostname) = 0;
NS_IMETHOD SetHostname(const nsAString & aHostname) = 0;
/* attribute AString formSubmitURL; */
NS_IMETHOD GetFormSubmitURL(nsAString & aFormSubmitURL) = 0;
NS_IMETHOD SetFormSubmitURL(const nsAString & aFormSubmitURL) = 0;
/* attribute AString httpRealm; */
NS_IMETHOD GetHttpRealm(nsAString & aHttpRealm) = 0;
NS_IMETHOD SetHttpRealm(const nsAString & aHttpRealm) = 0;
/* attribute AString username; */
NS_IMETHOD GetUsername(nsAString & aUsername) = 0;
NS_IMETHOD SetUsername(const nsAString & aUsername) = 0;
/* attribute AString usernameField; */
NS_IMETHOD GetUsernameField(nsAString & aUsernameField) = 0;
NS_IMETHOD SetUsernameField(const nsAString & aUsernameField) = 0;
/* attribute AString password; */
NS_IMETHOD GetPassword(nsAString & aPassword) = 0;
NS_IMETHOD SetPassword(const nsAString & aPassword) = 0;
/* attribute AString passwordField; */
NS_IMETHOD GetPasswordField(nsAString & aPasswordField) = 0;
NS_IMETHOD SetPasswordField(const nsAString & aPasswordField) = 0;
/* void init (in AString aHostname, in AString aFormSubmitURL, in AString aHttpRealm, in AString aUsername, in AString aPassword, in AString aUsernameField, in AString aPasswordField); */
NS_IMETHOD Init(const nsAString & aHostname, const nsAString & aFormSubmitURL, const nsAString & aHttpRealm, const nsAString & aUsername, const nsAString & aPassword, const nsAString & aUsernameField, const nsAString & aPasswordField) = 0;
/* boolean equals (in nsILoginInfo aLoginInfo); */
NS_IMETHOD Equals(nsILoginInfo *aLoginInfo, bool *_retval) = 0;
/* boolean matches (in nsILoginInfo aLoginInfo, in boolean ignorePassword); */
NS_IMETHOD Matches(nsILoginInfo *aLoginInfo, bool ignorePassword, bool *_retval) = 0;
/* nsILoginInfo clone (); */
NS_IMETHOD Clone(nsILoginInfo * *_retval) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsILoginInfo, NS_ILOGININFO_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSILOGININFO \
NS_IMETHOD GetHostname(nsAString & aHostname) override; \
NS_IMETHOD SetHostname(const nsAString & aHostname) override; \
NS_IMETHOD GetFormSubmitURL(nsAString & aFormSubmitURL) override; \
NS_IMETHOD SetFormSubmitURL(const nsAString & aFormSubmitURL) override; \
NS_IMETHOD GetHttpRealm(nsAString & aHttpRealm) override; \
NS_IMETHOD SetHttpRealm(const nsAString & aHttpRealm) override; \
NS_IMETHOD GetUsername(nsAString & aUsername) override; \
NS_IMETHOD SetUsername(const nsAString & aUsername) override; \
NS_IMETHOD GetUsernameField(nsAString & aUsernameField) override; \
NS_IMETHOD SetUsernameField(const nsAString & aUsernameField) override; \
NS_IMETHOD GetPassword(nsAString & aPassword) override; \
NS_IMETHOD SetPassword(const nsAString & aPassword) override; \
NS_IMETHOD GetPasswordField(nsAString & aPasswordField) override; \
NS_IMETHOD SetPasswordField(const nsAString & aPasswordField) override; \
NS_IMETHOD Init(const nsAString & aHostname, const nsAString & aFormSubmitURL, const nsAString & aHttpRealm, const nsAString & aUsername, const nsAString & aPassword, const nsAString & aUsernameField, const nsAString & aPasswordField) override; \
NS_IMETHOD Equals(nsILoginInfo *aLoginInfo, bool *_retval) override; \
NS_IMETHOD Matches(nsILoginInfo *aLoginInfo, bool ignorePassword, bool *_retval) override; \
NS_IMETHOD Clone(nsILoginInfo * *_retval) override;
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSILOGININFO(_to) \
NS_IMETHOD GetHostname(nsAString & aHostname) override { return _to GetHostname(aHostname); } \
NS_IMETHOD SetHostname(const nsAString & aHostname) override { return _to SetHostname(aHostname); } \
NS_IMETHOD GetFormSubmitURL(nsAString & aFormSubmitURL) override { return _to GetFormSubmitURL(aFormSubmitURL); } \
NS_IMETHOD SetFormSubmitURL(const nsAString & aFormSubmitURL) override { return _to SetFormSubmitURL(aFormSubmitURL); } \
NS_IMETHOD GetHttpRealm(nsAString & aHttpRealm) override { return _to GetHttpRealm(aHttpRealm); } \
NS_IMETHOD SetHttpRealm(const nsAString & aHttpRealm) override { return _to SetHttpRealm(aHttpRealm); } \
NS_IMETHOD GetUsername(nsAString & aUsername) override { return _to GetUsername(aUsername); } \
NS_IMETHOD SetUsername(const nsAString & aUsername) override { return _to SetUsername(aUsername); } \
NS_IMETHOD GetUsernameField(nsAString & aUsernameField) override { return _to GetUsernameField(aUsernameField); } \
NS_IMETHOD SetUsernameField(const nsAString & aUsernameField) override { return _to SetUsernameField(aUsernameField); } \
NS_IMETHOD GetPassword(nsAString & aPassword) override { return _to GetPassword(aPassword); } \
NS_IMETHOD SetPassword(const nsAString & aPassword) override { return _to SetPassword(aPassword); } \
NS_IMETHOD GetPasswordField(nsAString & aPasswordField) override { return _to GetPasswordField(aPasswordField); } \
NS_IMETHOD SetPasswordField(const nsAString & aPasswordField) override { return _to SetPasswordField(aPasswordField); } \
NS_IMETHOD Init(const nsAString & aHostname, const nsAString & aFormSubmitURL, const nsAString & aHttpRealm, const nsAString & aUsername, const nsAString & aPassword, const nsAString & aUsernameField, const nsAString & aPasswordField) override { return _to Init(aHostname, aFormSubmitURL, aHttpRealm, aUsername, aPassword, aUsernameField, aPasswordField); } \
NS_IMETHOD Equals(nsILoginInfo *aLoginInfo, bool *_retval) override { return _to Equals(aLoginInfo, _retval); } \
NS_IMETHOD Matches(nsILoginInfo *aLoginInfo, bool ignorePassword, bool *_retval) override { return _to Matches(aLoginInfo, ignorePassword, _retval); } \
NS_IMETHOD Clone(nsILoginInfo * *_retval) override { return _to Clone(_retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSILOGININFO(_to) \
NS_IMETHOD GetHostname(nsAString & aHostname) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHostname(aHostname); } \
NS_IMETHOD SetHostname(const nsAString & aHostname) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetHostname(aHostname); } \
NS_IMETHOD GetFormSubmitURL(nsAString & aFormSubmitURL) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFormSubmitURL(aFormSubmitURL); } \
NS_IMETHOD SetFormSubmitURL(const nsAString & aFormSubmitURL) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFormSubmitURL(aFormSubmitURL); } \
NS_IMETHOD GetHttpRealm(nsAString & aHttpRealm) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHttpRealm(aHttpRealm); } \
NS_IMETHOD SetHttpRealm(const nsAString & aHttpRealm) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetHttpRealm(aHttpRealm); } \
NS_IMETHOD GetUsername(nsAString & aUsername) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUsername(aUsername); } \
NS_IMETHOD SetUsername(const nsAString & aUsername) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUsername(aUsername); } \
NS_IMETHOD GetUsernameField(nsAString & aUsernameField) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUsernameField(aUsernameField); } \
NS_IMETHOD SetUsernameField(const nsAString & aUsernameField) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUsernameField(aUsernameField); } \
NS_IMETHOD GetPassword(nsAString & aPassword) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPassword(aPassword); } \
NS_IMETHOD SetPassword(const nsAString & aPassword) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPassword(aPassword); } \
NS_IMETHOD GetPasswordField(nsAString & aPasswordField) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPasswordField(aPasswordField); } \
NS_IMETHOD SetPasswordField(const nsAString & aPasswordField) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPasswordField(aPasswordField); } \
NS_IMETHOD Init(const nsAString & aHostname, const nsAString & aFormSubmitURL, const nsAString & aHttpRealm, const nsAString & aUsername, const nsAString & aPassword, const nsAString & aUsernameField, const nsAString & aPasswordField) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aHostname, aFormSubmitURL, aHttpRealm, aUsername, aPassword, aUsernameField, aPasswordField); } \
NS_IMETHOD Equals(nsILoginInfo *aLoginInfo, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Equals(aLoginInfo, _retval); } \
NS_IMETHOD Matches(nsILoginInfo *aLoginInfo, bool ignorePassword, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Matches(aLoginInfo, ignorePassword, _retval); } \
NS_IMETHOD Clone(nsILoginInfo * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Clone(_retval); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsLoginInfo : public nsILoginInfo
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSILOGININFO
nsLoginInfo();
private:
~nsLoginInfo();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS(nsLoginInfo, nsILoginInfo)
nsLoginInfo::nsLoginInfo()
{
/* member initializers and constructor code */
}
nsLoginInfo::~nsLoginInfo()
{
/* destructor code */
}
/* attribute AString hostname; */
NS_IMETHODIMP nsLoginInfo::GetHostname(nsAString & aHostname)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsLoginInfo::SetHostname(const nsAString & aHostname)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute AString formSubmitURL; */
NS_IMETHODIMP nsLoginInfo::GetFormSubmitURL(nsAString & aFormSubmitURL)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsLoginInfo::SetFormSubmitURL(const nsAString & aFormSubmitURL)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute AString httpRealm; */
NS_IMETHODIMP nsLoginInfo::GetHttpRealm(nsAString & aHttpRealm)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsLoginInfo::SetHttpRealm(const nsAString & aHttpRealm)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute AString username; */
NS_IMETHODIMP nsLoginInfo::GetUsername(nsAString & aUsername)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsLoginInfo::SetUsername(const nsAString & aUsername)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute AString usernameField; */
NS_IMETHODIMP nsLoginInfo::GetUsernameField(nsAString & aUsernameField)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsLoginInfo::SetUsernameField(const nsAString & aUsernameField)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute AString password; */
NS_IMETHODIMP nsLoginInfo::GetPassword(nsAString & aPassword)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsLoginInfo::SetPassword(const nsAString & aPassword)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute AString passwordField; */
NS_IMETHODIMP nsLoginInfo::GetPasswordField(nsAString & aPasswordField)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsLoginInfo::SetPasswordField(const nsAString & aPasswordField)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void init (in AString aHostname, in AString aFormSubmitURL, in AString aHttpRealm, in AString aUsername, in AString aPassword, in AString aUsernameField, in AString aPasswordField); */
NS_IMETHODIMP nsLoginInfo::Init(const nsAString & aHostname, const nsAString & aFormSubmitURL, const nsAString & aHttpRealm, const nsAString & aUsername, const nsAString & aPassword, const nsAString & aUsernameField, const nsAString & aPasswordField)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean equals (in nsILoginInfo aLoginInfo); */
NS_IMETHODIMP nsLoginInfo::Equals(nsILoginInfo *aLoginInfo, bool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean matches (in nsILoginInfo aLoginInfo, in boolean ignorePassword); */
NS_IMETHODIMP nsLoginInfo::Matches(nsILoginInfo *aLoginInfo, bool ignorePassword, bool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsILoginInfo clone (); */
NS_IMETHODIMP nsLoginInfo::Clone(nsILoginInfo * *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#define NS_LOGININFO_CONTRACTID "@mozilla.org/login-manager/loginInfo;1"
#endif /* __gen_nsILoginInfo_h__ */
| [
"andras.igneczi@doclerholding.com"
] | andras.igneczi@doclerholding.com |
f61be13bf6b4c7ca9f23e16f886d4f9ba51c8cfc | 9fa10e3f1b94b7ef396d446647acfdd74ec3c892 | /example-gstt_basics/src/ofGsttApp.h | 536fa08db05797b256f30aafd0489bac331e57d8 | [] | no_license | fx-lange/ofxGSTT | 35a8451e679e7515c2560765e1e0183536fa5370 | c4354777ca1d7aa2cc396e6026b82fbf36a7e30f | refs/heads/master | 2021-01-20T03:57:03.885069 | 2015-04-09T19:14:05 | 2015-04-09T19:14:05 | 2,756,730 | 12 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 471 | h | #pragma once
#include "ofMain.h"
#include "ofxGSTT.h"
class ofGsttApp: public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y);
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased();
void gsttResponse(ofxGSTTResponseArgs & response);
string responseStr;
ofxGSTT gstt;
ofSoundStream soundStream;
};
| [
"langefx@gmail.com"
] | langefx@gmail.com |
77d8dc8725c589e3c09ae16b991929f3c1a19f70 | a65f5bae4dcaad49a6ad40e9310efeed07492149 | /YsbotControl/CmdInfo.h | 2db9787acb711a96644bcfac78ecced1c0fa78cd | [] | no_license | 15831944/YsbotControl | b3e60d03b6ea80bb04076f3067cea81a8bdea5ed | 01f5c93be667d4ae1aa7c8af90551a312f86bf57 | refs/heads/main | 2023-07-25T00:39:33.476245 | 2021-09-09T03:28:22 | 2021-09-09T03:28:22 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,840 | h | // Copyright 2016, 亚思信息科技有限责任公司
// All right reserved.
//
// Author: Liu Run Dan ( lrdcz@163.com )
//
// Yasi Robot Motion Control System - 亚思机器人运动控制系统
#ifndef _command_infomation_h
#define _command_infomation_h
#include "PosInfo.h"
#include "RobotState.h"
#include "GroupProperties.h"
class Dynamic : public BasicScriptVariable
{
public:
Dynamic();
Dynamic (const Dynamic& dyn) { operator= (dyn); }
const Dynamic& operator= (const Dynamic& dyn);
double PathVel; // 位置速度(mm/s)
double PathAcc; // 位置加速度(mm/s^2)
double PathDec; // 位置减速度(mm/s^2)
double PathJerk;
double JointVel; // 关节速度(%)
double JointAcc; // 关节加速度(%)
double JointDec; // 关节减速度(%)
double JointJerk;
double OriVel; // 旋转速度(deg/s)
double OriAcc; // 旋转加速度(deg/s^2)
double OriDec; // 旋转减速度(deg/s^2)
double OriJerk;
double Override;
bool custom_parameter;
char* get_value( const char* name, char* strValue);
void set_value( const char* name, char* strValue);
void check_value( const char* name, const bool, char* );
};
std::ostream& operator<< (std::ostream& os, const Dynamic& v);
std::istream& operator>> (std::istream &in, Dynamic& v);
class Overlap : public BasicScriptVariable
{
public:
enum BufferMode
{
mcAborting = 0,
mcBuffered = 1,
mcBlendingLow = 2,
mcBlendingPrevious = 3,
mcBlendingNext = 4,
mcBlendingHigh = 5,
};
enum TransitionMode
{
TMNone = 0,
TMStartVelocity = 1,
TMCornerDistance = 2,
TMConstantVelocity = 3, // invalid for codesys below
TMMaxCornerDeviation = 4,
TMConstDeviation = 5,
TMIntermediatePoint = 6,
TMDynamicOptimized = 7,
};
Overlap();
Overlap (const Overlap& ove) { operator= (ove); }
const Overlap& operator= (const Overlap& ove);
BufferMode iBufferMode;
TransitionMode iTransMode;
Real TransitionParameter[3];
char* get_value( const char* name, char* strValue);
void set_value( const char* name, char* strValue);
void check_value( const char* name, const bool, char* );
};
std::ostream& operator<< (std::ostream& os, const Overlap& v);
std::istream& operator>> (std::istream &in, Overlap& v);
enum CommandT
{
CMD_NULL = 0,
CMD_JOG,
CMD_PTP,
CMD_LIN,
CMD_CIR,
CMD_PTPREL,
CMD_LINREL,
CMD_CIRREL,
CMD_SPLINE,
CMD_WAITIO, // add by dan.
CMD_DELAYING,
CMD_HALT,
CMD_CONTINUE,
CMD_ABORT,
CMD_ABORTJOG,
CMD_HOME,
CMD_ABORTHOME,
CMD_READINPUT,
CMD_SETOUTPUT,
CMD_SETPOSITION,
CMD_RESET,
CMD_POWER,
CMD_BLEND,
CMD_ERRORSTOP,
CMD_RESETCMDINDEX,
CMD_TIMEDELAY,
CMD_MCOMMAND,
CMD_SETOVERRIDE,
CMD_WAITMOTIONFINISH,
CMD_SETCOORDREF,
CMD_CONVEYORBEGIN,
CMD_CONVEYORWAIT,
CMD_CONVEYORDONE,
CMD_CONVEYOREND,
};
// different variables that are used by the different possible commands
// only the variables that are related to the current commandType have
// legal values
class CmdInfo
{
public:
int iObjNo;
int iSourceLineNo;
CommandT iCommandType;
// in degree
PosInfo startPos; // ACS, MCS, PCS
PosInfo destPos;
PosInfo auxPos; // for circle motion
const CartRef* cartref; // user coordinate system, may be dynamic coordinate
const CartPos* tool; // tool coordinate system
Dynamic dyn;
Overlap ovl;
Real dec_time;
unsigned short HomeMark;
int iInOutNo;
int iInOutBit;
int iIoValue;
int chJogAxisMark;
int chJogDirMark;
long int iDelayTime;
JogCoordT iJogCoordType;
bool customStartPos;
bool bOnOff;
public:
CmdInfo(void);
~CmdInfo(void);
const CmdInfo& operator= (const CmdInfo& ) throw ();
CmdInfo (const CmdInfo& cf) throw () { operator= (cf); }
};
#endif | [
"liurundan9@163.com"
] | liurundan9@163.com |
16a2ef12e184a63e6e0f1bd26c3906b8fc817d8d | a7ab87d2fa045c6290b6529a59cada569ab07971 | /1009.cc | 5ef07dda49348053c926a704bed0457aa35a8339 | [] | no_license | dingdd/hdu | 23fa8ff144c167afc05b19d02882dcf30285a592 | 0f98e39664ac85782f57dbcb70cb09bea9e2ac4c | refs/heads/master | 2021-07-06T19:49:08.105727 | 2021-05-26T10:33:50 | 2021-05-26T10:33:50 | 11,066,985 | 0 | 0 | null | 2013-07-01T01:25:49 | 2013-06-30T09:14:52 | null | UTF-8 | C++ | false | false | 757 | cc | #include <iostream>
#include <iomanip>
#include <algorithm>
struct Trade{
int J,F;
};
bool compare(struct Trade t1, struct Trade t2){
if (t1.F == 0){
return true;
}
if (t2.F == 0){
return false;
}
if ( t1.J * t2.F - t2.J * t1.F > 0)
return true;
return false;
}
int main(){
using namespace std;
int M,N;
struct Trade trades[1000];
while(cin >>M >>N && M != -1 && N != -1){
for(int i=0;i<N;++i){
cin >> trades[i].J >> trades[i].F;
}
sort(trades,trades+N,compare);
double sum = 0.0;
for(int i=0;i<N&&M>=0;++i){
if (M >= trades[i].F){
sum += trades[i].J;
M -= trades[i].F;
}else {
sum += 1.0 * trades[i].J * M / trades[i].F;
M = 0;
}
}
cout <<fixed <<setprecision(3) <<sum <<endl;
}
return 0;
}
| [
"mail.dingdd@gmail.com"
] | mail.dingdd@gmail.com |
eadebe91912258a5e4e4ece9e2daa3bbff8c66a7 | d344de8e32f82bc2596a01eac6ca1b109884bd06 | /Coyo (competive programming)/assignments/30-09-2019/$_string_using_recursion.cpp | 9f6b408dec4a8c6a7c1d8e23699807925e74144f | [] | no_license | vijaygwala/MyCodingStyle- | 214e9149ccbb33b21d2132dd0a7d85272d438f16 | 39d75463ec8af798df7d013efc940de89a447009 | refs/heads/master | 2022-10-06T07:55:46.928080 | 2020-06-05T15:55:31 | 2020-06-05T15:55:31 | 268,440,527 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 676 | cpp |
#include<bits/stdc++.h>
using namespace std;
void printSpace(char str[]);
void print(char str[],string ans,int ind,bool flag);
int main()
{
int T;
cin>>T;
while(T--)
{
char str[10000];
cin>>str;
printSpace(str);
cout<<endl;
}
}
void printSpace(char str[])
{ string ans="";
ans+=str[0];
print(str,ans,1,true);
}
void print(char str[],string ans,int ind,bool flag)
{
if(str[ind]=='\0')
{
cout<<ans<<"$";
return;
}
if(str[ind])
{
print(str,ans+str[ind],ind+1,true);
if(flag)
print(str,ans+" ",ind,false);
}
}
| [
"vijaygwala97@gmail.com"
] | vijaygwala97@gmail.com |
00e56dbe11c5ce7db75b3807ebb8ae613b6850b7 | 9f7bc8df3f30f2ec31581d6d2eca06e332aa15b4 | /c++/Win32/MFC/Controls/IEToolbar/BmpMenuOwnerWnd.h | b430567cb497690daadc55c2215fb24c42e58849 | [
"MIT"
] | permissive | moodboom/Reusable | 58f518b5b81facb862bbb36015aaa00adc710e0e | 5e0a4a85834533cf3ec5bec52cd6c5b0d60df8e8 | refs/heads/master | 2023-08-22T20:06:18.210680 | 2023-08-05T20:08:36 | 2023-08-05T20:08:36 | 50,254,274 | 3 | 3 | MIT | 2023-07-12T17:29:42 | 2016-01-23T19:23:01 | C++ | WINDOWS-1252 | C++ | false | false | 5,346 | h | //-------------------------------------------------------------------//
// CBmpMenuOwnerWnd class
//-------------------------------------------------------------------//
//
// NOTE: Derived from code originally posted to CodeGuru.com by
// Nikolay Denisov (acnick@mail.lanck.net).
//
// Copyright © 2005 A better Software.
//-------------------------------------------------------------------//
#ifndef __BMPMENUOWNERWND_H__
#define __BMPMENUOWNERWND_H__
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "..\..\WinAppEx.h"
/////////////////////////////////////////////////////////////////////////////
// CBmpMenuOwnerWnd
template< class TBase >
class CBmpMenuOwnerWnd : public TBase
{
// Constructors
public:
CBmpMenuOwnerWnd();
~CBmpMenuOwnerWnd();
// Message map functions
protected:
afx_msg void OnInitMenuPopup( CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu );
afx_msg void OnDrawItem( int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct );
afx_msg void OnMeasureItem( int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct );
};
/////////////////////////////////////////////////////////////////////////////
// CBmpMenuOwnerWnd out-of-line functions
template< class TBase >
CBmpMenuOwnerWnd< TBase >::CBmpMenuOwnerWnd()
{
}
template< class TBase >
CBmpMenuOwnerWnd< TBase >::~CBmpMenuOwnerWnd()
{
}
template< class TBase >
void CBmpMenuOwnerWnd< TBase >::OnInitMenuPopup( CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu )
{
TBase::OnInitMenuPopup( pPopupMenu, nIndex, bSysMenu );
CWinAppEx::GetInstance()->SetMenuIcons( pPopupMenu );
}
template< class TBase >
void CBmpMenuOwnerWnd< TBase >::OnDrawItem( int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct )
{
CWinAppEx* pApp = CWinAppEx::GetInstance();
if ( pApp->GetBitmappedMenus() && ( lpDrawItemStruct->CtlType == ODT_MENU ) )
{
int nImage = pApp->GetMenuImage( lpDrawItemStruct->itemID );
if ( nImage != -1 )
{
CDC* pDC = CDC::FromHandle( lpDrawItemStruct->hDC );
CRect rcItem( &lpDrawItemStruct->rcItem );
CImageList* pImageList = pApp->GetMenuImageList();
if ( lpDrawItemStruct->itemState & ODS_GRAYED )
{
// Create a color bitmap.
CWindowDC windowDC( 0 );
CDC colorDC;
colorDC.CreateCompatibleDC( 0 );
CBitmap colorBmp;
colorBmp.CreateCompatibleBitmap( &windowDC, szMenuIcon.cx, szMenuIcon.cy );
CBitmap* oldColorBmp = colorDC.SelectObject( &colorBmp );
// Create a monochrome bitmap.
CDC monoDC;
monoDC.CreateCompatibleDC( 0 );
CBitmap monoBmp;
monoBmp.CreateCompatibleBitmap( &monoDC, szMenuIcon.cx, szMenuIcon.cy );
CBitmap* pOldMonoBmp = monoDC.SelectObject( &monoBmp );
COLORREF clrBtnHilite = ::GetSysColor( COLOR_BTNHIGHLIGHT );
// Copy the toolbar button to the color bitmap, make all transparent
// areas the same color as the button highlight color.
pImageList->DrawIndirect( &colorDC, nImage, CPoint( 0, 0 ),
szMenuIcon, CPoint( 0, 0 ), ILD_NORMAL, SRCCOPY, clrBtnHilite );
// Copy the color bitmap into the monochrome bitmap. Pixels that
// have the button highlight color are mapped to the background
colorDC.SetBkColor( clrBtnHilite );
monoDC.BitBlt( 0, 0, szMenuIcon.cx, szMenuIcon.cy, &colorDC, 0, 0, SRCCOPY );
// Draw the monochrome bitmap onto the menu.
pDC->BitBlt( rcItem.left, rcItem.top + ( rcItem.Height() - szMenuIcon.cy ) / 2,
szMenuIcon.cx, szMenuIcon.cy, &monoDC, 0, 0, SRCCOPY );
// Delete the color DC and bitmap.
colorDC.SelectObject( oldColorBmp );
colorDC.DeleteDC();
colorBmp.DeleteObject();
// Delete the monochrome DC and bitmap.
monoDC.SelectObject( pOldMonoBmp );
monoDC.DeleteDC();
monoBmp.DeleteObject();
}
else
{
VERIFY( pImageList->Draw( pDC, nImage, CPoint( rcItem.left,
rcItem.top + ( rcItem.Height() - szMenuIcon.cy ) / 2 ), ILD_NORMAL ) );
}
}
}
else
{
TBase::OnDrawItem( nIDCtl, lpDrawItemStruct );
}
}
template< class TBase >
void CBmpMenuOwnerWnd< TBase >::OnMeasureItem( int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct )
{
CWinAppEx* pApp = CWinAppEx::GetInstance();
if ( pApp->GetBitmappedMenus() && ( lpMeasureItemStruct->CtlType == ODT_MENU ) )
{
// const NONCLIENTMETRICS& info = pApp->GetNonClientMetrics();
// lpMeasureItemStruct->itemWidth = max( info.iMenuWidth, szMenuIcon.cx + 4 );
// lpMeasureItemStruct->itemHeight = max( info.iMenuHeight, szMenuIcon.cy );
lpMeasureItemStruct->itemWidth = szMenuIcon.cx + 4;
lpMeasureItemStruct->itemHeight = szMenuIcon.cy;
}
else
{
TBase::OnMeasureItem( nIDCtl, lpMeasureItemStruct );
}
}
/////////////////////////////////////////////////////////////////////////////
#endif // !__BMPMENUOWNERWND_H__
| [
"m@thedigitalmachine.com"
] | m@thedigitalmachine.com |
13e24926432cd3290a46dc5cdc167ecdcdc2e1d4 | 8fb9ae63c6a64d9f0789643405be4282c33c3a1b | /UVA/10405 - Longest Common Subsequence.cpp | 24db1f087954173857e2cf369e49013fd588a31d | [] | no_license | RafikFarhad/Code_is_fun | 7c67b4d9c97d7e58ccf822214d1ba4fe51b88ba6 | 08fd1c53125deaaeb0d6aac8f9c2fd7c76a05e4d | refs/heads/master | 2021-07-25T13:32:48.839014 | 2021-01-10T00:23:34 | 2021-01-10T00:23:34 | 46,503,470 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,542 | cpp | /// Heil Hydra
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <algorithm>
#include <new>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#define CLR(o) memset(o, 0x00, sizeof o)
#define CLR1(o) memset(o, -1, sizeof o)
#define MAX3(a, b, c) MAX(a , MAX(b,c))
#define MIN3(a, b, c) MIN(a , MIN(b,c))
#define takei(a) scanf("%d", &a)
#define takell(a) scanf("%lld", &a)
#define takellu(a) scanf("%llu", &a)
#define sf scanf
#define ssf sscanf
#define pb push_back
#define PPP system("pause")
#define ok cout << "OK" <<endl;
#define pf printf
#define NL printf("\n")
#define PI 2*acos(0)
#define READ freopen("input.txt","r",stdin);
#define WRITE freopen("output.txt", "w", stdout);
using namespace std;
template <class T> T MAX(T a, T b) { return a>b?a:b;}template <class T> T MIN(T a, T b) { return a<b?a:b;}
template <class T1> void deb(T1 p) { cout << "Debugging: " << p << endl;}
template <class T1, class T2> void deb(T1 p, T2 q) { cout << "Debugging: " << p << "\t" << q << endl;}
template <class T1, class T2, class T3> void deb(T1 p, T2 q, T3 r) { cout << "Debugging: " << p << "\t " << q << "\t " << r << endl;}
template <class T1, class T2, class T3, class T4> void deb(T1 p, T2 q, T3 r, T4 s) { cout << "Debugging: " << p << "\t " << q << "\t " << r << "\t " << s << endl;}
long long int POOW(int b, int p) { if(p==0) return 1; return b*POOW(b, p-1);}
const int xx[] = {0, 0, 1, -1, -1, 1, -1, 1};const int yy[] = {1, -1, 0, 0, 1, 1, -1, -1}; const int kx[] = {-2, -1, 1, 2, 2, 1, -1, -2}; const int ky[] = {1, 2, 2, 1, -1, -2, -2, -1}; // KX-> Knight moves xx-> diagonal -> 8 horizontal/vertical->4
#define SIZE 100005
char a[1005], b[1005];
int p, q, mem[1005][1005];
int LCS(int x, int y)
{
if(x==p || y==q) return 0;
if(mem[x][y]!=-1) return mem[x][y];
if(a[x]==b[y])
return mem[x][y] = 1 + LCS(x+1, y+1);
return mem[x][y] = max(LCS(x+1, y), LCS(x, y+1));
}
int main()
{
// time_t t1=clock();
#ifndef ONLINE_JUDGE
READ;
WRITE;
#endif
/// MAIN
while(gets(a))
{
gets(b);
CLR1(mem);
p = strlen(a);
q = strlen(b);
pf("%d\n", LCS(0,0));
}
/* Coding is FUN */
/// ENDD
// time_t t2=clock();
// cout << " My time: " <<(t2-t1) << endl;;
return 0;
}
| [
"rafikfarhad@gmail.com"
] | rafikfarhad@gmail.com |
f6af2b6136fb875e56aeb499af1cd510421e672f | aaad6f199fa18f60c6f393bd1eb7ae6b14a41845 | /week10/india/india.cpp | 42ff8b8fa05668a2eadec8adf8a8d9c633d90923 | [] | no_license | LuigiAndMario/AlgoLab | 487d5dc524876dc80003d0da4ecc0eb2359ae616 | ace9ccccc363004acddb2e4b0f890e2e0a697129 | refs/heads/master | 2020-03-29T19:13:15.663789 | 2020-02-04T17:31:42 | 2020-02-04T17:31:42 | 150,253,198 | 5 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 4,309 | cpp | // Includes
// ========
// STL includes
#include <iostream>
#include <climits>
// BGL includes
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/cycle_canceling.hpp>
#include <boost/graph/push_relabel_max_flow.hpp>
#include <boost/graph/successive_shortest_path_nonnegative_weights.hpp>
#include <boost/graph/find_flow_cost.hpp>
// Graph Type with nested interior edge properties for Cost Flow Algorithms
typedef boost::adjacency_list_traits<boost::vecS, boost::vecS, boost::directedS> traits;
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property,
boost::property<boost::edge_capacity_t, long,
boost::property<boost::edge_residual_capacity_t, long,
boost::property<boost::edge_reverse_t, traits::edge_descriptor,
boost::property <boost::edge_weight_t, long> > > > > graph; // new! weightmap corresponds to costs
typedef boost::graph_traits<graph>::edge_descriptor edge_desc;
typedef boost::graph_traits<graph>::out_edge_iterator out_edge_it; // Iterator
// Custom edge adder class
class edge_adder {
graph &G;
public:
explicit edge_adder(graph &G) : G(G) {}
void add_edge(int from, int to, long capacity, long cost) {
auto c_map = boost::get(boost::edge_capacity, G);
auto r_map = boost::get(boost::edge_reverse, G);
auto w_map = boost::get(boost::edge_weight, G); // new!
const edge_desc e = boost::add_edge(from, to, G).first;
const edge_desc rev_e = boost::add_edge(to, from, G).first;
c_map[e] = capacity;
c_map[rev_e] = 0; // reverse edge has no capacity!
r_map[e] = rev_e;
r_map[rev_e] = e;
w_map[e] = cost; // new assign cost
w_map[rev_e] = -cost; // new negative cost
}
};
typedef struct guide {
int x;
int y;
int e;
int d;
} guide;
using namespace std;
long flow_with_capacity(vector<guide> &guides, long capacity, int c, int b, int k, int a) {
graph G(c + 1);
edge_adder adder(G);
const int src = c;
for (auto it = guides.begin() ; it != guides.end() ; it++) {
adder.add_edge(it->x, it->y, it->e, it->d);
}
adder.add_edge(src, k, capacity, 0);
boost::successive_shortest_path_nonnegative_weights(G, src, a);
long cost = boost::find_flow_cost(G);
return cost <= b ? boost::push_relabel_max_flow(G, src, a) : -1;
}
void testcase() {
int c; cin >> c; // # cities (nodes)
int g; cin >> g; // # guides (edges)
int b; cin >> b; // Budget
int k; cin >> k; // Start
int a; cin >> a; // End
graph G(c);
edge_adder adder(G);
vector<guide> guides;
for (int i = 0 ; i < g ; i++) {
int x; cin >> x; // From
int y; cin >> y; // To
int d; cin >> d; // Cost
int e; cin >> e; // Capacity
adder.add_edge(x, y, e, d);
guides.push_back({x, y, e, d});
}
// IDEA: limit the flow, get the max possible flow with cost <= b
// Find this with binary search (bot = 0, top = max flow)
long bot = 0; // Lower bound
long top = boost::push_relabel_max_flow(G, k, a); // Upper bound
// This clears testset 2
boost::successive_shortest_path_nonnegative_weights(G, k, a);
long cost = boost::find_flow_cost(G);
if (cost <= b) {
cout << top << endl;
return;
}
long best = -1;
while (true) {
// End of the searc
if (bot == top) {
// Litterally a tie
best = flow_with_capacity(guides, bot, c, b, k, a);
break;
}
if (bot + 1 == top) {
// Kind of a tie
best = max(flow_with_capacity(guides, bot, c, b, k, a),
flow_with_capacity(guides, top, c, b, k, a));
break;
}
// The search continues
long mid = (bot + top) / 2;
long res = flow_with_capacity(guides, mid, c, b, k, a);
if (res == -1) {
// Mid is too high, we need to go lower
top = mid - 1;
} else {
// Mid might be too low, we can go higher
bot = mid;
}
}
cout << best << endl;
}
int main() {
int t; cin >> t;
while (t--) {
testcase();
}
return 0;
}
| [
"luigi@sansonetti.ch"
] | luigi@sansonetti.ch |
1caf712429a0d59bb1d5cdbcf904c6aec54b1866 | fcdea24e6466d4ec8d7798555358a9af8acf9b35 | /Plugins/mrayPhysx/PhysXShape.cpp | 1da4c9f819f7b3dada4a5d860041513eb58a7aea | [] | no_license | yingzhang536/mrayy-Game-Engine | 6634afecefcb79c2117cecf3e4e635d3089c9590 | 6b6fcbab8674a6169e26f0f20356d0708620b828 | refs/heads/master | 2021-01-17T07:59:30.135446 | 2014-11-30T16:10:54 | 2014-11-30T16:10:54 | 27,630,181 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,243 | cpp | #include "stdafx.h"
#include "PhysXShape.h"
#include "physXCommon.h"
#include "NxBounds3.h"
#include "CPhysXMaterial.h"
namespace mray{
namespace physics{
PhysXShape::PhysXShape(NxShape*shape,IPhysicalNode* node)
{
m_nxShape=shape;
m_node=node;
if(m_nxShape)
{
const char* n=m_nxShape->getName();
core::char_to_string(n,m_name);
}
}
PhysXShape::~PhysXShape()
{
}
NxShape* PhysXShape::getNxShape()
{
return m_nxShape;
}
void PhysXShape::setPhysicalNode(IPhysicalNode* node)
{
m_node=node;
}
const core::string& PhysXShape::getName()
{
return m_name;
}
IPhysicalNode* PhysXShape::getPhysicalNode()
{
return m_node;
}
void PhysXShape::setCollisionGroup(ushort collisionGroup)
{
m_nxShape->setGroup(collisionGroup);
}
ushort PhysXShape::getCollisionGroup()const
{
return m_nxShape->getGroup();
}
void PhysXShape::getWorldBounds(math::box3d&bounds)const
{
NxBounds3 b;
m_nxShape->getWorldBounds(b);
bounds.MinP.set(b.min.x,b.min.y,b.min.z);
bounds.MaxP.set(b.max.x,b.max.y,b.max.z);
}
void PhysXShape::setLocalPos(const math::matrix4x4&m)
{
NxMat34 nm;
nm.setRowMajor44(m.getMatPointer());
m_nxShape->setLocalPose(nm);
}
void PhysXShape::setLocalTranslation(const math::vector3d&v)
{
m_nxShape->setLocalPosition(ToNxVec3(v));
}
void PhysXShape::setLocalOrintation(const math::quaternion&v)
{
NxMat33 nm;
NxQuat q;
q.setWXYZ(v.w,v.x,v.y,v.z);
nm.fromQuat(q);
m_nxShape->setLocalOrientation(nm);
}
math::matrix4x4 PhysXShape::getLocalPos()const
{
math::matrix4x4 m;
NxMat34 nm=m_nxShape->getLocalPose();
nm.getRowMajor44(m.pointer());
return m;
}
math::vector3d PhysXShape::getLocalTranslation()const
{
NxVec3 r=m_nxShape->getLocalPosition();
return ToVec3(r);
}
math::quaternion PhysXShape::getLocalOrintation()const
{
NxQuat qq;
NxMat33 nm=m_nxShape->getLocalOrientation();
nm.toQuat(qq);
return math::quaternion(qq.w,qq.x,qq.y,qq.z);
}
void PhysXShape::setGlobalPos(const math::matrix4x4&m)
{
NxMat34 nm;
nm.setRowMajor44(m.getMatPointer());
m_nxShape->setGlobalPose(nm);
}
void PhysXShape::setGlobalTranslation(const math::vector3d&v)
{
m_nxShape->setGlobalPosition(ToNxVec3(v));
}
void PhysXShape::setGlobalOrintation(const math::quaternion&v)
{
NxMat33 nm;
NxQuat q;
q.setWXYZ(v.w,v.x,v.y,v.z);
nm.fromQuat(q);
m_nxShape->setGlobalOrientation(nm);
}
math::matrix4x4 PhysXShape::getGlobalPos()const
{
math::matrix4x4 m;
NxMat34 nm=m_nxShape->getLocalPose();
nm.getRowMajor44(m.pointer());
return m;
}
math::vector3d PhysXShape::getGlobalTranslation()const
{
NxVec3 r=m_nxShape->getGlobalPosition();
return ToVec3(r);
}
math::quaternion PhysXShape::getGlobalOrintation()const
{
NxQuat qq;
NxMat33 nm=m_nxShape->getGlobalOrientation();
nm.toQuat(qq);
return math::quaternion(qq.w,qq.x,qq.y,qq.z);
}
void PhysXShape::setMaterial(IPhysicMaterial* mat)
{
CPhysXMaterial*m=(CPhysXMaterial*)mat;
if(!m)
return;
NxMaterialIndex i=m->getMaterialIndex();
}
IPhysicMaterial* PhysXShape::getMaterial()const
{
return 0;
}
void PhysXShape::setSkinWidth(float w)
{
}
float PhysXShape::getSkinWidth()
{
return 0;
}
}
}
| [
"mrayyamen@gmail.com"
] | mrayyamen@gmail.com |
c4cab701528e9f14b98f6b4571a32b148e6ddefd | 8e861d5a4b11fab598b7493b183214ff66f7493a | /DynamicProgramming/Longest-Increasing-Subsequence/54a_LIS_Envelopes.cpp | be26cc15b9edc3e5ab56ca814ddd1e0dfc7bbef2 | [] | no_license | sreekanth025/coding-problems | 9e218a5043403098f72d7798c0d118218f2f0372 | 25031624f6ea652c93886dd92a099a8be75c0b5c | refs/heads/master | 2023-06-17T23:07:16.966184 | 2021-07-20T14:04:59 | 2021-07-20T14:04:59 | 262,855,003 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,178 | cpp | /*
You have a number of envelopes with widths and heights given as a pair of integers (w, h).
One envelope can fit into another if and only if both the width and height of one
envelope is greater than the width and height of the other envelope.
What is the maximum number of envelopes can you Russian doll? (put one inside other)
*/
// Problem Link: https://leetcode.com/problems/russian-doll-envelopes/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int maxEnvelopes(vector<vector<int>>& envelopes) {
int n = envelopes.size();
if(n==0 || n==1) return n;
sort(envelopes.begin(), envelopes.end());
int result = 1;
vector<int> dp(n,1);
for(int i=1; i<n; i++) {
for(int j=0; j<i; j++) {
if((envelopes[i][0] > envelopes[j][0]) &&
(envelopes[i][1] > envelopes[j][1]) &&
(dp[j]+1 > dp[i])) {
dp[i]=dp[j]+1;
}
}
result = max(result, dp[i]);
}
return result;
}
}; | [
"vs25@iitbbs.ac.in"
] | vs25@iitbbs.ac.in |
69d3377747fa2763e1e549e19673a12ee049c9ef | 569d64661f9e6557022cc45428b89eefad9a6984 | /code/centerserver/360_login.cpp | 5f652b22f1e8e40959acb18cbe94b3ffd1db9d88 | [] | no_license | dgkang/ROG | a2a3c8233c903fa416df81a8261aab2d8d9ac449 | 115d8d952a32cca7fb7ff01b63939769b7bfb984 | refs/heads/master | 2020-05-25T02:44:44.555599 | 2019-05-20T08:33:51 | 2019-05-20T08:33:51 | 187,584,950 | 0 | 1 | null | 2019-05-20T06:59:06 | 2019-05-20T06:59:05 | null | UTF-8 | C++ | false | false | 3,881 | cpp | #include "centerserver_pch.h"
#include "360_login.h"
#include "player.h"
#include "gate_handler.h"
#include "player_manager.h"
#include "player_job.h"
#include "md5.h"
#include "config_loader.h"
#include "string_parser.h"
uint16 Parse360LoginParam(const std::string& token, std::string& uid, std::string& loginServerId);
// ==================================================
// 360登录模式
// ==================================================
void Verify360ModeLogin(uint32 gateSvrID, uint64 loginID, const std::string& token, uint32 addrIP, uint16 addrPort)
{
Player* player = 0;
std::string uid;
std::string loginServerName;
uint16 errcode = ERR_FAILED;
errcode = Parse360LoginParam(token, uid, loginServerName);
if(errcode != ERR_SUCCEED)
{
GateHandler::Instance()->SendLoginGameAck(errcode, gateSvrID, loginID);
return;
}
if(!PlayerManager::Instance()->AddVerifyPlayer(gateSvrID, loginID, uid, addrIP, addrPort, uid, uid, ConfigLoader::Instance()->GetPlatformName(), loginServerName))
{
GateHandler::Instance()->SendLoginGameAck(ERR_FAILED, gateSvrID, loginID);
return;
}
}
// ==================================================
// 解析 360 登陆参数
// ==================================================
uint16 Parse360LoginParam(const std::string& token, std::string& uid, std::string& loginServerName)
{
std::map<std::string, std::string> paramMap;
std::string signStr = "";
std::string md5Str ="";
MD5 md5Coder;
uint32 loginTime = 0;
uint32 now = (uint32)Crown::SDNow().GetTimeValue();
// 解析参数
std::vector<std::string> params = Crown::SDSplitStrings(token, '&');
for(uint32 i=0; i < params.size(); ++i)
{
std::vector<std::string> key_value = Crown::SDSplitStrings(params[i], '=');
if(key_value.size() == 2)
{
// 转小写
if(key_value[0] != "server_id")
CommonLib::ToLower(key_value[1]);
paramMap[key_value[0]] = key_value[1];
}
}
// 用户id
if(paramMap.find("qid") == paramMap.end())
{
CnWarn("360 login token no qid\n");
return ERR_LACK_QID;
}
uid = paramMap["qid"];
// 区服id
if(paramMap.find("server_id") == paramMap.end())
{
CnWarn("360 login token no server_id\n");
return ERR_LACK_SERVERID;
}
loginServerName = paramMap["server_id"];
loginServerName = MakeUpServerName(loginServerName);
// 登录时间
if(paramMap.find("time") == paramMap.end())
{
CnWarn("360 login token no time\n");
return ERR_LACK_TIME;
}
// 校验登陆时间(同一个sign过15分钟算超时)
loginTime = Crown::SDAtou(paramMap["time"].c_str());
//if(now > (loginTime + 900)) // 15分钟 = 900秒
//{
// CnWarn("360 login sign time out\n");
// return false;
//}
// 登录签名
if(paramMap.find("sign") == paramMap.end())
{
CnWarn("360 login token no sign\n");
return ERR_LACK_SIGN;
}
// 实名制标识
if(paramMap.find("isAdult") == paramMap.end())
{
CnWarn("360 login token no isAdult\n");
return ERR_LACK_ISADULT;
}
// 拼接签名字符串
signStr = "qid="+ paramMap["qid"] + "&time=" + paramMap["time"];
signStr += "&server_id="+ paramMap["server_id"] + ConfigLoader::Instance()->GetLogin360Key();
// 生成 MD5 码
md5Coder.update(signStr);
// 赋值md5码
md5Str = md5Coder.toString();
// 检查计算出的MD5与用户发来的是否相同,相同则通过校验
if(md5Str == paramMap["sign"])
{
CnInfo("360 login %s %s\n", loginServerName.c_str(), uid.c_str());
return ERR_SUCCEED;
}
CnWarn("360 login token sign error\n");
return ERR_MISMATCH_SIGN;
}
| [
"judge23253@sina.com"
] | judge23253@sina.com |
3d6f5d280c9cbeeda15d8191e0ac79ed1c5a772c | ccfbf5a9ee9c00282c200945bbe36b387eb38b19 | /Codeforces Solutions/codeforces 214A-5.cpp | ac684659c853d1382c467c0107947a3b79c95781 | [] | no_license | sakiib/OnlineJudge-Solutions | e070d4b255d036cdefaf087e9f75b69db708406c | b024352aa99efe548b48ef74c492cb69c1fa89f9 | refs/heads/master | 2023-01-07T20:57:04.259395 | 2020-11-16T08:41:27 | 2020-11-16T08:41:27 | 288,191,980 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,465 | cpp | #include <bits/stdc++.h>
/**
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
using namespace std;
typedef long long int LL;
typedef unsigned long long uLL;
const int inf = (int)1e9;
const LL INF = (LL)1e18;
const int N = 100005;
const LL MOD = 1000000007;
const double EPS = 1e-7;
const double PI = acos( -1.0 );
#define endl '\n'
#define ii pair< int, int >
#define iii pair< int, ii >
#define F first
#define S second
#define pb push_back
#define sc scanf
#define pf printf
#define min3(a, b, c) min( a, min( b, c) )
#define clr( V ) V.clear( )
#define sz( V ) (int)V.size( )
#define min4(a, b, c, d) min( min3( a, b, c),d )
#define Fix( x ) setprecision( x ) << fixed
#define SREV( V ) sort( V.rbegin() , V.rend() )
#define All( V ) V.begin(),V.end()
#define min5(a, b, c, d, e) min( min4( a, b, c, d), e )
#define SORT( V ) sort( V.begin(), V.end() )
#define REV( V ) reverse( V.begin(), V.end() )
#define MEM( a, x ) memset( a, x, sizeof( a ) )
#define max3( a, b, c ) max( a, max( b, c) )
#define mp make_pair
#define pp pop_back
#define max4(a, b, c, d) max( max3( a, b, c ), d )
#define RIGHTMOST __builtin_ctzll
#define POPCOUNT __builtin_popcountll
#define LEFTMOST( x ) ( 63-__builtin_clzll( x ) )
#define max5(a, b, c, d, e) max( max4( a, b, c, d ), e )
#define SQ( x ) ( ( (x)*(x) ) )
#define CU( x ) ( (x)*(x)*(x) )
#define CLR( a, n ) for( int i = 0; i < n; i++ ) a[i].clear()
#define debug( x ) cerr << "X is : " << x << endl
#define FOR( i, a, b ) for( int i = a; i <= b; i++ )
#define ROF( i, b, a ) for( int i = b; i >= a; i-- )
#define REP( i, a ) for( int i = 0; i < a; i++ )
#define Read freopen( "input.txt", "r", stdin )
#define Write freopen( "output.txt", "w", stdout )
#define Fast ios_base :: sync_with_stdio( 0 ); cin.tie(NULL)
#define PQ( x ) priority_queue< x, vector< x >, greater< x > >
#define Unique( a ) sort( All(a) ), a.erase( unique( All(a) ), a.end() )
#define UB( a, key ) upper_bound( a.begin(), a.end(), key ) - a.begin()
#define LB( a, key ) lower_bound( a.begin(), a.end(), key ) - a.begin()
const int dx[] = { +1 , -1 , +0 , +0 };
const int dy[] = { +0 , +0 , +1 , -1 };
const int hx[] = { -2 , -2 , -1 , -1 , +1 , +1 , +2 , +2 };
const int hy[] = { +1 , -1 , +2 , -2 , +2 , -2 , +1 , -1 };
const int fx[] = { -1 , +0 , +1 , +0 , +1 , +1 , -1 , -1 , +0 };
const int fy[] = { +0 , -1 , +0 , +1 , +1 , -1 , +1 , -1 , +0 };
template < typename T > inline T GCD( T a , T b ) { a = abs(a) , b = abs(b); return !b ? a : GCD(b, a % b); }
template < typename T > inline T LCM( T x , T y ) { T g = GCD( x , y ); return x*y/g; }
template < typename T > inline T BigMod ( T b , T p , T mod ) { T res = 1%mod , x = b%mod; while( p ) { if( p&1 ) res = (res*x)%mod; x = (x*x)%mod; p >>= 1; } return res; }
template < typename T > inline T ModInv( T val , T mod ) { return BigMod( val , mod-2 , mod ); }
template < typename T > inline T bigmod ( T b , T p , T mod ) { if( p == 0 ) return 1; T x = bigmod( b , p/2 , mod ); x = ( x*x )%mod; if( p%2 == 1 ) x = ( b*x )%mod; return x; }
template < typename T > inline T NumDigit ( T num , T base ) { return ( (T)( log10((num) )/log10( (base) ) ) )+1; }
template < typename T > inline T Power ( T b , T p ) { T res = 1 , x = b; while( p ) { if( p&1 ) res = (res*x); x = (x*x); p >>=1; } return res; }
template < typename T > inline T IsPrime( T x ) { if( x < 2 ) return false; for( T i = 2; i*i <= x; i++ ) { if( x%i == 0 ) return false; } return true; }
template < typename T > inline T SumDigit( T x ) { T ret = 0; while( x ) { ret += x%10 , x /= 10; } return ret; }
int main( int argc , char const *argv[] ) {
int n , m;
sc("%d %d",&n,&m);
int sq = max( sqrt(n) , sqrt(m) );
int cnt = 0;
FOR( i , 0 , sq ) {
FOR( j , 0 , sq ) {
if( i*i+j == n && i+j*j == m ) cnt++;
}
}
pf("%d\n",cnt);
return 0;
}
| [
"sakibalamin162@gmail.com"
] | sakibalamin162@gmail.com |
9d5f97722f21e766226d0fa15412acee216cfcbd | b060dbf34c1f2a26800f439c5300cebf5f712b90 | /Arduino/rosserial_arduino/msg_gen/cpp/include/rosserial_arduino/Adc.h | 56ed3545aa1d2ca48e86a3ae6ea5b2995d9f64a0 | [] | no_license | laurago894/ITESM-CEM-RESCUE | ddda569b8db225f4413055281e5b0df7bbc25e9f | 78d692c5c8ca3f7c91560a94748a7c4a859f284d | refs/heads/master | 2021-01-01T19:51:37.289819 | 2013-08-02T01:39:14 | 2013-08-02T01:39:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,135 | h | /* Auto-generated by genmsg_cpp for file /home/laura/ros_workspace/Arduino/rosserial_arduino/msg/Adc.msg */
#ifndef ROSSERIAL_ARDUINO_MESSAGE_ADC_H
#define ROSSERIAL_ARDUINO_MESSAGE_ADC_H
#include <string>
#include <vector>
#include <map>
#include <ostream>
#include "ros/serialization.h"
#include "ros/builtin_message_traits.h"
#include "ros/message_operations.h"
#include "ros/time.h"
#include "ros/macros.h"
#include "ros/assert.h"
namespace rosserial_arduino
{
template <class ContainerAllocator>
struct Adc_ {
typedef Adc_<ContainerAllocator> Type;
Adc_()
: adc0(0)
, adc1(0)
, adc2(0)
, adc3(0)
, adc4(0)
, adc5(0)
{
}
Adc_(const ContainerAllocator& _alloc)
: adc0(0)
, adc1(0)
, adc2(0)
, adc3(0)
, adc4(0)
, adc5(0)
{
}
typedef uint16_t _adc0_type;
uint16_t adc0;
typedef uint16_t _adc1_type;
uint16_t adc1;
typedef uint16_t _adc2_type;
uint16_t adc2;
typedef uint16_t _adc3_type;
uint16_t adc3;
typedef uint16_t _adc4_type;
uint16_t adc4;
typedef uint16_t _adc5_type;
uint16_t adc5;
private:
static const char* __s_getDataType_() { return "rosserial_arduino/Adc"; }
public:
ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
private:
static const char* __s_getMD5Sum_() { return "6d7853a614e2e821319068311f2af25b"; }
public:
ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
private:
static const char* __s_getMessageDefinition_() { return "uint16 adc0\n\
uint16 adc1\n\
uint16 adc2\n\
uint16 adc3\n\
uint16 adc4\n\
uint16 adc5\n\
\n\
"; }
public:
ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
{
ros::serialization::OStream stream(write_ptr, 1000000000);
ros::serialization::serialize(stream, adc0);
ros::serialization::serialize(stream, adc1);
ros::serialization::serialize(stream, adc2);
ros::serialization::serialize(stream, adc3);
ros::serialization::serialize(stream, adc4);
ros::serialization::serialize(stream, adc5);
return stream.getData();
}
ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
{
ros::serialization::IStream stream(read_ptr, 1000000000);
ros::serialization::deserialize(stream, adc0);
ros::serialization::deserialize(stream, adc1);
ros::serialization::deserialize(stream, adc2);
ros::serialization::deserialize(stream, adc3);
ros::serialization::deserialize(stream, adc4);
ros::serialization::deserialize(stream, adc5);
return stream.getData();
}
ROS_DEPRECATED virtual uint32_t serializationLength() const
{
uint32_t size = 0;
size += ros::serialization::serializationLength(adc0);
size += ros::serialization::serializationLength(adc1);
size += ros::serialization::serializationLength(adc2);
size += ros::serialization::serializationLength(adc3);
size += ros::serialization::serializationLength(adc4);
size += ros::serialization::serializationLength(adc5);
return size;
}
typedef boost::shared_ptr< ::rosserial_arduino::Adc_<ContainerAllocator> > Ptr;
typedef boost::shared_ptr< ::rosserial_arduino::Adc_<ContainerAllocator> const> ConstPtr;
boost::shared_ptr<std::map<std::string, std::string> > __connection_header;
}; // struct Adc
typedef ::rosserial_arduino::Adc_<std::allocator<void> > Adc;
typedef boost::shared_ptr< ::rosserial_arduino::Adc> AdcPtr;
typedef boost::shared_ptr< ::rosserial_arduino::Adc const> AdcConstPtr;
template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::rosserial_arduino::Adc_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::rosserial_arduino::Adc_<ContainerAllocator> >::stream(s, "", v);
return s;}
} // namespace rosserial_arduino
namespace ros
{
namespace message_traits
{
template<class ContainerAllocator> struct IsMessage< ::rosserial_arduino::Adc_<ContainerAllocator> > : public TrueType {};
template<class ContainerAllocator> struct IsMessage< ::rosserial_arduino::Adc_<ContainerAllocator> const> : public TrueType {};
template<class ContainerAllocator>
struct MD5Sum< ::rosserial_arduino::Adc_<ContainerAllocator> > {
static const char* value()
{
return "6d7853a614e2e821319068311f2af25b";
}
static const char* value(const ::rosserial_arduino::Adc_<ContainerAllocator> &) { return value(); }
static const uint64_t static_value1 = 0x6d7853a614e2e821ULL;
static const uint64_t static_value2 = 0x319068311f2af25bULL;
};
template<class ContainerAllocator>
struct DataType< ::rosserial_arduino::Adc_<ContainerAllocator> > {
static const char* value()
{
return "rosserial_arduino/Adc";
}
static const char* value(const ::rosserial_arduino::Adc_<ContainerAllocator> &) { return value(); }
};
template<class ContainerAllocator>
struct Definition< ::rosserial_arduino::Adc_<ContainerAllocator> > {
static const char* value()
{
return "uint16 adc0\n\
uint16 adc1\n\
uint16 adc2\n\
uint16 adc3\n\
uint16 adc4\n\
uint16 adc5\n\
\n\
";
}
static const char* value(const ::rosserial_arduino::Adc_<ContainerAllocator> &) { return value(); }
};
template<class ContainerAllocator> struct IsFixedSize< ::rosserial_arduino::Adc_<ContainerAllocator> > : public TrueType {};
} // namespace message_traits
} // namespace ros
namespace ros
{
namespace serialization
{
template<class ContainerAllocator> struct Serializer< ::rosserial_arduino::Adc_<ContainerAllocator> >
{
template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
{
stream.next(m.adc0);
stream.next(m.adc1);
stream.next(m.adc2);
stream.next(m.adc3);
stream.next(m.adc4);
stream.next(m.adc5);
}
ROS_DECLARE_ALLINONE_SERIALIZER;
}; // struct Adc_
} // namespace serialization
} // namespace ros
namespace ros
{
namespace message_operations
{
template<class ContainerAllocator>
struct Printer< ::rosserial_arduino::Adc_<ContainerAllocator> >
{
template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::rosserial_arduino::Adc_<ContainerAllocator> & v)
{
s << indent << "adc0: ";
Printer<uint16_t>::stream(s, indent + " ", v.adc0);
s << indent << "adc1: ";
Printer<uint16_t>::stream(s, indent + " ", v.adc1);
s << indent << "adc2: ";
Printer<uint16_t>::stream(s, indent + " ", v.adc2);
s << indent << "adc3: ";
Printer<uint16_t>::stream(s, indent + " ", v.adc3);
s << indent << "adc4: ";
Printer<uint16_t>::stream(s, indent + " ", v.adc4);
s << indent << "adc5: ";
Printer<uint16_t>::stream(s, indent + " ", v.adc5);
}
};
} // namespace message_operations
} // namespace ros
#endif // ROSSERIAL_ARDUINO_MESSAGE_ADC_H
| [
"laurago894@gmail.com"
] | laurago894@gmail.com |
45923d013ca6e78d9c520fb870cf47c623249e17 | b4afc4393ec266a0f47539e46e0ca312ef05ddb2 | /2019.10.24/k_st.cpp | 6bb0e48ce118685d59ddb2668dd558ab9d0b4fcb | [] | no_license | MarryAnt/SPbGU_1_term | e9d756f9825925d5e4977b9ea4b0c53f9768f126 | 613503ef275541f5824d7dc0a23612c48a1173e3 | refs/heads/master | 2020-07-21T22:21:01.797878 | 2019-12-24T10:48:26 | 2019-12-24T10:48:26 | 206,986,506 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 813 | cpp | #include <iostream>
#include <cmath>
using namespace std;
int k_st(int arr[], int l, int r, int k){
if(l >= r){
return arr[l];
}
int i = l;
int j = r;
int p = arr[(l+r)/2];
while(i < j){
while(arr[i] < p){
i++;
}
while(arr[j] > p){
j--;
}
if(i < j){
swap(arr[i],arr[j]);
i++;
j--;
}
}
if((k >= l) && (k < i)){
return k_st(arr, l, i-1, k);
}
else if((j < k) && (k <= r)){
return k_st(arr, j+1, r, k);
}
else{
return arr[p];
}
}
int main(){
int n;
cin >> n;
int arr[n];
for(int i = 0; i < n; i++){
cin >> arr[i];
}
int k;
cin >> k;
cout << k_st(arr, 0, n-1, k-1);
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
6d7c7eb5000a13e2d84801dd2f2bc77e31570668 | 2762ff2bcd294b175ef146669182aaab7fa84375 | /randomcl/hgpu_prng.cpp | 453bbd59afaeeb8ce9ec29eb5bf967f6fff9f28b | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] | permissive | vadimdi/PRNGCL | 3fc4b21b36e2c4fd5445345e278999c6d5bb4352 | e935c9139066a5384ef150de4a54716fc1c24b7b | refs/heads/master | 2021-01-13T01:25:14.756765 | 2017-02-28T00:25:29 | 2017-02-28T00:25:29 | 13,076,392 | 6 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 36,493 | cpp | /******************************************************************************
* @file hgpu_prng.cpp
* @author Vadim Demchik <vadimdi@yahoo.com>
* @version 1.1.2
*
* @brief [PRNGCL library]
* Pseudo-random number generators for HGPU package
*
*
* @section LICENSE
*
* Copyright (c) 2013-2015 Vadim Demchik
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
#include "hgpu_prng.h"
// #define HGPU_PRNG_SKIP_CHECK // skip uniformity checking in double precision
#define HGPU_PRNG_MAX_descriptions 32
#define HGPU_PRNG_MAX_name_length 256
#define HGPU_PRNG_INCLUDE(prng) { \
if (i>=HGPU_PRNG_MAX_descriptions) exit(HGPU_ERROR_ARRAY_OUT_OF_BOUND); \
HGPU_PRNG_descriptions[i++] = prng; \
};
const HGPU_PRNG_description* HGPU_PRNG_descriptions[HGPU_PRNG_MAX_descriptions];
int HGPU_PRNG_descriptions_number = 0;
HGPU_PRNG_internal_state_t HGPU_PRNG_internal_state = {1, 12345, 31415926, 3};
void
HGPU_PRNG_srand(unsigned int randseries){
const size_t md5_buffer_size = 64;
char* md5_ptr = NULL;
char* md5_hash = NULL;
char md5_srand[md5_buffer_size];
HGPU_PRNG_internal_state.x = randseries;
HGPU_PRNG_internal_state.y = 12345;
HGPU_PRNG_internal_state.z = 31415926;
HGPU_PRNG_internal_state.t = 3;
#ifdef PRNGCL_MD5_INIT
// prepare PRNG internal state with md5-hash
memset(md5_srand,0,md5_buffer_size);
sprintf_s(md5_srand,md5_buffer_size,"%x%x%x%x",
HGPU_PRNG_internal_state.x,HGPU_PRNG_internal_state.y,
HGPU_PRNG_internal_state.z,HGPU_PRNG_internal_state.t);
md5_hash = HGPU_md5(md5_srand);
md5_ptr = md5_hash;
memcpy(&(HGPU_PRNG_internal_state.x), md5_ptr, sizeof(HGPU_PRNG_internal_state.x) );
md5_ptr += sizeof(HGPU_PRNG_internal_state.x);
memcpy(&(HGPU_PRNG_internal_state.y), md5_ptr, sizeof(HGPU_PRNG_internal_state.y) );
md5_ptr += sizeof(HGPU_PRNG_internal_state.y);
memcpy(&(HGPU_PRNG_internal_state.z), md5_ptr, sizeof(HGPU_PRNG_internal_state.z) );
md5_ptr += sizeof(HGPU_PRNG_internal_state.z);
memcpy(&(HGPU_PRNG_internal_state.t), md5_ptr, sizeof(HGPU_PRNG_internal_state.t) );
free(md5_hash);
#endif
srand(HGPU_PRNG_internal_state.x);
unsigned int z = 1;
for (int i=0; i<200; i++) z |= HGPU_PRNG_rand32bit();
}
unsigned int
HGPU_PRNG_rand32bit(void){
unsigned long t=(HGPU_PRNG_internal_state.x^(HGPU_PRNG_internal_state.x<<11));
HGPU_PRNG_internal_state.x = HGPU_PRNG_internal_state.y;
HGPU_PRNG_internal_state.y = HGPU_PRNG_internal_state.z;
HGPU_PRNG_internal_state.z = HGPU_PRNG_internal_state.t;
HGPU_PRNG_internal_state.t = (HGPU_PRNG_internal_state.t^(HGPU_PRNG_internal_state.t>>19))^(t^(t>>8));
return HGPU_PRNG_internal_state.t;
}
inline double
trunc(double x){
double z;
modf(x,&z);
return z;
}
double
HGPU_PRNG_double_from_uint(unsigned int rnd1,unsigned int rnd2,unsigned int rnd_min,unsigned int rnd_max,double k){
return (rnd1 + k * rnd2 - (rnd_min + k * rnd_max)) / ((rnd_max - rnd_min) * (1.0 - k));
}
double
HGPU_PRNG_double_from_float(float rnd1,float rnd2,double rnd_min,double rnd_max,double k){
double a1 = (rnd_max - rnd_min);
double a2 = trunc((a1-2.0*k) / k) + a1;
return (trunc((rnd1-rnd_min-k) / k) + rnd2 - rnd_min) * (1.0-k*k) / a2;
// double a1 = (rnd_max - rnd_min);
// double a2 = k * a1;
// double a3 = a1 * (1.0 - k);
// double a4 = -(rnd_min / a1 + rnd_max) * k - rnd_min;
// return (trunc((rnd1 - rnd_min) / a2) + rnd2 / a1) * k / a3 + a4 / a3;
}
double
HGPU_PRNG_double_get_k(int bitness){
double result = 1.0/pow(2.0,bitness);
return result;
}
const HGPU_PRNG_description**
HGPU_PRNG_descriptions_new(void){
int i = 0;
HGPU_PRNG_INCLUDE(HGPU_PRNG_XOR128);
HGPU_PRNG_INCLUDE(HGPU_PRNG_CONSTANT);
HGPU_PRNG_INCLUDE(HGPU_PRNG_XOR7);
HGPU_PRNG_INCLUDE(HGPU_PRNG_RANECU);
HGPU_PRNG_INCLUDE(HGPU_PRNG_RANMAR);
HGPU_PRNG_INCLUDE(HGPU_PRNG_RANLUX);
HGPU_PRNG_INCLUDE(HGPU_PRNG_PM);
HGPU_PRNG_INCLUDE(HGPU_PRNG_MRG32K3A);
HGPU_PRNG_INCLUDE(NULL);
HGPU_PRNG_descriptions_number = (i-1);
return HGPU_PRNG_descriptions;
}
const HGPU_PRNG_description*
HGPU_PRNG_description_get_with_parameters(HGPU_parameter** parameters){
const HGPU_PRNG_description* description = NULL;
HGPU_PRNG_default_randseries = 0;
HGPU_parameter* parameter_prng = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG);
if (parameter_prng && (parameter_prng->value_text))
description = HGPU_PRNG_description_get_with_name(parameter_prng->value_text);
else
description = HGPU_PRNG_default;
HGPU_PRNG_set_default_with_parameters(parameters);
return description;
}
const HGPU_PRNG_description*
HGPU_PRNG_description_get_with_name(const char* prng_name){
const HGPU_PRNG_description* description = NULL;
if (prng_name) {
const HGPU_PRNG_description** prng_all = HGPU_PRNG_descriptions_new();
int i=0;
while ((i<HGPU_PRNG_descriptions_number)&&(!description)){
if(!strcmp(prng_all[i]->name,prng_name)) description = prng_all[i];
i++;
}
if (!description){
fprintf(stderr,"Unknown PRNG: %s\n",prng_name);
fprintf(stderr,"Please, use one of the following PRNGs:\n");
for (int j=0; j<i; j++) fprintf(stderr,"%s\n",prng_all[j]->name);
fprintf(stderr,"\n");
HGPU_error_message(HGPU_ERROR_UNKNOWN_PARAMETER,"unknown PRNG");
}
} else {
description = HGPU_PRNG_description_get_with_parameters(NULL);
}
HGPU_PRNG_default = description;
return description;
}
HGPU_PRNG*
HGPU_PRNG_new(const HGPU_PRNG_description* prng_descr){
HGPU_PRNG* prng = (HGPU_PRNG*) calloc(1,sizeof(HGPU_PRNG));
if (!prng)
HGPU_error_message(HGPU_ERROR_NO_MEMORY,"could not allocate memory for PRNG_description");
prng->state = calloc(1,prng_descr->state_size);
if (!prng->state) {
free(prng);
HGPU_error_message(HGPU_ERROR_NO_MEMORY,"could not allocate memory for PRNG_state");
}
prng->prng = prng_descr;
prng->parameters = (HGPU_PRNG_parameters*) calloc(1,sizeof(HGPU_PRNG_parameters));
prng->parameters->id_buffer_input_seeds = HGPU_GPU_MAX_BUFFERS;
prng->parameters->id_buffer_seeds = HGPU_GPU_MAX_BUFFERS;
prng->parameters->id_buffer_randoms = HGPU_GPU_MAX_BUFFERS;
prng->parameters->id_kernel_produce = HGPU_GPU_MAX_KERNELS;
HGPU_PRNG_set_samples( prng,HGPU_PRNG_default_samples);
HGPU_PRNG_set_instances( prng,HGPU_PRNG_default_instances);
HGPU_PRNG_set_precision( prng,HGPU_PRNG_default_precision);
HGPU_PRNG_set_randseries(prng,HGPU_PRNG_default_randseries);
return prng;
}
HGPU_PRNG*
HGPU_PRNG_new_default(void){
HGPU_PRNG* prng = HGPU_PRNG_new(HGPU_PRNG_default);
HGPU_PRNG_set_precision(prng,HGPU_PRNG_default_precision);
HGPU_PRNG_set_instances(prng,HGPU_PRNG_default_instances);
HGPU_PRNG_set_samples(prng,HGPU_PRNG_default_samples);
HGPU_PRNG_set_randseries(prng,HGPU_PRNG_default_randseries);
return prng;
}
HGPU_PRNG*
HGPU_PRNG_new_with_parameters(HGPU_parameter** parameters){
HGPU_PRNG* prng = HGPU_PRNG_new(HGPU_PRNG_description_get_with_parameters(parameters));
if (prng->prng->parameter_init) (prng->prng->parameter_init)(prng->state,parameters);
return prng;
}
void
HGPU_PRNG_free(HGPU_PRNG* prng){
if(!prng) return;
free(prng->state);
free(prng->parameters);
free(prng);
}
void
HGPU_PRNG_and_buffers_free(HGPU_GPU_context* context,HGPU_PRNG* prng){
// release all buffers
HGPU_GPU_context_buffer_release(context,prng->parameters->id_buffer_input_seeds);
HGPU_GPU_context_buffer_release(context,prng->parameters->id_buffer_seeds);
HGPU_GPU_context_buffer_release(context,prng->parameters->id_buffer_randoms);
HGPU_PRNG_free(prng);
}
void
HGPU_PRNG_set_default_with_parameters(HGPU_parameter** parameters){
if (!parameters) return;
HGPU_parameter* parameter_randseries = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_RANDSERIES);
if (parameter_randseries && (parameter_randseries->value_text)) HGPU_PRNG_set_default_randseries(parameter_randseries->value_integer);
HGPU_precision precision = HGPU_parameters_get_precision(parameters,(char*) HGPU_PARAMETER_PRNG_PRECISION);
if (precision) HGPU_PRNG_set_default_precision(precision);
HGPU_parameter* parameter_samples = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_SAMPLES);
if (parameter_samples && (parameter_samples->value_text)) HGPU_PRNG_set_default_samples(parameter_samples->value_integer);
HGPU_parameter* parameter_instances = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_INSTANCES);
if (parameter_instances && (parameter_instances->value_text)) HGPU_PRNG_set_default_instances(parameter_instances->value_integer);
}
void
HGPU_PRNG_set_default_precision(HGPU_precision precision){
HGPU_PRNG_default_precision = precision;
}
void
HGPU_PRNG_set_default_randseries(unsigned int randseries){
HGPU_PRNG_default_randseries = randseries;
}
void
HGPU_PRNG_set_default_instances(unsigned int instances){
HGPU_PRNG_default_instances = instances;
}
void
HGPU_PRNG_set_default_samples(unsigned int samples){
HGPU_PRNG_default_samples = samples;
}
void
HGPU_PRNG_set_default_prng(const char* prng_name){
HGPU_PRNG_default = NULL;
HGPU_PRNG_default_randseries = 0;
if (prng_name) {
const HGPU_PRNG_description** prng_all = HGPU_PRNG_descriptions_new();
int i=0;
while ((i<HGPU_PRNG_descriptions_number)&&(!HGPU_PRNG_default)){
if(!strcmp(prng_all[i]->name,prng_name)) HGPU_PRNG_default = prng_all[i];
i++;
}
if (!HGPU_PRNG_default){
fprintf(stderr,"Unknown PRNG: %s\n",prng_name);
fprintf(stderr,"Please, use one of the following PRNGs:\n");
for (int j=0; j<i; j++) fprintf(stderr,"%s\n",prng_all[j]->name);
fprintf(stderr,"\n");
HGPU_error_message(HGPU_ERROR_UNKNOWN_PARAMETER,"unknown PRNG");
}
} else {
HGPU_PRNG_default = HGPU_PRNG_description_get_with_parameters(NULL);
}
}
void
HGPU_PRNG_set_precision(HGPU_PRNG* prng,HGPU_precision precision){
prng->parameters->precision = precision;
}
void
HGPU_PRNG_set_randseries(HGPU_PRNG* prng,unsigned int randseries){
prng->parameters->randseries = randseries;
// reinit PRNG
unsigned int srandtime = (unsigned int) time(NULL);
if (!prng->parameters->randseries) prng->parameters->randseries = srandtime; // set time-dependent RANDOM seed (if randseries=0)
(prng->prng->init)(prng->state,prng->parameters->randseries); // CPU seed table initialization
}
void
HGPU_PRNG_set_instances(HGPU_PRNG* prng,unsigned int instances){
prng->parameters->instances = instances;
}
void
HGPU_PRNG_set_samples(HGPU_PRNG* prng,unsigned int samples){
prng->parameters->samples = samples;
}
void
HGPU_PRNG_change_samples(HGPU_GPU_context* context,HGPU_PRNG* prng,unsigned int samples){
unsigned int kernel_id = prng->parameters->id_kernel_produce;
if (kernel_id<HGPU_GPU_MAX_KERNELS) {
HGPU_PRNG_set_samples(prng,samples);
unsigned int number_of_args = HGPU_GPU_context_kernel_get_args_number(context,kernel_id);
if (number_of_args)
HGPU_GPU_context_kernel_bind_constant_by_argument_id(context,kernel_id,&prng->parameters->samples,sizeof(prng->parameters->samples),(number_of_args-1));
}
}
void
HGPU_PRNG_set_with_parameters(HGPU_PRNG* prng,HGPU_parameter** parameters){
if ((!prng) || (!parameters)) return;
HGPU_precision precision = HGPU_parameters_get_precision(parameters,(char*) HGPU_PARAMETER_PRNG_PRECISION);
if (precision) HGPU_PRNG_set_precision(prng,precision);
HGPU_parameter* parameter_samples = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_SAMPLES);
if (parameter_samples && (parameter_samples->value_text)) HGPU_PRNG_set_samples(prng,parameter_samples->value_integer);
HGPU_parameter* parameter_instances = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_INSTANCES);
if (parameter_instances && (parameter_instances->value_text)) HGPU_PRNG_set_instances(prng,parameter_instances->value_integer);
HGPU_parameter* parameter_randseries = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_RANDSERIES);
if (parameter_randseries && (parameter_randseries->value_text)) HGPU_PRNG_set_randseries(prng,parameter_randseries->value_integer);
if (prng->prng->parameter_init) (prng->prng->parameter_init)(prng->state,parameters);
}
unsigned int
HGPU_PRNG_init(HGPU_GPU_context* context,HGPU_PRNG* prng){
unsigned int kernel_id = HGPU_GPU_MAX_KERNELS;
unsigned int PRNG_input_seeds_id = HGPU_GPU_MAX_BUFFERS;
unsigned int PRNG_seeds_id = HGPU_GPU_MAX_BUFFERS;
unsigned int PRNG_randoms_id = HGPU_GPU_MAX_BUFFERS;
if (!context) {
HGPU_GPU_error_note(HGPU_ERROR_BAD_CONTEXT,"context is not initialized");
// or try to initialize context
return kernel_id;
}
if (!prng) {
HGPU_GPU_error_note(HGPU_ERROR_BAD_PRNG,"PRNG is not initialized");
// or try to initialize PRNG
return kernel_id;
}
if (!prng->prng->prng_src) {
HGPU_GPU_error_note(HGPU_ERROR_BAD_PRNG_INIT,"bad PRNG initialization");
// or try to reinitialize PRNG
return kernel_id;
}
// calulate instances
if (!prng->parameters->instances) {
prng->parameters->instances = HGPU_GPU_device_get_max_memory_width(context->device);
prng->parameters->samples = 1 + (prng->parameters->samples - 1) / prng->parameters->instances;
}
char* prng_src = HGPU_io_file_read_with_path(HGPU_io_path_root,prng->prng->prng_src);
char options[HGPU_GPU_MAX_OPTIONS_LENGTH];
int j2 = sprintf_s(options,HGPU_GPU_MAX_OPTIONS_LENGTH,"-I %s%s",HGPU_io_path_root,PRNGCL_ROOT_PATH);
if (prng->parameters->precision==HGPU_precision_double) j2 += sprintf_s(options+j2,HGPU_GPU_MAX_OPTIONS_LENGTH-j2," -D PRNG_PRECISION=2");
#ifdef HGPU_PRNG_SKIP_CHECK
j2 += sprintf_s(options+j2,HGPU_GPU_MAX_OPTIONS_LENGTH-j2," -D PRNG_SKIP_CHECK");
#endif
// additional particular options of PRNG
// include additional options for opencl
if (prng->prng->GPU_options) {
char* add_options = (*prng->prng->GPU_options)(context,prng->state,prng->parameters);
if ((add_options) && (strlen(add_options)>0)) j2 += sprintf_s(options+j2,HGPU_GPU_MAX_OPTIONS_LENGTH-j2," %s",add_options);
free(add_options);
}
// compile opencl program
cl_program prg = HGPU_GPU_program_with_options_new(prng_src,options,context);
// make memory objects: prepare seed tables (input and working)
// perform input seed table by PRNG subroutine
(*prng->prng->GPU_init)(context,prng->state,prng->parameters);
PRNG_input_seeds_id = prng->parameters->id_buffer_input_seeds;
PRNG_seeds_id = prng->parameters->id_buffer_seeds;
PRNG_randoms_id = prng->parameters->id_buffer_randoms;
const size_t global_size[] = {prng->parameters->instances}; // global_size
if ((PRNG_input_seeds_id<HGPU_GPU_MAX_BUFFERS) && (PRNG_seeds_id<HGPU_GPU_MAX_BUFFERS) && (prng->prng->init_kernel)) {
// make seed preparation kernel
unsigned int kernel_seed_id = HGPU_GPU_context_kernel_init(context,prg,prng->prng->init_kernel,1,global_size,NULL);
HGPU_GPU_context_kernel_bind_buffer(context,kernel_seed_id,PRNG_input_seeds_id);
HGPU_GPU_context_kernel_bind_buffer(context,kernel_seed_id,PRNG_seeds_id);
// run seed preparation kernel
HGPU_GPU_context_kernel_run(context,kernel_seed_id);
}
// release input seed table
if (PRNG_input_seeds_id<HGPU_GPU_MAX_BUFFERS)
HGPU_GPU_context_buffer_release(context,PRNG_input_seeds_id);
// make working kernel
kernel_id = HGPU_GPU_context_kernel_init(context,prg,prng->prng->production_kernel, 1,global_size,NULL);
if (PRNG_seeds_id<HGPU_GPU_MAX_BUFFERS) HGPU_GPU_context_kernel_bind_buffer(context,kernel_id,PRNG_seeds_id);
if (PRNG_randoms_id<HGPU_GPU_MAX_BUFFERS) HGPU_GPU_context_kernel_bind_buffer(context,kernel_id,PRNG_randoms_id);
HGPU_GPU_context_kernel_bind_constant(context,kernel_id,&prng->parameters->samples,sizeof(prng->parameters->samples));
prng->parameters->id_buffer_randoms = PRNG_randoms_id;
prng->parameters->id_kernel_produce = kernel_id;
free(prng_src);
return kernel_id;
}
void
HGPU_PRNG_produce(HGPU_GPU_context* context,unsigned int prng_kernel_id){
HGPU_GPU_context_kernel_run(context,prng_kernel_id);
}
double
HGPU_PRNG_produce_CPU_float_one(HGPU_PRNG* prng,unsigned int){
return (double) ((float) prng->prng->CPU_produce_one_double(prng->state));
}
double
HGPU_PRNG_produce_CPU_double_one(HGPU_PRNG* prng,unsigned int){
return prng->prng->CPU_produce_one_double(prng->state);
}
double
HGPU_PRNG_produce_CPU_floatN_one(HGPU_PRNG* prng,unsigned int prns_drop){
double result = 0.0;
double prng_k = prng->prng->k_value;
float rnd1, rnd2;
rnd1 = (float) (prng->prng->CPU_produce_one_double)(prng->state);
#ifndef HGPU_PRNG_SKIP_CHECK
bool flag = true;
while (flag) {
#endif
rnd2 = (float) (prng->prng->CPU_produce_one_double)(prng->state);
#ifndef HGPU_PRNG_SKIP_CHECK
if ((rnd1 > prng->prng->min_double_value) && (rnd1 < prng->prng->max_double_value))
flag = false;
else {
// pass prns_drop prns
for (unsigned int i=0;i<prns_drop;i++) rnd1 = (float) (prng->prng->CPU_produce_one_double)(prng->state);
rnd1 = rnd2;
}
}
#endif
result = HGPU_PRNG_double_from_float(rnd1,rnd2,prng->prng->min_double_value,prng->prng->max_double_value,prng_k);
return result;
}
double
HGPU_PRNG_produce_CPU_uintN_one(HGPU_PRNG* prng,unsigned int prns_drop){
double result = 0.0;
double prng_k = prng->prng->k_value;
unsigned int rnd1, rnd2;
rnd1 = (prng->prng->CPU_produce_one_uint)(prng->state);
#ifndef HGPU_PRNG_SKIP_CHECK
bool flag = true;
while (flag) {
#endif
rnd2 = (prng->prng->CPU_produce_one_uint)(prng->state);
#ifndef HGPU_PRNG_SKIP_CHECK
if ((rnd1 > prng->prng->min_uint_value) && (rnd1 < prng->prng->max_uint_value))
flag = false;
else {
// pass prns_drop prns
for (unsigned int i=0;i<prns_drop;i++) rnd1 = (prng->prng->CPU_produce_one_uint)(prng->state);
rnd1 = rnd2;
}
}
#endif
result = HGPU_PRNG_double_from_uint(rnd1,rnd2,prng->prng->min_uint_value,prng->prng->max_uint_value,prng_k);
return result;
}
double
HGPU_PRNG_produce_CPU_one(HGPU_PRNG* prng){
double result = 0.0;
if (!prng){
HGPU_GPU_error_note(HGPU_ERROR_BAD_PRNG,"PRNG is not initialized");
return result;
}
double (*prng_produce_one)(HGPU_PRNG*,unsigned int);
double prng_k = prng->prng->k_value;
unsigned int prng_drop = 0;
prng_produce_one = NULL;
if (prng->parameters->precision==HGPU_precision_double) {
if ((prng->prng->output_type == HGPU_PRNG_output_type_double) || (!prng_k)) {
prng_produce_one = &HGPU_PRNG_produce_CPU_double_one;
} else {
if (((prng->prng->output_type == HGPU_PRNG_output_type_uint) ||
(prng->prng->output_type == HGPU_PRNG_output_type_uint4) ||
(prng->prng->output_type == HGPU_PRNG_output_type_uint4by1)) && (prng->prng->CPU_produce_one_uint)) {
prng_drop = HGPU_PRNG_get_output_type_values(prng) - 1;
if (prng->prng->output_type == HGPU_PRNG_output_type_uint4by1) prng_drop = 0;
prng_produce_one = &HGPU_PRNG_produce_CPU_uintN_one;
} else {
prng_drop = HGPU_PRNG_get_output_type_values(prng) - 1;
if (prng->prng->output_type == HGPU_PRNG_output_type_float4by1) prng_drop = 0;
prng_produce_one = &HGPU_PRNG_produce_CPU_floatN_one;
}
}
} else {
prng_produce_one = &HGPU_PRNG_produce_CPU_float_one;
}
if (prng_produce_one)
result = (*prng_produce_one)(prng,prng_drop);
return result;
}
void
HGPU_PRNG_produce_CPU(HGPU_PRNG* prng,double** randoms_CPU,unsigned int number_of_prns){
if ((!prng) || (!randoms_CPU) || (!number_of_prns)) return;
double* result = (*randoms_CPU);
if (!result) {
result = (double*) calloc(number_of_prns,sizeof(double));
if (!result)
HGPU_error_message(HGPU_ERROR_NO_MEMORY,"could not allocate memory for PRNG_CPU_output");
}
double (*prng_produce_one)(HGPU_PRNG*,unsigned int);
double prng_k = prng->prng->k_value;
unsigned int prng_drop = 0;
prng_produce_one = NULL;
if (prng->parameters->precision==HGPU_precision_double) {
if ((prng->prng->output_type == HGPU_PRNG_output_type_double) || (!prng_k)) {
prng_produce_one = &HGPU_PRNG_produce_CPU_double_one;
} else {
if (((prng->prng->output_type == HGPU_PRNG_output_type_uint) ||
(prng->prng->output_type == HGPU_PRNG_output_type_uint4) ||
(prng->prng->output_type == HGPU_PRNG_output_type_uint4by1)) && (prng->prng->CPU_produce_one_uint)) {
prng_drop = HGPU_PRNG_get_output_type_values(prng) - 1;
if (prng->prng->output_type == HGPU_PRNG_output_type_uint4by1) prng_drop = 0;
prng_produce_one = &HGPU_PRNG_produce_CPU_uintN_one;
} else {
prng_drop = HGPU_PRNG_get_output_type_values(prng) - 1;
if (prng->prng->output_type == HGPU_PRNG_output_type_float4by1) prng_drop = 0;
prng_produce_one = &HGPU_PRNG_produce_CPU_floatN_one;
}
}
} else {
prng_produce_one = &HGPU_PRNG_produce_CPU_float_one;
}
if (prng_produce_one)
for (unsigned int i=0; i<number_of_prns; i++)
result[i] = (*prng_produce_one)(prng,prng_drop);
(*randoms_CPU) = result;
}
char*
HGPU_PRNG_make_header(HGPU_PRNG* prng){
char* result = NULL;
if (!prng) return result;
int j = 0;
char buffer[HGPU_GPU_MAX_OPTIONS_LENGTH];
j += sprintf_s(buffer+j,HGPU_GPU_MAX_OPTIONS_LENGTH-j," PRNGCL library ver.%u.%u.%u\n",PRNGCL_VERSION_MAJOR,PRNGCL_VERSION_MINOR,PRNGCL_VERSION_MICRO);
j += sprintf_s(buffer+j,HGPU_GPU_MAX_OPTIONS_LENGTH-j," ***************************************************\n");
j += sprintf_s(buffer+j,HGPU_GPU_MAX_OPTIONS_LENGTH-j," PRNG : %s\n",prng->prng->name);
j += sprintf_s(buffer+j,HGPU_GPU_MAX_OPTIONS_LENGTH-j," PRNG precision : %s\n",HGPU_convert_precision_to_str(prng->parameters->precision));
j += sprintf_s(buffer+j,HGPU_GPU_MAX_OPTIONS_LENGTH-j," PRNG randseries : %u\n",prng->parameters->randseries);
j += sprintf_s(buffer+j,HGPU_GPU_MAX_OPTIONS_LENGTH-j," PRNG instances : %u\n",prng->parameters->instances);
j += sprintf_s(buffer+j,HGPU_GPU_MAX_OPTIONS_LENGTH-j," PRNG samples : %u\n",prng->parameters->samples);
j += sprintf_s(buffer+j,HGPU_GPU_MAX_OPTIONS_LENGTH-j," ***************************************************\n");
size_t result_length = strlen(buffer) + 1;
result = (char*) calloc(result_length,sizeof(char));
j = sprintf_s(result,result_length,"%s",buffer);
return result;
}
double
HGPU_PRNG_GPU_get_from_buffer(HGPU_GPU_context* context,HGPU_PRNG* prng,unsigned int index){
double result = 0.0;
if ((!context) || (!prng)) return result;
void* results_ptr = HGPU_GPU_context_buffer_get_mapped(context,prng->parameters->id_buffer_randoms);
cl_float4* pointer_to_randoms = NULL;
cl_double4* pointer_to_randoms_double = NULL;
unsigned int output_type_vals = HGPU_PRNG_get_output_type_values(prng);
unsigned int index_s = 0;
unsigned int index_h = 0;
unsigned int index_o = 0;
if (prng->parameters->precision==HGPU_precision_double)
pointer_to_randoms_double = (cl_double4*) results_ptr;
else
pointer_to_randoms = (cl_float4*) results_ptr;
if ((pointer_to_randoms) || (pointer_to_randoms_double)) {
unsigned int offset = prng->parameters->instances;
if (output_type_vals == 1) {
index_s = (index / offset) & 3;
index_h = index % offset;
index_o = (index / (4 * offset));
}
if (output_type_vals == 4) {
index_s = (index & 3);
index_h = ((index >> 2) % offset) ;
index_o = ((index >> 2) / offset);
}
if (prng->parameters->precision==HGPU_precision_double)
result = pointer_to_randoms_double[index_o + offset*index_h].s[index_s];
else
result = pointer_to_randoms[index_o + offset*index_h].s[index_s];
}
return result;
}
unsigned int
HGPU_PRNG_get_output_type_values(HGPU_PRNG* prng){
unsigned int result = 1;
if ((prng->prng->output_type == HGPU_PRNG_output_type_uint ) ||
(prng->prng->output_type == HGPU_PRNG_output_type_float ) ||
(prng->prng->output_type == HGPU_PRNG_output_type_double))
result = 1;
if ((prng->prng->output_type == HGPU_PRNG_output_type_uint4 ) ||
(prng->prng->output_type == HGPU_PRNG_output_type_uint4by1 ) ||
(prng->prng->output_type == HGPU_PRNG_output_type_float4 ) ||
(prng->prng->output_type == HGPU_PRNG_output_type_float4by1) ||
(prng->prng->output_type == HGPU_PRNG_output_type_double4) )
result = 4;
return result;
}
void
HGPU_PRNG_write_results(HGPU_GPU_context* context,HGPU_PRNG* prng,const char* file_path,const char* file_name){
FILE *stream;
char* buffer = (char*) calloc(HGPU_FILENAME_MAX,sizeof(char));
if (!buffer) HGPU_error(HGPU_ERROR_NO_MEMORY);
HGPU_io_path_join_filename(&buffer,HGPU_FILENAME_MAX,file_path,file_name);
fopen_s(&stream,buffer,"w+");
if(stream){
char* header = HGPU_PRNG_make_header(prng);
fprintf(stream,"%s",header);
unsigned int output_type_vals = HGPU_PRNG_get_output_type_values(prng);
unsigned int number_of_prns = prng->parameters->samples * output_type_vals;
for (unsigned int i=0; i<number_of_prns; i++)
fprintf(stream,"[%5u] % .20e\n",i,HGPU_PRNG_GPU_get_from_buffer(context,prng,i));
if (fclose(stream)) HGPU_error_note(HGPU_ERROR_FILE_NOT_CLOSED,"the file was not closed");
free(header);
}
free(buffer);
}
void
HGPU_PRNG_write_output_text(HGPU_GPU_context* context,HGPU_PRNG* prng,const char* file_path,const char* file_name){
FILE *stream;
char* buffer = (char*) calloc(HGPU_FILENAME_MAX,sizeof(char));
if (!buffer) HGPU_error(HGPU_ERROR_NO_MEMORY);
HGPU_io_path_join_filename(&buffer,HGPU_FILENAME_MAX,file_path,file_name);
fopen_s(&stream,buffer,"w+");
if(stream){
unsigned int output_type_vals = HGPU_PRNG_get_output_type_values(prng);
unsigned int number_of_prns = prng->parameters->instances * prng->parameters->samples * output_type_vals;
for (unsigned int i=0; i<(number_of_prns>>2); i++){
for (unsigned int j=0; j<MIN(4,(number_of_prns-i*4)); j++)
fprintf(stream,"% .20e ",HGPU_PRNG_GPU_get_from_buffer(context,prng,i*4+j));
fprintf(stream,"\n");
}
if (fclose(stream)) HGPU_error_note(HGPU_ERROR_FILE_NOT_CLOSED,"the file was not closed");
}
free(buffer);
}
unsigned int
HGPU_PRNG_test(HGPU_GPU_context* context,HGPU_parameter** parameters,const HGPU_PRNG_description* prng_descr,unsigned int randseries,
HGPU_precision precision,unsigned int number,double test_value){
unsigned int result = 0;
HGPU_PRNG_set_default_precision(precision);
HGPU_PRNG_set_default_randseries(randseries);
HGPU_PRNG_set_default_samples(number);
HGPU_parameter* parameter_instances = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_INSTANCES);
if (parameter_instances && (parameter_instances->value_text)) HGPU_PRNG_set_default_instances(parameter_instances->value_integer);
HGPU_PRNG* prng = HGPU_PRNG_new(prng_descr);
if (randseries) HGPU_PRNG_set_randseries(prng,randseries);
double* CPU_results = (double*) calloc(number+1,sizeof(double));
if (!CPU_results)
HGPU_error_message(HGPU_ERROR_NO_MEMORY,"could not allocate memory for results");
unsigned int prng_id = HGPU_PRNG_init(context,prng);
HGPU_PRNG_produce_CPU(prng,&CPU_results,number);
double CPU_value = CPU_results[number-1];
HGPU_PRNG_produce(context,prng_id);
unsigned int output_type_vals = HGPU_PRNG_get_output_type_values(prng);
unsigned int number_of_prns = prng->parameters->samples * output_type_vals;
double GPU_prn, CPU_prn;
for (unsigned int i=0; i<number_of_prns; ++i) {
if (precision==HGPU_precision_single) {
GPU_prn = ((float) HGPU_PRNG_GPU_get_from_buffer(context,prng,i));
CPU_prn = ((float) CPU_results[i]);
} else {
GPU_prn = HGPU_PRNG_GPU_get_from_buffer(context,prng,i);
CPU_prn = CPU_results[i];
}
if (GPU_prn!=CPU_prn) {
printf("[%u]:\t GPU: % .20e CPU: % .20e difference: % e\n",(unsigned int) i,GPU_prn,CPU_prn,(GPU_prn-CPU_prn));
result++;
}
}
double test_value_norm = test_value;
if (prng->parameters->precision==HGPU_precision_single) test_value_norm = (double) ((float) test_value);
if (test_value_norm!=CPU_value) {
printf("Expected: % .20e Generated: % .20e Difference: % e\n",test_value_norm,CPU_value,(test_value_norm-CPU_value));
result++;
}
printf("%s (%s): ",prng->prng->name,HGPU_convert_precision_to_str(prng->parameters->precision));
if (result)
printf("%u test(s) failed!!!\n",result);
else
printf("all tests passed\n");
free(CPU_results);
HGPU_PRNG_and_buffers_free(context,prng);
return result;
}
double
HGPU_PRNG_benchmark(HGPU_GPU_context* context,HGPU_parameter** parameters,const HGPU_PRNG_description* prng_descr,HGPU_precision precision){
double result = 0.0;
unsigned int max_cycles = HGPU_PRNG_TEST_MAX_PASSES; // HGPU_PRNG_TEST_MAX_PASSES=test maximum number of passes
double duration = HGPU_PRNG_TEST_MAX_DURATION; // HGPU_PRNG_TEST_DURATION =test duration in seconds
HGPU_PRNG_set_default_precision(precision);
HGPU_PRNG_set_default_randseries(1);
HGPU_parameter* parameter_samples = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_SAMPLES);
HGPU_parameter* parameter_instances = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_INSTANCES);
HGPU_parameter* parameter_cycles = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_TEST_MAX_PASSES);
HGPU_parameter* parameter_duration = HGPU_parameters_get_by_name(parameters,(char*) HGPU_PARAMETER_PRNG_TEST_MAX_DURATION);
if (parameter_cycles && (parameter_cycles->value_text)) max_cycles = parameter_cycles->value_integer;
if (parameter_duration && (parameter_duration->value_text)) duration = parameter_duration->value_double;
HGPU_PRNG_set_default_with_parameters(parameters);
HGPU_PRNG* prng = HGPU_PRNG_new(prng_descr);
unsigned int instances = HGPU_GPU_device_get_max_memory_width(context->device);
if (parameter_instances && (parameter_instances->value_text)) instances = parameter_instances->value_integer;
unsigned int output_type_vals = 4;
unsigned long int alloc_memory = HGPU_GPU_device_get_max_allocation_memory(context->device);
unsigned int elem_size = (precision==HGPU_precision_single) ? sizeof(cl_float) : sizeof(cl_double);
unsigned int samples = HGPU_convert_round_to_power_2((unsigned int)(((alloc_memory >> 1) - prng->prng->state_size * instances) /
(elem_size * output_type_vals * instances)));
unsigned int samples_best = samples;
if (parameter_samples && (parameter_samples->value_text)) samples = parameter_samples->value_integer;
HGPU_PRNG_set_instances(prng,instances);
HGPU_PRNG_set_samples(prng,samples);
unsigned int prng_id = HGPU_PRNG_init(context,prng);
// context->debug_flags.max_workgroup_size = 256;
// HGPU_GPU_context_kernel_limit_max_workgroup_size(context,prng_id);
double last_start_et = 0.0;
while (samples) {
HGPU_PRNG_change_samples(context,prng,samples);
unsigned int cycles = 0;
double time_elapsed = 0.0;
HGPU_timer time_start = HGPU_timer_start();
while((time_elapsed<duration) && (cycles<max_cycles)) {
HGPU_PRNG_produce(context,prng_id);
cycles++;
time_elapsed = HGPU_timer_get(time_start);
}
double prns = ((double) cycles) * ((double) prng->parameters->samples) * ((double) prng->parameters->instances) * ((double) output_type_vals);
double productivity = 0.0;
HGPU_timer_deviation elapsed_time = HGPU_timer_deviation_default;
HGPU_GPU_kernel* kernel = HGPU_GPU_kernel_get_by_index(context->kernel,prng_id);
if (kernel) {
double e_time = 0.0;
if (context->debug_flags.profiling) {
elapsed_time = HGPU_GPU_kernel_get_time_execution(kernel);
e_time = elapsed_time.mean - last_start_et;
} else
e_time = HGPU_convert_s_to_ns(time_elapsed);
productivity = HGPU_convert_B_to_GBS(prns,e_time);
if (result<productivity) {
result = productivity;
samples_best = samples;
}
last_start_et = elapsed_time.mean;
}
printf("Perf: %1.2e (Gsamples/sec) - %e PRNs (%u samples - %u cycles - %u instances) per %e seconds\n",productivity,prns,samples,cycles,prng->parameters->instances,time_elapsed);
samples = samples >> 1;
}
printf("\nPRNG: %s\n",prng->prng->name);
printf("Precision: %s\n",HGPU_convert_precision_to_str(prng->parameters->precision));
printf("Instances: %u\n",prng->parameters->instances);
printf("Best productivity (Gsamples/sec): %e\n",result);
printf("Best samples: %u\n",samples_best);
HGPU_PRNG_and_buffers_free(context,prng);
return result;
}
| [
"vadimdi@yahoo.com"
] | vadimdi@yahoo.com |
239870d7a50eab30c7f01353a69a3252f064645a | 630f7abd037c8f6a8192234ac16ffd43325cd16a | /dependencies/imgui/addons/imguiyesaddons/imguistringifier.h | dfb1af0a00c47a6ca36f7cd7f1405d75067ad269 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | Cloudxtreme/MQ2Nav | e71dd9d489c99e4f810f2e158fa19fcc4499ea76 | 6a0a78b315f63a8d22de12bcd130a090a0da9adb | refs/heads/master | 2020-03-21T14:49:17.822629 | 2018-04-21T04:30:13 | 2018-04-21T04:30:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,384 | h | #ifndef IMGUISTRINGIFIER_H_
#define IMGUISTRINGIFIER_H_
#ifndef IMGUI_API
#include <imgui.h> // ImVector
#endif //IMGUI_API
// Base64Encode(...) and Base64Decode(...) embed libb64 (stripped from STL <iostream> header file):
// LIBB64 LICENSE (libb64.sourceforge.net):
/*
Copyright-Only Dedication (based on United States law)
or Public Domain Certification
The person or persons who have associated work with this document (the
"Dedicator" or "Certifier") hereby either (a) certifies that, to the best of
his knowledge, the work of authorship identified is in the public domain of the
country from which the work is published, or (b) hereby dedicates whatever
copyright the dedicators holds in the work of authorship identified below (the
"Work") to the public domain. A certifier, moreover, dedicates any copyright
interest he may have in the associated work, and for these purposes, is
described as a "dedicator" below.
A certifier has taken reasonable steps to verify the copyright status of this
work. Certifier recognizes that his good faith efforts may not shield him from
liability if in fact the work certified is not in the public domain.
Dedicator makes this dedication for the benefit of the public at large and to
the detriment of the Dedicator's heirs and successors. Dedicator intends this
dedication to be an overt act of relinquishment in perpetuity of all present
and future rights under copyright law, whether vested or contingent, in the
Work. Dedicator understands that such relinquishment of all rights includes
the relinquishment of all rights to enforce (by lawsuit or otherwise) those
copyrights in the Work.
Dedicator recognizes that, once placed in the public domain, the Work may be
freely reproduced, distributed, transmitted, used, modified, built upon, or
otherwise exploited by anyone for any purpose, commercial or non-commercial,
and in any way, including by methods that have not yet been invented or
conceived.
*/
// USAGE
/*
// HOW DO I EMBED Base64/85 INSIDE MY SOURCE CODE ? (OTHER FORMATS WORK IN A SIMILIAR WAY)
Hp) const char* input;int inputSize; // They contain my binary stuff (e.g. in imguihelper.h: ImGuiHelper::GetFileContent(...))
ImVector<char>& encodedText;
if (ImGui::Base64Encode(input,inputSize,encodedText,true)) // 'true' is mandatory if we want to embed the output
{
// Write &encodedText[0] to a file (e.g. "encodedOutput.inl")
}
// To load it back inside another project:
const char source[] =
#include "encodedOutput.inl" // generated with Base64Encode(... , true) or similiar
ImVector<char> decodedBin;
if (ImGui::Base64Decode(source,decodedBin)) {
// Now &decodedBin[0] should be what we need
}
// If we need the source_size we can just use:
// a) sizeof(source) if binary (= the inline file contains numbers).
// b) strlen(source) or sizeof(source)-1 if text-based (= the inline file contains a long string, so there is an implicit '\0' termination).
Also see imguibz2.h and imguihelper.h (the latter has methods to decode directly from a file path).
*/
namespace ImGui {
IMGUI_API bool Base64Encode(const char* input,int inputSize,ImVector<char>& output,bool stringifiedMode=false,int numCharsPerLineInStringifiedMode=112);
IMGUI_API bool Base64Decode(const char* input,ImVector<char>& output);
IMGUI_API bool Base85Encode(const char* input,int inputSize,ImVector<char>& output,bool stringifiedMode=false,int numCharsPerLineInStringifiedMode=112);
IMGUI_API bool Base85Decode(const char* input,ImVector<char>& output);
IMGUI_API bool BinaryStringify(const char* input,int inputSize,ImVector<char>& output,int numInputBytesPerLineInStringifiedMode=80);
IMGUI_API bool TextStringify(const char* input,ImVector<char>& output,int numCharsPerLineInStringifiedMode=0,int inputSize=0);
#ifdef YES_IMGUIBZ2
#ifndef BZ_DECOMPRESS_ONLY
IMGUI_API bool Bz2Base64Encode(const char* input,int inputSize,ImVector<char>& output,bool stringifiedMode=false,int numCharsPerLineInStringifiedMode=112);
IMGUI_API bool Bz2Base85Encode(const char* input,int inputSize,ImVector<char>& output,bool stringifiedMode=false,int numCharsPerLineInStringifiedMode=112);
#endif //BZ_DECOMPRESS_ONLY
IMGUI_API bool Bz2Base64Decode(const char* input,ImVector<char>& output);
IMGUI_API bool Bz2Base85Decode(const char* input,ImVector<char>& output);
#endif //YES_IMGUIBZ2
} // namespace ImGui
#endif // IMGUISTRINGIFIER_H_
| [
"brainiac2k@gmail.com"
] | brainiac2k@gmail.com |
eb932f953f7cb59ef09a7bdeaa33286c7787ccab | be5aff02a885d1a25766e9bfa735c9554ff662fa | /Rahul/sketch_jan10a/sketch_jan10a.ino | c2b21e1b04600194110a529c8ee7066fb40818cb | [] | no_license | TheNishantK/SAE_NITK_Electronics | 9a4882595910f3bc583e6bd9ade6e65c671c980e | 4eecff94226aa93b5c509bc4d59b0b143193953f | refs/heads/master | 2023-06-09T14:29:28.395181 | 2021-07-03T07:13:25 | 2021-07-03T07:13:25 | 117,209,727 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 354 | ino | #include<SoftwareSerial.h>
SoftwareSerial lcd(10,11);
String data="",rpm="",temp="",fuel="";
char ch;
void setup() {
// put your setup code here, to run once:
lcd.begin(9600);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
while(lcd.available())
{ data+=lcd.read();
//data+=ch;
}
Serial.println(data);
}
| [
"rahul157vanshi@gmail.com"
] | rahul157vanshi@gmail.com |
9f5804066aa3810adf2a586554b2b7652db1e04d | bbe0fdc391b325ec0ec6cb899f133a2b7ffacd14 | /cs315/Lab02/isPal.cpp | 4b711724dbb73384578680428e05571b0619d9ac | [] | no_license | juanm707/SonomaStateCourseWork | fe9795c0c268628a64aafa4643a89426f13f6b34 | 970123554d5ac692547fc3c09faea52670844d60 | refs/heads/master | 2023-05-25T17:56:33.791972 | 2020-05-13T08:14:24 | 2020-05-13T08:14:24 | 263,552,635 | 2 | 0 | null | 2023-05-22T22:19:27 | 2020-05-13T07:09:04 | Python | UTF-8 | C++ | false | false | 1,254 | cpp | //////////////////////////////////////////
// Author: Juan Martinez //
// Student: Juan Martinez //
// Term: Fall 2017 //
// Course: CS 315 //
// Assignment: Lab 02 //
// Date: 9/25/17 //
// Professor: Dr. Kooshesh //
// File: isPal.cpp //
//////////////////////////////////////////
bool isPalIterative(const char *s, int n) {
// s contains n characters. The function uses an iterative
// algorithm to determine if s contains a string that is a palindrome or
// not.
for (int i = 0; i < n/2; i++)
{
if (s[i] != s[n - 1 - i])
{
return false;
}
}
return true;
}
bool isPalRecursive(const char *s, int start, int n) {
// s contains n characters. The function uses a recursive
// algorithm to determine if s contains a string that is a palindrome or
// not. When the function is called for the first time, start will
// contain zero, the index of the first element of s.
if (n == 0)
return true;
if (n == 1)
return true;
if (s[start] == s[n-1])
return isPalRecursive(s, start + 1, n - 1);
else
return false;
}
| [
"juanm.jm49@gmail.com"
] | juanm.jm49@gmail.com |
17b7212fbf3d99242ca5b18f77c41bcdd827e260 | be5cffc6c8b5b4816595fd00c84d4751e5289360 | /Finale/bicicletta.cpp | 43539a6af37483fd40fb56244e8859933048e0a0 | [] | no_license | Daragona/ProgettoPao | 33b740b77f7c8960ea38426f368b48d99e945175 | 577b8c037c2fba91c585cc7e8047de102e90e2e5 | refs/heads/main | 2023-05-31T17:10:06.355723 | 2021-06-16T13:13:06 | 2021-06-16T13:13:06 | 325,549,441 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 983 | cpp | #include "bicicletta.h"
bicicletta::bicicletta(const string &Marca_,const string &Modello_,const double &Price_, const int &Quantity_, const bool &Used_, const string &Telaio_, const string &Manubrio_,const string &Sella_, const string &Corona_, const double &diamRuote_):
veicolo(Marca_,Modello_,Price_, Quantity_, Used_),
Telaio(Telaio_),Manubrio(Manubrio_),Sella(Sella_),Corona(Corona_),diamRuote(diamRuote_)
{}
string bicicletta::getSella() const{
return Sella;
}
string bicicletta::getCorona() const {
return Corona;
}
double bicicletta::getDiamRuote() const{
return diamRuote;
}
bool bicicletta::operator==(veicolo& compare)const{
const bicicletta* compareCast=dynamic_cast<const bicicletta*>(&compare);
if(!compareCast) return false;
return Telaio==compareCast->Telaio && Manubrio==compareCast->Manubrio && Sella==compareCast->Sella && diamRuote==compareCast->diamRuote && veicolo::operator==(compare);
}
| [
"noreply@github.com"
] | noreply@github.com |
8404a6442dbf116510d690ec11d92d67bdd36d6d | 0d1409a3437cfbdcfe61082433f8b6822771b72e | /Practica3/filosofos-interb.cpp | c7b64031cd4f651e79db6aa5181b0c6f48132f1b | [] | no_license | ManuelJNunez/SCD | 8e2d1efef86a4aa78fada396d5c3407cf75d895d | 69c262411139c5620a83c78811233aded1f5911f | refs/heads/master | 2020-04-20T11:47:16.889234 | 2019-02-02T11:55:17 | 2019-02-02T11:55:17 | 168,826,288 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,593 | cpp | // -----------------------------------------------------------------------------
//
// Sistemas concurrentes y Distribuidos.
// Práctica 3. Implementación de algoritmos distribuidos con MPI
//
// Archivo: filosofos-plantilla.cpp
// Implementación del problema de los filósofos (sin camarero).
// Plantilla para completar.
//
// Historial:
// Actualizado a C++11 en Septiembre de 2017
// -----------------------------------------------------------------------------
#include <mpi.h>
#include <thread> // this_thread::sleep_for
#include <random> // dispositivos, generadores y distribuciones aleatorias
#include <chrono> // duraciones (duration), unidades de tiempo
#include <iostream>
using namespace std;
using namespace std::this_thread ;
using namespace std::chrono ;
const int
num_filosofos = 5 ,
num_procesos = 2*num_filosofos ;
//**********************************************************************
// plantilla de función para generar un entero aleatorio uniformemente
// distribuido entre dos valores enteros, ambos incluidos
// (ambos tienen que ser dos constantes, conocidas en tiempo de compilación)
//----------------------------------------------------------------------
template< int min, int max > int aleatorio()
{
static default_random_engine generador( (random_device())() );
static uniform_int_distribution<int> distribucion_uniforme( min, max ) ;
return distribucion_uniforme( generador );
}
// ---------------------------------------------------------------------
void funcion_filosofos( int id )
{
int id_ten_izq = (id+1) % num_procesos, //id. tenedor izq.
id_ten_der = (id+num_procesos-1) % num_procesos; //id. tenedor der.
while ( true )
{
cout <<"Filósofo " <<id << " solicita ten. izq." <<id_ten_izq <<endl;
// ... solicitar tenedor izquierdo (completar)
MPI_Ssend( &id, 1, MPI_INT, id_ten_izq, 0, MPI_COMM_WORLD );
cout <<"Filósofo " <<id <<" solicita ten. der." <<id_ten_der <<endl;
// ... solicitar tenedor derecho (completar)
MPI_Ssend( &id, 1, MPI_INT, id_ten_der, 0, MPI_COMM_WORLD );
cout <<"Filósofo " <<id <<" comienza a comer" <<endl ;
sleep_for( milliseconds( aleatorio<10,100>() ) );
cout <<"Filósofo " <<id <<" suelta ten. izq. " <<id_ten_izq <<endl;
// ... soltar el tenedor izquierdo (completar)
MPI_Ssend( &id, 1, MPI_INT, id_ten_izq, 0, MPI_COMM_WORLD );
cout<< "Filósofo " <<id <<" suelta ten. der. " <<id_ten_der <<endl;
// ... soltar el tenedor derecho (completar)
MPI_Ssend( &id, 1, MPI_INT, id_ten_der, 0, MPI_COMM_WORLD );
cout << "Filosofo " << id << " comienza a pensar" << endl;
sleep_for( milliseconds( aleatorio<10,100>() ) );
}
}
// ---------------------------------------------------------------------
void funcion_tenedores( int id )
{
int valor, id_filosofo ; // valor recibido, identificador del filósofo
MPI_Status estado ; // metadatos de las dos recepciones
while ( true )
{
// ...... recibir petición de cualquier filósofo (completar)
// ...... guardar en 'id_filosofo' el id. del emisor (completar)
MPI_Recv ( &id_filosofo, 1, MPI_INT, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &estado );
cout <<"Ten. " <<id <<" ha sido cogido por filo. " <<id_filosofo <<endl;
// ...... recibir liberación de filósofo 'id_filosofo' (completar)
MPI_Recv ( &valor, 1, MPI_INT, id_filosofo, 0, MPI_COMM_WORLD, &estado );
cout <<"Ten. "<< id<< " ha sido liberado por filo. " <<id_filosofo <<endl ;
}
}
// ---------------------------------------------------------------------
int main( int argc, char** argv )
{
int id_propio, num_procesos_actual ;
MPI_Init( &argc, &argv );
MPI_Comm_rank( MPI_COMM_WORLD, &id_propio );
MPI_Comm_size( MPI_COMM_WORLD, &num_procesos_actual );
if ( num_procesos == num_procesos_actual )
{
// ejecutar la función correspondiente a 'id_propio'
if ( id_propio % 2 == 0 ) // si es par
funcion_filosofos( id_propio ); // es un filósofo
else // si es impar
funcion_tenedores( id_propio ); // es un tenedor
}
else
{
if ( id_propio == 0 ) // solo el primero escribe error, indep. del rol
{ cout << "el número de procesos esperados es: " << num_procesos << endl
<< "el número de procesos en ejecución es: " << num_procesos_actual << endl
<< "(programa abortado)" << endl ;
}
}
MPI_Finalize();
return 0;
}
// ---------------------------------------------------------------------
| [
"manueljesusnunezruiz@gmail.com"
] | manueljesusnunezruiz@gmail.com |
156cbbd5954d8fb031b9cf8be2126fa2c393cfe1 | 04b1803adb6653ecb7cb827c4f4aa616afacf629 | /components/viz/client/local_surface_id_provider.cc | c01127894a9019570261e876236d93fd57b14f3c | [
"BSD-3-Clause"
] | permissive | Samsung/Castanets | 240d9338e097b75b3f669604315b06f7cf129d64 | 4896f732fc747dfdcfcbac3d442f2d2d42df264a | refs/heads/castanets_76_dev | 2023-08-31T09:01:04.744346 | 2021-07-30T04:56:25 | 2021-08-11T05:45:21 | 125,484,161 | 58 | 49 | BSD-3-Clause | 2022-10-16T19:31:26 | 2018-03-16T08:07:37 | null | UTF-8 | C++ | false | false | 553 | cc | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/viz/client/local_surface_id_provider.h"
#include "components/viz/common/quads/compositor_frame.h"
namespace viz {
LocalSurfaceIdProvider::LocalSurfaceIdProvider() = default;
LocalSurfaceIdProvider::~LocalSurfaceIdProvider() = default;
void LocalSurfaceIdProvider::ForceAllocateNewId() {
parent_local_surface_id_allocator_.GenerateId();
}
} // namespace viz
| [
"sunny.nam@samsung.com"
] | sunny.nam@samsung.com |
c00091c539edcd38dc52e3bdb9985a775b7a69b3 | 47abd462bf24f3b19000d88b7f9d63622a1a3fe6 | /Inhyuk/Queue/C++/3078.cpp | 9b4e8efc11fe9155663f4d46416dfeb1b4725f95 | [
"Apache-2.0"
] | permissive | alps-jbnu/ALPS_2020_Summer_Study | 1f5b9e59ca2e8dcd10fdeced043f19e3a3b5aeeb | 3656d5c6ab44f7f43c1f8c691e75352495c76adc | refs/heads/master | 2022-12-16T04:28:25.099163 | 2020-08-27T07:20:31 | 2020-08-27T07:20:31 | 277,059,912 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 457 | cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int N, K;
long long ans = 0;
queue<string> q;
vector<int> v(20, 0);
cin >> N >> K;
while (N--) {
string name;
cin >> name;
q.push(name);
v[name.length()]++;
if (v[name.length()] > 1) ans += v[name.length()] - 1;
if (q.size() == K + 1) {
v[q.front().length()]--;
q.pop();
}
}
cout << ans << endl;
} | [
"inhyuk04@gmail.com"
] | inhyuk04@gmail.com |
c1adf7547b123342d08e484166af4e1d0acef106 | 38b9daafe39f937b39eefc30501939fd47f7e668 | /tutorials/2WayCouplingOceanWave3D/submergedBarResults180628-Eta/17.4/p_rgh | 9f3492145694d0ea3ca2f858526f8e3f42f0d4e4 | [] | no_license | rubynuaa/2-way-coupling | 3a292840d9f56255f38c5e31c6b30fcb52d9e1cf | a820b57dd2cac1170b937f8411bc861392d8fbaa | refs/heads/master | 2020-04-08T18:49:53.047796 | 2018-08-29T14:22:18 | 2018-08-29T14:22:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 205,574 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 3.0.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "17.4";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField nonuniform List<scalar>
22680
(
-261.383
-247.428
-232.207
-215.727
-197.999
-179.035
-158.851
-137.488
-114.987
-91.4115
-66.8233
-41.2589
-14.7625
13.2519
42.1226
70.4097
98.8006
127.097
155.176
182.794
209.765
235.841
260.821
284.463
306.557
326.872
345.203
361.343
375.126
386.394
395.028
400.931
404.043
404.31
401.923
396.766
388.852
378.292
365.17
349.626
331.803
311.896
290.096
266.631
241.726
215.627
188.572
160.814
132.587
104.128
75.6548
47.3792
19.5782
-7.67421
-34.2557
-60.0316
-84.879
-108.706
-131.433
-153.003
-173.369
-192.505
-210.389
-227.014
-242.378
-256.487
-269.351
-280.985
-291.403
-300.623
-308.663
-315.542
-321.279
-325.895
-329.408
-331.839
-333.184
-333.453
-332.652
-330.81
-327.903
-323.943
-318.917
-312.82
-305.64
-297.362
-287.971
-277.446
-265.779
-252.944
-238.939
-223.751
-207.375
-189.824
-171.094
-151.207
-130.19
-108.093
-84.9567
-60.8552
-35.8694
-10.1116
16.3366
43.3028
70.6098
98.0991
125.593
152.895
179.8
206.097
231.561
255.978
279.123
300.789
320.761
338.853
354.881
368.69
380.129
389.091
395.472
399.214
400.212
398.581
394.251
387.247
377.664
365.587
351.131
334.435
315.663
294.999
272.645
248.817
223.745
197.668
170.827
143.463
115.812
88.1024
60.5469
33.3434
6.67038
-19.3144
-44.4763
-68.7024
-91.9018
-114.003
-134.958
-154.735
-173.314
-190.692
-206.876
-221.877
-235.717
-248.417
-260
-270.497
-279.937
-288.348
-295.763
-302.208
-307.727
-312.326
-316.013
-318.838
-320.821
-321.954
-322.248
-321.704
-320.316
-318.075
-314.951
-310.919
-305.951
-299.993
-292.995
-284.909
-275.664
-265.212
-253.479
-240.411
-225.94
-210.022
-192.625
-173.722
-153.318
-131.42
-108.076
-83.3508
-57.3452
-30.1832
-2.02177
26.954
56.5319
86.4769
116.532
146.431
175.89
204.626
232.361
258.811
283.724
306.845
327.953
346.845
363.345
377.301
388.602
397.155
402.873
405.837
405.982
403.371
398.08
390.227
379.946
367.405
352.822
336.425
318.507
299.464
279.708
260.07
240.315
-261.456
-247.504
-232.284
-215.806
-198.079
-179.115
-158.931
-137.568
-115.065
-91.4874
-66.8963
-41.3283
-14.8277
13.1913
42.0748
70.3708
98.772
127.079
155.171
182.802
209.787
235.877
260.871
284.529
306.638
326.968
345.313
361.467
375.26
386.538
395.18
401.088
404.211
404.468
402.076
396.916
388.998
378.43
365.297
349.742
331.906
311.984
290.169
266.689
241.768
215.654
188.584
160.811
132.571
104.1
75.616
47.3314
19.5225
-7.73652
-34.3235
-60.1039
-84.9548
-108.784
-131.512
-153.083
-173.45
-192.585
-210.468
-227.092
-242.454
-256.562
-269.425
-281.057
-291.473
-300.692
-308.73
-315.607
-321.343
-325.958
-329.469
-331.9
-333.244
-333.511
-332.712
-330.869
-327.963
-324.004
-318.978
-312.883
-305.703
-297.427
-288.037
-277.514
-265.849
-253.016
-239.012
-223.826
-207.451
-189.901
-171.171
-151.284
-130.267
-108.168
-85.0296
-60.9251
-35.9349
-10.1718
16.2825
43.256
70.5719
98.0709
125.575
152.89
179.807
206.117
231.595
256.026
279.185
300.865
320.851
338.957
354.996
368.815
380.263
389.232
395.618
399.362
400.371
398.725
394.395
387.387
377.797
365.71
351.244
334.535
315.75
295.072
272.703
248.86
223.772
197.681
170.826
143.448
115.785
88.0632
60.4976
33.2854
6.6051
-19.3855
-44.5519
-68.7812
-91.9825
-114.085
-135.04
-154.815
-173.393
-190.77
-206.951
-221.95
-235.787
-248.485
-260.065
-270.56
-279.997
-288.406
-295.819
-302.263
-307.78
-312.378
-316.06
-318.888
-320.87
-322.003
-322.298
-321.755
-320.368
-318.128
-315.006
-310.977
-306.013
-300.058
-293.064
-284.983
-275.743
-265.295
-253.567
-240.503
-226.036
-210.121
-192.727
-173.825
-153.421
-131.521
-108.175
-83.4447
-57.4328
-30.2626
-2.09113
26.8963
56.4874
86.447
116.518
146.433
175.909
204.663
232.414
258.881
283.81
306.946
328.068
346.972
363.482
377.446
388.753
397.31
403.036
405.988
406.133
403.516
398.218
390.355
380.061
367.507
352.907
336.489
318.543
299.458
279.632
259.875
239.871
-261.603
-247.655
-232.439
-215.963
-198.238
-179.276
-159.092
-137.727
-115.221
-91.6392
-67.0424
-41.4672
-14.958
13.0703
41.9789
70.2931
98.7147
127.044
155.161
182.818
209.83
235.949
260.973
284.661
306.801
327.161
345.534
361.713
375.529
386.826
395.482
401.402
404.536
404.791
402.384
397.217
389.29
378.706
365.552
349.974
332.111
312.161
290.315
266.803
241.851
215.707
188.607
160.806
132.539
104.044
75.5384
47.2358
19.4111
-7.86113
-34.4591
-60.2486
-85.1064
-108.941
-131.672
-153.244
-173.611
-192.745
-210.626
-227.248
-242.608
-256.712
-269.572
-281.2
-291.613
-300.829
-308.863
-315.738
-321.471
-326.083
-329.592
-332.02
-333.362
-333.63
-332.831
-330.988
-328.082
-324.124
-319.099
-313.006
-305.829
-297.556
-288.169
-277.65
-265.988
-253.158
-239.156
-223.973
-207.601
-190.052
-171.323
-151.437
-130.418
-108.317
-85.1733
-61.0627
-36.064
-10.2902
16.1763
43.1644
70.4982
98.0168
125.543
152.881
179.823
206.16
231.665
256.125
279.313
301.021
321.033
339.165
355.228
369.068
380.533
389.517
395.913
399.661
400.687
399.02
394.686
387.669
378.064
365.96
351.471
334.738
315.927
295.22
272.821
248.947
223.829
197.708
170.824
143.419
115.731
87.9863
60.4004
33.1709
6.47605
-19.5263
-44.7015
-68.937
-92.1421
-114.246
-135.201
-154.975
-173.55
-190.923
-207.099
-222.094
-235.926
-248.618
-260.194
-270.683
-280.116
-288.521
-295.929
-302.37
-307.883
-312.476
-316.157
-318.985
-320.965
-322.098
-322.393
-321.852
-320.468
-318.231
-315.114
-311.091
-306.133
-300.186
-293.2
-285.128
-275.897
-265.459
-253.739
-240.684
-226.224
-210.316
-192.926
-174.028
-153.623
-131.721
-108.369
-83.6298
-57.6053
-30.4187
-2.22716
26.7836
56.4011
86.3899
116.492
146.44
175.95
204.739
232.524
259.024
283.985
307.15
328.3
347.228
363.759
377.74
389.058
397.623
403.363
406.295
406.437
403.809
398.496
390.613
380.294
367.711
353.078
336.62
318.624
299.475
279.575
259.666
239.527
-261.824
-247.882
-232.671
-216.199
-198.478
-179.517
-159.332
-137.966
-115.456
-91.867
-67.2617
-41.6757
-15.1536
12.888
41.8348
70.1763
98.6286
126.992
155.145
182.841
209.895
236.057
261.126
284.859
307.044
327.449
345.865
362.083
375.933
387.258
395.937
401.872
405.011
405.279
402.853
397.671
389.728
379.12
365.935
350.321
332.418
312.425
290.534
266.976
241.977
215.786
188.641
160.798
132.491
103.96
75.4217
47.0922
19.2435
-8.04814
-34.6626
-60.4658
-85.3339
-109.176
-131.911
-153.486
-173.853
-192.986
-210.864
-227.482
-242.837
-256.938
-269.792
-281.415
-291.823
-301.034
-309.064
-315.933
-321.663
-326.27
-329.776
-332.2
-333.539
-333.809
-333.009
-331.165
-328.259
-324.303
-319.282
-313.192
-306.019
-297.75
-288.368
-277.853
-266.196
-253.37
-239.374
-224.195
-207.826
-190.279
-171.552
-151.666
-130.645
-108.539
-85.3893
-61.2696
-36.258
-10.4681
16.0163
43.027
70.3874
97.9354
125.494
152.867
179.847
206.224
231.771
256.273
279.503
301.254
321.307
339.477
355.575
369.447
380.939
389.944
396.354
400.109
401.152
399.469
395.123
388.092
378.466
366.333
351.813
335.043
316.191
295.441
272.998
249.078
223.915
197.749
170.822
143.376
115.649
87.8707
60.2544
32.9989
6.28224
-19.7376
-44.9262
-69.1711
-92.3818
-114.489
-135.443
-155.214
-173.785
-191.152
-207.322
-222.309
-236.134
-248.818
-260.387
-270.869
-280.294
-288.692
-296.094
-302.53
-308.037
-312.621
-316.305
-319.13
-321.108
-322.24
-322.537
-321.998
-320.618
-318.386
-315.276
-311.261
-306.314
-300.378
-293.404
-285.346
-276.128
-265.704
-253.997
-240.956
-226.507
-210.609
-193.226
-174.332
-153.928
-132.022
-108.661
-83.908
-57.8645
-30.6533
-2.43163
26.6141
56.2712
86.3039
116.453
146.451
176.012
204.852
232.689
259.239
284.248
307.458
328.649
347.613
364.174
378.18
389.516
398.09
403.847
406.761
406.895
404.249
398.914
391
380.644
368.019
353.335
336.818
318.753
299.504
279.454
259.288
238.785
-262.119
-248.184
-232.98
-216.514
-198.797
-179.839
-159.654
-138.285
-115.769
-92.1711
-67.5542
-41.9539
-15.4145
12.6437
41.6424
70.0203
98.5134
126.921
155.124
182.873
209.982
236.201
261.328
285.122
307.369
327.833
346.306
362.576
376.472
387.834
396.543
402.499
405.646
405.922
403.484
398.279
390.314
379.672
366.446
350.784
332.829
312.777
290.825
267.205
242.143
215.891
188.687
160.788
132.427
103.847
75.2653
46.9003
19.0196
-8.29766
-34.9343
-60.7557
-85.6376
-109.489
-132.231
-153.808
-174.175
-193.306
-211.181
-227.794
-243.144
-257.238
-270.086
-281.702
-292.103
-301.307
-309.331
-316.195
-321.918
-326.521
-330.022
-332.439
-333.775
-334.048
-333.246
-331.401
-328.496
-324.543
-319.525
-313.439
-306.271
-298.008
-288.632
-278.125
-266.474
-253.654
-239.663
-224.49
-208.126
-190.582
-171.857
-151.971
-130.948
-108.837
-85.6775
-61.5458
-36.5173
-10.7058
15.8023
42.8438
70.2393
97.8264
125.428
152.848
179.879
206.309
231.911
256.471
279.758
301.564
321.672
339.894
356.039
369.952
381.48
390.514
396.944
400.708
401.762
400.075
395.708
388.656
379.002
366.832
352.268
335.449
316.544
295.737
273.233
249.253
224.029
197.803
170.818
143.318
115.54
87.716
60.0592
32.7691
6.02333
-20.0199
-45.2262
-69.4836
-92.7018
-114.812
-135.766
-155.534
-174.099
-191.458
-207.619
-222.597
-236.412
-249.086
-260.644
-271.116
-280.532
-288.921
-296.314
-302.743
-308.242
-312.819
-316.502
-319.324
-321.299
-322.43
-322.728
-322.193
-320.818
-318.593
-315.492
-311.489
-306.554
-300.634
-293.677
-285.636
-276.437
-266.031
-254.342
-241.318
-226.884
-210.999
-193.627
-174.738
-154.335
-132.423
-109.051
-84.2795
-58.2107
-30.9666
-2.70482
26.3876
56.0976
86.1887
116.401
146.464
176.094
205.003
232.908
259.525
284.598
307.867
329.114
348.126
364.729
378.767
390.128
398.715
404.483
407.389
407.509
404.838
399.471
391.516
381.111
368.429
353.678
337.083
318.924
299.553
279.329
258.881
238.006
-262.487
-248.562
-233.367
-216.908
-199.197
-180.241
-160.056
-138.684
-116.16
-92.5515
-67.9202
-42.3021
-15.7411
12.3366
41.4013
69.8249
98.3689
126.833
155.098
182.912
210.09
236.38
261.582
285.451
307.774
328.314
346.858
363.193
377.146
388.556
397.301
403.283
406.442
406.72
404.274
399.042
391.046
380.363
367.085
351.364
333.341
313.217
291.19
267.492
242.352
216.023
188.744
160.774
132.346
103.706
75.0687
46.6597
18.7391
-8.60987
-35.2744
-61.1187
-86.0178
-109.881
-132.63
-154.211
-174.579
-193.707
-211.578
-228.185
-243.527
-257.613
-270.453
-282.061
-292.454
-301.649
-309.665
-316.521
-322.238
-326.834
-330.328
-332.739
-334.073
-334.345
-333.542
-331.696
-328.793
-324.843
-319.829
-313.748
-306.587
-298.33
-288.962
-278.464
-266.821
-254.009
-240.026
-224.859
-208.501
-190.962
-172.238
-152.353
-131.327
-109.209
-86.0382
-61.8917
-36.8425
-11.0036
15.5341
42.6145
70.0537
97.6896
125.345
152.824
179.918
206.415
232.087
256.717
280.076
301.953
322.129
340.415
356.619
370.584
382.157
391.227
397.681
401.46
402.52
400.833
396.441
389.363
379.672
367.456
352.837
335.957
316.985
296.106
273.528
249.471
224.171
197.87
170.813
143.244
115.403
87.5219
59.8145
32.4809
5.69893
-20.3735
-45.6019
-69.8748
-93.1024
-115.217
-136.171
-155.934
-174.492
-191.841
-207.991
-222.957
-236.759
-249.42
-260.966
-271.426
-280.829
-289.206
-296.59
-303.008
-308.497
-313.068
-316.747
-319.565
-321.537
-322.667
-322.967
-322.436
-321.068
-318.852
-315.762
-311.773
-306.855
-300.953
-294.017
-285.999
-276.822
-266.439
-254.774
-241.771
-227.357
-211.488
-194.128
-175.246
-154.844
-132.926
-109.539
-84.7449
-58.6442
-31.359
-3.0472
26.1036
55.8798
86.044
116.335
146.481
176.196
205.191
233.183
259.883
285.036
308.38
329.695
348.768
365.422
379.502
390.893
399.497
405.272
408.179
408.276
405.575
400.168
392.161
381.696
368.942
354.109
337.417
319.143
299.628
279.206
258.425
237.114
-262.929
-249.016
-233.831
-217.382
-199.677
-180.725
-160.539
-139.163
-116.631
-93.0087
-68.3601
-42.7208
-16.1337
11.9658
41.1115
69.5896
98.1945
126.726
155.065
182.958
210.219
236.595
261.885
285.845
308.26
328.891
347.521
363.934
377.955
389.422
398.212
404.225
407.398
407.679
405.222
399.959
391.927
381.192
367.852
352.059
333.957
313.746
291.627
267.835
242.601
216.179
188.811
160.757
132.248
103.535
74.831
46.3693
18.402
-8.98492
-35.6834
-61.555
-86.4747
-110.352
-133.11
-154.695
-175.064
-194.189
-212.054
-228.654
-243.987
-258.064
-270.893
-282.491
-292.874
-302.06
-310.066
-316.913
-322.621
-327.209
-330.696
-333.1
-334.43
-334.7
-333.896
-332.05
-329.148
-325.202
-320.193
-314.119
-306.966
-298.717
-289.359
-278.87
-267.238
-254.435
-240.46
-225.302
-208.952
-191.417
-172.696
-152.812
-131.782
-109.656
-86.4718
-62.3077
-37.234
-11.3629
15.2122
42.3389
69.8303
97.5247
125.245
152.795
179.964
206.541
232.296
257.012
280.457
302.418
322.677
341.04
357.315
371.344
382.97
392.083
398.568
402.364
403.432
401.741
397.323
390.212
380.476
368.205
353.521
336.567
317.514
296.549
273.881
249.733
224.341
197.95
170.805
143.154
115.238
87.288
59.5197
32.134
5.30853
-20.7989
-46.0537
-70.3451
-93.584
-115.704
-136.657
-156.414
-174.963
-192.301
-208.437
-223.388
-237.175
-249.821
-261.352
-271.797
-281.185
-289.549
-296.92
-303.327
-308.804
-313.366
-317.041
-319.855
-321.822
-322.952
-323.255
-322.728
-321.368
-319.162
-316.086
-312.114
-307.215
-301.336
-294.425
-286.434
-277.285
-266.93
-255.292
-242.315
-227.924
-212.075
-194.729
-175.856
-155.456
-133.53
-110.126
-85.3047
-59.1657
-31.8313
-3.45933
25.7618
55.6175
85.8694
116.255
146.501
176.318
205.417
233.512
260.313
285.562
308.996
330.394
349.539
366.255
380.385
391.812
400.438
406.219
409.127
409.199
406.46
401.005
392.938
382.398
369.559
354.627
337.82
319.41
299.727
279.08
257.929
236.184
-263.445
-249.545
-234.373
-217.934
-200.237
-181.29
-161.104
-139.723
-117.181
-93.5429
-68.8742
-43.2104
-16.593
11.5305
40.7727
69.3141
97.9897
126.599
155.026
183.011
210.369
236.844
262.238
286.305
308.828
329.564
348.294
364.799
378.901
390.434
399.276
405.325
408.516
408.798
406.328
401.032
392.956
382.161
368.749
352.871
334.675
314.362
292.138
268.235
242.891
216.361
188.888
160.736
132.132
103.334
74.5516
46.0262
18.01
-9.42301
-36.1615
-62.0652
-87.0087
-110.903
-133.671
-155.261
-175.63
-194.752
-212.61
-229.201
-244.524
-258.589
-271.407
-282.994
-293.364
-302.539
-310.534
-317.37
-323.068
-327.647
-331.126
-333.522
-334.846
-335.114
-334.308
-332.462
-329.562
-325.62
-320.618
-314.552
-307.407
-299.169
-289.821
-279.345
-267.724
-254.933
-240.968
-225.82
-209.479
-191.949
-173.231
-153.348
-132.314
-110.178
-86.9789
-62.7941
-37.6923
-11.7841
14.8361
42.0164
69.5685
97.3312
125.126
152.759
180.017
206.687
232.54
257.356
280.901
302.962
323.316
341.769
358.128
372.231
383.92
393.083
399.603
403.421
404.497
402.799
398.354
391.204
381.416
369.08
354.319
337.279
318.132
297.065
274.293
250.037
224.539
198.042
170.796
143.049
115.044
87.0135
59.1744
31.7277
4.85156
-21.2965
-46.5822
-70.8951
-94.147
-116.272
-137.224
-156.975
-175.514
-192.838
-208.958
-223.892
-237.661
-250.289
-261.803
-272.23
-281.602
-289.949
-297.304
-303.698
-309.162
-313.715
-317.383
-320.191
-322.155
-323.285
-323.589
-323.068
-321.716
-319.523
-316.464
-312.511
-307.636
-301.783
-294.902
-286.941
-277.825
-267.502
-255.897
-242.951
-228.587
-212.761
-195.432
-176.57
-156.171
-134.237
-110.813
-85.9595
-59.7758
-32.3839
-3.94186
25.3614
55.3102
85.6646
116.161
146.523
176.46
205.68
233.896
260.815
286.176
309.715
331.209
350.44
367.229
381.416
392.886
401.537
407.327
410.232
410.276
407.495
401.983
393.844
383.219
370.281
355.233
338.294
319.73
299.857
278.961
257.442
235.237
-264.034
-250.15
-234.992
-218.566
-200.877
-181.936
-161.751
-140.363
-117.811
-94.1546
-69.4628
-43.7714
-17.1201
11.0299
40.3848
68.9978
97.7539
126.453
154.98
183.07
210.538
237.127
262.64
286.829
309.475
330.333
349.179
365.789
379.983
391.593
400.494
406.583
409.795
410.079
407.594
402.261
394.135
383.27
369.775
353.8
335.496
315.067
292.72
268.691
243.221
216.567
188.975
160.709
131.998
103.101
74.2299
45.6286
17.5634
-9.92449
-36.7095
-62.6498
-87.6204
-111.533
-134.313
-155.909
-176.277
-195.395
-213.245
-229.826
-245.138
-259.19
-271.995
-283.567
-293.925
-303.086
-311.068
-317.893
-323.579
-328.147
-331.617
-334.004
-335.322
-335.587
-334.779
-332.932
-330.035
-326.098
-321.103
-315.047
-307.912
-299.685
-290.35
-279.887
-268.279
-255.501
-241.548
-226.412
-210.081
-192.558
-173.844
-153.961
-132.923
-110.777
-87.5597
-63.3513
-38.2176
-12.268
14.4054
41.6465
69.268
97.1083
124.99
152.716
180.075
206.854
232.818
257.748
281.408
303.582
324.046
342.604
359.058
373.246
385.006
394.227
400.788
404.631
405.715
404.009
399.534
392.339
382.492
370.08
355.232
338.094
318.837
297.656
274.763
250.385
224.764
198.146
170.783
142.926
114.82
86.6979
58.7776
31.2612
4.32739
-21.8671
-47.1878
-71.5252
-94.7918
-116.923
-137.874
-157.618
-176.143
-193.451
-209.553
-224.468
-238.217
-250.824
-262.318
-272.725
-282.077
-290.406
-297.744
-304.123
-309.571
-314.114
-317.774
-320.576
-322.535
-323.664
-323.971
-323.457
-322.115
-319.936
-316.895
-312.965
-308.116
-302.294
-295.445
-287.521
-278.443
-268.157
-256.589
-243.677
-229.345
-213.545
-196.237
-177.387
-156.99
-135.046
-111.6
-86.71
-60.4752
-33.0176
-4.49553
24.9017
54.9571
85.4291
116.052
146.547
176.622
205.981
234.334
261.388
286.878
310.538
332.143
351.471
368.343
382.597
394.116
402.795
408.595
411.496
411.51
408.679
403.103
394.882
384.159
371.107
355.928
338.84
320.102
300.019
278.853
256.95
234.277
-264.698
-250.832
-235.69
-219.277
-201.599
-182.664
-162.479
-141.085
-118.52
-94.8441
-70.1263
-44.4046
-17.7163
10.4634
39.9476
68.64
97.4863
126.287
154.926
183.135
210.727
237.445
263.091
287.417
310.203
331.198
350.174
366.904
381.202
392.898
401.866
408.001
411.238
411.522
409.021
403.647
395.463
384.518
370.931
354.846
336.419
315.86
293.375
269.204
243.592
216.797
189.071
160.676
131.846
102.836
73.865
45.1748
17.0625
-10.4899
-37.3279
-63.3094
-88.3103
-112.244
-135.037
-156.638
-177.006
-196.12
-213.961
-230.53
-245.828
-259.867
-272.656
-284.213
-294.555
-303.702
-311.67
-318.48
-324.154
-328.71
-332.168
-334.546
-335.858
-336.119
-335.308
-333.461
-330.567
-326.635
-321.648
-315.603
-308.48
-300.266
-290.945
-280.496
-268.904
-256.141
-242.201
-227.078
-210.758
-193.243
-174.533
-154.651
-133.609
-111.451
-88.2152
-63.9798
-38.8102
-12.8143
13.9182
41.2281
68.9279
96.8556
124.834
152.667
180.14
207.039
233.129
258.189
281.978
304.28
324.868
343.543
360.105
374.389
386.23
395.515
402.124
405.995
407.089
405.371
400.863
393.618
383.703
371.207
356.261
339.011
319.632
298.32
275.292
250.775
225.015
198.261
170.767
142.787
114.566
86.3402
58.3287
30.734
3.73524
-22.5114
-47.8714
-72.2361
-95.5192
-117.657
-138.607
-158.341
-176.852
-194.143
-210.224
-225.116
-238.842
-251.427
-262.897
-273.282
-282.612
-290.921
-298.239
-304.6
-310.032
-314.562
-318.213
-321.007
-322.963
-324.09
-324.401
-323.893
-322.562
-320.399
-317.38
-313.475
-308.655
-302.867
-296.056
-288.173
-279.137
-268.893
-257.368
-244.496
-230.199
-214.429
-197.144
-178.308
-157.913
-135.959
-112.488
-87.5572
-61.2649
-33.7333
-5.12106
24.3819
54.5575
85.1621
115.927
146.573
176.803
206.319
234.828
262.033
287.669
311.464
333.194
352.632
369.598
383.928
395.502
404.214
410.026
412.919
412.899
410.014
404.364
396.052
385.218
372.038
356.714
339.46
320.529
300.218
278.762
256.468
233.319
-265.436
-251.589
-236.466
-220.068
-202.402
-183.474
-163.29
-141.89
-119.309
-95.6121
-70.8653
-45.1108
-18.3836
9.83069
39.461
68.24
97.186
126.099
154.864
183.204
210.936
237.796
263.591
288.069
311.011
332.16
351.282
368.144
382.559
394.351
403.394
409.58
412.844
413.129
410.609
405.191
396.94
385.908
372.216
356.009
337.446
316.741
294.102
269.773
244.003
217.052
189.175
160.637
131.673
102.539
73.4558
44.6657
16.5049
-11.1202
-38.0176
-64.0447
-89.079
-113.036
-135.842
-157.45
-177.818
-196.925
-214.757
-231.313
-246.596
-260.618
-273.39
-284.931
-295.256
-304.386
-312.338
-319.133
-324.792
-329.336
-332.782
-335.149
-336.453
-336.709
-335.895
-334.048
-331.158
-327.232
-322.254
-316.22
-309.111
-300.911
-291.607
-281.174
-269.599
-256.853
-242.928
-227.819
-211.511
-194.005
-175.301
-155.42
-134.372
-112.202
-88.9458
-64.6801
-39.4704
-13.4233
13.3734
40.7608
68.5476
96.5723
124.659
152.609
180.209
207.243
233.474
258.677
282.611
305.056
325.782
344.587
361.269
375.66
387.593
396.95
403.611
407.513
408.617
406.886
402.343
395.042
385.051
372.462
357.405
340.03
320.515
299.058
275.879
251.208
225.293
198.387
170.747
142.628
114.28
85.9394
57.8267
30.1452
3.07418
-23.2303
-48.6337
-73.0285
-96.3296
-118.475
-139.422
-159.147
-177.642
-194.911
-210.969
-225.837
-239.537
-252.096
-263.541
-273.901
-283.207
-291.492
-298.788
-305.129
-310.544
-315.06
-318.701
-321.486
-323.437
-324.563
-324.877
-324.377
-323.059
-320.913
-317.918
-314.041
-309.255
-303.504
-296.735
-288.897
-279.908
-269.712
-258.234
-245.406
-231.149
-215.413
-198.154
-179.334
-158.942
-136.977
-113.478
-88.502
-62.146
-34.5321
-5.81929
23.8012
54.1105
84.863
115.787
146.601
177.003
206.693
235.376
262.751
288.548
312.495
334.363
353.925
370.996
385.41
397.045
405.794
411.62
414.502
414.446
411.501
405.768
397.354
386.398
373.076
357.59
340.153
321.014
300.456
278.693
256.001
232.37
-266.247
-252.423
-237.319
-220.938
-203.286
-184.367
-164.185
-142.776
-120.18
-96.4588
-71.6803
-45.8903
-19.1247
9.13158
38.925
67.797
96.852
125.889
154.793
183.279
211.162
238.179
264.138
288.785
311.899
333.218
352.502
369.511
384.054
395.953
405.079
411.321
414.614
414.898
412.359
406.894
398.568
387.44
373.632
357.29
338.576
317.71
294.9
270.398
244.453
217.33
189.287
160.59
131.48
102.209
73.0011
44.1019
15.8884
-11.8162
-38.7793
-64.8567
-89.9273
-113.909
-136.73
-158.345
-178.712
-197.813
-215.634
-232.175
-247.442
-261.445
-274.199
-285.72
-296.027
-305.138
-313.073
-319.852
-325.495
-330.023
-333.456
-335.812
-337.108
-337.357
-336.539
-334.694
-331.807
-327.888
-322.919
-316.899
-309.804
-301.621
-292.334
-281.919
-270.363
-257.635
-243.728
-228.634
-212.34
-194.845
-176.147
-156.267
-135.214
-113.031
-89.7522
-65.453
-40.1988
-14.096
12.7701
40.244
68.1262
96.2578
124.462
152.543
180.283
207.465
233.851
259.212
283.306
305.908
326.787
345.737
362.551
377.06
389.094
398.531
405.25
409.186
410.301
408.556
403.973
396.611
386.536
373.843
358.665
341.152
321.487
299.87
276.523
251.682
225.597
198.523
170.722
142.451
113.963
85.4947
57.2704
29.4935
2.34315
-24.0245
-49.4755
-73.9033
-97.2238
-119.377
-140.321
-160.035
-178.511
-195.758
-211.79
-226.63
-240.302
-252.833
-264.25
-274.582
-283.861
-292.12
-299.392
-305.711
-311.108
-315.608
-319.236
-322.012
-323.958
-325.083
-325.4
-324.909
-323.604
-321.478
-318.508
-314.663
-309.913
-304.204
-297.482
-289.693
-280.756
-270.614
-259.188
-246.408
-232.195
-216.498
-199.267
-180.465
-160.077
-138.1
-114.572
-89.5455
-63.1194
-35.4153
-6.59155
23.1587
53.6154
84.5307
115.631
146.629
177.222
207.105
235.979
263.541
289.516
313.631
335.652
355.35
372.536
387.043
398.746
407.536
413.376
416.247
416.15
413.139
407.316
398.789
387.698
374.221
358.559
340.922
321.557
300.737
278.653
255.557
231.442
-267.133
-253.333
-238.251
-221.889
-204.253
-185.343
-165.163
-143.746
-121.131
-97.3848
-72.5718
-46.7436
-19.9383
8.36094
38.3393
67.3099
96.483
125.657
154.712
183.357
211.407
238.595
264.732
289.564
312.867
334.372
353.833
371.005
385.688
397.705
406.921
413.225
416.55
416.833
414.271
408.756
400.346
389.114
375.178
358.688
339.81
318.767
295.771
271.079
244.941
217.631
189.406
160.536
131.266
101.844
72.5
43.4819
15.2121
-12.5787
-39.6141
-65.746
-90.8559
-114.864
-137.701
-159.323
-179.689
-198.783
-216.591
-233.116
-248.364
-262.348
-275.081
-286.581
-296.868
-305.96
-313.875
-320.635
-326.261
-330.773
-334.191
-336.535
-337.821
-338.063
-337.242
-335.397
-332.514
-328.602
-323.645
-317.638
-310.56
-302.395
-293.128
-282.732
-271.197
-258.489
-244.602
-229.525
-213.245
-195.762
-177.072
-157.193
-136.134
-113.937
-90.6348
-66.2994
-40.9967
-14.833
12.1074
39.6767
67.6631
95.9108
124.245
152.467
180.36
207.705
234.259
259.794
284.063
306.838
327.884
346.992
363.952
378.59
390.734
400.26
407.041
411.016
412.143
410.381
405.756
398.326
388.159
375.353
360.041
342.378
322.547
300.756
277.226
252.198
225.926
198.669
170.691
142.254
113.612
85.0052
56.6587
28.778
1.54089
-24.8952
-50.3978
-74.8611
-98.2027
-120.363
-141.304
-161.005
-179.461
-196.682
-212.686
-227.496
-241.137
-253.637
-265.023
-275.325
-284.574
-292.805
-300.051
-306.346
-311.722
-316.205
-319.819
-322.586
-324.526
-325.649
-325.97
-325.488
-324.198
-322.094
-319.151
-315.339
-310.629
-304.967
-298.295
-290.562
-281.682
-271.598
-260.229
-247.503
-233.339
-217.683
-200.485
-181.702
-161.32
-139.33
-115.769
-90.6891
-64.1865
-36.3836
-7.4392
22.4531
53.0712
84.1648
115.457
146.658
177.46
207.553
236.637
264.403
290.574
314.872
337.061
356.907
374.221
388.83
400.606
409.442
415.298
418.155
418.014
414.931
409.009
400.358
389.12
375.474
359.62
341.768
322.161
301.063
278.645
255.141
230.544
-268.094
-254.319
-239.262
-222.921
-205.302
-186.402
-166.225
-144.8
-122.167
-98.3908
-73.5403
-47.6708
-20.8243
7.5146
37.7039
66.7774
96.0777
125.4
154.62
183.439
211.668
239.041
265.372
290.405
313.914
335.623
355.278
372.626
387.462
399.607
408.921
415.294
418.654
418.937
416.347
410.778
402.277
390.933
376.855
360.206
341.149
319.913
296.714
271.814
245.468
217.953
189.53
160.474
131.029
101.446
71.9508
42.8024
14.4768
-13.4085
-40.5231
-66.7138
-91.8655
-115.901
-138.756
-160.384
-180.75
-199.834
-217.629
-234.136
-249.364
-263.326
-276.037
-287.515
-297.779
-306.849
-314.744
-321.484
-327.091
-331.586
-334.988
-337.318
-338.593
-338.828
-338.002
-336.158
-333.28
-329.376
-324.432
-318.439
-311.379
-303.234
-293.987
-283.614
-272.101
-259.415
-245.548
-230.491
-214.227
-196.757
-178.076
-158.198
-137.133
-114.921
-91.5939
-67.2201
-41.8656
-15.6355
11.3849
39.0577
67.1573
95.5305
124.005
152.381
180.44
207.961
234.7
260.423
284.882
307.845
329.072
348.353
365.472
380.251
392.514
402.136
408.987
413.002
414.142
412.363
407.691
400.188
389.921
376.991
361.534
343.707
323.697
301.715
277.986
252.756
226.28
198.823
170.653
142.035
113.226
84.4696
55.9906
27.9972
0.666163
-25.8436
-51.4019
-75.903
-99.2668
-121.435
-142.372
-162.058
-180.492
-197.685
-213.657
-228.434
-242.042
-254.508
-265.861
-276.13
-285.348
-293.547
-300.764
-307.033
-312.387
-316.852
-320.451
-323.207
-325.14
-326.262
-326.587
-326.114
-324.841
-322.759
-319.847
-316.071
-311.405
-305.792
-299.176
-291.503
-282.685
-272.664
-261.358
-248.69
-234.58
-218.97
-201.808
-183.047
-162.671
-140.668
-117.072
-91.9342
-65.3487
-37.4386
-8.36321
21.6831
52.4765
83.7642
115.265
146.687
177.715
208.038
237.35
265.338
291.721
316.218
338.59
358.598
376.05
390.77
402.627
411.512
417.385
420.226
420.038
416.876
410.847
402.062
390.665
376.835
360.774
342.692
322.828
301.435
278.673
254.758
229.683
-269.128
-255.383
-240.351
-224.033
-206.434
-187.545
-167.37
-145.939
-123.285
-99.4777
-74.5864
-48.6724
-21.7834
6.58922
37.0191
66.1979
95.6343
125.118
154.517
183.522
211.946
239.518
266.056
291.307
315.04
336.97
356.835
374.374
389.378
401.661
411.082
417.529
420.927
421.211
418.59
412.958
404.36
392.895
378.664
361.843
342.593
321.147
297.729
272.604
246.032
218.297
189.66
160.402
130.768
101.013
71.3523
42.055
13.6882
-14.3067
-41.5078
-67.7612
-92.9572
-117.023
-139.895
-161.53
-181.894
-200.969
-218.748
-235.236
-250.442
-264.38
-277.066
-288.52
-298.76
-307.807
-315.679
-322.398
-327.985
-332.461
-335.846
-338.161
-339.424
-339.65
-338.821
-336.977
-334.103
-330.21
-325.278
-319.302
-312.26
-304.137
-294.913
-284.563
-273.075
-260.412
-246.569
-231.532
-215.285
-197.831
-179.159
-159.284
-138.213
-115.985
-92.6301
-68.216
-42.8067
-16.5054
10.6024
38.3865
66.6073
95.1159
123.741
152.283
180.522
208.233
235.171
261.098
285.763
308.929
330.353
349.82
367.11
382.043
394.436
404.162
411.087
415.147
416.301
414.502
409.78
402.197
391.822
378.759
363.145
345.14
324.937
302.747
278.803
253.354
226.657
198.985
170.608
141.794
112.805
83.8863
55.2649
27.1497
-0.282008
-26.8711
-52.4888
-77.0302
-100.417
-122.594
-143.525
-163.195
-181.605
-198.766
-214.704
-229.445
-243.016
-255.447
-266.764
-276.997
-286.18
-294.346
-301.531
-307.773
-313.103
-317.547
-321.13
-323.874
-325.8
-326.921
-327.249
-326.787
-325.531
-323.474
-320.594
-316.858
-312.238
-306.68
-300.124
-292.515
-283.766
-273.813
-262.574
-249.971
-235.919
-220.359
-203.236
-184.5
-164.131
-142.116
-118.482
-93.282
-66.6075
-38.582
-9.36488
20.8475
51.8303
83.3276
115.055
146.715
177.989
208.559
238.117
266.346
292.958
317.671
340.24
360.424
378.025
392.865
404.81
413.749
419.64
422.464
422.223
418.977
412.832
403.902
392.333
378.306
362.023
343.695
323.558
301.858
278.74
254.412
228.865
-270.238
-256.523
-241.52
-225.226
-207.648
-188.773
-168.602
-147.163
-124.489
-100.646
-75.7106
-49.7488
-22.817
5.58192
36.285
65.5697
95.151
124.808
154.402
183.608
212.24
240.024
266.785
292.269
316.244
338.413
358.506
376.252
391.435
403.867
413.404
419.93
423.37
423.656
421.003
415.299
406.6
395.001
380.606
363.599
344.142
322.47
298.815
273.447
246.632
218.659
189.794
160.321
130.483
100.541
70.7036
41.2278
12.8555
-15.2747
-42.5696
-68.8892
-94.1317
-118.228
-141.119
-162.762
-183.123
-202.187
-219.949
-236.415
-251.597
-265.51
-278.17
-289.598
-299.812
-308.833
-316.681
-323.377
-328.942
-333.398
-336.765
-339.064
-340.314
-340.53
-339.696
-337.853
-334.984
-331.101
-326.184
-320.225
-313.204
-305.104
-295.904
-285.581
-274.119
-261.481
-247.662
-232.648
-216.422
-198.983
-180.321
-160.449
-139.374
-117.129
-93.7446
-69.288
-43.8208
-17.4441
9.75833
37.6625
66.0124
94.6657
123.453
152.172
180.604
208.52
235.671
261.818
286.704
310.089
331.725
351.393
368.868
383.966
396.499
406.337
413.344
417.452
418.62
416.799
412.024
404.355
393.864
380.657
364.873
346.677
326.265
303.853
279.678
253.991
227.058
199.154
170.553
141.529
112.347
83.2538
54.48
26.2342
-1.30484
-27.9789
-53.6597
-78.2439
-101.655
-123.84
-144.765
-164.416
-182.799
-199.927
-215.827
-230.529
-244.061
-256.453
-267.732
-277.927
-287.072
-295.202
-302.354
-308.565
-313.869
-318.291
-321.857
-324.589
-326.507
-327.625
-327.957
-327.506
-326.269
-324.238
-321.393
-317.699
-313.13
-307.629
-301.139
-293.599
-284.924
-275.045
-263.88
-251.346
-237.356
-221.851
-204.771
-186.063
-165.703
-143.673
-120.001
-94.7344
-67.9644
-39.8152
-10.4461
19.9448
51.1313
82.8541
114.825
146.741
178.279
209.117
238.939
267.426
294.285
319.23
342.012
362.385
380.148
395.117
407.156
416.153
422.063
424.868
424.572
421.234
414.964
405.879
394.125
379.887
363.369
344.779
324.354
302.332
278.849
254.107
228.089
-271.422
-257.74
-242.767
-226.5
-208.945
-190.085
-169.92
-148.472
-125.778
-101.898
-76.9132
-50.9001
-23.9269
4.49004
35.5024
64.8901
94.6259
124.471
154.273
183.695
212.548
240.558
267.557
293.291
317.526
339.953
360.291
378.259
393.636
406.227
415.889
422.5
425.985
426.273
423.585
417.804
408.996
397.251
382.683
365.476
345.795
323.882
299.972
274.343
247.268
219.04
189.93
160.226
130.173
100.03
70.0047
40.317
11.9799
-16.3155
-43.7104
-70.0992
-95.3903
-119.519
-142.429
-164.079
-184.436
-203.489
-221.231
-237.675
-252.83
-266.715
-279.347
-290.747
-300.933
-309.928
-317.75
-324.421
-329.963
-334.397
-337.744
-340.026
-341.262
-341.468
-340.629
-338.786
-335.923
-332.052
-327.149
-321.209
-314.21
-306.135
-296.962
-286.667
-275.232
-262.622
-248.83
-233.84
-217.636
-200.215
-181.564
-161.696
-140.616
-118.354
-94.939
-70.4371
-44.9082
-18.4517
8.84981
36.8841
65.3717
94.1785
123.138
152.048
180.686
208.821
236.201
262.583
287.706
311.326
333.19
353.073
370.747
386.021
398.706
408.665
415.757
419.917
421.101
419.257
414.424
406.663
396.047
382.686
366.72
348.32
327.683
305.033
280.609
254.669
227.482
199.329
170.489
141.24
111.85
82.5707
53.634
25.2491
-2.40397
-29.1687
-54.916
-79.5452
-102.981
-125.174
-146.091
-165.723
-184.075
-201.166
-217.026
-231.686
-245.176
-257.527
-268.764
-278.919
-288.024
-296.114
-303.23
-309.409
-314.685
-319.085
-322.632
-325.35
-327.259
-328.374
-328.711
-328.272
-327.054
-325.051
-322.243
-318.595
-314.08
-308.641
-302.22
-294.755
-286.159
-276.36
-265.274
-252.814
-238.893
-223.447
-206.413
-187.737
-167.387
-145.343
-121.63
-96.293
-69.4212
-41.1401
-11.6086
18.9735
50.378
82.3425
114.574
146.765
178.586
209.71
239.816
268.579
295.703
320.896
343.907
364.483
382.418
397.526
409.667
418.725
424.655
427.441
427.085
423.649
417.245
407.994
396.043
381.58
364.81
345.945
325.218
302.86
279.002
253.844
227.36
-272.681
-259.034
-244.094
-227.856
-210.326
-191.484
-171.325
-149.869
-127.152
-103.233
-78.195
-52.1265
-25.1141
3.30983
34.672
64.1562
94.0565
124.104
154.13
183.782
212.87
241.119
268.37
294.372
318.885
341.59
362.192
380.397
395.981
408.743
418.538
425.24
428.773
429.062
426.338
420.474
411.551
399.648
384.894
367.473
347.554
325.381
301.199
275.293
247.939
219.439
190.067
160.117
129.834
99.4802
69.256
39.3283
11.0528
-17.4331
-44.932
-71.3926
-96.7339
-120.896
-143.825
-165.482
-185.835
-204.874
-222.596
-239.014
-254.141
-267.997
-280.599
-291.968
-302.126
-311.092
-318.886
-325.53
-331.047
-335.458
-338.785
-341.048
-342.269
-342.463
-341.619
-339.775
-336.919
-333.059
-328.173
-322.254
-315.279
-307.23
-298.085
-287.821
-276.415
-263.835
-250.072
-235.108
-218.928
-201.525
-182.887
-163.025
-141.939
-119.661
-96.2146
-71.6644
-46.0696
-19.5297
7.87522
36.0502
64.6836
93.6532
122.796
151.909
180.766
209.135
236.76
263.393
288.769
312.639
334.746
354.86
372.746
388.21
401.056
411.144
418.329
422.544
423.744
421.876
416.981
409.122
398.372
384.846
368.686
350.067
329.191
306.285
281.596
255.385
227.928
199.508
170.413
140.923
111.312
81.8349
52.7253
24.1928
-3.58131
-30.4417
-56.2591
-80.9354
-104.397
-126.597
-147.506
-167.115
-185.434
-202.485
-218.301
-232.916
-246.362
-258.668
-269.862
-279.973
-289.035
-297.084
-304.161
-310.306
-315.551
-319.927
-323.454
-326.157
-328.057
-329.169
-329.51
-329.083
-327.886
-325.913
-323.144
-319.544
-315.086
-309.714
-303.367
-295.982
-287.471
-277.758
-266.757
-254.377
-240.529
-225.147
-208.165
-189.522
-169.184
-147.127
-123.371
-97.9594
-70.9796
-42.5585
-12.8542
17.9316
49.5688
81.7913
114.302
146.786
178.91
210.338
240.747
269.806
297.212
322.671
345.924
366.718
384.838
400.095
412.345
421.469
427.419
430.184
429.764
426.222
419.676
410.248
398.086
383.385
366.349
347.193
326.149
303.443
279.201
253.627
226.68
-274.015
-260.406
-245.5
-229.294
-211.792
-192.969
-172.819
-151.354
-128.614
-104.653
-79.5564
-53.4272
-26.376
2.03361
33.7941
63.364
93.4401
123.707
153.972
183.868
213.205
241.705
269.223
295.509
320.321
343.323
364.207
382.668
398.471
411.417
421.353
428.153
431.736
432.025
429.263
423.313
414.262
402.193
387.242
369.592
349.418
326.97
302.497
276.294
248.645
219.855
190.205
159.992
129.467
98.8908
68.4595
38.2713
10.0609
-18.6325
-46.2363
-72.7708
-98.1637
-122.36
-145.309
-166.973
-187.32
-206.344
-224.043
-240.434
-255.531
-269.355
-281.924
-293.262
-303.388
-312.324
-320.089
-326.705
-332.195
-336.582
-339.886
-342.13
-343.333
-343.515
-342.664
-340.822
-337.973
-334.125
-329.256
-323.36
-316.41
-308.389
-299.275
-289.042
-277.669
-265.121
-251.388
-236.453
-220.298
-202.915
-184.293
-164.436
-143.346
-121.05
-97.572
-72.9709
-47.3071
-20.6796
6.83293
35.1607
63.9467
93.0881
122.425
151.753
180.843
209.46
237.345
264.245
289.891
314.029
336.395
356.754
374.867
390.533
403.551
413.777
421.062
425.335
426.552
424.658
419.697
411.733
400.841
387.139
370.772
351.919
330.789
307.611
282.64
256.14
228.395
199.691
170.324
140.579
110.733
81.045
51.7518
23.0637
-4.83899
-31.7993
-57.6904
-82.4155
-105.904
-128.11
-149.009
-168.593
-186.876
-203.884
-219.653
-234.22
-247.618
-259.877
-271.024
-281.09
-290.106
-298.11
-305.146
-311.254
-316.468
-320.817
-324.323
-327.01
-328.9
-330.009
-330.354
-329.94
-328.765
-326.823
-324.096
-320.547
-316.15
-310.847
-304.58
-297.281
-288.861
-279.24
-268.328
-256.035
-242.266
-226.952
-210.026
-191.42
-171.096
-149.027
-125.226
-99.7361
-72.6417
-44.0722
-14.1847
16.8175
48.7022
81.1992
114.006
146.803
179.249
211.002
241.733
271.106
298.813
324.554
348.067
369.091
387.409
402.825
415.191
424.384
430.357
433.099
432.611
428.957
422.259
412.641
400.257
385.303
367.986
348.524
327.15
304.083
279.45
253.454
226.048
-275.424
-261.855
-246.986
-230.814
-213.343
-194.542
-174.403
-152.928
-130.165
-106.158
-80.9982
-54.8018
-27.7108
0.657012
32.8678
62.5082
92.7738
123.277
153.798
183.953
213.551
242.316
270.114
296.702
321.833
345.153
366.339
385.071
401.108
414.249
424.336
431.241
434.877
435.165
432.359
426.321
417.131
404.887
389.726
371.833
351.387
328.646
303.865
277.347
249.383
220.286
190.341
159.851
129.07
98.2611
67.6177
37.2248
8.92156
-19.9198
-47.6256
-74.2353
-99.6809
-123.911
-146.881
-168.551
-188.893
-207.899
-225.574
-241.934
-256.998
-270.788
-283.324
-294.628
-304.721
-313.624
-321.358
-327.945
-333.407
-337.767
-341.047
-343.27
-344.455
-344.624
-343.766
-341.925
-339.083
-335.248
-330.399
-324.526
-317.604
-309.612
-300.531
-290.331
-278.993
-266.479
-252.779
-237.875
-221.746
-204.386
-185.78
-165.93
-144.837
-122.523
-99.0117
-74.3581
-48.6231
-21.9035
5.72237
34.2143
63.1595
92.4814
122.024
151.579
180.916
209.797
237.957
265.141
291.072
315.494
338.135
358.756
377.11
392.991
406.193
416.565
423.956
428.292
429.526
427.604
422.573
414.497
403.454
389.565
372.979
353.878
332.476
309.011
283.738
256.933
228.881
199.877
170.221
140.204
110.11
80.1993
50.7116
21.8595
-6.17864
-33.2437
-59.2119
-83.9872
-107.503
-129.715
-150.602
-170.159
-188.402
-205.363
-221.081
-235.597
-248.944
-261.154
-272.252
-282.269
-291.236
-299.193
-306.184
-312.253
-317.434
-321.756
-325.239
-327.909
-329.788
-330.894
-331.242
-330.841
-329.69
-327.781
-325.097
-321.602
-317.269
-312.042
-305.859
-298.651
-290.328
-280.805
-269.99
-257.788
-244.104
-228.865
-211.998
-193.433
-173.126
-151.044
-127.197
-101.625
-74.4096
-45.6835
-15.6021
15.6291
47.7762
80.5646
113.687
146.815
179.603
211.701
242.774
272.48
300.505
326.546
350.334
371.605
390.133
405.718
418.207
427.474
433.471
436.187
435.626
431.853
424.994
415.176
402.556
387.334
369.722
349.941
328.222
304.781
279.748
253.328
225.465
-276.909
-263.383
-248.553
-232.416
-214.978
-196.202
-176.076
-154.593
-131.807
-107.749
-82.5209
-56.2494
-29.1165
-0.819864
31.8885
61.5819
92.0545
122.813
153.607
184.035
213.909
242.95
271.041
297.949
323.42
347.08
368.587
387.607
403.894
417.241
427.489
434.505
438.198
438.486
435.632
429.5
420.161
407.733
392.346
374.197
353.463
330.411
305.302
278.45
250.153
220.731
190.474
159.692
128.64
97.5868
66.7302
36.2259
7.59411
-21.298
-49.1016
-75.7875
-101.287
-125.552
-148.542
-170.218
-190.552
-209.54
-227.187
-243.515
-258.544
-272.299
-284.798
-296.066
-306.123
-314.993
-322.695
-329.25
-334.682
-339.014
-342.27
-344.47
-345.636
-345.789
-344.924
-343.084
-340.249
-336.43
-331.6
-325.752
-318.859
-310.9
-301.853
-291.688
-280.388
-267.909
-254.245
-239.373
-223.273
-205.938
-187.349
-167.509
-146.413
-124.081
-100.535
-75.8276
-50.0184
-23.2024
4.54028
33.2103
62.3203
91.8315
121.59
151.385
180.983
210.142
238.594
266.078
292.312
317.035
339.968
360.866
379.475
395.585
408.982
419.51
427.013
431.415
432.668
430.716
425.61
417.416
406.213
392.126
375.307
355.943
334.254
310.483
284.892
257.763
229.385
200.063
170.101
139.797
109.44
79.2954
49.6028
20.5779
-7.60153
-34.7772
-60.8252
-85.6523
-109.195
-131.413
-152.286
-171.813
-190.013
-206.923
-222.586
-237.047
-250.341
-262.498
-273.546
-283.51
-292.426
-300.333
-307.277
-313.304
-318.45
-322.742
-326.202
-328.854
-330.722
-331.822
-332.175
-331.788
-330.66
-328.785
-326.148
-322.71
-318.445
-313.297
-307.204
-300.092
-291.873
-282.454
-271.742
-259.637
-246.043
-230.884
-214.082
-195.562
-175.274
-153.181
-129.286
-103.629
-76.2854
-47.3944
-17.1085
14.3644
46.7891
79.886
113.342
146.822
179.972
212.435
243.869
273.927
302.29
328.648
352.729
374.26
393.011
408.775
421.395
430.741
436.763
439.451
438.812
434.912
427.883
417.853
404.984
389.481
371.559
351.442
329.364
305.539
280.097
253.249
224.931
-278.47
-264.989
-250.199
-234.101
-216.7
-197.951
-177.841
-156.348
-133.541
-109.43
-84.1253
-57.769
-30.5898
-2.38745
30.842
60.5766
91.2788
122.313
153.397
184.115
214.276
243.604
272.001
299.248
325.081
349.104
370.953
390.279
406.829
420.394
430.814
437.947
441.701
441.99
439.086
432.847
423.352
410.729
395.104
376.684
355.647
332.265
306.809
279.603
250.953
221.188
190.602
159.513
128.176
96.8655
65.7904
35.1578
6.19162
-22.765
-50.6657
-77.429
-102.982
-127.282
-150.293
-171.975
-192.3
-211.266
-228.884
-245.177
-260.169
-273.885
-286.346
-297.576
-307.597
-316.431
-324.098
-330.62
-336.02
-340.323
-343.552
-345.729
-346.873
-347.011
-346.138
-344.298
-341.472
-337.668
-332.86
-327.039
-320.176
-312.251
-303.24
-293.114
-281.853
-269.412
-255.785
-240.948
-224.88
-207.572
-189.002
-169.171
-148.074
-125.726
-102.144
-77.3803
-51.4928
-24.5774
3.28235
32.1483
61.4271
91.1363
121.122
151.169
181.043
210.496
239.256
267.056
293.61
318.651
341.893
363.084
381.964
398.316
411.919
422.613
430.235
434.707
435.98
433.995
428.811
420.491
409.119
394.822
377.757
358.116
336.122
312.027
286.101
258.628
229.908
200.249
169.964
139.357
108.723
78.3307
48.4234
19.2168
-9.10999
-36.4016
-62.532
-87.4127
-110.982
-133.204
-154.061
-173.555
-191.709
-208.564
-224.168
-238.57
-251.808
-263.911
-274.905
-284.815
-293.676
-301.529
-308.423
-314.407
-319.516
-323.777
-327.211
-329.844
-331.699
-332.795
-333.152
-332.778
-331.675
-329.837
-327.248
-323.87
-319.676
-314.611
-308.613
-301.604
-293.495
-284.186
-273.584
-261.583
-248.085
-233.011
-216.28
-197.809
-177.544
-155.44
-131.496
-105.75
-78.2717
-49.2073
-18.7061
13.0212
45.7387
79.1616
112.97
146.822
180.355
213.203
245.018
275.449
304.168
330.861
355.25
377.057
396.044
411.998
424.757
434.186
440.233
442.892
442.17
438.137
430.928
420.675
407.542
391.742
373.496
353.029
330.579
306.358
280.499
253.217
224.446
-280.107
-266.673
-251.926
-235.869
-218.507
-199.79
-179.698
-158.197
-135.369
-111.202
-85.8124
-59.3592
-32.1221
-4.01586
29.6882
59.4813
90.4439
121.778
153.17
184.192
214.653
244.278
272.993
300.597
326.815
351.225
373.439
393.089
409.916
423.712
434.313
441.57
445.389
445.68
442.721
436.366
426.71
413.877
398.001
379.296
357.94
334.208
308.384
280.804
251.782
221.655
190.724
159.31
127.675
96.0964
64.7928
34.005
4.72475
-24.3193
-52.3192
-79.1614
-104.769
-129.103
-152.135
-173.822
-194.137
-213.08
-230.664
-246.92
-261.873
-275.548
-287.968
-299.158
-309.14
-317.937
-325.568
-332.055
-337.422
-341.694
-344.895
-347.047
-348.168
-348.288
-347.407
-345.567
-342.751
-338.963
-334.178
-328.385
-321.555
-313.666
-304.693
-294.609
-283.388
-270.988
-257.401
-242.6
-226.567
-209.286
-190.739
-170.92
-149.822
-127.457
-103.84
-79.0178
-53.0483
-26.0302
1.94645
31.0275
60.4782
90.3939
120.618
150.93
181.094
210.856
239.939
268.074
294.966
320.342
343.909
365.411
384.578
401.185
415.007
425.876
433.624
438.17
439.463
437.444
432.176
423.724
412.173
397.655
380.33
360.396
338.081
313.645
287.364
259.529
230.447
200.433
169.807
138.881
107.955
77.3027
47.1708
17.7741
-10.7071
-38.1184
-64.3343
-89.2696
-112.865
-135.09
-155.93
-175.387
-193.49
-210.285
-225.828
-240.168
-253.346
-265.392
-276.329
-286.182
-294.985
-302.782
-309.623
-315.56
-320.63
-324.86
-328.267
-330.88
-332.721
-333.811
-334.171
-333.812
-332.735
-330.935
-328.397
-325.081
-320.962
-315.985
-310.087
-303.187
-295.194
-286.003
-275.517
-263.626
-250.23
-235.248
-218.592
-200.176
-179.935
-157.822
-133.828
-107.99
-80.3708
-51.1245
-20.3977
11.5974
44.623
78.3894
112.57
146.815
180.751
214.006
246.223
277.045
306.139
333.185
357.899
379.998
399.235
415.39
428.295
437.811
443.885
446.513
445.703
441.53
434.131
423.641
410.232
394.121
375.534
354.702
331.868
307.24
280.953
253.231
224.009
-281.82
-268.437
-253.733
-237.72
-220.402
-201.718
-181.65
-160.14
-137.292
-113.066
-87.5834
-61.0191
-33.7067
-5.5869
28.3005
58.2845
89.5468
121.205
152.923
184.264
215.037
244.968
274.011
301.993
328.621
353.443
376.044
396.036
413.155
427.197
437.988
445.377
449.263
449.554
446.539
440.06
430.233
417.177
401.039
382.034
360.34
336.239
310.027
282.053
252.639
222.131
190.836
159.082
127.136
95.2775
63.7324
32.7644
3.19166
-25.9603
-54.0638
-80.9864
-106.648
-131.016
-154.069
-175.761
-196.064
-214.981
-232.53
-248.745
-263.655
-277.287
-289.664
-300.813
-310.755
-319.512
-327.104
-333.555
-338.888
-343.127
-346.298
-348.424
-349.521
-349.62
-348.731
-346.892
-344.085
-340.315
-335.554
-329.792
-322.995
-315.144
-306.212
-296.171
-284.994
-272.638
-259.092
-244.331
-228.334
-211.083
-192.561
-172.755
-151.658
-129.276
-105.624
-80.7414
-54.6876
-27.5626
0.529393
29.8492
59.4707
89.6017
120.075
150.666
181.134
211.221
240.645
269.131
296.378
322.107
346.018
367.847
387.316
404.193
418.246
429.3
437.181
441.805
443.12
441.064
435.707
427.116
415.377
400.626
383.027
362.783
340.131
315.335
288.681
260.464
231.001
200.613
169.628
138.366
107.134
76.2091
45.8421
16.2476
-12.3951
-39.9302
-66.2346
-91.2248
-114.847
-137.074
-157.893
-177.31
-195.358
-212.089
-227.564
-241.839
-254.955
-266.941
-277.82
-287.613
-296.355
-304.091
-310.876
-316.764
-321.794
-325.991
-329.369
-331.96
-333.786
-334.87
-335.234
-334.89
-333.84
-332.078
-329.593
-326.343
-322.303
-317.417
-311.625
-304.839
-296.97
-287.904
-277.541
-265.767
-252.48
-237.595
-221.02
-202.663
-182.452
-160.332
-136.286
-110.353
-82.5853
-53.1491
-22.1856
10.0902
43.4397
77.5676
112.141
146.799
181.16
214.843
247.482
278.715
308.203
335.621
360.678
383.084
402.585
418.952
432.012
441.62
447.723
450.316
449.413
445.091
437.491
426.752
413.053
396.617
377.672
356.461
333.229
308.182
281.461
253.291
223.618
-283.61
-270.281
-255.621
-239.655
-222.384
-203.738
-183.698
-162.178
-139.315
-115.022
-89.4406
-62.7479
-35.3424
-7.02082
26.5905
56.9798
88.5858
120.594
152.656
184.333
215.429
245.674
275.054
303.434
330.498
355.76
378.771
399.124
416.55
430.848
441.843
449.371
453.327
453.616
450.537
443.935
433.921
420.633
404.218
384.897
362.848
338.359
311.737
283.349
253.523
222.615
190.938
158.828
126.555
94.4033
62.6059
31.4356
1.58826
-27.6887
-55.9012
-82.9057
-108.621
-133.022
-156.097
-177.793
-198.081
-216.969
-234.48
-250.651
-265.517
-279.103
-291.435
-302.54
-312.439
-321.155
-328.708
-335.121
-340.416
-344.622
-347.762
-349.859
-350.93
-351.008
-350.109
-348.271
-345.475
-341.723
-336.988
-331.257
-324.497
-316.686
-307.797
-297.802
-286.67
-274.36
-260.859
-246.139
-230.181
-212.964
-194.468
-174.678
-153.583
-131.186
-107.498
-82.5533
-56.4122
-29.174
-0.972407
28.6118
58.4015
88.7573
119.492
150.374
181.16
211.589
241.37
270.225
297.845
323.947
348.219
370.391
390.179
407.341
421.639
432.887
440.909
445.615
446.952
444.857
439.407
430.669
418.732
403.736
385.849
365.28
342.272
317.098
290.051
261.434
231.57
200.788
169.426
137.811
106.257
75.0482
44.435
14.6341
-14.1759
-41.8398
-68.2352
-93.2803
-116.928
-139.155
-159.951
-179.325
-197.313
-213.974
-229.377
-243.583
-256.634
-268.559
-279.376
-289.106
-297.784
-305.456
-312.182
-318.018
-323.007
-327.169
-330.517
-333.085
-334.895
-335.972
-336.339
-336.01
-334.987
-333.267
-330.836
-327.655
-323.697
-318.908
-313.227
-306.562
-298.824
-289.89
-279.657
-268.006
-254.834
-240.053
-223.566
-205.274
-185.096
-162.97
-138.873
-112.841
-84.9181
-55.2839
-24.073
8.49688
42.1864
76.6938
111.68
146.773
181.58
215.713
248.795
280.461
310.361
338.171
363.588
386.317
406.097
422.688
435.91
445.615
451.749
454.303
453.302
448.823
441.012
430.013
416.009
399.231
379.913
358.308
334.665
309.189
282.023
253.397
223.268
-285.477
-272.205
-257.59
-241.674
-224.454
-205.85
-185.843
-164.314
-141.439
-117.075
-91.3852
-64.5453
-37.0358
-8.34383
24.572
55.5699
87.5603
119.946
152.368
184.397
215.828
246.392
276.115
304.917
332.445
358.174
381.622
402.353
420.1
434.669
445.878
453.555
457.584
457.871
454.724
447.989
437.777
424.246
407.54
387.888
365.466
340.567
313.514
284.69
254.43
223.104
191.027
158.546
125.93
93.4705
61.4094
30.0186
-0.0905489
-29.5063
-57.8331
-84.9213
-110.689
-135.121
-158.219
-179.918
-200.191
-219.047
-236.515
-252.639
-267.458
-280.995
-293.28
-304.339
-314.194
-322.867
-330.379
-336.751
-342.009
-346.178
-349.285
-351.352
-352.397
-352.449
-351.541
-349.704
-346.919
-343.187
-338.479
-332.782
-326.06
-318.292
-309.448
-299.5
-288.418
-276.156
-262.702
-248.026
-232.109
-214.929
-196.461
-176.688
-155.599
-133.187
-109.463
-84.455
-58.222
-30.8656
-2.56214
27.314
57.2672
87.8584
118.866
150.053
181.173
211.959
242.115
271.356
299.368
325.86
350.513
373.046
393.169
410.63
425.186
436.64
444.81
449.603
450.961
448.825
443.276
434.384
422.239
406.986
388.796
367.885
344.503
318.932
291.472
262.435
232.149
200.955
169.197
137.212
105.322
73.8155
42.9466
12.9305
-16.0521
-43.8497
-70.338
-95.4383
-119.111
-141.336
-162.107
-181.433
-199.355
-215.942
-231.268
-245.401
-258.384
-270.245
-280.999
-290.664
-299.273
-306.878
-313.54
-319.323
-324.268
-328.394
-331.711
-334.254
-336.048
-337.117
-337.486
-337.171
-336.177
-334.5
-332.126
-329.017
-325.144
-320.456
-314.891
-308.355
-300.755
-291.961
-281.865
-270.343
-257.294
-242.624
-226.231
-208.01
-187.869
-165.74
-141.592
-115.458
-87.3716
-57.5322
-26.0629
6.81462
40.8607
75.7669
111.186
146.737
182.013
216.616
250.163
282.281
312.614
340.832
366.628
389.698
409.77
426.598
439.992
449.799
455.962
458.477
457.371
452.727
444.693
433.42
419.098
401.961
382.256
360.24
336.174
310.257
282.635
253.55
222.966
-287.42
-274.211
-259.639
-243.777
-226.613
-208.054
-188.088
-166.548
-143.668
-119.228
-93.4197
-66.4112
-38.8032
-9.77395
22.4486
54.0667
86.4709
119.259
152.06
184.458
216.233
247.121
277.19
306.438
334.46
360.688
384.597
405.725
423.808
438.662
450.098
457.93
462.038
462.323
459.104
452.222
441.802
428.017
411.004
391.007
368.195
342.865
315.356
286.074
255.36
223.595
191.1
158.23
125.259
92.4785
60.1399
28.5126
-1.85
-31.4149
-59.8615
-87.0352
-112.855
-137.313
-160.437
-182.139
-202.393
-221.214
-238.635
-254.709
-269.478
-282.964
-295.199
-306.211
-316.019
-324.647
-332.116
-338.447
-343.664
-347.796
-350.868
-352.903
-353.92
-353.944
-353.027
-351.189
-348.418
-344.707
-340.028
-334.367
-327.685
-319.961
-311.163
-301.267
-290.238
-278.025
-264.621
-249.992
-234.12
-216.977
-198.541
-178.788
-157.705
-135.281
-111.522
-86.4483
-60.1192
-32.6376
-4.22715
25.9392
56.0632
86.9023
118.194
149.698
181.168
212.327
242.877
272.522
300.945
327.845
352.897
375.81
396.286
414.062
428.889
440.559
448.885
453.769
455.15
452.971
447.318
438.264
425.901
410.378
391.87
370.601
346.826
320.839
292.945
263.468
232.742
201.114
168.941
136.569
104.326
72.5089
41.3748
11.1352
-18.0268
-45.9611
-72.5448
-97.7002
-121.396
-143.618
-164.361
-183.634
-201.485
-217.992
-233.236
-247.292
-260.204
-271.999
-282.689
-292.285
-300.823
-308.356
-314.951
-320.677
-325.577
-329.667
-332.951
-335.468
-337.243
-338.303
-338.674
-338.374
-337.409
-335.776
-333.462
-330.427
-326.643
-322.06
-316.618
-310.217
-302.762
-294.116
-284.165
-272.78
-259.86
-245.308
-229.016
-210.874
-190.774
-168.644
-144.444
-118.208
-89.9482
-59.897
-28.1586
5.04013
39.4595
74.7833
110.657
146.688
182.456
217.553
251.584
284.177
314.963
343.609
369.802
393.23
413.61
430.686
444.259
454.173
460.371
462.84
461.624
456.807
448.541
436.98
422.323
404.812
384.702
362.261
337.76
311.393
283.306
253.743
222.695
-289.44
-276.299
-261.768
-245.964
-228.862
-210.35
-190.435
-168.883
-146.002
-121.482
-95.5473
-68.3452
-40.66
-11.4277
20.3207
52.4805
85.3179
118.534
151.73
184.514
216.644
247.857
278.272
307.993
336.542
363.302
387.7
409.244
427.676
442.83
454.505
462.5
466.69
466.974
463.676
456.636
446.001
431.945
414.612
394.256
371.036
345.251
317.263
287.501
256.311
224.088
191.154
157.879
124.538
91.4241
58.7942
26.9163
-3.69444
-33.4163
-61.989
-89.2498
-115.118
-139.601
-162.753
-184.456
-204.689
-223.471
-240.842
-256.86
-271.577
-285.01
-297.193
-308.155
-317.915
-326.496
-333.921
-340.208
-345.383
-349.475
-352.51
-354.513
-355.501
-355.492
-354.564
-352.729
-349.971
-346.281
-341.633
-336.01
-329.37
-321.694
-312.944
-303.103
-292.127
-279.969
-266.616
-252.036
-236.212
-219.11
-200.709
-180.979
-159.905
-137.469
-113.676
-88.5347
-62.1068
-34.4886
-5.86411
24.382
54.7847
85.887
117.475
149.31
181.144
212.695
243.656
273.724
302.576
329.904
355.375
378.686
399.532
417.638
432.75
444.648
453.138
458.117
459.521
457.295
451.534
442.309
429.718
413.912
395.072
373.426
349.24
322.816
294.469
264.531
233.342
201.26
168.652
135.874
103.264
71.1233
39.7137
9.24367
-20.1045
-48.1791
-74.8594
-100.069
-123.786
-146.003
-166.716
-185.932
-203.706
-220.125
-235.283
-249.256
-262.096
-273.823
-284.445
-293.971
-302.432
-309.89
-316.415
-322.08
-326.934
-330.987
-334.235
-336.725
-338.481
-339.531
-339.903
-339.618
-338.683
-337.096
-334.843
-331.885
-328.194
-323.721
-318.407
-312.148
-304.847
-296.356
-286.558
-275.317
-262.534
-248.107
-231.923
-213.866
-193.813
-171.686
-147.433
-121.094
-92.6503
-62.3807
-30.3622
3.17152
37.9814
73.7419
110.093
146.626
182.909
218.523
253.061
286.147
317.406
346.5
373.108
396.912
417.616
434.955
448.718
458.744
464.971
467.395
466.062
461.063
452.553
440.691
425.684
407.782
387.249
364.369
339.419
312.587
284.026
253.977
222.459
-291.537
-278.471
-263.976
-248.235
-231.202
-212.74
-192.889
-171.323
-148.445
-123.844
-97.7719
-70.3445
-42.6132
-13.2819
18.1442
50.8146
84.1019
117.773
151.379
184.567
217.061
248.599
279.352
309.578
338.689
366.016
390.933
412.911
431.705
447.173
459.102
467.271
471.545
471.822
468.44
461.238
450.372
436.033
418.366
397.634
373.99
347.725
319.233
288.969
257.281
224.579
191.187
157.491
123.765
90.3006
57.3697
25.2278
-5.62806
-35.5132
-64.2182
-91.5678
-117.482
-141.982
-165.167
-186.871
-207.081
-225.819
-243.135
-259.094
-273.757
-287.132
-299.261
-310.171
-319.881
-328.414
-335.793
-342.034
-347.165
-351.216
-354.213
-356.182
-357.139
-357.091
-356.154
-354.321
-351.578
-347.911
-343.296
-337.713
-331.117
-323.488
-314.791
-305.007
-294.088
-281.987
-268.688
-254.159
-238.386
-221.328
-202.966
-183.26
-162.199
-139.752
-115.926
-90.7176
-64.1872
-36.4232
-7.57828
22.7399
53.4297
84.8082
116.705
148.884
181.098
213.056
244.446
274.957
304.258
332.033
357.943
381.67
402.907
421.359
436.772
448.908
457.571
462.65
464.077
461.802
455.925
446.522
433.693
417.591
398.403
376.362
351.746
324.864
296.045
265.624
233.952
201.394
168.332
135.129
102.136
69.6597
37.9647
7.25643
-22.2841
-50.5043
-77.2826
-102.546
-126.282
-148.492
-169.171
-188.325
-206.015
-222.339
-237.404
-251.293
-264.057
-275.715
-286.269
-295.721
-304.103
-311.479
-317.929
-323.532
-328.339
-332.354
-335.564
-338.025
-339.761
-340.801
-341.172
-340.902
-339.997
-338.458
-336.269
-333.391
-329.796
-325.436
-320.257
-314.148
-307.009
-298.683
-289.045
-277.956
-265.317
-251.021
-234.955
-216.991
-196.991
-174.87
-150.565
-124.121
-95.4815
-64.988
-32.6786
1.2036
36.4207
72.638
109.489
146.549
183.371
219.524
254.593
288.193
319.945
349.508
376.55
400.748
421.792
439.406
453.366
463.508
469.778
472.143
470.687
465.497
456.73
444.553
429.181
410.871
389.898
366.562
341.152
313.849
284.808
254.261
222.267
-293.709
-280.731
-266.263
-250.589
-233.635
-215.222
-195.453
-173.871
-150.999
-126.316
-100.096
-72.4064
-44.6654
-15.2989
15.8566
49.0679
82.8239
116.975
151.006
184.616
217.486
249.344
280.42
311.189
340.9
368.833
394.299
416.729
435.895
451.693
463.892
472.245
476.608
476.876
473.401
466.03
454.916
440.284
422.267
401.145
377.058
350.288
321.264
290.477
258.266
225.065
191.196
157.063
122.937
89.1068
55.8633
23.4449
-7.65532
-37.7081
-66.5517
-93.9919
-119.948
-144.457
-167.682
-189.385
-209.569
-228.259
-245.514
-261.409
-276.016
-289.331
-301.403
-312.26
-321.918
-330.4
-337.731
-343.926
-349.011
-353.017
-355.975
-357.909
-358.836
-358.74
-357.796
-355.965
-353.237
-349.596
-345.014
-339.474
-332.924
-325.347
-316.703
-306.979
-296.121
-284.079
-270.838
-256.363
-240.643
-223.633
-205.312
-185.635
-164.589
-142.134
-118.275
-92.998
-66.361
-38.4467
-9.38819
21.0311
52.0006
83.6648
115.881
148.419
181.028
213.411
245.25
276.222
305.993
334.233
360.602
384.764
406.409
425.223
440.953
453.341
462.187
467.369
468.819
466.492
460.494
450.905
437.827
421.417
401.865
379.411
354.344
326.984
297.671
266.745
234.567
201.512
167.973
134.328
100.934
68.1094
36.1199
5.1645
-24.5741
-52.9438
-79.8214
-105.137
-128.889
-151.088
-171.731
-190.817
-208.415
-224.638
-239.603
-253.402
-266.088
-277.676
-288.16
-297.536
-305.835
-313.125
-319.495
-325.032
-329.791
-333.77
-336.939
-339.369
-341.083
-342.11
-342.482
-342.225
-341.351
-339.862
-337.74
-334.944
-331.447
-327.206
-322.168
-316.217
-309.249
-301.096
-291.627
-280.698
-268.211
-254.053
-238.114
-220.251
-200.311
-178.198
-153.84
-127.294
-98.4422
-67.7215
-35.11
-0.865656
34.7762
71.471
108.845
146.458
183.845
220.561
256.179
290.315
322.58
352.632
380.129
404.739
426.139
444.045
458.214
468.476
474.779
477.088
475.504
470.116
461.082
448.576
432.821
414.083
392.652
368.846
342.963
315.196
285.639
254.568
222.066
-295.956
-283.081
-268.626
-253.026
-236.166
-217.795
-198.135
-176.54
-153.669
-128.903
-102.523
-74.5279
-46.8195
-17.4872
13.4375
47.2383
81.4848
116.142
150.61
184.664
217.921
250.09
281.462
312.821
343.173
371.754
397.802
420.7
440.249
456.395
468.878
477.426
481.881
482.14
478.565
471.009
459.636
444.699
426.315
404.789
380.243
352.939
323.356
292.022
259.264
225.545
191.177
156.589
122.05
87.8401
54.2719
21.5645
-9.7805
-40.003
-68.9928
-96.5256
-122.518
-147.023
-170.301
-192.001
-212.155
-230.792
-247.981
-263.805
-278.356
-291.606
-303.619
-314.42
-324.025
-332.455
-339.737
-345.883
-350.92
-354.88
-357.797
-359.695
-360.59
-360.439
-359.488
-357.66
-354.95
-351.336
-346.788
-341.294
-334.792
-327.269
-318.679
-309.018
-298.226
-286.245
-273.065
-258.645
-242.984
-226.024
-207.75
-188.103
-167.076
-144.617
-120.73
-95.3815
-68.6358
-40.5659
-11.3096
19.2566
50.492
82.4503
114.997
147.907
180.929
213.755
246.064
277.515
307.779
336.506
363.356
387.973
410.046
429.24
445.3
457.951
466.989
472.279
473.752
471.368
465.244
455.46
442.121
425.389
405.455
382.57
357.031
329.172
299.341
267.891
235.184
201.611
167.574
133.468
99.6579
66.471
34.1788
2.96922
-26.9724
-55.4948
-82.473
-107.838
-131.604
-153.791
-174.396
-193.41
-210.907
-227.021
-241.88
-255.586
-268.19
-279.708
-290.12
-299.417
-307.627
-314.826
-321.112
-326.58
-331.29
-335.232
-338.357
-340.756
-342.446
-343.461
-343.83
-343.586
-342.744
-341.306
-339.253
-336.542
-333.146
-329.029
-324.137
-318.352
-311.564
-303.593
-294.302
-283.54
-271.215
-257.203
-241.399
-223.647
-203.774
-181.672
-157.262
-130.619
-101.539
-70.589
-37.6636
-3.04274
33.0414
70.2349
108.156
146.346
184.324
221.628
257.821
292.513
325.31
355.868
383.839
408.884
430.66
448.87
463.258
473.647
479.985
482.231
480.511
474.914
465.599
452.748
436.595
417.41
395.503
371.207
344.839
316.583
286.526
254.928
221.914
-298.275
-285.53
-271.063
-255.543
-238.8
-220.455
-200.945
-179.353
-156.457
-131.61
-105.06
-76.7048
-49.0755
-19.8434
10.8508
45.3229
80.0862
115.275
150.191
184.71
218.367
250.836
282.46
314.468
345.507
374.78
401.447
424.827
444.766
461.278
474.066
482.818
487.368
487.615
483.932
476.177
464.536
449.276
430.51
408.567
383.548
355.678
325.504
293.603
260.272
226.017
191.127
156.068
121.103
86.4922
52.5935
19.583
-12.0077
-42.4003
-71.545
-99.1725
-125.195
-149.679
-173.026
-194.72
-214.84
-233.418
-250.535
-266.282
-280.777
-293.958
-305.909
-316.654
-326.204
-334.579
-341.81
-347.905
-352.891
-356.804
-359.678
-361.54
-362.403
-362.182
-361.231
-359.407
-356.716
-353.128
-348.618
-343.173
-336.721
-329.253
-320.72
-311.128
-300.403
-288.487
-275.369
-261.007
-245.409
-228.5
-210.277
-190.664
-169.66
-147.196
-123.285
-97.8639
-71.0081
-42.7771
-13.3242
17.4068
48.9068
81.1671
114.055
147.349
180.798
214.082
246.881
278.829
309.606
338.839
366.192
391.287
413.808
433.401
449.809
462.739
471.978
477.381
478.877
476.434
470.177
460.189
446.58
429.514
409.183
385.847
359.815
331.437
301.068
269.069
235.813
201.697
167.139
132.549
98.3063
64.7442
32.1402
0.668298
-29.4832
-58.1638
-85.2435
-110.654
-134.431
-156.605
-177.17
-196.103
-213.49
-229.485
-244.231
-257.838
-270.36
-281.807
-292.149
-301.364
-309.481
-316.582
-322.778
-328.174
-332.836
-336.743
-339.817
-342.186
-343.852
-344.852
-345.218
-344.987
-344.175
-342.791
-340.808
-338.184
-334.892
-330.902
-326.164
-320.553
-313.954
-306.174
-297.07
-286.484
-274.326
-260.467
-244.81
-227.177
-207.379
-185.292
-160.829
-134.05
-104.812
-73.5889
-40.3366
-5.3249
31.2166
68.9291
107.42
146.215
184.808
222.723
259.512
294.786
328.139
359.226
387.692
413.189
435.359
453.889
468.502
479.02
485.42
487.576
485.717
479.902
470.293
457.083
440.514
420.863
398.458
373.658
346.8
318.048
287.491
255.329
221.807
-300.666
-288.092
-273.572
-258.139
-241.544
-223.199
-203.902
-182.35
-159.375
-134.444
-107.72
-78.9314
-51.4368
-22.3581
8.04945
43.3187
78.6304
114.372
149.746
184.756
218.829
251.582
283.392
316.127
347.899
377.916
405.239
429.115
449.446
466.346
479.457
488.428
493.075
493.302
489.501
481.545
469.612
454.019
434.853
412.481
386.976
358.505
327.708
295.22
261.287
226.477
191.042
155.496
120.093
85.0621
50.8251
17.4968
-14.3415
-44.9023
-74.2114
-101.937
-127.982
-152.42
-175.863
-197.545
-217.626
-236.14
-253.176
-268.838
-283.278
-296.385
-308.272
-318.958
-328.451
-336.771
-343.949
-349.991
-354.925
-358.788
-361.618
-363.443
-364.278
-363.978
-363.025
-361.21
-358.533
-354.98
-350.504
-345.115
-338.712
-331.303
-322.828
-313.31
-302.654
-290.805
-277.751
-263.45
-247.918
-231.068
-212.899
-193.323
-172.345
-149.88
-125.944
-100.451
-73.4785
-45.0844
-15.4341
15.4857
47.2484
79.8165
113.057
146.752
180.646
214.411
247.718
280.184
311.491
341.251
369.124
394.717
417.704
437.71
454.483
467.705
477.157
482.676
484.194
481.689
475.293
465.093
451.203
433.789
413.042
389.235
362.689
333.767
302.837
270.266
236.433
201.75
166.65
131.558
96.8641
62.9135
29.991
-1.75152
-32.1169
-60.9583
-88.1381
-113.589
-137.369
-159.527
-180.05
-198.895
-216.16
-232.028
-246.653
-260.159
-272.597
-283.975
-294.245
-303.376
-311.395
-318.393
-324.489
-329.81
-334.425
-338.303
-341.323
-343.658
-345.297
-346.281
-346.643
-346.423
-345.643
-344.315
-342.406
-339.873
-336.686
-332.829
-328.252
-322.827
-316.426
-308.849
-299.943
-289.54
-277.558
-263.86
-248.36
-230.858
-211.144
-189.075
-164.556
-137.636
-108.235
-76.7288
-43.1364
-7.71855
29.3029
67.5589
106.646
146.075
185.311
223.864
261.265
297.137
331.063
362.696
391.679
417.65
440.232
459.104
473.959
484.61
491.03
493.123
491.121
485.081
475.164
461.579
444.575
424.438
401.515
376.194
348.826
319.58
288.488
255.745
221.607
-303.129
-290.801
-276.14
-260.811
-244.403
-226.023
-207.034
-185.605
-162.444
-137.412
-110.528
-81.2052
-53.9111
-25.0302
4.98962
41.2256
77.1209
113.431
149.276
184.801
219.315
252.329
284.226
317.796
350.348
381.163
409.186
433.566
454.289
471.599
485.057
494.259
499.007
499.209
495.277
487.116
474.867
458.931
439.344
416.532
390.531
361.418
329.962
296.87
262.304
226.923
190.916
154.868
119.018
83.5421
48.9646
15.3025
-16.7877
-47.5103
-76.9974
-104.825
-130.882
-155.236
-178.816
-200.473
-220.512
-238.956
-255.905
-271.473
-285.866
-298.892
-310.714
-321.341
-330.775
-339.036
-346.161
-352.149
-357.026
-360.836
-363.619
-365.405
-366.221
-365.802
-364.861
-363.056
-360.398
-356.879
-352.438
-347.108
-340.757
-333.407
-324.991
-315.549
-304.97
-293.192
-280.208
-265.971
-250.512
-233.725
-215.619
-196.085
-175.141
-152.68
-128.726
-103.161
-76.0679
-47.5073
-17.66
13.4616
45.4907
78.3697
111.975
146.084
180.442
214.705
248.547
281.557
313.419
343.732
372.151
398.265
421.741
442.182
459.333
472.861
482.537
488.175
489.716
487.14
480.599
470.177
455.993
438.216
417.038
392.738
365.655
336.169
304.656
271.494
237.063
201.791
166.126
130.511
95.3504
60.9977
27.7498
-4.27167
-34.8551
-63.8634
-91.1471
-116.635
-140.417
-162.559
-183.044
-201.795
-218.929
-234.659
-249.153
-262.552
-274.902
-286.208
-296.405
-305.448
-313.363
-320.25
-326.244
-331.487
-336.058
-339.914
-342.887
-345.169
-346.775
-347.74
-348.097
-347.884
-347.137
-345.866
-344.033
-341.594
-338.51
-334.791
-330.381
-325.151
-318.958
-311.597
-302.897
-292.688
-280.895
-267.364
-252.04
-234.687
-215.071
-193.028
-168.457
-141.391
-111.824
-80.0275
-46.0832
-10.2483
27.276
66.0941
105.808
145.901
185.808
225.029
263.076
299.567
334.086
366.286
395.807
422.275
445.291
464.517
479.622
490.407
496.884
498.877
496.725
490.448
480.209
466.233
448.777
428.135
404.666
378.805
350.92
321.175
289.556
256.213
221.408
-305.667
-293.735
-278.747
-263.561
-247.382
-228.923
-210.348
-189.254
-165.67
-140.52
-113.524
-83.5234
-56.515
-27.85
1.6094
39.0483
75.5603
112.448
148.779
184.846
219.833
253.085
284.922
319.473
352.851
384.526
413.296
438.185
459.29
477.041
490.872
500.314
505.167
505.348
501.258
492.889
480.302
464.012
443.984
420.721
394.22
364.418
332.262
298.554
263.317
227.355
190.744
154.18
117.876
81.9223
47.0088
12.9967
-19.3523
-50.223
-79.9025
-107.837
-133.899
-158.117
-181.9
-203.517
-223.514
-241.881
-258.738
-274.191
-288.536
-301.461
-313.214
-323.783
-333.158
-341.358
-348.422
-354.347
-359.162
-362.911
-365.643
-367.384
-368.163
-367.604
-366.735
-364.955
-362.314
-358.833
-354.43
-349.153
-342.854
-335.561
-327.215
-317.854
-307.361
-295.65
-282.738
-268.56
-253.171
-236.449
-218.41
-198.923
-178.023
-155.572
-131.612
-105.977
-78.761
-50.0295
-19.9837
11.3497
43.6479
76.84
110.821
145.353
180.188
214.966
249.36
282.937
315.376
346.259
375.248
401.911
425.898
446.793
464.347
478.198
488.111
493.876
495.439
492.79
486.098
475.446
460.961
442.81
421.183
396.37
368.732
338.658
306.537
272.761
237.708
201.817
165.558
129.396
93.7472
58.978
25.3955
-6.91516
-37.7256
-66.9099
-94.3013
-119.816
-143.59
-165.711
-186.156
-204.8
-221.784
-237.361
-251.713
-264.999
-277.26
-288.5
-298.626
-307.581
-315.386
-322.156
-328.042
-333.201
-337.724
-341.573
-344.431
-346.676
-348.261
-349.216
-349.575
-349.375
-348.663
-347.45
-345.701
-343.357
-340.375
-336.79
-332.557
-327.532
-321.557
-314.421
-305.933
-295.923
-284.315
-270.944
-255.808
-238.612
-219.11
-197.106
-172.496
-145.288
-115.553
-83.4613
-49.1562
-12.8918
25.1525
64.5494
104.912
145.693
186.296
226.21
264.926
302.061
337.201
369.99
400.076
427.063
450.53
470.132
485.5
496.418
502.962
504.837
502.536
496.012
485.438
471.058
453.133
431.959
407.923
381.504
353.104
322.882
290.738
256.802
221.378
-308.267
-297.126
-281.313
-266.377
-250.467
-231.892
-213.824
-193.557
-169.044
-143.775
-116.776
-85.8886
-59.2845
-30.7976
-2.16862
36.8027
73.9479
111.415
148.252
184.886
220.396
253.86
285.421
321.163
355.407
388.008
417.582
442.978
464.446
482.674
496.906
506.603
511.561
511.713
507.45
498.871
485.918
469.262
448.77
425.05
398.053
367.502
334.601
300.272
264.321
227.771
190.521
153.427
116.666
80.1965
44.957
10.5706
-22.0305
-53.0319
-82.9462
-110.99
-137.071
-161.06
-185.129
-206.635
-226.584
-244.86
-261.621
-276.927
-291.194
-303.896
-315.357
-325.421
-333.94
-340.775
-345.806
-348.919
-350.125
-349.537
-347.406
-344.107
-340.108
-335.595
-332.196
-329.421
-327.492
-326.035
-325.137
-324.379
-323.553
-322.148
-319.682
-315.415
-308.53
-298.27
-285.435
-271.326
-255.969
-239.282
-221.311
-201.864
-180.995
-158.541
-134.574
-108.876
-81.539
-52.6396
-22.3958
9.1615
41.7271
75.2405
109.611
144.583
179.912
215.229
250.194
284.358
317.392
348.867
378.441
405.674
430.19
451.556
469.526
483.717
493.879
499.772
501.34
498.622
491.777
480.886
466.09
447.553
425.458
400.109
371.891
341.203
308.452
274.036
238.335
201.798
164.925
128.196
92.0421
56.8616
22.914
-9.67388
-40.7076
-70.0602
-97.5384
-123.039
-146.756
-168.793
-189.107
-207.496
-224.104
-239.213
-252.975
-265.506
-276.794
-286.778
-295.299
-302.282
-307.791
-312.032
-315.278
-317.764
-319.497
-320.351
-320.105
-320.107
-319.976
-319.854
-319.877
-320.038
-320.127
-320.181
-320.266
-320.328
-320.236
-319.91
-319.196
-317.907
-315.797
-312.377
-307.072
-299.152
-288.04
-274.781
-259.791
-242.719
-223.329
-201.347
-176.672
-149.299
-119.407
-87.0181
-52.3515
-15.6483
22.9347
62.9418
103.986
145.49
186.816
227.439
266.844
304.634
340.413
373.801
404.475
432.008
455.949
475.947
491.595
502.64
509.125
510.989
508.545
501.769
490.842
476.041
457.627
435.896
411.261
384.267
355.344
324.706
292.078
257.499
221.494
-260.619
-289.611
-276.181
-264.05
-249.676
-233.478
-217.314
-199.304
-172.442
-147.133
-120.361
-88.409
-62.2989
-33.8519
-6.44446
34.5081
72.2878
110.315
147.695
184.918
221.021
254.675
285.643
322.879
358.01
391.613
422.058
447.949
469.748
488.503
503.159
513.127
518.192
518.33
513.856
505.07
491.712
474.686
453.701
429.519
402.042
370.667
336.97
302.027
265.304
228.172
190.235
152.603
115.395
78.3595
42.8005
8.01021
-24.8737
-55.9712
-86.1391
-114.231
-140.305
-163.911
-188.319
-209.322
-228.299
-243.783
-254.034
-254.954
-241.245
-217.177
-193
-170.648
-150.213
-131.945
-115.996
-102.66
-92.1478
-84.5553
-79.8439
-77.9261
-78.4113
-81.1157
-85.1729
-90.5803
-97.3133
-105.279
-114.808
-125.724
-138.35
-152.635
-168.408
-185.014
-201.344
-215.511
-224.151
-227.891
-229.012
-226.376
-218.777
-204.598
-184.269
-161.726
-137.698
-111.915
-84.4306
-55.3315
-24.8896
6.89465
39.7117
73.5464
108.313
143.74
179.584
215.463
251.028
285.799
319.452
351.55
381.732
409.563
434.634
456.491
474.892
489.438
499.859
505.883
507.442
504.65
497.646
486.507
471.389
452.45
429.871
403.963
375.144
343.822
310.422
275.349
238.983
201.777
164.268
126.953
90.2816
54.6857
20.3826
-12.4635
-43.6794
-73.1349
-100.578
-125.849
-149.144
-170.446
-189.437
-205.402
-218.012
-227.051
-232.02
-232.362
-227.584
-217.794
-204.977
-192.693
-181.577
-171.773
-163.201
-155.543
-148.443
-141.889
-136.29
-132.06
-129.201
-127.493
-126.825
-127.167
-128.417
-130.468
-133.428
-137.49
-142.713
-148.907
-156.052
-164.373
-174.042
-185.106
-197.25
-209.473
-219.306
-224.498
-227.067
-225.979
-219.561
-205.051
-181.27
-153.558
-123.457
-90.7232
-55.6618
-18.5202
20.6029
61.2289
102.991
145.26
187.351
228.712
268.836
307.307
343.739
377.742
409.022
437.126
461.567
481.982
497.925
509.093
515.52
517.35
514.767
507.721
496.425
481.187
462.265
439.954
414.692
387.096
357.641
326.552
293.38
258.028
221.454
-3.88837
-8.30829
-32.2293
-60.5386
-91.4077
-125.256
-161.423
-192.881
-166.693
-146.368
-124.337
-90.9702
-65.5424
-37.0217
-11.4192
32.1535
70.6
109.117
147.099
184.936
221.733
255.566
285.474
324.648
360.65
395.345
426.742
453.107
475.186
494.534
509.643
519.893
525.062
525.182
520.476
511.488
497.686
480.287
458.774
434.128
406.204
373.909
339.357
303.824
266.252
228.562
189.885
151.708
114.057
76.3419
40.491
5.2897
-27.7316
-58.8242
-89.243
-116.94
-141.169
-156.692
-158.468
-134.72
-108.722
-83.2749
-58.9934
-36.9641
-24.0872
-17.4304
-12.7434
-8.95685
-5.99403
-3.7947
-2.26005
-1.29147
-0.758528
-0.525868
-0.472364
-0.514645
-0.608511
-0.749188
-0.921904
-1.14609
-1.43573
-1.82338
-2.34589
-3.07415
-4.12417
-5.67741
-8.00205
-11.5139
-17.0226
-25.6358
-38.9476
-56.0008
-75.1591
-95.6835
-116.393
-133.656
-141.124
-139.087
-130.584
-113.72
-87.6909
-58.239
-27.5213
4.53841
37.6209
71.7766
106.945
142.823
179.197
215.65
251.845
287.239
321.531
354.277
385.093
413.552
439.201
461.577
480.436
495.359
506.057
512.225
513.77
510.896
503.726
492.329
476.881
457.53
434.45
407.96
378.518
346.535
312.461
276.708
239.652
201.75
163.581
125.665
88.4708
52.4858
17.895
-15.0858
-46.2261
-75.2309
-101.209
-122.714
-137.996
-144.164
-138.056
-123.26
-107.188
-91.041
-75.473
-61.0524
-48.387
-38.1148
-30.4513
-24.3791
-19.5742
-15.7129
-12.5318
-9.85467
-7.72672
-6.31838
-5.63956
-5.21942
-4.97191
-4.83596
-4.77371
-4.78739
-4.89945
-5.09613
-5.38079
-5.79214
-6.37584
-7.13898
-8.13901
-9.51008
-11.4294
-14.2789
-18.5672
-25.1368
-35.3694
-49.8319
-67.2026
-87.5071
-109.868
-130.452
-139.89
-136.362
-122.492
-94.8895
-59.2212
-21.5441
18.1784
59.4305
101.926
144.984
187.874
230.008
270.864
310.052
347.155
381.797
413.716
442.413
467.379
488.234
504.493
515.786
522.16
523.926
521.206
513.877
502.196
486.509
467.063
444.144
418.213
389.981
360.014
328.482
294.815
258.812
221.625
-3.71643
-3.63949
-3.81672
-4.08104
-4.1901
-4.17506
-4.18836
-9.79009
-29.2858
-52.2056
-76.4786
-78.6982
-61.6496
-38.6193
-17.2133
29.8671
68.9257
107.635
146.438
184.9
222.557
256.599
284.754
326.523
363.309
399.209
431.662
458.46
480.742
500.77
516.368
526.907
532.177
532.269
527.313
518.13
503.843
486.066
463.99
438.873
410.568
377.219
341.745
305.678
267.158
228.954
189.434
150.65
112.617
74.275
38.255
2.69809
-29.9004
-57.2138
-71.8702
-59.5219
-44.4153
-27.4411
-13.6335
-7.92876
-4.07648
-1.40617
0.0258215
0.212991
0.206229
0.17875
0.163271
0.145445
0.129457
0.114862
0.10124
0.0890489
0.0786267
0.0697838
0.0611424
0.052265
0.0440561
0.036138
0.0286314
0.0221253
0.0160512
0.00929308
0.00177826
-0.00761964
-0.0206943
-0.0397965
-0.0682215
-0.110786
-0.183098
-0.30205
-0.510777
-0.888889
-1.59688
-2.96174
-5.65469
-10.9041
-20.7956
-33.8633
-47.4886
-58.4537
-58.9537
-47.059
-27.2151
1.81928
35.2679
69.8705
105.497
141.852
178.771
215.805
252.655
288.694
323.644
357.06
388.532
417.649
443.896
466.811
486.15
501.473
512.467
518.785
520.259
517.327
509.99
498.326
482.536
462.761
439.154
412.05
381.959
349.285
314.517
278.06
240.289
201.668
162.828
124.33
86.6804
50.4908
16.0748
-15.4483
-41.5325
-57.5159
-57.2892
-49.1765
-38.6486
-27.6109
-18.2712
-12.056
-7.53698
-4.31083
-2.12011
-0.772573
-0.0904759
0.0546135
0.00895616
-0.017969
-0.0358191
-0.0501016
-0.0630304
-0.0729554
-0.0759134
-0.0704755
-0.0621399
-0.0567691
-0.0540704
-0.0526354
-0.051705
-0.0513467
-0.0517783
-0.0531537
-0.0555873
-0.0595778
-0.0656278
-0.0731373
-0.0826323
-0.096605
-0.11725
-0.152047
-0.208119
-0.299208
-0.463191
-0.759147
-1.31369
-2.43648
-4.81682
-10.0325
-21.2378
-37.0742
-52.9886
-60.0251
-47.5605
-22.6672
15.4233
57.5169
100.814
144.696
188.396
231.336
272.934
312.862
350.656
385.948
418.542
447.86
473.374
494.694
511.294
522.715
528.789
530.681
527.833
520.209
508.127
491.974
471.985
448.423
421.774
392.88
362.379
330.478
296.371
259.88
222.274
-3.54928
-3.51165
-3.652
-3.8703
-3.97254
-3.97683
-3.99881
-4.06626
-4.16893
-4.18155
-4.12133
-4.38561
-4.42728
-4.43826
-8.44487
33.7641
67.1264
106.449
145.766
184.549
223.487
257.844
283.247
328.602
365.949
403.206
436.85
464.019
486.386
507.221
523.343
534.167
539.542
539.604
534.385
524.994
510.191
492.03
469.35
443.747
415.171
380.586
344.124
307.609
267.965
229.258
188.857
149.646
111.384
72.4311
37.5791
11.8538
4.85514
1.31206
0.661559
0.606956
0.529543
0.452425
0.41101
0.361782
0.332772
0.298852
0.247488
0.214379
0.200635
0.173962
0.157652
0.140178
0.124599
0.110496
0.0979479
0.0869808
0.0777855
0.0701418
0.062885
0.0556651
0.0491407
0.0433857
0.0380668
0.0350132
0.0325304
0.0308145
0.0297076
0.029437
0.0296258
0.0301054
0.0308931
0.0315168
0.0324589
0.0325263
0.03344
0.0365931
0.0415575
0.0453909
0.0494386
0.0569635
0.0723336
0.108601
0.173725
0.32829
0.774614
2.16441
6.36588
18.1578
40.6085
69.1193
103.687
140.74
178.271
215.918
253.449
290.153
325.789
359.902
392.052
421.86
448.731
472.203
492.044
507.783
519.092
525.571
526.921
523.934
516.42
504.477
488.328
468.114
443.956
416.209
385.445
352.055
316.567
279.38
240.864
201.514
162.04
123.118
85.6256
51.8402
25.6501
11.8457
4.07461
0.563545
0.12661
0.0940097
0.0711103
0.0755268
0.0849362
0.0668531
0.0583521
0.0520484
0.046199
0.0422677
0.0519541
0.0552337
0.0432185
0.037688
0.0341002
0.0311021
0.0285581
0.026837
0.0262584
0.0261439
0.0254092
0.0249288
0.0246284
0.0246917
0.0252053
0.0261279
0.0275185
0.0293508
0.0313818
0.0335618
0.0360874
0.0392929
0.0432958
0.0478812
0.0529309
0.0581563
0.0635409
0.0690817
0.0747
0.0806027
0.0878243
0.0950286
0.101083
0.109818
0.128333
0.17355
0.289054
0.657828
2.05863
7.63203
26.5445
58.5147
99.4745
144.39
188.941
232.706
275.062
315.745
354.25
390.203
423.506
453.476
479.562
501.373
518.339
529.894
535.634
537.654
534.67
526.722
514.215
497.575
477.022
452.786
425.378
395.77
364.691
332.426
297.875
261.061
222.663
-3.38404
-3.36976
-3.48991
-3.67178
-3.76754
-3.78537
-3.81244
-3.8959
-3.94898
-3.97403
-3.96529
-4.32058
-4.27277
-4.26264
1.06777
30.182
64.9345
111.612
146.096
185.132
224.722
259.237
280.478
331.024
368.484
407.346
442.355
469.801
492.083
513.903
530.579
541.676
547.158
547.162
541.728
532.07
516.754
498.191
474.861
448.73
420.102
383.986
346.429
309.53
268.668
229.762
188.436
148.197
107.965
68.6115
36.0167
13.7571
5.84754
1.30713
0.637699
0.578351
0.509086
0.434455
0.391197
0.345538
0.316393
0.280275
0.236514
0.205847
0.190684
0.166368
0.150161
0.133563
0.118723
0.105301
0.0933581
0.0829018
0.0741235
0.0667757
0.0599661
0.053284
0.0470823
0.0417331
0.0372629
0.0341802
0.0316951
0.0300359
0.0287846
0.0284621
0.0283216
0.0286848
0.029026
0.0294113
0.0300923
0.0302368
0.0312961
0.0342827
0.0383708
0.0422182
0.0467208
0.0548542
0.069669
0.100942
0.160796
0.307646
0.731913
2.03011
5.95323
17.1891
39.2563
67.4302
101.973
139.357
177.548
215.905
254.231
291.616
327.963
362.8
395.654
426.182
453.707
477.746
498.115
514.285
525.931
532.593
533.752
530.725
523.023
510.782
494.257
473.589
448.856
420.423
388.945
354.774
318.504
280.547
241.275
201.13
160.874
121.16
83.2245
49.5571
24.0477
10.9982
3.66662
0.443977
0.11405
0.0834448
0.0652813
0.0629918
0.0760071
0.0636895
0.055966
0.0500688
0.0449432
0.0418624
0.0480513
0.0496812
0.0411871
0.0361559
0.0326915
0.0298681
0.0275431
0.0259718
0.0253774
0.0253805
0.0246585
0.0241181
0.023783
0.0237826
0.0242084
0.0250379
0.0263165
0.0280104
0.0299168
0.0320057
0.0344423
0.037501
0.0412692
0.0455762
0.0503222
0.0552459
0.0603331
0.0655353
0.0708032
0.0763128
0.0826465
0.0888127
0.0943511
0.1031
0.121259
0.161906
0.267006
0.611683
1.9213
7.05485
25.2053
56.9014
98.1172
143.911
189.482
234.164
277.287
318.707
357.938
394.56
428.616
459.268
485.938
508.275
525.638
537.346
542.597
544.847
541.724
533.423
520.465
503.318
482.185
457.224
428.982
398.618
366.92
334.208
299.169
262.06
222.732
-3.21941
-3.22041
-3.32403
-3.47686
-3.56584
-3.59286
-3.6235
-3.69466
-3.74762
-3.77743
-3.78995
-4.04962
-4.04226
-4.04447
-4.15951
-4.0742
-3.60986
24.2024
96.5359
178.023
225.954
262.129
275.236
333.83
370.313
411.597
448.228
475.816
497.773
520.832
538.094
549.444
555.029
554.984
549.379
539.373
523.576
504.567
480.553
453.78
425.389
387.262
348.675
311.768
269.362
226.915
165.486
95.4705
36.7112
13.1809
2.28257
0.847419
0.746045
0.627378
0.5851
0.537991
0.471086
0.414699
0.372513
0.329144
0.301003
0.265803
0.226756
0.197362
0.18103
0.158698
0.14284
0.127117
0.113042
0.100329
0.0890095
0.079076
0.0706639
0.063506
0.0569144
0.0505777
0.0447295
0.039694
0.0353375
0.0324143
0.0300858
0.0284979
0.0274243
0.0270525
0.0269983
0.027293
0.0276643
0.0279883
0.0285379
0.0285983
0.0294746
0.0316748
0.0345868
0.0367022
0.0385114
0.0411745
0.0447959
0.0509844
0.0563842
0.0662356
0.0968327
0.174808
0.394089
1.08103
3.47396
11.9173
39.7358
90.47
149.401
204.948
252.76
293.051
330.209
365.796
399.365
430.645
458.865
483.472
504.395
521.004
532.998
539.852
540.753
537.713
529.803
517.243
500.317
479.17
453.796
424.577
392.28
357.221
319.999
280.585
237.44
184.791
120.435
61.1588
25.4267
7.36469
0.474457
0.143679
0.086871
0.0683545
0.0829065
0.0700851
0.0604927
0.0602541
0.0685317
0.0598099
0.0531848
0.0479466
0.0434821
0.0410744
0.0452035
0.0457802
0.0391601
0.0345286
0.0311755
0.0284853
0.0263184
0.0248121
0.0241167
0.0232454
0.0233596
0.0229469
0.0226959
0.0227249
0.0231236
0.0238965
0.0250841
0.0266534
0.0284372
0.0304195
0.0327346
0.0356085
0.0391197
0.0431176
0.0475171
0.0520878
0.0567916
0.0615684
0.0663417
0.0711826
0.0763411
0.0807461
0.0836163
0.0863905
0.0900241
0.0936049
0.0988258
0.121927
0.203133
0.493377
1.76399
7.90546
35.626
98.1374
169.242
230.147
279.543
321.788
361.725
399.018
433.894
465.272
492.542
515.432
533.217
545.098
549.73
552.305
549.011
540.314
526.87
509.187
487.442
461.671
432.464
401.232
368.795
335.469
299.513
260.177
215.246
-3.05455
-3.06514
-3.15529
-3.28483
-3.36712
-3.4002
-3.4336
-3.49746
-3.54618
-3.57978
-3.60745
-3.81388
-3.8239
-3.83181
-3.95716
-3.84827
-3.81202
-3.95233
-3.80193
9.67652
104.612
221.317
266.943
337.72
371.089
415.869
454.299
481.966
503.346
528.046
545.898
557.479
563.151
563.023
557.332
546.947
530.631
511.155
486.289
458.772
431.47
390.651
350.297
301.882
205.821
102.039
31.6485
8.2829
1.15266
0.961989
0.808405
0.743745
0.67679
0.592662
0.552105
0.507807
0.4462
0.394894
0.353413
0.312479
0.284434
0.250712
0.216099
0.188381
0.1714
0.150812
0.135415
0.120534
0.1072
0.0951735
0.0844786
0.0750967
0.0671291
0.0602894
0.0540396
0.0480997
0.0426064
0.0378486
0.0342507
0.0310444
0.0287098
0.0271636
0.0260262
0.0256473
0.0254951
0.0257486
0.0260539
0.0263581
0.02688
0.02707
0.0279751
0.0299787
0.0325495
0.0344717
0.0361296
0.0382658
0.040899
0.0444167
0.0455483
0.0454565
0.0481117
0.0524373
0.0630248
0.0995185
0.209416
0.559903
1.8537
7.21045
28.4617
91.7085
177.301
259.855
321.372
368.099
403.194
435.237
464.172
489.356
510.869
527.943
540.316
547.427
548.084
544.988
536.821
523.883
506.472
484.736
458.556
428.282
394.541
356.041
307.505
232.618
140.43
61.8386
21.2117
2.45297
0.184874
0.0756093
0.10267
0.089449
0.0682921
0.0638924
0.0741122
0.0655114
0.0581593
0.0582508
0.0630154
0.0564652
0.0505578
0.045725
0.0417509
0.0397603
0.0424805
0.0424909
0.0371893
0.0329656
0.0297676
0.0272359
0.0252181
0.0237825
0.0230785
0.0230863
0.0222195
0.0218343
0.0216204
0.0216574
0.0220263
0.0227419
0.0238418
0.0252966
0.0269682
0.0288451
0.0310474
0.0337548
0.0370359
0.040767
0.0448676
0.0491432
0.053547
0.0580093
0.0624796
0.0669824
0.071627
0.0755356
0.0781365
0.0803954
0.0825884
0.0831545
0.081486
0.0812221
0.0835099
0.0916516
0.153815
0.430408
1.72869
8.91934
44.9139
135.282
234.625
310.739
364.534
403.512
439.26
471.413
499.326
522.845
541.112
553.205
557.628
560.152
556.612
547.453
533.453
515.155
492.679
465.96
435.545
402.845
367.784
327.794
270.909
186.883
96.8451
-2.88895
-2.90524
-2.98418
-3.09487
-3.17064
-3.20739
-3.24248
-3.30011
-3.34595
-3.38205
-3.41865
-3.58327
-3.60472
-3.61831
-3.71296
-3.63577
-3.62586
-3.69817
-3.60829
-3.61897
-3.43529
1.32711
92.4269
238.663
354.629
414.845
461.154
488.736
508.592
535.589
553.999
565.777
571.534
571.288
565.495
554.807
537.777
517.926
492.51
463.746
435.126
356.566
221.937
92.1795
27.0821
3.43501
1.15629
0.956613
0.935228
0.846237
0.753187
0.696102
0.636169
0.563599
0.519898
0.477744
0.420357
0.37416
0.334398
0.295939
0.268257
0.236339
0.205045
0.179013
0.161948
0.142868
0.128047
0.113991
0.101396
0.0900473
0.0799519
0.0710854
0.0635176
0.0569709
0.0510269
0.0454362
0.0402987
0.0358734
0.0324623
0.0294411
0.0272679
0.0257702
0.0247178
0.0243121
0.024153
0.0243364
0.0245789
0.0248462
0.0253058
0.0255495
0.0264295
0.0282056
0.0304862
0.0322383
0.033813
0.0357905
0.0381595
0.0409797
0.0418741
0.0415667
0.0425174
0.0423958
0.0410119
0.0415845
0.044095
0.0578143
0.114078
0.319974
1.10158
4.49884
19.3842
74.9236
179.086
288.127
372.184
430.182
469.059
495.191
517.286
534.873
547.675
555.149
555.443
552.311
543.797
530.344
512.209
489.314
460.251
420.996
357.869
253.964
140.389
57.7307
15.0949
0.443035
0.152673
0.0824021
0.0752503
0.0462744
0.0842285
0.0795375
0.0638415
0.0619349
0.0677909
0.0616747
0.0557581
0.0555466
0.0582571
0.0531462
0.0478908
0.0434399
0.039881
0.038152
0.0398619
0.039511
0.0351705
0.031342
0.0283047
0.0258996
0.0240088
0.0226421
0.0219019
0.0214569
0.0210101
0.0206589
0.0204772
0.0205218
0.020863
0.0215278
0.0225458
0.0238859
0.0254429
0.0272135
0.0293026
0.0318492
0.0349033
0.0383708
0.042175
0.0461486
0.050251
0.0543959
0.0585631
0.0627361
0.066945
0.0704926
0.0729685
0.0750546
0.0768667
0.0772238
0.0755705
0.0739425
0.0714966
0.0644134
0.0601299
0.0654449
0.116632
0.381447
1.75055
9.70691
49.488
158.539
280.853
375.548
438.18
477.591
506.059
530.237
549.109
561.591
565.781
568.254
564.384
554.656
539.974
520.868
497.208
467.965
429.782
373.014
282.074
180.609
87.692
32.7921
2.89743
-2.72231
-2.74166
-2.81112
-2.90638
-2.97592
-3.01455
-3.05043
-3.10282
-3.14612
-3.18341
-3.22457
-3.35797
-3.38666
-3.40228
-3.47803
-3.42011
-3.40734
-3.4611
-3.39299
-3.3633
-3.2042
-3.04957
-2.78881
-1.67176
55.8687
210.929
386.14
477.259
506.334
542.397
562.527
574.413
580.192
579.745
574.037
563.01
545.469
523.441
473.389
351.615
194.922
64.7614
18.6279
1.47025
1.16324
1.01587
0.95735
0.858471
0.862293
0.787919
0.711057
0.653694
0.596392
0.533483
0.488574
0.448293
0.395245
0.352782
0.315259
0.279221
0.252138
0.222215
0.193698
0.169338
0.152529
0.134782
0.120624
0.107382
0.0955269
0.0848613
0.0753796
0.0670471
0.0599054
0.0536973
0.0480732
0.0428362
0.0380241
0.0339011
0.0306202
0.0278356
0.0257588
0.0243278
0.0233104
0.0228942
0.0227164
0.0228506
0.0230576
0.0232997
0.0237195
0.0239998
0.0248444
0.0263836
0.0283832
0.0300045
0.0314931
0.0333093
0.0354282
0.0377693
0.0386397
0.0385048
0.0392242
0.0387004
0.0368566
0.0354904
0.0329108
0.0300363
0.0278202
0.0295078
0.0525616
0.18162
0.691288
2.77839
11.9098
47.5826
144.873
266.543
375.901
450.633
498.935
530.28
549.076
558.714
558.771
555.541
545.101
526.945
497.367
445.074
351.69
232.588
116.678
45.1759
7.62486
0.222804
0.0479187
0.0854857
0.0589866
0.0546154
0.0607388
0.0454668
0.0750557
0.0720624
0.0608108
0.0592419
0.0625529
0.0579099
0.053103
0.0525815
0.0539272
0.0498133
0.0451931
0.0411536
0.0379289
0.0363368
0.037282
0.036651
0.0330317
0.0295879
0.0267545
0.0244973
0.0227262
0.0214339
0.0206873
0.0202033
0.0197704
0.0194567
0.0192978
0.0193501
0.0196678
0.0202833
0.021221
0.0224521
0.023899
0.025562
0.0275273
0.0299077
0.03274
0.0359498
0.0394678
0.0431478
0.0469541
0.050797
0.0546663
0.0585189
0.0623326
0.0655575
0.0678912
0.0698139
0.0713024
0.0714495
0.0698946
0.0681466
0.065407
0.0588599
0.0510678
0.0423968
0.0350908
0.0348506
0.0647817
0.322364
1.74394
9.29222
43.6538
151.832
289.707
405.859
477.768
524.156
552.698
567.527
570.008
574.046
569.628
558.126
539.656
511.686
464.113
374.66
253.998
135.126
58.9156
17.0732
0.77574
0.265242
0.147086
-2.55445
-2.57512
-2.63644
-2.71892
-2.78256
-2.82174
-2.85767
-2.90551
-2.94653
-2.98397
-3.02708
-3.13637
-3.16792
-3.18713
-3.24693
-3.20447
-3.19347
-3.22814
-3.16662
-3.13404
-2.99372
-2.79968
-2.63971
-2.53281
-2.37146
-2.36959
5.38855
97.2456
251.14
385.614
493.988
564.61
587.534
582.583
538.263
463.504
353.229
227.42
90.8946
35.5667
7.24544
1.16356
1.01723
1.04095
0.974724
0.922964
0.884626
0.807869
0.80107
0.733445
0.667837
0.611995
0.557537
0.501974
0.457541
0.418913
0.370483
0.331213
0.295894
0.262274
0.236068
0.208159
0.182076
0.159415
0.143102
0.126605
0.113175
0.100746
0.0896267
0.0796346
0.0707532
0.0629431
0.0562257
0.0503655
0.0450764
0.0401834
0.0357074
0.0318682
0.0287618
0.0261981
0.0242491
0.022891
0.021925
0.0214898
0.0212892
0.0213871
0.02155
0.0217648
0.0221379
0.0224338
0.0232655
0.0246263
0.0263
0.0278118
0.0292084
0.0308609
0.0327229
0.03466
0.0354599
0.0354146
0.0357967
0.0351796
0.0335358
0.0320471
0.0295759
0.0260989
0.0211146
0.0135969
0.00314834
-0.000680529
0.0117198
0.0789859
0.372145
1.51734
6.05959
22.7248
71.4192
167.551
268.968
351.686
408.395
438.371
444.622
428.875
387.361
322.984
238.389
145.706
73.4062
23.9765
1.30891
0.145829
0.0456761
0.0092504
-0.0150472
0.0513498
0.0460611
0.0499151
0.0539899
0.0455544
0.0671955
0.0658943
0.0576408
0.0561344
0.0578168
0.0541412
0.0502333
0.04953
0.0499431
0.0464743
0.0423863
0.0387245
0.0358243
0.0343421
0.0347296
0.0339246
0.0308668
0.0277843
0.0251646
0.0230604
0.0214073
0.0201901
0.0194501
0.0189568
0.0185423
0.0182539
0.0181127
0.0181665
0.0184589
0.0190245
0.0198832
0.0210103
0.0223486
0.0239003
0.0257355
0.0279453
0.0305581
0.0335181
0.0367559
0.0401481
0.0436602
0.0472065
0.0507785
0.0543141
0.0577603
0.0606835
0.0628577
0.0646097
0.0658339
0.0658716
0.0644868
0.0626912
0.0597819
0.0536517
0.0460872
0.0378415
0.0290933
0.0192926
0.00184957
-0.00711856
0.0331129
0.302647
1.44812
6.66968
28.8123
99.6146
220.781
335.79
423.801
477.777
502.081
504.533
483.257
435.66
365.297
274.854
171.842
86.4757
30.8031
3.06631
0.299362
0.140832
0.124068
0.116131
0.128959
-2.38533
-2.40615
-2.4604
-2.53218
-2.59023
-2.62899
-2.66434
-2.70817
-2.74697
-2.78381
-2.82703
-2.91749
-2.94895
-2.97111
-3.01885
-2.98793
-2.97592
-2.99969
-2.9458
-2.90836
-2.77787
-2.6146
-2.46296
-2.35205
-2.23959
-2.22758
-1.90973
-1.42024
-1.21135
-1.03062
-0.496052
6.33826
23.1596
29.1295
29.0076
29.7655
19.7704
5.77848
1.01017
0.947606
0.863711
0.887092
0.876063
0.942734
0.898303
0.858977
0.819691
0.756464
0.741973
0.681007
0.623638
0.570339
0.519075
0.469531
0.42663
0.389774
0.345697
0.30933
0.276357
0.245155
0.220065
0.194164
0.170267
0.149281
0.133643
0.118334
0.105682
0.0940689
0.0836903
0.074375
0.066098
0.0588152
0.0525281
0.0470293
0.0420757
0.0375237
0.0333693
0.029805
0.0268876
0.0245085
0.0226861
0.0214153
0.0204981
0.0200667
0.0198586
0.0199108
0.0200416
0.0202275
0.0205556
0.0208553
0.0216421
0.022896
0.0242634
0.0255995
0.0268616
0.0283509
0.0299737
0.0315705
0.032268
0.0323395
0.0325061
0.0318653
0.0303078
0.0287246
0.0262505
0.0227308
0.017738
0.010566
0.000660074
-0.00806821
-0.0169726
-0.0285801
-0.0351375
-0.0149182
0.110813
0.59213
2.20082
6.96414
18.4277
39.7054
68.6542
92.9978
99.423
91.0897
69.5791
42.3734
16.8776
1.85596
0.302457
0.18529
0.00323048
-0.0560744
-0.0425384
-0.0123658
-0.0144303
0.0399514
0.0408324
0.0462352
0.0489005
0.0448051
0.0605476
0.0602482
0.0541495
0.0527254
0.0534347
0.0504214
0.0471535
0.0462793
0.0461058
0.0431505
0.039541
0.0362408
0.0336297
0.0322353
0.0322299
0.0313208
0.0287035
0.0259517
0.0235463
0.0215971
0.0200604
0.0189183
0.0181957
0.017704
0.0173098
0.0170426
0.0169171
0.0169705
0.0172387
0.0177555
0.0185371
0.0195646
0.0207953
0.0222295
0.0239294
0.0259668
0.0283632
0.03108
0.0340463
0.037158
0.0403829
0.0436325
0.0469077
0.0501287
0.0532375
0.0558757
0.05787
0.0594383
0.0604412
0.0603917
0.0591256
0.0572988
0.0543071
0.0487331
0.0417552
0.0339213
0.0253806
0.0154008
-0.000513267
-0.0163314
-0.0337835
-0.0412143
-0.00295935
0.19264
0.986781
3.88855
13.1492
35.1126
72.2217
112.329
138.258
141.038
125.382
95.7497
59.7759
26.5478
4.64496
0.396445
0.184706
0.0776872
0.0841212
0.0695154
0.087412
0.0942974
0.108481
-2.21494
-2.23517
-2.28321
-2.3459
-2.3987
-2.4363
-2.47058
-2.51079
-2.54735
-2.58302
-2.62509
-2.70074
-2.73188
-2.75489
-2.79337
-2.77116
-2.76005
-2.77425
-2.72714
-2.68714
-2.56976
-2.42434
-2.28517
-2.18398
-2.06344
-2.0354
-1.72523
-1.32348
-1.12651
-0.96198
-0.801204
-0.632012
-0.410204
-0.170063
0.124472
0.364988
0.456195
0.614006
0.750304
0.780914
0.778443
0.813256
0.810644
0.863598
0.826873
0.796305
0.757159
0.703849
0.684398
0.629575
0.578826
0.528832
0.480955
0.436425
0.395816
0.360889
0.320888
0.287268
0.256681
0.227866
0.204092
0.18018
0.158306
0.138967
0.124148
0.109987
0.0981506
0.0873555
0.0777168
0.0690752
0.061399
0.0546416
0.048793
0.0436655
0.0390558
0.0348441
0.0310083
0.0277183
0.0249975
0.0228067
0.0211074
0.0199212
0.0190539
0.0186275
0.0184155
0.0184325
0.0185362
0.0186909
0.0189747
0.0192665
0.0199809
0.0211118
0.02229
0.0234596
0.0245751
0.0258861
0.0272891
0.0285925
0.0291708
0.0292289
0.0292269
0.0285284
0.0270194
0.0254605
0.02303
0.0196164
0.0148102
0.00813158
-0.000808511
-0.00933335
-0.018421
-0.0308681
-0.0451286
-0.0606205
-0.0764154
-0.0920469
-0.10768
-0.123813
-0.136133
-0.146093
-0.154271
-0.157953
-0.152529
-0.0367747
0.0846078
0.110374
0.0126914
-0.0695131
-0.0906896
-0.0783857
-0.0574714
-0.0621457
-0.04197
-0.015569
-0.00987888
0.0320528
0.0367733
0.0425923
0.0446561
0.0430518
0.0546123
0.0549801
0.0505088
0.0491279
0.0491696
0.0466791
0.0439479
0.0429616
0.0424174
0.0398598
0.0366783
0.0337189
0.0313703
0.0300528
0.0297771
0.0288135
0.0265493
0.0240984
0.0219046
0.0201087
0.0186882
0.0176227
0.0169261
0.0164466
0.0160728
0.0158267
0.0157133
0.0157627
0.0160038
0.0164718
0.0171791
0.0181088
0.019233
0.0205478
0.0221098
0.0239745
0.0261585
0.0286351
0.0313344
0.034168
0.0371095
0.0400674
0.0430521
0.0459682
0.0487585
0.0511221
0.0529298
0.0543171
0.0551229
0.0549854
0.0537842
0.0519945
0.0490661
0.0439468
0.0375042
0.0302054
0.0220361
0.0124596
-0.00183344
-0.0173487
-0.0344619
-0.052364
-0.06829
-0.0886861
-0.107164
-0.127309
-0.144272
-0.153121
-0.158678
-0.161605
-0.159513
-0.150588
-0.0224762
0.114454
0.222851
0.0960412
-0.0224976
-0.02197
-0.0194479
0.029279
0.0704933
0.0708437
0.0804378
0.0858623
0.0932173
-2.04333
-2.06251
-2.10504
-2.15992
-2.20777
-2.24368
-2.27647
-2.31335
-2.34762
-2.3817
-2.42176
-2.4856
-2.51629
-2.53866
-2.57007
-2.55438
-2.54507
-2.55156
-2.51087
-2.46902
-2.36374
-2.23543
-2.1093
-2.01095
-1.89834
-1.84911
-1.5778
-1.23539
-1.04501
-0.891161
-0.743857
-0.577897
-0.378952
-0.157194
0.108937
0.310469
0.406028
0.552486
0.680133
0.711513
0.71583
0.745893
0.748442
0.789036
0.758012
0.73326
0.695688
0.650288
0.627966
0.578902
0.53368
0.487377
0.443079
0.402897
0.364997
0.332187
0.296016
0.265073
0.236889
0.21043
0.188136
0.166186
0.146222
0.128497
0.114606
0.101569
0.0905793
0.0806079
0.0717126
0.0637456
0.0566705
0.0504398
0.0450317
0.0402841
0.0360221
0.0321446
0.028624
0.0256024
0.0230875
0.0210715
0.0195051
0.018403
0.0175906
0.0171738
0.0169503
0.0169475
0.0170125
0.0171358
0.0173764
0.0176505
0.0182864
0.0192635
0.0203114
0.0213391
0.0223237
0.023465
0.024671
0.0257263
0.0261796
0.0262037
0.0260462
0.0252461
0.0237727
0.0222173
0.0198372
0.0164934
0.0119076
0.00574292
-0.00229241
-0.0101899
-0.0188015
-0.0301106
-0.0430532
-0.0571024
-0.0715445
-0.085939
-0.1005
-0.115378
-0.127867
-0.138365
-0.146116
-0.1483
-0.144795
-0.13972
-0.135101
-0.130176
-0.126042
-0.111601
-0.0990579
-0.0799253
-0.0568979
-0.056268
-0.037432
-0.016034
-0.00631955
0.026221
0.0329768
0.0386663
0.0406644
0.0406659
0.049305
0.0499347
0.046671
0.0453824
0.0450408
0.0429463
0.0406461
0.0396057
0.0388396
0.036601
0.0338019
0.0311598
0.0290511
0.0278077
0.0273533
0.0263747
0.0244023
0.0222262
0.0202393
0.0185962
0.017291
0.0163038
0.0156409
0.0151799
0.0148295
0.0146045
0.014501
0.0145441
0.0147569
0.0151752
0.01581
0.016644
0.0176602
0.0188531
0.0202756
0.0219702
0.0239441
0.0261818
0.028618
0.0311746
0.0338344
0.0365018
0.0391935
0.0418109
0.044294
0.0463973
0.0480188
0.0492381
0.049876
0.0496751
0.0485482
0.0468224
0.0439637
0.0392111
0.0332671
0.0265242
0.0188132
0.00963207
-0.00318295
-0.017514
-0.0330961
-0.0497487
-0.0649695
-0.0825985
-0.099286
-0.118637
-0.135539
-0.145018
-0.150769
-0.152006
-0.148922
-0.141856
-0.133331
-0.125683
-0.115932
-0.106596
-0.089116
-0.0540733
-0.0375823
0.00681753
0.131534
0.151554
0.0824095
0.0803644
0.0895324
-1.87057
-1.88842
-1.92602
-1.97411
-2.01729
-2.05111
-2.08211
-2.11585
-2.14775
-2.17991
-2.21741
-2.27168
-2.30111
-2.32254
-2.34866
-2.33768
-2.32986
-2.33098
-2.29526
-2.25359
-2.15957
-2.04619
-1.93194
-1.84048
-1.73374
-1.67276
-1.43423
-1.14113
-0.960472
-0.813212
-0.674396
-0.520336
-0.341704
-0.139272
0.093706
0.27268
0.37079
0.500505
0.612452
0.64583
0.654384
0.680708
0.685492
0.716487
0.690678
0.669989
0.635013
0.596064
0.572482
0.528736
0.488309
0.445949
0.405363
0.369091
0.334161
0.303646
0.271082
0.242779
0.217001
0.192868
0.172186
0.15217
0.134038
0.117897
0.105016
0.0930885
0.08297
0.0738261
0.0656757
0.0583831
0.0519084
0.0462046
0.0412439
0.0368827
0.032973
0.0294294
0.0262196
0.0234667
0.0211605
0.0193187
0.0178832
0.0168659
0.0161104
0.0157116
0.0154774
0.0154496
0.0154872
0.0156025
0.0157937
0.0160333
0.0165822
0.0174147
0.0183245
0.019209
0.0200626
0.0210267
0.0220301
0.0228386
0.0231523
0.023217
0.0229534
0.0220801
0.0206827
0.0190854
0.0167551
0.0135339
0.00918704
0.0034755
-0.00381033
-0.011105
-0.0191615
-0.0293869
-0.0409475
-0.0535838
-0.0666218
-0.079704
-0.0928924
-0.10618
-0.117588
-0.127248
-0.13432
-0.136749
-0.132581
-0.129747
-0.126477
-0.121875
-0.116247
-0.10244
-0.0900184
-0.0729305
-0.0535418
-0.0499944
-0.0331433
-0.015569
-0.00398802
0.0214891
0.0292601
0.0348254
0.0369485
0.0378045
0.0442968
0.0450952
0.0427328
0.0415622
0.0410039
0.0392221
0.0372714
0.0362241
0.035341
0.0333692
0.0309115
0.0285647
0.0266781
0.0255124
0.0249492
0.0239874
0.0222635
0.0203393
0.0185529
0.0170616
0.0158704
0.014964
0.0143415
0.013905
0.0135827
0.0133728
0.0132782
0.0133125
0.0134965
0.0138647
0.0144265
0.0151659
0.0160731
0.0171427
0.0184225
0.0199457
0.0217105
0.0237135
0.0258906
0.0281755
0.0305554
0.0329365
0.0353377
0.0376604
0.0398483
0.0417019
0.0431363
0.0441798
0.0446635
0.0444188
0.0433586
0.041673
0.0389176
0.0345951
0.0291171
0.0228109
0.0156496
0.00711235
-0.00450319
-0.0177632
-0.0315954
-0.0464823
-0.060728
-0.0765214
-0.0918814
-0.108971
-0.123906
-0.133021
-0.138559
-0.140682
-0.136049
-0.132906
-0.127447
-0.120607
-0.11049
-0.0975988
-0.0775538
-0.0506442
-0.0428096
0.0490953
0.311235
0.324538
0.12031
0.0865611
0.0852672
-1.69675
-1.71311
-1.74629
-1.78839
-1.82713
-1.85858
-1.88753
-1.91827
-1.94773
-1.97771
-2.01231
-2.05868
-2.08632
-2.10654
-2.12864
-2.12109
-2.11445
-2.11212
-2.08048
-2.04037
-1.9569
-1.85708
-1.75465
-1.66945
-1.57039
-1.50266
-1.29353
-1.04285
-0.875089
-0.738582
-0.610337
-0.465841
-0.305325
-0.12182
0.0813252
0.240113
0.336238
0.451826
0.548922
0.582008
0.593531
0.616186
0.62214
0.645683
0.624417
0.606787
0.574941
0.541363
0.517728
0.47894
0.442846
0.404528
0.367722
0.335079
0.303275
0.275215
0.246072
0.220394
0.197021
0.175188
0.156221
0.138117
0.121761
0.107179
0.0953722
0.0845492
0.0753227
0.0670124
0.0596107
0.0529937
0.0471202
0.0419443
0.037434
0.0334655
0.02991
0.0267011
0.0237986
0.0213076
0.0192164
0.0175456
0.0162413
0.0153124
0.0146162
0.0142373
0.014
0.0139411
0.0139615
0.0140754
0.0141831
0.0143821
0.0148541
0.0155571
0.0163272
0.0170817
0.0178144
0.0186063
0.0194061
0.0199952
0.0201735
0.0201727
0.0197997
0.0188784
0.0176308
0.0160357
0.0137843
0.0106986
0.00660479
0.00132787
-0.00521273
-0.0118656
-0.0193213
-0.0285355
-0.0388497
-0.050083
-0.0616615
-0.0732694
-0.0849712
-0.0965985
-0.106667
-0.115121
-0.121177
-0.123226
-0.120009
-0.117415
-0.114268
-0.109879
-0.104095
-0.0921129
-0.0806973
-0.0658091
-0.0494835
-0.0442444
-0.0291546
-0.0147876
-0.00267103
0.0177837
0.0258715
0.0311399
0.0332812
0.0346165
0.0395769
0.0404363
0.0387345
0.0376929
0.0370292
0.0355031
0.0338408
0.0328235
0.0318973
0.0301592
0.02801
0.0259397
0.0242624
0.0231813
0.0225633
0.0216418
0.0201344
0.0184412
0.0168482
0.0155067
0.0144287
0.013604
0.0130273
0.01262
0.0123242
0.0121284
0.0120391
0.0120632
0.0122185
0.0125363
0.0130251
0.0136701
0.0144676
0.0154132
0.0165482
0.0178968
0.0194542
0.0212251
0.0231451
0.0251618
0.0272631
0.0293622
0.0314765
0.0335113
0.0354139
0.037023
0.038263
0.039129
0.039475
0.0391901
0.0381791
0.0365299
0.0338905
0.029951
0.0249913
0.0192267
0.012619
0.00472134
-0.00563978
-0.0176972
-0.030213
-0.0434762
-0.0564246
-0.0703924
-0.0842937
-0.0992865
-0.112263
-0.120537
-0.125492
-0.127147
-0.123363
-0.120166
-0.114931
-0.107911
-0.0975253
-0.083449
-0.0631754
-0.0449485
-0.0191269
0.229608
0.306243
0.293791
0.104082
0.0784552
0.0692556
-1.52194
-1.53678
-1.56592
-1.60268
-1.63722
-1.66609
-1.69278
-1.72061
-1.74757
-1.77516
-1.80667
-1.84637
-1.8719
-1.89069
-1.90874
-1.90435
-1.89902
-1.89467
-1.86669
-1.82907
-1.75562
-1.66815
-1.57701
-1.49884
-1.40812
-1.33828
-1.15626
-0.94188
-0.788415
-0.66311
-0.545441
-0.413425
-0.27031
-0.106909
0.0700125
0.210047
0.300929
0.403337
0.48722
0.519144
0.533178
0.552469
0.558586
0.576377
0.559008
0.54381
0.515362
0.486388
0.463593
0.429461
0.39741
0.363144
0.330144
0.300963
0.272365
0.246891
0.221016
0.197959
0.176985
0.157428
0.140255
0.12404
0.109421
0.0963749
0.0856882
0.0759654
0.0676454
0.0601718
0.0535196
0.0475776
0.0423042
0.0376566
0.0336002
0.0300289
0.0268328
0.0239549
0.0213589
0.0191254
0.0172537
0.0157553
0.0145857
0.0137434
0.0131085
0.0127494
0.0125234
0.0124366
0.0124264
0.0124824
0.0125182
0.0127081
0.0131073
0.013694
0.0143312
0.0149482
0.0155419
0.0161821
0.0168023
0.0172281
0.017298
0.0171632
0.016671
0.0157155
0.0145379
0.0129567
0.0107762
0.00781041
0.0040559
-0.000746556
-0.00657342
-0.0126261
-0.0194324
-0.0275706
-0.0366829
-0.0465675
-0.056723
-0.066838
-0.0769835
-0.0869346
-0.0955903
-0.102781
-0.107808
-0.109455
-0.107058
-0.104705
-0.101781
-0.0977667
-0.0922684
-0.0820294
-0.0716931
-0.058731
-0.0449068
-0.0387763
-0.025687
-0.0135766
-0.00182918
0.0148576
0.0226362
0.0274946
0.0296613
0.0312198
0.0350615
0.0359082
0.0346903
0.0337822
0.0330897
0.0317821
0.0303655
0.0294068
0.0284915
0.026966
0.0250988
0.0232879
0.0218081
0.0208181
0.0201859
0.0193235
0.01801
0.0165316
0.0151259
0.0139315
0.0129672
0.012226
0.0116998
0.0113249
0.0110533
0.0108726
0.0107884
0.0108023
0.010929
0.0111966
0.0116125
0.0121648
0.0128517
0.013673
0.0146604
0.0158343
0.0171869
0.0187278
0.0203924
0.0221446
0.0239665
0.0257885
0.0276151
0.0293687
0.030992
0.0323626
0.0334027
0.0341001
0.0343259
0.0339966
0.0330224
0.0314365
0.0289726
0.0253853
0.0209
0.0156546
0.00958347
0.0023041
-0.00687795
-0.0176287
-0.0287523
-0.040498
-0.0520271
-0.0642262
-0.0764124
-0.0892678
-0.100327
-0.107551
-0.111785
-0.113018
-0.110005
-0.106854
-0.101826
-0.0947874
-0.0842913
-0.0694084
-0.0501544
-0.0386398
0.0289063
0.282218
0.306404
0.168215
0.0660373
0.0580636
0.0526034
-1.34624
-1.35956
-1.38502
-1.41695
-1.44748
-1.47363
-1.49791
-1.52288
-1.54726
-1.57232
-1.60062
-1.6346
-1.65779
-1.67506
-1.68886
-1.6875
-1.68372
-1.67842
-1.65394
-1.6194
-1.55545
-1.47949
-1.39932
-1.32861
-1.24679
-1.17833
-1.02111
-0.838752
-0.7009
-0.587971
-0.481646
-0.36278
-0.236478
-0.0925325
0.0597696
0.182194
0.265671
0.355183
0.427259
0.457487
0.472397
0.48938
0.494877
0.508267
0.494215
0.481069
0.45611
0.431201
0.409907
0.380168
0.35197
0.321732
0.292542
0.266728
0.241373
0.218596
0.19587
0.175434
0.156857
0.13956
0.124242
0.109902
0.0969944
0.0854694
0.0759417
0.0673223
0.0599254
0.0532961
0.0473995
0.0421363
0.0374662
0.0333497
0.0297524
0.0265824
0.0237473
0.0212003
0.0189061
0.0169334
0.0152739
0.0139514
0.0129151
0.0121641
0.0115926
0.0112624
0.0110439
0.0109388
0.0108989
0.0108471
0.0108761
0.0110307
0.0113544
0.0118256
0.0123296
0.0128118
0.0132612
0.0137379
0.0141817
0.0144538
0.0144276
0.0141978
0.0136087
0.0126418
0.0114516
0.00989391
0.00780273
0.00500123
0.00154242
-0.00284836
-0.00802533
-0.0134243
-0.019514
-0.0266239
-0.0345846
-0.0430969
-0.0517793
-0.060431
-0.0690378
-0.0773637
-0.0846058
-0.090548
-0.0946008
-0.0958676
-0.0940172
-0.0919453
-0.0893164
-0.0857185
-0.0806563
-0.0719743
-0.0628195
-0.0516242
-0.040036
-0.0337028
-0.0224519
-0.0120621
-0.00129002
0.0123302
0.0195357
0.023968
0.0260896
0.0276968
0.0307019
0.0314935
0.0306297
0.029853
0.029181
0.0280652
0.026863
0.0259817
0.0251134
0.0237849
0.0221774
0.0206107
0.0193197
0.018427
0.0178125
0.0170247
0.01589
0.0146125
0.0133869
0.0123381
0.0114881
0.0108327
0.0103607
0.0100221
0.00977622
0.00961217
0.00953248
0.00953578
0.00963418
0.00985263
0.0101965
0.0106585
0.011236
0.0119323
0.0127706
0.0137708
0.0149203
0.0162358
0.0176471
0.0191416
0.020684
0.0222341
0.0237752
0.0252536
0.026605
0.0277408
0.0285844
0.0291183
0.029235
0.0288613
0.0279232
0.0264132
0.0241327
0.0209013
0.0168791
0.0121464
0.00664607
4.37819e-05
-0.00812935
-0.0176947
-0.0273728
-0.0375751
-0.0475931
-0.0580985
-0.0685977
-0.0793876
-0.0885825
-0.0946659
-0.0981258
-0.0989569
-0.096458
-0.0934154
-0.0886227
-0.081724
-0.0713815
-0.0563168
-0.0389361
0.0156781
0.273403
0.281367
0.312511
0.0705611
0.0476418
0.0443089
0.0442678
-1.16976
-1.18158
-1.20365
-1.23116
-1.25785
-1.28118
-1.30293
-1.32507
-1.34683
-1.36923
-1.39427
-1.42322
-1.44397
-1.45977
-1.47081
-1.47099
-1.46864
-1.46317
-1.44212
-1.41111
-1.35626
-1.29113
-1.22166
-1.15886
-1.08641
-1.02202
-0.887855
-0.734077
-0.612592
-0.51265
-0.41832
-0.313426
-0.20364
-0.0790688
0.0504439
0.155956
0.230597
0.307755
0.369096
0.396855
0.411461
0.425424
0.431156
0.441252
0.43002
0.418719
0.39723
0.376009
0.356705
0.331139
0.306669
0.280416
0.255019
0.232518
0.210415
0.190414
0.170741
0.152925
0.136735
0.121678
0.108257
0.0957747
0.0845543
0.0745328
0.0661871
0.0586684
0.0522012
0.0464151
0.0412709
0.036682
0.0326105
0.0290213
0.025882
0.0231148
0.0206411
0.0184264
0.0164324
0.0147265
0.01328
0.0121278
0.0112309
0.0105735
0.010064
0.00976284
0.00954252
0.00941787
0.00935412
0.00922963
0.00926655
0.00936861
0.00961043
0.00995635
0.0103298
0.0106808
0.0109917
0.011308
0.0115757
0.0116947
0.0115584
0.0112183
0.0105496
0.00956543
0.00836407
0.0068343
0.00484422
0.00230462
-0.00087586
-0.00487183
-0.0094257
-0.0141742
-0.0195374
-0.0256649
-0.0324572
-0.039615
-0.0469002
-0.0541043
-0.0611838
-0.0679315
-0.0737784
-0.0785011
-0.0816352
-0.0825294
-0.0810422
-0.0792439
-0.0769414
-0.0738008
-0.0692913
-0.0619579
-0.054063
-0.044626
-0.0349644
-0.0288587
-0.0193414
-0.0104655
-0.000960542
0.0101596
0.0166038
0.0205558
0.0225532
0.0240914
0.0264508
0.0271612
0.0265526
0.0259014
0.025281
0.0243393
0.0233279
0.0225392
0.0217473
0.0206065
0.0192431
0.0179084
0.0168003
0.0160126
0.0154412
0.01474
0.0137727
0.0126842
0.0116336
0.0107299
0.00999347
0.00942506
0.00901098
0.0087118
0.00850026
0.00835136
0.00827247
0.0082631
0.00833053
0.00849899
0.00877039
0.00914155
0.00960857
0.0101777
0.0108663
0.011692
0.0126382
0.0137278
0.0148879
0.0161241
0.0173906
0.0186694
0.0199284
0.0211371
0.0222262
0.0231321
0.0237844
0.0241586
0.0241687
0.0237544
0.0228532
0.0214321
0.0193444
0.016464
0.0128995
0.00869653
0.00379225
-0.0020897
-0.00923132
-0.0175738
-0.0259787
-0.0346479
-0.0432217
-0.0520458
-0.0608086
-0.0696121
-0.0770394
-0.0819514
-0.0846311
-0.0850965
-0.0829796
-0.0801081
-0.0756733
-0.0691735
-0.0594391
-0.0449849
-0.0288298
0.0961598
0.324115
0.28691
0.158846
0.0125944
0.038889
0.0376755
0.0377759
-0.992569
-1.00296
-1.02189
-1.04532
-1.0683
-1.08873
-1.10787
-1.12719
-1.14627
-1.16594
-1.18771
-1.21215
-1.23037
-1.24482
-1.25452
-1.25529
-1.25384
-1.24872
-1.2311
-1.20398
-1.1579
-1.1031
-1.0441
-0.989597
-0.926893
-0.868673
-0.756083
-0.628278
-0.523714
-0.437333
-0.355558
-0.265169
-0.171681
-0.0662287
0.0417979
0.130884
0.195678
0.260847
0.312195
0.33685
0.350306
0.360148
0.367301
0.374924
0.366086
0.356513
0.338414
0.320616
0.303659
0.282087
0.261267
0.238952
0.217331
0.198123
0.179278
0.162124
0.145441
0.130251
0.116453
0.103633
0.0921495
0.0815236
0.0719834
0.0634623
0.0563269
0.0499191
0.0443989
0.0394684
0.0350881
0.0311843
0.0277219
0.0246702
0.0219996
0.0196443
0.0175389
0.0156581
0.0139645
0.0125201
0.0112833
0.0103164
0.00954289
0.00897531
0.00852344
0.00824565
0.00802735
0.00788485
0.00780003
0.00767071
0.00767424
0.00773946
0.0078997
0.00811387
0.00835677
0.00857076
0.0087294
0.00887778
0.00897271
0.00894842
0.00870049
0.00825037
0.00750814
0.00649064
0.00527298
0.00377292
0.00188981
-0.00038858
-0.00324653
-0.00682154
-0.010782
-0.0148701
-0.0194555
-0.0245909
-0.0302332
-0.0361058
-0.0420127
-0.0477824
-0.0533718
-0.0586146
-0.0631024
-0.0666513
-0.0689182
-0.0694518
-0.068237
-0.0666967
-0.0647261
-0.0620429
-0.0581757
-0.0521415
-0.0454945
-0.0376718
-0.029727
-0.0241822
-0.0163169
-0.0088362
-0.000737626
0.00824576
0.0138046
0.0172276
0.0190338
0.0204264
0.0222731
0.0228897
0.0224671
0.0219362
0.0213904
0.0206112
0.0197759
0.0190934
0.0183979
0.0174398
0.0163057
0.0151925
0.0142618
0.0135858
0.013075
0.0124681
0.0116592
0.0107512
0.00987055
0.00910871
0.00848588
0.00800487
0.0076505
0.00739282
0.00721013
0.00707455
0.0069957
0.00697187
0.00700761
0.00712395
0.00732174
0.00759955
0.00795556
0.00839519
0.00893282
0.00958039
0.0103225
0.0111813
0.0120933
0.0130648
0.0140591
0.0150601
0.01604
0.0169768
0.0178075
0.0184873
0.0189501
0.0191734
0.0190861
0.0186397
0.0177777
0.0164651
0.0145967
0.0120703
0.00896074
0.00528723
0.000989118
-0.00415828
-0.0103284
-0.0173743
-0.0244656
-0.0317045
-0.038805
-0.0459842
-0.0530393
-0.0599505
-0.065692
-0.0694277
-0.0713356
-0.0714679
-0.0696681
-0.0670999
-0.0631586
-0.0572807
-0.0485008
-0.0355603
-0.0209945
0.0303938
0.209167
0.246777
-0.0230604
-0.00721971
0.0310773
0.0313995
0.0316927
-0.814762
-0.823804
-0.839792
-0.859406
-0.8788
-0.896285
-0.912732
-0.929245
-0.945611
-0.962481
-0.980992
-1.0013
-1.01696
-1.0303
-1.03886
-1.0408
-1.03953
-1.03516
-1.021
-0.997752
-0.960163
-0.915298
-0.866595
-0.820735
-0.768107
-0.717648
-0.625479
-0.521663
-0.434373
-0.361986
-0.293265
-0.217765
-0.140419
-0.0537436
0.0338957
0.106956
0.161233
0.214693
0.256655
0.277799
0.289681
0.296164
0.303913
0.309596
0.302815
0.294936
0.280112
0.265558
0.2512
0.233475
0.216254
0.197815
0.179931
0.163999
0.148387
0.134112
0.120353
0.107778
0.0963546
0.0857465
0.0762069
0.067415
0.0595304
0.0524887
0.0465655
0.0412584
0.0366795
0.0325942
0.0289656
0.0257321
0.0228621
0.0203316
0.0181165
0.0161609
0.0144133
0.0128581
0.0114628
0.0102779
0.00926732
0.00843375
0.00781358
0.00735111
0.00697256
0.00672985
0.00652355
0.00637052
0.00627221
0.00613536
0.00608277
0.0060758
0.0061398
0.00623038
0.00634269
0.00640802
0.00641083
0.00639785
0.00635187
0.00620035
0.00584706
0.00529861
0.00449207
0.00344986
0.00222161
0.000750622
-0.00103473
-0.00312344
-0.00561253
-0.00870111
-0.0121324
-0.015589
-0.019373
-0.0235171
-0.028006
-0.0326009
-0.0371277
-0.0414733
-0.0456006
-0.0493831
-0.0525436
-0.0549608
-0.0564055
-0.0565893
-0.0555673
-0.0542951
-0.0526728
-0.0504634
-0.0472721
-0.0424427
-0.0370344
-0.0307473
-0.0243881
-0.0196346
-0.013325
-0.00720341
-0.000567879
0.00652732
0.0111327
0.0139888
0.0155454
0.0167415
0.0181659
0.0186801
0.0183943
0.0179729
0.0175163
0.016887
0.0162174
0.0156482
0.0150603
0.0142808
0.0133632
0.0124623
0.0117049
0.0111456
0.010709
0.0102027
0.00954632
0.00881134
0.00809567
0.00747418
0.00696389
0.00656993
0.006276
0.0060598
0.00589281
0.0057777
0.00570222
0.0056648
0.00567014
0.00573528
0.00586074
0.00604611
0.00629158
0.00660229
0.00698907
0.00745841
0.00799875
0.00862714
0.00929403
0.010002
0.010725
0.0114474
0.0121498
0.012813
0.0133863
0.013837
0.0141094
0.0141847
0.0140086
0.0135349
0.0127137
0.0115127
0.0098636
0.00768888
0.00503383
0.00189705
-0.00178634
-0.00618829
-0.0113734
-0.0172011
-0.0229739
-0.0287604
-0.0343653
-0.0399237
-0.0452902
-0.050402
-0.0545329
-0.0571037
-0.0582585
-0.0580894
-0.0565705
-0.0543562
-0.0509478
-0.0458375
-0.0382787
-0.0275908
-0.015777
-0.0211089
-0.0322941
-0.0213406
-0.0866271
-0.00920497
0.0243677
0.0254918
0.0259381
-0.636418
-0.644211
-0.657429
-0.673427
-0.689328
-0.703837
-0.717544
-0.731249
-0.744866
-0.758893
-0.774156
-0.790609
-0.803686
-0.815525
-0.823613
-0.825833
-0.824874
-0.821594
-0.810803
-0.792615
-0.763292
-0.728092
-0.68951
-0.65257
-0.610202
-0.56865
-0.495954
-0.414577
-0.344692
-0.286594
-0.231296
-0.170945
-0.10976
-0.0419407
0.0260592
0.0832129
0.126399
0.168386
0.201228
0.2184
0.228401
0.232912
0.239742
0.243827
0.238819
0.232608
0.221027
0.209616
0.198058
0.184128
0.170517
0.155966
0.141835
0.129213
0.116868
0.105544
0.0947079
0.0847791
0.0757665
0.0674023
0.0598602
0.0529326
0.0467274
0.0411875
0.0365146
0.0323357
0.0287286
0.025515
0.0226635
0.0201256
0.0178766
0.015899
0.0141689
0.0126416
0.0112779
0.0100703
0.00898485
0.00805786
0.00725625
0.00667
0.00615776
0.00577809
0.00546373
0.00523405
0.00503222
0.00486518
0.00472906
0.00454841
0.00442737
0.00436116
0.00432338
0.00429885
0.00428356
0.00422834
0.00412238
0.00398168
0.00380695
0.00352058
0.00305923
0.00241461
0.00154834
0.000478306
-0.000769102
-0.00222423
-0.00393001
-0.00585969
-0.00804727
-0.0106288
-0.0134872
-0.0163479
-0.0193342
-0.0224963
-0.0258355
-0.029164
-0.0323204
-0.0352462
-0.0379186
-0.0402651
-0.0421156
-0.043425
-0.0440708
-0.0439033
-0.0430127
-0.0420115
-0.0407442
-0.039018
-0.0365264
-0.0328379
-0.0286615
-0.0238495
-0.0189809
-0.015173
-0.0103406
-0.00557377
-0.000417356
0.00495704
0.00856222
0.0108201
0.0120788
0.0130428
0.0141031
0.0145075
0.01432
0.0139979
0.0136375
0.0131507
0.0126373
0.0121871
0.0117185
0.011114
0.0104068
0.00971191
0.00912472
0.00868489
0.00833479
0.00793587
0.00742855
0.00686158
0.00630876
0.00582703
0.00542994
0.00512347
0.00489234
0.00472048
0.00457025
0.00447848
0.00440796
0.00436024
0.00433695
0.00435283
0.00440865
0.00450477
0.00464248
0.004826
0.00506355
0.00535802
0.00570059
0.0061033
0.00652916
0.00698026
0.00743581
0.00788698
0.00831629
0.00871177
0.00903388
0.0092571
0.00933987
0.00926374
0.0089905
0.00848284
0.00769636
0.00660307
0.00516469
0.00332523
0.0011127
-0.00149729
-0.0045676
-0.00822957
-0.012425
-0.0170471
-0.0215353
-0.0258941
-0.0299983
-0.033933
-0.0376116
-0.040974
-0.0435418
-0.0449571
-0.0453714
-0.0449201
-0.0436593
-0.0418465
-0.0390622
-0.0348801
-0.0287777
-0.0205631
-0.0119813
-0.0309974
-0.0820884
-0.110072
-0.0708265
-0.00860744
0.0181508
0.019679
0.020191
-0.45761
-0.464275
-0.474856
-0.487384
-0.499861
-0.511367
-0.522291
-0.533185
-0.544026
-0.555177
-0.567209
-0.580003
-0.590473
-0.599349
-0.607289
-0.608474
-0.608315
-0.60628
-0.598782
-0.587144
-0.56592
-0.540224
-0.511731
-0.484039
-0.452258
-0.420583
-0.366891
-0.307097
-0.254931
-0.211484
-0.169975
-0.124892
-0.0795569
-0.0296742
0.0195432
0.0612887
0.0932557
0.124101
0.147901
0.160613
0.168307
0.171826
0.176691
0.179392
0.175892
0.17131
0.162988
0.154641
0.146028
0.135834
0.125803
0.115127
0.104712
0.095368
0.0862587
0.0778687
0.069884
0.0625522
0.055902
0.0497367
0.0441611
0.0390475
0.034469
0.0303799
0.0269188
0.0238274
0.0211542
0.0187739
0.0166613
0.0147809
0.0131152
0.0116486
0.0103611
0.00922145
0.00820009
0.00729315
0.00648025
0.0057954
0.00521598
0.00470082
0.00434086
0.0040598
0.00382464
0.00364088
0.00347898
0.0033418
0.00318527
0.00299966
0.00284724
0.0027267
0.00260291
0.00247298
0.00233111
0.00216354
0.00195651
0.00170531
0.00136578
0.000893638
0.000294551
-0.00047251
-0.00142053
-0.00253541
-0.00380471
-0.00523832
-0.00685504
-0.00860722
-0.0105183
-0.0126359
-0.0148924
-0.0171034
-0.019313
-0.0215282
-0.023733
-0.0258046
-0.0276034
-0.029116
-0.030341
-0.031265
-0.0318145
-0.0320312
-0.0318931
-0.0313718
-0.0305814
-0.0298503
-0.0289424
-0.0277066
-0.0259277
-0.0233323
-0.0203737
-0.016989
-0.0135431
-0.0107821
-0.00737056
-0.0039639
-0.000286677
0.00347491
0.00605885
0.00769577
0.00862423
0.00933082
0.0100621
0.0103506
0.0102327
0.010007
0.00974561
0.00940073
0.00903574
0.00871054
0.00837199
0.00794009
0.00744011
0.00694709
0.0065285
0.00621077
0.00595611
0.00566907
0.00530838
0.00490585
0.0045136
0.00417041
0.0038869
0.00366812
0.00350164
0.00337769
0.00326033
0.00318796
0.0031218
0.0030618
0.00301002
0.00297686
0.00296366
0.00297207
0.00300325
0.0030605
0.00314955
0.00327105
0.00341832
0.0035992
0.00378767
0.00398675
0.00418009
0.00436722
0.00453013
0.00466651
0.00474519
0.00474881
0.00464549
0.00442177
0.00404804
0.00350011
0.0027435
0.00175854
0.000527433
-0.000980132
-0.00275069
-0.00483897
-0.00730173
-0.0102219
-0.0135099
-0.0169284
-0.0201405
-0.0230943
-0.0257061
-0.0280316
-0.0300398
-0.0316907
-0.0327211
-0.0329805
-0.03266
-0.0319384
-0.0309377
-0.0295818
-0.0275014
-0.0243774
-0.0198887
-0.0140985
-0.00842457
-0.0221188
-0.0581329
-0.0783548
-0.0510246
-0.00700114
0.0123904
0.0141247
0.0144894
-0.278427
-0.284177
-0.292282
-0.301497
-0.310636
-0.319148
-0.327267
-0.335336
-0.343364
-0.351589
-0.360381
-0.369634
-0.377474
-0.383262
-0.389723
-0.390971
-0.391744
-0.391094
-0.386893
-0.38057
-0.367185
-0.350645
-0.331924
-0.313395
-0.292109
-0.270777
-0.235424
-0.196287
-0.16185
-0.133352
-0.106302
-0.0774584
-0.0492622
-0.0191447
0.0108348
0.0361471
0.0556348
0.074578
0.0890928
0.0968831
0.10173
0.104062
0.106966
0.10857
0.106531
0.10378
0.0987761
0.0936957
0.0883786
0.0821608
0.0760265
0.069507
0.0631225
0.0573929
0.0518282
0.0466949
0.0418392
0.0373901
0.0333703
0.0296499
0.0262799
0.0231936
0.0204356
0.0179795
0.015906
0.0140613
0.0124717
0.0110614
0.00981377
0.00870685
0.00773046
0.00687286
0.00612278
0.00546617
0.00488421
0.00436709
0.00391351
0.00353028
0.00318504
0.00294139
0.00275859
0.00260367
0.00245508
0.0023161
0.00216809
0.00201615
0.00181703
0.00159349
0.00138186
0.0010884
0.000813511
0.000516678
0.000191834
-0.000157119
-0.000540606
-0.000961052
-0.0014858
-0.00212325
-0.00286093
-0.00373404
-0.00474124
-0.00586912
-0.00710595
-0.00845663
-0.00992355
-0.0114427
-0.0130258
-0.0146594
-0.0162989
-0.0178174
-0.0192162
-0.0205052
-0.0216134
-0.0224383
-0.0228928
-0.0230108
-0.0228107
-0.0223367
-0.0216005
-0.0207389
-0.01983
-0.0189555
-0.0182482
-0.0178
-0.0172569
-0.0165174
-0.0154561
-0.013921
-0.0121641
-0.010173
-0.00810116
-0.00644569
-0.00441612
-0.00237176
-0.000178977
0.00205291
0.00361015
0.00460033
0.00516951
0.00560028
0.00602989
0.00620331
0.00613741
0.0060064
0.00584654
0.00564304
0.00542321
0.00522729
0.00502422
0.0047646
0.00446766
0.0041731
0.00392257
0.00373009
0.00357574
0.00340245
0.00318676
0.00294612
0.00271204
0.00250666
0.00233656
0.0022055
0.0021057
0.00203266
0.00197895
0.00191747
0.00185013
0.00177349
0.00168938
0.00160419
0.00151959
0.00143723
0.00135857
0.0012872
0.00122561
0.00117244
0.0011218
0.00107942
0.00102749
0.000972532
0.000901385
0.000820616
0.00071561
0.000591271
0.000423441
0.000205648
-8.27618e-05
-0.000451438
-0.000921934
-0.00150448
-0.00222582
-0.00309729
-0.00411606
-0.00528238
-0.00659235
-0.00812854
-0.00996125
-0.0121451
-0.0145266
-0.0168111
-0.0187534
-0.0202959
-0.0214083
-0.0221443
-0.0225057
-0.0224838
-0.0220053
-0.0211197
-0.0200782
-0.0191016
-0.0183868
-0.0175406
-0.0162358
-0.0142791
-0.0115105
-0.00808466
-0.00502288
-0.0127591
-0.0341884
-0.0458975
-0.0301244
-0.00467008
0.00712721
0.00850192
0.00870067
-0.0961625
-0.101044
-0.106806
-0.113009
-0.11924
-0.125293
-0.131257
-0.137259
-0.143299
-0.149475
-0.155959
-0.162695
-0.168928
-0.17406
-0.179514
-0.182934
-0.185923
-0.188005
-0.188445
-0.187604
-0.183262
-0.176969
-0.16882
-0.159988
-0.14939
-0.138795
-0.121432
-0.102146
-0.0841477
-0.0691316
-0.0537953
-0.0372442
-0.0219403
-0.00663466
0.00805423
0.0207852
0.0310119
0.0407942
0.0483952
0.0531488
0.056307
0.0577452
0.0592063
0.0596287
0.0586365
0.0570584
0.0544421
0.0516438
0.0485731
0.045163
0.0417682
0.0382095
0.0347163
0.0315255
0.0284325
0.0255671
0.0228936
0.0204325
0.0182006
0.0161331
0.0142493
0.0125361
0.0110173
0.00966265
0.00850335
0.00746774
0.00656403
0.00576038
0.00504783
0.00441544
0.0038566
0.00336423
0.00293053
0.00255141
0.00221686
0.00191798
0.00165125
0.00140229
0.00116401
0.00113986
0.000953577
0.000789333
0.000617968
0.000428092
0.00022019
-1.55084e-05
-0.000280179
-0.000579443
-0.000884747
-0.00126881
-0.00165308
-0.00206643
-0.00251612
-0.00300056
-0.00351899
-0.00409336
-0.00476076
-0.00550346
-0.00632807
-0.00725479
-0.00827071
-0.00937453
-0.010547
-0.0117889
-0.0130876
-0.0143647
-0.0156118
-0.0167529
-0.0177763
-0.0185682
-0.0191219
-0.0194227
-0.0193762
-0.0189158
-0.0180018
-0.0167015
-0.0150707
-0.0132203
-0.0112254
-0.00933082
-0.00771724
-0.00657578
-0.00602439
-0.00587491
-0.0056983
-0.00545704
-0.00510849
-0.00460402
-0.0040279
-0.00337297
-0.00269637
-0.0021442
-0.00147211
-0.000792208
-7.6191e-05
0.000671653
0.00119706
0.00152921
0.00172275
0.00186945
0.00201103
0.00206875
0.00204781
0.00200584
0.00195177
0.00188542
0.00181228
0.00174708
0.00167863
0.00159076
0.00149196
0.00139388
0.00131043
0.00124569
0.00119349
0.00113519
0.00106351
0.000983551
0.000905746
0.000837448
0.000780776
0.000737187
0.000704141
0.000681832
0.000667799
0.000621582
0.000551531
0.000458448
0.000339421
0.000199979
4.06837e-05
-0.000136272
-0.000328839
-0.000533273
-0.000751112
-0.000984822
-0.0012425
-0.00151549
-0.00182025
-0.00213932
-0.00248888
-0.00285136
-0.00323914
-0.00363787
-0.00406467
-0.00451421
-0.00500138
-0.00552576
-0.00609909
-0.00671514
-0.00740122
-0.00816211
-0.00896187
-0.00977668
-0.0106054
-0.0115664
-0.0127417
-0.014163
-0.0155861
-0.016709
-0.017302
-0.017381
-0.0169905
-0.0161335
-0.0148253
-0.013102
-0.0111275
-0.00915446
-0.00747958
-0.0063611
-0.00601277
-0.00572386
-0.00525263
-0.00455059
-0.00359148
-0.00249245
-0.00163043
-0.00396938
-0.0120891
-0.0151977
-0.00950758
-0.00135847
0.00238984
0.00284815
0.00296033
227.211
200.223
169.038
128.474
87.9801
37.3269
225.049
197.45
165.662
124.948
84.8845
34.9253
222.805
194.736
162.448
121.555
80.3656
27.1763
220.544
192.156
159.433
118.735
78.0339
23.57
218.457
189.609
156.337
115.371
74.1752
19.6027
216.416
187.334
153.94
113.604
71.3904
15.8778
214.467
184.966
150.933
110.03
68.5853
12.7863
212.606
182.707
148.418
107.768
65.8971
10.166
210.812
180.544
145.949
105.239
63.3568
7.99025
209.09
178.47
143.571
102.759
61.0121
6.15376
207.438
176.48
141.299
100.476
58.7195
4.50219
205.864
174.581
139.15
98.4726
56.3404
2.98056
204.364
172.767
137.119
96.6234
53.9607
1.56673
202.941
171.042
135.202
94.8553
51.6532
0.244712
201.59
169.402
133.386
93.1102
49.4272
-1.00341
200.311
167.839
131.653
91.3872
47.2747
-2.18447
199.1
166.353
129.999
89.6992
45.1755
-3.33011
197.953
164.936
128.409
88.0424
43.1097
-4.45525
196.868
163.579
126.873
86.4128
41.0565
-5.54031
195.845
162.282
125.396
84.8257
39.0165
-6.5557
194.88
161.038
123.972
83.276
36.9681
-7.54009
193.97
159.846
122.593
81.7534
34.9118
-8.54189
193.115
158.703
121.266
80.251
32.8795
-9.58889
192.303
157.6
119.964
78.7533
30.8619
-10.672
191.535
156.539
118.708
77.2665
28.8747
-11.769
190.817
155.529
117.493
75.7467
26.9075
-12.8842
190.126
154.56
116.283
74.2125
24.9652
-14.0233
189.469
153.612
115.154
72.7288
23.051
-15.2826
188.831
152.716
113.822
71.3163
21.1357
-16.6721
188.19
151.793
112.498
69.7819
19.4214
-18.4316
187.561
150.869
111.269
68.5082
18.0152
-20.7661
186.888
150.081
110.012
67.3021
16.3631
-22.6968
186.175
149.31
108.771
65.3468
14.5979
-19.2296
185.402
148.507
107.47
63.2984
14.1696
11.1353
184.469
148.101
105.773
61.9171
20.5931
14.3847
183.518
147.254
104.559
60.266
32.4736
5.17441
182.553
146.328
103.083
64.071
16.3833
1.55881
181.186
145.665
100.75
44.0683
2.1009
1.18338
179.752
144.378
89.5784
13.3156
0.503638
0.91832
178.742
138.117
30.9903
0.80708
0.454611
0.772203
174.47
69.6008
3.09888
1.1953
0.471636
0.734452
101.726
11.7227
1.93154
1.23844
0.476254
0.819133
7.92943
0.621769
0.774276
1.00364
0.944139
0.89861
0.0591753
0.0745079
0.209808
0.630503
1.02357
1.43979
-0.0179136
0.0369128
0.097827
0.231208
0.500936
2.82051
0.00925023
0.0513829
0.0538452
0.0323947
0.0874764
2.63068
0.0287596
0.0594963
0.0435113
-0.00351766
-0.0487779
0.819147
0.0421044
0.0551761
0.0406437
-0.00540508
-0.0569148
0.00563003
0.0520529
0.0494776
0.0367886
-0.00472025
-0.0431762
-0.018889
0.0530695
0.0449228
0.0322998
-0.002707
-0.0325237
-0.0146479
0.0467735
0.0407118
0.0282414
-0.000841624
-0.0251279
-0.0111919
0.0421241
0.0365004
0.024622
0.000550249
-0.0195433
-0.00834877
0.0385635
0.0321839
0.0213044
0.00146728
-0.0150848
-0.0060791
0.0343742
0.0277666
0.0181156
0.00198547
-0.0114985
-0.00433971
0.0297299
0.0232811
0.0150773
0.00218904
-0.00861375
-0.00302727
0.0246732
0.018864
0.01224
0.00213619
-0.00627521
-0.00205352
0.0192716
0.0145058
0.00944009
0.00186905
-0.00439439
-0.00134486
0.0138226
0.0102303
0.00669325
0.00145029
-0.00287471
-0.000835428
0.00839903
0.00610029
0.00400002
0.000924135
-0.00161112
-0.000458223
0.00293597
0.00203346
0.00132644
0.000328303
-0.00049823
-0.000148573
-58.384
-101.876
-138.444
-166.862
-187.836
-201.03
-53.7485
-98.7647
-135.833
-164.803
-186.459
-200.496
-49.933
-96.0384
-133.236
-162.508
-184.681
-199.494
-46.9657
-93.6237
-130.913
-160.667
-183.532
-199.124
-44.6501
-91.4485
-128.728
-158.909
-181.741
-198.443
-42.9893
-89.5213
-126.798
-157.325
-181.022
-197.925
-41.9287
-87.8527
-125.142
-155.845
-179.776
-197.448
-41.3571
-86.4687
-123.73
-154.53
-178.802
-197.031
-41.1854
-85.3847
-122.561
-153.371
-177.914
-196.691
-41.3404
-84.6067
-121.631
-152.389
-177.195
-196.443
-41.7528
-84.1184
-120.927
-151.599
-176.62
-196.288
-42.3708
-83.9079
-120.455
-151.007
-176.202
-196.252
-43.152
-83.9659
-120.21
-150.62
-175.943
-196.329
-44.0756
-84.2662
-120.188
-150.449
-175.849
-196.539
-45.1313
-84.7948
-120.379
-150.499
-175.924
-196.878
-46.3114
-85.538
-120.781
-150.777
-176.175
-197.36
-47.603
-86.484
-121.392
-151.277
-176.616
-197.97
-48.9943
-87.6284
-122.225
-151.987
-177.258
-198.729
-50.4837
-88.9598
-123.283
-152.904
-178.102
-199.63
-52.0615
-90.477
-124.566
-154.026
-179.151
-200.681
-53.7067
-92.1772
-126.076
-155.356
-180.397
-201.891
-55.4066
-94.0594
-127.82
-156.893
-181.831
-203.28
-57.1405
-96.1329
-129.807
-158.641
-183.442
-204.858
-58.8913
-98.3992
-132.023
-160.602
-185.245
-206.616
-60.6908
-100.832
-134.456
-162.792
-187.248
-208.55
-62.4795
-103.39
-137.053
-165.219
-189.445
-210.661
-64.1498
-106.035
-140.223
-167.883
-191.835
-212.945
-65.6846
-108.709
-143.688
-170.795
-194.425
-215.407
-66.9896
-111.483
-147.398
-173.987
-197.191
-218.096
-67.9767
-114.75
-151.386
-177.419
-200.111
-221.062
-68.3213
-117.778
-155.424
-181.073
-203.209
-224.303
-67.4115
-119.432
-158.542
-184.983
-206.412
-227.831
-43.1137
-114.253
-158.145
-188.476
-209.63
-231.536
6.79537
-42.8369
-131.153
-188.608
-212.31
-235.258
8.43645
7.48907
-39.7404
-160.565
-210.229
-238.869
7.35251
9.9819
-0.190676
-50.255
-172.142
-240.322
6.09911
10.0121
4.88856
-1.71523
-49.8655
-183.31
4.43461
9.18287
4.47083
2.29239
-0.528437
-20.2668
2.63912
7.27748
4.61138
2.30177
2.09063
1.15448
1.3738
3.59501
3.80266
3.00656
1.66725
0.84588
1.37686
1.09254
1.93306
1.91299
0.893619
0.603371
1.40391
0.975841
0.788607
0.569485
0.486349
0.46565
1.4362
1.24967
0.678999
0.558302
0.441736
0.462931
2.12251
1.47591
0.964801
0.587535
0.288753
0.337725
3.25595
0.805756
0.441318
0.276364
0.101556
0.0958637
3.32122
0.425833
0.0949554
0.0674335
0.0350544
0.00722941
2.37857
0.170001
0.0615678
0.0512388
0.0323669
0.0126281
0.380923
0.0730521
0.0565452
0.0477481
0.032092
0.0168806
0.0497232
0.0571225
0.052464
0.0443137
0.0316276
0.0212918
0.0445457
0.0511142
0.0483884
0.0408143
0.030111
0.0222631
0.0401904
0.0458595
0.0441695
0.0371501
0.0279817
0.0198325
0.0359276
0.0406578
0.0396959
0.03341
0.0256187
0.017062
0.031638
0.0355652
0.0348184
0.0295809
0.0230339
0.0158658
0.0274058
0.030631
0.0303241
0.0257134
0.0202766
0.0144055
0.0232159
0.0258002
0.025777
0.021775
0.0174163
0.0126527
0.0190172
0.0210556
0.0211859
0.0178357
0.0144263
0.0106477
0.0148273
0.0163853
0.0165594
0.0138962
0.0113274
0.00845835
0.0106273
0.0117446
0.0118969
0.00993729
0.00813022
0.00613064
0.00640195
0.00711095
0.0071886
0.00597602
0.00490181
0.00371653
0.00215879
0.00241398
0.00242081
0.00200401
0.00164347
0.00125176
-214.823
-234.043
-252.015
-268.232
-282.142
-293.655
-302.73
-309.424
-313.829
-316.067
-316.307
-314.849
-311.887
-307.657
-302.38
-296.203
-289.194
-281.353
-272.581
-262.708
-251.499
-238.677
-223.971
-207.116
-187.909
-166.219
-141.972
-115.192
-85.9866
-54.5664
-21.1887
13.8434
50.195
87.156
124.32
161.165
197.135
231.664
264.183
294.144
321.02
344.351
363.702
378.74
389.194
394.881
395.584
391.622
382.885
369.543
351.924
330.354
305.244
277.06
246.305
213.504
179.19
143.888
108.092
72.257
36.7951
2.06237
-31.6487
-64.0993
-95.0998
-124.508
-152.218
-178.15
-202.245
-224.465
-244.785
-263.182
-279.652
-294.193
-306.804
-317.49
-326.255
-333.09
-337.984
-340.939
-341.912
-340.824
-337.706
-332.506
-325.171
-315.638
-303.873
-289.826
-273.439
-254.69
-233.572
-210.08
-184.249
-156.148
-125.92
-93.7126
-59.7
-24.1952
12.6004
50.6374
88.6774
126.455
163.581
199.65
234.134
266.539
296.382
323.211
346.536
365.97
381.195
391.932
398.006
399.167
395.641
387.402
374.586
357.456
336.349
311.675
283.921
253.564
221.122
187.14
152.176
116.72
81.2858
46.5098
8.55409
-24.3021
-56.0089
-86.1155
-114.322
-140.428
-164.3
-185.867
-205.079
-221.926
-236.428
-248.623
-258.573
-215.177
-234.117
-252.1
-268.31
-282.222
-293.733
-302.806
-309.498
-313.897
-316.126
-316.362
-314.897
-311.927
-307.691
-302.409
-296.23
-289.222
-281.384
-272.617
-262.752
-251.551
-238.739
-224.042
-207.195
-187.994
-166.308
-142.062
-115.282
-86.0726
-54.6471
-21.2612
13.7815
50.1455
87.1212
124.302
161.164
197.153
231.701
264.241
294.221
321.115
344.463
363.829
378.878
389.339
395.03
395.742
391.762
383.021
369.669
352.037
330.451
305.323
277.12
246.346
213.527
179.196
143.879
108.068
72.2218
36.7503
2.01002
-31.7067
-64.1612
-95.1642
-124.574
-152.284
-178.216
-202.312
-224.531
-244.851
-263.247
-279.716
-294.256
-306.866
-317.552
-326.316
-333.152
-338.046
-341.002
-341.973
-340.888
-337.771
-332.573
-325.24
-315.709
-303.947
-289.901
-273.517
-254.77
-233.653
-210.162
-184.33
-156.227
-125.997
-93.7854
-59.767
-24.255
12.5503
50.6012
88.6554
126.447
163.589
199.675
234.177
266.6
296.461
323.307
346.647
366.095
381.331
392.076
398.153
399.325
395.783
387.54
374.713
357.571
336.449
311.757
283.984
253.608
221.148
187.148
152.168
116.696
81.242
46.4316
8.53329
-24.3545
-56.0745
-86.1882
-114.399
-140.508
-164.38
-185.947
-205.158
-222.003
-236.503
-248.695
-258.643
-215.202
-234.247
-252.274
-268.464
-282.38
-293.888
-302.958
-309.643
-314.033
-316.244
-316.471
-314.99
-312.006
-307.757
-302.467
-296.283
-289.275
-281.443
-272.687
-262.837
-251.654
-238.861
-224.182
-207.35
-188.161
-166.483
-142.241
-115.459
-86.2429
-54.8067
-21.4047
13.659
50.0482
87.0534
124.266
161.163
197.191
231.778
264.356
294.376
321.307
344.689
364.083
379.155
389.631
395.328
396.058
392.045
383.294
369.923
352.263
330.645
305.482
277.242
246.431
213.575
179.209
143.861
108.022
72.1524
36.6616
1.90612
-31.8217
-64.284
-95.2923
-124.705
-152.417
-178.349
-202.444
-224.663
-244.981
-263.376
-279.843
-294.381
-306.99
-317.674
-326.438
-333.274
-338.169
-341.127
-342.094
-341.016
-337.901
-332.707
-325.377
-315.851
-304.093
-290.053
-273.672
-254.929
-233.815
-210.325
-184.492
-156.387
-126.151
-93.931
-59.901
-24.3748
12.4499
50.5289
88.6113
126.431
163.605
199.724
234.262
266.722
296.619
323.499
346.871
366.345
381.603
392.363
398.447
399.639
396.069
387.816
374.97
357.801
336.647
311.921
284.111
253.697
221.2
187.165
152.152
116.647
81.1549
46.2696
8.49737
-24.4598
-56.2058
-86.3337
-114.553
-140.666
-164.54
-186.106
-205.315
-222.156
-236.652
-248.84
-258.782
-215.267
-234.427
-252.514
-268.697
-282.618
-294.121
-303.185
-309.86
-314.236
-316.422
-316.635
-315.13
-312.124
-307.857
-302.553
-296.361
-289.354
-281.532
-272.793
-262.965
-251.809
-239.044
-224.392
-207.584
-188.413
-166.747
-142.508
-115.724
-86.4987
-55.0464
-21.6202
13.4748
49.9021
86.9514
124.212
161.163
197.246
231.892
264.53
294.608
321.595
345.027
364.464
379.571
390.069
395.776
396.528
392.474
383.705
370.304
352.603
330.937
305.72
277.424
246.557
213.646
179.229
143.833
107.953
72.0481
36.5285
1.75011
-31.9945
-64.4685
-95.4844
-124.902
-152.616
-178.549
-202.643
-224.86
-245.176
-263.569
-280.033
-294.569
-307.175
-317.858
-326.62
-333.457
-338.353
-341.313
-342.275
-341.208
-338.097
-332.907
-325.584
-316.064
-304.313
-290.28
-273.906
-255.169
-234.058
-210.569
-184.736
-156.626
-126.382
-94.1495
-60.1021
-24.5546
12.2989
50.4204
88.5451
126.408
163.628
199.798
234.39
266.905
296.856
323.788
347.207
366.721
382.011
392.794
398.888
400.104
396.502
388.232
375.354
358.147
336.946
312.167
284.301
253.83
221.277
187.19
152.127
116.574
81.0255
46.0332
8.43635
-24.6192
-56.4033
-86.5522
-114.785
-140.904
-164.781
-186.345
-205.551
-222.387
-236.877
-249.057
-258.992
-215.355
-234.659
-252.824
-269.008
-282.936
-294.432
-303.489
-310.148
-314.505
-316.663
-316.854
-315.317
-312.281
-307.989
-302.667
-296.465
-289.459
-281.65
-272.933
-263.136
-252.016
-239.289
-224.672
-207.895
-188.748
-167.098
-142.866
-116.079
-86.8403
-55.3666
-21.9081
13.2279
49.7076
86.8153
124.141
161.162
197.321
232.044
264.762
294.918
321.978
345.477
364.973
380.126
390.654
396.373
397.146
393.054
384.254
370.813
353.057
331.326
306.038
277.668
246.725
213.74
179.254
143.796
107.861
71.9087
36.3505
1.54177
-32.2251
-64.7146
-95.7408
-125.164
-152.881
-178.814
-202.909
-225.123
-245.437
-263.826
-280.287
-294.819
-307.422
-318.103
-326.864
-333.7
-338.599
-341.56
-342.521
-341.463
-338.358
-333.175
-325.859
-316.348
-304.607
-290.582
-274.217
-255.488
-234.383
-210.896
-185.061
-156.945
-126.691
-94.4412
-60.3706
-24.7948
12.0962
50.276
88.4568
126.377
163.659
199.896
234.561
267.149
297.172
324.173
347.654
367.222
382.555
393.369
399.477
400.715
397.085
388.787
375.868
358.608
337.343
312.494
284.554
254.008
221.38
187.223
152.095
116.478
80.8555
45.7344
8.33797
-24.8347
-56.6673
-86.8439
-115.093
-141.222
-165.101
-186.664
-205.865
-222.695
-237.176
-249.347
-259.271
-215.466
-234.947
-253.201
-269.398
-283.333
-294.821
-303.868
-310.509
-314.839
-316.969
-317.127
-315.551
-312.477
-308.154
-302.809
-296.594
-289.589
-281.796
-273.108
-263.349
-252.274
-239.594
-225.023
-208.285
-189.168
-167.539
-143.313
-116.523
-87.2681
-55.7676
-22.2686
12.9176
49.4644
86.6448
124.05
161.16
197.413
232.234
265.051
295.306
322.458
346.041
365.609
380.82
391.386
397.121
397.911
393.786
384.942
371.449
353.624
331.813
306.436
277.972
246.935
213.858
179.286
143.749
107.745
71.7337
36.1274
1.28087
-32.5139
-65.0227
-96.0615
-125.493
-153.213
-179.147
-203.24
-225.453
-245.763
-264.147
-280.605
-295.132
-307.731
-318.408
-327.168
-334.005
-338.904
-341.867
-342.832
-341.783
-338.684
-333.51
-326.203
-316.703
-304.974
-290.961
-274.607
-255.887
-234.789
-211.304
-185.468
-157.345
-127.077
-94.8064
-60.7067
-25.0959
11.841
50.096
88.3463
126.337
163.696
200.019
234.773
267.454
297.567
324.654
348.214
367.849
383.236
394.088
400.214
401.467
397.821
389.482
376.51
359.184
337.841
312.903
284.87
254.229
221.509
187.263
152.054
116.358
80.6466
45.3839
8.19081
-25.1084
-56.9987
-87.2092
-115.479
-141.619
-165.502
-187.064
-206.259
-223.079
-237.55
-249.709
-259.62
-215.598
-235.293
-253.647
-269.867
-283.81
-295.289
-304.322
-310.941
-315.241
-317.338
-317.455
-315.831
-312.713
-308.352
-302.979
-296.749
-289.745
-281.971
-273.318
-263.604
-252.583
-239.961
-225.444
-208.753
-189.674
-168.068
-143.851
-117.057
-87.7825
-56.25
-22.7025
12.5433
49.1725
86.4395
123.941
161.156
197.523
232.462
265.398
295.77
323.034
346.718
366.373
381.653
392.266
398.021
398.82
394.67
385.771
372.213
354.305
332.397
306.913
278.336
247.186
213.999
179.323
143.692
107.605
71.5229
35.8587
0.967149
-32.8611
-65.393
-96.4468
-125.887
-153.612
-179.546
-203.638
-225.848
-246.154
-264.534
-280.986
-295.508
-308.102
-318.775
-327.533
-334.37
-339.271
-342.234
-343.206
-342.165
-339.075
-333.911
-326.616
-317.13
-305.414
-291.415
-275.074
-256.366
-235.276
-211.795
-185.956
-157.824
-127.541
-95.2454
-61.1109
-25.4583
11.5327
49.8805
88.2134
126.29
163.741
200.165
235.028
267.819
298.041
325.231
348.886
368.602
384.054
394.953
401.102
402.362
398.707
390.317
377.282
359.877
338.438
313.394
285.249
254.494
221.662
187.311
152.004
116.214
80.4004
44.9897
7.98602
-25.4423
-57.3981
-87.6484
-115.944
-142.097
-165.984
-187.543
-206.731
-223.541
-237.999
-250.144
-260.04
-215.761
-235.703
-254.164
-270.415
-284.365
-295.835
-304.853
-311.446
-315.711
-317.766
-317.836
-316.158
-312.987
-308.582
-303.175
-296.928
-289.927
-282.174
-273.561
-263.902
-252.944
-240.389
-225.936
-209.301
-190.264
-168.686
-144.48
-117.68
-88.3841
-56.8138
-23.2107
12.1049
48.831
86.199
123.813
161.151
197.65
232.727
265.803
296.312
323.706
347.509
367.266
382.627
393.294
399.073
399.876
395.705
386.741
373.106
355.1
333.078
307.469
278.761
247.478
214.162
179.365
143.624
107.44
71.2758
35.5439
0.600218
-33.2671
-65.8257
-96.8969
-126.347
-154.077
-180.012
-204.103
-226.309
-246.61
-264.984
-281.431
-295.946
-308.534
-319.203
-327.959
-334.795
-339.698
-342.663
-343.642
-342.611
-339.531
-334.379
-327.098
-317.627
-305.928
-291.945
-275.619
-256.925
-235.845
-212.368
-186.527
-158.385
-128.082
-95.7583
-61.584
-25.8832
11.1713
49.6296
88.0577
126.233
163.792
200.335
235.325
268.245
298.595
325.905
349.67
369.481
385.009
395.962
402.141
403.406
399.739
391.293
378.184
360.685
339.135
313.967
285.691
254.803
221.84
187.366
151.945
116.048
80.1187
44.5567
7.71755
-25.8385
-57.8663
-88.1622
-116.486
-142.654
-166.546
-188.103
-207.283
-224.081
-238.524
-250.652
-260.529
-215.962
-236.177
-254.756
-271.043
-285.001
-296.46
-305.461
-312.025
-316.25
-318.255
-318.272
-316.532
-313.301
-308.844
-303.398
-297.131
-290.132
-282.403
-273.837
-264.241
-253.357
-240.879
-226.5
-209.928
-190.941
-169.394
-145.202
-118.394
-89.0738
-57.4597
-23.7945
11.6019
48.44
85.9229
123.665
161.144
197.794
233.028
266.265
296.932
324.475
348.413
368.287
383.74
394.47
400.279
401.084
396.888
387.852
374.128
356.01
333.857
308.105
279.246
247.811
214.347
179.412
143.545
107.25
70.9917
35.1825
0.179609
-33.7323
-66.3213
-97.4122
-126.874
-154.609
-180.545
-204.634
-226.837
-247.132
-265.499
-281.939
-296.447
-309.028
-319.693
-328.445
-335.281
-340.186
-343.154
-344.141
-343.119
-340.052
-334.914
-327.649
-318.196
-306.515
-292.551
-276.243
-257.564
-236.496
-213.024
-187.18
-159.026
-128.703
-96.3456
-62.1264
-26.371
10.756
49.343
87.8789
126.167
163.85
200.528
235.663
268.732
299.227
326.676
350.568
370.487
386.103
397.118
403.331
404.603
400.917
392.41
379.217
361.61
339.932
314.622
286.196
255.155
222.043
187.428
151.877
115.858
79.8022
44.0875
7.38225
-26.2988
-58.4044
-88.751
-117.107
-143.293
-167.19
-188.743
-207.914
-224.698
-239.124
-251.233
-261.088
-216.212
-236.719
-255.421
-271.753
-285.718
-297.165
-306.145
-312.677
-316.858
-318.81
-318.762
-316.952
-313.654
-309.137
-303.647
-297.357
-290.361
-282.66
-274.146
-264.621
-253.82
-241.43
-227.134
-210.634
-191.704
-170.193
-146.015
-119.2
-89.8521
-58.1879
-24.4548
11.0332
47.9989
85.6106
123.496
161.135
197.955
233.367
266.784
297.628
325.34
349.431
369.437
384.995
395.796
401.639
402.445
398.219
389.104
375.279
357.034
334.734
308.82
279.791
248.184
214.554
179.463
143.454
107.034
70.67
34.7737
-0.295269
-34.2572
-66.8801
-97.9928
-127.467
-155.208
-181.145
-205.231
-227.43
-247.719
-266.079
-282.51
-297.01
-309.584
-320.243
-328.992
-335.827
-340.735
-343.707
-344.703
-343.691
-340.637
-335.516
-328.269
-318.835
-307.176
-293.233
-276.945
-258.284
-237.229
-213.763
-187.916
-159.749
-129.402
-97.0076
-62.7388
-26.9225
10.2859
49.0205
87.6765
126.091
163.913
200.744
236.042
269.279
299.939
327.544
351.578
371.62
387.335
398.421
404.672
405.951
402.243
393.669
380.381
362.652
340.829
315.359
286.764
255.55
222.269
187.495
151.799
115.644
79.4518
43.5821
6.9788
-26.8248
-59.0132
-89.4156
-117.808
-144.013
-167.915
-189.464
-208.624
-225.392
-239.799
-251.886
-261.718
-216.527
-237.334
-256.165
-272.544
-286.515
-297.949
-306.906
-313.403
-317.536
-319.428
-319.307
-317.419
-314.044
-309.461
-303.921
-297.606
-290.612
-282.943
-274.487
-265.042
-254.335
-242.043
-227.84
-211.421
-192.554
-171.083
-146.922
-120.098
-90.7196
-58.9996
-25.1915
10.3971
47.5073
85.2612
123.306
161.122
198.132
233.742
267.36
298.402
326.302
350.564
370.717
386.391
397.272
403.154
403.961
399.697
390.498
376.56
358.174
335.709
309.615
280.396
248.598
214.782
179.517
143.35
106.791
70.3099
34.3173
-0.825329
-34.8423
-67.5027
-98.6391
-128.127
-155.874
-181.812
-205.896
-228.09
-248.372
-266.723
-283.145
-297.636
-310.202
-320.854
-329.6
-336.434
-341.344
-344.321
-345.326
-344.327
-341.288
-336.184
-328.957
-319.546
-307.91
-293.991
-277.726
-259.085
-238.044
-214.585
-188.734
-160.554
-130.18
-97.7447
-63.4217
-27.5383
9.76003
48.6621
87.4501
126.004
163.98
200.982
236.463
269.886
300.73
328.509
352.703
372.881
388.705
399.871
406.166
407.454
403.718
395.069
381.677
363.812
341.827
316.178
287.394
255.988
222.519
187.569
151.712
115.407
79.0677
43.04
6.50693
-27.4178
-59.6935
-90.1566
-118.588
-144.814
-168.722
-190.267
-209.414
-226.165
-240.55
-252.613
-262.418
-216.912
-238.026
-256.99
-273.418
-287.393
-298.813
-307.745
-314.204
-318.283
-320.109
-319.907
-317.933
-314.473
-309.815
-304.221
-297.877
-290.885
-283.25
-274.859
-265.503
-254.9
-242.718
-228.618
-212.289
-193.491
-172.066
-147.923
-121.089
-91.6766
-59.8959
-26.0053
9.6922
46.9645
84.8738
123.095
161.105
198.325
234.153
267.992
299.253
327.36
351.811
372.127
387.93
398.899
404.824
405.632
401.326
392.034
377.97
359.428
336.782
310.488
281.06
249.051
215.03
179.574
143.233
106.521
69.9106
33.8125
-1.41148
-35.4881
-68.1896
-99.3513
-128.853
-156.607
-182.547
-206.628
-228.816
-249.09
-267.432
-283.844
-298.324
-310.882
-321.526
-330.268
-337.101
-342.014
-344.997
-346.011
-345.026
-342.003
-336.919
-329.715
-320.327
-308.718
-294.826
-278.585
-259.966
-238.942
-215.49
-189.637
-161.441
-131.038
-98.5576
-64.1758
-28.2195
9.17698
48.2676
87.1989
125.906
164.052
201.241
236.923
270.554
301.6
329.572
353.941
374.271
390.216
401.469
407.813
409.11
405.342
396.613
383.105
365.088
342.925
317.079
288.086
256.468
222.791
187.647
151.613
115.146
78.6494
42.4601
5.96679
-28.0788
-60.4465
-90.9747
-119.449
-145.698
-169.612
-191.15
-210.284
-227.015
-241.377
-253.413
-263.188
-217.377
-238.799
-257.899
-274.377
-288.354
-299.758
-308.662
-315.079
-319.101
-320.854
-320.564
-318.493
-314.939
-310.2
-304.544
-298.168
-291.179
-283.582
-275.263
-266.005
-255.516
-243.455
-229.469
-213.238
-194.517
-173.142
-149.019
-122.175
-92.7241
-60.8781
-26.8969
8.91705
46.3703
84.4476
122.86
161.084
198.532
234.599
268.681
300.181
328.516
353.173
373.668
389.612
400.679
406.651
407.459
403.104
393.714
379.512
360.799
337.954
311.441
281.783
249.543
215.299
179.632
143.101
106.223
69.4711
33.2585
-2.05447
-36.1955
-68.9411
-100.13
-129.648
-157.408
-183.349
-207.427
-229.609
-249.874
-268.206
-284.606
-299.075
-311.622
-322.259
-330.996
-337.829
-342.745
-345.734
-346.759
-345.789
-342.783
-337.721
-330.541
-321.18
-309.599
-295.736
-279.523
-260.929
-239.923
-216.48
-190.623
-162.411
-131.976
-99.4467
-65.0011
-28.9669
8.53459
47.8371
86.9223
125.796
164.126
201.52
237.424
271.281
302.549
330.732
355.294
375.789
391.867
403.216
409.614
410.921
407.116
398.3
384.665
366.483
344.124
318.062
288.841
256.991
223.085
187.729
151.503
114.861
78.1966
41.841
5.3586
-28.8089
-61.2729
-91.8708
-120.391
-146.665
-170.584
-192.116
-211.234
-227.943
-242.28
-254.286
-264.029
-217.931
-239.659
-258.895
-275.42
-289.398
-300.784
-309.657
-316.03
-319.99
-321.663
-321.276
-319.1
-315.443
-310.613
-304.891
-298.479
-291.492
-283.936
-275.696
-266.545
-256.183
-244.254
-230.393
-214.27
-195.633
-174.312
-150.211
-123.357
-93.8637
-61.9474
-27.8673
8.07038
45.7238
83.9817
122.602
161.056
198.754
235.081
269.426
301.186
329.768
354.651
375.34
391.439
402.611
408.635
409.443
405.035
395.537
381.185
362.285
339.224
312.473
282.566
250.074
215.586
179.692
142.954
105.895
68.9904
32.6541
-2.7552
-36.9652
-69.7577
-100.976
-130.509
-158.277
-184.218
-208.293
-230.468
-250.724
-269.045
-285.432
-299.889
-312.424
-323.052
-331.784
-338.617
-343.536
-346.533
-347.569
-346.614
-343.627
-338.589
-331.436
-322.103
-310.554
-296.723
-280.54
-261.973
-240.987
-217.554
-191.694
-163.465
-132.995
-100.413
-65.8982
-29.7805
7.82992
47.3705
86.6197
125.673
164.203
201.82
237.964
272.067
303.578
331.991
356.762
377.436
393.659
405.113
411.569
412.888
409.042
400.132
386.357
367.996
345.425
319.127
289.657
257.554
223.401
187.815
151.381
114.552
77.7092
41.1808
4.68241
-29.6091
-62.1737
-92.8457
-121.415
-147.714
-171.64
-193.163
-212.264
-228.95
-243.259
-255.233
-264.941
-218.583
-240.611
-259.98
-276.55
-290.525
-301.891
-310.732
-317.058
-320.952
-322.536
-322.043
-319.753
-315.984
-311.056
-305.259
-298.809
-291.823
-284.312
-276.158
-267.124
-256.9
-245.115
-231.39
-215.386
-196.84
-175.577
-151.5
-124.634
-95.0969
-63.1042
-28.9184
7.15102
45.0245
83.4747
122.318
161.023
198.989
235.597
270.227
302.268
331.118
356.244
377.145
393.411
404.697
410.778
411.585
407.118
397.504
382.991
363.888
340.592
313.584
283.406
250.643
215.892
179.75
142.79
105.537
68.4674
31.9981
-3.51433
-37.798
-70.6401
-101.889
-131.439
-159.214
-185.156
-209.226
-231.394
-251.639
-269.948
-286.322
-300.765
-313.288
-323.907
-332.633
-339.465
-344.388
-347.393
-348.441
-347.502
-344.536
-339.523
-332.399
-323.098
-311.583
-297.786
-281.636
-263.099
-242.134
-218.713
-192.851
-164.603
-134.097
-101.456
-66.8676
-30.661
7.06046
46.8683
86.2901
125.536
164.281
202.138
238.542
272.913
304.686
333.347
358.344
379.214
395.594
407.161
413.681
415.012
411.121
402.109
388.182
369.628
346.827
320.274
290.535
258.158
223.737
187.902
151.246
114.217
77.1875
40.4768
3.9381
-30.48
-63.1498
-93.9003
-122.522
-148.848
-172.779
-194.293
-213.376
-230.036
-244.314
-256.254
-265.924
-219.34
-241.658
-261.157
-277.768
-291.736
-303.079
-311.886
-318.162
-321.985
-323.475
-322.868
-320.453
-316.561
-311.526
-305.649
-299.155
-292.172
-284.709
-276.648
-267.742
-257.667
-246.039
-232.462
-216.585
-198.138
-176.938
-152.887
-126.008
-96.4248
-64.3492
-30.0519
6.15701
44.272
82.9256
122.009
160.982
199.237
236.146
271.083
303.427
332.565
357.954
379.083
395.53
406.939
413.081
413.887
409.355
399.617
384.929
365.608
342.06
314.774
284.305
251.249
216.214
179.808
142.609
105.147
67.9013
31.2891
-4.33256
-38.695
-71.589
-102.87
-132.438
-160.22
-186.161
-210.227
-232.386
-252.621
-270.916
-287.276
-301.704
-314.213
-324.821
-333.542
-340.373
-345.3
-348.314
-349.375
-348.453
-345.51
-340.524
-333.431
-324.164
-312.685
-298.926
-282.812
-264.307
-243.366
-219.957
-194.093
-165.825
-135.281
-102.578
-67.9098
-31.6095
6.22398
46.3311
85.9322
125.383
164.36
202.474
239.159
273.818
305.873
334.802
360.043
381.122
397.672
409.361
415.951
417.294
413.354
404.232
390.141
371.379
348.33
321.503
291.474
258.802
224.092
187.991
151.097
113.858
76.631
39.7272
3.12552
-31.4225
-64.2023
-95.0355
-123.713
-150.067
-174.003
-195.506
-214.568
-231.2
-245.446
-257.349
-266.978
-220.209
-242.808
-262.429
-279.075
-293.032
-304.35
-313.12
-319.344
-323.091
-324.48
-323.749
-321.2
-317.175
-312.023
-306.058
-299.517
-292.535
-285.125
-277.164
-268.397
-258.484
-247.025
-233.609
-217.869
-199.528
-178.397
-154.375
-127.482
-97.8487
-65.6838
-31.2678
5.08488
43.4661
82.3328
121.671
160.932
199.497
236.729
271.995
304.663
334.11
359.782
381.155
397.796
409.338
415.546
416.349
411.748
401.876
387.001
367.446
343.626
316.042
285.261
251.891
216.553
179.864
142.409
104.724
67.2907
30.5259
-5.21106
-39.657
-72.6056
-103.919
-133.505
-161.294
-187.235
-211.295
-233.446
-253.669
-271.949
-288.294
-302.706
-315.2
-325.797
-334.511
-341.341
-346.273
-349.297
-350.371
-349.467
-346.548
-341.592
-334.531
-325.301
-313.861
-300.142
-284.067
-265.597
-244.683
-221.287
-195.421
-167.134
-136.548
-103.78
-69.0258
-32.628
5.31883
45.7597
85.5449
125.213
164.437
202.827
239.813
274.782
307.14
336.355
361.858
383.163
399.894
411.715
418.378
419.735
415.743
406.502
392.236
373.25
349.936
322.814
292.474
259.485
224.465
188.079
150.932
113.471
76.0393
38.93
2.2444
-32.4373
-65.3321
-96.2524
-124.987
-151.372
-175.311
-196.802
-215.842
-232.444
-246.655
-258.517
-268.103
-221.199
-244.063
-263.797
-280.471
-294.413
-305.703
-314.435
-320.604
-324.272
-325.551
-324.688
-321.993
-317.825
-312.546
-306.486
-299.894
-292.913
-285.559
-277.706
-269.088
-259.35
-248.075
-234.831
-219.239
-201.013
-179.956
-155.964
-129.057
-99.3692
-67.11
-32.5669
3.93191
42.6065
81.6944
121.306
160.872
199.767
237.344
272.96
305.975
335.753
361.726
383.361
400.21
411.895
418.173
418.974
414.297
404.283
389.207
369.402
345.292
317.39
286.275
252.569
216.906
179.916
142.189
104.267
66.6339
29.7077
-6.15145
-40.6848
-73.6904
-105.037
-134.641
-162.437
-188.377
-212.431
-234.573
-254.783
-273.048
-289.375
-303.77
-316.248
-326.832
-335.54
-342.369
-347.306
-350.34
-351.429
-350.543
-347.65
-342.726
-335.7
-326.508
-315.111
-301.435
-285.402
-266.97
-246.084
-222.703
-196.837
-168.528
-137.899
-105.063
-70.2167
-33.7167
4.34163
45.1554
85.1265
125.026
164.512
203.195
240.504
275.805
308.487
338.008
363.791
385.336
402.261
414.222
420.965
422.338
418.289
408.921
394.468
375.242
351.644
324.206
293.534
260.207
224.856
188.166
150.751
113.057
75.411
38.0843
1.29439
-33.5252
-66.5402
-97.552
-126.348
-152.763
-176.705
-198.181
-217.197
-233.767
-247.941
-259.761
-269.3
-222.317
-245.429
-265.264
-281.959
-295.88
-307.138
-315.832
-321.944
-325.529
-326.691
-325.684
-322.833
-318.51
-313.095
-306.932
-300.284
-293.303
-286.008
-278.272
-269.815
-260.266
-249.188
-236.13
-220.696
-202.593
-181.616
-157.655
-130.734
-100.988
-68.6295
-33.9506
2.69646
41.6928
81.0086
120.909
160.802
200.047
237.99
273.98
307.364
337.495
363.789
385.703
402.775
414.612
420.964
421.762
417.005
406.838
391.549
371.477
347.058
318.816
287.346
253.282
217.274
179.963
141.948
103.774
65.9293
28.8331
-7.15528
-41.7794
-74.8441
-106.225
-135.846
-163.649
-189.588
-213.635
-235.766
-255.963
-274.212
-290.52
-304.896
-317.358
-327.928
-336.628
-343.456
-348.399
-351.445
-352.549
-351.682
-348.816
-343.925
-336.937
-327.787
-316.435
-302.805
-286.816
-268.426
-247.571
-224.207
-198.34
-170.011
-139.336
-106.427
-71.4834
-34.8763
3.28868
44.5192
84.6751
124.818
164.584
203.578
241.23
276.885
309.914
339.761
365.841
387.642
404.774
416.886
423.714
425.102
420.993
411.489
396.838
377.355
353.454
325.681
294.655
260.967
225.262
188.249
150.552
112.615
74.7458
37.1877
0.274999
-34.6869
-67.8277
-98.9353
-127.794
-154.242
-178.185
-199.645
-218.634
-235.17
-249.304
-261.08
-270.569
-223.571
-246.908
-266.834
-283.54
-297.432
-308.657
-317.31
-323.365
-326.861
-327.898
-326.739
-323.719
-319.23
-313.668
-307.394
-300.684
-293.702
-286.472
-278.861
-270.576
-261.23
-250.365
-237.506
-222.242
-204.271
-183.378
-159.451
-132.514
-102.708
-70.2426
-35.4208
1.37716
40.7235
80.2728
120.481
160.719
200.336
238.668
275.053
308.829
339.334
365.971
388.183
405.491
417.489
423.922
424.716
419.871
409.544
394.027
373.671
348.923
320.32
288.472
254.029
217.655
180.003
141.682
103.244
65.1753
27.9004
-8.22378
-42.9424
-76.0674
-107.483
-137.122
-164.931
-190.867
-214.908
-237.028
-257.21
-275.441
-291.73
-306.085
-318.528
-329.084
-337.776
-344.603
-349.552
-352.61
-353.731
-352.884
-350.047
-345.191
-338.243
-329.137
-317.832
-304.252
-288.312
-269.965
-249.144
-225.798
-199.932
-171.581
-140.858
-107.873
-72.8263
-36.1066
2.15552
43.8523
84.1884
124.59
164.65
203.972
241.99
278.024
311.42
341.614
368.01
390.083
407.435
419.706
426.624
428.031
423.856
414.208
399.345
379.591
355.368
327.238
295.836
261.764
225.682
188.328
150.334
112.144
74.0448
36.2368
-0.814804
-35.9232
-69.1958
-100.404
-129.329
-155.809
-179.752
-201.193
-220.153
-236.653
-250.745
-262.473
-271.91
-224.967
-248.506
-268.508
-285.213
-299.071
-310.26
-318.871
-324.866
-328.271
-329.176
-327.853
-324.653
-319.984
-314.264
-307.87
-301.094
-294.111
-286.947
-279.47
-271.372
-262.244
-251.607
-238.96
-223.878
-206.047
-185.244
-161.354
-134.4
-104.531
-71.9509
-36.977
-0.0283412
39.6965
79.484
120.019
160.622
200.633
239.375
276.18
310.37
341.273
368.273
390.8
408.359
420.53
427.048
427.836
422.9
412.4
396.641
375.985
350.888
321.903
289.654
254.809
218.047
180.035
141.393
102.675
64.3708
26.9074
-9.35779
-44.1751
-77.3615
-108.812
-138.468
-166.282
-192.216
-216.248
-238.356
-258.523
-276.736
-293.003
-307.337
-319.759
-330.3
-338.983
-345.809
-350.765
-353.836
-354.974
-354.147
-351.341
-346.523
-339.617
-330.558
-319.304
-305.775
-289.888
-271.589
-250.804
-227.477
-201.614
-173.241
-142.467
-109.402
-74.2459
-37.4067
0.937468
43.1555
83.6634
124.338
164.709
204.378
242.784
279.22
313.007
343.567
370.298
392.66
410.246
422.686
429.699
431.125
426.88
417.081
401.991
381.95
357.386
328.876
297.076
262.597
226.116
188.4
150.094
111.643
73.3078
35.2297
-1.97638
-37.2346
-70.6455
-101.958
-130.952
-157.466
-181.406
-202.825
-221.755
-238.216
-252.264
-263.943
-273.323
-226.508
-250.229
-270.289
-286.982
-300.797
-311.945
-320.515
-326.451
-329.76
-330.524
-329.026
-325.633
-320.773
-314.883
-308.359
-301.51
-294.525
-287.433
-280.099
-272.2
-263.306
-252.913
-240.493
-225.604
-207.923
-187.215
-163.365
-136.394
-106.457
-73.7566
-38.6192
-1.51574
38.6033
78.6392
119.521
160.51
200.935
240.111
277.358
311.987
343.309
370.694
393.556
411.382
423.736
430.343
431.126
426.091
415.409
399.394
378.42
352.954
323.564
290.891
255.62
218.448
180.057
141.076
102.064
63.514
25.8529
-10.559
-45.4785
-78.7276
-110.212
-139.886
-167.704
-193.634
-217.657
-239.753
-259.903
-278.096
-294.341
-308.651
-321.052
-331.576
-340.249
-347.075
-352.038
-355.122
-356.278
-355.472
-352.698
-347.921
-341.06
-332.049
-320.849
-307.376
-291.544
-273.296
-252.55
-229.246
-203.387
-174.991
-144.165
-111.016
-75.7427
-38.7766
-0.367581
42.4283
83.0967
124.06
164.761
204.792
243.61
280.474
314.674
345.622
372.706
395.374
413.206
425.825
432.94
434.386
430.068
420.106
404.776
384.432
359.507
330.597
298.376
263.466
226.56
188.463
149.83
111.11
72.5341
34.1655
-3.21112
-38.6218
-72.1782
-103.6
-132.665
-159.215
-183.149
-204.543
-223.44
-239.86
-253.862
-265.488
-274.809
-228.197
-252.079
-272.178
-288.845
-302.608
-313.715
-322.243
-328.119
-331.33
-331.944
-330.26
-326.66
-321.595
-315.523
-308.859
-301.932
-294.943
-287.926
-280.745
-273.059
-264.416
-254.283
-242.106
-227.424
-209.901
-189.295
-165.487
-138.498
-108.488
-75.6618
-40.348
-3.05039
37.406
77.735
118.985
160.381
201.242
240.875
278.588
313.679
345.445
373.236
396.453
414.561
427.108
433.811
434.587
429.447
418.572
402.287
380.976
355.121
325.303
292.182
256.461
218.858
180.069
140.731
101.41
62.6024
24.7352
-11.8296
-46.8534
-80.1664
-111.684
-141.374
-169.197
-195.121
-219.135
-241.217
-261.351
-279.522
-295.743
-310.028
-322.406
-332.912
-341.575
-348.399
-353.37
-356.468
-357.644
-356.859
-354.119
-349.385
-342.57
-333.612
-322.468
-309.054
-293.282
-275.089
-254.384
-231.104
-205.252
-176.832
-145.952
-112.716
-77.3175
-40.2155
-1.75847
41.6672
82.4837
123.756
164.802
205.214
244.468
281.784
316.421
347.778
375.235
398.225
416.318
429.126
436.348
437.816
433.421
423.285
407.702
387.038
361.732
332.399
299.734
264.369
227.014
188.514
149.54
110.544
71.7243
33.0414
-4.52082
-40.0852
-73.7952
-105.332
-134.47
-161.055
-184.98
-206.346
-225.207
-241.585
-255.54
-267.11
-276.369
-230.039
-254.058
-274.178
-290.805
-304.506
-315.568
-324.056
-329.873
-332.982
-333.437
-331.555
-327.734
-322.449
-316.182
-309.369
-302.357
-295.362
-288.424
-281.406
-273.949
-265.574
-255.72
-243.802
-229.339
-211.983
-191.485
-167.721
-140.713
-110.628
-77.6677
-42.1649
-4.56019
36.0292
76.7685
118.41
160.233
201.553
241.666
279.868
315.447
347.68
375.9
399.491
417.897
430.65
437.452
438.22
432.969
421.89
405.319
383.654
357.388
327.12
293.526
257.332
219.274
180.066
140.356
100.712
61.6336
23.5524
-13.1716
-48.3014
-81.6789
-113.229
-142.934
-170.761
-196.679
-220.682
-242.75
-262.865
-281.014
-297.209
-311.467
-323.821
-334.307
-342.959
-349.782
-354.762
-357.875
-359.071
-358.307
-355.603
-350.914
-344.148
-335.245
-324.161
-310.809
-295.102
-276.967
-256.307
-233.052
-207.209
-178.766
-147.83
-114.504
-78.9714
-41.7208
-3.22587
40.8594
81.8192
123.423
164.832
205.64
245.354
283.152
318.249
350.036
377.886
401.216
419.583
432.591
439.925
441.417
436.94
426.621
410.772
389.77
364.063
334.282
301.151
265.305
227.475
188.552
149.223
109.944
70.882
31.8528
-5.9077
-41.6251
-75.4978
-107.153
-136.367
-162.99
-186.9
-208.235
-227.059
-243.391
-257.297
-268.809
-278.002
-232.038
-256.167
-276.291
-292.86
-306.49
-317.505
-325.954
-331.713
-334.719
-335.005
-332.912
-328.856
-323.336
-316.86
-309.886
-302.782
-295.779
-288.925
-282.081
-274.868
-266.779
-257.223
-245.58
-231.349
-214.172
-193.787
-170.07
-143.042
-112.879
-79.7769
-44.0732
-6.14498
34.5679
75.7395
117.795
160.065
201.866
242.482
281.2
317.289
350.014
378.686
402.671
421.393
434.362
441.27
442.029
436.658
425.364
408.494
386.454
359.757
329.014
294.923
258.231
219.696
180.048
139.947
99.9675
60.6067
22.3018
-14.5859
-49.8249
-83.2662
-114.848
-144.566
-172.396
-198.306
-222.298
-244.351
-264.447
-282.573
-298.739
-312.969
-325.296
-335.762
-344.402
-351.224
-356.213
-359.342
-360.559
-359.816
-357.15
-352.509
-345.795
-336.949
-325.927
-312.642
-297.003
-278.931
-258.319
-235.091
-209.261
-180.794
-149.799
-116.382
-80.7053
-43.2889
-4.74165
39.9722
81.0972
123.059
164.849
206.068
246.269
284.575
320.158
352.396
380.659
404.346
423.004
436.221
443.673
445.192
440.626
430.116
413.984
392.63
366.498
336.247
302.626
266.274
227.941
188.574
148.874
109.308
70.0088
30.5965
-7.37438
-43.2413
-77.2879
-109.067
-138.358
-165.02
-188.91
-210.21
-228.994
-245.28
-259.134
-270.585
-279.709
-234.203
-258.411
-278.519
-295.011
-308.559
-319.525
-327.938
-333.641
-336.542
-336.65
-334.333
-330.025
-324.254
-317.555
-310.409
-303.204
-296.193
-289.425
-282.767
-275.814
-268.032
-258.792
-247.442
-233.458
-216.468
-196.204
-172.537
-145.488
-115.242
-81.9919
-46.0773
-7.83114
33.0431
74.6472
117.136
159.874
202.178
243.322
282.579
319.205
352.448
381.594
405.995
425.05
438.248
445.266
446.015
440.518
428.997
411.811
389.379
362.227
330.985
296.371
259.156
220.12
180.011
139.504
99.1733
59.5195
20.9817
-16.0748
-51.4254
-84.9298
-116.54
-146.272
-174.103
-200.005
-223.983
-246.021
-266.097
-284.198
-300.335
-314.533
-326.832
-337.276
-345.903
-352.724
-357.724
-360.869
-362.108
-361.386
-358.759
-354.169
-347.509
-338.724
-327.768
-314.552
-298.986
-280.982
-260.42
-237.222
-211.408
-182.917
-151.861
-118.351
-82.5201
-44.9171
-6.19591
38.8908
80.3116
122.663
164.851
206.494
247.211
286.055
322.149
354.86
383.556
407.619
426.581
440.018
447.594
449.141
444.483
433.77
417.339
395.617
369.039
338.294
304.158
267.275
228.41
188.575
148.49
108.634
69.1061
29.271
-8.92372
-44.9334
-79.167
-111.074
-140.444
-167.148
-191.012
-212.271
-231.012
-247.25
-261.053
-272.439
-281.491
-236.532
-260.792
-280.864
-297.259
-310.711
-321.628
-330.01
-335.66
-338.454
-338.372
-335.817
-331.241
-325.203
-318.266
-310.935
-303.622
-296.598
-289.922
-283.462
-276.787
-269.331
-260.429
-249.39
-235.667
-218.875
-198.739
-175.125
-148.053
-117.719
-84.3154
-48.182
-9.62948
31.4625
73.4919
116.432
159.66
202.49
244.186
284.008
321.196
354.982
384.627
409.466
428.87
442.309
449.444
450.18
444.55
432.79
415.272
392.427
364.798
333.034
297.871
260.107
220.545
179.955
139.024
98.3277
58.37
19.5912
-17.6403
-53.104
-86.6706
-118.308
-148.05
-175.881
-201.773
-225.738
-247.759
-267.814
-285.889
-301.995
-316.16
-328.428
-338.848
-347.463
-354.282
-359.293
-362.456
-363.718
-363.015
-360.431
-355.896
-349.291
-340.569
-329.682
-316.539
-301.053
-283.119
-262.612
-239.445
-213.652
-185.136
-154.016
-120.414
-84.4173
-46.6067
-7.55937
37.5824
79.4597
122.233
164.836
206.917
248.177
287.591
324.222
357.427
386.577
411.034
430.316
443.984
451.689
453.267
448.512
437.583
420.84
398.733
371.686
340.421
305.749
268.307
228.88
188.554
148.068
107.921
68.182
27.8684
-10.5595
-46.7003
-81.1374
-113.177
-142.627
-169.376
-193.204
-214.419
-233.115
-249.302
-263.054
-274.372
-283.349
-239.025
-263.312
-283.328
-299.603
-312.947
-323.814
-332.169
-337.771
-340.459
-340.173
-337.367
-332.506
-326.182
-318.99
-311.462
-304.031
-296.994
-290.412
-284.162
-277.783
-270.677
-262.135
-251.426
-237.979
-221.394
-201.393
-177.835
-150.74
-120.315
-86.7499
-50.3901
-11.5308
29.8094
72.2716
115.681
159.419
202.796
245.07
285.482
323.259
357.613
387.784
413.082
432.855
446.549
453.806
454.527
448.756
436.744
418.878
395.601
367.472
335.159
299.42
261.08
220.967
179.875
138.503
97.4265
57.1532
18.1251
-19.2858
-54.8635
-88.4907
-120.151
-149.902
-177.733
-203.613
-227.563
-249.566
-269.6
-287.648
-303.719
-317.85
-330.085
-340.48
-349.079
-355.898
-360.922
-364.103
-365.391
-364.703
-362.165
-357.687
-351.141
-342.484
-331.67
-318.603
-303.202
-285.344
-264.896
-241.761
-215.995
-187.454
-156.268
-122.574
-86.3987
-48.3617
-8.83666
36.0465
78.5428
121.769
164.803
207.331
249.165
289.183
326.378
360.099
389.723
414.595
434.211
448.121
455.962
457.572
452.715
441.56
424.488
401.977
374.439
342.63
307.397
269.369
229.347
188.506
147.604
107.163
67.2428
26.3836
-12.286
-48.5404
-83.2016
-115.377
-144.908
-171.707
-195.489
-216.653
-235.302
-251.437
-265.138
-276.384
-285.283
-241.659
-265.978
-285.908
-302.04
-315.264
-326.08
-334.417
-339.975
-342.558
-342.055
-338.983
-333.818
-327.191
-319.728
-311.988
-304.43
-297.375
-290.891
-284.866
-278.802
-272.069
-263.91
-253.552
-240.395
-224.029
-204.171
-180.671
-153.551
-123.03
-89.2966
-52.7033
-13.5352
28.0825
70.9859
114.883
159.151
203.101
245.976
287.004
325.398
360.347
391.067
416.846
437.008
450.971
458.354
459.059
453.138
440.862
422.631
398.902
370.247
337.36
301.017
262.075
221.387
179.771
137.942
96.4713
55.8698
16.5836
-21.0107
-56.7038
-90.39
-122.068
-151.829
-179.656
-205.522
-229.457
-251.443
-271.454
-289.473
-305.509
-319.601
-331.803
-342.169
-350.754
-357.572
-362.609
-365.811
-367.125
-366.45
-363.959
-359.544
-353.058
-344.469
-333.731
-320.745
-305.434
-287.658
-267.272
-244.169
-218.438
-189.871
-158.615
-124.835
-88.4663
-50.1907
-10.176
34.4253
77.5667
121.269
164.751
207.732
250.175
290.83
328.617
362.876
392.996
418.301
438.269
452.431
460.412
462.057
457.093
445.701
428.283
405.354
377.299
344.919
309.102
270.46
229.809
188.427
147.093
106.359
66.2948
24.8133
-14.1086
-50.4504
-85.3625
-117.677
-147.288
-174.144
-197.866
-218.975
-237.573
-253.654
-267.305
-278.477
-287.294
-244.406
-268.803
-288.596
-304.572
-317.66
-328.428
-336.754
-342.276
-344.757
-344.021
-340.668
-335.18
-328.228
-320.477
-312.511
-304.814
-297.739
-291.355
-285.571
-279.842
-273.507
-265.756
-255.769
-242.919
-226.782
-207.075
-183.638
-156.491
-125.87
-91.9624
-55.1275
-15.651
26.2787
69.6285
114.031
158.851
203.395
246.899
288.57
327.608
363.18
394.477
420.76
441.33
455.576
463.092
463.777
457.698
445.145
426.531
402.328
373.127
339.638
302.664
263.09
221.801
179.64
137.334
95.4555
54.5139
14.9604
-22.8218
-58.6305
-92.3723
-124.064
-153.831
-181.655
-207.504
-231.422
-253.39
-273.377
-291.365
-307.364
-321.415
-333.58
-343.917
-352.485
-359.303
-364.356
-367.58
-368.922
-368.255
-365.816
-361.467
-355.042
-346.524
-335.867
-322.964
-307.749
-290.06
-269.742
-246.67
-220.984
-192.389
-161.059
-127.2
-90.6221
-52.1021
-11.6692
32.8036
76.5377
120.735
164.677
208.115
251.203
292.534
330.94
365.758
396.396
422.155
442.49
456.917
465.043
466.726
461.649
450.007
432.226
408.863
380.266
347.289
310.864
271.58
230.264
188.313
146.529
105.502
65.3559
23.144
-16.0337
-52.4259
-87.6239
-120.079
-149.768
-176.692
-200.335
-221.383
-239.928
-255.954
-269.558
-280.652
-289.383
-247.245
-271.799
-291.396
-307.197
-320.131
-330.855
-339.183
-344.676
-347.06
-346.072
-342.422
-336.589
-329.292
-321.234
-313.026
-305.179
-298.08
-291.802
-286.271
-280.9
-274.99
-267.673
-258.078
-245.552
-229.654
-210.106
-186.737
-159.56
-128.832
-94.7452
-57.6611
-17.8704
24.3904
68.1998
113.125
158.518
203.679
247.837
290.175
329.888
366.109
398.01
424.825
445.824
460.367
468.023
468.686
462.44
449.595
430.581
405.883
376.109
341.991
304.356
264.12
222.203
179.478
136.677
94.3776
53.085
13.2554
-24.7182
-60.641
-94.435
-126.134
-155.906
-183.726
-209.555
-233.456
-255.406
-275.37
-293.325
-309.283
-323.293
-335.417
-345.722
-354.272
-361.091
-366.161
-369.408
-370.783
-370.116
-367.732
-363.456
-357.094
-348.648
-338.075
-325.26
-310.148
-292.552
-272.306
-249.264
-223.636
-195.01
-163.6
-129.673
-92.8675
-54.1033
-13.3143
31.173
75.4596
120.164
164.582
208.474
252.247
294.293
333.349
368.746
399.925
426.158
446.879
461.58
469.857
471.578
466.386
454.479
436.318
412.506
383.34
349.738
312.683
272.728
230.708
188.16
145.908
104.584
64.443
21.3658
-18.0687
-54.4601
-89.9908
-122.585
-152.349
-179.353
-202.896
-223.878
-242.367
-258.336
-271.897
-282.909
-291.552
-250.168
-274.94
-294.323
-309.914
-322.676
-333.359
-341.703
-347.174
-349.466
-348.203
-344.25
-338.047
-330.383
-321.999
-313.533
-305.523
-298.392
-292.229
-286.964
-281.975
-276.518
-269.667
-260.488
-248.299
-232.648
-213.271
-189.973
-162.763
-131.927
-97.6516
-60.311
-20.2004
22.4165
66.6974
112.165
158.151
203.955
248.794
291.829
332.242
369.144
401.675
429.041
450.494
465.35
473.15
473.786
467.364
454.214
434.783
409.569
379.195
344.422
306.097
265.17
222.599
179.284
135.974
93.2392
51.5812
11.4656
-26.703
-62.7405
-96.5824
-128.281
-158.058
-185.872
-211.677
-235.562
-257.492
-277.432
-295.353
-311.268
-325.232
-337.314
-347.584
-356.116
-362.936
-368.023
-371.296
-372.708
-372.031
-369.71
-365.512
-359.214
-350.841
-340.358
-327.634
-312.63
-295.135
-274.967
-251.949
-226.396
-197.736
-166.24
-132.261
-95.2035
-56.1986
-15.1031
29.5176
74.3349
119.558
164.462
208.801
253.306
296.11
335.845
371.84
403.583
430.312
451.436
466.424
474.856
476.619
471.304
459.119
440.563
416.283
386.523
352.267
314.56
273.903
231.138
187.961
145.222
103.596
63.5766
19.469
-20.2227
-56.5432
-92.4694
-125.198
-155.031
-182.136
-205.549
-226.46
-244.892
-260.8
-274.325
-285.251
-293.802
-253.18
-278.212
-297.392
-312.712
-325.287
-335.934
-344.311
-349.774
-351.989
-350.428
-346.15
-339.554
-331.503
-322.773
-314.031
-305.841
-298.675
-292.636
-287.65
-283.066
-278.093
-271.736
-263
-251.174
-235.785
-216.579
-193.352
-166.106
-135.149
-100.681
-63.0793
-22.6425
20.3509
65.1151
111.142
157.742
204.21
249.756
293.514
334.66
372.27
405.465
433.409
455.336
470.524
478.476
479.081
472.474
459.003
439.136
413.383
382.386
346.929
307.882
266.229
222.974
179.046
135.21
92.0264
49.9912
9.58383
-28.7812
-64.9307
-98.8146
-130.502
-160.281
-188.089
-213.865
-237.732
-259.645
-279.561
-297.445
-313.316
-327.232
-339.268
-349.499
-358.012
-364.835
-369.942
-373.242
-374.701
-374.004
-371.748
-367.635
-361.401
-353.102
-342.714
-330.082
-315.197
-297.807
-277.726
-254.725
-229.269
-200.567
-168.976
-134.971
-97.6307
-58.3906
-17.013
27.8055
73.165
118.916
164.318
209.088
254.378
297.983
338.429
375.041
407.371
434.62
456.164
471.449
480.041
481.846
476.404
463.93
444.96
420.198
389.814
354.874
316.493
275.107
231.551
187.713
144.464
102.524
62.7924
17.4299
-22.5073
-58.6613
-95.0681
-127.921
-157.813
-185.046
-208.292
-229.13
-247.501
-263.345
-276.841
-287.678
-296.136
-256.305
-281.654
-300.608
-315.598
-327.951
-338.583
-347.013
-352.478
-354.637
-352.734
-348.118
-341.109
-332.646
-323.549
-314.513
-306.131
-298.92
-293.019
-288.323
-284.168
-279.708
-273.873
-265.603
-254.158
-239.038
-220.025
-196.879
-169.625
-138.534
-103.841
-65.9703
-25.2005
18.1872
63.4499
110.056
157.292
204.451
250.735
295.243
337.153
375.501
409.385
437.935
460.362
475.898
484.005
484.574
477.773
463.966
443.644
417.331
385.682
349.512
309.709
267.303
223.342
178.779
134.405
90.7607
48.3375
7.62688
-30.9396
-67.2038
-101.129
-132.797
-162.582
-190.386
-216.129
-239.979
-261.874
-281.761
-299.606
-315.431
-329.293
-341.28
-351.468
-359.961
-366.791
-371.922
-375.255
-376.818
-376.01
-373.839
-369.817
-363.65
-355.43
-345.141
-332.604
-317.843
-300.569
-280.58
-257.584
-232.254
-203.501
-171.806
-137.811
-100.148
-60.6828
-19.0582
26.0398
71.952
118.236
164.15
209.324
255.46
299.915
341.105
378.348
411.291
439.083
461.066
476.66
485.415
487.262
481.69
468.911
449.513
424.251
393.215
357.559
318.484
276.339
231.947
187.408
143.629
101.348
62.1286
15.2286
-24.9361
-60.7944
-97.7985
-130.758
-160.693
-188.094
-211.122
-231.886
-250.199
-265.972
-279.45
-290.19
-298.559
-259.71
-285.201
-303.895
-318.551
-330.647
-341.261
-349.764
-355.244
-357.358
-355.095
-350.163
-342.716
-333.812
-324.322
-314.974
-306.382
-299.119
-293.364
-288.967
-285.268
-281.356
-276.076
-268.288
-257.229
-242.378
-223.579
-200.529
-173.242
-142.068
-107.136
-68.9928
-27.889
15.9166
61.6886
108.896
156.79
204.663
251.713
297.003
339.708
378.828
413.437
442.614
465.568
481.472
489.745
490.271
483.265
469.105
448.312
421.418
389.091
352.18
311.596
268.402
223.702
178.478
133.547
89.4228
46.5945
5.56449
-33.2079
-69.5866
-103.547
-135.173
-164.963
-192.761
-218.46
-242.288
-264.159
-284.012
-301.812
-317.585
-331.389
-343.319
-353.455
-361.923
-368.754
-373.901
-377.256
-378.8
-377.988
-375.989
-372.085
-365.986
-357.848
-347.664
-335.218
-320.594
-303.451
-283.557
-260.54
-235.376
-206.545
-174.726
-140.784
-102.744
-63.0752
-21.2404
24.2122
70.6972
117.519
163.956
209.495
256.551
301.907
343.873
381.76
415.343
443.702
466.146
482.059
490.98
492.866
487.161
474.062
454.226
428.441
396.727
360.322
320.533
277.599
232.322
187.041
142.707
100.042
61.644
12.8279
-27.5263
-62.9143
-100.676
-133.711
-163.667
-191.29
-214.038
-234.731
-252.983
-268.678
-282.152
-292.789
-301.074
-263.116
-284.807
-299.658
-309.53
-315.881
-319.248
-319.445
-318.081
-317.179
-317.527
-319.302
-320.632
-320.212
-317.325
-312.257
-305.823
-299.241
-293.669
-289.576
-286.369
-283.047
-278.371
-271.107
-260.46
-245.871
-227.276
-204.316
-176.941
-145.641
-110.517
-72.1094
-30.6781
13.557
59.8482
107.677
156.248
204.857
252.698
298.792
342.327
382.244
417.61
447.444
470.95
487.244
495.691
496.159
488.943
474.416
453.134
425.633
392.603
354.921
313.515
269.49
224.015
178.106
132.608
87.9954
44.7575
3.40522
-35.5635
-72.0406
-106.009
-137.548
-167.283
-194.97
-220.43
-243.881
-265.084
-283.778
-299.67
-312.542
-322.344
-329.272
-333.612
-335.754
-336.32
-335.63
-334.069
-332.367
-330.513
-329.581
-328.846
-328.853
-328.899
-328.131
-325.658
-319.629
-306.445
-286.671
-263.642
-238.687
-209.852
-177.852
-143.943
-105.422
-65.561
-23.5488
22.3121
69.4046
116.764
163.739
209.586
257.65
303.96
346.739
385.278
419.53
448.481
471.405
487.649
496.737
498.66
492.818
479.387
459.1
432.773
400.351
363.161
322.64
278.89
232.678
186.605
141.695
98.5692
61.4032
10.1949
-30.2997
-64.9808
-103.72
-136.786
-166.732
-194.663
-217.037
-237.662
-255.846
-271.459
-284.947
-295.464
-303.689
-235.88
-217.963
-191.528
-169.484
-151.456
-134.121
-119.431
-110.484
-107.6
-112.044
-123.057
-139.321
-158.15
-176.822
-193.181
-205.888
-214.065
-218.331
-220.274
-221.419
-222.299
-223.541
-225.337
-226.767
-226.245
-221.107
-207.076
-181.01
-149.385
-114.065
-75.3357
-33.5519
11.1181
57.9242
106.396
155.664
205.036
253.703
300.632
345.029
385.774
421.929
452.445
476.527
493.23
501.851
502.237
494.811
479.902
458.111
429.982
396.214
357.734
315.473
270.589
224.322
177.714
131.643
86.5368
42.8855
1.21604
-37.9133
-74.4128
-108.239
-139.398
-168.368
-194.325
-215.714
-230.443
-235.013
-225.388
-202.046
-176.811
-152.5
-130.07
-110.046
-92.6779
-78.2216
-67.1735
-60.3677
-57.6989
-59.5205
-64.797
-73.896
-87.4585
-105.394
-127.901
-155.369
-186.544
-218.201
-237.255
-236.978
-230.963
-213.019
-181.011
-147.379
-108.423
-68.1953
-26.038
20.3323
68.0948
115.974
163.501
209.575
258.758
306.075
349.705
388.898
423.851
453.422
476.849
493.432
502.69
504.646
498.661
484.882
464.139
437.248
404.088
366.076
324.807
280.215
233.012
186.091
140.585
96.8785
61.4986
7.28309
-33.2817
-66.9587
-106.977
-139.985
-169.856
-198.151
-220.077
-240.666
-258.779
-274.318
-286.408
-270.393
-248.923
-60.6086
-37.244
-25.2275
-17.0158
-12.1347
-8.00492
-5.22747
-3.8145
-3.31049
-3.61888
-4.47535
-6.04953
-8.58962
-12.3833
-17.4989
-23.6744
-30.0453
-35.5327
-39.5519
-42.1858
-44.7825
-48.9428
-56.377
-68.3206
-85.2904
-106.743
-129.099
-139.999
-135.134
-115.689
-78.968
-36.6051
8.57297
55.9196
105.043
155.019
205.171
254.698
302.494
347.789
389.398
426.383
457.612
482.303
499.436
508.245
508.538
500.887
485.577
463.258
434.478
399.95
360.644
317.498
271.721
224.632
177.301
130.649
85.0475
41.0101
-0.88598
-39.9269
-75.8033
-107.435
-132.157
-144.686
-135.867
-112.616
-86.7222
-61.5119
-40.4264
-27.0053
-17.6795
-11.0293
-6.45546
-3.50624
-1.76541
-0.865737
-0.609241
-0.59723
-0.581251
-0.556354
-0.595647
-0.711999
-0.904916
-1.23861
-1.91806
-3.33157
-6.31918
-13.4932
-32.4458
-64.1198
-100.233
-137.509
-149.999
-139.272
-111.283
-70.9044
-28.9384
18.1189
66.7442
115.147
163.258
209.442
259.879
308.255
352.778
392.618
428.309
458.528
482.479
499.413
508.842
510.827
504.688
490.55
469.348
441.864
407.94
369.069
327.032
281.577
233.325
185.49
139.38
94.9018
62.054
3.97607
-36.5058
-68.7484
-110.344
-143.246
-172.958
-174.192
-130.777
-92.5839
-59.2137
-29.9605
-6.0399
0.213308
0.368578
-0.0773219
0.0150976
-0.108389
-0.194987
0.0287202
0.0297736
0.0269799
0.0237994
0.0145693
-0.00295409
-0.0272768
-0.0611322
-0.109749
-0.178829
-0.268342
-0.374487
-0.487977
-0.59203
-0.666388
-0.703607
-0.740434
-0.819192
-1.00449
-1.42247
-2.34106
-4.45778
-9.60117
-21.9435
-40.1358
-57.1948
-56.1275
-34.0851
5.63884
53.759
103.613
154.331
205.274
255.686
304.378
350.606
393.105
430.961
462.931
488.264
505.855
514.868
515.028
507.158
491.428
468.562
439.108
403.779
363.616
319.539
272.83
224.883
176.812
129.609
83.6016
39.4451
-1.67172
-36.3359
-57.7029
-56.0514
-44.2849
-29.6042
-16.7152
-8.68037
-3.4909
-0.743928
0.0652266
0.0569902
0.0534182
0.043739
0.0394543
0.037727
0.038118
0.0395861
0.0387848
0.0355072
0.0302213
0.0260944
0.0206541
0.0122996
0.00227436
-0.00792225
-0.0225562
-0.045278
-0.0742385
-0.124065
-0.240188
-0.566506
-1.58029
-5.73438
-20.9826
-45.1987
-65.4595
-57.1484
-30.0278
15.97
64.9692
114.06
162.96
209.159
261.028
310.505
355.965
396.433
432.906
463.801
488.3
505.593
515.195
517.199
510.902
496.386
474.735
446.621
411.91
372.144
329.316
282.983
233.626
184.798
138.059
92.4854
63.0328
0.324436
-39.8905
-69.2987
-72.0642
-42.917
-15.1549
0.226593
1.65815
2.23298
2.44521
2.44216
2.25024
1.88423
1.52945
0.335011
0.0985456
0.0828642
0.118836
0.120027
0.0750584
0.0745078
0.0755771
0.0690811
0.0586929
0.0486286
0.0396966
0.0317816
0.0248753
0.019539
0.0158458
0.0144783
0.0157283
0.0201866
0.0273813
0.0360195
0.0451808
0.054288
0.0637451
0.0707005
0.0762299
0.0866114
0.110245
0.157177
0.318538
1.04762
4.60733
20.2683
55.1506
101.841
153.546
205.337
256.67
306.281
353.492
396.904
435.671
468.403
494.415
512.488
521.72
521.681
513.604
497.432
473.995
443.843
407.669
366.628
321.58
273.894
225.068
176.284
128.69
83.0542
42.8255
17.1826
5.51933
0.556746
0.0911383
0.0678384
0.048002
0.0736754
0.0591003
0.051054
0.041264
0.0650957
0.0573321
0.0526781
0.0494867
0.0475749
0.0467519
0.0470543
0.0472792
0.0453116
0.0419311
0.0378284
0.0318177
0.0258191
0.0187981
0.0101721
0.000721487
-0.00993183
-0.0229193
-0.0364395
-0.0570023
-0.0843437
-0.115274
-0.145194
-0.181679
-0.243437
-0.289442
-0.270134
-0.0332395
3.36936
25.4337
64.315
113.16
162.368
208.437
262.164
312.831
359.28
400.337
437.644
469.245
494.316
511.976
521.751
523.76
517.294
502.394
480.304
451.508
416.001
375.307
331.658
284.451
233.899
183.932
136.739
89.7256
65.2115
4.22359
3.0407
3.55406
3.39586
3.19359
3.2193
3.09577
2.80064
2.66471
2.45438
2.32705
2.13438
1.81005
1.50689
0.291143
0.107398
0.0804642
0.114709
0.11206
0.0692505
0.0718738
0.0732249
0.0665295
0.0567485
0.0468631
0.038157
0.0305069
0.0238963
0.0188377
0.0154874
0.0143228
0.0155467
0.0196742
0.0262869
0.034261
0.04278
0.0511875
0.0595427
0.0659105
0.0716887
0.0816603
0.102153
0.146026
0.298574
0.983229
4.27422
19.1706
53.5364
100.2
152.496
205.223
257.641
308.183
356.432
400.79
440.513
474.023
500.754
519.334
528.816
528.516
520.228
503.587
479.548
448.669
411.609
369.645
323.55
274.834
225.102
175.472
127.145
81.123
41.0787
16.2232
5.15071
0.467095
0.0837621
0.0607515
0.0452349
0.066575
0.0561691
0.0490691
0.0419536
0.0594725
0.054188
0.0504047
0.047465
0.0456258
0.0447442
0.0448062
0.0448212
0.0429511
0.0397777
0.0347218
0.0304006
0.0248789
0.0182359
0.00999565
0.00112898
-0.00896624
-0.0216601
-0.035614
-0.056139
-0.0816391
-0.111436
-0.14014
-0.174814
-0.227789
-0.266741
-0.294619
-0.0452045
2.6444
23.0276
64.5706
114.158
162.635
207.267
262.929
315.151
362.706
404.321
442.531
474.864
500.531
518.566
528.512
530.505
523.86
508.57
486.061
456.513
420.219
378.591
334.035
285.914
234.22
183.167
134.822
82.0198
42.1809
9.17776
4.65858
3.22277
3.22464
3.07611
3.05039
2.90893
2.66812
2.53246
2.34093
2.21116
2.02533
1.73549
1.47523
0.281003
0.108729
0.0688139
0.0858227
0.0933063
0.0676199
0.0697856
0.0710789
0.0640549
0.0545347
0.0450425
0.0365751
0.02916
0.0227607
0.0177576
0.0144253
0.0132502
0.0143997
0.0182595
0.0244183
0.0318596
0.0397805
0.0475366
0.0548308
0.0599004
0.0635214
0.067753
0.0724077
0.0747688
0.082346
0.127851
0.310853
1.23829
6.77001
37.7484
110.415
190.683
256.821
310.118
359.474
404.784
445.515
479.818
507.305
526.412
536.157
535.529
527.041
509.889
485.207
453.539
415.475
372.483
325.145
274.387
217.673
144.271
69.7235
24.2735
4.29744
0.153374
0.102049
0.0609088
0.0650809
0.0535305
0.0447882
0.0605766
0.0528709
0.0468998
0.0420551
0.0550558
0.0511632
0.0478502
0.0451805
0.0434891
0.0426698
0.0426222
0.042512
0.0407318
0.0377643
0.0333683
0.0288369
0.0234998
0.0171605
0.00946056
0.00100238
-0.0087781
-0.0207552
-0.0337385
-0.0530279
-0.0772941
-0.105109
-0.133948
-0.16725
-0.220987
-0.263844
-0.320192
-0.37847
-0.410478
-0.136483
5.02448
47.6669
132.613
203.281
264.119
317.516
366.05
408.29
447.557
480.658
506.949
525.368
535.48
537.404
530.599
514.915
492.006
461.638
424.56
381.884
336.472
287.645
233.972
157.985
68.9405
12.8341
4.21073
3.19772
3.07788
3.05503
3.0464
2.91689
2.88486
2.75443
2.53867
2.4035
2.22693
2.0962
1.91849
1.65929
1.43507
0.376428
0.126772
0.0626235
0.0692118
0.0773175
0.064671
0.0685498
0.0693052
0.0617365
0.0524035
0.0432488
0.0350628
0.0279393
0.0218432
0.0170734
0.0139157
0.0128204
0.0139264
0.0175688
0.0233018
0.030227
0.0376091
0.0448652
0.0515846
0.0563939
0.0598383
0.0634044
0.0664124
0.0657234
0.0631691
0.0658863
0.0743637
0.11583
0.358388
1.79283
11.871
70.8609
185.403
290.034
361.013
408.915
450.684
485.782
514.075
533.731
543.781
542.835
534.107
516.35
490.888
458.233
418.766
373.111
314.724
218.952
105.11
33.4569
4.03385
0.143129
0.0423502
0.0890227
0.0798862
0.057322
0.0599537
0.0503944
0.044339
0.0557735
0.0499329
0.0446951
0.0412655
0.0511256
0.0482875
0.0453929
0.0429522
0.0413664
0.0405772
0.0404195
0.040179
0.0385112
0.0357609
0.0319505
0.0274042
0.0223498
0.0163458
0.0090168
0.000967526
-0.00836048
-0.0198017
-0.0324006
-0.0507824
-0.0739439
-0.0997562
-0.127063
-0.160285
-0.207776
-0.250774
-0.305486
-0.370833
-0.429117
-0.496788
-0.521993
-0.0935522
8.40329
91.5772
216.975
311.059
370.293
412.358
452.581
486.548
513.564
532.383
542.657
544.452
537.499
521.435
498.127
466.82
429.034
385.684
338.44
255.43
113.206
19.3687
4.00433
3.05436
2.92991
2.96339
2.90108
2.88769
2.87462
2.76321
2.72252
2.60135
2.40732
2.27466
2.1115
1.98206
1.8133
1.58135
1.38755
0.22808
0.102708
0.0578421
0.0583046
0.0672471
0.0608513
0.0668618
0.0675974
0.0593724
0.0501747
0.0413724
0.0334429
0.0266438
0.0208818
0.0163882
0.0134295
0.0124167
0.0134558
0.0168632
0.0221685
0.0285689
0.0354109
0.0421501
0.0483379
0.0529237
0.0562612
0.0594697
0.0619292
0.0611517
0.0585717
0.0584769
0.0567138
0.0507817
0.0538718
0.114371
0.503067
3.12759
22.5191
120.883
269.977
384.112
452.852
491.725
520.827
541.064
551.484
550.112
541.087
522.46
495.63
459.475
405.45
300.604
155.207
49.9896
5.76708
0.160559
0.0526524
0.0613438
0.0297744
0.0764632
0.0720948
0.0554935
0.0556375
0.0478065
0.0432998
0.051559
0.0470366
0.0424501
0.0399977
0.0474835
0.0454121
0.0428903
0.0406657
0.0391855
0.0384215
0.038187
0.0378631
0.036289
0.0337386
0.0302364
0.0259057
0.0211086
0.0154268
0.00857368
0.000972422
-0.00792942
-0.0187255
-0.0307385
-0.0481122
-0.0698855
-0.094218
-0.120645
-0.152493
-0.19669
-0.236823
-0.289127
-0.347013
-0.407716
-0.4755
-0.553522
-0.622755
-0.64404
0.441
18.2952
143.143
313.315
405.167
458.099
492.879
520.39
539.613
550.052
551.563
544.51
528.088
504.483
472.254
433.126
348.594
175.593
34.1372
5.01796
2.78572
2.81415
2.82979
2.77267
2.79125
2.73785
2.7217
2.70525
2.60739
2.56177
2.4492
2.27452
2.1461
1.99497
1.86849
1.70928
1.50166
1.33367
0.0824544
0.0839331
0.053244
0.0504016
0.0613228
0.0580851
0.0651301
0.0656336
0.0567944
0.0477243
0.039265
0.0317059
0.0252578
0.0198388
0.0156345
0.0128915
0.0119578
0.012942
0.0160774
0.0209647
0.0268637
0.0331868
0.039421
0.0451079
0.0493949
0.0525473
0.05543
0.0574998
0.056871
0.0547789
0.0540646
0.0513963
0.0437963
0.0354765
0.0286129
0.0352398
0.132336
0.825853
5.67444
38.3213
166.199
326.934
442.81
506.407
539.978
554.153
552.637
541.636
514.618
460.818
348.881
196.101
71.3073
10.942
0.19221
0.0523971
0.0493663
0.0306972
0.0493213
0.0316667
0.0679411
0.0654911
0.0533694
0.05199
0.0452675
0.0417396
0.0476695
0.0441352
0.0402033
0.0384278
0.044061
0.0425326
0.0403436
0.0383368
0.0369675
0.0362357
0.0359421
0.0355516
0.0340745
0.0317164
0.0284755
0.0243914
0.0198664
0.0145166
0.00806516
0.000885049
-0.00755856
-0.0177626
-0.0291823
-0.0455493
-0.0660925
-0.0886495
-0.113736
-0.144071
-0.184792
-0.223617
-0.272398
-0.327325
-0.383008
-0.447432
-0.518087
-0.594845
-0.648907
-0.683826
-0.670027
0.411252
27.1499
185.08
366.315
475.843
520.073
546.178
557.713
558.898
551.838
535.002
506.726
402.323
217.349
46.5201
8.55958
2.40849
2.37706
2.5139
2.6201
2.64924
2.60666
2.62017
2.57454
2.55697
2.5379
2.45156
2.40282
2.29811
2.1406
2.01756
1.87755
1.75536
1.60607
1.42023
1.27427
0.0439729
0.0768042
0.053133
0.0451467
0.0574826
0.0567023
0.0636045
0.0633607
0.0540509
0.0451684
0.0370912
0.0299117
0.0238334
0.0187591
0.0148407
0.0123049
0.0114481
0.0123718
0.0152494
0.0197416
0.0251578
0.0309758
0.0367124
0.0419301
0.0459265
0.0488725
0.0514453
0.0531586
0.0525669
0.0506786
0.0495845
0.0467819
0.0399608
0.0317179
0.0219455
0.0110455
-0.00124158
0.0155417
0.177032
1.26199
7.95509
42.8844
153.636
287.411
381.246
422.266
420.517
375.783
285.864
169.147
72.7142
14.2642
0.17629
0.0268626
0.0313086
0.0178953
0.0347467
0.0296972
0.043066
0.0327766
0.0609523
0.0599338
0.0507244
0.0484607
0.0426505
0.0398782
0.0440917
0.0412061
0.0378691
0.0365833
0.0408362
0.0396969
0.0377923
0.0359863
0.0347254
0.0340269
0.033693
0.0332585
0.031872
0.0296923
0.0267069
0.0228823
0.0186344
0.0136155
0.00759477
0.00084957
-0.00711664
-0.016695
-0.0275546
-0.0429282
-0.0621344
-0.0832274
-0.106972
-0.135718
-0.173294
-0.209879
-0.25569
-0.306217
-0.35968
-0.419095
-0.486088
-0.55298
-0.610749
-0.646973
-0.736185
-0.820112
-0.7637
0.275254
13.448
120.877
274.804
389.113
451.221
451.087
398.021
292.493
143.279
37.4894
8.90824
1.8664
1.98741
2.12891
2.20032
2.34184
2.44508
2.47222
2.44084
2.44995
2.41121
2.39313
2.3718
2.2955
2.2451
2.14795
2.0058
1.88899
1.75941
1.64254
1.50337
1.33712
1.21005
0.0401978
0.0661864
0.0526316
0.0420211
0.0528993
0.0554369
0.0618164
0.0606601
0.0511188
0.0425254
0.0348577
0.0280832
0.0223805
0.0176493
0.0140118
0.0116717
0.0108843
0.0117427
0.014373
0.018489
0.0234466
0.0287754
0.0340351
0.0388016
0.0424958
0.0452311
0.0475086
0.0489127
0.0483132
0.0465617
0.0452073
0.0422901
0.0359589
0.0281004
0.0188583
0.00842327
-0.00679862
-0.0198531
-0.0371471
-0.0200857
0.16265
1.20437
5.99372
22.4653
54.5234
84.9324
87.2956
65.9826
31.0276
4.6102
0.226803
0.0539591
-0.0173504
-0.0335714
0.0114276
0.0159276
0.028577
0.0292089
0.038284
0.033062
0.0549056
0.0547358
0.0476987
0.0450511
0.0399993
0.0377264
0.0406744
0.0383222
0.0354922
0.0345355
0.0377408
0.0368797
0.0352267
0.0336075
0.0324499
0.0317866
0.0314269
0.0309666
0.0296756
0.0276654
0.0248939
0.0213494
0.0173807
0.012694
0.00708619
0.000778264
-0.0067048
-0.0156627
-0.0258857
-0.0402435
-0.058133
-0.0777222
-0.1001
-0.12711
-0.161775
-0.196295
-0.238943
-0.285943
-0.335785
-0.391473
-0.452593
-0.515271
-0.568261
-0.60607
-0.684997
-0.767146
-0.758269
-0.72459
-0.741814
-0.642597
-0.483194
-0.176208
1.06044
9.44504
16.626
10.9214
1.01056
1.09318
1.36625
1.59212
1.80304
1.97197
2.04975
2.17785
2.27261
2.29817
2.27601
2.28069
2.24751
2.22947
2.2068
2.13902
2.08847
1.99857
1.87031
1.76036
1.64069
1.52994
1.40094
1.2524
1.14165
0.0382103
0.0521154
0.0475057
0.0480313
0.0547276
0.0567811
0.0604422
0.0574081
0.0479938
0.0398021
0.0325722
0.0262231
0.0208959
0.0165044
0.0131419
0.0109895
0.0102658
0.0110559
0.0134634
0.0172134
0.0217413
0.0266048
0.0314016
0.0357361
0.039117
0.0416201
0.0436099
0.0447367
0.0441309
0.0424754
0.0409248
0.0379206
0.0320126
0.0246548
0.0159798
0.00603088
-0.00805713
-0.0212492
-0.0408786
-0.0584935
-0.0824654
-0.104058
-0.12595
-0.142458
-0.152341
-0.155884
-0.143524
0.0701663
0.109274
-0.0317858
-0.0921206
-0.095059
-0.0424333
-0.0326873
0.00553976
0.0156553
0.0244646
0.0281045
0.0344395
0.0323494
0.0494349
0.0498917
0.044462
0.0416536
0.037294
0.0353969
0.0373925
0.0354619
0.0330763
0.0323428
0.0347536
0.0340906
0.0326571
0.0312117
0.0301548
0.0295301
0.0291567
0.0286816
0.0274829
0.0256349
0.0230855
0.0198115
0.0161276
0.011776
0.00658269
0.000710923
-0.00626871
-0.014604
-0.0242038
-0.0375473
-0.0541284
-0.0722633
-0.0931863
-0.11843
-0.150222
-0.182596
-0.222122
-0.265617
-0.31219
-0.363478
-0.419845
-0.477019
-0.527475
-0.563547
-0.636481
-0.70419
-0.702568
-0.678862
-0.692311
-0.597145
-0.482275
-0.38807
-0.287402
-0.108653
0.143967
0.429564
0.716703
0.951905
1.23189
1.47053
1.66336
1.82037
1.8984
2.01471
2.1015
2.12555
2.11113
2.11218
2.0836
2.06583
2.04271
1.98231
1.93273
1.84988
1.73429
1.63162
1.52148
1.41746
1.29863
1.16616
1.06959
0.036653
0.0458956
0.0407019
0.0457863
0.0584886
0.067154
0.0591661
0.0535835
0.044702
0.037005
0.0302378
0.0243583
0.0193803
0.0153255
0.012233
0.0102643
0.00960067
0.0103245
0.0125144
0.0159132
0.020028
0.0244481
0.0287999
0.0327101
0.0357686
0.0380287
0.0397461
0.0406265
0.0400132
0.0384249
0.0367212
0.0336962
0.0281929
0.0212675
0.0130785
0.00367793
-0.00897522
-0.0214636
-0.0390217
-0.0555874
-0.0768214
-0.0969607
-0.117789
-0.134727
-0.145006
-0.147451
-0.142615
-0.136744
-0.129412
-0.118442
-0.100879
-0.0887282
-0.0431909
-0.0280989
0.00213992
0.0151484
0.0213436
0.0263445
0.0310528
0.0310279
0.0444704
0.0452802
0.0410701
0.0382974
0.0345228
0.0329314
0.034243
0.0326144
0.030605
0.0300428
0.0318442
0.031323
0.0300807
0.0287953
0.0278357
0.0272499
0.0268734
0.0263968
0.0252892
0.0235996
0.0212641
0.0182642
0.0148659
0.0108496
0.00606683
0.000638095
-0.00583416
-0.0135395
-0.0224777
-0.0348056
-0.0500665
-0.0667906
-0.0862381
-0.109665
-0.138742
-0.168827
-0.205264
-0.245215
-0.288415
-0.335653
-0.387313
-0.439712
-0.4864
-0.521508
-0.586905
-0.645769
-0.644727
-0.62289
-0.63012
-0.547922
-0.44594
-0.359303
-0.264612
-0.0973614
0.131567
0.391374
0.661589
0.874479
1.12846
1.34842
1.52819
1.67052
1.74818
1.85191
1.9316
1.95431
1.94592
1.94426
1.91955
1.90233
1.87937
1.8255
1.77774
1.70177
1.59784
1.50277
1.40187
1.30506
1.1963
1.07849
0.99433
0.0340537
0.0407312
0.036816
0.04154
0.0530361
0.0570113
0.0529916
0.0493632
0.0412683
0.0341281
0.0278497
0.0224157
0.0178332
0.0141139
0.0112884
0.00949805
0.00889469
0.00955467
0.011534
0.014594
0.0183077
0.0222913
0.0262075
0.029705
0.0324424
0.0344503
0.0359032
0.0365525
0.0359017
0.0343681
0.0325804
0.0295943
0.024453
0.017967
0.0103485
0.00152234
-0.0100044
-0.0216672
-0.0372175
-0.0525236
-0.0714332
-0.0897888
-0.10847
-0.123912
-0.133804
-0.136843
-0.13219
-0.127891
-0.121255
-0.108666
-0.0927486
-0.0785627
-0.0415947
-0.0239985
-0.000217911
0.014204
0.0187538
0.0242834
0.028043
0.0291915
0.0398413
0.0408759
0.0375826
0.0349683
0.0317125
0.0303424
0.0311617
0.0297498
0.0280703
0.0276661
0.0289951
0.0285764
0.0275025
0.026365
0.0254986
0.0249533
0.0245823
0.0241198
0.0231014
0.0215676
0.0194391
0.0167086
0.0135988
0.00991995
0.00554628
0.0005607
-0.00539116
-0.0124684
-0.020732
-0.0320366
-0.0459979
-0.0613099
-0.0792419
-0.100801
-0.127244
-0.155035
-0.188368
-0.224929
-0.264606
-0.307766
-0.354751
-0.402561
-0.445538
-0.478846
-0.536431
-0.588088
-0.588955
-0.570218
-0.572995
-0.498705
-0.407917
-0.326154
-0.235906
-0.0824253
0.122219
0.35517
0.600288
0.798298
1.02806
1.22848
1.39424
1.52256
1.59918
1.69033
1.76287
1.78408
1.78068
1.7768
1.75542
1.73896
1.71667
1.66865
1.62339
1.55416
1.46108
1.37381
1.28192
1.19266
1.09387
0.989503
0.916289
0.0309128
0.0360322
0.0326267
0.0366483
0.044562
0.0423195
0.0467832
0.0448091
0.0376986
0.0311714
0.0254106
0.0204358
0.0162523
0.0128697
0.010308
0.00869139
0.00814823
0.00874112
0.0105158
0.0132482
0.0165716
0.0201247
0.0236091
0.0267041
0.0291204
0.0308706
0.0320683
0.0325078
0.0318127
0.030299
0.0284422
0.0254971
0.020718
0.0147174
0.00767785
-0.00050632
-0.0108828
-0.0216798
-0.0354872
-0.0493648
-0.0659896
-0.0823083
-0.0987152
-0.112243
-0.120901
-0.123552
-0.119521
-0.115589
-0.109275
-0.0976009
-0.0837181
-0.0693372
-0.039067
-0.0202968
-0.00207712
0.0127755
0.0166047
0.0220785
0.0251903
0.0269947
0.0354859
0.0366258
0.0340502
0.0316636
0.0288675
0.0276456
0.0281019
0.0268915
0.0255188
0.0252163
0.0261896
0.0258459
0.0249194
0.0239184
0.0231418
0.0226424
0.022285
0.0218439
0.0209192
0.0195357
0.0176106
0.0151467
0.0123261
0.00898545
0.00501906
0.000481302
-0.00494567
-0.0113883
-0.0189568
-0.0292414
-0.0419025
-0.0558263
-0.0722099
-0.0918861
-0.115761
-0.141172
-0.171441
-0.204595
-0.240784
-0.279905
-0.322394
-0.365566
-0.404855
-0.435959
-0.486718
-0.531409
-0.533175
-0.517239
-0.516526
-0.450708
-0.370514
-0.295315
-0.210632
-0.0710552
0.112283
0.321904
0.542475
0.723087
0.929281
1.1098
1.26066
1.37636
1.44984
1.52995
1.59525
1.61482
1.6143
1.60971
1.59123
1.57572
1.5545
1.51182
1.46958
1.40697
1.32406
1.24472
1.16168
1.08025
0.991259
0.899305
0.835823
0.0277252
0.0312064
0.0200376
0.0275378
0.0259198
0.0328598
0.0417365
0.0401624
0.0340363
0.028149
0.0229238
0.0184171
0.0146346
0.0115936
0.00929716
0.00785139
0.00736506
0.00788822
0.00946058
0.0118751
0.0148149
0.0179485
0.0210108
0.0237128
0.0258062
0.0272925
0.0282405
0.0284811
0.0277336
0.0262305
0.0243321
0.0214329
0.0169728
0.0114069
0.00493691
-0.00254121
-0.0117803
-0.0215927
-0.0337088
-0.0461112
-0.0605813
-0.074782
-0.0888578
-0.100401
-0.107732
-0.109892
-0.106613
-0.102963
-0.0971802
-0.0868146
-0.0747094
-0.0608261
-0.0358465
-0.017292
-0.00313849
0.0112533
0.0146683
0.0197275
0.0224373
0.0245495
0.0313507
0.032508
0.0305019
0.0283706
0.0259834
0.0248886
0.025086
0.0240684
0.0229352
0.0226915
0.0234176
0.0231305
0.0223349
0.0214605
0.0207712
0.0203181
0.0199814
0.0195644
0.0187392
0.0174996
0.0157778
0.013579
0.0110488
0.00804799
0.00448763
0.00039952
-0.00449479
-0.0103026
-0.0171602
-0.0264191
-0.0377922
-0.0503284
-0.0651441
-0.0829042
-0.10428
-0.12728
-0.154489
-0.18429
-0.216915
-0.252058
-0.290096
-0.328806
-0.36423
-0.39291
-0.4371
-0.475811
-0.478111
-0.464773
-0.461393
-0.403139
-0.332499
-0.2639
-0.185914
-0.0614965
0.101953
0.288354
0.485103
0.648064
0.831424
0.99247
1.12823
1.23162
1.30043
1.37054
1.42864
1.44676
1.4459
1.44293
1.42702
1.41261
1.39277
1.35505
1.31622
1.26014
1.18685
1.11553
1.04121
0.967779
0.888439
0.80801
0.753251
0.0245122
0.0264503
0.0104856
0.0285423
0.0195031
0.0282281
0.0368178
0.03552
0.0302865
0.0250562
0.0203866
0.0163615
0.0129869
0.0102923
0.00826085
0.00698629
0.00655585
0.00701154
0.00838477
0.0104874
0.0130501
0.0157719
0.0184206
0.0207381
0.0225133
0.0237361
0.0244401
0.0244925
0.0236799
0.0221794
0.0202584
0.017438
0.0132942
0.00816453
0.00221478
-0.00460369
-0.0127945
-0.021493
-0.032022
-0.0428629
-0.0551813
-0.0672933
-0.079093
-0.088676
-0.0946709
-0.0963284
-0.0936311
-0.0903453
-0.0851767
-0.0761302
-0.065622
-0.0527635
-0.0321926
-0.0147829
-0.00352758
0.0096413
0.0128372
0.0173546
0.0197571
0.0219368
0.0273922
0.0285031
0.0269492
0.0250868
0.0230642
0.0220624
0.0220979
0.0212675
0.0203141
0.0201241
0.0206686
0.0204262
0.0197475
0.0189916
0.0183868
0.0179794
0.0176702
0.0172847
0.0165562
0.0154596
0.0139437
0.0120063
0.00976676
0.00710593
0.00395085
0.000315377
-0.00404209
-0.00921091
-0.015343
-0.0235786
-0.0336704
-0.044825
-0.058048
-0.073881
-0.0928011
-0.113347
-0.137517
-0.163987
-0.193045
-0.224229
-0.257898
-0.292164
-0.323755
-0.349642
-0.387852
-0.420895
-0.423539
-0.412278
-0.407246
-0.356252
-0.294653
-0.233066
-0.162341
-0.0523991
0.0912543
0.255106
0.428306
0.573188
0.734405
0.876265
0.996816
1.08811
1.15107
1.21193
1.26292
1.27967
1.27805
1.27647
1.26281
1.24964
1.23142
1.19835
1.16324
1.11361
1.04949
0.986229
0.920522
0.855243
0.785388
0.715731
0.668863
0.0212762
0.022334
0.00775042
0.0272699
0.0242972
0.0241066
0.0319544
0.0308034
0.0264511
0.0219009
0.0178057
0.0142743
0.0113354
0.00897478
0.00720416
0.00609832
0.00572311
0.00611471
0.00729419
0.00908925
0.0112795
0.0135949
0.0158328
0.0177686
0.0192276
0.0201902
0.020659
0.0205357
0.0196509
0.0181506
0.0162263
0.013505
0.0096716
0.004985
-0.000406851
-0.006523
-0.0137279
-0.0213795
-0.0303663
-0.0395872
-0.0498768
-0.0599026
-0.0694783
-0.077153
-0.0818347
-0.082974
-0.0807066
-0.077817
-0.0733152
-0.0655519
-0.0565376
-0.0451539
-0.0282221
-0.0125889
-0.00348891
0.00805109
0.0110755
0.0149929
0.0171159
0.0192025
0.0235671
0.0245883
0.0233944
0.0218101
0.0201086
0.0192097
0.0191625
0.0184838
0.0176851
0.0175361
0.0179342
0.0177276
0.017155
0.0165094
0.0159866
0.0156271
0.0153479
0.0150017
0.0143668
0.0134149
0.012099
0.0104263
0.00847905
0.0061605
0.00340978
0.000229881
-0.00358617
-0.00811342
-0.0135065
-0.0207154
-0.0295329
-0.0393054
-0.0509213
-0.0648102
-0.0813147
-0.0993764
-0.12052
-0.143675
-0.169148
-0.196406
-0.225769
-0.255663
-0.283366
-0.30632
-0.338876
-0.366764
-0.369426
-0.359945
-0.353949
-0.309792
-0.256685
-0.202346
-0.139553
-0.0438924
0.0802327
0.221994
0.372019
0.49859
0.638136
0.761059
0.866299
0.945668
1.00189
1.05402
1.09799
1.11305
1.11278
1.11032
1.09862
1.08678
1.07038
1.04173
1.01058
0.967328
0.912023
0.856836
0.799664
0.742628
0.682101
0.622582
0.582918
0.0180494
0.0186226
0.00505824
0.0176582
0.0160568
0.0201213
0.0270482
0.0260782
0.0225592
0.0186924
0.0151818
0.0121533
0.00964923
0.00762718
0.0061193
0.00517724
0.00485661
0.00518407
0.0061721
0.00766786
0.00948996
0.0114031
0.0132318
0.0147893
0.015927
0.016623
0.0168603
0.0165663
0.0156105
0.014105
0.0121913
0.00958352
0.0060578
0.00181418
-0.00300586
-0.00839838
-0.0145816
-0.0211195
-0.028606
-0.0362437
-0.0445609
-0.0525397
-0.0599971
-0.0658301
-0.0692355
-0.0698609
-0.0679378
-0.0654541
-0.0616256
-0.0551645
-0.047599
-0.0378234
-0.0240489
-0.0106084
-0.00314218
0.00654533
0.00934167
0.0126474
0.0144922
0.0163829
0.0198419
0.0207433
0.0198374
0.0185266
0.0171185
0.0163634
0.0162684
0.0157013
0.0150487
0.014928
0.0152096
0.0150358
0.0145609
0.0140212
0.0135795
0.0132699
0.0130249
0.0127234
0.0121817
0.011374
0.0102769
0.00885462
0.00719759
0.00521975
0.00287256
0.00014888
-0.00312272
-0.00700737
-0.0116528
-0.0178378
-0.0253897
-0.0337823
-0.0437775
-0.0557161
-0.0698372
-0.0853923
-0.103523
-0.123383
-0.145262
-0.168608
-0.193708
-0.219276
-0.243056
-0.26288
-0.290136
-0.313332
-0.315587
-0.307696
-0.301349
-0.263754
-0.218765
-0.171894
-0.117493
-0.0361125
0.0688517
0.18889
0.316047
0.424119
0.542394
0.646644
0.736484
0.804027
0.852838
0.896631
0.933679
0.946617
0.94771
0.944375
0.934445
0.924022
0.909588
0.885185
0.858173
0.821259
0.774467
0.727359
0.678657
0.629931
0.578588
0.52868
0.495655
0.0148267
0.0150908
0.00304106
0.0017026
0.00870367
0.0163265
0.0221036
0.0213762
0.0186086
0.0154235
0.01251
0.00999553
0.00788939
0.00624518
0.00500569
0.00422826
0.00396026
0.00422109
0.00501835
0.00621958
0.00768009
0.00919813
0.0106258
0.0118104
0.0126228
0.013044
0.0130474
0.0125801
0.011549
0.0100251
0.00812466
0.00563355
0.00241191
-0.00139264
-0.00563558
-0.0103036
-0.01546
-0.0208552
-0.0268437
-0.03287
-0.0392435
-0.0452081
-0.0506093
-0.0546623
-0.0568317
-0.056951
-0.0553109
-0.0532578
-0.0501224
-0.0449085
-0.0387539
-0.0306864
-0.019751
-0.0087248
-0.00263355
0.00515773
0.00762674
0.0103267
0.0118792
0.0135063
0.0161933
0.0169546
0.0162815
0.015232
0.0141036
0.0134926
0.0133723
0.0129161
0.0123946
0.0122952
0.0124864
0.0123408
0.0119552
0.0115146
0.0111508
0.0108909
0.0106829
0.0104281
0.00998235
0.00931972
0.00839038
0.00724314
0.0058808
0.0042475
0.00230394
4.10419e-05
-0.00268319
-0.00592012
-0.00980466
-0.0149614
-0.0212494
-0.0282565
-0.0366166
-0.0465916
-0.0583464
-0.0713697
-0.0864953
-0.103065
-0.121347
-0.140803
-0.161682
-0.182978
-0.202914
-0.219455
-0.241712
-0.261147
-0.262069
-0.255679
-0.249462
-0.218115
-0.180895
-0.141641
-0.0959749
-0.0287327
0.057398
0.156061
0.260633
0.350069
0.447353
0.533141
0.607527
0.663318
0.70418
0.739876
0.770122
0.780724
0.780647
0.77868
0.770377
0.761418
0.749053
0.728742
0.70599
0.675361
0.636846
0.597809
0.557528
0.517154
0.474865
0.434137
0.407295
0.0115902
0.011686
0.00238208
-0.000481998
0.00542307
0.0127102
0.0171745
0.0166847
0.0145936
0.0120913
0.00979129
0.0078094
0.0061192
0.00485289
0.0038806
0.00326761
0.00305235
0.00324681
0.00385357
0.00476515
0.00587123
0.00700404
0.00804151
0.00885813
0.00934991
0.00949763
0.0092713
0.00863303
0.00751684
0.00596804
0.00408022
0.00170317
-0.00123299
-0.00461369
-0.00829212
-0.0122275
-0.0164154
-0.0206577
-0.0251585
-0.0295567
-0.0340086
-0.037968
-0.041347
-0.0436517
-0.0446028
-0.0442126
-0.0428056
-0.041193
-0.0387571
-0.0347536
-0.0299948
-0.0236925
-0.0153768
-0.00684853
-0.0020544
0.00389336
0.00592065
0.00802114
0.00926216
0.0105804
0.0125928
0.0132017
0.0127211
0.0119194
0.0110582
0.0105834
0.010461
0.0101116
0.00971501
0.00963394
0.00975992
0.00964416
0.00934695
0.0090063
0.00872373
0.00852047
0.00835597
0.00815635
0.00780654
0.00728187
0.00662796
0.00571398
0.00464297
0.00335276
0.00181341
1.01708e-05
-0.00216422
-0.00475561
-0.00787868
-0.0120154
-0.0170567
-0.0226896
-0.0294201
-0.0374493
-0.0468797
-0.0573783
-0.0695362
-0.0828517
-0.0975574
-0.113169
-0.129879
-0.146918
-0.162929
-0.176178
-0.193584
-0.209308
-0.208956
-0.203684
-0.197842
-0.172564
-0.142932
-0.111495
-0.0749838
-0.0221743
0.045249
0.122673
0.204899
0.27556
0.352109
0.419616
0.478428
0.522407
0.554939
0.582733
0.606269
0.614527
0.612487
0.612548
0.605916
0.598533
0.588415
0.572229
0.553937
0.52959
0.49917
0.46819
0.436292
0.404303
0.37096
0.339068
0.318042
0.00831079
0.00835733
0.00193039
0.000152138
0.00411645
0.00917113
0.0122727
0.0119653
0.0105013
0.00869788
0.00703387
0.00560177
0.00436349
0.00346318
0.0027564
0.00230881
0.00214706
0.00227829
0.00269918
0.00332815
0.00408418
0.00483565
0.00548618
0.00594012
0.00611921
0.00600308
0.00555536
0.0047569
0.00355693
0.00198992
0.000123855
-0.00213281
-0.00479507
-0.00776454
-0.0108955
-0.0141197
-0.0174197
-0.0204827
-0.0235438
-0.0263227
-0.0288757
-0.0308388
-0.0322163
-0.0327896
-0.0325296
-0.0316259
-0.0304234
-0.0292595
-0.0275264
-0.0247009
-0.0213258
-0.0168212
-0.0109864
-0.00492444
-0.00146243
0.00271716
0.00422133
0.00573037
0.00664203
0.00762099
0.00902949
0.00947825
0.00916561
0.00860529
0.00800353
0.0076684
0.00756795
0.00731927
0.00704218
0.00698253
0.00705847
0.00697011
0.00675334
0.00650421
0.00629479
0.00613851
0.00600967
0.00585857
0.00560097
0.00522229
0.00466776
0.00401832
0.00322466
0.00226173
0.00110775
-0.000248119
-0.00188528
-0.00383623
-0.00619348
-0.00930569
-0.013086
-0.0173188
-0.0223868
-0.0284251
-0.0354986
-0.0434056
-0.0525369
-0.062533
-0.073575
-0.0852546
-0.097737
-0.110425
-0.122074
-0.131995
-0.144676
-0.156055
-0.155534
-0.151363
-0.146385
-0.127493
-0.105472
-0.0818282
-0.0543621
-0.0152739
0.034074
0.0908036
0.150904
0.202724
0.258644
0.307783
0.350649
0.382444
0.406139
0.426019
0.442705
0.448422
0.445885
0.446341
0.441316
0.435513
0.427731
0.415687
0.401989
0.383895
0.36146
0.338553
0.315018
0.291408
0.266911
0.243588
0.228091
0.00500015
0.00511008
0.00132997
0.000451037
0.00259918
0.00558733
0.00735031
0.00720258
0.00635254
0.00526036
0.00424675
0.00337705
0.00266827
0.00208868
0.00164142
0.00135653
0.00125001
0.0013239
0.00156997
0.00192418
0.00233097
0.00269935
0.00295794
0.00304316
0.00289906
0.00250921
0.00183145
0.000867932
-0.000417276
-0.00200262
-0.00383651
-0.00595879
-0.00833104
-0.0108718
-0.0134405
-0.0159448
-0.0182953
-0.0202178
-0.0218897
-0.0230689
-0.023756
-0.0237521
-0.0231653
-0.022033
-0.0205749
-0.019156
-0.0181468
-0.0174445
-0.0164159
-0.0147429
-0.0127378
-0.0100428
-0.00658236
-0.00297478
-0.000881974
0.00159923
0.00253356
0.00344678
0.00400799
0.00461723
0.00546011
0.0057432
0.0055735
0.00524532
0.00489153
0.00469254
0.00462558
0.00447354
0.00430391
0.00425978
0.00428936
0.00422407
0.0040837
0.00392543
0.00379368
0.00369792
0.00362515
0.00354941
0.00340469
0.00317445
0.00290981
0.00256286
0.00211927
0.00156233
0.000881774
6.8061e-05
-0.00092869
-0.00213311
-0.00361341
-0.00559554
-0.00801737
-0.010748
-0.0140527
-0.0180128
-0.0226609
-0.0279089
-0.0339685
-0.0406068
-0.0479619
-0.0556762
-0.0639173
-0.0722731
-0.0796754
-0.085967
-0.0939365
-0.100835
-0.100003
-0.0967129
-0.0927035
-0.0799624
-0.0656407
-0.0505291
-0.0335483
-0.0100276
0.0199184
0.0546355
0.091625
0.12357
0.158203
0.188772
0.215506
0.235285
0.250197
0.262601
0.27304
0.276726
0.275225
0.275622
0.272649
0.269066
0.264219
0.256744
0.248136
0.236744
0.222676
0.208223
0.193316
0.178265
0.162661
0.147782
0.137621
0.0016702
0.00208601
0.000630515
0.000348427
0.000850002
0.00186745
0.00244715
0.00242997
0.00214848
0.00177486
0.00142765
0.00113241
0.000909514
0.000683501
0.00050065
0.000378028
0.000327137
0.000340944
0.000404356
0.000478372
0.000530866
0.000506824
0.000361452
6.70996e-05
-0.000412078
-0.00108979
-0.00201575
-0.00315981
-0.00454623
-0.0061681
-0.007982
-0.0099793
-0.0120605
-0.0141633
-0.0161458
-0.0178913
-0.0192299
-0.0199558
-0.0201506
-0.019652
-0.0184339
-0.0164388
-0.0139019
-0.0111169
-0.00854354
-0.00671889
-0.0059937
-0.00576018
-0.00542623
-0.0048789
-0.00422104
-0.00333128
-0.00218786
-0.000998969
-0.000303451
0.000518316
0.000848563
0.00115705
0.00135168
0.00156615
0.00185473
0.00196412
0.00192542
0.00183444
0.00173789
0.0016937
0.00169206
0.0016629
0.0016265
0.00162814
0.00164907
0.00163595
0.00159501
0.00154504
0.00150049
0.00146349
0.0014282
0.00138
0.00128656
0.00113794
0.00112498
0.000877379
0.000582016
0.000203661
-0.000274229
-0.000865278
-0.00159803
-0.00249346
-0.00360839
-0.00505446
-0.0067674
-0.0087192
-0.01107
-0.0138207
-0.016963
-0.0205532
-0.0245656
-0.0289003
-0.0336645
-0.0384067
-0.0434032
-0.0484915
-0.0526943
-0.0556838
-0.0592739
-0.0622459
-0.0600489
-0.0569535
-0.0528953
-0.0440014
-0.0351478
-0.025877
-0.0156799
-0.00282491
0.0128165
0.0307846
0.0490841
0.0644827
0.0808543
0.0946889
0.107044
0.115555
0.121505
0.125683
0.129006
0.129105
0.127062
0.125281
0.122113
0.118634
0.114588
0.109455
0.103892
0.0972856
0.0896792
0.0820219
0.0743561
0.0667879
0.059205
0.0521053
0.0468485
)
;
boundaryField
{
inlet
{
type zeroGradient;
}
bottom
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
atmosphere
{
type totalPressure;
rho none;
psi none;
gamma 1;
p0 uniform 0;
value nonuniform List<scalar>
378
(
-0.00136367
-0.00157325
-0.00183904
-0.00215805
-0.00252274
-0.00292943
-0.00338585
-0.00390269
-0.00448566
-0.00514697
-0.00590715
-0.00677326
-0.00770226
-0.00865601
-0.00971499
-0.0106809
-0.0116847
-0.0126501
-0.0135116
-0.0142713
-0.014613
-0.0146702
-0.0143622
-0.0138238
-0.0129446
-0.012056
-0.0102529
-0.00822168
-0.00623667
-0.00467916
-0.0030206
-0.00143419
-0.00041182
-4.46969e-07
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-9.90428e-07
-2.21908e-05
-7.45708e-05
-0.000159183
-0.000284589
-0.000446304
-0.00065839
-0.000907643
-0.0012109
-0.00154988
-0.00194243
-0.00237356
-0.00284666
-0.00336739
-0.00393579
-0.00456535
-0.00526304
-0.00604288
-0.0068901
-0.00781417
-0.00882751
-0.00991151
-0.0110632
-0.0122656
-0.0135073
-0.0147577
-0.015925
-0.0169933
-0.0178632
-0.0185426
-0.0189358
-0.0190304
-0.0187493
-0.0180264
-0.0168586
-0.0152185
-0.0131823
-0.0108339
-0.00831666
-0.00574818
-0.00343692
-0.00157404
-0.000400246
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-5.5351e-06
-4.34491e-05
-0.000115256
-0.000220679
-0.00036069
-0.000531839
-0.000733368
-0.000962934
-0.0012183
-0.00149747
-0.00180227
-0.00213838
-0.00251173
-0.00291568
-0.00336133
-0.00383315
-0.00434034
-0.00486503
-0.00541605
-0.00597302
-0.00654587
-0.00712622
-0.00772761
-0.0083423
-0.00897757
-0.00961766
-0.0102894
-0.0109889
-0.0116601
-0.0122735
-0.0128351
-0.0134814
-0.0142856
-0.0152827
-0.0161588
-0.0166139
-0.0164753
-0.0157435
-0.0145068
-0.0127629
-0.0105893
-0.00809081
-0.00547563
-0.00306658
-0.0012043
-0.000142033
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-7.12816e-08
-3.34096e-05
-8.56142e-05
-0.000126492
-0.000149879
-0.000169811
-0.000206483
-0.000283622
-0.00041906
-0.000651678
-0.00101573
-0.00152337
-0.00219521
-0.00304462
-0.00412255
-0.00538696
-0.00684919
-0.0085135
-0.0103346
-0.0122792
-0.0142061
-0.0160646
-0.0177066
-0.0190054
-0.0197669
-0.0198005
-0.0190937
-0.0176287
-0.0153979
-0.0123863
-0.00890955
-0.00538133
-0.00237784
-0.000492527
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-9.80125e-07
-2.61319e-05
-8.60859e-05
-0.000181441
-0.000317024
-0.00049858
-0.000731426
-0.00102411
-0.00139871
-0.00187812
-0.00242683
-0.0030567
-0.00381604
-0.00467517
-0.00561649
-0.00669937
-0.00783706
-0.0090112
-0.0102572
-0.0113033
-0.012344
-0.0133469
-0.0138148
-0.013642
-0.0135143
-0.0132292
-0.0112248
-0.00939361
-0.00742354
-0.00480917
-0.00289747
-0.0013934
-0.000353691
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
)
;
}
frontBack
{
type empty;
}
}
// ************************************************************************* //
| [
"abenaz15@etudiant.mines-nantes.fr"
] | abenaz15@etudiant.mines-nantes.fr | |
9539653371e7032d30399ab934c1eb5e164d6180 | 253ccbd7fb767187f73cca279ff70befc678cdbf | /src/ds/nonstd.h | 469534f4ec239faff40161dc180f5de8c9a576a1 | [
"Apache-2.0"
] | permissive | rajdhandus/CCF | 4040a011b204c1c4596bc5ece3a58a6b1f2ddf53 | 96edbc9db6bd14c559a8c59bcda1c2a4835768d2 | refs/heads/main | 2023-03-11T07:36:32.842083 | 2021-02-19T16:00:02 | 2021-02-19T16:00:02 | 340,814,565 | 1 | 0 | Apache-2.0 | 2021-02-21T04:11:32 | 2021-02-21T04:11:32 | null | UTF-8 | C++ | false | false | 2,905 | h | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache 2.0 License.
#pragma once
#include <algorithm>
#include <array>
#include <cctype>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>
/**
* This file defines various type traits and utils that are not available in the
* standard library. Some are added in C++20, some are proposed, some are purely
* custom. They are defined here to avoid repetition in other locations
*/
namespace nonstd
{
/** is_specialization detects type-specialized templates. This does not work
* for value-dependent types (eg - std::array)
*/
template <typename T, template <typename...> class U>
struct is_specialization : std::false_type
{};
template <template <typename...> class T, typename... Args>
struct is_specialization<T<Args...>, T> : std::true_type
{};
/** Similar to is_specialization, but for detecting std::array specifically
*/
template <typename T>
struct is_std_array : std::false_type
{};
template <typename T, size_t N>
struct is_std_array<std::array<T, N>> : public std::true_type
{};
/** dependent_false produces a static, compile-time false, dependent on a
* specific type or value instantiation. This is useful for producing a
* static_assert which will fail only when invalid paths are called, but
* allows compilation otherwise
*/
template <typename T, T = T{}>
struct dependent_false : public std::false_type
{};
template <typename T, T t = T{}>
static constexpr bool dependent_false_v = dependent_false<T, t>::value;
/** remove_cvref combines remove_cv and remove_reference - this is present in
* C++20
*/
template <class T>
struct remove_cvref
{
typedef std::remove_cv_t<std::remove_reference_t<T>> type;
};
template <class T>
using remove_cvref_t = typename remove_cvref<T>::type;
/** more generic std::string member functions are present in C++20
*/
static inline bool starts_with(
const std::string& s, const std::string& prefix)
{
return s.rfind(prefix, 0) == 0;
}
static inline bool ends_with(const std::string& s, const std::string& suffix)
{
return s.size() >= suffix.size() &&
s.compare(s.size() - suffix.size(), suffix.size(), suffix) == 0;
}
/** converts strings to upper or lower case, in-place
*/
static inline void to_upper(std::string& s)
{
std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) {
return std::toupper(c);
});
}
static inline void to_lower(std::string& s)
{
std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) {
return std::tolower(c);
});
}
static inline std::string remove_prefix(
const std::string& s, const std::string& prefix)
{
if (starts_with(s, prefix))
{
return s.substr(prefix.size());
}
return s;
}
} | [
"noreply@github.com"
] | noreply@github.com |
bccdaa763acc75b85359defe9358e93a69f9c2c7 | 17041c8e6a40b6a1b4d3b98efa06209a6789a921 | /Dynamic Programming/10_time_and_space_complexity/10_radix_sort.cpp | 8bba20aa71b47d232cf6f6c8f6057b5c2c147835 | [] | no_license | ravi956/pepcoding-level1-in-cpp | 5c93d56e3ae030bd118af0e37fe7df02db004fa3 | 7f6e880668a0556af0ec0a0644df3475213dda83 | refs/heads/master | 2023-03-11T00:56:53.043629 | 2021-03-03T07:00:03 | 2021-03-03T07:00:03 | 294,654,788 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,121 | cpp | #include <bits/stdc++.h>
using namespace std;
void print(int *arr, int n)
{
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
cout << endl;
}
void countSort(int *arr, int exp, int n)
{
int farr[10] = {0};
for (int i = 0; i < n; i++)
farr[arr[i] / exp % 10]++;
for (int i = 1; i < 10; i++)
farr[i] += farr[i - 1];
int ans[n];
for (int i = n - 1; i >= 0; i--)
{
int val = arr[i];
int pos = farr[arr[i] / exp % 10];
int idx = pos - 1;
ans[idx] = val;
farr[arr[i] / exp % 10]--;
}
for (int i = 0; i < n; i++)
arr[i] = ans[i];
cout << "After sorting on " << exp << " place -> ";
print(arr, n);
}
void radixSort(int *arr, int n)
{
int maximum = INT_MIN;
for (int i = 0; i < n; i++)
maximum = max(maximum, arr[i]);
int exp = 1;
while (exp <= maximum)
{
countSort(arr, exp, n);
exp = exp * 10;
}
}
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
cin >> arr[i];
radixSort(arr, n);
print(arr, n);
} | [
"ravikumar956078@gmail.com"
] | ravikumar956078@gmail.com |
8849cd360f52182f404aa544933158da4f2f229e | c9fa24fed756ad4b38e9dce6430062bf24c99561 | /VieClus/extern/KaHIP/lib/data_structure/graph_hierarchy.cpp | c10d69d93f8282decf87be7c0ab38246de77003c | [
"MIT"
] | permissive | ahthomps/k-plex-enumeration | b14a03f277486d448d77831d9b617ba0f845fda5 | 83a63e8f7dac5831cbe753167d5cea3f7501ce73 | refs/heads/master | 2023-04-19T21:25:12.650739 | 2021-05-06T18:29:11 | 2021-05-06T18:29:11 | 272,840,408 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,409 | cpp | /******************************************************************************
* graph_hierarchy.cpp
*
* Source of KaHIP -- Karlsruhe High Quality Partitioning.
*****************************************************************************/
#include "graph_hierarchy.h"
graph_hierarchy::graph_hierarchy() : m_current_coarser_graph(NULL),
m_current_coarse_mapping(NULL){
}
graph_hierarchy::~graph_hierarchy() {
for( unsigned i = 0; i < m_to_delete_mappings.size(); i++) {
if(m_to_delete_mappings[i] != NULL)
delete m_to_delete_mappings[i];
}
for( unsigned i = 0; i+1 < m_to_delete_hierachies.size(); i++) {
if(m_to_delete_hierachies[i] != NULL)
delete m_to_delete_hierachies[i];
}
}
void graph_hierarchy::push_back(graph_access * G, CoarseMapping * coarse_mapping) {
m_the_graph_hierarchy.push(G);
m_the_mappings.push(coarse_mapping);
m_to_delete_mappings.push_back(coarse_mapping);
m_coarsest_graph = G;
}
graph_access* graph_hierarchy::pop_finer_and_project() {
graph_access* finer = pop_coarsest();
CoarseMapping* coarse_mapping = m_the_mappings.top(); // mapps finer to coarser nodes
m_the_mappings.pop();
if(finer == m_coarsest_graph) {
m_current_coarser_graph = finer;
finer = pop_coarsest();
finer->set_partition_count(m_current_coarser_graph->get_partition_count());
coarse_mapping = m_the_mappings.top();
m_the_mappings.pop();
}
ASSERT_EQ(m_the_graph_hierarchy.size(), m_the_mappings.size());
//perform projection
graph_access& fRef = *finer;
graph_access& cRef = *m_current_coarser_graph;
forall_nodes(fRef, n) {
NodeID coarser_node = (*coarse_mapping)[n];
PartitionID coarser_partition_id = cRef.getPartitionIndex(coarser_node);
fRef.setPartitionIndex(n, coarser_partition_id);
} endfor
m_current_coarse_mapping = coarse_mapping;
finer->set_partition_count(m_current_coarser_graph->get_partition_count());
m_current_coarser_graph = finer;
return finer;
}
graph_access* graph_hierarchy::pop_finer_and_project_ns( PartialBoundary & separator ) {
graph_access* finer = pop_coarsest();
CoarseMapping* coarse_mapping = m_the_mappings.top(); // mapps finer to coarser nodes
m_the_mappings.pop();
if(finer == m_coarsest_graph) {
m_current_coarser_graph = finer;
finer = pop_coarsest();
finer->set_partition_count(m_current_coarser_graph->get_partition_count());
coarse_mapping = m_the_mappings.top();
m_the_mappings.pop();
}
ASSERT_EQ(m_the_graph_hierarchy.size(), m_the_mappings.size());
separator.clear();
//perform projection
graph_access& fRef = *finer;
graph_access& cRef = *m_current_coarser_graph;
forall_nodes(fRef, n) {
NodeID coarser_node = (*coarse_mapping)[n];
PartitionID coarser_partition_id = cRef.getPartitionIndex(coarser_node);
fRef.setPartitionIndex(n, coarser_partition_id);
if( coarser_partition_id == 2 ) separator.insert(n);
} endfor
m_current_coarse_mapping = coarse_mapping;
finer->set_partition_count(m_current_coarser_graph->get_partition_count());
m_current_coarser_graph = finer;
return finer;
}
CoarseMapping * graph_hierarchy::get_mapping_of_current_finer() {
return m_current_coarse_mapping;
}
graph_access* graph_hierarchy::get_coarsest( ) {
return m_coarsest_graph;
}
graph_access* graph_hierarchy::pop_coarsest( ) {
graph_access* current_coarsest = m_the_graph_hierarchy.top();
m_the_graph_hierarchy.pop();
return current_coarsest;
}
bool graph_hierarchy::isEmpty( ) {
ASSERT_EQ(m_the_graph_hierarchy.size(), m_the_mappings.size());
return m_the_graph_hierarchy.empty();
}
unsigned int graph_hierarchy::size() {
return m_the_graph_hierarchy.size();
}
| [
"almaotter@gmail.com"
] | almaotter@gmail.com |
934be7c737dc508cd12a110fa48548b0c0c491d4 | 0d5d0e5dbc95c3f621a063222ef0036f386b9f55 | /BaseProject/Plugins/WidgetThumbs/Intermediate/Build/Win64/UE4Editor/Development/WidgetThumbs/Module.WidgetThumbs.cpp | 18a55ef315b5454529f1846e8eaf62eccc859192 | [] | no_license | Spikesalive/FTC | da604916eacda46efb167c562f57ba90587adee3 | 8b9b1315442fbedd0fce6f73b8021d75be76ffd5 | refs/heads/main | 2023-09-06T08:00:26.132842 | 2021-10-18T18:48:06 | 2021-10-18T18:48:06 | 417,198,034 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 513 | cpp | // This file is automatically generated at compile-time to include some subset of the user-created cpp files.
#include "C:/Users/mikeb/Documents/Git/FTC/BaseProject/Plugins/WidgetThumbs/Source/WidgetThumbs/Private/WidgetBlueprintThumbnailRenderer.cpp"
#include "C:/Users/mikeb/Documents/Git/FTC/BaseProject/Plugins/WidgetThumbs/Source/WidgetThumbs/Private/WidgetBlueprintThumbnailScene.cpp"
#include "C:/Users/mikeb/Documents/Git/FTC/BaseProject/Plugins/WidgetThumbs/Source/WidgetThumbs/Private/WidgetThumbs.cpp"
| [
"mikebawdon1998@gmail.com"
] | mikebawdon1998@gmail.com |
ac611a868cb8af283dbaff58ddbe520f913f129a | dfbb1a9b8e69804da45cb76681b45c87738eca19 | /stdafx.cpp | 305a50828641605c9db11d30b3d3dd9ad1324563 | [] | no_license | ModelDBRepository/105383 | f24efbb3da3756b2d5aec0576e87553253550ad6 | 1df783d5ee7abb73d471c4c73a077433392e45d7 | refs/heads/master | 2020-05-29T18:24:32.521063 | 2019-05-31T02:48:41 | 2019-05-31T02:48:41 | 189,298,821 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 282 | cpp | // stdafx.cpp : source file that includes just the standard includes
// GPC.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
| [
"tom.morse@yale.edu"
] | tom.morse@yale.edu |
4965035a3cd765a4875ff6229eec5e494874ddc1 | d22e7a298458cf2bb7fc050b59fd585cd1f7e0c4 | /sdk/source/Src/Projects/AreasBuilder/GuiLib/GuiControlBar.cpp | 0bb09e70fb94ac0a5c7cd65bff4ca1f12625441a | [
"MIT",
"CC-BY-4.0"
] | permissive | egorpushkin/neurolab | 9cad44104dcfe199aa63dd6fd9669c063e29d5e8 | 08daa763f13982d2214bbc9cd9060a0709542d7e | refs/heads/master | 2021-05-04T18:49:01.131630 | 2017-10-19T21:52:40 | 2017-10-19T21:52:40 | 106,142,310 | 2 | 0 | null | 2017-10-09T03:21:07 | 2017-10-08T01:34:09 | null | ISO-8859-1 | C++ | false | false | 68,339 | cpp | /****************************************************************************
* *
* GuiToolKit *
* (MFC extension) *
* Created by Francisco Campos G. www.beyondata.com fcampos@beyondata.com *
*--------------------------------------------------------------------------*
* *
* This program is free software;so you are free to use it any of your *
* applications (Freeware, Shareware, Commercial),but leave this header *
* intact. *
* *
* These files are provided "as is" without warranty of any kind. *
* *
* GuiToolKit is forever FREE CODE !!!!! *
* *
*--------------------------------------------------------------------------*
* Created by: Francisco Campos G. *
* Bug Fixes and improvements : (Add your name) *
* -Francisco Campos *
* *
****************************************************************************/
// GuiControlBar.cpp : implementation file
#include "stdafx.h"
#include "GuiControlBar.h"
#include "GuiDockContext.h"
#include "GuiDrawLayer.h"
#include "GuiToolBarWnd.h"
#include "menuBar.h"
#include "GuiMDIFrame.h"
#include "GuiFrameWnd.h"
#include "GuiMiniFrameWnd.h"
#define GUI_SCROLLON 10
#define GUI_SCROLLOFF 11
#define GUI_NUMITER 5
#define HTPIN 323
// CGuiControlBar
#pragma warning( disable : 4244 )
IMPLEMENT_DYNAMIC(CGuiControlBar, CControlBar)
CGuiControlBar::CGuiControlBar()
{
nGapGripper=20;
m_bActive=FALSE;
m_bOldActive=FALSE;
m_sizeMinFloating=m_sizeVert=m_sizeHorz=CSize(280,170);
m_sizeMinFloating1=m_sizeMinFloating;
m_sizeHorzt=CSize(200,100);
m_sizeVertt=CSize(600,100);
m_pos=0;
m_Last=0;
m_bTracking=FALSE;
m_rcBorder=CRect(0,0,0,0);
m_rcOldBorder=CRect(0,0,0,0);
m_ptOld=CPoint(0,0);
m_sizeMinV=CSize(28,28);
m_sizeMinH=CSize(28,28);
m_Initialize=FALSE;
m_First=-1;
m_bForcepaint=FALSE;
m_stateBtn=NORMAL;
m_stateAHBtn=NORMAL;
m_bSupportMultiView=FALSE;
m_MenuContext=NULL;
m_StyleDisplay=GUISTYLE_XP;
m_clrFondo=GuiDrawLayer::GetRGBColorFace(GuiDrawLayer::m_Style);
m_bAutoHide=FALSE;
Porc=0.0;
m_bComplete=TRUE;
m_IsLoadDocking=TRUE;
m_hIcon=NULL;
}
CGuiControlBar::~CGuiControlBar()
{
}
BEGIN_MESSAGE_MAP(CGuiControlBar, CControlBar)
ON_WM_CREATE()
ON_WM_LBUTTONDOWN()
ON_WM_RBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_NCLBUTTONDOWN()
ON_WM_NCRBUTTONDOWN()
ON_WM_NCLBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_NCPAINT()
ON_WM_NCCALCSIZE()
ON_WM_WINDOWPOSCHANGED()
ON_WM_PAINT()
ON_WM_LBUTTONDBLCLK()
ON_WM_NCLBUTTONDBLCLK()
ON_WM_NCHITTEST()
ON_WM_SETCURSOR()
ON_WM_SIZE()
ON_WM_NCMOUSEMOVE()
ON_WM_TIMER()
ON_COMMAND(ID_GUI_SHOWTITLE, OnShowTitle)
ON_WM_SYSCOLORCHANGE()
END_MESSAGE_MAP()
// CGuiControlBar message handlers
void CGuiControlBar::OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL /*bDisableIfNoHndler*/)
{
CWnd* pFocus = GetFocus();
m_bOldActive=(pFocus->GetSafeHwnd() && IsChild(pFocus));
m_bForcepaint=TRUE;
if (!m_bActive && m_bOldActive)
OnActiveWindow();
m_bForcepaint=FALSE;
}
void CGuiControlBar::OnSysColorChange( )
{
m_clrFondo=GuiDrawLayer::GetRGBColorFace(GuiDrawLayer::m_Style);
CControlBar::OnSysColorChange( );
}
BOOL CGuiControlBar::Create(LPCTSTR lpszWindowName, DWORD dwStyle,CWnd* pParentWnd, UINT nID)
{
// TODO: Add your specialized code here and/or call the base class
//gran parte del codigo se tomo como guia de clases MFC
ASSERT_VALID(pParentWnd); // must have a parent
//en esta linea se verifica que la ventana debe disponer de un estilo fijo o dinamico
//pero no los dos.el estilo Dynamic permite cambiar el tamaño dela ventana mientras flota
//pero no cuando esta docking, el estilo fijo determina las columnas en que se disponen los
//componentes y permance asi.
ASSERT(!((dwStyle & CBRS_SIZE_FIXED) && (dwStyle & CBRS_SIZE_DYNAMIC)));
// save the style
//en dwStyle debe asignarse un tipo de alineación por ejemplo CBRS_TOP,etc de lo contrario
//se generase un ASSERT al acambiar el Style
dwStyle|=CBRS_TOP;
m_dwStyle = (dwStyle & CBRS_ALL);//save the original style
dwStyle &= ~CBRS_ALL;
//en la siguiente instruccion el proposito que se busca es evitar el parpadeo
//cuando se refresca la ventana.
//WS_CLIPCHILDREN : recorta el area de las ventanas hijas cuando se dibuja sobre
// la ventana que la contiene.
//WS_CLIPSIBLING : cuando se recibe el mensaje paint se recorta el area de las otras ventanas
// hijas superpuestas, que estan fuera de la region.
dwStyle |= WS_CLIPSIBLINGS|WS_CLIPCHILDREN;
pMf=pParentWnd;
//con el estilo CS_DBLCLKS, lo que se busca es que al recibir un doble clic
//la ventana reaccione,ojo el problema es que esto lo hace solo con el area cliente.
LPCTSTR lpszClassName=::AfxRegisterWndClass(CS_DBLCLKS,
::LoadCursor(NULL,IDC_ARROW),
::GetSysColorBrush(COLOR_BTNFACE),
NULL);
//poque no se llama a CControlBar::Create, bueno, da igual llamar a cualquiera, CWnd o CControlBar
//esto debido a que CControlbar se deriva de CWnd y porque ademas CControlBar no sobrecarga el
//metodo Create, nosotros si porque tenemos que particularizar, cosas.
BOOL bResp= CWnd::Create(lpszClassName, lpszWindowName, dwStyle, CRect(0,0,0,0), pParentWnd, nID);
if (!bResp) return FALSE;
return TRUE;
}
int CGuiControlBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CControlBar::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
//aqui es cuando llamamos a nuestra clase CGuiDockContext, de esta manera
//sobrecargamos el clase original que para nuestros propositos no nos sirve.
//porque ?, bueno porque me interesa que no se pegen las toolbar en el interior
//de las ventanas.
if (m_pDockContext==NULL)
m_pDockContext=new CGuiDockContext(this);
ASSERT(m_pDockContext);
m_CloseBtn.SetData(6,_T("Close"));
m_CloseBtn.SetImageList(IDB_GUI_DOCKBAR,9,10,RGB(255,0,255));
m_AutoHideBtn.SetData(12,_T("Auto Hide"));
m_AutoHideBtn.SetImageList(IDB_GUI_DOCKBAR,9,15,RGB(255,0,255));
return 0;
}
void CGuiControlBar::OnShowTitle()
{
ActiveCaption();
SendMessage(WM_NCPAINT);
}
CSize CGuiControlBar::CalcWinPos()
{
POSITION pos = m_pDockSite->m_listControlBars.GetHeadPosition();
DWORD dwDockStyle = m_dwDockStyle;
dwDockStyle &= CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI;
CRect rect;
GetWindowRect(&rect);
while (pos != NULL)
{
CDockBar* pDockBar = (CDockBar*)m_pDockSite->m_listControlBars.GetNext(pos);
if (pDockBar->IsDockBar() && pDockBar->IsWindowVisible() &&
(pDockBar->m_dwStyle & dwDockStyle & CBRS_ALIGN_ANY) &&
(!pDockBar->m_bFloating ||
(dwDockStyle & pDockBar->m_dwStyle & CBRS_FLOAT_MULTI)))
{
CRect rectBar;
pDockBar->GetWindowRect(&rectBar);
if (rectBar.Width() == 0)
rectBar.right++;
if (rectBar.Height() == 0)
rectBar.bottom++;
if (rectBar.IntersectRect(rectBar, rect))
{
int nSize=pDockBar->m_arrBars.GetSize();
int iCont=0;
UINT m_nDockBarID;
for (int i=0;i <nSize; i++)
{
m_nDockBarID = pDockBar->GetDlgCtrlID();
CControlBar* pBar;
pBar = (CControlBar*) pDockBar->m_arrBars[i];
if (HIWORD(pBar) == 0) continue; // placeholder
if (!pBar->IsVisible()) continue;
iCont++;
}
m_pDockSite->GetControlBar(m_nDockBarID)->GetWindowRect(rectBar);
if((pDockBar->m_dwStyle & dwDockStyle) ==CBRS_ALIGN_LEFT)
{
if (iCont==0)
return CSize(m_sizeMinFloating.cx,(rectBar.Height()-4));
else if(iCont>0)
return CSize(m_sizeMinFloating.cx,(rectBar.Height()/iCont));
}
else
{
if (iCont==0)
return CSize((rectBar.Width()-4),m_sizeMinFloating.cy);
else if(iCont>0)
return CSize((rectBar.Width()/iCont),m_sizeMinFloating.cy);
}
}
}
}
/* if (i==1)
return CSize(m_sizeMinFloating.cx,(rcWin.Height()-4));
else if(i>1)
return CSize(m_sizeMinFloating.cx,(rcWin.Height()/i));
else*/
return m_sizeMinFloating;
}
//esta funcion calcula el tamaño horizontal de la ventana,no importa si esta
//docking a izquierda o derecha o arriba o abajo.Debemos disponer de un espacio equitativo entre todas
//ventanas que se encuentren docking ya sea en una fila o columna.
CSize CGuiControlBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
{
//la funcion original toma el ancho o alto dependiendo del sentido que nos
//indica bHorz.
ASSERT_VALID(this);
//se modifica esta rutina para que se ajuste correctamente las ventanas docking
if (IsFloating())
return m_sizeMinFloating;//CalcWinPos();
else
{
//si bStrerch es TRUE significa que esta ventana no se puede hacer
//Docking
if (bStretch)
{
if (bHorz)
return CSize(32767, m_sizeHorz.cy);
else
return CSize(m_sizeVert.cx, 32767);
}
}
int Len=GetHiWid();
//call from GuiDockContext
if (Len==0)
{
if (IsHorz())
return m_sizeHorz;
else
return m_sizeVert;
}
int nWidth = GetWidthMax();
int nMinSpace=0;//minimo espacio requerido con lo tamaños normales
int nMinimo=0; //minimo espacio de los tamaños minimos
int nRealBars=0;
int m_First=GetFirstPos();
for (int nPos = m_First; nPos <= m_Last; nPos++)
{
CGuiControlBar* pBar = GetGuiControlBar(nPos,TRUE);
if (pBar== NULL) continue;
if (!pBar->IsVisible()) continue;
if (!pBar->IsKindOf(RUNTIME_CLASS(CGuiControlBar)))
{
CPoint pt(GetMessagePos());
CGuiFrameWnd* mFrame=(CGuiFrameWnd*)m_pDockSite;
if (IsLeft())
mFrame->DockControlBar(pBar,mFrame->m_dockLeft);
if(IsTop())
mFrame->DockControlBar(pBar,mFrame->m_dockTop);
if(IsBottom())
mFrame->DockControlBar(pBar,mFrame->m_dockBottom);
if(IsRight())
mFrame->DockControlBar(pBar,mFrame->m_dockRight);
continue;
}
if (IsVert())
pBar->m_sizeVert.cx=nWidth;
else
pBar->m_sizeHorz.cy=nWidth; //todas se hacen con el mismo ancho
nMinSpace+=IsVert() ? pBar->m_sizeVert.cy:pBar->m_sizeHorz.cx; //minimo espacio para alinear las barras
nRealBars++; //cuantas barras realmente existen
}
//si el tamaño de las barras en la fila es mayor que
//el espacio disponible, luego la solucion salomonica es
//repartir el espacio entre todas.
if (nRealBars == 1 )
{
if (bHorz)
return m_sizeHorz= CSize(Len,m_sizeHorz.cy);
else
return m_sizeVert=CSize(m_sizeVert.cx,Len);
}
int niDif=(Len-nMinSpace);//sVert()?8:2);
if (abs(niDif) !=0)
{
BOOL bGrow=FALSE;
if (niDif > 0)
bGrow=TRUE;
niDif=abs(niDif);
while(niDif > 0)
{
for (int nPos = m_First; nPos <= m_Last; nPos++)
{
CGuiControlBar* pBar = GetGuiControlBar(nPos);
if (pBar== NULL) continue;
if(IsVert())
{
if(bGrow)
pBar->m_sizeVert.cy+=1;
else
{
if (pBar->m_sizeVert.cy-1 < 26)
{
niDif--; //bug fixed
continue;
}
pBar->m_sizeVert.cy-=1;
}
}
else
{
if(bGrow)
pBar->m_sizeHorz.cx+=1;
else
{
if (pBar->m_sizeHorz.cx-1 < 26)
{
niDif--; //bug fixed
continue;
}
pBar->m_sizeHorz.cx-=1;
}
}
niDif--;
if(niDif==0) break;
}
}
}
//--reubicar las ventanas, sin esta rutina nada funciona
RecalWindowPos();
if (IsHorz())
return m_sizeHorz;
else
return m_sizeVert;
}
//esta rutina dispone de la posición en el Dockbar de la pila de ventanas
void CGuiControlBar::RecalWindowPos()
{
int m_First=GetFirstPos();
int m_Last=GetLastPos();
int m_This=m_pDockBar->FindBar(this);
AFX_SIZEPARENTPARAMS layout;
layout.hDWP =::BeginDeferWindowPos( m_Last);
CRect rcWin=GetDockRect();
int m_VertPos=0;
for(int i=m_First; i<= m_Last; i++)
{
CGuiControlBar* pBar = GetGuiControlBar(i);
if (pBar == NULL) continue;
CRect rcBar;
pBar->GetWindowRect(rcBar);
rcBar.OffsetRect(-rcWin.TopLeft());
if (IsVert())
{
if (i==m_First)
{
rcBar.top=0;
}
else
rcBar.top=m_VertPos;
}
else
{
if (i==m_First)
rcBar.left=0;
else
rcBar.left=m_VertPos;
}
//AfxRepositionWindow(&layout,pBar->m_hWnd,&rcBar);
if (IsVert())
rcBar.bottom=m_VertPos+pBar->m_sizeVert.cy;
else
rcBar.right=m_VertPos+pBar->m_sizeHorz.cx;
pBar->MoveWindow(rcBar,TRUE);
if (IsVert())
m_VertPos+=rcBar.Height();
else
m_VertPos+=rcBar.Width();
}
ASSERT( layout.hDWP != NULL );
if( layout.hDWP != NULL )
{
VERIFY( ::EndDeferWindowPos(layout.hDWP) );
}
//m_pDockSite->DelayRecalcLayout();
}
CRect CGuiControlBar::GetDockRect()
{
CRect rcWin;
if(!m_bAutoHide)
{
if (IsVert())
if (IsLeft())
{
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_LEFT)->GetWindowRect(rcWin);
CRect rc11;
m_pDockSite->GetControlBar(CBRS_ALIGN_LEFT)->GetWindowRect(rc11);
}
else
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_RIGHT)->GetWindowRect(rcWin);
else
if(IsBottom())
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_BOTTOM)->GetWindowRect(rcWin);
else
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_TOP)->GetWindowRect(rcWin);
}
else
{
if (IsHideVert())
if (IsHideLeft())
{
m_pDockSite->GetControlBar(CBRS_ALIGN_LEFT)->GetWindowRect(rcWin);
CRect rc11;
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_LEFT)->GetWindowRect(rc11);
}
else
m_pDockSite->GetControlBar(CBRS_ALIGN_RIGHT)->GetWindowRect(rcWin);
else
if(IsHideBottom())
m_pDockSite->GetControlBar(CBRS_ALIGN_BOTTOM)->GetWindowRect(rcWin);
else
m_pDockSite->GetControlBar(CBRS_ALIGN_TOP)->GetWindowRect(rcWin);
}
return rcWin;
}
CRect CGuiControlBar::GetDockRectBck()
{
CRect rcWin=CRect(0,0,0,0);
if (m_nLastAlingDockingBck==AFX_IDW_DOCKBAR_LEFT)
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_LEFT)->GetWindowRect(rcWin);
else if(m_nLastAlingDockingBck==AFX_IDW_DOCKBAR_RIGHT)
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_RIGHT)->GetWindowRect(rcWin);
else if(m_nLastAlingDockingBck==AFX_IDW_DOCKBAR_BOTTOM)
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_BOTTOM)->GetWindowRect(rcWin);
else if(m_nLastAlingDockingBck==AFX_IDW_DOCKBAR_TOP)
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_TOP)->GetWindowRect(rcWin);
return rcWin;
}
int CGuiControlBar::GetWidthMax()
{
m_pos=m_pDockBar->FindBar(this);
m_Last=GetLastPos();
int nWidth=0;
for (int nPos = GetFirstPos(); nPos <= m_Last; nPos++)
{
CGuiControlBar* pBar = GetGuiControlBar(nPos);
if (pBar== NULL) continue;
nWidth=max(nWidth,IsVert() ? pBar->m_sizeVert.cx:pBar->m_sizeHorz.cy);
}
return nWidth;
}
CGuiControlBar* CGuiControlBar::GetGuiControlBar(int nPos,BOOL bAll) const
{
CGuiControlBar* pResult = (CGuiControlBar*)m_pDockBar->m_arrBars[nPos];
if (bAll==FALSE)
{
if (HIWORD(pResult) == NULL) return NULL;
else if (!pResult->IsVisible()) return NULL;
else if (!pResult->IsKindOf(RUNTIME_CLASS(CGuiControlBar))) return NULL;
}
else
{
if (HIWORD(pResult) == NULL)
return NULL;
}
return pResult;
}
//En esta función se calcula el tamaño de la ventana cuando esta flotando
//y gestionar cuando el mouse es presionado en las esquinas.
//#define HTTOPLEFT 13
//#define HTTOPRIGHT 14
//#define HTBOTTOMLEFT 16
//#define HTBOTTOMRIGHT 17
CSize CGuiControlBar::CalcDynamicLayout(int nLength, DWORD nMode)
{
// m_pDockSite->DelayRecalcLayout();
if (IsFloating() && !m_bAutoHide)
{
// Enable diagonal arrow cursor for resizing
//m_sizeVert=m_sizeHorz=CSize(200,200);
GetParent()->GetParent()->ModifyStyle(MFS_4THICKFRAME/*|WS_CAPTION*/,0);
}
if (nMode & (LM_HORZDOCK | LM_VERTDOCK) )
{
m_pDockSite->DelayRecalcLayout();
//obligar a reposicionar la ventana, de lo contrario cuando vuelva de un doble click
//desde la ventana CMiniFrameWnd queda sin area cliente
if (!m_bAutoHide)
{
SetWindowPos(NULL, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER |
SWP_NOACTIVATE | SWP_FRAMECHANGED|SWP_NOREDRAW);
}
return CControlBar::CalcDynamicLayout(nLength, nMode);
}
if (nMode & LM_MRUWIDTH && !m_bAutoHide)
return m_sizeMinFloating;
if (nMode & LM_COMMIT && !m_bAutoHide)
return m_sizeMinFloating ;
if (m_bAutoHide)
{
CRect rcW;
CRect rcC;
CRect rcFrameClient;
GetClientRect(rcC);
if (m_nLastAlingDocking ==CBRS_ALIGN_LEFT)
{
m_pDockSite->GetControlBar(CBRS_ALIGN_LEFT)->GetWindowRect(rcW);
m_sizeMinFloating.cy=rcW.Height();
}
if (m_nLastAlingDocking == CBRS_ALIGN_RIGHT)
{
m_pDockSite->GetControlBar(CBRS_ALIGN_RIGHT)->GetWindowRect(rcW);
m_sizeMinFloating.cy=rcW.Height();
}
if (m_nLastAlingDocking == CBRS_ALIGN_TOP)
{
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_TOP)->GetWindowRect(rcW);
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_TOP)->GetWindowRect(rcFrameClient);
m_sizeMinFloating.cx=rcFrameClient.Width();
}
if (m_nLastAlingDocking == CBRS_ALIGN_BOTTOM)
{
m_pDockSite->GetControlBar(CBRS_ALIGN_BOTTOM)->GetWindowRect(rcW);
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_BOTTOM)->GetWindowRect(rcFrameClient);
m_sizeMinFloating.cx=rcFrameClient.Width();
}
return m_sizeMinFloating;
}
if (IsFloating() && !m_bAutoHide)
{
CRect rcWin;
POINT cpt;
GetCursorPos(&cpt);
GetParent()->GetParent()->GetWindowRect(&rcWin);
int nXOffset=0;int nYOffset=0;
switch (m_pDockContext->m_nHitTest)
{
//------------------------------------------------------------------
case HTLEFT:
m_pDockContext->m_rectFrameDragHorz= rcWin;
m_pDockContext->m_rectFrameDragHorz.left = cpt.x;
m_sizeMinFloating.cx = max(rcWin.right - cpt.x,32)-4 ;
m_sizeMinFloating.cy = max((rcWin.bottom -rcWin.top)-nGapGripper-5,32)+2 ;
return m_sizeMinFloating;
break;
case HTTOP:
m_pDockContext->m_rectFrameDragHorz=rcWin;
m_pDockContext->m_rectFrameDragHorz.top = cpt.y;
m_sizeMinFloating.cx = max(rcWin.right-rcWin.left-2,32)-4 ;
m_sizeMinFloating.cy = max((rcWin.bottom -nGapGripper-cpt.y-3),32) ;
return m_sizeMinFloating;
break;
case HTRIGHT:
m_pDockContext->m_rectFrameDragHorz=rcWin;
m_pDockContext->m_rectFrameDragHorz.right = cpt.x;
m_sizeMinFloating.cy = max(rcWin.bottom -rcWin.top-nGapGripper-3,32) ;
m_sizeMinFloating.cx = max(cpt.x-rcWin.left-4,32);
return m_sizeMinFloating;
break;
case HTBOTTOM:
m_pDockContext->m_rectFrameDragHorz=rcWin;
m_sizeMinFloating.cy = max(cpt.y-rcWin.top -nGapGripper-3,32) ;
m_sizeMinFloating.cx = max(rcWin.right-rcWin.left-2,32)-4 ;
m_pDockContext->m_rectFrameDragHorz.bottom = cpt.y-4;
return m_sizeMinFloating;
break;
case HTTOPLEFT:
//---------------------------------------------------------
//En este caso crece la ventana a izquierda y hacia arriba
//izquierda incrementa cx y top incrementa cy
m_sizeMinFloating.cx = max(rcWin.right - cpt.x,32)-3 ;
m_sizeMinFloating.cy = max(rcWin.bottom -nGapGripper-cpt.y,32)-2 ;
m_pDockContext->m_rectFrameDragHorz.top = cpt.y-1;
m_pDockContext->m_rectFrameDragHorz.left = cpt.x-2;
return m_sizeMinFloating;
break;
case HTTOPRIGHT:
m_sizeMinFloating.cx = max(cpt.x-rcWin.left,32)-4 ;
m_sizeMinFloating.cy = max(rcWin.bottom -nGapGripper-cpt.y,32)-2 ;
m_pDockContext->m_rectFrameDragHorz.top = cpt.y-1;
m_pDockContext->m_rectFrameDragHorz.right = cpt.x-2;
return m_sizeMinFloating;
break;
case HTBOTTOMLEFT:
m_sizeMinFloating.cx = max(rcWin.right - cpt.x,32)-4;
m_sizeMinFloating.cy = max(cpt.y-rcWin.top -nGapGripper,32)-2 ;
m_pDockContext->m_rectFrameDragHorz.top = rcWin.top;
m_pDockContext->m_rectFrameDragHorz.bottom = cpt.y-1;
m_pDockContext->m_rectFrameDragHorz.left = cpt.x-2;
return m_sizeMinFloating;
break;
case HTBOTTOMRIGHT:
m_sizeMinFloating.cx = max(cpt.x-rcWin.left,32);
m_sizeMinFloating.cy = max(cpt.y-rcWin.top -nGapGripper,32) ;
m_pDockContext->m_rectFrameDragHorz.top = rcWin.top;
m_pDockContext->m_rectFrameDragHorz.bottom = cpt.y+1;
m_pDockContext->m_rectFrameDragHorz.right = cpt.x+2;
return m_sizeMinFloating;
break;
}
}
if(nMode & LM_LENGTHY)
m_sizeMinFloating.cy = max(nLength,32);
else
m_sizeMinFloating.cx = max(nLength,32);
return m_sizeMinFloating;
}
void CGuiControlBar::ScrollOff()
{
ScrollOnEfect(FALSE);
GetDockingFrame()->ShowControlBar(this, FALSE, FALSE);
}
void CGuiControlBar::ScrollOn()
{
m_sizeMinFloating1=m_sizeMinFloating;
GetDockingFrame()->ShowControlBar(this, TRUE, TRUE);
if (m_nLastAlingDocking ==CBRS_ALIGN_LEFT || m_nLastAlingDocking == CBRS_ALIGN_RIGHT)
{
m_nSizeMed= m_sizeMinFloating.cx/GUI_NUMITER;
m_sizeMinFloating.cx=0;
}
else
{
m_nSizeMed= m_sizeMinFloating.cy/GUI_NUMITER;
m_sizeMinFloating.cy=0;
}
ScrollOnEfect(TRUE);
}
void CGuiControlBar::ScrollOnEfect(BOOL on)
{
CRect rcW;
CRect rcC;
CRect rcFrameClient;
CRect rcWinScroll;
GetClientRect(rcC);
GetWindowRect(rcWinScroll);
CDockBar* pDockBar = m_pDockBar;
CMiniDockFrameWnd* pDockFrame = (CMiniDockFrameWnd*)pDockBar->GetParent();
CFrameWnd* pFrame = reinterpret_cast<CFrameWnd*>(AfxGetMainWnd());
CRect rc1;
m_bComplete=FALSE;
long iWidth80;
long iWidth20;
long iGUI_NUMITER=GUI_NUMITER;
if (IsHideVert())
{
iWidth80=m_sizeMinFloating1.cx/iGUI_NUMITER;
iWidth20=m_sizeMinFloating1.cx/iGUI_NUMITER;
}
else
{
iWidth80=m_sizeMinFloating1.cy/iGUI_NUMITER;
iWidth20=m_sizeMinFloating1.cy/iGUI_NUMITER;
}
for(int i=0; i< iGUI_NUMITER; i++)
{
if (IsHideVert())
{
if (IsHideLeft())
m_pDockSite->GetControlBar(CBRS_ALIGN_LEFT)->GetWindowRect(rcW);
else
m_pDockSite->GetControlBar(CBRS_ALIGN_RIGHT)->GetWindowRect(rcW);
}
else
{
if(IsHideBottom())
{
m_pDockSite->GetControlBar(CBRS_ALIGN_BOTTOM)->GetWindowRect(rcW);
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_BOTTOM)->GetWindowRect(rcFrameClient);
m_sizeMinFloating.cx=rcFrameClient.Width();
}
else
{
m_pDockSite->GetControlBar(CBRS_ALIGN_TOP)->GetWindowRect(rcW);
m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_TOP)->GetWindowRect(rcFrameClient);
m_sizeMinFloating.cx=rcFrameClient.Width();
}
}
if (on)
{
if (IsHideVert())
m_sizeMinFloating.cx+=(long)iWidth80;
else
m_sizeMinFloating.cy+=(long)iWidth80;
}
else
{
if (IsHideVert())
m_sizeMinFloating.cx-=(long)iWidth80;
else
m_sizeMinFloating.cy-=(long)iWidth80;
}
if (IsHideVert())
m_sizeMinFloating.cy=rcW.Height()-(rcW.Height()+m_pDockSite->GetControlBar(CBRS_ALIGN_TOP)->IsVisible()?24:0);
if (IsHideVert())
{
if (IsHideLeft())
rc1.left=rcW.right+24;
else
rc1.left=rcW.left-(m_sizeMinFloating.cx+26);
rc1.top=rcW.top;
rc1.right=rc1.left+m_sizeMinFloating.cx;
rc1.bottom=rc1.top+m_sizeMinFloating.cy;
}
else
{
if (IsHideBottom())
rc1.top=rcW.top-(m_sizeMinFloating.cy+26);
else
rc1.top=rcW.bottom+26;
rc1.left=rcFrameClient.left;
rc1.right=rc1.left+m_sizeMinFloating.cx;
rc1.bottom=rc1.top+m_sizeMinFloating.cy;
}
pDockFrame->SetWindowPos(reinterpret_cast<CWnd*>(HWND_TOP),rc1.left,rc1.top, rc1.Width(),rc1.Height(),SWP_HIDEWINDOW);
CRect rcInvalidateClient(rc1);
MapWindowPoints(NULL,&rcInvalidateClient);
pDockFrame->RecalcLayout(TRUE);
pDockFrame->UpdateWindow();
pDockFrame->SetWindowPos(reinterpret_cast<CWnd*>(HWND_TOP), rc1.left,rc1.top, rc1.Width(),rc1.Height(),
SWP_SHOWWINDOW|SWP_NOACTIVATE);
RedrawWindow(&rcInvalidateClient,NULL, RDW_UPDATENOW);
if(!on)
{
pFrame->RecalcLayout(TRUE);
pFrame->UpdateWindow();
pFrame->RedrawWindow(&rcInvalidateClient,NULL,RDW_UPDATENOW);
}
//Sleep(10);
}
m_bComplete=TRUE;
m_sizeMinFloating=m_sizeMinFloating1;
if (!on)
{
pDockFrame->SetWindowPos(reinterpret_cast<CWnd*>(HWND_TOP),rc1.left,rc1.top, rc1.Width(),rc1.Height(),SWP_HIDEWINDOW);
}
else
{
pDockFrame->RecalcLayout(TRUE);
pDockFrame->UpdateWindow();
}
}
void CGuiControlBar::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
if (nIDEvent == 1)
{
if (m_stateBtn==NORMAL) return;
CRect rc;
CPoint pt(GetMessagePos());
CRect rcT=m_rcCloseBtn;
ClientToScreen(rcT);
pt.y+=23;
pt.x+=5;
if (!rcT.PtInRect(pt))
{
m_stateBtn=NORMAL;
KillTimer(1);
SendMessage(WM_NCPAINT);
}
}
if (nIDEvent == 2)
{
if (m_stateAHBtn==NORMAL) return;
CRect rc;
CPoint pt(GetMessagePos());
CRect rcT=m_rcAutoHideBtn;
ClientToScreen(rcT);
pt.y+=23;
pt.x+=5;
if (!rcT.PtInRect(pt))
{
m_stateAHBtn=NORMAL;
KillTimer(2);
SendMessage(WM_NCPAINT);
}
}
CControlBar::OnTimer(nIDEvent);
}
void CGuiControlBar::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(m_pDockBar != NULL)
{
ActiveCaption();
// m_pDockContext->ToggleDocking();
}
else
CWnd::OnLButtonDblClk(nFlags, point);
}
void CGuiControlBar::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_pDockBar != NULL)
{
// start the drag
ClientToScreen(&point);
// m_pDockContext->StartDrag(point);
}
else
CControlBar::OnLButtonDown(nFlags, point);
}
void CGuiControlBar::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_pDockBar != NULL)
{
// start the drag
ReleaseCapture();
m_pDockSite->UnlockWindowUpdate();
}
else
CControlBar::OnLButtonDown(nFlags, point);
}
void CGuiControlBar::OnMouseMove( UINT nHitTest, CPoint point)
{
if(m_bTracking)
{
if (GetCapture() != this)
{
//StopTracking(FALSE);
m_bTracking=FALSE;
}
OnInvertTracker(m_rcBorder);
//nuevos tamaños de la ventana
if (IsVert() || IsHideVert())
{
if (m_SideMove==HTLEFT || m_SideMove==HTRIGHT)
{
m_rcBorder.left=point.x;
m_rcBorder.right=m_rcBorder.left+4;
}
else
{
m_rcBorder.top=point.y+26;
m_rcBorder.bottom=m_rcBorder.top+4;
}
}
else
{
if (m_SideMove==HTBOTTOM || m_SideMove==HTTOP)
{
m_rcBorder.top=point.y+26;
m_rcBorder.bottom=m_rcBorder.top+4;
}
else
{
m_rcBorder.left=point.x;
m_rcBorder.right=m_rcBorder.left+4;
}
}
//--------------------------------------------------
//se hacen iguales todos los tamaños
//if(!m_bAutoHide)
{
ClientToScreen(&point);
m_pDockSite->ScreenToClient(&point);
}
m_ptActualPos=point;
OnInvertTracker(m_rcBorder);
//SetEqualWidth();
//-----------------------------------------------
}
}
//depende de la posicion se hace igual el tamanio del ancho o alto
void CGuiControlBar::SetEqualWidth()
{
int nFirstPos=GetFirstPos();
for (int nPos = nFirstPos; nPos <= m_Last; nPos++)
{
CGuiControlBar* pBar = GetGuiControlBar(nPos);
if (pBar== NULL) continue;
if (IsHorz())
pBar->m_sizeHorz.cy=m_sizeHorz.cy;//rcDockBar.Height();
else
pBar->m_sizeVert.cx=m_sizeVert.cx;
}
}
int CGuiControlBar::GetHiWid()
{
CRect rcWin;
CMenuDockBar* pDock=(CMenuDockBar*)m_pDockBar;
rcWin=pDock->m_rectLayout; //the real size
if(IsVert())
return rcWin.Height();
else
return rcWin.Width();
}
//espero que funcione el truco
//la idea es trabajar con coordenadas screen las dimensiones de los bordes del
//dockBar, mas no con los movimientos internos.
void CGuiControlBar::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CPoint ptTemp=point;
ClientToScreen(&ptTemp);
CRect rcFrame;
CDockBar* pDockBar = m_pDockBar;
BOOL isMDI=FALSE;
if (GetParentFrame()->IsKindOf(RUNTIME_CLASS(CGuiMDIFrame)))
isMDI=TRUE;
if (m_bAutoHide)
{
if (isMDI)
((CGuiMDIFrame*)GetParentFrame())->GetParent()->GetClientRect(rcFrame);
else
((CGuiFrameWnd*)GetParentFrame())->GetParent()->GetClientRect(rcFrame);
}
else
{
if (isMDI)
((CGuiMDIFrame*)GetParentFrame())->GetClientRect(rcFrame);
else
((CGuiFrameWnd*)GetParentFrame())->GetClientRect(rcFrame);
}
if (m_bTracking)
{
ReleaseCapture();
m_bTracking=FALSE;
OnInvertTracker(m_rcBorder);
m_pDockSite->UnlockWindowUpdate();
if (ptTemp ==m_ptStartPos) return;
if (IsVert())
{
if (m_SideMove==HTLEFT)
m_sizeVert.cx-=point.x;
else if(m_SideMove==HTRIGHT)
m_sizeVert.cx=point.x;
else if(m_SideMove==HTTOP)
AjustReDinSize(point);
}
else if (IsHorz())
{
if (m_SideMove==HTBOTTOM)
{
if (point.y < 0)
m_sizeHorz.cy+=abs(point.y);
else
m_sizeHorz.cy=point.y;
}
else if (m_SideMove==HTTOP)
{
if (point.y < 0)
m_sizeHorz.cy+=abs(point.y)-12;
else
m_sizeHorz.cy-=abs(point.y)+12;
}
else if (m_SideMove==HTRIGHT)
AjustReDinSize(point);
}
if (IsHideVert()== TRUE)
{
if (IsHideRight())
{
if(point.x<0)
m_sizeMinFloating.cx+=abs(point.x);
else
m_sizeMinFloating.cx-=point.x;
if (m_sizeMinFloating.cx < (rcFrame.Width()-50) && m_sizeMinFloating.cx > 20)
m_sizeMinFloating1=m_sizeMinFloating;
else
{
m_sizeMinFloating=m_sizeMinFloating1;
return;
}
CRect rc1;
CMiniDockFrameWnd* pDockFrame = (CMiniDockFrameWnd*)pDockBar->GetParent();
pDockFrame->GetWindowRect(rc1);
if(point.x<0)
rc1.right+=point.x;
else
rc1.right-=point.x;
ClientToScreen(&point);
pDockFrame->SetWindowPos(reinterpret_cast<CWnd*>(HWND_TOP),point.x-5,rc1.top, rc1.Width(),rc1.Height(),NULL);
}
else
{
m_sizeMinFloating.cx=point.x+8;
if (m_sizeMinFloating.cx < (rcFrame.Width()-50) && m_sizeMinFloating.cx > 20)
m_sizeMinFloating1=m_sizeMinFloating;
else
m_sizeMinFloating=m_sizeMinFloating1;
m_sizeMinFloating1=m_sizeMinFloating;
GetParentFrame()->RecalcLayout(TRUE);
}
return ;
}
if (IsHideTop() || IsHideBottom())
{
if(IsHideTop())
{
m_sizeMinFloating.cy=point.y+25;
if (m_sizeMinFloating.cy < (rcFrame.Height()-100) && m_sizeMinFloating.cy > 20)
m_sizeMinFloating1=m_sizeMinFloating;
else
{
m_sizeMinFloating=m_sizeMinFloating1;
return;
}
m_pDockSite->RecalcLayout();
GetParentFrame()->RecalcLayout(TRUE);
}
else
{
if(point.y<0)
m_sizeMinFloating.cy+=abs(point.y);
else
m_sizeMinFloating.cy-=point.y;
if (m_sizeMinFloating.cy < (rcFrame.Height()-100) && m_sizeMinFloating.cy > 20)
m_sizeMinFloating1=m_sizeMinFloating;
else
{
m_sizeMinFloating=m_sizeMinFloating1;
return ;
}
CRect rc1;
CDockBar* pDockBar = m_pDockBar;
CMiniDockFrameWnd* pDockFrame = (CMiniDockFrameWnd*)pDockBar->GetParent();
pDockFrame->GetWindowRect(rc1);
if(point.y<0)
rc1.top+=abs(point.y);
else
rc1.top-=point.y;
ClientToScreen(&point);
//m_sizeMinFloating.cx=rc1.Width();
//GetDockingFrame()->FloatControlBar(this,rc1.TopLeft());
pDockFrame->SetWindowPos(reinterpret_cast<CWnd*>(HWND_TOP),rc1.left,point.y, rc1.Width(),rc1.Height(),NULL);
}
return;
}
if (!m_bAutoHide)
SetEqualWidth();
}
if(!m_bAutoHide)
m_pDockSite->RecalcLayout();
}
//ajusta las ventanas a redimencionarlas verticalmente
//se decrementa las anteriores ventanas a la actual y se
//incrementan las posteriores.
void CGuiControlBar::AjustReDinSize(CPoint point)
{
int nFirstPos=GetFirstPos();
int nLastPos=GetLastPos();
int m_ThisPos=m_pDockBar->FindBar(this);
ClientToScreen(&point);
//si la diferencia es negativa esta barra crece la anterior a esta disminuye
int nDif=0;
BOOL bGrow=FALSE;
if (IsVert())
{
nDif=m_ptStartPos.y- point.y;
if (nDif > 0)
bGrow=TRUE;
if (bGrow)
m_sizeVert.cy+=abs(nDif)+4;
else
m_sizeVert.cy-=abs(nDif);
if (nFirstPos == m_ThisPos)
return;
}
else
{
nDif=m_ptStartPos.x- point.x;
if (nDif < 0)
bGrow=TRUE;
if (bGrow)
m_sizeHorz.cx+=abs(nDif);
else
m_sizeHorz.cx-=abs(nDif);
if (nLastPos == m_ThisPos)
return;
}
if (IsVert())
AjustVert(bGrow,nDif);
else
AjustHorz(bGrow,nDif);
RecalWindowPos();
}
void CGuiControlBar::AjustVert(BOOL bGrow,int nDif)
{
int nFirstPos=GetFirstPos();
int nLastPos=GetLastPos();
int m_ThisPos=m_pDockBar->FindBar(this);
if(m_SideMove==HTTOP)
{
//Esta ventana crece las anteriores reducen su tamaño
if (bGrow)
{
for (int i=m_ThisPos-1; i > 0; i--)
{
CGuiControlBar* pBar = GetGuiControlBar(i);
if (pBar== NULL) return;
if(IsVert())
{
if (pBar->m_sizeVert.cy-abs(nDif) < pBar->m_sizeMinV.cy)
{
pBar->m_sizeVert.cy=pBar->m_sizeMinV.cy;
continue;
}
else
{
pBar->m_sizeVert.cy-=abs(nDif);
break;
}
}
}//for
}//bGrow
else //este disminuye la anterior crece
{
if (m_ThisPos-1 > 0)
{
CGuiControlBar* pBar = GetGuiControlBar(m_ThisPos-1);
if (pBar== NULL) return;
pBar->m_sizeVert.cy+=abs(nDif);
if(m_sizeVert.cy > m_sizeMinV.cy)
return;
else
pBar->m_sizeVert.cy-=m_sizeMinV.cy;
}
for (int i=m_ThisPos+1; i >= m_Last; i++)
{
CGuiControlBar* pBar = GetGuiControlBar(i);
if (pBar== NULL) return;
if(IsVert())
{
if (pBar->m_sizeVert.cy-abs(nDif) < pBar->m_sizeMinV.cy)
continue;
else
{
pBar->m_sizeVert.cy-=abs(nDif);
return;
}
}
}//for
}
}
}
void CGuiControlBar::AjustHorz(BOOL bGrow,int nDif)
{
int nFirstPos=GetFirstPos();
int nLastPos=GetLastPos();
int m_ThisPos=m_pDockBar->FindBar(this);
if(m_SideMove==HTRIGHT)
{
//Esta ventana crece las anteriores reducen su tamaño
if (bGrow)
{
for (int i=m_ThisPos+1; i <= nLastPos; i++)
{
CGuiControlBar* pBar = GetGuiControlBar(i);
if (pBar== NULL) return;
if(IsHorz())
{
if (pBar->m_sizeHorz.cx-abs(nDif) < pBar->m_sizeMinH.cx)
{
pBar->m_sizeHorz.cx=pBar->m_sizeMinH.cx;
continue;
}
else
{
pBar->m_sizeHorz.cx-=abs(nDif);
break;
}
}
}//for
}//bGrow
else //este disminuye la anterior crece
{
if (m_ThisPos+1 <= m_Last)
{
CGuiControlBar* pBar = GetGuiControlBar(m_ThisPos+1);
if (pBar== NULL) return;
pBar->m_sizeHorz.cx+=abs(nDif);
if(m_sizeHorz.cx > m_sizeMinH.cx)
return;
else
pBar->m_sizeHorz.cx+=abs(nDif);
}
for (int i=m_ThisPos-1; i >0; i--)
{
CGuiControlBar* pBar = GetGuiControlBar(i);
if (pBar== NULL) return;
if(IsHorz())
{
if (pBar->m_sizeHorz.cx-abs(nDif) < pBar->m_sizeMinH.cx)
continue;
else
{
pBar->m_sizeHorz.cx-=abs(nDif);
return;
}
}
}//for
}
}
}
//----------------------------------------------------
//OnActiveWindow retira o asigna el foco a la ventana
void CGuiControlBar::OnActiveWindow()
{
POSITION pos = m_pDockSite->m_listControlBars.GetHeadPosition();
while (pos != NULL)
{
CDockBar* pDockBar = (CDockBar*)m_pDockSite->m_listControlBars.GetNext(pos);
if (pDockBar->IsDockBar() && pDockBar->IsWindowVisible() &&
(!pDockBar->m_bFloating || m_bAutoHide))
{
int nNumBars=(int)pDockBar->m_arrBars.GetSize();
for(int i=0; i< nNumBars;i++)
{
CGuiControlBar* pBar = (CGuiControlBar*) pDockBar->m_arrBars[i];
if (HIWORD(pBar) == NULL) continue;
if (!pBar->IsVisible()) continue;
if (!pBar->IsKindOf(RUNTIME_CLASS(CGuiControlBar))) continue;
if (pBar != this)
{
pBar->m_bOldActive=FALSE;
pBar->m_bActive=FALSE;
pBar->m_bForcepaint=TRUE;
pBar->SendMessage(WM_NCPAINT);
pBar->m_bForcepaint=FALSE;
}
else
{
m_bOldActive=m_bActive;
m_bActive=TRUE;
m_bForcepaint=TRUE;
SendMessage(WM_NCPAINT);
m_bForcepaint=FALSE;
}
}
}
}
}
void CGuiControlBar::ActiveCaption()
{
CWnd* pFocus=SetFocus();
if(pFocus->GetSafeHwnd())
IsChild(pFocus);
m_bForcepaint=TRUE;
OnActiveWindow();
m_bForcepaint=FALSE;
}
void CGuiControlBar::OnNcRButtonDown(UINT nHitTest, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_bTracking /*|| IsFloating()*/)
return;
// ScreenToScreen (&point);
CMenu m_menu;
if (m_MenuContext!=NULL)
{
m_menu.LoadMenu(m_MenuContext);
CMenu* m_SubMenu = m_menu.GetSubMenu(0);
m_SubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL,
point.x, point.y-2, AfxGetMainWnd());
Invalidate();
UpdateWindow();
}
CWnd::OnNcLButtonDown(nHitTest, point);
}
void CGuiControlBar::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_bTracking /*|| IsFloating()*/)
return;
m_ptStartPos=point;
if( nHitTest == HTCAPTION || nHitTest == HTCLOSE || nHitTest == HTPIN)
ActiveCaption();
//---------para el boton----
if( nHitTest == HTCLOSE)
{
m_stateBtn=PRESS;
SendMessage(WM_NCPAINT);
/*SetTimer(1,100,0);
CRect rc;
CGuiMiniFrameWnd* p = new CGuiMiniFrameWnd;
if (!p->Create(this,this,CRect(100,100,300,400),
_T("Title"),300))
{
}*/
return;
}
if( nHitTest == HTPIN)
{
m_stateAHBtn=PRESS;
SendMessage(WM_NCPAINT);
/*SetTimer(1,100,0);
CRect rc;
CGuiMiniFrameWnd* p = new CGuiMiniFrameWnd;
if (!p->Create(this,this,CRect(100,100,300,400),
_T("Title"),300))
{
}*/
return;
}
//--------------------------
if (m_pDockBar != NULL )
{
if (HTCAPTION == nHitTest && !m_bAutoHide)
{
m_pDockContext->StartDrag(point);
m_sizeHorzt=m_sizeHorz;
m_sizeVertt=m_sizeVert;
}
if(!m_bTracking)
{
if(m_rcBorder.PtInRect(point))
{
m_pDockSite->LockWindowUpdate();
OnInvertTracker(m_rcBorder);
m_ptStartPos=point;
SetCapture();
SetFocus();
m_bTracking=TRUE;
m_sizeHorzt=m_sizeHorz;
m_sizeVertt=m_sizeVert;
}
}
}
//other bug fixed
// CWnd::OnNcLButtonDown(nHitTest, point);
}
void CGuiControlBar::InitAutoHide()
{
if (m_bAutoHide==TRUE)
{
m_stateBtn=NORMAL;
m_sizeMinFloatingBck=m_sizeMinFloating;
Porc=0.0;
KillTimer(1);
CGuiMDIFrame* pB=(CGuiMDIFrame*)pMf;
pB->FloatControlBar(this,CPoint(400,400));
if(IsHideRight())
{
m_nLastAlingDocking=CBRS_ALIGN_RIGHT;
pB->m_dockHideRight.AddToolBars(this);
}
if(IsHideLeft())
{
m_nLastAlingDocking=CBRS_ALIGN_LEFT;
pB->m_dockHideLeft.AddToolBars(this);
}
if(IsHideTop())
{
m_nLastAlingDocking=CBRS_ALIGN_TOP;
pB->m_dockHideTop.AddToolBars(this);
}
if(IsHideBottom())
{
m_nLastAlingDocking=CBRS_ALIGN_BOTTOM;
pB->m_dockHideBottom.AddToolBars(this);
}
GetDockingFrame()->ShowControlBar(this, FALSE, FALSE);
GetDockingFrame()->FloatControlBar(this,CPoint(400,400));
GetParent()->GetParent()->ModifyStyle(WS_CAPTION,0);
}
else
m_IsLoadDocking=FALSE;
}
void CGuiControlBar::OnNcLButtonUp(UINT nHitTest, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CRect rc;
//------------------ para el boton
CRect rcT=m_rcCloseBtn;
ClientToScreen(rcT);
point.y+=23;
point.x+=5;
if (rcT.PtInRect(point))
{
if (m_stateBtn ==PRESS)
{
m_stateBtn=NORMAL;
KillTimer(1);
if (m_bAutoHide)
{
m_bAutoHide=FALSE;
GetParent()->GetParent()->ModifyStyle(WS_CAPTION,1);
CGuiMDIFrame* pB;
CGuiFrameWnd* pB1;
BOOL isMDI=FALSE;
if (pMf->IsKindOf(RUNTIME_CLASS(CGuiMDIFrame)))
isMDI=TRUE;
if (isMDI)
pB=(CGuiMDIFrame*)pMf;
else
pB1= (CGuiFrameWnd*)pMf;
if(m_nLastAlingDocking==CBRS_ALIGN_RIGHT)
{
if (isMDI)
{
pB->m_dockHideRight.DeleteToolBars(this);
pB->DockControlBar(this, AFX_IDW_DOCKBAR_RIGHT);
}
else
{
pB1->m_dockHideRight.DeleteToolBars(this);
pB1->DockControlBar(this, AFX_IDW_DOCKBAR_RIGHT);
}
}
if(m_nLastAlingDocking==CBRS_ALIGN_LEFT)
{
if (isMDI)
{
pB->m_dockHideLeft.DeleteToolBars(this);
pB->DockControlBar(this, AFX_IDW_DOCKBAR_LEFT);
}
else
{
pB1->m_dockHideLeft.DeleteToolBars(this);
pB1->DockControlBar(this, AFX_IDW_DOCKBAR_LEFT);
}
}
if(m_nLastAlingDocking==CBRS_ALIGN_TOP)
{
if (isMDI)
{
pB->m_dockHideTop.DeleteToolBars(this);
pB->DockControlBar(this, AFX_IDW_DOCKBAR_TOP);
}
else
{
pB1->m_dockHideTop.DeleteToolBars(this);
pB1->DockControlBar(this, AFX_IDW_DOCKBAR_TOP);
}
}
if(m_nLastAlingDocking==CBRS_ALIGN_BOTTOM)
{
if (isMDI)
{
pB->m_dockHideBottom.DeleteToolBars(this);
pB->DockControlBar(this, AFX_IDW_DOCKBAR_BOTTOM);
}
else
{
pB1->m_dockHideBottom.DeleteToolBars(this);
pB1->DockControlBar(this, AFX_IDW_DOCKBAR_BOTTOM);
}
}
m_nLastAlingDocking=0;
// SendMessage(WM_NCLBUTTONDBLCLK);
}
//--------------------------------------------------------------
GetDockingFrame()->ShowControlBar(this, FALSE, FALSE);
}
SendMessage(WM_NCPAINT);
m_pDockSite->RecalcLayout();
return;
}
//ojo guardar el aling de la ventana
rcT=m_rcAutoHideBtn;
ClientToScreen(rcT);
if (rcT.PtInRect(point))
{
if (m_stateAHBtn ==PRESS)
{
if (m_bAutoHide)
{
CGuiMDIFrame* pB;
CGuiFrameWnd* pB1;
BOOL isMDI=FALSE;
m_bAutoHide=FALSE;
m_sizeMinFloating=m_sizeMinFloatingBck;
GetParent()->GetParent()->ModifyStyle(WS_CAPTION,1);
pB=(CGuiMDIFrame*)pMf;
if (pMf->IsKindOf(RUNTIME_CLASS(CGuiMDIFrame)))
isMDI=TRUE;
if (isMDI)
pB=(CGuiMDIFrame*)pMf;
else
pB1= (CGuiFrameWnd*)pMf;
if(m_nLastAlingDocking==CBRS_ALIGN_RIGHT)
{
if (isMDI)
{
pB->m_dockHideRight.DeleteToolBars(this);
pB->DockControlBar(this, AFX_IDW_DOCKBAR_RIGHT);
}
else
{
pB1->m_dockHideRight.DeleteToolBars(this);
pB1->DockControlBar(this, AFX_IDW_DOCKBAR_RIGHT);
}
}
if(m_nLastAlingDocking==CBRS_ALIGN_LEFT)
{
if (isMDI)
{
pB->m_dockHideLeft.DeleteToolBars(this);
pB->DockControlBar(this, AFX_IDW_DOCKBAR_LEFT);
}
else
{
pB1->m_dockHideLeft.DeleteToolBars(this);
pB1->DockControlBar(this, AFX_IDW_DOCKBAR_LEFT);
}
}
if(m_nLastAlingDocking==CBRS_ALIGN_TOP)
{
if (isMDI)
{
pB->m_dockHideTop.DeleteToolBars(this);
pB->DockControlBar(this, AFX_IDW_DOCKBAR_TOP);
}
else
{
pB1->m_dockHideTop.DeleteToolBars(this);
pB1->DockControlBar(this, AFX_IDW_DOCKBAR_TOP);
}
}
if(m_nLastAlingDocking==CBRS_ALIGN_BOTTOM)
{
if (isMDI)
{
pB->m_dockHideBottom.DeleteToolBars(this);
pB->DockControlBar(this, AFX_IDW_DOCKBAR_BOTTOM);
}
else
{
pB1->m_dockHideBottom.DeleteToolBars(this);
pB1->DockControlBar(this, AFX_IDW_DOCKBAR_BOTTOM);
}
}
GetDockingFrame()->ShowControlBar(this, TRUE, TRUE);
m_nLastAlingDocking=0;
// SendMessage(WM_NCLBUTTONDBLCLK);
}
else
{
m_sizeMinFloatingBck=m_sizeMinFloating;
m_stateBtn=NORMAL;
m_bAutoHide=TRUE;
Porc=0.0;
KillTimer(1);
CGuiMDIFrame* pB;
CGuiFrameWnd* pB1;
pMf=GetParentFrame();
BOOL isMDI=FALSE;
if (pMf->IsKindOf(RUNTIME_CLASS(CGuiMDIFrame)))
isMDI=TRUE;
if (isMDI)
pB=(CGuiMDIFrame*)pMf;
else
pB1= (CGuiFrameWnd*)pMf;
if(IsRight())
{
m_nLastAlingDocking=CBRS_ALIGN_RIGHT;
if (isMDI)
pB->m_dockHideRight.AddToolBars(this);
else
pB1->m_dockHideRight.AddToolBars(this);
}
if(IsLeft())
{
m_nLastAlingDocking=CBRS_ALIGN_LEFT;
if (isMDI)
pB->m_dockHideLeft.AddToolBars(this);
else
pB1->m_dockHideLeft.AddToolBars(this);
}
if(IsTop())
{
m_nLastAlingDocking=CBRS_ALIGN_TOP;
if (isMDI)
pB->m_dockHideTop.AddToolBars(this);
else
pB1->m_dockHideTop.AddToolBars(this);
}
if(IsBottom())
{
m_nLastAlingDocking=CBRS_ALIGN_BOTTOM;
if (isMDI)
pB->m_dockHideBottom.AddToolBars(this);
else
pB1->m_dockHideBottom.AddToolBars(this);
}
// if (isMDI)
{
GetDockingFrame()->ShowControlBar(this, FALSE, FALSE);
GetDockingFrame()->FloatControlBar(this,CPoint(400,400));
}
/* else
{
pB1->ShowControlBar(this, FALSE, FALSE);
pB1->FloatControlBar(this,CPoint(400,400));
}*/
GetParent()->GetParent()->ModifyStyle(WS_CAPTION,0);
}
}
SendMessage(WM_NCPAINT);
m_pDockSite->RecalcLayout();
return;
}
//-------------------para el boton
m_pDockSite->RecalcLayout();
}
void CGuiControlBar::OnNcPaint()
{
// TODO: Add your message handler code here
// Do not call CControlBar::OnNcPaint() for painting messages
// Tomo la misma rutina que se desarrolla para la clase
// CGuiToolBarWnd.
CRect rcWindow;
CRect rcClient;
CWindowDC dc(this);
CDC m_dc; //contexto de dispositivo en memoria
CBitmap m_bitmap;
//la idea es tomar el area de la ventana y area cliente , luego debemos
//igualar el area de coordenadas de ventana al cliente
GetWindowRect(&rcWindow);
GetClientRect(&rcClient);
ScreenToClient(rcWindow);
rcClient.OffsetRect(-rcWindow.TopLeft());
rcWindow.OffsetRect(-rcWindow.TopLeft());
m_dc.CreateCompatibleDC(&dc);
m_bitmap.CreateCompatibleBitmap(&dc,rcWindow.Width(),rcWindow.Height());
CBitmap *m_OldBitmap=m_dc.SelectObject(&m_bitmap);
//aqui debe utilizarse la brocha que define GuiDrawLayer, si no hacemos la siguiente
//linea usted vera un horrible color negro, a cambio del dibujo.
CBrush cb;
cb.CreateSolidBrush(m_clrFondo);
m_dc.FillRect(rcWindow, &cb);
DrawGripper(&m_dc,&rcWindow);
dc.IntersectClipRect(rcWindow);
dc.ExcludeClipRect(rcClient);//asi evitamos el parpadeo
dc.BitBlt(rcWindow.left,rcWindow.top,rcWindow.Width(),rcWindow.Height(),&m_dc,0,0,SRCCOPY);
//ReleaseDC(&dc); //TODO--PAUL
//::ReleaseDC(m_hWnd, dc.Detach());
m_dc.SelectObject(m_OldBitmap);
m_bitmap.DeleteObject();
m_dc.DeleteDC();
}
void CGuiControlBar::DrawGripper(CDC* pDC,CRect* rc)
{
CRect gripper = rc;
gripper.top =3;
gripper.left+=4;
if (IsVert())
gripper.right-=!IsFloating()?!IsRight()?6:3:2;
else
gripper.right-=3;
if(m_StyleDisplay == GUISTYLE_XP)
gripper.bottom =gripper.top +nGapGripper-3;
if(m_StyleDisplay == GUISTYLE_2003)
gripper.bottom =gripper.top +nGapGripper+1;
//si la ventana esta activa pintamos el caption o el area del titulo de color azul
if (m_bAutoHide)
m_bActive=FALSE;
else if (IsFloating() )
m_bActive=TRUE;
if(!m_bActive)
{
if (m_StyleDisplay == GUISTYLE_2003)
{
CGradient M(CSize(gripper.Width(),gripper.Height()));
M.PrepareVertical(pDC,m_StyleDisplay);
M.Draw(pDC,4,0,0,0,gripper.Width(),gripper.Height(),SRCCOPY);
}
if (m_StyleDisplay == GUISTYLE_XP)
{
CPen cp(PS_SOLID,1,::GetSysColor(COLOR_BTNSHADOW));
CPen* cpold=pDC->SelectObject(&cp);
//linea superior
pDC->MoveTo(gripper.left+1,gripper.top);
pDC->LineTo(gripper.right,gripper.top);
//linea izquierda
pDC->MoveTo(gripper.left,gripper.top+1);
pDC->LineTo(gripper.left,gripper.bottom);
//linea inferior
pDC->MoveTo(gripper.left+1,gripper.bottom);
pDC->LineTo(gripper.right,gripper.bottom);
//linea derecha
pDC->MoveTo(gripper.right,gripper.top+1);
pDC->LineTo(gripper.right,gripper.bottom);
pDC->SelectObject(cpold);
}
}
else
{
if (m_StyleDisplay == GUISTYLE_XP)
{
CBrush cb;
cb.CreateSolidBrush(::GetSysColor(COLOR_ACTIVECAPTION));//GuiDrawLayer::GetRGBCaptionXP());
pDC->FillRect(gripper,&cb);
cb.DeleteObject();
}
if (m_StyleDisplay == GUISTYLE_2003)
{
CGradient M(CSize(gripper.Width(),gripper.Height()));
M.PrepareCaption(pDC,m_StyleDisplay);
M.Draw(pDC,4,0,0,0,gripper.Width(),gripper.Height(),SRCCOPY);
}
}
if(m_StyleDisplay == GUISTYLE_2003) //no es XP
{
CRect rcWin=gripper;
//rcWin.left= gripper.left;
rcWin.top+=5;
rcWin.left+=5;
rcWin.right=rcWin.left+2;
rcWin.bottom-=4;
CRect rcBlack;
for (int i=0; i < rcWin.Height(); i+=4)
{
CRect rcWindow;
CBrush cb;
cb.CreateSolidBrush(::GetSysColor(COLOR_BTNHIGHLIGHT));
rcWindow=rcWin;
rcWindow.top=rcWin.top+i;
rcWindow.bottom=rcWindow.top+2;
pDC->FillRect(rcWindow,&cb);
rcBlack=rcWindow;
rcBlack.left-=1;
rcBlack.top=(rcWin.top+i)-1;
rcBlack.bottom=rcBlack.top+2;
rcBlack.right=rcBlack.left+2;
cb.DeleteObject();
cb.CreateSolidBrush(GuiDrawLayer::GetRGBColorShadow(m_StyleDisplay));
pDC->FillRect(rcBlack,&cb);
}
}
gripper.DeflateRect(1, 1);
CString m_caption;
GetWindowText(m_caption);
CFont m_cfont;
m_cfont.CreateFont(-11,0,0,0,400,0,0,0,0,1,2,1,34,_T("Verdana"));
CFont* m_fontOld=pDC->SelectObject(&m_cfont);
int nMode = pDC->SetBkMode(TRANSPARENT);
CString m_cadBreak=m_caption;
CSize SizeCad=pDC->GetTextExtent(m_cadBreak,m_cadBreak.GetLength());
CRect rCText=gripper;
rCText.top=6;
rCText.bottom =rCText.top+14;
int cont=m_cadBreak.GetLength();
if (SizeCad.cx > (gripper.Width()-30))
{
while(cont > 1 )
{
CString m_scadtemp=m_cadBreak+"...";
CSize coor=pDC->GetTextExtent(m_scadtemp,m_scadtemp.GetLength());
if(coor.cx > (gripper.Width()-30))
{
m_cadBreak=m_cadBreak.Left(m_cadBreak.GetLength()-1);
}
else
break;
cont--;
}
m_cadBreak+=_T("...");
}
if (gripper.Width() > 0 )
if (!m_bActive)
pDC->TextOut(rCText.left+8,rCText.top,m_cadBreak);
else
{
if (GuiDrawLayer::m_Style == GUISTYLE_XP)
pDC->SetTextColor(RGB(255,255,255));
pDC->TextOut(rCText.left+8,rCText.top,m_cadBreak);
}
//CRect gripper;
//------------------------------------------------
GetWindowRect( gripper );
ScreenToClient( gripper );
gripper.OffsetRect( -gripper.left, -gripper.top );
gripper.left=gripper.right-20;
gripper.right-=7;
gripper.top+=6;
gripper.bottom=gripper.top+13;
m_rcAutoHideBtn=gripper;
m_rcAutoHideBtn.right-=14;
m_rcAutoHideBtn.left-=14;
m_rcCloseBtn=gripper;
//m_rcCloseBtn.left-=4;
//ClientToScreen(m_rcCloseBtn);
if(!m_bAutoHide)
m_AutoHideBtn.SetData(12,_T("Auto Hide"));
else
m_AutoHideBtn.SetData(14,_T("Auto Hide"));
m_CloseBtn.Paint(pDC,m_stateBtn,gripper,NULL_BRUSH,m_bActive && GuiDrawLayer::m_Style != GUISTYLE_2003);
m_AutoHideBtn.Paint(pDC,m_stateAHBtn,m_rcAutoHideBtn,NULL_BRUSH,m_bActive && GuiDrawLayer::m_Style != GUISTYLE_2003);
//------------------------------------------------
pDC->SetBkMode(nMode);
pDC->SelectObject(m_fontOld);
}
//en esta función se calcula el area cliente que podra ser utilizado
//por ventanas que deriven esta clase.
void CGuiControlBar::OnNcCalcSize(BOOL /*bCalcValidRects*/, NCCALCSIZE_PARAMS* lpncsp)
{
// adjust non-client area for border space
lpncsp->rgrc[0].left +=!IsFloating() || m_bAutoHide ?5:2;
lpncsp->rgrc[0].top +=!IsFloating() || m_bAutoHide ?nGapGripper+3:3;
if (IsVert())
lpncsp->rgrc[0].right -=!IsFloating() || m_bAutoHide?!IsRight()?5:2:2;
else
lpncsp->rgrc[0].right -=3;
lpncsp->rgrc[0].bottom -=!IsFloating()||m_bAutoHide?3:2;
}
//Aqui la idea es verificar que si se da clic sobre otra ventana de este tipo
//automaticamente emita un mensaje eliminando el caption que la identifica como
//ventana default.
void CGuiControlBar::OnWindowPosChanged(WINDOWPOS* lpwndpos)
{
CRect rc;
GetClientRect(rc);
nDockBarAling = GetParent()->GetDlgCtrlID();
if(!IsFloating())
m_nLastAlingDockingBck=nDockBarAling;
//envie un recalculo del area cliente solo si el tamaño ha sido
//cambiado, de lo contrario permanezca igual
lpwndpos->flags |= SWP_FRAMECHANGED;
CControlBar::OnWindowPosChanged(lpwndpos);
CWnd* pWnd = GetWindow(GW_CHILD);
if (!m_bSupportMultiView)
{
if (pWnd != NULL)
{
pWnd->MoveWindow(rc);
ASSERT(pWnd->GetWindow(GW_HWNDNEXT) == NULL);
}
}
else
{
while (pWnd != NULL)
{
if (pWnd->IsWindowVisible())
{
pWnd->MoveWindow(rc);
break;
}
pWnd=pWnd->GetWindow(GW_HWNDNEXT);
}
}
}
//este conjunto de clases nos indican el estado de la ventana
//en un momento determinado
BOOL CGuiControlBar::IsHideVert()
{
if (m_nLastAlingDocking ==CBRS_ALIGN_LEFT || m_nLastAlingDocking == CBRS_ALIGN_RIGHT)
return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsHideLeft()
{
if (m_nLastAlingDocking ==CBRS_ALIGN_LEFT) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsHideRight()
{
if (m_nLastAlingDocking == CBRS_ALIGN_RIGHT) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsHideTop()
{
if (m_nLastAlingDocking == CBRS_ALIGN_TOP) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsHideBottom()
{
if (m_nLastAlingDocking == CBRS_ALIGN_BOTTOM) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsLeft()
{
if (nDockBarAling == AFX_IDW_DOCKBAR_LEFT) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsRight()
{
if (nDockBarAling == AFX_IDW_DOCKBAR_RIGHT) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsTop()
{
if (nDockBarAling == AFX_IDW_DOCKBAR_TOP) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsBottom()
{
if (nDockBarAling == AFX_IDW_DOCKBAR_BOTTOM) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsVert()
{
if (IsLeft() || IsRight()) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsHorz()
{
if (IsTop() || IsBottom()) return TRUE;
return FALSE;
}
BOOL CGuiControlBar::IsFloating()
{
if (nDockBarAling == AFX_IDW_DOCKBAR_FLOAT) return TRUE;
return FALSE;
}
void CGuiControlBar::OnPaint()
{
CPaintDC dc(this); // device context for painting
m_pDockSite->RecalcLayout();//si quita esto se tiene problemas
// TODO: Add your message handler code here
// Do not call CControlBar::OnPaint() for painting messages
}
UINT CGuiControlBar::OnNcHitTest(CPoint point)
{
// TODO: Add your message handler code here and/or call default
CRect rcWindow;
//no se convierte las coordenadas de pantalla porque el punto
//entregado por esta función esta dado en el mismo sentido.
GetWindowRect(rcWindow);
int it=0;
// if (IsFloating())
// return CControlBar::OnNcHitTest(point);
CRect rcT=m_rcCloseBtn;
ClientToScreen(rcT);
CPoint pt=point;
pt.y+=23;
pt.x+=5;
//pt.Offset(-rcT.left,-rcT.top);
if (rcT.PtInRect(pt))
return HTCLOSE;
rcT=m_rcAutoHideBtn;
ClientToScreen(rcT);
pt=point;
pt.y+=23;
pt.x+=5;
if (rcT.PtInRect(pt))
return HTPIN;
CRect rcTemp;
for (int i=0; i< 4; i++)
{
rcTemp=rcWindow;
if (i== 0) //left
{
it= rcTemp.left;
it+=4;
rcTemp.right=it;
m_rcBorder=rcTemp;
if (rcTemp.PtInRect(point))
if(IsLegal(HTLEFT)) return m_SideMove=HTLEFT;
}
if (i==1) //top
{
it= rcTemp.top;
it+=4;
rcTemp.bottom=it;
m_rcBorder=rcTemp;
if (rcTemp.PtInRect(point))
if(IsLegal(HTTOP)) return m_SideMove=HTTOP ;
}
if (i==2) //right
{
it= rcTemp.right;
it-=4;
rcTemp.left=it;
m_rcBorder=rcTemp;
if (rcTemp.PtInRect(point))
if (IsLegal(HTRIGHT)) return m_SideMove=HTRIGHT;
}
if (i==3) //bottom
{
it= rcTemp.bottom;
it-=4;
rcTemp.top=it;
m_rcBorder=rcTemp;
if (rcTemp.PtInRect(point))
if (IsLegal(HTBOTTOM))return m_SideMove=HTBOTTOM;
}
}
it=0;
rcTemp=rcWindow;
it= rcTemp.top+nGapGripper;
rcTemp.bottom=it;
if (rcTemp.PtInRect(point))
{
SetCursor(::LoadCursor(NULL,IDC_ARROW));
return m_SideMove=HTCAPTION;
}
return CControlBar::OnNcHitTest(point);
}
//-----------------------------------------------------------
//aqui se verifica que las coordenadas de cambio de tamaño
//sean las correctas
BOOL CGuiControlBar::IsLegal(UINT uAlin)
{
m_First=GetFirstPos();
// if (IsFloating()) return FALSE;
switch(uAlin)
{
case HTLEFT:
if(!m_bAutoHide)
{
if (IsHorz() && m_pos >0 && (m_pos != m_Last && m_pos != m_First)) return TRUE;
if (IsVert() && m_pos <= m_Last && IsRight() ) return TRUE;
}
else
{
if (!IsHideVert() && m_pos >0 && (m_pos != m_Last && m_pos != m_First)) return TRUE;
if (IsHideVert() && m_pos <= m_Last && IsHideRight() ) return TRUE;
}
return FALSE;
break;
case HTTOP:
if(!m_bAutoHide)
{
if (m_pos != m_First && IsVert()) return TRUE;
if (IsHorz() && m_pos <= m_Last && IsBottom() ) return TRUE;
}
else
{
if (m_pos != m_First && IsHideVert()) return TRUE;
if (!IsHideVert() && m_pos <= m_Last && IsHideBottom() ) return TRUE;
}
return FALSE;
break;
case HTRIGHT:
if(!m_bAutoHide)
{
if (m_pos <= m_Last && IsVert() && IsLeft() ) return TRUE;
if (IsHorz() && m_pos >0 && m_pos != m_Last) return TRUE;
}
else
{
if (m_pos <= m_Last && IsHideVert() && IsHideLeft() ) return TRUE;
if (!IsHideVert() && m_pos >0 && m_pos != m_Last) return TRUE;
}
return FALSE;
case HTBOTTOM:
if(!m_bAutoHide)
{
if ((m_pos != m_Last && m_pos != m_First) && IsHorz() && IsBottom()) return TRUE;
if (m_pos <= m_Last && IsHorz() && IsTop()) return TRUE;
}
else
{
if ((m_pos != m_Last && m_pos != m_First) && !IsHideVert() && IsHideBottom()) return TRUE;
if (m_pos <= m_Last && !IsHideVert() && IsHideTop()) return TRUE;
}
//if (IsVert() && m_pos >0 ) return TRUE;
return FALSE;
break;
}
return FALSE;
}
//----------------------------------------------
//debemos obtener cuantas barras existen en esta columnas
//porque si intentamos obtener el conteo con la funciones de dockbar
//siempre obtendremos nuestra actual barra mas otra de otra fila, por lo que
//el conteo es incorrecto, luego despues de nuestra barra la siguiente nula
//es el final de esta fila.
int CGuiControlBar::GetLastPos()
{
int nNumBars=(int)m_pDockBar->m_arrBars.GetSize();
int m_pos=m_pDockBar->FindBar(this);
for(int i=m_pos+1; i< nNumBars;i++)
{
if (m_pDockBar->m_arrBars[i]== NULL)
return i-1;
}
return -1;
}
//--------------------------------------------
//esta rutina funciona algo parecido a la anterior
//con la diferencia que ahora se parte desde la posicion
//que indetifica m_pos hacia atraz hasta encontrar el nulo
int CGuiControlBar::GetFirstPos()
{
int m_pos=m_pDockBar->FindBar(this);
for(int i=m_pos; i>=0;i--)
{
if (m_pDockBar->m_arrBars[i]== NULL)
return i+1;
}
return -1;
}
//------------------------------------------------------------------------
BOOL CGuiControlBar::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
if (IsFloating() && !m_bAutoHide) return 0;
CPoint ptCursor;
::GetCursorPos (&ptCursor);
if(nHitTest == HTLEFT ||nHitTest == HTRIGHT)
SetCursor(AfxGetApp ()->LoadCursor (AFX_IDC_HSPLITBAR));
else if(nHitTest == HTTOP ||nHitTest == HTBOTTOM)
SetCursor(AfxGetApp ()->LoadCursor (AFX_IDC_VSPLITBAR));
else
return CControlBar::OnSetCursor(pWnd, nHitTest, message);
return 1;
}
void CGuiControlBar::OnInvertTracker(const CRect& rect)
{
ASSERT_VALID(this);
ASSERT(!rect.IsRectEmpty());
CRect rcWin=GetDockRect();
CDC *pDC = m_pDockSite->GetDCEx(NULL,
DCX_WINDOW|DCX_CACHE|DCX_LOCKWINDOWUPDATE);
CRect rcBar;
GetWindowRect(rcBar);
if (m_bAutoHide)
rcWin=rcBar;
if (IsVert()|| IsHideVert()) //el sentido de las barras es vertical
{
if (m_SideMove==HTLEFT || m_SideMove==HTRIGHT) //el mouse esta en el borde izquierdo o derecho
{
rcWin.OffsetRect(-rect.left,-rect.top);
rcWin.top+=10;
rcWin.left=rect.left+2;
rcWin.right=rect.right+2;
}
else //el mouse esta el borde de arriba pero de una barra vertical
{
rcBar.OffsetRect(-rect.TopLeft());
rcBar.OffsetRect(CPoint(0,9));
rcWin=rcBar;
if (IsLeft() || IsRight()) //a la izquierda
{
rcWin.top=rect.top;
rcWin.bottom=rect.bottom;
}
//
}
}
else //el sentido de las barras es horizontal
{
if (m_SideMove==HTTOP || m_SideMove==HTBOTTOM) //el mouse esta en el borde de arriba o abajo
{
rcWin.OffsetRect(-rect.left,-rect.top);
rcWin.top=rect.top-2;
rcWin.bottom=rect.bottom;
}
else //el mouse esta en el borde derecho
{
rcBar.OffsetRect(-rect.TopLeft());
rcBar.OffsetRect(CPoint(0,8));
rcWin=rcBar;
if ((IsBottom()|| IsHideBottom()) || (IsTop()|| IsHideTop())) //abajo
{
rcWin.left=rect.left+2;
rcWin.right=rect.right+2;
}
}
}
ClientToScreen(&rcWin);
m_pDockSite->ScreenToClient(&rcWin);
// invert the brush pattern (looks just like frame window sizing)
CBrush* pBrush = CDC::GetHalftoneBrush();
HBRUSH hOldBrush = NULL;
if (pBrush != NULL)
hOldBrush = (HBRUSH)SelectObject(pDC->m_hDC, pBrush->m_hObject);
pDC->PatBlt(rcWin.left, rcWin.top, rcWin.Width(), rcWin.Height(), PATINVERT);
if (hOldBrush != NULL)
SelectObject(pDC->m_hDC, hOldBrush);
m_pDockSite->ReleaseDC(pDC);
}
/*void CGuiControlBar::OnInvertTracker(const CRect& rect)
{
ASSERT_VALID(this);
ASSERT(!rect.IsRectEmpty());
CRect rcWin=GetDockRect();
CDC *pDC = m_pDockSite->GetDCEx(NULL,
DCX_WINDOW|DCX_CACHE|DCX_LOCKWINDOWUPDATE);
CRect rcBar;
GetParent()->GetWindowRect(rcBar);
if (m_bAutoHide)
rcWin=rcBar;
if (IsVert()|| IsHideVert()) //el sentido de las barras es vertical
{
if (m_SideMove==HTLEFT || m_SideMove==HTRIGHT) //el mouse esta en el borde izquierdo o derecho
{
rcWin.OffsetRect(-rect.left,-rect.top);
rcWin.top+=10;
rcWin.left=rect.left+2;
rcWin.right=rect.right+2;
}
else //el mouse esta el borde de arriba pero de una barra vertical
{
rcBar.OffsetRect(-rect.TopLeft());
rcBar.OffsetRect(CPoint(0,9));
rcWin=rcBar;
if (IsLeft() || IsRight()) //a la izquierda
{
rcWin.top=rect.top;
rcWin.bottom=rect.bottom;
}
//
}
}
else //el sentido de las barras es horizontal
{
if (m_SideMove==HTTOP || m_SideMove==HTBOTTOM) //el mouse esta en el borde de arriba o abajo
{
rcWin.OffsetRect(-rect.left,-rect.top);
rcWin.top=rect.top-2;
rcWin.bottom=rect.bottom-2;
}
else //el mouse esta en el borde derecho
{
rcBar.OffsetRect(-rect.TopLeft());
rcBar.OffsetRect(CPoint(0,8));
rcWin=rcBar;
if ((IsBottom()|| IsHideBottom()) || (IsTop()|| IsHideTop())) //abajo
{
rcWin.left=rect.left+2;
rcWin.right=rect.right+2;
}
}
}
ClientToScreen(&rcWin);
GetParentFrame()->ScreenToClient(&rcWin);
// invert the brush pattern (looks just like frame window sizing)
CBrush* pBrush = CDC::GetHalftoneBrush();
HBRUSH hOldBrush = NULL;
if (pBrush != NULL)
hOldBrush = (HBRUSH)SelectObject(pDC->m_hDC, pBrush->m_hObject);
pDC->PatBlt(rcWin.left, rcWin.top, rcWin.Width(), rcWin.Height(), PATINVERT);
if (hOldBrush != NULL)
SelectObject(pDC->m_hDC, hOldBrush);
m_pDockSite->ReleaseDC(pDC);
}
*/
void CGuiControlBar::OnSize(UINT nType, int cx, int cy)
{
// CControlBar::OnSize(nType, cx, cy);
CWnd* pWnd = GetWindow(GW_CHILD);
if (!m_bSupportMultiView)
{
if (pWnd != NULL)
{
pWnd->MoveWindow(0, 0, cx, cy);
ASSERT(pWnd->GetWindow(GW_HWNDNEXT) == NULL);
}
}
else
{
while (pWnd != NULL)
{
if (pWnd->IsWindowVisible())
{
pWnd->MoveWindow(0, 0, cx, cy);
break;
}
pWnd=pWnd->GetWindow(GW_HWNDNEXT);
}
}
// TODO: Add your message handler code here
}
void CGuiControlBar::SetColorFondo(COLORREF clrFondo)
{
m_clrFondo=clrFondo;
}
//enum State{NORMAL=0,OVER=1,PRESS=2};
void CGuiControlBar::LoadStateBar(CString sProfile)
{
CWinApp* pApp = AfxGetApp();
TCHAR szSection[256] = {0};
wsprintf(szSection, _T("%s-Bar%d"),sProfile,GetDlgCtrlID());
m_sizeHorz.cx=pApp->GetProfileInt(szSection, _T("sizeHorz.cx"),200 );
m_sizeHorz.cy=pApp->GetProfileInt(szSection, _T("sizeHorz.cy"),100 );
m_sizeVert.cx=pApp->GetProfileInt(szSection, _T("sizeVert.cx"),200 );
m_sizeVert.cy=pApp->GetProfileInt(szSection, _T("sizeVert.cy"),100 );
m_bAutoHide=pApp->GetProfileInt(szSection, _T("AutoHide"),0 );
m_nLastAlingDocking=pApp->GetProfileInt(szSection, _T("Aling"),0 );
if (m_bAutoHide)
InitAutoHide();
else
m_nLastAlingDocking=0;
}
void CGuiControlBar::SaveBar(CString sProfile)
{
CWinApp* pApp = AfxGetApp();
TCHAR szSection[256] = {0};
wsprintf(szSection, _T("%s-Bar%d"), sProfile,GetDlgCtrlID());
pApp->WriteProfileString(szSection, NULL, NULL);
pApp->WriteProfileInt(szSection, _T("sizeHorz.cx"), m_sizeHorz.cx);
pApp->WriteProfileInt(szSection, _T("sizeHorz.cy"), m_sizeHorz.cy);
pApp->WriteProfileInt(szSection, _T("sizeVert.cx"), m_sizeVert.cx);
pApp->WriteProfileInt(szSection, _T("sizeVert.cy"), m_sizeVert.cy);
pApp->WriteProfileInt(szSection, _T("AutoHide"), m_bAutoHide);
pApp->WriteProfileInt(szSection, _T("Aling"), m_nLastAlingDocking);
}
void CGuiControlBar::OnNcMouseMove(UINT nHitTest, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (nHitTest == HTCLOSE)
if (m_stateBtn != NORMAL) return;
if (nHitTest == HTPIN)
if (m_stateAHBtn != NORMAL) return;
if (nHitTest == HTCLOSE)
{
m_stateBtn=OVER;
SetTimer(1,100,0);
}
if (nHitTest == HTPIN)
{
m_stateAHBtn=OVER;
SetTimer(2,100,0);
}
SendMessage(WM_NCPAINT);
CControlBar::OnNcMouseMove(nHitTest, point);
}
void CGuiControlBar::OnNcLButtonDblClk(UINT nFlags, CPoint point)
{
if(m_pDockBar != NULL && !m_bAutoHide)
{
m_pDockContext->ToggleDocking();
m_rcOldBorder=CRect(0,0,0,0);
}
}
| [
"egor.pushkin@gmail.com"
] | egor.pushkin@gmail.com |
8dde9d3badeab257bb8441f1f827d0adeaf3168e | fa8c099b20c480abef033342147570f0a9c76d54 | /Base/Source/Platform.h | bc4c3fd568af59520014065fea52bb23700960a8 | [] | no_license | TemplarDon/SP3 | b312fd1c6c6b926912648b15f196936f2ae8b90a | 155c7f973e58eab42c9243a8a69eeb0cb69655a3 | refs/heads/master | 2020-04-06T06:54:13.984488 | 2016-09-01T10:36:07 | 2016-09-01T10:36:07 | 65,668,853 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 164 | h | #ifndef PLATFORM_H
#define PLATFORM_H
#include "GameObject.h"
class Platform :public GameObject
{
public:
Platform();
~Platform();
protected:
};
#endif
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
8749e5b748bc5864671cdb433d7e66803ea01a97 | da8979fbe17c5fcd9b28cba2bbf17c79c5d2e24c | /Platformer/NYUCodebase/Vector.cpp | 9a6a81eb250d581900c11111b674591eb07d737f | [] | no_license | Jekkt/ph1211GameProgClass | 12980394805fb5b8bd224afd83602c05a8901d83 | 09c974b6c28f6c529cbc78460d2bcba7fa507c8f | refs/heads/master | 2021-01-18T20:20:15.155232 | 2015-12-21T20:01:44 | 2015-12-21T20:01:44 | 42,818,671 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 178 | cpp | #include "Vector.h"
Vector::Vector()
{
}
Vector::Vector(float pX, float pY, float pZ) {
x = pX;
y = pY;
z = pZ;
}
Vector::~Vector(){
}
void Vector::normalize() {
}
| [
"jekkt01@hotmail.de"
] | jekkt01@hotmail.de |
24dc7cd1255bf6f4c2310904187553f2dfa06e5d | 698546ef4129fedcb2490dd55c111a883f9795fb | /storage.cpp | 3999ac9a41dfa3563ead6c075c7bea27308980fa | [] | no_license | Vladimirsky555/sitesOrganizer | cc979788869872b56d42917d72100c139deb9695 | e5925bef6df3126e3aa964cd7f93012aecb613f3 | refs/heads/master | 2022-06-29T07:44:40.988566 | 2020-05-06T17:27:32 | 2020-05-06T17:27:32 | 261,830,818 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,304 | cpp | #include "storage.h"
#include <QFile>
#include <QByteArray>
#define FILENAME "data"
Storage::Storage(QObject *parent) : QObject(parent)
{
QFile f(FILENAME);
if (!f.exists()) return;
f.open(QFile::ReadOnly);
QByteArray data = f.readAll();
f.close();
QDataStream str(data);
while (!str.atEnd()) {
QByteArray arr;
str >> arr;
Listitem *item = new Listitem(arr);
addModel(item);
}
}
Storage::~Storage() {
QFile f(FILENAME);
f.open(QFile::WriteOnly|QFile::Truncate);
QDataStream str(&f);
for (int i = 0; i < models.count(); i++)
str << models[i]->saveIt();
f.close();
}
QList<Listitem *> Storage::getList()
{
return this->models;
}
QStringList Storage::getCategoryList()
{
QStringList tmp;
for(int i = 0; i < models.count(); i++){
tmp[i] = models[i]->getName();
}
return tmp;
}
void Storage::addModel(Listitem *item)
{
if(models.contains(item))return;
models.append(item);
}
void Storage::deleteItem(int id)
{
models.removeAt(id);
}
Listitem *Storage::getItem(int id)
{
return models[id];
}
void Storage::allClear()
{
for(int i = 0; i < models.count(); i++){
models.at(i)->allClear();
}
models.clear();
}
int Storage::getCount()
{
return models.count();
}
int Storage::getID(Listitem *item)
{
for(int i = 0; i < models.count(); i++)
{
if(item == models.at(i)){
return i;
}
}
}
void Storage::insertItem(int index, Listitem *model)
{
if (models.contains(model)) return;
if(models.count() == 0){
models.append(model);
return;
}
this->models.insert(index+1, model);
return;
}
void Storage::replaceDownItem(int id)
{
Listitem *temp = models[id];
if(id < models.count() - 1){
models[id] = models[id+1];
models[id+1] = temp;
}
}
void Storage::replaceUpItem(int id)
{
Listitem *temp = models[id];
if(id > 0){
models[id] = models[id-1];
models[id-1] = temp;
}
}
void Storage::saveToFile()
{
QFile f(FILENAME);
f.open(QFile::WriteOnly|QFile::Truncate);
QDataStream str(&f);
for (int i = 0; i < models.count(); i++)
str << models[i]->saveIt();
f.close();
}
| [
"vladimir.bervin@gmail.com"
] | vladimir.bervin@gmail.com |
1dfd6f60c555aa752f46504555023540d3368fb5 | a772c6fcd17f431607a58df7a6cd34873a7e5815 | /Tools/TurboDLL/TreeListEditCtrl.cpp | a2aa5461886aa361bf411a489505c574149f8d81 | [] | no_license | wanglvhh/VisionProject | 43624c8728b6ab3812a536d2a3927be5cd62393f | ce9a3d4b5342fa9b578073e69b28881d88a6da2f | refs/heads/master | 2023-07-19T08:09:42.545448 | 2021-09-10T01:30:05 | 2021-09-10T01:30:05 | 404,651,996 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,226 | cpp | // TreeListEditCtrl.cpp : implementation file
//
#include "stdafx.h"
#include "TreeListDC.h"
#include "TreeListHeaderCtrl.h"
#include "TreeListTipCtrl.h"
#include "TreeListStaticCtrl.h"
#include "TreeListEditCtrl.h"
#include "TreeListComboCtrl.h"
#include "TreeListCtrl.h"
//#include "TreeListResource.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTreeListEditCtrl
CTreeListEditCtrl::CTreeListEditCtrl() :
m_pTreeListCtrl( NULL )
{
}
CTreeListEditCtrl::~CTreeListEditCtrl()
{
}
BEGIN_MESSAGE_MAP(CTreeListEditCtrl, CEdit)
//{{AFX_MSG_MAP(CTreeListEditCtrl)
ON_WM_CREATE()
ON_WM_KILLFOCUS()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTreeListEditCtrl message handlers
int CTreeListEditCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CEdit::OnCreate(lpCreateStruct) == -1)
return -1;
m_pTreeListCtrl = (CTreeListCtrl*)GetParent();
return 0;
}
void CTreeListEditCtrl::OnKillFocus(CWnd* pNewWnd)
{
CEdit::OnKillFocus(pNewWnd);
m_pTreeListCtrl->SetCtrlFocus( pNewWnd, FALSE );
}
| [
"wanglvhh@outlook.com"
] | wanglvhh@outlook.com |
6868200b91ce579786b77f1aa7dbbf56b29adb89 | 105711f82739c75b10d82f8ad847e8fbabd6665e | /humanplayer.h | 5b351f4404faa935f9f2d7959b38ec56fb663c73 | [] | no_license | grazinga-grazille/Straights | 817e52da6078a09fe3664d51f450150eb12884de | 368da61c3f3512b5aebb9bf126bec668cef8ef2b | refs/heads/master | 2023-02-01T19:08:36.343674 | 2020-12-20T22:01:59 | 2020-12-20T22:01:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 305 | h | #ifndef _HUMANPLAYER_H
#define _HUMANPLAYER_H
#include "player.h"
class HumanPlayer : public Player {
public:
HumanPlayer(std::string name, bool type);
~HumanPlayer();
virtual void playCard(Card card, Table &table) override;
virtual void discardCard(Card card) override;
};
#endif
| [
"66083419+grazinga-grazille@users.noreply.github.com"
] | 66083419+grazinga-grazille@users.noreply.github.com |
32387c7ab35add3ad1e87cd53859e6fdbb2a2034 | 14a9bcfc8abe0c5dc5471c48baf83ad584523b7f | /Parameter.h | 9787ad55969a25ba1ea3a6a57d81451697f3f49e | [] | no_license | BrendanJMitch/CS_236-Project2 | 0bc4a72abca3cf6a5a78fb2f81ebdaeda29967cf | 67bea0438efc9b1411aac30d26d76980676d2651 | refs/heads/master | 2023-02-28T23:31:31.938898 | 2021-02-09T21:46:11 | 2021-02-09T21:46:11 | 337,482,550 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 165 | h | #pragma once
#include <iostream>
#include <string>
class Parameter{
private:
public:
Parameter(){}
virtual std::string toString() = 0;
}; | [
"brendanjmitch@gmail.com"
] | brendanjmitch@gmail.com |
63e616d3f6faf8f70899cf3a6200d9d8d1fdfcc2 | 4be87e5418f2800adcc4c215f416e6aede732da7 | /P2/src/TurtleSuspendResumeOnTopic/machine/TurtleSuspendResumeOnTopic.machine/State_VERIFY.h | e897a2cece5357ceca3cff57bf4c190930c91815 | [] | no_license | jorgealemangonzalez/Robotica | 8d07c4f4d94eb52d645df802bd47a603274f5dd2 | 588dcd6b9819b2ca1e79a0110937081227a63e90 | refs/heads/master | 2021-01-11T11:58:29.845407 | 2016-11-16T08:56:54 | 2016-11-16T08:56:54 | 76,683,020 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,904 | h | //
// State_VERIFY.h
//
// Automatically created through MiCASE -- do not change manually!
//
#ifndef clfsm_TurtleSuspendResumeOnTopic_State_VERIFY_h
#define clfsm_TurtleSuspendResumeOnTopic_State_VERIFY_h
#include "CLState.h"
#include "CLAction.h"
#include "CLTransition.h"
namespace FSM
{
namespace CLM
{
namespace FSMTurtleSuspendResumeOnTopic
{
namespace State
{
class VERIFY: public CLState
{
class OnEntry: public CLAction
{
virtual void perform(CLMachine *, CLState *) const;
};
class OnExit: public CLAction
{
virtual void perform(CLMachine *, CLState *) const;
};
class Internal: public CLAction
{
virtual void perform(CLMachine *, CLState *) const;
};
class Transition_0: public CLTransition
{
public:
Transition_0(int toState = 3): CLTransition(toState) {}
virtual bool check(CLMachine *, CLState *) const;
};
class Transition_1: public CLTransition
{
public:
Transition_1(int toState = 7): CLTransition(toState) {}
virtual bool check(CLMachine *, CLState *) const;
};
CLTransition *_transitions[2];
public:
VERIFY(const char *name = "VERIFY");
virtual ~VERIFY();
virtual CLTransition * const *transitions() const { return _transitions; }
virtual int numberOfTransitions() const { return 2; }
# include "State_VERIFY_Variables.h"
};
}
}
}
}
#endif
| [
"miquelferran.floriach01@estudiant.upf.edu"
] | miquelferran.floriach01@estudiant.upf.edu |
2446aee49793bfe016612d424d12e1d51cce5784 | 09ea1901af1caa0cd7a6977209c384e08278a371 | /code/Ardupilot/libraries/DataFlash/DataFlash_SITL.h | 3664ff4af318cb58bcf68908ad8886c0ea6e9be9 | [] | no_license | sid1980/JAGUAR | e038e048a0542d7f3b67c480d27881f91ef42e4e | 2dc262fdc10a600335f71878e092265bc9da77c2 | refs/heads/master | 2021-12-03T05:19:44.367320 | 2014-05-01T23:21:27 | 2014-05-01T23:21:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,027 | h | /* ************************************************************ */
/* DataFlash_SITL Log library */
/* ************************************************************ */
#ifndef __DATAFLASH_SITL_H__
#define __DATAFLASH_SITL_H__
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
#include <AP_HAL.h>
#include "DataFlash.h"
class DataFlash_SITL : public DataFlash_Block
{
private:
//Methods
uint8_t BufferRead (uint8_t BufferNum, uint16_t IntPageAdr);
void BufferWrite (uint8_t BufferNum, uint16_t IntPageAdr, uint8_t Data);
void BufferToPage (uint8_t BufferNum, uint16_t PageAdr, uint8_t wait);
void PageToBuffer(uint8_t BufferNum, uint16_t PageAdr);
void WaitReady();
uint8_t ReadStatusReg();
uint8_t ReadStatus();
uint16_t PageSize();
void PageErase (uint16_t PageAdr);
void BlockErase (uint16_t BlockAdr);
void ChipErase();
// write size bytes of data to a page. The caller must ensure that
// the data fits within the page, otherwise it will wrap to the
// start of the page
// If pHeader is not NULL then write the header bytes before the data
void BlockWrite(uint8_t BufferNum, uint16_t IntPageAdr,
const void *pHeader, uint8_t hdr_size,
const void *pBuffer, uint16_t size);
// read size bytes of data to a page. The caller must ensure that
// the data fits within the page, otherwise it will wrap to the
// start of the page
bool BlockRead(uint8_t BufferNum, uint16_t IntPageAdr, void *pBuffer, uint16_t size);
AP_HAL::SPIDeviceDriver *_spi;
AP_HAL::Semaphore *_spi_sem;
public:
DataFlash_SITL() {}
void Init();
void ReadManufacturerID();
bool CardInserted();
};
#endif // CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
#endif // __DATAFLASH_SITL_H__
| [
"jonathan2@Jonathans-MacBook-Pro.local"
] | jonathan2@Jonathans-MacBook-Pro.local |
552dc85cf7c63db9c6b9150281a3c4da3ab77897 | 90347e4ee58805c7146610b9eb83320db13b188a | /CPP/251_Flatten 2D Vector .cp | 436fb35556f8a480a903a45c188a6ea8c3feeddb | [] | no_license | wuyou8933/Leetcode | 44fdbcd8c9e3546ede80ce1a5aab438938d71f64 | 466d2b2fe3b3ba97096d7523d7396076fe3e84ce | refs/heads/master | 2021-06-28T12:28:56.460490 | 2020-12-21T20:41:50 | 2020-12-21T20:41:50 | 10,822,122 | 0 | 2 | null | 2020-07-25T23:56:36 | 2013-06-20T14:51:29 | Python | UTF-8 | C++ | false | false | 1,160 | cp | //
// main.cpp
// chang
//
// Created by Changjie Ma on 3/17/16.
// Copyright © 2016 Changjie Ma. All rights reserved.
//
#include <iostream>
#include <set>
#include <vector>
#include <unordered_map>
using namespace std;
class Vector2D{
private:
vector<int> data;
int index;
public:
Vector2D(vector<vector<int>>& vec2d){
size_t row = vec2d.size();
for(int r = 0; r< row; r++){
size_t col = vec2d[r].size();
for(int c = 0; c<col; c++)
data.push_back(vec2d[r][c]);
}
index = 0;
}
int next(){
return data[index++];
}
bool isNext(){
return index<data.size();
}
/*
public:
vector<vector<int>>:: iterator i, iend;
int j = 0;
Vector2D(vector<vector<int>>& vec2d){
i = vec2d.begin();
iend = vec2d.end();
}
int next(){
return (*i)[j++];
}
bool isNext(){
while(i!=iend && j==(*i).size()){
i++; j=0;
}
return i!=iend;
*/
};
int main(int argc, const char * argv[]) {
return 0;
}
| [
"shuaishuaima@outlook.com"
] | shuaishuaima@outlook.com |
8cc76459dba201f5c4b037bf8487580cfa909ec4 | 9e48c8810bc5d7ce26e0b123aed8300b44373b98 | /LinkAggSim/LacpMuxSM.cpp | e21cac14c7e903de107e9e64f3f0f56820640f8e | [
"Apache-2.0"
] | permissive | srhaddock/LinkAggSim | dffc637ba2185ac8372e4ab70df3689871e8936f | b083fe72308cb2a0daf9dbe758a736afd3ba47e7 | refs/heads/master | 2021-01-19T10:36:54.839121 | 2017-06-15T21:43:38 | 2017-06-15T21:43:38 | 82,197,124 | 0 | 0 | null | 2017-06-09T22:42:55 | 2017-02-16T15:46:59 | C++ | UTF-8 | C++ | false | false | 17,037 | cpp | /*
Copyright 2017 Stephen Haddock Consulting, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "stdafx.h"
#include "AggPort.h"
// void AggPort::LacpMuxSM::resetMuxSM(AggPort& port)
void AggPort::LacpMuxSM::reset(AggPort& port)
{
port.waitWhileTimer = 0;
port.waitToRestoreTimer = 0;
port.MuxSmState = enterDetached(port);
}
/**/
// void AggPort::LacpMuxSM::timerTickMuxSM(AggPort& port)
void AggPort::LacpMuxSM::timerTick(AggPort& port)
{
if (port.waitWhileTimer > 0) port.waitWhileTimer--;
if (port.waitToRestoreTimer > 0) port.waitToRestoreTimer--;
}
/**/
// int AggPort::LacpMuxSM::runMuxSM(AggPort& port, bool singleStep)
int AggPort::LacpMuxSM::run(AggPort& port, bool singleStep)
{
bool transitionTaken = false;
int loop = 0;
// if (port.waitWhileTimer > 0) port.waitWhileTimer--;
do
{
transitionTaken = stepMuxSM(port);
loop++;
} while (!singleStep && transitionTaken && loop < 10);
if (!transitionTaken) loop--;
return (loop);
}
bool AggPort::LacpMuxSM::stepMuxSM(AggPort& port)
{
MuxSmStates nextMuxSmState = MuxSmStates::NO_STATE;
bool transitionTaken = false;
if (port.actorLacpVersion == 1) // This has the old state machine with LACPv1 and new (2017) state machine with LACPv2 for convenience
// It doesn't have to be that way. Old machine can work with v2 LACPDUs and new machine can work with v1 LACPDUs
{
// No global transitions
switch (port.MuxSmState)
{
case MuxSmStates::DETACHED:
if ((port.portSelected == selectedVals::SELECTED) || (port.portSelected == selectedVals::STANDBY))
nextMuxSmState = enterWaiting(port);
break;
case MuxSmStates::WAITING:
port.ReadyN = (port.waitWhileTimer == 0);
if ((port.portSelected == selectedVals::SELECTED) && port.Ready)
nextMuxSmState = enterAttached(port);
else if (port.portSelected == selectedVals::UNSELECTED)
nextMuxSmState = enterDetached(port);
break;
case MuxSmStates::ATTACHED:
if ((port.portSelected == selectedVals::SELECTED) && port.partnerOperPortState.sync)
if (port.policy_coupledMuxControl)
nextMuxSmState = enterCollDist(port);
else
nextMuxSmState = enterCollecting(port);
else if (port.portSelected != selectedVals::SELECTED)
nextMuxSmState = enterDetached(port);
break;
case MuxSmStates::COLLECTING:
if ((port.portSelected == selectedVals::SELECTED) && port.partnerOperPortState.sync
&& port.partnerOperPortState.collecting)
nextMuxSmState = enterDistributing(port);
else if ((port.portSelected != selectedVals::SELECTED) ||
(!port.partnerOperPortState.sync))
nextMuxSmState = enterAttached(port);
break;
case MuxSmStates::DISTRIBUTING:
if ((port.portSelected != selectedVals::SELECTED) ||
!port.partnerOperPortState.sync || !port.partnerOperPortState.collecting)
nextMuxSmState = enterCollecting(port);
break;
case MuxSmStates::COLL_DIST:
if ((port.portSelected != selectedVals::SELECTED) ||
(!port.partnerOperPortState.sync))
nextMuxSmState = enterAttached(port);
break;
default:
nextMuxSmState = enterDetached(port);
break;
}
}
else // (port.actorLacpVersion > 1)
{
bool portGoodToGo = port.actorAttached && port.PortEnabled && (port.waitToRestoreTimer == 0) && port.wtrRevertOK;
// Global transitions:
if (port.portSelected != selectedVals::SELECTED)
{
if (port.MuxSmState != MuxSmStates::DETACHED)
nextMuxSmState = enterDetached(port);
}
else if (port.actorAttached && !port.PortEnabled &&
((port.waitToRestoreTimer != port.waitToRestoreTime) ||
((port.MuxSmState != MuxSmStates::ATTACHED_WTR) && (port.waitToRestoreTime == 0))))
{
nextMuxSmState = enterAttachedWtr(port);
}
// else if (portGoodToGo && !port.partnerOperPortState.sync)
else if (portGoodToGo && !port.partnerOperPortState.sync && (!port.actorOperPortState.sync || port.actorOperPortState.collecting))
{
// if (port.MuxSmState != MuxSmStates::ATTACHED)
nextMuxSmState = enterAttached(port);
}
else if (portGoodToGo && port.partnerOperPortState.sync &&
// !port.policy_coupledMuxControl && !port.partnerOperPortState.collecting && !port.actorOperPortState.collecting)
!port.policy_coupledMuxControl && !port.partnerOperPortState.collecting &&
(!port.actorOperPortState.collecting || port.actorOperPortState.distributing))
{
nextMuxSmState = enterCollecting(port);
}
else if (portGoodToGo && port.partnerOperPortState.sync &&
(port.policy_coupledMuxControl || port.partnerOperPortState.collecting) && !port.actorOperPortState.distributing)
{
nextMuxSmState = enterCollDist(port);
}
// State-specific transitions:
else switch (port.MuxSmState)
{
case MuxSmStates::DETACHED:
if ((port.portSelected == selectedVals::SELECTED) && !port.actorAttached && port.Ready)
nextMuxSmState = enterAttach(port);
break;
case MuxSmStates::ATTACH:
case MuxSmStates::ATTACHED_WTR:
case MuxSmStates::ATTACHED:
case MuxSmStates::COLLECTING:
break;
case MuxSmStates::COLL_DIST:
// if (!port.policy_coupledMuxControl && !port.partnerOperPortState.collecting)
// nextMuxSmState = enterCollecting(port);
break;
case MuxSmStates::WAITING:
case MuxSmStates::DISTRIBUTING:
default:
nextMuxSmState = enterDetached(port);
break;
}
}
if (nextMuxSmState != MuxSmStates::NO_STATE)
{
port.MuxSmState = nextMuxSmState;
transitionTaken = true;
}
else {} // no change to MuxSmState (or anything else)
return (transitionTaken);
}
/**/
AggPort::LacpMuxSM::MuxSmStates AggPort::LacpMuxSM::enterDetached(AggPort& port)
{
if (SimLog::Debug > 3)
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is DETACHED from Aggregator " << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
if (port.actorLacpVersion == 1)
{
detachMuxFromAggregator(port);
port.actorOperPortState.sync = false;
if (port.policy_coupledMuxControl)
{
port.actorOperPortState.collecting = false;
disableCollectingDistributing(port);
port.actorOperPortState.distributing = false;
}
else
{
disableDistributing(port);
port.actorOperPortState.distributing = false;
port.actorOperPortState.collecting = false;
disableCollecting(port);
}
port.NTT = true;
port.ReadyN = false;
port.Ready = false;
}
else // (port.actorLacpVersion > 1)
{
if (port.actorOperPortState.collecting) // Not in standard -- other than debug messages does it make a difference?
disableCollectingDistributing(port);
port.actorOperPortState.distributing = false;
port.actorOperPortState.collecting = false;
if (port.actorOperPortState.sync)
port.NTT = true;
port.actorOperPortState.sync = false;
detachMuxFromAggregator(port);
port.waitToRestoreTimer = 0;
port.Ready = false;
}
return (MuxSmStates::DETACHED);
}
AggPort::LacpMuxSM::MuxSmStates AggPort::LacpMuxSM::enterWaiting(AggPort& port)
{
if ((SimLog::Debug > 3))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is WAITING for Aggregator " << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
port.waitWhileTimer = AggregateWaitTime; // Wait a little to see if other ports are attaching
port.ReadyN = (port.waitWhileTimer == 0);
return (MuxSmStates::WAITING);
}
AggPort::LacpMuxSM::MuxSmStates AggPort::LacpMuxSM::enterAttach(AggPort& port)
{
if ((SimLog::Debug > 3))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is ATTACH for Aggregator " << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
attachMuxToAggregator(port);
return (MuxSmStates::ATTACH);
}
AggPort::LacpMuxSM::MuxSmStates AggPort::LacpMuxSM::enterAttachedWtr(AggPort& port)
{
if ((SimLog::Debug > 3))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is ATTACHED_WTR for Aggregator " << port.actorPortAggregatorIdentifier;
if (!port.wtrRevertiveMode)
SimLog::logFile << " (non-revertive) ";
SimLog::logFile << " ***" << dec << endl;
}
disableCollectingDistributing(port);
port.actorOperPortState.sync = false;
port.actorOperPortState.collecting = false;
port.actorOperPortState.distributing = false;
port.waitToRestoreTimer = port.waitToRestoreTime;
port.wtrRevertOK = port.wtrRevertiveMode;
// port.NTT = true; // Not in standard. Does it make a difference since !Port_Enabled?
return (MuxSmStates::ATTACHED_WTR);
}
AggPort::LacpMuxSM::MuxSmStates AggPort::LacpMuxSM::enterAttached(AggPort& port)
{
if ((SimLog::Debug > 3))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is ATTACHED to Aggregator " << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
if (port.actorLacpVersion == 1)
{
attachMuxToAggregator(port);
port.actorOperPortState.sync = true;
if (port.policy_coupledMuxControl)
{
if (port.actorOperPortState.collecting || port.actorOperPortState.collecting) // why did I have this? was it supposed to be something else?
{
port.actorOperPortState.collecting = false;
disableCollectingDistributing(port);
port.actorOperPortState.distributing = false;
}
}
else
{
port.actorOperPortState.collecting = false;
disableCollecting(port);
}
port.NTT = true;
}
else // (port.actorLacpVersion > 1)
{
if (port.actorOperPortState.collecting) // Not in standard -- other than debug messages does it make a difference?
disableCollectingDistributing(port);
port.actorOperPortState.sync = true;
port.actorOperPortState.collecting = false;
port.actorOperPortState.distributing = false;
port.NTT = true;
}
return (MuxSmStates::ATTACHED);
}
AggPort::LacpMuxSM::MuxSmStates AggPort::LacpMuxSM::enterCollecting(AggPort& port)
{
if ((SimLog::Debug > 3))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is COLLECTING on Aggregator " << port.actorPortAggregatorIdentifier
// << " (partnerOperPortState = 0x" << (unsigned short)(port.partnerOperPortState.state) << " ) "
<< " ***" << dec << endl;
}
if (port.actorLacpVersion == 1)
{
enableCollecting(port);
port.actorOperPortState.collecting = true;
disableDistributing(port);
port.actorOperPortState.distributing = false;
port.NTT = true;
}
else // (port.actorLacpVersion > 1)
{
if (!port.actorOperPortState.collecting)
{
port.NTT = true;
enableCollecting(port);
}
else
disableDistributing(port);
// For new mux don't have to disable distributing since never pass through COLLECTING when going down,
// but do need to set Sync True since may go directly from ATTACH to COLLECTING
// disableDistributing(port);
port.actorOperPortState.sync = true;
port.actorOperPortState.collecting = true;
port.actorOperPortState.distributing = false;
}
return (MuxSmStates::COLLECTING);
}
AggPort::LacpMuxSM::MuxSmStates AggPort::LacpMuxSM::enterDistributing(AggPort& port)
{
if ((SimLog::Debug > 3))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is DISTRIBUTING on Aggregator " << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
port.actorOperPortState.distributing = true;
enableDistributing(port);
// port.NTT = true;
return (MuxSmStates::DISTRIBUTING);
}
AggPort::LacpMuxSM::MuxSmStates AggPort::LacpMuxSM::enterCollDist(AggPort& port)
{
if ((SimLog::Debug > 3))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is COLL_DIST on Aggregator " << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
if (port.actorLacpVersion == 1)
{
port.actorOperPortState.distributing = true;
enableCollectingDistributing(port);
port.actorOperPortState.collecting = true;
port.NTT = true;
}
else // (port.actorLacpVersion > 1)
{
if (!port.actorOperPortState.collecting)
enableCollectingDistributing(port);
else
enableDistributing(port);
port.actorOperPortState.sync = true;
port.actorOperPortState.collecting = true;
port.actorOperPortState.distributing = true;
port.NTT = true;
}
return (MuxSmStates::COLL_DIST);
}
void AggPort::LacpMuxSM::attachMuxToAggregator(AggPort& port)
{
port.actorAttached = true; // would be set true when attachment process completes
}
void AggPort::LacpMuxSM::detachMuxFromAggregator(AggPort& port)
{
port.actorAttached = false; // set false when the detachment process is initiated
}
// so far all the rest of these work for both v1 and v2
void AggPort::LacpMuxSM::enableCollecting(AggPort& port)
{
port.changePartnerOperDistAlg = true;
port.changePortLinkState = true;
}
void AggPort::LacpMuxSM::disableCollecting(AggPort& port)
{
// no function in simulation
port.changePortLinkState = true;
}
void AggPort::LacpMuxSM::enableDistributing(AggPort& port)
{
// if (!port.actorOperPortState.distributing) // Don't need to test this since only one way into this state
// If were going to add this test would have to set distributing true after calling enableDistributing
port.changeActorDistributing = true;
if ((SimLog::Debug > 0))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is UP on Aggregator " << port.actorSystem.addrMid << ":" << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
cout << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is UP on Aggregator " << port.actorSystem.addrMid << ":" << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
void AggPort::LacpMuxSM::disableDistributing(AggPort& port)
{
if (port.actorOperPortState.distributing)
{
port.changeActorDistributing = true;
if ((SimLog::Debug > 0))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is DOWN on Aggregator " << port.actorSystem.addrMid << ":" << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
cout << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is DOWN on Aggregator " << port.actorSystem.addrMid << ":" << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
}
void AggPort::LacpMuxSM::enableCollectingDistributing(AggPort& port)
{
port.changeActorDistributing = true;
port.changePartnerOperDistAlg |= !port.actorOperPortState.collecting;
port.changePortLinkState |= !port.actorOperPortState.collecting;
if ((SimLog::Debug > 0))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is UP on Aggregator " << port.actorSystem.addrMid << ":" << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
cout << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is UP on Aggregator " << port.actorSystem.addrMid << ":" << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
void AggPort::LacpMuxSM::disableCollectingDistributing(AggPort& port)
{
port.changeActorDistributing = true;
port.portOperConversationMask.reset();
port.distributionConversationMask.reset();
port.collectionConversationMask.reset();
port.actorDWC = false;
port.LinkNumberID = port.adminLinkNumberID;
port.changePortLinkState = true;
port.actorPartnerSync = (port.portOperConversationMask == port.partnerOperConversationMask);
if ((SimLog::Debug > 0))
{
SimLog::logFile << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is DOWN on Aggregator " << port.actorSystem.addrMid << ":" << port.actorSystem.addrMid << ":" << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
cout << "Time " << SimLog::Time << hex << ": *** Port " << port.actorSystem.addrMid << ":" << port.actorPort.num
<< " is DOWN on Aggregator " << port.actorSystem.addrMid << ":" << port.actorPortAggregatorIdentifier << " ***" << dec << endl;
}
/**/
| [
"shaddock@stanfordalumni.org"
] | shaddock@stanfordalumni.org |
5f9ebd77b39413462c9b9b9b5f6e810e068caea2 | f4cdc686736cc5373b20e92c508b19bd117781a3 | /Porzadek.h | 88bd7d38f2af697c3618053a317d35fd68e4e7ca | [] | no_license | IXOFIXOF/Permutacje | f04b6f4c0bd8a85ceb1c2a092fb2337e5445d0ab | dfd7e16d96347fe242f7a1cfa8e872ce5bb698d2 | refs/heads/master | 2021-04-15T12:13:29.162314 | 2018-04-16T21:44:41 | 2018-04-16T21:44:41 | 126,601,041 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 365 | h | #pragma once
#include "stdafx.h"
#include "Permutacja.h"
class Porzadek
{
public:
Porzadek();
~Porzadek();
unsigned int Newton(unsigned int n, unsigned int k);
virtual void Nastepnik(Permutacja perm) = 0;
virtual void Poprzednik(Permutacja perm) = 0;
virtual int Rank(Permutacja perm) = 0;
virtual void Perm(int Rank, int n, vector<int>& Alphabet) = 0;
};
| [
"IXOF@POCZTA.ONET.PL"
] | IXOF@POCZTA.ONET.PL |
3801b6ae50a6c5855f4886106b1a44715198b700 | 31aae25a55025e5a613d156f9d263117e5709e25 | /eulers/euler 1.cpp | ba8725e57fa6e86dec7a5bf60e53404f3cd324c9 | [] | no_license | capijose1/ccomp1_2018 | ae5bf642a3df7b4174667feb08f57c9e729d9799 | a6564ee882715e6ea036a5863da79634eef48fe6 | refs/heads/master | 2020-03-26T23:51:04.724895 | 2018-09-25T13:19:00 | 2018-09-25T13:19:00 | 145,572,547 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 233 | cpp | #include <iostream>
using namespace std;
int main()
{
int a=0;
int n;
cin>>n;
for (int i=1;i<n;i++){
if (((i%3)==0)||((i%5)==0)){
a=a+i;
}
}
cout << a << " ";
return 0;
}
| [
"jose.tito.acrota@ucsp.edu.pe"
] | jose.tito.acrota@ucsp.edu.pe |
3fe80fdd4995d317a074cafa6b0ba2dc6de57f51 | 433026226cf958cbccca1896c9df183eaf23a4e7 | /src/TextUtility.cpp | c3be452b7ad8aa4173c0090b98d4e6073751731d | [] | no_license | GordeyChernyy/DrawingTool | adceaf49854d766d213ae02e483389970e88051d | eca9162018b7e995c313372b535e80ccf7551f05 | refs/heads/master | 2021-01-10T16:42:39.285656 | 2016-02-11T03:35:31 | 2016-02-11T03:35:31 | 43,794,438 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 107 | cpp | //
// TextUtility.cpp
// DrawingTool
//
// Created by Zerc on 11/24/15.
//
//
#include "TextUtility.h"
| [
"kewava@gmail.com"
] | kewava@gmail.com |
ef301f8cac522dd364df122ef4e5f34ccbf7d261 | 837f5dc6e03f5842c8950e5a829c9a1ab8fffac1 | /CS307UPLOAD/bla/databaseInterface.cpp | 17ea64666b2893bc82afdcd53f0e7c02625beb15 | [] | no_license | dkirschl/CS307Project | bb52feb3bb385ddc82790e3d3b4a78f960ee7b5a | c76600a28ecb6e566f2813eea713b52b8fd10d6c | refs/heads/master | 2020-04-29T09:06:45.794244 | 2014-12-11T22:56:25 | 2014-12-11T22:56:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,586 | cpp | //DATABASE INTERFACE CODE
#include "tbinclude.h"
#include <sqlite3.h>
using namespace std;
string callback_return;
static int callback(void *data, int argc, char **argv, char **azColName){
int i;
fprintf(stdout, "%s: ", (const char*)data);
fprintf(stdout, "%d\n", argc);
for(i = 0; i<argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
callback_return += string(argv[i]);
if(i != (argc - 1)){
callback_return += "~";
}
}
if(argc != 1){
callback_return += "|";
}
printf("\n");
return 0;
}
/*
int main(int argc, char *argv[]){
bool w;
int a = 1;
char *b = (char*)&a;
w = isGoodPass(b, "222");
return 0;
}
*/
//INPUT: slaveSocket, password, name, alias, age, gender
//IDEA: Accept input and create a user based on provided info.
//OUTPUT: Write confirmation back to user if successful.
//RETURN: NONE
void dataCreateUser(int slaveSocket,char * password, char * name, char * alias, char * age, char * gender)
{
if(isValidValue(password) && isValidValue(name) && isValidValue(alias) && isValidValue(age) && isValidValue(gender))
{
//add user to the database and return the key from the database if there is an error then return -1
write(slaveSocket,"ISVALID",7);
sqlite3 *db;
char *zErrMsg = 0;
int rc;
std::string query;
std::string query2;
int results;
int file_entry;
char* user;
rc = sqlite3_open("serverDatabase.db", &db);
if(rc){
fprintf(stderr, "Unable to open database: %s\n", sqlite3_errmsg(db));
} else {
fprintf(stderr, "Opened database succesfully\n");
}
// check if alias is unique
//
const char* data = "Callback functioin called";
query = "INSERT INTO USERS (password, name, alias, age, gender) VALUES('"+string(password)+"','"+ string(name) + "','" + string(alias) + "','" + string(age) + "','" + string(gender) + "');";
query2 = "SELECT seq FROM sqlite_sequence WHERE name='USERS';";
//query2 = "SELECT last_row_id();";
fprintf(stdout, "%s\n", query.c_str());
results = sqlite3_exec(db, query.c_str(), callback, 0, &zErrMsg);
fprintf(stdout, "RESULTS IS: %d\n", results);
file_entry = sqlite3_exec(db, query2.c_str(), callback, (void*) data, &zErrMsg);
if(results != SQLITE_OK){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
} else {
fprintf(stdout, "User inserted succesfully\n");
}
if(file_entry != SQLITE_OK){
fprintf(stderr, "SQL 2 error: %s\n", zErrMsg);
} else {
// user = user_id;
fprintf(stdout, "User ID found succesfully\n");
}
fprintf(stdout, "User Id: %s\n", callback_return.c_str());
sqlite3_close(db);
write(slaveSocket, callback_return.c_str(), callback_return.length());
fprintf(stdout, "Wrote back\n");
}
else
{
write(slaveSocket,"INVALID",7);
}
}
void dataDeleteUser(int slaveSocket, char * key, char * password)
{
if(isValidValue(password) && isGoodPass(key, password))
{
write(slaveSocket,"ISVALID",7);
//database stuff
}
else
{
write(slaveSocket,"INVALID",7);
}
}
//INPUT: slaveSocket, key, password, sport, location, date, time, summary, skill level
//IDEA: Accept into and create an event based on provided info.
//OUTPUT: Write confirmation back to user if successful.
//RETURN: NONE
void dataCreateEvent(int slaveSocket,char * key,char * password,char * sport,char * location,char * date,char * time,char * summary,char * skill)
{
if(isValidValue(password) && isValidValue(sport) && isValidValue(location) && isValidValue(date) && isValidValue(time) && isValidValue(summary) && isValidValue(skill))
{
if(isGoodPass(key, password) == false)
{
write(slaveSocket,"INVALID",7);
}
else
{
//Do stuff ************************
write(slaveSocket,"ISVALID",7);
sqlite3 *db;
char *zErrMsg = 0;
char *zErrMsg2 = 0;
int rc;
std::string query;
std::string query2;
int results;
int file_entry;
char* event;
rc = sqlite3_open("serverDatabase.db", &db);
if(rc){
fprintf(stderr, "Unable to open database: %s\n", sqlite3_errmsg(db));
} else {
fprintf(stderr, "Opened database succesfully\n");
}
const char* data = "Callback functioin called";
query = "INSERT INTO EVENTS (sport, location, date, time, summary,desiredSkillLevel) VALUES('"+string(sport)+"','"+ string(location) + "','" + string(date) + "','" + string(time) + "','" + string(summary) + "','" + string(skill) + "');";
query2 = "SELECT seq FROM sqlite_sequence WHERE name='EVENTS';";
//query2 = "SELECT last_row_id();";
fprintf(stdout, "%s\n", query.c_str());
results = sqlite3_exec(db, query.c_str(), callback, 0, &zErrMsg);
fprintf(stdout, "RESULTS IS: %d\n", results);
file_entry = sqlite3_exec(db, query2.c_str(), callback, (void*) data, &zErrMsg2);
if(results != SQLITE_OK){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
} else {
fprintf(stdout, "Event inserted succesfully\n");
}
if(file_entry != SQLITE_OK){
fprintf(stderr, "SQL 2 error: %s\n", zErrMsg2);
} else {
// user = user_id;
fprintf(stdout, "Event ID found succesfully\n");
}
fprintf(stdout, "Event Id: %s\n", callback_return.c_str());
sqlite3_close(db);
write(slaveSocket, callback_return.c_str(), callback_return.length());
fprintf(stdout, "Wrote back\n");
}
}
else
{
write(slaveSocket,"INVALID",7);
}
}
//INPUT: slaveSocket, key, password, name, alias, age, gender, desc.
//IDEA: Accept info, check if it is valid. If valid change relevent user data.
//OUTPUT: Confirmation back if successful.
//RETURN: NONE
void dataUpdateUser(int slaveSocket,char * key,char * password,char * name,char * alias,char * age,char * gender,char * desc)
{
if(isValidValue(password) && isValidValue(name) && isValidValue(alias) && isValidValue(age) && isValidValue(gender) && isValidValue(desc))
{
if(isGoodPass(key, password) == false)
{
write(slaveSocket,"INVALID",7);
}
else
{
//Do stuff ************************
write(slaveSocket,"ISVALID",7);
}
}
else
{
write(slaveSocket,"INVALID",7);
}
}
//INPUT: slaveSocket, key, password, event key, sport, location, date, time, summary, skill level
//IDEA: Accept info, check if it is valid. If valid, change relevent event data.
//OUTPUT: Confirmation back if successful.
//RETURN: NONE
void dataUpdateEvent(int slaveSocket,char * key,char * password,char * evKey,char * sport,char * location,char * date,char * time,char * summary,char * skill)
{
if(isValidValue(password) && isValidValue(sport) && isValidValue(location) && isValidValue(date) && isValidValue(time) && isValidValue(summary) && isValidValue(skill))
{
if(isGoodPass(key, password) == false || isCorrectUser(key,evKey) == false)
{
write(slaveSocket,"INVALID",7);
}
else
{
//Do stuff ************************
write(slaveSocket,"ISVALID",7);
}
}
else
{
write(slaveSocket,"INVALID",7);
}
}
//INPUT: Key, password, Event key
//IDEA: Accept info, check if valid. If valid, delete specified event.
//OUTPUT: Confirmation of success or failure.
//RETURN: NONE
void dataDeleteEvent(int slaveSocket,char * key,char * password,char * evKey)
{
if(isGoodPass(key, password) == false || isCorrectUser(key,evKey) == false)
{
write(slaveSocket,"INVALID",7);
}
else
{
write(slaveSocket,"ISVALID",7);
/////////////////////////////////////////////////////////////////
sqlite3 *db;
char *zErrMsg = 0;
int rc;
std::string query;
int results;
int file_entry;
rc = sqlite3_open("serverDatabase.db", &db);
if(rc){
fprintf(stderr, "Unable to open database: %s\n", sqlite3_errmsg(db));
} else {
fprintf(stderr, "Opened database succesfully\n");
}
const char* data = "Callback functioin called";
query = "DELETE from EVENTS where id="+string(evKey)+";";
fprintf(stdout, "%s\n", query.c_str());
results = sqlite3_exec(db, query.c_str(), callback, 0, &zErrMsg);
fprintf(stdout, "RESULTS IS: %d\n", results);
if(results != SQLITE_OK){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
} else {
fprintf(stdout, "Event deleted succesfully\n");
}
sqlite3_close(db);
fprintf(stdout, "Finished action\n");
////////////////////////////////////////////////////////////////
}
}
//INPUT: Sport, location, date, time, skill level
//IDEA: Accept info, check for valid inputs. For valid inputs search the database.
//OUTPUT: Events matching request.
//RETURN: NONE
void dataGetEvent(int slaveSocket,char * sport,char * location,char * date,char * time,char * skill)
{
write(slaveSocket,"ISVALID",7);
string query = "SELECT summary, date FROM EVENTS";
int flag = 0;
if(isValidValue(sport))
{
if(flag == 0){
query += " WHERE ";
}
query += " sport ='" + string(sport)+ "' ";
flag = 1;
}
if(isValidValue(location))
{
if(flag == 0){
query += " WHERE ";
}
if(flag == 1)
{
query += " AND ";
}
query += " location ='" + string(location) + "' ";
flag = 1;
}
if(isValidValue(date))
{
if(flag == 0){
query += " WHERE ";
}
if(flag == 1)
{
query += " AND ";
}
query += " location ='" + string(date) + "' ";
flag = 1;
}
if(isValidValue(time))
{
if(flag == 0){
query += " WHERE ";
}
if(flag == 1)
{
query += " AND ";
}
query += " location ='" + string(time) + "' ";
flag = 1;
}
if(isValidValue(skill))
{
if(flag == 0){
query += " WHERE ";
}
if(flag == 1)
{
query += " AND ";
}
query += " location ='" + string(skill) + "' ";
flag = 1;
}
query += ";";
///////////////////////////////////////////////////////////////////////
sqlite3 *db;
char *zErrMsg = 0;
int rc;
int results;
int file_entry;
rc = sqlite3_open("serverDatabase.db", &db);
if(rc){
fprintf(stderr, "Unable to open database: %s\n", sqlite3_errmsg(db));
} else {
fprintf(stderr, "Opened database succesfully\n");
}
const char* data = "Callback function called";
fprintf(stdout, "%s\n", query.c_str());
callback_return = "|";
results = sqlite3_exec(db, query.c_str(), callback, (void*) data, &zErrMsg);
if(results != SQLITE_OK){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
} else {
fprintf(stdout, "Event inserted succesfully\n");
}
fprintf(stdout, "callback_return: %s\n", callback_return.c_str());
sqlite3_close(db);
write(slaveSocket, callback_return.c_str(), callback_return.length());
fprintf(stdout, "Wrote back\n");
///////////////////////////////////////////////////////////////////////////////////////
}
//Internal uses
//INPUT: A string key and password.
//IDEA: Accept a key and password pair and check if they match.
//OUTPUT: NONE
//RETURN: True if pair match, false if they do not.
bool isGoodPass(char * key, char * password)
{
int *temp;
int value;
temp = (int *) key;
value = *temp;
printf("\n value = %d\n", value);
// SELECT password FROM users WHERE id = value
/*
if(strncmp(,password,21) == 0) //need to add in a reference to the password that the provided key matches ************************
{
return true;
}
return false;
*/
return true;
}
//INPUT: String to be checked. ex: Location, Date, time, skill, or sport.
//IDEA: Check if the provided string contains actual information.
//OUTPUT: NONE
//RETURN: Check if input contains important information. If it does return True, if not return false.
bool isValidValue(char * string)
{
if(string == NULL || string[0] == ' ')
{
return false;
}
return true;
}
bool isCorrectUser(char * key, char * evKey)
{
if(1) //event owner key == given key
{
return true;
}
else
{
return false;
}
}
| [
"brentzc@gmail.com"
] | brentzc@gmail.com |
df04e5d04f85f68838b9be87dfa05109528d45ad | ccedef4a0dc654fb70cc52719ea5fc2463c6d88e | /src/RoxSerialReader.h | 43061fe02073b6721370bc0dcc0d2746f5f7eeaa | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | neroroxxx/RoxSerialReader | 7c7490094b9a2a370347195f6dc6ca35271554dd | 3474ab6271080a7fa71b80ac1d185c36bc2c0401 | refs/heads/master | 2022-12-01T01:09:10.645664 | 2020-08-15T04:35:40 | 2020-08-15T04:35:40 | 287,677,921 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,519 | h | /*
https://www.RoxXxtar.com/bmc
Licensed under the MIT license. See LICENSE file in the project root for full license information.
Library to read one or more 74HC4067 or 74HC4051 analog-in multiplexers
Rox74HC4067, this is a 16 pin analog-in multiplexer
Rox74HC4051, this is a 8 pin analog-in multiplexer
This library will read each pin of the mux and store it in RAM
It was designed and tested for PJRC Teensy boards only.
Use at your own risk.
*/
#ifndef RoxSerialReader_h
#define RoxSerialReader_h
#include <Arduino.h>
template <uint16_t buffSize>
class RoxSerialReader {
public:
RoxSerialReader(){
memset(buff, 0, buffSize);
}
bool read(){
char receivedChar;
memset(buff, 0, buffSize);
while(Serial.available() > 0 && !ready){
receivedChar = Serial.read();
// once a "new line" ch
if((uint8_t)receivedChar != 10) {
buff[counter] = receivedChar;
counter++;
if(counter >= buffSize){
counter = buffSize-1;
}
} else {
// set the last character as a EOL
buff[counter] = 0;
counter = 0;
ready = true;
}
}
if(ready){
ready = false;
return true;
}
return false;
}
bool match(const char * str){
return (strcmp(buff, str)==0);
}
char * getBuffer(){
return buff;
}
private:
char buff[buffSize];
uint16_t counter = 0;
bool ready = false;
};
#endif
| [
"neroroxxx@gmail.com"
] | neroroxxx@gmail.com |
83a35bb7d9856990bb1c0fc55269805e447f8893 | 17c3833af2a3d0bdb5ddb0db400b447c2ff5d5bf | /include/components/Ref4030Comp.hpp | 137b5bbad20adb0531a17b50eed254c76b00f2ef | [] | no_license | arthurphilippe/cpp_nanotekspice | c83149fc2923a9f0977e7995ee1c8e5ed48d1418 | f37c562a7d19a2a79147de46d2d03340178432f1 | refs/heads/master | 2021-03-22T01:06:31.728802 | 2018-03-04T12:23:01 | 2018-03-04T12:23:01 | 119,529,691 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 393 | hpp | /*
** EPITECH PROJECT, 2017
** nanotekspice
** File description:
** comp
*/
#ifndef REF4030COMP_HPP_
#define REF4030COMP_HPP_
#include "DefaultComponent.hpp"
namespace nts {
class Ref4030Comp : public DefaultComponent {
public:
Ref4030Comp(const std::string &name);
virtual Tristate compute(std::size_t pin = 1) override;
protected:
private:
};
}
#endif /* !REF4030COMP_HPP_ */
| [
"arthur.philippe@epitech.eu"
] | arthur.philippe@epitech.eu |
0979b57fc53310e88481e6bb75b25279399f6709 | c24fd3736a20c701a8ebe5a5656240a4f49949c7 | /Source/Teme/Tema2/Tema2.h | 9c4b9c8b0c96f62f43eed2b9ec18903ca965decd | [
"MIT"
] | permissive | adinasm/EGC | 546ef2536a2e2623d109633cb53d6cf3da9c9e7b | 01b51ed98790635bcec723253a771d8b98c09b4b | refs/heads/master | 2021-01-01T02:40:13.477791 | 2020-02-08T15:10:39 | 2020-02-08T15:10:39 | 239,145,456 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,763 | h | #pragma once
#include <Component/SimpleScene.h>
#include "LabCamera.h"
#include "Transform3D.h"
#include <Teme\Tema2\Plane.h>
#include <Teme\Tema2\Obstacle.h>
#include <Teme\Tema2\Fuel.h>
#include <Teme\Tema2\Cloud.h>
#include <Teme\Tema2\Cloud.h>
class Tema2 : public SimpleScene
{
public:
Tema2();
~Tema2();
void Init() override;
private:
void FrameStart() override;
void Update(float deltaTimeSeconds) override;
void FrameEnd() override;
void RenderSimpleMesh(Mesh* mesh, Shader* shader, const glm::mat4& modelMatrix, const glm::vec3& color,
Texture2D* texture);
void OnInputUpdate(float deltaTime, int mods) override;
void OnKeyPress(int key, int mods) override;
void OnKeyRelease(int key, int mods) override;
void OnMouseMove(int mouseX, int mouseY, int deltaX, int deltaY) override;
void OnMouseBtnPress(int mouseX, int mouseY, int button, int mods) override;
void OnMouseBtnRelease(int mouseX, int mouseY, int button, int mods) override;
void OnMouseScroll(int mouseX, int mouseY, int offsetX, int offsetY) override;
void OnWindowResize(int width, int height) override;
void CreateTextures();
void CreateShaders();
void CheckEnd(float deltaTimeSeconds);
bool CheckCollision(glm::vec3& position, float scale, glm::vec3& boundingBoxPosition,
glm::vec3& boundingBoxScale, float planeAngle, float type);
void RenderPlane(float deltaTimeSeconds);
void RenderBackground(float deltaTimeSeconds);
void RenderObstacles();
void RenderFuel();
void RenderClouds();
void RenderPlaneComponent(std::string textureName, std::string name, glm::vec3& coordinates, glm::vec3& scales);
void RenderWings();
void RenderPilot(std::string meshName, std::string textureName, glm::vec3& coordinates, glm::vec3& scales);
void RenderProp(float deltaTimeSeconds, glm::vec3& coordinates, glm::vec3& scales,
std::string meshName);
protected:
Tema::Camera* camera;
glm::mat4 projectionMatrix;
bool renderCameraTarget;
float zNear, zFar;
float fov;
private:
Plane* plane;
Obstacle* obstacles;
Fuel* fuel;
Cloud* cloud;
glm::mat4 thirdPersCameraPosition;
glm::mat4 firstPersCameraPosition;
glm::mat4 targetPosition;
bool thirdPersCamera;
glm::vec3 lightPosition;
glm::vec3 headlightDirection;
glm::vec3 headlightPosition;
unsigned int materialShininess;
float materialKd;
float materialKs;
float cutOff;
float translateX, translateY;
bool playing;
int lives;
float maxFuel, currentFuel, crashAcceleration;
bool first;
bool renderBoundingBox;
float planeAngle;
float propAngle;
float sunAngle;
glm::vec3 color;
float angleOffset;
float radius, height;
float lightAngle;
std::unordered_map<std::string, Texture2D*> mapTextures;
};
| [
"adina.smeu@gmail.com"
] | adina.smeu@gmail.com |
be2ed5499d2ddeabb4f58bc8d679421c52d27231 | f8f0defcaae039099abc3aadfa5ef960a323d709 | /Source/Engine/ConsolePrint.h | ee539aff66c16ba56c0f49e1569924cd58933d97 | [] | no_license | atadjiki/GameEngine | f8bcb6fa14ae3e22d9e9b82eb58b5590b8d18ec6 | 88a1ccd68485fd9dd6544c884f8fe5ed338e8f20 | refs/heads/master | 2020-05-22T19:02:09.516475 | 2020-04-17T06:10:59 | 2020-04-17T06:10:59 | 186,485,659 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 598 | h | #ifndef __CONSOLE_PRINT_H
#define __CONSOLE_PRINT_H
namespace Engine
{
void ConsolePrint(int count, const char * i_fmt, ...);
} // Namespace Engine
// This is how we handle variable argument pre-processor macros
// This is only supported by compilers that support the C99 standard
#if defined(_DEBUG) && !defined(DISABLE_DEBUG_PRINT)
#define DEBUG_PRINT(fmt,...) Engine::ConsolePrint((fmt),__VA_ARGS__)
#else
// This is one way we create a do nothing (NO OP) macro that doesn't
// generate a compiler warning or error
#define DEBUG_PRINT(fmt,...) void(0)
#endif
#endif // __CONSOLE_PRINT_H
| [
"atadjiki@gmail.com"
] | atadjiki@gmail.com |
5139482135503bc2f3c395f76ba612cbf47aa3da | d3cecb6acb88d3212b34dae8fdeb4f8e6c0b12fc | /src/SendCommands.cc | 42957e6dc1bf9f8b50e4930fcf95566257df51ef | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | fuzziqersoftware/newserv | 683dd013dd7e9534a2494b1fa59e4b929031975f | 02b0bf622cac4921718e0796e10cc2892c63c0b6 | refs/heads/master | 2023-08-31T12:04:32.677122 | 2023-08-31T01:59:34 | 2023-08-31T01:59:34 | 155,674,389 | 89 | 35 | MIT | 2023-09-09T07:13:19 | 2018-11-01T06:55:04 | C++ | UTF-8 | C++ | false | false | 101,835 | cc | #include "SendCommands.hh"
#include <event2/buffer.h>
#include <inttypes.h>
#include <string.h>
#include <memory>
#include <phosg/Encoding.hh>
#include <phosg/Hash.hh>
#include <phosg/Random.hh>
#include <phosg/Strings.hh>
#include <phosg/Time.hh>
#include "CommandFormats.hh"
#include "Compression.hh"
#include "FileContentsCache.hh"
#include "PSOProtocol.hh"
#include "StaticGameData.hh"
#include "Text.hh"
using namespace std;
extern const char* QUEST_BARRIER_DISCONNECT_HOOK_NAME;
extern const char* CARD_AUCTION_DISCONNECT_HOOK_NAME;
const unordered_set<uint32_t> v2_crypt_initial_client_commands({
0x00260088, // (17) DCNTE license check
0x00B0008B, // (02) DCNTE login
0x0114008B, // (02) DCNTE extended login
0x00260090, // (17) DCv1 prototype and JP license check
0x00280090, // (17) DCv1 license check
0x00B00093, // (02) DCv1 login
0x01140093, // (02) DCv1 extended login
0x00E0009A, // (17) DCv2/GCNTE license check
0x00CC009D, // (02) DCv2/GCNTE login
0x00CC019D, // (02) DCv2/GCNTE login (UDP off)
0x0130009D, // (02) DCv2/GCNTE extended login
0x0130019D, // (02) DCv2/GCNTE extended login (UDP off)
// Note: PSO PC initial commands are not listed here because we don't use a
// detector encryption for PSO PC (instead, we use the split reconnect command
// to send PC to a different port).
});
const unordered_set<uint32_t> v3_crypt_initial_client_commands({
0x00E000DB, // (17) GC/XB license check
0x00EC009E, // (02) GC login
0x00EC019E, // (02) GC login (UDP off)
0x0150009E, // (02) GC extended login
0x0150019E, // (02) GC extended login (UDP off)
0x0130009E, // (02) XB login
0x0130019E, // (02) XB login (UDP off)
0x0194009E, // (02) XB extended login
0x0194019E, // (02) XB extended login (UDP off)
});
const unordered_set<string> bb_crypt_initial_client_commands({
string("\xB4\x00\x93\x00\x00\x00\x00\x00", 8),
string("\xAC\x00\x93\x00\x00\x00\x00\x00", 8),
string("\xDC\x00\xDB\x00\x00\x00\x00\x00", 8),
});
void send_command(std::shared_ptr<Client> c, uint16_t command,
uint32_t flag, const std::vector<std::pair<const void*, size_t>>& blocks) {
c->channel.send(command, flag, blocks);
}
void send_command(shared_ptr<Client> c, uint16_t command, uint32_t flag,
const void* data, size_t size) {
c->channel.send(command, flag, data, size);
}
void send_command_excluding_client(shared_ptr<Lobby> l, shared_ptr<Client> c,
uint16_t command, uint32_t flag, const void* data, size_t size) {
for (auto& client : l->clients) {
if (!client || (client == c)) {
continue;
}
send_command(client, command, flag, data, size);
}
}
void send_command_if_not_loading(shared_ptr<Lobby> l,
uint16_t command, uint32_t flag, const void* data, size_t size) {
for (auto& client : l->clients) {
if (!client || (client->flags & Client::Flag::LOADING)) {
continue;
}
send_command(client, command, flag, data, size);
}
}
void send_command(shared_ptr<Lobby> l, uint16_t command, uint32_t flag,
const void* data, size_t size) {
send_command_excluding_client(l, nullptr, command, flag, data, size);
}
void send_command(shared_ptr<ServerState> s, uint16_t command, uint32_t flag,
const void* data, size_t size) {
for (auto& l : s->all_lobbies()) {
send_command(l, command, flag, data, size);
}
}
template <typename HeaderT>
void send_command_with_header_t(Channel& ch, const void* data, size_t size) {
const HeaderT* header = reinterpret_cast<const HeaderT*>(data);
ch.send(header->command, header->flag, header + 1, size - sizeof(HeaderT));
}
void send_command_with_header(Channel& ch, const void* data, size_t size) {
switch (ch.version) {
case GameVersion::DC:
case GameVersion::GC:
case GameVersion::XB:
send_command_with_header_t<PSOCommandHeaderDCV3>(ch, data, size);
break;
case GameVersion::PC:
case GameVersion::PATCH:
send_command_with_header_t<PSOCommandHeaderPC>(ch, data, size);
break;
case GameVersion::BB:
send_command_with_header_t<PSOCommandHeaderBB>(ch, data, size);
break;
default:
throw logic_error("unimplemented game version in send_command_with_header");
}
}
static const char* anti_copyright = "This server is in no way affiliated, sponsored, or supported by SEGA Enterprises or SONICTEAM. The preceding message exists only to remain compatible with programs that expect it.";
static const char* dc_port_map_copyright = "DreamCast Port Map. Copyright SEGA Enterprises. 1999";
static const char* dc_lobby_server_copyright = "DreamCast Lobby Server. Copyright SEGA Enterprises. 1999";
static const char* bb_game_server_copyright = "Phantasy Star Online Blue Burst Game Server. Copyright 1999-2004 SONICTEAM.";
static const char* bb_pm_server_copyright = "PSO NEW PM Server. Copyright 1999-2002 SONICTEAM.";
static const char* patch_server_copyright = "Patch Server. Copyright SonicTeam, LTD. 2001";
S_ServerInitWithAfterMessage_DC_PC_V3_02_17_91_9B<0xB4>
prepare_server_init_contents_console(
uint32_t server_key, uint32_t client_key, uint8_t flags) {
bool initial_connection = (flags & SendServerInitFlag::IS_INITIAL_CONNECTION);
S_ServerInitWithAfterMessage_DC_PC_V3_02_17_91_9B<0xB4> cmd;
cmd.basic_cmd.copyright = initial_connection
? dc_port_map_copyright
: dc_lobby_server_copyright;
cmd.basic_cmd.server_key = server_key;
cmd.basic_cmd.client_key = client_key;
cmd.after_message = anti_copyright;
return cmd;
}
void send_server_init_dc_pc_v3(shared_ptr<Client> c, uint8_t flags) {
bool initial_connection = (flags & SendServerInitFlag::IS_INITIAL_CONNECTION);
uint8_t command = initial_connection ? 0x17 : 0x02;
uint32_t server_key = random_object<uint32_t>();
uint32_t client_key = random_object<uint32_t>();
auto cmd = prepare_server_init_contents_console(
server_key, client_key, initial_connection);
send_command_t(c, command, 0x00, cmd);
switch (c->version()) {
case GameVersion::PC:
c->channel.crypt_in.reset(new PSOV2Encryption(client_key));
c->channel.crypt_out.reset(new PSOV2Encryption(server_key));
break;
case GameVersion::DC:
case GameVersion::GC:
case GameVersion::XB: {
shared_ptr<PSOV2OrV3DetectorEncryption> det_crypt(new PSOV2OrV3DetectorEncryption(
client_key, v2_crypt_initial_client_commands, v3_crypt_initial_client_commands));
c->channel.crypt_in = det_crypt;
c->channel.crypt_out.reset(new PSOV2OrV3ImitatorEncryption(server_key, det_crypt));
break;
}
default:
throw invalid_argument("incorrect client version");
}
}
S_ServerInitWithAfterMessage_BB_03_9B<0xB4>
prepare_server_init_contents_bb(
const parray<uint8_t, 0x30>& server_key,
const parray<uint8_t, 0x30>& client_key,
uint8_t flags) {
bool use_secondary_message = (flags & SendServerInitFlag::USE_SECONDARY_MESSAGE);
S_ServerInitWithAfterMessage_BB_03_9B<0xB4> cmd;
cmd.basic_cmd.copyright = use_secondary_message ? bb_pm_server_copyright : bb_game_server_copyright;
cmd.basic_cmd.server_key = server_key;
cmd.basic_cmd.client_key = client_key;
cmd.after_message = anti_copyright;
return cmd;
}
void send_server_init_bb(shared_ptr<ServerState> s, shared_ptr<Client> c,
uint8_t flags) {
bool use_secondary_message = (flags & SendServerInitFlag::USE_SECONDARY_MESSAGE);
parray<uint8_t, 0x30> server_key;
parray<uint8_t, 0x30> client_key;
random_data(server_key.data(), server_key.bytes());
random_data(client_key.data(), client_key.bytes());
auto cmd = prepare_server_init_contents_bb(server_key, client_key, flags);
send_command_t(c, use_secondary_message ? 0x9B : 0x03, 0x00, cmd);
static const string primary_expected_first_data("\xB4\x00\x93\x00\x00\x00\x00\x00", 8);
static const string secondary_expected_first_data("\xDC\x00\xDB\x00\x00\x00\x00\x00", 8);
shared_ptr<PSOBBMultiKeyDetectorEncryption> detector_crypt(new PSOBBMultiKeyDetectorEncryption(
s->bb_private_keys,
bb_crypt_initial_client_commands,
cmd.basic_cmd.client_key.data(),
sizeof(cmd.basic_cmd.client_key)));
c->channel.crypt_in = detector_crypt;
c->channel.crypt_out.reset(new PSOBBMultiKeyImitatorEncryption(
detector_crypt, cmd.basic_cmd.server_key.data(),
sizeof(cmd.basic_cmd.server_key), true));
}
void send_server_init_patch(shared_ptr<Client> c) {
uint32_t server_key = random_object<uint32_t>();
uint32_t client_key = random_object<uint32_t>();
S_ServerInit_Patch_02 cmd;
cmd.copyright = patch_server_copyright;
cmd.server_key = server_key;
cmd.client_key = client_key;
send_command_t(c, 0x02, 0x00, cmd);
c->channel.crypt_out.reset(new PSOV2Encryption(server_key));
c->channel.crypt_in.reset(new PSOV2Encryption(client_key));
}
void send_server_init(
shared_ptr<ServerState> s, shared_ptr<Client> c, uint8_t flags) {
switch (c->version()) {
case GameVersion::DC:
case GameVersion::PC:
case GameVersion::GC:
case GameVersion::XB:
send_server_init_dc_pc_v3(c, flags);
break;
case GameVersion::PATCH:
send_server_init_patch(c);
break;
case GameVersion::BB:
send_server_init_bb(s, c, flags);
break;
default:
throw logic_error("unimplemented versioned command");
}
}
void send_update_client_config(shared_ptr<Client> c) {
S_UpdateClientConfig_DC_PC_V3_04 cmd;
cmd.player_tag = 0x00010000;
cmd.guild_card_number = c->license->serial_number;
cmd.cfg = c->export_config();
send_command_t(c, 0x04, 0x00, cmd);
}
template <typename CommandT>
void send_quest_open_file_t(
shared_ptr<Client> c,
const string& quest_name,
const string& filename,
uint32_t file_size,
QuestFileType type) {
CommandT cmd;
uint8_t command_num;
switch (type) {
case QuestFileType::ONLINE:
command_num = 0x44;
cmd.name = "PSO/" + quest_name;
cmd.type = 0;
break;
case QuestFileType::GBA_DEMO:
command_num = 0xA6;
cmd.name = "GBA Demo";
cmd.type = 2;
break;
case QuestFileType::DOWNLOAD:
command_num = 0xA6;
cmd.name = "PSO/" + quest_name;
cmd.type = 0;
break;
case QuestFileType::EPISODE_3:
command_num = 0xA6;
cmd.name = "PSO/" + quest_name;
cmd.type = 3;
break;
default:
throw logic_error("invalid quest file type");
}
cmd.file_size = file_size;
cmd.filename = filename.c_str();
send_command_t(c, command_num, 0x00, cmd);
}
void send_quest_buffer_overflow(
shared_ptr<ServerState> s, shared_ptr<Client> c) {
// PSO Episode 3 USA doesn't natively support the B2 command, but we can add
// it back to the game with some tricky commands. For details on how this
// works, see system/ppc/Episode3USAQuestBufferOverflow.s.
auto fn = s->function_code_index->name_to_function.at("Episode3USAQuestBufferOverflow");
if (fn->code.size() > 0x400) {
throw runtime_error("Episode 3 buffer overflow code must be a single segment");
}
static const string filename = "m999999p_e.bin";
send_quest_open_file_t<S_OpenFile_PC_GC_44_A6>(
c, "BufferOverflow", filename, 0x18, QuestFileType::EPISODE_3);
S_WriteFile_13_A7 cmd;
cmd.filename = filename;
memcpy(cmd.data.data(), fn->code.data(), fn->code.size());
if (fn->code.size() < 0x400) {
memset(&cmd.data[fn->code.size()], 0, 0x400 - fn->code.size());
}
cmd.data_size = fn->code.size();
send_command_t(c, 0xA7, 0x00, cmd);
}
void empty_function_call_response_handler(uint32_t, uint32_t) {}
void prepare_client_for_patches(shared_ptr<ServerState> s, shared_ptr<Client> c, std::function<void()> on_complete) {
auto send_version_detect = [s, wc = weak_ptr<Client>(c), on_complete]() -> void {
auto c = wc.lock();
if (!c) {
return;
}
if (c->version() == GameVersion::GC &&
c->specific_version == default_specific_version_for_version(GameVersion::GC, -1)) {
send_function_call(c, s->function_code_index->name_to_function.at("VersionDetect"));
c->function_call_response_queue.emplace_back([s, c, on_complete](uint32_t specific_version, uint32_t) -> void {
c->specific_version = specific_version;
c->log.info("Version detected as %08" PRIX32, c->specific_version);
on_complete();
});
} else {
on_complete();
}
};
if (!(c->flags & Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH)) {
send_function_call(c, s->function_code_index->name_to_function.at("CacheClearFix-Phase1"), {}, "", 0x80000000, 8, 0x7F2734EC);
c->function_call_response_queue.emplace_back([s, wc = weak_ptr<Client>(c), send_version_detect](uint32_t, uint32_t header_checksum) -> void {
auto c = wc.lock();
if (!c) {
return;
}
try {
c->specific_version = specific_version_for_gc_header_checksum(header_checksum);
c->log.info("Version detected as %08" PRIX32 " from header checksum %08" PRIX32, c->specific_version, header_checksum);
} catch (const out_of_range&) {
c->log.info("Could not detect specific version from header checksum %08" PRIX32, header_checksum);
}
send_function_call(c, s->function_code_index->name_to_function.at("CacheClearFix-Phase2"));
c->function_call_response_queue.emplace_back([s, wc = weak_ptr<Client>(c), send_version_detect](uint32_t, uint32_t) -> void {
auto c = wc.lock();
if (!c) {
return;
}
c->log.info("Client cache behavior patched");
c->flags |= Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;
send_update_client_config(c);
send_version_detect();
});
});
} else {
send_version_detect();
}
}
void send_function_call(
shared_ptr<Client> c,
shared_ptr<CompiledFunctionCode> code,
const unordered_map<string, uint32_t>& label_writes,
const string& suffix,
uint32_t checksum_addr,
uint32_t checksum_size,
uint32_t override_relocations_offset) {
return send_function_call(
c->channel,
c->flags,
code,
label_writes,
suffix,
checksum_addr,
checksum_size,
override_relocations_offset);
}
void send_function_call(
Channel& ch,
uint64_t client_flags,
shared_ptr<CompiledFunctionCode> code,
const unordered_map<string, uint32_t>& label_writes,
const string& suffix,
uint32_t checksum_addr,
uint32_t checksum_size,
uint32_t override_relocations_offset) {
if (client_flags & Client::Flag::NO_SEND_FUNCTION_CALL) {
throw logic_error("client does not support function calls");
}
if (code.get() && (client_flags & Client::Flag::SEND_FUNCTION_CALL_CHECKSUM_ONLY)) {
throw logic_error("client only supports checksums in send_function_call");
}
string data;
uint32_t index = 0;
if (code.get()) {
data = code->generate_client_command(label_writes, suffix, override_relocations_offset);
index = code->index;
if (client_flags & Client::Flag::ENCRYPTED_SEND_FUNCTION_CALL) {
uint32_t key = random_object<uint32_t>();
// This format was probably never used on any little-endian system, but we
// implement the way it would probably work there if it was used.
StringWriter w;
if (code->is_big_endian()) {
w.put_u32b(data.size());
w.put_u32b(key);
} else {
w.put_u32l(data.size());
w.put_u32l(key);
}
data = prs_compress(data);
// Round size up to a multiple of 4 for encryption
data.resize((data.size() + 3) & ~3);
PSOV2Encryption crypt(key);
if (code->is_big_endian()) {
crypt.encrypt_big_endian(data.data(), data.size());
} else {
crypt.encrypt(data.data(), data.size());
}
w.write(data);
data = std::move(w.str());
}
}
S_ExecuteCode_B2 header = {data.size(), checksum_addr, checksum_size};
StringWriter w;
w.put(header);
w.write(data);
ch.send(0xB2, index, w.str());
}
void send_reconnect(shared_ptr<Client> c, uint32_t address, uint16_t port) {
S_Reconnect_19 cmd = {{address, port, 0}};
send_command_t(c, (c->version() == GameVersion::PATCH) ? 0x14 : 0x19, 0x00, cmd);
}
void send_pc_console_split_reconnect(shared_ptr<Client> c, uint32_t address,
uint16_t pc_port, uint16_t console_port) {
S_ReconnectSplit_19 cmd;
cmd.pc_address = address;
cmd.pc_port = pc_port;
cmd.gc_command = 0x19;
cmd.gc_flag = 0x00;
cmd.gc_size = 0x97;
cmd.gc_address = address;
cmd.gc_port = console_port;
send_command_t(c, 0x19, 0x00, cmd);
}
void send_client_init_bb(shared_ptr<Client> c, uint32_t error) {
S_ClientInit_BB_00E6 cmd;
cmd.error = error;
cmd.player_tag = 0x00010000;
cmd.guild_card_number = c->license->serial_number;
cmd.team_id = static_cast<uint32_t>(random_object<uint32_t>());
cmd.cfg = c->export_config_bb();
cmd.caps = 0x00000102;
send_command_t(c, 0x00E6, 0x00000000, cmd);
}
void send_team_and_key_config_bb(shared_ptr<Client> c) {
send_command_t(c, 0x00E2, 0x00000000, c->game_data.account()->key_config);
}
void send_player_preview_bb(shared_ptr<Client> c, uint8_t player_index,
const PlayerDispDataBBPreview* preview) {
if (!preview) {
// no player exists
S_PlayerPreview_NoPlayer_BB_00E4 cmd = {player_index, 0x00000002};
send_command_t(c, 0x00E4, 0x00000000, cmd);
} else {
SC_PlayerPreview_CreateCharacter_BB_00E5 cmd = {player_index, *preview};
send_command_t(c, 0x00E5, 0x00000000, cmd);
}
}
void send_guild_card_header_bb(shared_ptr<Client> c) {
uint32_t checksum = c->game_data.account()->guild_cards.checksum();
S_GuildCardHeader_BB_01DC cmd = {1, sizeof(GuildCardFileBB), checksum};
send_command_t(c, 0x01DC, 0x00000000, cmd);
}
void send_guild_card_chunk_bb(shared_ptr<Client> c, size_t chunk_index) {
size_t chunk_offset = chunk_index * 0x6800;
if (chunk_offset >= sizeof(GuildCardFileBB)) {
throw logic_error("attempted to send chunk beyond end of guild card file");
}
S_GuildCardFileChunk_02DC cmd;
size_t data_size = min<size_t>(
sizeof(GuildCardFileBB) - chunk_offset, sizeof(cmd.data));
cmd.unknown = 0;
cmd.chunk_index = chunk_index;
memcpy(
cmd.data,
reinterpret_cast<const uint8_t*>(&c->game_data.account()->guild_cards) + chunk_offset,
data_size);
send_command(c, 0x02DC, 0x00000000, &cmd, sizeof(cmd) - sizeof(cmd.data) + data_size);
}
static const vector<string> stream_file_entries = {
"ItemMagEdit.prs",
"ItemPMT.prs",
"BattleParamEntry.dat",
"BattleParamEntry_on.dat",
"BattleParamEntry_lab.dat",
"BattleParamEntry_lab_on.dat",
"BattleParamEntry_ep4.dat",
"BattleParamEntry_ep4_on.dat",
"PlyLevelTbl.prs",
};
static FileContentsCache bb_stream_files_cache(3600000000ULL);
void send_stream_file_index_bb(shared_ptr<Client> c) {
struct S_StreamFileIndexEntry_BB_01EB {
le_uint32_t size;
le_uint32_t checksum; // crc32 of file data
le_uint32_t offset; // offset in stream (== sum of all previous files' sizes)
ptext<char, 0x40> filename;
};
vector<S_StreamFileIndexEntry_BB_01EB> entries;
size_t offset = 0;
for (const string& filename : stream_file_entries) {
string key = "system/blueburst/" + filename;
auto cache_res = bb_stream_files_cache.get_or_load(key);
auto& e = entries.emplace_back();
e.size = cache_res.file->data->size();
// Computing the checksum can be slow, so we cache it along with the file
// data. If the cache result was just populated, then it may be different,
// so we always recompute the checksum in that case.
if (cache_res.generate_called) {
e.checksum = crc32(cache_res.file->data->data(), e.size);
bb_stream_files_cache.replace_obj<uint32_t>(key + ".crc32", e.checksum);
} else {
auto compute_checksum = [&](const string&) -> uint32_t {
return crc32(cache_res.file->data->data(), e.size);
};
e.checksum = bb_stream_files_cache.get_obj<uint32_t>(key + ".crc32", compute_checksum).obj;
}
e.offset = offset;
e.filename = filename;
offset += e.size;
}
send_command_vt(c, 0x01EB, entries.size(), entries);
}
void send_stream_file_chunk_bb(shared_ptr<Client> c, uint32_t chunk_index) {
auto cache_result = bb_stream_files_cache.get(
"<BB stream file>", +[](const string&) -> string {
size_t bytes = 0;
for (const auto& name : stream_file_entries) {
bytes += bb_stream_files_cache.get_or_load("system/blueburst/" + name).file->data->size();
}
string ret;
ret.reserve(bytes);
for (const auto& name : stream_file_entries) {
ret += *bb_stream_files_cache.get_or_load("system/blueburst/" + name).file->data;
}
return ret;
});
const auto& contents = cache_result.file->data;
S_StreamFileChunk_BB_02EB chunk_cmd;
chunk_cmd.chunk_index = chunk_index;
size_t offset = sizeof(chunk_cmd.data) * chunk_index;
if (offset > contents->size()) {
throw runtime_error("client requested chunk beyond end of stream file");
}
size_t bytes = min<size_t>(contents->size() - offset, sizeof(chunk_cmd.data));
memcpy(chunk_cmd.data, contents->data() + offset, bytes);
size_t cmd_size = offsetof(S_StreamFileChunk_BB_02EB, data) + bytes;
cmd_size = (cmd_size + 3) & ~3;
send_command(c, 0x02EB, 0x00000000, &chunk_cmd, cmd_size);
}
void send_approve_player_choice_bb(shared_ptr<Client> c) {
S_ApprovePlayerChoice_BB_00E4 cmd = {c->game_data.bb_player_index, 1};
send_command_t(c, 0x00E4, 0x00000000, cmd);
}
void send_complete_player_bb(shared_ptr<Client> c) {
auto account = c->game_data.account();
auto player = c->game_data.player();
SC_SyncCharacterSaveFile_BB_00E7 cmd;
cmd.inventory = player->inventory;
cmd.disp = player->disp;
cmd.unknown_a1 = 0;
cmd.creation_timestamp = 0;
cmd.signature = 0xA205B064;
cmd.play_time_seconds = 0; // TODO: Can we just use the same value as in disp?
cmd.option_flags = account->option_flags;
cmd.quest_data1 = player->quest_data1;
cmd.bank = player->bank;
cmd.guild_card.guild_card_number = c->game_data.guild_card_number;
cmd.guild_card.name = player->disp.name;
cmd.guild_card.team_name = account->team_name;
cmd.guild_card.description = player->guild_card_description;
cmd.guild_card.present = 1;
cmd.guild_card.language = cmd.inventory.language;
cmd.guild_card.section_id = player->disp.visual.section_id;
cmd.guild_card.char_class = player->disp.visual.char_class;
cmd.unknown_a3 = 0;
cmd.symbol_chats = account->symbol_chats;
cmd.shortcuts = account->shortcuts;
cmd.auto_reply = player->auto_reply;
cmd.info_board = player->info_board;
cmd.battle_records = player->battle_records;
cmd.unknown_a4.clear(0);
cmd.challenge_records = player->challenge_records;
cmd.tech_menu_config = player->tech_menu_config;
cmd.unknown_a6.clear(0);
cmd.quest_data2 = player->quest_data2;
cmd.key_config = account->key_config;
send_command_t(c, 0x00E7, 0x00000000, cmd);
}
////////////////////////////////////////////////////////////////////////////////
// patch functions
void send_enter_directory_patch(shared_ptr<Client> c, const string& dir) {
S_EnterDirectory_Patch_09 cmd = {dir};
send_command_t(c, 0x09, 0x00, cmd);
}
void send_patch_file(shared_ptr<Client> c, shared_ptr<PatchFileIndex::File> f) {
S_OpenFile_Patch_06 open_cmd = {0, f->size, f->name};
send_command_t(c, 0x06, 0x00, open_cmd);
for (size_t x = 0; x < f->chunk_crcs.size(); x++) {
auto data = f->load_data();
size_t chunk_size = min<uint32_t>(f->size - (x * 0x4000), 0x4000);
vector<pair<const void*, size_t>> blocks;
S_WriteFileHeader_Patch_07 cmd_header = {x, f->chunk_crcs[x], chunk_size};
blocks.emplace_back(&cmd_header, sizeof(cmd_header));
blocks.emplace_back(data->data() + (x * 0x4000), chunk_size);
send_command(c, 0x07, 0x00, blocks);
}
S_CloseCurrentFile_Patch_08 close_cmd = {0};
send_command_t(c, 0x08, 0x00, close_cmd);
}
////////////////////////////////////////////////////////////////////////////////
// message functions
void send_text(Channel& ch, StringWriter& w, uint16_t command,
const u16string& text, bool should_add_color) {
if ((ch.version == GameVersion::DC) ||
(ch.version == GameVersion::GC) ||
(ch.version == GameVersion::XB)) {
string data = encode_sjis(text);
if (should_add_color) {
add_color(w, data.c_str(), data.size());
} else {
w.write(data);
}
w.put_u8(0);
} else {
if (should_add_color) {
add_color(w, text.c_str(), text.size());
} else {
w.write(text.data(), text.size() * sizeof(char16_t));
}
w.put_u16(0);
}
while (w.str().size() & 3) {
w.put_u8(0);
}
ch.send(command, 0x00, w.str());
}
void send_text(Channel& ch, uint16_t command, const u16string& text, bool should_add_color) {
StringWriter w;
send_text(ch, w, command, text, should_add_color);
}
void send_header_text(Channel& ch, uint16_t command,
uint32_t guild_card_number, const u16string& text, bool should_add_color) {
StringWriter w;
w.put(SC_TextHeader_01_06_11_B0_EE({0, guild_card_number}));
send_text(ch, w, command, text, should_add_color);
}
void send_message_box(shared_ptr<Client> c, const u16string& text) {
uint16_t command;
switch (c->version()) {
case GameVersion::PATCH:
command = 0x13;
break;
case GameVersion::DC:
case GameVersion::PC:
command = 0x1A;
break;
case GameVersion::GC:
case GameVersion::XB:
case GameVersion::BB:
command = 0xD5;
break;
default:
throw logic_error("invalid game version");
}
send_text(c->channel, command, text, true);
}
void send_ep3_timed_message_box(Channel& ch, uint32_t frames, const string& message) {
StringWriter w;
w.put<S_TimedMessageBoxHeader_GC_Ep3_EA>({frames});
add_color(w, message.data(), message.size());
w.put_u8(0);
while (w.size() & 3) {
w.put_u8(0);
}
ch.send(0xEA, 0x00, w.str());
}
void send_lobby_name(shared_ptr<Client> c, const u16string& text) {
send_text(c->channel, 0x8A, text, false);
}
void send_quest_info(shared_ptr<Client> c, const u16string& text,
bool is_download_quest) {
send_text(c->channel, is_download_quest ? 0xA5 : 0xA3, text, true);
}
void send_lobby_message_box(shared_ptr<Client> c, const u16string& text) {
send_header_text(c->channel, 0x01, 0, text, true);
}
void send_ship_info(shared_ptr<Client> c, const u16string& text) {
send_header_text(c->channel, 0x11, 0, text, true);
}
void send_ship_info(Channel& ch, const u16string& text) {
send_header_text(ch, 0x11, 0, text, true);
}
void send_text_message(Channel& ch, const u16string& text) {
send_header_text(ch, 0xB0, 0, text, true);
}
void send_text_message(shared_ptr<Client> c, const u16string& text) {
send_header_text(c->channel, 0xB0, 0, text, true);
}
void send_text_message(shared_ptr<Lobby> l, const u16string& text) {
for (size_t x = 0; x < l->max_clients; x++) {
if (l->clients[x]) {
send_text_message(l->clients[x], text);
}
}
}
void send_text_message(shared_ptr<ServerState> s, const u16string& text) {
// TODO: We should have a collection of all clients (even those not in any
// lobby) and use that instead here
for (auto& l : s->all_lobbies()) {
send_text_message(l, text);
}
}
__attribute__((format(printf, 2, 3))) void send_ep3_text_message_printf(
shared_ptr<ServerState> s, const char* format, ...) {
va_list va;
va_start(va, format);
string buf = string_vprintf(format, va);
va_end(va);
u16string decoded = decode_sjis(buf);
for (auto& it : s->id_to_lobby) {
for (auto& c : it.second->clients) {
if (c && (c->flags & Client::Flag::IS_EPISODE_3)) {
send_text_message(c, decoded);
}
}
}
}
u16string prepare_chat_message(
GameVersion version,
const u16string& from_name,
const u16string& text,
char private_flags) {
u16string data;
if (version == GameVersion::BB) {
data.append(u"\tJ");
}
data.append(remove_language_marker(from_name));
data.append(1, u'\t');
if (private_flags) {
data.append(1, static_cast<uint16_t>(private_flags));
}
data.append(u"\tJ");
data.append(text);
return data;
}
void send_chat_message(Channel& ch, const u16string& text, char private_flags) {
if (private_flags != 0) {
if (ch.version != GameVersion::GC) {
throw runtime_error("nonzero private_flags in non-GC chat message");
}
u16string effective_text;
effective_text.push_back(static_cast<char16_t>(private_flags));
effective_text += text;
send_header_text(ch, 0x06, 0, effective_text, false);
} else {
send_header_text(ch, 0x06, 0, text, false);
}
}
void send_chat_message(shared_ptr<Client> c, uint32_t from_guild_card_number,
const u16string& prepared_data) {
send_header_text(c->channel, 0x06, from_guild_card_number, prepared_data, false);
}
void send_chat_message(shared_ptr<Lobby> l, uint32_t from_guild_card_number,
const u16string& prepared_data) {
for (auto c : l->clients) {
if (c) {
send_header_text(c->channel, 0x06, from_guild_card_number, prepared_data, false);
}
}
}
void send_chat_message(shared_ptr<Client> c, uint32_t from_guild_card_number,
const u16string& from_name, const u16string& text, char private_flags) {
auto data = prepare_chat_message(c->version(), from_name, text, private_flags);
send_chat_message(c, from_guild_card_number, data);
}
template <typename CmdT>
void send_simple_mail_t(
shared_ptr<Client> c,
uint32_t from_guild_card_number,
const u16string& from_name,
const u16string& text) {
CmdT cmd;
cmd.player_tag = 0x00010000;
cmd.from_guild_card_number = from_guild_card_number;
cmd.from_name = from_name;
cmd.to_guild_card_number = c->license->serial_number;
cmd.text = text;
send_command_t(c, 0x81, 0x00, cmd);
}
void send_simple_mail_bb(
shared_ptr<Client> c,
uint32_t from_guild_card_number,
const u16string& from_name,
const u16string& text) {
SC_SimpleMail_BB_81 cmd;
cmd.player_tag = 0x00010000;
cmd.from_guild_card_number = from_guild_card_number;
cmd.from_name = from_name;
cmd.to_guild_card_number = c->license->serial_number;
cmd.received_date = decode_sjis(format_time(now()));
cmd.text = text;
send_command_t(c, 0x81, 0x00, cmd);
}
void send_simple_mail(shared_ptr<Client> c, uint32_t from_guild_card_number,
const u16string& from_name, const u16string& text) {
switch (c->version()) {
case GameVersion::DC:
case GameVersion::GC:
case GameVersion::XB:
send_simple_mail_t<SC_SimpleMail_DC_V3_81>(
c, from_guild_card_number, from_name, text);
break;
case GameVersion::PC:
send_simple_mail_t<SC_SimpleMail_PC_81>(
c, from_guild_card_number, from_name, text);
break;
case GameVersion::BB:
send_simple_mail_bb(c, from_guild_card_number, from_name, text);
break;
default:
throw logic_error("unimplemented versioned command");
}
}
////////////////////////////////////////////////////////////////////////////////
// info board
template <typename CharT>
void send_info_board_t(shared_ptr<Client> c, shared_ptr<Lobby> l) {
vector<S_InfoBoardEntry_D8<CharT>> entries;
for (const auto& c : l->clients) {
if (!c.get()) {
continue;
}
auto& e = entries.emplace_back();
e.name = c->game_data.player()->disp.name;
e.message = c->game_data.player()->info_board;
add_color_inplace(e.message);
}
send_command_vt(c, 0xD8, entries.size(), entries);
}
void send_info_board(shared_ptr<Client> c, shared_ptr<Lobby> l) {
if (c->version() == GameVersion::PC ||
c->version() == GameVersion::PATCH ||
c->version() == GameVersion::BB) {
send_info_board_t<char16_t>(c, l);
} else {
send_info_board_t<char>(c, l);
}
}
template <typename CommandHeaderT, typename CharT>
void send_card_search_result_t(
shared_ptr<ServerState> s,
shared_ptr<Client> c,
shared_ptr<Client> result,
shared_ptr<Lobby> result_lobby) {
const auto& port_name = version_to_lobby_port_name.at(static_cast<size_t>(c->version()));
S_GuildCardSearchResult<CommandHeaderT, CharT> cmd;
cmd.player_tag = 0x00010000;
cmd.searcher_guild_card_number = c->license->serial_number;
cmd.result_guild_card_number = result->license->serial_number;
cmd.reconnect_command_header.size = sizeof(cmd.reconnect_command_header) + sizeof(cmd.reconnect_command);
cmd.reconnect_command_header.command = 0x19;
cmd.reconnect_command_header.flag = 0x00;
cmd.reconnect_command.address = s->connect_address_for_client(c);
cmd.reconnect_command.port = s->name_to_port_config.at(port_name)->port;
cmd.reconnect_command.unused = 0;
auto encoded_server_name = encode_sjis(s->name);
string location_string;
if (result_lobby->is_game()) {
string encoded_lobby_name = encode_sjis(result_lobby->name);
location_string = string_printf("%s,BLOCK01,%s",
encoded_lobby_name.c_str(), encoded_server_name.c_str());
} else if (result_lobby->is_ep3()) {
location_string = string_printf("BLOCK01-C%02" PRIu32 ",BLOCK01,%s",
result_lobby->lobby_id - 15, encoded_server_name.c_str());
} else {
location_string = string_printf("BLOCK01-%02" PRIu32 ",BLOCK01,%s",
result_lobby->lobby_id, encoded_server_name.c_str());
}
cmd.location_string = location_string;
cmd.extension.lobby_refs[0].menu_id = MenuID::LOBBY;
cmd.extension.lobby_refs[0].item_id = result->lobby_id;
cmd.extension.player_name = result->game_data.player()->disp.name;
send_command_t(c, 0x41, 0x00, cmd);
}
void send_card_search_result(
shared_ptr<ServerState> s,
shared_ptr<Client> c,
shared_ptr<Client> result,
shared_ptr<Lobby> result_lobby) {
if ((c->version() == GameVersion::DC) ||
(c->version() == GameVersion::GC) ||
(c->version() == GameVersion::XB)) {
send_card_search_result_t<PSOCommandHeaderDCV3, char>(
s, c, result, result_lobby);
} else if (c->version() == GameVersion::PC) {
send_card_search_result_t<PSOCommandHeaderPC, char16_t>(
s, c, result, result_lobby);
} else if (c->version() == GameVersion::BB) {
send_card_search_result_t<PSOCommandHeaderBB, char16_t>(
s, c, result, result_lobby);
} else {
throw logic_error("unimplemented versioned command");
}
}
template <typename CmdT>
void send_guild_card_dc_pc_v3_t(
Channel& ch,
uint32_t guild_card_number,
const u16string& name,
const u16string& description,
uint8_t section_id,
uint8_t char_class) {
CmdT cmd;
cmd.header.subcommand = 0x06;
cmd.header.size = sizeof(CmdT) / 4;
cmd.header.unused = 0x0000;
cmd.player_tag = 0x00010000;
cmd.guild_card_number = guild_card_number;
cmd.name = name;
remove_language_marker_inplace(cmd.name);
cmd.description = description;
cmd.present = 1;
cmd.present2 = 1;
cmd.section_id = section_id;
cmd.char_class = char_class;
ch.send(0x60, 0x00, &cmd, sizeof(cmd));
}
static void send_guild_card_bb(
Channel& ch,
uint32_t guild_card_number,
const u16string& name,
const u16string& team_name,
const u16string& description,
uint8_t section_id,
uint8_t char_class) {
G_SendGuildCard_BB_6x06 cmd;
cmd.header.subcommand = 0x06;
cmd.header.size = sizeof(cmd) / 4;
cmd.header.unused = 0x0000;
cmd.guild_card_number = guild_card_number;
cmd.name = remove_language_marker(name);
cmd.team_name = remove_language_marker(team_name);
cmd.description = description;
cmd.present = 1;
cmd.present2 = 1;
cmd.section_id = section_id;
cmd.char_class = char_class;
ch.send(0x60, 0x00, &cmd, sizeof(cmd));
}
void send_guild_card(
Channel& ch,
uint32_t guild_card_number,
const u16string& name,
const u16string& team_name,
const u16string& description,
uint8_t section_id,
uint8_t char_class) {
if (ch.version == GameVersion::DC) {
send_guild_card_dc_pc_v3_t<G_SendGuildCard_DC_6x06>(
ch, guild_card_number, name, description, section_id, char_class);
} else if (ch.version == GameVersion::PC) {
send_guild_card_dc_pc_v3_t<G_SendGuildCard_PC_6x06>(
ch, guild_card_number, name, description, section_id, char_class);
} else if ((ch.version == GameVersion::GC) ||
(ch.version == GameVersion::XB)) {
send_guild_card_dc_pc_v3_t<G_SendGuildCard_V3_6x06>(
ch, guild_card_number, name, description, section_id, char_class);
} else if (ch.version == GameVersion::BB) {
send_guild_card_bb(
ch, guild_card_number, name, team_name, description, section_id, char_class);
} else {
throw logic_error("unimplemented versioned command");
}
}
void send_guild_card(shared_ptr<Client> c, shared_ptr<Client> source) {
if (!source->license) {
throw runtime_error("source player does not have a license");
}
uint32_t guild_card_number = source->license->serial_number;
u16string name = source->game_data.player()->disp.name;
u16string description = source->game_data.player()->guild_card_description;
uint8_t section_id = source->game_data.player()->disp.visual.section_id;
uint8_t char_class = source->game_data.player()->disp.visual.char_class;
send_guild_card(
c->channel, guild_card_number, name, u"", description, section_id, char_class);
}
////////////////////////////////////////////////////////////////////////////////
// menus
template <typename EntryT>
void send_menu_t(shared_ptr<Client> c, shared_ptr<const Menu> menu, bool is_info_menu) {
vector<EntryT> entries;
{
auto& e = entries.emplace_back();
e.menu_id = menu->menu_id;
e.item_id = 0xFFFFFFFF;
e.flags = 0x0004;
e.text = menu->name;
}
for (const auto& item : menu->items) {
bool is_visible = true;
switch (c->version()) {
case GameVersion::DC:
is_visible &= !(item.flags & MenuItem::Flag::INVISIBLE_ON_DC);
if (c->flags & Client::Flag::IS_DC_TRIAL_EDITION) {
is_visible &= !(item.flags & MenuItem::Flag::INVISIBLE_ON_DCNTE);
}
break;
case GameVersion::PC:
is_visible &= !(item.flags & MenuItem::Flag::INVISIBLE_ON_PC);
break;
case GameVersion::GC:
is_visible &= !(item.flags & MenuItem::Flag::INVISIBLE_ON_GC);
if (c->flags & Client::Flag::IS_GC_TRIAL_EDITION) {
is_visible &= !(item.flags & MenuItem::Flag::INVISIBLE_ON_GC_TRIAL_EDITION);
}
break;
case GameVersion::XB:
is_visible &= !(item.flags & MenuItem::Flag::INVISIBLE_ON_XB);
break;
case GameVersion::BB:
is_visible &= !(item.flags & MenuItem::Flag::INVISIBLE_ON_BB);
break;
default:
throw runtime_error("menus not supported for this game version");
}
if (item.flags & MenuItem::Flag::REQUIRES_MESSAGE_BOXES) {
is_visible &= !(c->flags & Client::Flag::NO_D6);
}
if (item.flags & MenuItem::Flag::REQUIRES_SEND_FUNCTION_CALL) {
is_visible &= !(c->flags & Client::Flag::NO_SEND_FUNCTION_CALL);
}
if (item.flags & MenuItem::Flag::REQUIRES_SAVE_DISABLED) {
is_visible &= !(c->flags & Client::Flag::SAVE_ENABLED);
}
if (item.flags & MenuItem::Flag::INVISIBLE_IN_INFO_MENU) {
is_visible &= !is_info_menu;
}
if (is_visible) {
auto& e = entries.emplace_back();
e.menu_id = menu->menu_id;
e.item_id = item.item_id;
e.flags = (c->version() == GameVersion::BB) ? 0x0004 : 0x0F04;
e.text = item.name;
}
}
send_command_vt(c, is_info_menu ? 0x1F : 0x07, entries.size() - 1, entries);
c->last_menu_sent = menu;
}
void send_menu(shared_ptr<Client> c, shared_ptr<const Menu> menu, bool is_info_menu) {
if (c->version() == GameVersion::PC ||
c->version() == GameVersion::PATCH ||
c->version() == GameVersion::BB) {
send_menu_t<S_MenuEntry_PC_BB_07_1F>(c, menu, is_info_menu);
} else {
send_menu_t<S_MenuEntry_DC_V3_07_1F>(c, menu, is_info_menu);
}
}
template <typename CharT>
void send_game_menu_t(
shared_ptr<Client> c,
shared_ptr<ServerState> s,
bool is_spectator_team_list,
bool show_tournaments_only) {
vector<S_GameMenuEntry<CharT>> entries;
{
auto& e = entries.emplace_back();
e.menu_id = MenuID::GAME;
e.game_id = 0x00000000;
e.difficulty_tag = 0x00;
e.num_players = 0x00;
e.name = s->name;
e.episode = 0x00;
e.flags = 0x04;
}
for (shared_ptr<Lobby> l : s->all_lobbies()) {
if (!l->is_game()) {
continue;
}
if (l->version != c->version()) {
continue;
}
bool l_is_ep3 = l->is_ep3();
bool c_is_ep3 = !!(c->flags & Client::Flag::IS_EPISODE_3);
if (l_is_ep3 != c_is_ep3) {
continue;
}
if ((c->flags & Client::Flag::IS_DC_V1) && (l->flags & Lobby::Flag::NON_V1_ONLY)) {
continue;
}
bool l_is_spectator_team = !!(l->flags & Lobby::Flag::IS_SPECTATOR_TEAM);
if (l_is_spectator_team != is_spectator_team_list) {
continue;
}
if (show_tournaments_only && !l->tournament_match) {
continue;
}
uint8_t episode_num;
switch (l->episode) {
case Episode::EP1:
episode_num = 1;
break;
case Episode::EP2:
episode_num = 2;
break;
case Episode::EP3:
episode_num = 0;
break;
case Episode::EP4:
episode_num = 3;
break;
default:
throw runtime_error("lobby has incorrect episode number");
}
auto& e = entries.emplace_back();
e.menu_id = MenuID::GAME;
e.game_id = l->lobby_id;
e.difficulty_tag = (l_is_ep3 ? 0x0A : (l->difficulty + 0x22));
e.num_players = l->count_clients();
if (c->version() == GameVersion::DC) {
e.episode = (l->flags & Lobby::Flag::NON_V1_ONLY) ? 1 : 0;
} else {
e.episode = ((c->version() == GameVersion::BB) ? (l->max_clients << 4) : 0) | episode_num;
}
if (l->is_ep3()) {
e.flags = (l->password.empty() ? 0 : 2) | ((l->flags & Lobby::Flag::BATTLE_IN_PROGRESS) ? 4 : 0);
} else {
e.flags = ((episode_num << 6) | (l->password.empty() ? 0 : 2));
switch (l->mode) {
case GameMode::NORMAL:
break;
case GameMode::BATTLE:
e.flags |= 0x10;
break;
case GameMode::CHALLENGE:
e.flags |= 0x20;
break;
case GameMode::SOLO:
e.flags |= 0x34;
break;
default:
throw logic_error("invalid game mode");
}
}
e.name = l->name;
}
send_command_vt(c, is_spectator_team_list ? 0xE6 : 0x08, entries.size() - 1, entries);
}
void send_game_menu(
shared_ptr<Client> c,
shared_ptr<ServerState> s,
bool is_spectator_team_list,
bool show_tournaments_only) {
if ((c->version() == GameVersion::DC) ||
(c->version() == GameVersion::GC) ||
(c->version() == GameVersion::XB)) {
send_game_menu_t<char>(c, s, is_spectator_team_list, show_tournaments_only);
} else {
send_game_menu_t<char16_t>(c, s, is_spectator_team_list, show_tournaments_only);
}
}
template <typename EntryT>
void send_quest_menu_t(
shared_ptr<Client> c,
uint32_t menu_id,
const vector<shared_ptr<const Quest>>& quests,
bool is_download_menu) {
vector<EntryT> entries;
for (const auto& quest : quests) {
auto& e = entries.emplace_back();
e.menu_id = menu_id;
e.item_id = quest->menu_item_id;
e.name = quest->name;
e.short_description = quest->short_description;
add_color_inplace(e.short_description);
}
send_command_vt(c, is_download_menu ? 0xA4 : 0xA2, entries.size(), entries);
}
template <typename EntryT>
void send_quest_menu_t(
shared_ptr<Client> c,
uint32_t menu_id,
shared_ptr<const QuestCategoryIndex> category_index,
uint8_t flags) {
bool is_download_menu = flags & (QuestCategoryIndex::Category::Flag::DOWNLOAD | QuestCategoryIndex::Category::Flag::EP3_DOWNLOAD);
vector<EntryT> entries;
for (const auto& category : category_index->categories) {
if (!category.matches_flags(flags)) {
continue;
}
auto& e = entries.emplace_back();
e.menu_id = menu_id;
e.item_id = category.category_id;
e.name = category.name;
e.short_description = category.description;
add_color_inplace(e.short_description);
}
send_command_vt(c, is_download_menu ? 0xA4 : 0xA2, entries.size(), entries);
}
void send_quest_menu(shared_ptr<Client> c, uint32_t menu_id,
const vector<shared_ptr<const Quest>>& quests, bool is_download_menu) {
switch (c->version()) {
case GameVersion::PC:
send_quest_menu_t<S_QuestMenuEntry_PC_A2_A4>(c, menu_id, quests, is_download_menu);
break;
case GameVersion::DC:
case GameVersion::GC:
send_quest_menu_t<S_QuestMenuEntry_DC_GC_A2_A4>(c, menu_id, quests, is_download_menu);
break;
case GameVersion::XB:
send_quest_menu_t<S_QuestMenuEntry_XB_A2_A4>(c, menu_id, quests, is_download_menu);
break;
case GameVersion::BB:
send_quest_menu_t<S_QuestMenuEntry_BB_A2_A4>(c, menu_id, quests, is_download_menu);
break;
default:
throw logic_error("unimplemented versioned command");
}
}
void send_quest_menu(shared_ptr<Client> c, uint32_t menu_id,
shared_ptr<const QuestCategoryIndex> category_index, uint8_t flags) {
switch (c->version()) {
case GameVersion::PC:
send_quest_menu_t<S_QuestMenuEntry_PC_A2_A4>(c, menu_id, category_index, flags);
break;
case GameVersion::DC:
case GameVersion::GC:
send_quest_menu_t<S_QuestMenuEntry_DC_GC_A2_A4>(c, menu_id, category_index, flags);
break;
case GameVersion::XB:
send_quest_menu_t<S_QuestMenuEntry_XB_A2_A4>(c, menu_id, category_index, flags);
break;
case GameVersion::BB:
send_quest_menu_t<S_QuestMenuEntry_BB_A2_A4>(c, menu_id, category_index, flags);
break;
default:
throw logic_error("unimplemented versioned command");
}
}
void send_lobby_list(shared_ptr<Client> c, shared_ptr<ServerState> s) {
// This command appears to be deprecated, as PSO expects it to be exactly how
// this server sends it, and does not react if it's different, except by
// changing the lobby IDs.
vector<S_LobbyListEntry_83> entries;
for (shared_ptr<Lobby> l : s->all_lobbies()) {
if (!(l->flags & Lobby::Flag::DEFAULT)) {
continue;
}
if ((l->flags & Lobby::Flag::NON_V1_ONLY) && (c->flags & Client::Flag::IS_DC_V1)) {
continue;
}
if (l->is_ep3() && !(c->flags & Client::Flag::IS_EPISODE_3)) {
continue;
}
auto& e = entries.emplace_back();
e.menu_id = MenuID::LOBBY;
e.item_id = l->lobby_id;
e.unused = 0;
}
send_command_vt(c, 0x83, entries.size(), entries);
}
////////////////////////////////////////////////////////////////////////////////
// lobby joining
template <typename EntryT>
void send_player_records(shared_ptr<Client> c, shared_ptr<Lobby> l, shared_ptr<Client> joining_client) {
vector<EntryT> entries;
auto add_client = [&](shared_ptr<Client> lc) -> void {
auto lp = lc->game_data.player();
auto& e = entries.emplace_back();
e.client_id = lc->lobby_client_id;
e.challenge = lp->challenge_records;
e.battle = lp->battle_records;
};
if (joining_client) {
add_client(joining_client);
} else {
entries.reserve(12);
for (auto lc : l->clients) {
if (lc) {
add_client(lc);
}
}
}
send_command_vt(c->channel, 0xC5, entries.size(), entries);
}
static void send_join_spectator_team(shared_ptr<Client> c, shared_ptr<Lobby> l) {
if (!(c->flags & Client::Flag::IS_EPISODE_3)) {
throw runtime_error("lobby is not Episode 3");
}
if (!l->is_ep3()) {
throw runtime_error("lobby is not Episode 3");
}
if (!(l->flags & Lobby::Flag::IS_SPECTATOR_TEAM)) {
throw runtime_error("lobby is not a spectator team");
}
S_JoinSpectatorTeam_GC_Ep3_E8 cmd;
cmd.variations.clear(0);
cmd.client_id = c->lobby_client_id;
cmd.leader_id = l->leader_id;
cmd.event = l->event;
cmd.section_id = l->section_id;
cmd.rare_seed = l->random_seed;
cmd.episode = 3;
uint8_t player_count = 0;
auto watched_lobby = l->watched_lobby.lock();
if (watched_lobby) {
// Live spectating
for (size_t z = 0; z < 4; z++) {
if (!watched_lobby->clients[z]) {
continue;
}
auto& p = cmd.players[z];
p.lobby_data.player_tag = 0x00010000;
p.lobby_data.guild_card = watched_lobby->clients[z]->license->serial_number;
p.lobby_data.client_id = watched_lobby->clients[z]->lobby_client_id;
p.lobby_data.name = watched_lobby->clients[z]->game_data.player()->disp.name;
remove_language_marker_inplace(p.lobby_data.name);
p.inventory = watched_lobby->clients[z]->game_data.player()->inventory;
for (size_t y = 0; y < 30; y++) {
p.inventory.items[y].data.bswap_data2_if_mag();
}
p.disp = watched_lobby->clients[z]->game_data.player()->disp.to_dcpcv3();
remove_language_marker_inplace(p.disp.visual.name);
auto& e = cmd.entries[z];
e.player_tag = 0x00010000;
e.guild_card_number = watched_lobby->clients[z]->license->serial_number;
e.name = watched_lobby->clients[z]->game_data.player()->disp.name;
remove_language_marker_inplace(e.name);
e.present = 1;
e.level = watched_lobby->clients[z]->game_data.player()->disp.stats.level.load();
player_count++;
}
} else if (l->battle_player) {
// Battle record replay
const auto* ev = l->battle_player->get_record()->get_first_event();
if (!ev) {
throw runtime_error("battle record contains no events");
}
if (ev->type != Episode3::BattleRecord::Event::Type::SET_INITIAL_PLAYERS) {
throw runtime_error("battle record does not begin with set players event");
}
for (const auto& entry : ev->players) {
uint8_t client_id = entry.lobby_data.client_id;
if (client_id >= 4) {
throw runtime_error("invalid client id in battle record");
}
cmd.players[client_id].lobby_data = entry.lobby_data;
remove_language_marker_inplace(cmd.players[client_id].lobby_data.name);
cmd.players[client_id].inventory = entry.inventory;
for (size_t z = 0; z < 30; z++) {
cmd.players[client_id].inventory.items[z].data.bswap_data2_if_mag();
}
cmd.players[client_id].disp = entry.disp;
remove_language_marker_inplace(cmd.players[client_id].disp.visual.name);
cmd.entries[client_id].player_tag = 0x00010000;
cmd.entries[client_id].guild_card_number = entry.lobby_data.guild_card;
cmd.entries[client_id].name = entry.disp.visual.name;
remove_language_marker_inplace(cmd.entries[client_id].name);
cmd.entries[client_id].present = 1;
cmd.entries[client_id].level = entry.disp.stats.level.load();
player_count++;
}
} else {
throw runtime_error("neither a watched lobby nor a battle player are present");
}
for (size_t z = 4; z < 12; z++) {
if (l->clients[z]) {
cmd.spectator_players[z - 4].lobby_data.player_tag = 0x00010000;
cmd.spectator_players[z - 4].lobby_data.guild_card = l->clients[z]->license->serial_number;
cmd.spectator_players[z - 4].lobby_data.client_id = l->clients[z]->lobby_client_id;
cmd.spectator_players[z - 4].lobby_data.name = l->clients[z]->game_data.player()->disp.name;
remove_language_marker_inplace(cmd.spectator_players[z - 4].lobby_data.name);
cmd.spectator_players[z - 4].inventory = l->clients[z]->game_data.player()->inventory;
cmd.spectator_players[z - 4].disp = l->clients[z]->game_data.player()->disp.to_dcpcv3();
remove_language_marker_inplace(cmd.spectator_players[z - 4].disp.visual.name);
cmd.entries[z].player_tag = 0x00010000;
cmd.entries[z].guild_card_number = l->clients[z]->license->serial_number;
cmd.entries[z].name = l->clients[z]->game_data.player()->disp.name;
remove_language_marker_inplace(cmd.entries[z].name);
cmd.entries[z].present = 1;
cmd.entries[z].level = l->clients[z]->game_data.player()->disp.stats.level.load();
player_count++;
}
}
cmd.spectator_team_name = encode_sjis(l->name);
send_command_t(c, 0xE8, player_count, cmd);
}
template <typename LobbyDataT>
void send_join_game_t(shared_ptr<Client> c, shared_ptr<Lobby> l) {
if (l->flags & Lobby::Flag::IS_SPECTATOR_TEAM) {
send_join_spectator_team(c, l);
return;
}
bool is_ep3 = l->is_ep3();
string data(is_ep3 ? sizeof(S_JoinGame_GC_Ep3_64) : sizeof(S_JoinGame<LobbyDataT>), '\0');
// TODO: This is a terrible way to handle the different Ep3 format within the
// template. Find a way to make this cleaner.
auto* cmd = reinterpret_cast<S_JoinGame<LobbyDataT>*>(data.data());
S_JoinGame_GC_Ep3_64* cmd_ep3 = nullptr;
if (is_ep3) {
cmd_ep3 = reinterpret_cast<S_JoinGame_GC_Ep3_64*>(data.data());
new (cmd_ep3) S_JoinGame_GC_Ep3_64();
} else {
new (cmd) S_JoinGame<LobbyDataT>();
}
cmd->variations = l->variations;
size_t player_count = 0;
for (size_t x = 0; x < 4; x++) {
if (l->clients[x]) {
cmd->lobby_data[x].player_tag = 0x00010000;
cmd->lobby_data[x].guild_card = l->clients[x]->license->serial_number;
cmd->lobby_data[x].client_id = l->clients[x]->lobby_client_id;
cmd->lobby_data[x].name = l->clients[x]->game_data.player()->disp.name;
if (cmd_ep3) {
cmd_ep3->players_ep3[x].inventory = l->clients[x]->game_data.player()->inventory;
for (size_t z = 0; z < 30; z++) {
cmd_ep3->players_ep3[x].inventory.items[z].data.bswap_data2_if_mag();
}
cmd_ep3->players_ep3[x].disp = convert_player_disp_data<PlayerDispDataDCPCV3>(
l->clients[x]->game_data.player()->disp);
}
player_count++;
} else {
cmd->lobby_data[x].clear();
}
}
cmd->client_id = c->lobby_client_id;
cmd->leader_id = l->leader_id;
cmd->disable_udp = 0x01; // Unused on PC/XB/BB
cmd->difficulty = l->difficulty;
cmd->battle_mode = (l->mode == GameMode::BATTLE) ? 1 : 0;
cmd->event = l->event;
cmd->section_id = l->section_id;
cmd->challenge_mode = (l->mode == GameMode::CHALLENGE) ? 1 : 0;
cmd->rare_seed = l->random_seed;
switch (l->episode) {
case Episode::EP1:
cmd->episode = 1;
break;
case Episode::EP2:
cmd->episode = 2;
break;
case Episode::EP3:
cmd->episode = 0xFF;
break;
case Episode::EP4:
cmd->episode = 3;
break;
default:
throw logic_error("invalid episode number in game");
}
cmd->unused2 = 0x01;
cmd->solo_mode = (l->mode == GameMode::SOLO) ? 1 : 0;
cmd->unused3 = 0x00;
send_command(c, 0x64, player_count, data);
}
void send_join_game_dc_nte(shared_ptr<Client> c, shared_ptr<Lobby> l) {
if (l->flags & Lobby::Flag::IS_SPECTATOR_TEAM) {
throw runtime_error("DC NTE players cannot join spectator teams");
}
S_JoinGame_DCNTE_64 cmd;
cmd.client_id = c->lobby_client_id;
cmd.leader_id = l->leader_id;
cmd.disable_udp = 0x01;
cmd.variations = l->variations;
size_t player_count = 0;
for (size_t x = 0; x < 4; x++) {
if (l->clients[x]) {
cmd.lobby_data[x].player_tag = 0x00010000;
cmd.lobby_data[x].guild_card = l->clients[x]->license->serial_number;
cmd.lobby_data[x].client_id = l->clients[x]->lobby_client_id;
cmd.lobby_data[x].name = l->clients[x]->game_data.player()->disp.name;
player_count++;
} else {
cmd.lobby_data[x].clear();
}
}
send_command_t(c, 0x64, player_count, cmd);
}
template <typename LobbyDataT, typename DispDataT, typename RecordsT>
void send_join_lobby_t(shared_ptr<Client> c, shared_ptr<Lobby> l,
shared_ptr<Client> joining_client = nullptr) {
uint8_t command;
if (l->is_game()) {
if (joining_client) {
command = (l->flags & Lobby::Flag::IS_SPECTATOR_TEAM) ? 0xEB : 0x65;
} else {
throw logic_error("send_join_lobby_t should not be used for primary game join command");
}
} else {
command = joining_client ? 0x68 : 0x67;
}
if ((c->version() != GameVersion::DC) || !(c->flags & Client::Flag::IS_DC_V1)) {
send_player_records<RecordsT>(c, l, joining_client);
}
uint8_t lobby_type = (l->type > 14) ? (l->block - 1) : l->type;
// Allow non-canonical lobby types on GC. They may work on other versions too,
// but I haven't verified which values don't crash on each version.
if (c->version() == GameVersion::GC) {
if (c->flags & Client::Flag::IS_EPISODE_3) {
if ((l->type > 0x14) && (l->type < 0xE9)) {
lobby_type = l->block - 1;
}
} else {
if ((l->type > 0x11) && (l->type != 0x67) && (l->type != 0xD4) && (l->type < 0xFC)) {
lobby_type = l->block - 1;
}
}
} else {
if (lobby_type > 0x0E) {
lobby_type = l->block - 1;
}
}
S_JoinLobby<LobbyFlags, LobbyDataT, DispDataT> cmd;
cmd.lobby_flags.client_id = c->lobby_client_id;
cmd.lobby_flags.leader_id = l->leader_id;
cmd.lobby_flags.disable_udp = 0x01;
cmd.lobby_flags.lobby_number = lobby_type;
cmd.lobby_flags.block_number = l->block;
cmd.lobby_flags.unknown_a1 = 0;
cmd.lobby_flags.event = l->event;
cmd.lobby_flags.unknown_a2 = 0;
cmd.lobby_flags.unused = 0;
vector<shared_ptr<Client>> lobby_clients;
if (joining_client) {
lobby_clients.emplace_back(joining_client);
} else {
for (auto lc : l->clients) {
if (lc) {
lobby_clients.emplace_back(lc);
}
}
}
size_t used_entries = 0;
for (const auto& lc : lobby_clients) {
auto& e = cmd.entries[used_entries++];
e.lobby_data.player_tag = 0x00010000;
e.lobby_data.guild_card = lc->license->serial_number;
e.lobby_data.client_id = lc->lobby_client_id;
e.lobby_data.name = lc->game_data.player()->disp.name;
e.inventory = lc->game_data.player()->inventory;
if (c->version() == GameVersion::GC) {
for (size_t z = 0; z < 30; z++) {
e.inventory.items[z].data.bswap_data2_if_mag();
}
}
e.disp = convert_player_disp_data<DispDataT>(lc->game_data.player()->disp);
if ((c->version() == GameVersion::PC) || (c->version() == GameVersion::DC)) {
e.disp.enforce_v2_limits();
}
}
send_command(c, command, used_entries, &cmd, cmd.size(used_entries));
}
void send_join_lobby_dc_nte(shared_ptr<Client> c, shared_ptr<Lobby> l,
shared_ptr<Client> joining_client = nullptr) {
uint8_t command;
if (l->is_game()) {
if (joining_client) {
command = 0x65;
} else {
throw logic_error("send_join_lobby_dc_nte should not be used for primary game join command");
}
} else {
command = joining_client ? 0x68 : 0x67;
}
S_JoinLobby_DCNTE_65_67_68 cmd;
cmd.lobby_flags.client_id = c->lobby_client_id;
cmd.lobby_flags.leader_id = l->leader_id;
cmd.lobby_flags.disable_udp = 0x01;
vector<shared_ptr<Client>> lobby_clients;
if (joining_client) {
lobby_clients.emplace_back(joining_client);
} else {
for (auto lc : l->clients) {
if (lc) {
lobby_clients.emplace_back(lc);
}
}
}
size_t used_entries = 0;
for (const auto& lc : lobby_clients) {
auto& e = cmd.entries[used_entries++];
e.lobby_data.player_tag = 0x00010000;
e.lobby_data.guild_card = lc->license->serial_number;
e.lobby_data.client_id = lc->lobby_client_id;
e.lobby_data.name = lc->game_data.player()->disp.name;
e.inventory = lc->game_data.player()->inventory;
e.disp = convert_player_disp_data<PlayerDispDataDCPCV3>(lc->game_data.player()->disp);
e.disp.enforce_v2_limits();
}
send_command(c, command, used_entries, &cmd, cmd.size(used_entries));
}
void send_join_lobby(shared_ptr<Client> c, shared_ptr<Lobby> l) {
if (l->is_game()) {
switch (c->version()) {
case GameVersion::PC:
send_join_game_t<PlayerLobbyDataPC>(c, l);
break;
case GameVersion::DC:
if (c->flags & (Client::Flag::IS_DC_TRIAL_EDITION | Client::Flag::IS_DC_V1_PROTOTYPE)) {
send_join_game_dc_nte(c, l);
break;
}
[[fallthrough]];
case GameVersion::GC:
send_join_game_t<PlayerLobbyDataDCGC>(c, l);
break;
case GameVersion::XB:
send_join_game_t<PlayerLobbyDataXB>(c, l);
break;
case GameVersion::BB:
send_join_game_t<PlayerLobbyDataBB>(c, l);
break;
default:
throw logic_error("unimplemented versioned command");
}
} else {
switch (c->version()) {
case GameVersion::DC:
if (c->flags & (Client::Flag::IS_DC_TRIAL_EDITION | Client::Flag::IS_DC_V1_PROTOTYPE)) {
send_join_lobby_dc_nte(c, l);
} else {
send_join_lobby_t<PlayerLobbyDataDCGC, PlayerDispDataDCPCV3, PlayerRecordsEntry_DC>(c, l);
}
break;
case GameVersion::PC:
send_join_lobby_t<PlayerLobbyDataPC, PlayerDispDataDCPCV3, PlayerRecordsEntry_PC>(c, l);
break;
case GameVersion::GC:
send_join_lobby_t<PlayerLobbyDataDCGC, PlayerDispDataDCPCV3, PlayerRecordsEntry_V3>(c, l);
break;
case GameVersion::XB:
send_join_lobby_t<PlayerLobbyDataXB, PlayerDispDataDCPCV3, PlayerRecordsEntry_V3>(c, l);
break;
case GameVersion::BB:
send_join_lobby_t<PlayerLobbyDataBB, PlayerDispDataBB, PlayerRecordsEntry_BB>(c, l);
break;
default:
throw logic_error("unimplemented versioned command");
}
}
// If the client will stop sending message box close confirmations after
// joining any lobby, set the appropriate flag and update the client config
if ((c->flags & (Client::Flag::NO_D6_AFTER_LOBBY | Client::Flag::NO_D6)) == Client::Flag::NO_D6_AFTER_LOBBY) {
c->flags |= Client::Flag::NO_D6;
send_update_client_config(c);
}
}
void send_player_join_notification(shared_ptr<Client> c,
shared_ptr<Lobby> l, shared_ptr<Client> joining_client) {
switch (c->version()) {
case GameVersion::DC:
if (c->flags & (Client::Flag::IS_DC_TRIAL_EDITION | Client::Flag::IS_DC_V1_PROTOTYPE)) {
send_join_lobby_dc_nte(c, l, joining_client);
} else {
send_join_lobby_t<PlayerLobbyDataDCGC, PlayerDispDataDCPCV3, PlayerRecordsEntry_DC>(c, l, joining_client);
}
break;
case GameVersion::PC:
send_join_lobby_t<PlayerLobbyDataPC, PlayerDispDataDCPCV3, PlayerRecordsEntry_PC>(c, l, joining_client);
break;
case GameVersion::GC:
send_join_lobby_t<PlayerLobbyDataDCGC, PlayerDispDataDCPCV3, PlayerRecordsEntry_V3>(c, l, joining_client);
break;
case GameVersion::XB:
send_join_lobby_t<PlayerLobbyDataXB, PlayerDispDataDCPCV3, PlayerRecordsEntry_V3>(c, l, joining_client);
break;
case GameVersion::BB:
send_join_lobby_t<PlayerLobbyDataBB, PlayerDispDataBB, PlayerRecordsEntry_BB>(c, l, joining_client);
break;
default:
throw logic_error("unimplemented versioned command");
}
}
void send_player_leave_notification(shared_ptr<Lobby> l, uint8_t leaving_client_id) {
S_LeaveLobby_66_69_Ep3_E9 cmd = {leaving_client_id, l->leader_id, 1, 0};
uint8_t cmd_num;
if (l->is_game()) {
cmd_num = (l->flags & Lobby::Flag::IS_SPECTATOR_TEAM) ? 0xE9 : 0x66;
} else {
cmd_num = 0x69;
}
send_command_t(l, cmd_num, leaving_client_id, cmd);
for (const auto& watcher_l : l->watcher_lobbies) {
send_command_t(watcher_l, cmd_num, leaving_client_id, cmd);
}
}
void send_self_leave_notification(shared_ptr<Client> c) {
S_LeaveLobby_66_69_Ep3_E9 cmd = {c->lobby_client_id, 0, 1, 0};
send_command_t(c, 0x69, c->lobby_client_id, cmd);
}
void send_get_player_info(shared_ptr<Client> c) {
if ((c->version() == GameVersion::DC) &&
(c->flags & Client::Flag::IS_DC_TRIAL_EDITION)) {
send_command(c, 0x8D, 0x00);
} else {
send_command(c, 0x95, 0x00);
}
}
////////////////////////////////////////////////////////////////////////////////
// Trade window
void send_execute_item_trade(shared_ptr<Client> c,
const vector<ItemData>& items) {
SC_TradeItems_D0_D3 cmd;
if (items.size() > cmd.item_datas.size()) {
throw logic_error("too many items in execute trade command");
}
cmd.target_client_id = c->lobby_client_id;
cmd.item_count = items.size();
for (size_t x = 0; x < items.size(); x++) {
cmd.item_datas[x] = items[x];
if (c->version() == GameVersion::GC) {
cmd.item_datas[x].bswap_data2_if_mag();
}
}
send_command_t(c, 0xD3, 0x00, cmd);
}
void send_execute_card_trade(shared_ptr<Client> c,
const vector<pair<uint32_t, uint32_t>>& card_to_count) {
if (!(c->flags & Client::Flag::IS_EPISODE_3)) {
throw logic_error("cannot send trade cards command to non-Ep3 client");
}
SC_TradeCards_GC_Ep3_EE_FlagD0_FlagD3 cmd;
constexpr size_t max_entries = sizeof(cmd.entries) / sizeof(cmd.entries[0]);
if (card_to_count.size() > max_entries) {
throw logic_error("too many items in execute card trade command");
}
cmd.target_client_id = c->lobby_client_id;
cmd.entry_count = card_to_count.size();
size_t x;
for (x = 0; x < card_to_count.size(); x++) {
cmd.entries[x].card_type = card_to_count[x].first;
cmd.entries[x].count = card_to_count[x].second;
}
for (; x < max_entries; x++) {
cmd.entries[x].card_type = 0;
cmd.entries[x].count = 0;
}
send_command_t(c, 0xEE, 0xD3, cmd);
}
////////////////////////////////////////////////////////////////////////////////
// arrows
void send_arrow_update(shared_ptr<Lobby> l) {
vector<S_ArrowUpdateEntry_88> entries;
for (size_t x = 0; x < l->max_clients; x++) {
if (!l->clients[x]) {
continue;
}
auto& e = entries.emplace_back();
e.player_tag = 0x00010000;
e.guild_card_number = l->clients[x]->license->serial_number;
e.arrow_color = l->clients[x]->lobby_arrow_color;
}
for (size_t x = 0; x < l->max_clients; x++) {
if (!l->clients[x] || (l->clients[x]->flags & Client::Flag::IS_DC_V1)) {
continue;
}
send_command_vt(l->clients[x], 0x88, entries.size(), entries);
}
}
// tells the player that the joining player is done joining, and the game can resume
void send_resume_game(shared_ptr<Lobby> l, shared_ptr<Client> ready_client) {
static const be_uint32_t data = 0x72010000;
send_command_excluding_client(l, ready_client, 0x60, 0x00, &data, sizeof(be_uint32_t));
}
////////////////////////////////////////////////////////////////////////////////
// Game/cheat commands
static vector<G_UpdatePlayerStat_6x9A> generate_stats_change_subcommands(
uint16_t client_id, PlayerStatsChange stat, uint32_t amount) {
if (amount > (0x7BF8 * 0xFF) / sizeof(G_UpdatePlayerStat_6x9A)) {
throw runtime_error("stats change command is too large");
}
uint8_t stat_ch = static_cast<uint8_t>(stat);
vector<G_UpdatePlayerStat_6x9A> subs;
while (amount > 0) {
uint8_t sub_amount = min<size_t>(amount, 0xFF);
subs.emplace_back(G_UpdatePlayerStat_6x9A{{0x9A, 0x02, client_id}, 0, stat_ch, sub_amount});
amount -= sub_amount;
}
return subs;
}
void send_player_stats_change(shared_ptr<Lobby> l, shared_ptr<Client> c,
PlayerStatsChange stat, uint32_t amount) {
auto subs = generate_stats_change_subcommands(c->lobby_client_id, stat, amount);
send_command_vt(l, (subs.size() > 0x400 / sizeof(G_UpdatePlayerStat_6x9A)) ? 0x6C : 0x60, 0x00, subs);
}
void send_player_stats_change(Channel& ch, uint16_t client_id, PlayerStatsChange stat, uint32_t amount) {
auto subs = generate_stats_change_subcommands(client_id, stat, amount);
send_command_vt(ch, (subs.size() > 0x400 / sizeof(G_UpdatePlayerStat_6x9A)) ? 0x6C : 0x60, 0x00, subs);
}
void send_warp(Channel& ch, uint8_t client_id, uint32_t area, bool is_private) {
G_InterLevelWarp_6x94 cmd = {{0x94, 0x02, 0}, area, {}};
ch.send(is_private ? 0x62 : 0x60, client_id, &cmd, sizeof(cmd));
}
void send_warp(shared_ptr<Client> c, uint32_t area, bool is_private) {
send_warp(c->channel, c->lobby_client_id, area, is_private);
c->area = area;
}
void send_warp(shared_ptr<Lobby> l, uint32_t area, bool is_private) {
for (const auto& c : l->clients) {
if (c) {
send_warp(c, area, is_private);
}
}
}
void send_ep3_change_music(Channel& ch, uint32_t song) {
G_ChangeLobbyMusic_GC_Ep3_6xBF cmd = {{0xBF, 0x02, 0}, song};
ch.send(0x60, 0x00, cmd);
}
void send_set_player_visibility(shared_ptr<Lobby> l, shared_ptr<Client> c,
bool visible) {
uint8_t subcmd = visible ? 0x23 : 0x22;
uint16_t client_id = c->lobby_client_id;
G_SetPlayerVisibility_6x22_6x23 cmd = {{subcmd, 0x01, client_id}};
send_command_t(l, 0x60, 0x00, cmd);
}
////////////////////////////////////////////////////////////////////////////////
// BB game commands
void send_drop_item(Channel& ch, const ItemData& item,
bool from_enemy, uint8_t area, float x, float z, uint16_t entity_id) {
G_DropItem_PC_V3_BB_6x5F cmd = {
{{0x5F, 0x0B, 0x0000}, area, from_enemy, entity_id, x, z, 0, 0, item}, 0};
if (ch.version == GameVersion::GC) {
cmd.item_data.bswap_data2_if_mag();
}
ch.send(0x60, 0x00, &cmd, sizeof(cmd));
}
void send_drop_item(shared_ptr<Lobby> l, const ItemData& item,
bool from_enemy, uint8_t area, float x, float z, uint16_t entity_id) {
for (auto& c : l->clients) {
if (!c) {
continue;
}
send_drop_item(c->channel, item, from_enemy, area, x, z, entity_id);
}
}
void send_drop_stacked_item(Channel& ch, const ItemData& item,
uint8_t area, float x, float z) {
G_DropStackedItem_PC_V3_BB_6x5D cmd = {
{{0x5D, 0x0A, 0x0000}, area, 0, x, z, item}, 0};
if (ch.version == GameVersion::GC) {
cmd.item_data.bswap_data2_if_mag();
}
ch.send(0x60, 0x00, &cmd, sizeof(cmd));
}
void send_drop_stacked_item(shared_ptr<Lobby> l, const ItemData& item,
uint8_t area, float x, float z) {
for (auto& c : l->clients) {
if (!c) {
continue;
}
send_drop_stacked_item(c->channel, item, area, x, z);
}
}
void send_pick_up_item(shared_ptr<Lobby> l, shared_ptr<Client> c,
uint32_t item_id, uint8_t area) {
uint16_t client_id = c->lobby_client_id;
G_PickUpItem_6x59 cmd = {
{0x59, 0x03, client_id}, client_id, area, item_id};
send_command_t(l, 0x60, 0x00, cmd);
}
void send_create_inventory_item(shared_ptr<Lobby> l, shared_ptr<Client> c,
const ItemData& item) {
if (c->version() != GameVersion::BB) {
throw logic_error("6xBE can only be sent to BB clients");
}
uint16_t client_id = c->lobby_client_id;
G_CreateInventoryItem_BB_6xBE cmd = {{0xBE, 0x07, client_id}, item, 0};
send_command_t(l, 0x60, 0x00, cmd);
}
void send_destroy_item(shared_ptr<Lobby> l, shared_ptr<Client> c,
uint32_t item_id, uint32_t amount) {
uint16_t client_id = c->lobby_client_id;
G_DeleteInventoryItem_6x29 cmd = {{0x29, 0x03, client_id}, item_id, amount};
send_command_t(l, 0x60, 0x00, cmd);
}
void send_item_identify_result(shared_ptr<Lobby> l, shared_ptr<Client> c) {
if (c->version() != GameVersion::BB) {
throw logic_error("cannot send item identify result to non-BB client");
}
G_IdentifyResult_BB_6xB9 res;
res.header.subcommand = 0xB9;
res.header.size = sizeof(res) / 4;
res.header.client_id = c->lobby_client_id;
res.item_data = c->game_data.identify_result.data;
send_command_t(l, 0x60, 0x00, res);
}
void send_bank(shared_ptr<Client> c) {
if (c->version() != GameVersion::BB) {
throw logic_error("6xBC can only be sent to BB clients");
}
vector<PlayerBankItem> items(c->game_data.player()->bank.items,
&c->game_data.player()->bank.items[c->game_data.player()->bank.num_items]);
uint32_t checksum = random_object<uint32_t>();
G_BankContentsHeader_BB_6xBC cmd = {
{{0xBC, 0, 0}, 0}, checksum, c->game_data.player()->bank.num_items, c->game_data.player()->bank.meseta};
size_t size = 8 + sizeof(cmd) + items.size() * sizeof(PlayerBankItem);
cmd.header.size = size;
send_command_t_vt(c, 0x6C, 0x00, cmd, items);
}
void send_shop(shared_ptr<Client> c, uint8_t shop_type) {
if (c->version() != GameVersion::BB) {
throw logic_error("6xB6 can only be sent to BB clients");
}
const auto& contents = c->game_data.shop_contents.at(shop_type);
G_ShopContents_BB_6xB6 cmd = {
{0xB6, static_cast<uint8_t>(2 + (sizeof(ItemData) >> 2) * contents.size()), 0x0000},
shop_type,
static_cast<uint8_t>(contents.size()),
0,
{},
};
for (size_t x = 0; x < contents.size(); x++) {
cmd.item_datas[x] = contents[x];
}
send_command(c, 0x60, 0x00, &cmd, sizeof(cmd) - sizeof(cmd.item_datas[0]) * (20 - contents.size()));
}
// notifies players about a level up
void send_level_up(shared_ptr<Lobby> l, shared_ptr<Client> c) {
CharacterStats stats = c->game_data.player()->disp.stats.char_stats;
for (size_t x = 0; x < c->game_data.player()->inventory.num_items; x++) {
if ((c->game_data.player()->inventory.items[x].flags & 0x08) &&
(c->game_data.player()->inventory.items[x].data.data1[0] == 0x02)) {
stats.dfp += (c->game_data.player()->inventory.items[x].data.data1w[2] / 100);
stats.atp += (c->game_data.player()->inventory.items[x].data.data1w[3] / 50);
stats.ata += (c->game_data.player()->inventory.items[x].data.data1w[4] / 200);
stats.mst += (c->game_data.player()->inventory.items[x].data.data1w[5] / 50);
}
}
G_LevelUp_6x30 cmd = {
{0x30, sizeof(G_LevelUp_6x30) / 4, c->lobby_client_id},
stats.atp,
stats.mst,
stats.evp,
stats.hp,
stats.dfp,
stats.ata,
c->game_data.player()->disp.stats.level.load(),
0};
send_command_t(l, 0x60, 0x00, cmd);
}
void send_give_experience(shared_ptr<Lobby> l, shared_ptr<Client> c,
uint32_t amount) {
if (c->version() != GameVersion::BB) {
throw logic_error("6xBF can only be sent to BB clients");
}
uint16_t client_id = c->lobby_client_id;
G_GiveExperience_BB_6xBF cmd = {
{0xBF, sizeof(G_GiveExperience_BB_6xBF) / 4, client_id}, amount};
send_command_t(l, 0x60, 0x00, cmd);
}
void send_set_exp_multiplier(std::shared_ptr<Lobby> l) {
if (l->version != GameVersion::BB) {
throw logic_error("6xDD can only be sent to BB clients");
}
if (!l->is_game()) {
throw logic_error("6xDD can only be sent in games (not in lobbies)");
}
G_SetEXPMultiplier_BB_6xDD cmd = {{0xBF, sizeof(G_SetEXPMultiplier_BB_6xDD) / 4, l->exp_multiplier}};
send_command_t(l, 0x60, 0x00, cmd);
}
void send_rare_enemy_index_list(shared_ptr<Client> c, const vector<size_t>& indexes) {
S_RareMonsterList_BB_DE cmd;
if (indexes.size() > cmd.enemy_ids.size()) {
throw runtime_error("too many rare enemies");
}
for (size_t z = 0; z < indexes.size(); z++) {
cmd.enemy_ids[z] = indexes[z];
}
cmd.enemy_ids.clear_after(indexes.size(), 0xFFFF);
send_command_t(c, 0xDE, 0x00, cmd);
}
////////////////////////////////////////////////////////////////////////////////
// ep3 only commands
void send_ep3_card_list_update(shared_ptr<ServerState> s, shared_ptr<Client> c) {
if (!(c->flags & Client::Flag::HAS_EP3_CARD_DEFS)) {
const auto& data = (c->flags & Client::Flag::IS_EP3_TRIAL_EDITION)
? s->ep3_card_index_trial->get_compressed_definitions()
: s->ep3_card_index->get_compressed_definitions();
StringWriter w;
w.put_u32l(data.size());
w.write(data);
send_command(c, 0xB8, 0x00, w.str());
c->flags |= Client::Flag::HAS_EP3_CARD_DEFS;
send_update_client_config(c);
}
}
void send_ep3_media_update(
shared_ptr<Client> c,
uint32_t type,
uint32_t which,
const string& compressed_data) {
StringWriter w;
w.put<S_UpdateMediaHeader_GC_Ep3_B9>({type, which, compressed_data.size(), 0});
w.write(compressed_data);
while (w.size() & 3) {
w.put_u8(0);
}
send_command(c, 0xB9, 0x00, w.str());
}
void send_ep3_rank_update(shared_ptr<ServerState> s, shared_ptr<Client> c) {
uint32_t meseta = s->ep3_infinite_meseta ? 1000000 : 0;
S_RankUpdate_GC_Ep3_B7 cmd = {0, "\0\0\0\0\0\0\0\0\0\0\0", meseta, meseta, 0xFFFFFFFF};
send_command_t(c, 0xB7, 0x00, cmd);
}
void send_ep3_card_battle_table_state(shared_ptr<Lobby> l, uint16_t table_number) {
S_CardBattleTableState_GC_Ep3_E4 cmd;
for (size_t z = 0; z < 4; z++) {
cmd.entries[z].state = 0;
cmd.entries[z].unknown_a1 = 0;
cmd.entries[z].guild_card_number = 0;
}
set<shared_ptr<Client>> clients;
for (const auto& c : l->clients) {
if (!c) {
continue;
}
if (c->card_battle_table_number == table_number) {
if (c->card_battle_table_seat_number > 3) {
throw runtime_error("invalid battle table seat number");
}
auto& e = cmd.entries[c->card_battle_table_seat_number];
if (e.state == 0) {
e.state = c->card_battle_table_seat_state;
e.guild_card_number = c->license->serial_number;
clients.emplace(c);
}
}
}
for (const auto& c : clients) {
send_command_t(c, 0xE4, table_number, cmd);
}
}
void send_ep3_set_context_token(shared_ptr<Client> c, uint32_t context_token) {
G_SetContextToken_GC_Ep3_6xB4x1F cmd;
cmd.context_token = context_token;
send_command_t(c, 0xC9, 0x00, cmd);
}
void send_ep3_confirm_tournament_entry(
shared_ptr<ServerState> s,
shared_ptr<Client> c,
shared_ptr<const Episode3::Tournament> tourn) {
if (c->flags & Client::Flag::IS_EP3_TRIAL_EDITION) {
throw runtime_error("cannot send tournament entry command to Episode 3 Trial Edition client");
}
S_ConfirmTournamentEntry_GC_Ep3_CC cmd;
if (tourn) {
cmd.tournament_name = tourn->get_name();
cmd.server_name = encode_sjis(s->name);
// TODO: Fill this in appropriately when we support scheduled start times
cmd.start_time = "Unknown";
auto& teams = tourn->all_teams();
cmd.num_teams = min<size_t>(teams.size(), 0x20);
for (size_t z = 0; z < min<size_t>(teams.size(), 0x20); z++) {
cmd.team_entries[z].win_count = teams[z]->num_rounds_cleared;
cmd.team_entries[z].is_active = teams[z]->is_active;
cmd.team_entries[z].name = teams[z]->name;
}
}
send_command_t(c, 0xCC, tourn ? 0x01 : 0x00, cmd);
}
void send_ep3_tournament_list(
shared_ptr<ServerState> s,
shared_ptr<Client> c,
bool is_for_spectator_team_create) {
S_TournamentList_GC_Ep3_E0 cmd;
size_t z = 0;
for (const auto& tourn : s->ep3_tournament_index->all_tournaments()) {
if (z >= 0x20) {
throw logic_error("more than 32 tournaments exist");
}
auto& entry = cmd.entries[z];
entry.menu_id = is_for_spectator_team_create
? MenuID::TOURNAMENTS_FOR_SPEC
: MenuID::TOURNAMENTS;
entry.item_id = tourn->get_number();
// TODO: What does it mean for a tournament to be locked? Should we support
// that?
// TODO: Write appropriate round text (1st, 2nd, 3rd) here. This is
// nontrivial because unlike Sega's implementation, newserv does not require
// a round to completely finish before starting matches in the next round,
// as long as the winners of the preceding matches have been determined.
entry.state =
(tourn->get_state() == Episode3::Tournament::State::REGISTRATION)
? 0x00
: 0x05;
// TODO: Fill in cmd.start_time here when we implement scheduled starts.
entry.name = tourn->get_name();
const auto& teams = tourn->all_teams();
for (auto team : teams) {
if (!team->name.empty()) {
entry.num_teams++;
}
}
entry.max_teams = teams.size();
entry.unknown_a3 = 0xFFFF;
entry.unknown_a4 = 0xFFFF;
z++;
}
send_command_t(c, 0xE0, z, cmd);
}
void send_ep3_tournament_entry_list(
shared_ptr<Client> c,
shared_ptr<const Episode3::Tournament> tourn,
bool is_for_spectator_team_create) {
S_TournamentEntryList_GC_Ep3_E2 cmd;
cmd.players_per_team = tourn->get_is_2v2() ? 2 : 1;
size_t z = 0;
for (const auto& team : tourn->all_teams()) {
if (z >= 0x20) {
throw logic_error("more than 32 teams in tournament");
}
auto& entry = cmd.entries[z];
entry.menu_id = MenuID::TOURNAMENT_ENTRIES;
entry.item_id = (tourn->get_number() << 16) | z;
entry.unknown_a2 = team->num_rounds_cleared;
entry.locked = team->password.empty() ? 0 : 1;
if (tourn->get_state() != Episode3::Tournament::State::REGISTRATION) {
entry.state = 2;
} else if (team->name.empty()) {
entry.state = 0;
} else if (team->players.size() < team->max_players) {
entry.state = 1;
} else {
entry.state = 2;
}
entry.name = team->name;
z++;
}
send_command_t(c, is_for_spectator_team_create ? 0xE7 : 0xE2, z, cmd);
}
void send_ep3_tournament_details(
shared_ptr<Client> c,
shared_ptr<const Episode3::Tournament> tourn) {
S_TournamentGameDetails_GC_Ep3_E3 cmd;
cmd.name = tourn->get_name();
cmd.map_name = tourn->get_map()->map.name;
cmd.rules = tourn->get_rules();
const auto& teams = tourn->all_teams();
for (size_t z = 0; z < min<size_t>(teams.size(), 0x20); z++) {
cmd.bracket_entries[z].win_count = teams[z]->num_rounds_cleared;
cmd.bracket_entries[z].is_active = teams[z]->is_active ? 1 : 0;
cmd.bracket_entries[z].team_name = teams[z]->name;
}
cmd.num_bracket_entries = teams.size();
cmd.players_per_team = tourn->get_is_2v2() ? 2 : 1;
send_command_t(c, 0xE3, 0x02, cmd);
}
string ep3_description_for_client(shared_ptr<Client> c) {
if (!(c->flags & Client::Flag::IS_EPISODE_3)) {
throw runtime_error("client is not Episode 3");
}
auto player = c->game_data.player();
return string_printf(
"%s CLv%" PRIu32 " %c",
name_for_char_class(player->disp.visual.char_class),
player->disp.stats.level + 1,
char_for_language_code(player->inventory.language));
}
void send_ep3_game_details(shared_ptr<Client> c, shared_ptr<Lobby> l) {
shared_ptr<Lobby> primary_lobby;
if (l->flags & Lobby::Flag::IS_SPECTATOR_TEAM) {
primary_lobby = l->watched_lobby.lock();
} else {
primary_lobby = l;
}
auto tourn_match = primary_lobby ? primary_lobby->tournament_match : nullptr;
auto tourn = tourn_match ? tourn_match->tournament.lock() : nullptr;
if (tourn) {
S_TournamentGameDetails_GC_Ep3_E3 cmd;
cmd.name = encode_sjis(l->name);
cmd.map_name = tourn->get_map()->map.name;
cmd.rules = tourn->get_rules();
const auto& teams = tourn->all_teams();
for (size_t z = 0; z < min<size_t>(teams.size(), 0x20); z++) {
auto& entry = cmd.bracket_entries[z];
entry.win_count = teams[z]->num_rounds_cleared;
entry.is_active = teams[z]->is_active ? 1 : 0;
entry.team_name = teams[z]->name;
}
cmd.num_bracket_entries = teams.size();
cmd.players_per_team = tourn->get_is_2v2() ? 2 : 1;
if (primary_lobby) {
auto serial_number_to_client = primary_lobby->clients_by_serial_number();
auto describe_team = [&](S_TournamentGameDetails_GC_Ep3_E3::TeamEntry& team_entry, shared_ptr<const Episode3::Tournament::Team> team) -> void {
team_entry.team_name = team->name;
for (size_t z = 0; z < team->players.size(); z++) {
auto& entry = team_entry.players[z];
const auto& player = team->players[z];
if (player.is_human()) {
auto c = serial_number_to_client.at(player.serial_number);
entry.name = c->game_data.player()->disp.name;
entry.description = ep3_description_for_client(c);
} else {
entry.name = player.com_deck->player_name;
entry.description = "Deck: " + player.com_deck->deck_name;
}
}
};
describe_team(cmd.team_entries[0], tourn_match->preceding_a->winner_team);
describe_team(cmd.team_entries[1], tourn_match->preceding_b->winner_team);
}
uint8_t flag;
if (l != primary_lobby) {
for (auto spec_c : l->clients) {
if (spec_c) {
auto& entry = cmd.spectator_entries[cmd.num_spectators++];
entry.name = encode_sjis(spec_c->game_data.player()->disp.name);
entry.description = ep3_description_for_client(spec_c);
}
}
flag = 0x05;
} else {
flag = 0x03;
}
send_command_t(c, 0xE3, flag, cmd);
} else {
S_GameInformation_GC_Ep3_E1 cmd;
cmd.game_name = encode_sjis(l->name);
if (primary_lobby) {
size_t num_players = 0;
for (const auto& opp_c : primary_lobby->clients) {
if (opp_c) {
cmd.player_entries[num_players].name = opp_c->game_data.player()->disp.name;
cmd.player_entries[num_players].description = ep3_description_for_client(opp_c);
num_players++;
}
}
}
uint8_t flag;
if (l != primary_lobby) {
// TODO: This doesn't work (nothing shows up), but it appears to be a
// client bug? There doesn't appear to be a count field in the command
// anywhere...?
size_t num_spectators = 0;
for (auto spec_c : l->clients) {
if (spec_c) {
auto& entry = cmd.spectator_entries[num_spectators++];
entry.name = encode_sjis(spec_c->game_data.player()->disp.name);
entry.description = ep3_description_for_client(spec_c);
}
}
flag = 0x04;
} else if (primary_lobby &&
primary_lobby->ep3_server_base &&
primary_lobby->ep3_server_base->server->get_setup_phase() != Episode3::SetupPhase::REGISTRATION) {
cmd.rules = primary_lobby->ep3_server_base->map_and_rules1->rules;
flag = 0x01;
} else {
flag = 0x00;
}
send_command_t(c, 0xE1, flag, cmd);
}
}
void send_ep3_set_tournament_player_decks(
shared_ptr<ServerState> s,
shared_ptr<Lobby> l,
shared_ptr<Client> c,
shared_ptr<const Episode3::Tournament::Match> match) {
auto tourn = match->tournament.lock();
if (!tourn) {
throw runtime_error("tournament is deleted");
}
G_SetTournamentPlayerDecks_GC_Ep3_6xB4x3D cmd;
cmd.rules = tourn->get_rules();
cmd.map_number = tourn->get_map()->map.map_number.load();
cmd.player_slot = 0xFF;
for (size_t z = 0; z < 4; z++) {
auto& entry = cmd.entries[z];
entry.player_name.clear(0);
entry.deck_name.clear(0);
entry.unknown_a1.clear(0);
entry.card_ids.clear(0);
entry.client_id = z;
}
auto serial_number_to_client = l->clients_by_serial_number();
auto add_entries_for_team = [&](shared_ptr<const Episode3::Tournament::Team> team, size_t base_index) -> void {
for (size_t z = 0; z < team->players.size(); z++) {
auto& entry = cmd.entries[base_index + z];
const auto& player = team->players[z];
if (player.is_human()) {
entry.type = 1; // Human
entry.player_name = serial_number_to_client.at(player.serial_number)->game_data.player()->disp.name;
if (player.serial_number == c->license->serial_number) {
cmd.player_slot = base_index + z;
}
} else {
entry.type = 2; // COM
entry.player_name = player.com_deck->player_name;
entry.deck_name = player.com_deck->deck_name;
entry.card_ids = player.com_deck->card_ids;
}
entry.unknown_a2 = 6;
}
};
add_entries_for_team(match->preceding_a->winner_team, 0);
add_entries_for_team(match->preceding_b->winner_team, 2);
if (!(s->ep3_behavior_flags & Episode3::BehaviorFlag::DISABLE_MASKING)) {
uint8_t mask_key = (random_object<uint32_t>() % 0xFF) + 1;
set_mask_for_ep3_game_command(&cmd, sizeof(cmd), mask_key);
}
send_command_t(c, 0xC9, 0x00, cmd);
// TODO: Handle disconnection during the match (the other team should win)
}
void send_ep3_tournament_match_result(
shared_ptr<ServerState> s, shared_ptr<Lobby> l, shared_ptr<const Episode3::Tournament::Match> match) {
auto tourn = match->tournament.lock();
if (!tourn) {
return;
}
if ((match->winner_team != match->preceding_a->winner_team) &&
(match->winner_team != match->preceding_b->winner_team)) {
throw logic_error("cannot send tournament result without valid winner team");
}
auto serial_number_to_client = l->clients_by_serial_number();
auto write_player_names = [&](G_TournamentMatchResult_GC_Ep3_6xB4x51::NamesEntry& entry, shared_ptr<const Episode3::Tournament::Team> team) -> void {
for (size_t z = 0; z < team->players.size(); z++) {
const auto& player = team->players[z];
if (player.is_human()) {
entry.player_names[z] = serial_number_to_client.at(player.serial_number)->game_data.player()->disp.name;
} else {
entry.player_names[z] = player.com_deck->player_name;
}
}
};
G_TournamentMatchResult_GC_Ep3_6xB4x51 cmd;
cmd.match_description = (match == tourn->get_final_match())
? string_printf("(%s) Final match", tourn->get_name().c_str())
: string_printf("(%s) Round %zu", tourn->get_name().c_str(), match->round_num);
cmd.names_entries[0].team_name = match->preceding_a->winner_team->name;
write_player_names(cmd.names_entries[0], match->preceding_a->winner_team);
cmd.names_entries[1].team_name = match->preceding_b->winner_team->name;
write_player_names(cmd.names_entries[1], match->preceding_b->winner_team);
// The value 6 here causes the client to show the "Congratulations" text
// instead of "On to the next round"
cmd.round_num = (match == tourn->get_final_match()) ? 6 : match->round_num;
cmd.num_players_per_team = match->preceding_a->winner_team->max_players;
cmd.winner_team_id = (match->preceding_b->winner_team == match->winner_team);
// TODO: This amount should vary depending on the match level / round number,
// but newserv doesn't currently implement meseta at all - we just always give
// the player 1000000 and never charge for anything.
cmd.meseta_amount = 100;
cmd.meseta_reward_text = "You got %s meseta!";
if (!(s->ep3_behavior_flags & Episode3::BehaviorFlag::DISABLE_MASKING)) {
uint8_t mask_key = (random_object<uint32_t>() % 0xFF) + 1;
set_mask_for_ep3_game_command(&cmd, sizeof(cmd), mask_key);
}
send_command_t(l, 0xC9, 0x00, cmd);
if (s->ep3_behavior_flags & Episode3::BehaviorFlag::ENABLE_STATUS_MESSAGES) {
send_text_message_printf(l, "$C5TOURN/%02hhX/%zu WIN %c",
tourn->get_number(), match->round_num,
match->winner_team == match->preceding_a->winner_team ? 'A' : 'B');
}
}
void send_ep3_update_spectator_count(shared_ptr<Lobby> l) {
G_SetGameMetadata_GC_Ep3_6xB4x52 cmd;
for (auto watcher_l : l->watcher_lobbies) {
for (auto c : watcher_l->clients) {
cmd.total_spectators += (c.get() != nullptr);
}
}
// TODO: Make s available here so we can apply masking if needed (perhaps by
// adding a weak_ptr in Lobby... it'd be dumb to require s to be passed in to
// this function just to check a behavior flag)
// Note: We can't use send_command_t(l, ...) here because that would send the
// same command to l and to all watcher lobbies. The commands should have
// different values depending on who's in each watcher lobby, so we have to
// manually send to each client here.
for (auto c : l->clients) {
if (c) {
send_command_t(c, 0xC9, 0x00, cmd);
}
}
for (auto watcher_l : l->watcher_lobbies) {
cmd.local_spectators = 0;
for (auto c : watcher_l->clients) {
cmd.local_spectators += (c.get() != nullptr);
}
for (auto c : watcher_l->clients) {
if (c) {
send_command_t(c, 0xC9, 0x00, cmd);
}
}
}
}
void set_mask_for_ep3_game_command(void* vdata, size_t size, uint8_t mask_key) {
if (size < 8) {
throw logic_error("Episode 3 game command is too short for masking");
}
auto* header = reinterpret_cast<G_CardBattleCommandHeader*>(vdata);
size_t command_bytes = header->size * 4;
if (command_bytes != size) {
throw runtime_error("command size field does not match actual size");
}
// Don't waste time if the existing mask_key is the same as the requested one
if (header->mask_key == mask_key) {
return;
}
// If header->mask_key isn't zero when we get here, then the command is
// already masked with a different mask_key, so unmask it first
if ((mask_key != 0) && (header->mask_key != 0)) {
set_mask_for_ep3_game_command(vdata, size, 0);
}
// Now, exactly one of header->mask_key and mask_key should be nonzero, and we
// are either directly masking or unmasking the command. Since this operation
// is symmetric, we don't need to split it into two cases.
if ((header->mask_key == 0) == (mask_key == 0)) {
throw logic_error("only one of header->mask_key and mask_key may be nonzero");
}
uint8_t* data = reinterpret_cast<uint8_t*>(vdata);
uint8_t k = (header->mask_key ^ mask_key) + 0x80;
for (size_t z = 8; z < command_bytes; z++) {
k = (k * 7) + 3;
data[z] ^= k;
}
header->mask_key = mask_key;
}
void send_quest_file_chunk(
shared_ptr<Client> c,
const string& filename,
size_t chunk_index,
const void* data,
size_t size,
bool is_download_quest) {
if (size > 0x400) {
throw logic_error("quest file chunks must be 1KB or smaller");
}
S_WriteFile_13_A7 cmd;
cmd.filename = filename;
memcpy(cmd.data.data(), data, size);
if (size < 0x400) {
memset(&cmd.data[size], 0, 0x400 - size);
}
cmd.data_size = size;
send_command_t(c, is_download_quest ? 0xA7 : 0x13, chunk_index, cmd);
}
void send_open_quest_file(shared_ptr<Client> c, const string& quest_name,
const string& basename, shared_ptr<const string> contents, QuestFileType type) {
switch (c->version()) {
case GameVersion::DC:
send_quest_open_file_t<S_OpenFile_DC_44_A6>(
c, quest_name, basename, contents->size(), type);
break;
case GameVersion::PC:
case GameVersion::GC:
send_quest_open_file_t<S_OpenFile_PC_GC_44_A6>(
c, quest_name, basename, contents->size(), type);
break;
case GameVersion::XB:
send_quest_open_file_t<S_OpenFile_XB_44_A6>(
c, quest_name, basename, contents->size(), type);
break;
case GameVersion::BB:
send_quest_open_file_t<S_OpenFile_BB_44_A6>(
c, quest_name, basename, contents->size(), type);
break;
default:
throw logic_error("cannot send quest files to this version of client");
}
// For GC/XB/BB, we wait for acknowledgement commands before sending each
// chunk. For DC/PC, we send the entire quest all at once.
if ((c->version() == GameVersion::DC) || (c->version() == GameVersion::PC)) {
for (size_t offset = 0; offset < contents->size(); offset += 0x400) {
size_t chunk_bytes = contents->size() - offset;
if (chunk_bytes > 0x400) {
chunk_bytes = 0x400;
}
send_quest_file_chunk(c, basename.c_str(), offset / 0x400,
contents->data() + offset, chunk_bytes, (type != QuestFileType::ONLINE));
}
} else {
c->sending_files.emplace(basename, contents);
c->log.info("Opened file %s", basename.c_str());
}
}
bool send_quest_barrier_if_all_clients_ready(shared_ptr<Lobby> l) {
if (!l || !l->is_game()) {
return false;
}
// Check if any client is still loading
size_t x;
for (x = 0; x < l->max_clients; x++) {
if (!l->clients[x]) {
continue;
}
if (l->clients[x]->flags & Client::Flag::LOADING_QUEST) {
break;
}
}
// If they're all done, start the quest
if (x != l->max_clients) {
return false;
}
send_command(l, 0xAC, 0x00);
for (x = 0; x < l->max_clients; x++) {
if (l->clients[x]) {
l->clients[x]->disconnect_hooks.erase(QUEST_BARRIER_DISCONNECT_HOOK_NAME);
}
}
return true;
}
void send_card_auction_if_all_clients_ready(
shared_ptr<ServerState> s, shared_ptr<Lobby> l) {
// Check if any client is still not ready
size_t x;
for (x = 0; x < l->max_clients; x++) {
if (!l->clients[x]) {
continue;
}
if (!(l->clients[x]->flags & Client::Flag::AWAITING_CARD_AUCTION)) {
break;
}
}
if (x != l->max_clients) {
return;
}
for (x = 0; x < l->max_clients; x++) {
if (l->clients[x]) {
l->clients[x]->flags &= ~Client::Flag::AWAITING_CARD_AUCTION;
}
}
if ((s->ep3_card_auction_points == 0) ||
(s->ep3_card_auction_min_size == 0) ||
(s->ep3_card_auction_max_size == 0)) {
throw runtime_error("card auctions are not configured on this server");
}
uint16_t num_cards;
if (s->ep3_card_auction_min_size == s->ep3_card_auction_max_size) {
num_cards = s->ep3_card_auction_min_size;
} else {
num_cards = s->ep3_card_auction_min_size +
(random_object<uint16_t>() % (s->ep3_card_auction_max_size - s->ep3_card_auction_min_size + 1));
}
num_cards = min<uint16_t>(num_cards, 0x14);
uint64_t distribution_size = 0;
for (const auto& e : s->ep3_card_auction_pool) {
distribution_size += e.probability;
}
auto card_index = (l->flags & Lobby::Flag::IS_EP3_TRIAL)
? s->ep3_card_index_trial
: s->ep3_card_index;
S_StartCardAuction_GC_Ep3_EF cmd;
cmd.points_available = s->ep3_card_auction_points;
for (size_t z = 0; z < num_cards; z++) {
uint64_t v = random_object<uint64_t>() % distribution_size;
for (const auto& e : s->ep3_card_auction_pool) {
if (v >= e.probability) {
v -= e.probability;
} else {
cmd.entries[z].card_id = e.card_id;
cmd.entries[z].min_price = e.min_price;
break;
}
}
}
send_command_t(l, 0xEF, num_cards, cmd);
for (auto c : l->clients) {
if (c) {
c->disconnect_hooks.erase(CARD_AUCTION_DISCONNECT_HOOK_NAME);
}
}
}
void send_server_time(shared_ptr<Client> c) {
uint64_t t = now();
time_t t_secs = t / 1000000;
struct tm t_parsed;
gmtime_r(&t_secs, &t_parsed);
string time_str(128, 0);
size_t len = strftime(time_str.data(), time_str.size(),
"%Y:%m:%d: %H:%M:%S.000", &t_parsed);
if (len == 0) {
throw runtime_error("format_time buffer too short");
}
time_str.resize(len);
send_command(c, 0xB1, 0x00, time_str);
}
void send_change_event(shared_ptr<Client> c, uint8_t new_event) {
// This command isn't supported on versions before V3, nor on Trial Edition.
if ((c->version() == GameVersion::DC) ||
(c->version() == GameVersion::PC) ||
(c->flags & Client::Flag::IS_GC_TRIAL_EDITION)) {
return;
}
send_command(c, 0xDA, new_event);
}
void send_change_event(shared_ptr<Lobby> l, uint8_t new_event) {
for (auto& c : l->clients) {
if (!c) {
continue;
}
send_change_event(c, new_event);
}
}
void send_change_event(shared_ptr<ServerState> s, uint8_t new_event) {
// TODO: Create a collection of all clients on the server (including those not
// in lobbies) and use that here instead
for (auto& l : s->all_lobbies()) {
send_change_event(l, new_event);
}
}
| [
"fuzziqersoftware+g@gmail.com"
] | fuzziqersoftware+g@gmail.com |
f80d7ad0c05c4f4fda124353cf79ade0df37085e | aa8bc6f9479d6d02eaa8c432a06bfdc80e21f53e | /Core_SAMD21G18A_2/Screen2_0.h | a798915099b64d44938bf687f94f059b00f8df5d | [] | no_license | XBeeModule/XBee | a2e515106169aea33c311dd564704ceefa1dbcbe | 7290ce21d55884dfa365e4787c7cdfbbc8c095f6 | refs/heads/master | 2020-05-21T15:01:18.010658 | 2018-05-30T12:56:36 | 2018-05-30T12:56:42 | 60,069,011 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,153 | h | #pragma once
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include "UTFTMenu.h"
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// экран номер 2_0
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
class Screen2_0 : public AbstractTFTScreen
{
public:
static AbstractTFTScreen* create()
{
return new Screen2_0();
}
protected:
virtual void doSetup(TFTMenu* menu);
virtual void doUpdate(TFTMenu* menu);
virtual void doDraw(TFTMenu* menu);
virtual void onButtonPressed(TFTMenu* menu, int pressedButton);
private:
Screen2_0();
};
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| [
"promavto@ntmp.ru"
] | promavto@ntmp.ru |
19e192b4040105b151b42e506fe6baf651589ac8 | 6b15711f9f624f1173e6299c663ca216f91e7463 | /RotationDemo/RotationDemo/Graphics/Graphics.cpp | e99d82cece9c6aaefee723a759c6c6cffe901fd0 | [] | no_license | McThrok/RotationDemo | 36aa25959c9c66fff272859ddaf676f1b0257f9e | 2737355df8668f502e2f596e1d1d031eced4bf0e | refs/heads/master | 2022-03-18T06:48:20.278139 | 2019-11-28T23:34:52 | 2019-11-28T23:34:52 | 223,403,033 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,105 | cpp | #include "Graphics.h"
Graphics::~Graphics()
{
}
bool Graphics::Initialize(HWND hwnd, int width, int height)
{
this->windowWidth = width;
this->windowHeight = height;
this->fpsTimer.Start();
if (!InitializeDirectX(hwnd))
return false;
if (!InitializeShaders())
return false;
if (!InitializeScene())
return false;
InitGui(hwnd);
return true;
}
void Graphics::RenderFrame()
{
float bgcolor[] = { 0.05f, 0.05f, 0.1f, 1.0f };
this->deviceContext->ClearRenderTargetView(this->renderTargetView.Get(), bgcolor);
this->deviceContext->ClearDepthStencilView(this->depthStencilView.Get(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
RenderVisualisation();
RenderGui();
this->swapchain->Present(0, NULL);
}
void Graphics::InitGui(HWND hwnd) {
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX11_Init(this->device.Get(), this->deviceContext.Get());
ImGui::StyleColorsDark();
}
void Graphics::RenderGui() {
ImGui_ImplDX11_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
RenderMainPanel();
ImGui::Render();
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
}
void Graphics::RenderMainPanel() {
ImGui::SetNextWindowSize(ImVec2(500, 950), ImGuiCond_Once);
ImGui::SetNextWindowPos(ImVec2(10, 30), ImGuiCond_Once);
if (!ImGui::Begin("Main Panel"))
{
ImGui::End();
return;
}
if (simulation->paused) {
if (ImGui::Button("Start"))
simulation->paused = false;
}
else {
if (ImGui::Button("Pause"))
simulation->paused = true;
}
ImGui::SameLine();
if (ImGui::Button("Reset")) {
simulation->Reset();
}
ImGui::Separator();
if (ImGui::SliderFloat3("start position", &simulation->startPosition.x, 0, 5)) simulation->UpdateFrames();
if (ImGui::SliderFloat3("end position", &simulation->endPosition.x, 0, 5)) simulation->UpdateFrames();
ImGui::Separator();
if (ImGui::SliderFloat3("start rotation Euler", &simulation->startRotationEuler.x, -180, 180, "%.0f")) simulation->UpdateFramesEuler();
if (ImGui::SliderFloat3("end rotation Euler", &simulation->endRotationEuler.x, -180, 180, "%.0f")) simulation->UpdateFramesEuler();
if (ImGui::Button("Apply##Euler"))
simulation->UpdateRotationsFromEuler();
ImGui::Separator();
if (ImGui::SliderFloat4("start rotation Quat", &simulation->startRotationQuat.x, -5, 5, "%.2f")) simulation->UpdateFramesQuat();
if (ImGui::SliderFloat4("end rotation Quat", &simulation->endRotationQuat.x, -5, 5, "%.2f")) simulation->UpdateFramesQuat();
if (ImGui::Button("Apply##Quat"))
simulation->UpdateRotationsFromQuat();
ImGui::Separator();
if (ImGui::Checkbox("slerp", &simulation->slerp)) simulation->UpdateFramesQuat();
ImGui::Checkbox("loop", &simulation->loop);
ImGui::Checkbox("show Frames", &simulation->showFrames);
ImGui::SliderFloat("animation time", &simulation->animationTime, 1, 5);
ImGui::SliderFloat("animation progress", &simulation->time, 0, simulation->animationTime);
if (ImGui::SliderInt("frames", &simulation->frames, 0, 20)) simulation->UpdateFrames();
ImGui::End();
}
void Graphics::RenderVisualisation()
{
this->deviceContext->IASetInputLayout(this->vertexshader.GetInputLayout());
this->deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY::D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
this->deviceContext->RSSetState(this->rasterizerState.Get());
this->deviceContext->OMSetDepthStencilState(this->depthStencilState.Get(), 0);
this->deviceContext->VSSetShader(vertexshader.GetShader(), NULL, 0);
this->deviceContext->PSSetShader(pixelshader.GetShader(), NULL, 0);
this->deviceContext->VSSetConstantBuffers(0, 1, this->cbColoredObject.GetAddressOf());
this->deviceContext->PSSetConstantBuffers(0, 1, this->cbColoredObject.GetAddressOf());
//top
this->deviceContext->RSSetViewports(1, &viewportTop);
RenderModel(simulation->GetModelMatrixEuler(0));
RenderModel(simulation->GetModelMatrixEuler(1));
RenderModel(simulation->GetModelMatrixEuler());
if (simulation->showFrames)
for (auto m : simulation->framesEuler)
RenderModel(m);
//down
this->deviceContext->RSSetViewports(1, &viewportDown);
RenderModel(simulation->GetModelMatrixQuat(0));
RenderModel(simulation->GetModelMatrixQuat(1));
RenderModel(simulation->GetModelMatrixQuat());
if (simulation->showFrames)
for (auto m : simulation->framesQuat)
RenderModel(m);
}
void Graphics::RenderModel(Matrix worldMatrix)
{
float width = 0.03f;
RenderCube(Matrix::CreateScale(width, width, width) * worldMatrix, { 0.3f, 0.3f, 0.3f, 1 });
RenderCube(Matrix::CreateTranslation(width, 0, 0) * Matrix::CreateScale(1, width, width) * worldMatrix, { 1,0,0,1 });
RenderCube(Matrix::CreateTranslation(0, width, 0) * Matrix::CreateScale(width, 1, width) * worldMatrix, { 0,1,0,1 });
RenderCube(Matrix::CreateTranslation(0, 0, width) * Matrix::CreateScale(width, width, 1) * worldMatrix, { 0,0,1,1 });
}
void Graphics::RenderCube(Matrix worldMatrix, Vector4 color)
{
UINT offset = 0;
cbColoredObject.data.worldMatrix = worldMatrix;
cbColoredObject.data.wvpMatrix = cbColoredObject.data.worldMatrix * camera.GetViewMatrix() * camera.GetProjectionMatrix();
cbColoredObject.data.color = color;
cbColoredObject.ApplyChanges();
this->deviceContext->IASetVertexBuffers(0, 1, vbCube.GetAddressOf(), vbCube.StridePtr(), &offset);
this->deviceContext->IASetIndexBuffer(ibCube.Get(), DXGI_FORMAT_R32_UINT, 0);
this->deviceContext->DrawIndexed(ibCube.BufferSize(), 0, 0);
}
bool Graphics::InitializeDirectX(HWND hwnd)
{
std::vector<AdapterData> adapters = AdapterReader::GetAdapters();
if (adapters.size() < 1)
{
ErrorLogger::Log("No IDXGI Adapters found.");
return false;
}
DXGI_SWAP_CHAIN_DESC scd;
ZeroMemory(&scd, sizeof(DXGI_SWAP_CHAIN_DESC));
scd.BufferDesc.Width = this->windowWidth;
scd.BufferDesc.Height = this->windowHeight;
scd.BufferDesc.RefreshRate.Numerator = 60;
scd.BufferDesc.RefreshRate.Denominator = 1;
scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
scd.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
scd.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
scd.SampleDesc.Count = 1;
scd.SampleDesc.Quality = 0;
scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
scd.BufferCount = 1;
scd.OutputWindow = hwnd;
scd.Windowed = TRUE;
scd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
scd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
HRESULT hr;
hr = D3D11CreateDeviceAndSwapChain(adapters[0].pAdapter, //IDXGI Adapter
D3D_DRIVER_TYPE_UNKNOWN,
NULL, //FOR SOFTWARE DRIVER TYPE
NULL, //FLAGS FOR RUNTIME LAYERS
NULL, //FEATURE LEVELS ARRAY
0, //# OF FEATURE LEVELS IN ARRAY
D3D11_SDK_VERSION,
&scd, //Swapchain description
this->swapchain.GetAddressOf(), //Swapchain Address
this->device.GetAddressOf(), //Device Address
NULL, //Supported feature level
this->deviceContext.GetAddressOf()); //Device Context Address
if (FAILED(hr))
{
ErrorLogger::Log(hr, "Failed to create device and swapchain.");
return false;
}
Microsoft::WRL::ComPtr<ID3D11Texture2D> backBuffer;
hr = this->swapchain->GetBuffer(0, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(backBuffer.GetAddressOf()));
if (FAILED(hr)) //If error occurred
{
ErrorLogger::Log(hr, "GetBuffer Failed.");
return false;
}
hr = this->device->CreateRenderTargetView(backBuffer.Get(), NULL, this->renderTargetView.GetAddressOf());
if (FAILED(hr)) //If error occurred
{
ErrorLogger::Log(hr, "Failed to create render target view.");
return false;
}
//Describe our Depth/Stencil Buffer
D3D11_TEXTURE2D_DESC depthStencilDesc;
depthStencilDesc.Width = this->windowWidth;
depthStencilDesc.Height = this->windowHeight;
depthStencilDesc.MipLevels = 1;
depthStencilDesc.ArraySize = 1;
depthStencilDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
depthStencilDesc.SampleDesc.Count = 1;
depthStencilDesc.SampleDesc.Quality = 0;
depthStencilDesc.Usage = D3D11_USAGE_DEFAULT;
depthStencilDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
depthStencilDesc.CPUAccessFlags = 0;
depthStencilDesc.MiscFlags = 0;
hr = this->device->CreateTexture2D(&depthStencilDesc, NULL, this->depthStencilBuffer.GetAddressOf());
if (FAILED(hr)) //If error occurred
{
ErrorLogger::Log(hr, "Failed to create depth stencil buffer.");
return false;
}
hr = this->device->CreateDepthStencilView(this->depthStencilBuffer.Get(), NULL, this->depthStencilView.GetAddressOf());
if (FAILED(hr)) //If error occurred
{
ErrorLogger::Log(hr, "Failed to create depth stencil view.");
return false;
}
this->deviceContext->OMSetRenderTargets(1, this->renderTargetView.GetAddressOf(), this->depthStencilView.Get());
//Create depth stencil state
D3D11_DEPTH_STENCIL_DESC depthstencildesc;
ZeroMemory(&depthstencildesc, sizeof(D3D11_DEPTH_STENCIL_DESC));
depthstencildesc.DepthEnable = true;
depthstencildesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK::D3D11_DEPTH_WRITE_MASK_ALL;
depthstencildesc.DepthFunc = D3D11_COMPARISON_FUNC::D3D11_COMPARISON_LESS_EQUAL;
hr = this->device->CreateDepthStencilState(&depthstencildesc, this->depthStencilState.GetAddressOf());
if (FAILED(hr))
{
ErrorLogger::Log(hr, "Failed to create depth stencil state.");
return false;
}
//Create the Viewport
viewportHeight = this->windowHeight / 2;
ZeroMemory(&viewportTop, sizeof(D3D11_VIEWPORT));
viewportTop.TopLeftX = 0;
viewportTop.TopLeftY = 0;
viewportTop.Width = this->windowWidth;
viewportTop.Height = viewportHeight;
viewportTop.MinDepth = 0.0f;
viewportTop.MaxDepth = 1.0f;
ZeroMemory(&viewportDown, sizeof(D3D11_VIEWPORT));
viewportDown.TopLeftX = 0;
viewportDown.TopLeftY = viewportHeight;
viewportDown.Width = this->windowWidth;
viewportDown.Height = viewportHeight;
viewportDown.MinDepth = 0.0f;
viewportDown.MaxDepth = 1.0f;
////Set the Viewport
//this->deviceContext->RSSetViewports(1, &viewportRight);
//Create Rasterizer State
D3D11_RASTERIZER_DESC rasterizerDesc;
ZeroMemory(&rasterizerDesc, sizeof(D3D11_RASTERIZER_DESC));
rasterizerDesc.FillMode = D3D11_FILL_MODE::D3D11_FILL_SOLID;
rasterizerDesc.CullMode = D3D11_CULL_MODE::D3D11_CULL_BACK;
hr = this->device->CreateRasterizerState(&rasterizerDesc, this->rasterizerState.GetAddressOf());
if (FAILED(hr))
{
ErrorLogger::Log(hr, "Failed to create rasterizer state.");
return false;
}
spriteBatch = std::make_unique<DirectX::SpriteBatch>(this->deviceContext.Get());
spriteFont = std::make_unique<DirectX::SpriteFont>(this->device.Get(), L"Data\\Fonts\\comic_sans_ms_16.spritefont");
return true;
}
bool Graphics::InitializeShaders()
{
D3D11_INPUT_ELEMENT_DESC layout[] =
{
{"POSITION", 0, DXGI_FORMAT::DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_CLASSIFICATION::D3D11_INPUT_PER_VERTEX_DATA, 0 },
{"NORMAL", 0, DXGI_FORMAT::DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_CLASSIFICATION::D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
UINT numElements = ARRAYSIZE(layout);
if (!vertexshader.Initialize(this->device, L"my_vs.cso", layout, numElements))
return false;
if (!pixelshader.Initialize(this->device, L"my_ps.cso"))
return false;
if (!diagonalPixelshader.Initialize(this->device, L"diagonal_ps.cso"))
return false;
return true;
}
bool Graphics::InitializeScene()
{
VertexPN v[] = {
VertexPN(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f),
VertexPN(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f),
VertexPN(1.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f),
VertexPN(0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f),
VertexPN(1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f),
VertexPN(0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f),
VertexPN(0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f),
VertexPN(1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f),
VertexPN(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f),
VertexPN(1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f),
VertexPN(1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f),
VertexPN(1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f),
VertexPN(0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f),
VertexPN(0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f),
VertexPN(0.0f, 1.0f, 0.0f, -1.0f, 0.0f, 0.0f),
VertexPN(0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f),
VertexPN(0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f),
VertexPN(1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f),
VertexPN(1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f),
VertexPN(0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f),
VertexPN(0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 0.0f),
VertexPN(1.0f, 0.0f, 1.0f, 0.0f, -1.0f, 0.0f),
VertexPN(1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f),
VertexPN(0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f)
};
int indices[] =
{
0, 2, 3, 0,1, 2,
4, 6, 7, 4,5, 6,
8, 10, 11, 8, 9, 10,
12, 14, 15, 12, 13, 14,
16, 18, 19, 16, 17, 18,
20, 22, 23, 20, 21, 22,
};
this->vbCube.Initialize(this->device.Get(), v, ARRAYSIZE(v));
this->ibCube.Initialize(this->device.Get(), indices, ARRAYSIZE(indices));
//Initialize Constant Buffer(s)
this->cbColoredObject.Initialize(this->device.Get(), this->deviceContext.Get());
this->cbLight.Initialize(this->device.Get(), this->deviceContext.Get());
camera.SetPosition(0, -5.0f, 0);
camera.SetProjectionValues(60.0f, static_cast<float>(windowWidth) / static_cast<float>(viewportHeight), 0.1f, 1000.0f);
return true;
}
| [
"wojtek.trze@gmail.com"
] | wojtek.trze@gmail.com |
816e8db3047ae917ac0eb0481da8ede02e701c2b | 221cef3e16959051cdf1954919eae619590e1cc4 | /chrome/common/chrome_features.h | ae722d0f170325d4904138c832b3e0998a7e902b | [
"BSD-3-Clause"
] | permissive | cfzhang/chromium | 60f7ebbed5782ac32f0f3dd72ee76cdd16e9c992 | e3a11d93e60c9dd919d3a3b66cd691f60f552ed8 | refs/heads/master | 2023-02-26T10:20:57.513471 | 2019-09-16T05:32:04 | 2019-09-16T05:32:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,703 | h | // Copyright 2016 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.
// This file defines all the public base::FeatureList features for the chrome
// module.
#ifndef CHROME_COMMON_CHROME_FEATURES_H_
#define CHROME_COMMON_CHROME_FEATURES_H_
#include "base/component_export.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "chrome/common/buildflags.h"
#include "device/vr/buildflags/buildflags.h"
#include "extensions/buildflags/buildflags.h"
#include "ppapi/buildflags/buildflags.h"
#include "printing/buildflags/buildflags.h"
#include "ui/base/buildflags.h"
namespace features {
// All features in alphabetical order. The features should be documented
// alongside the definition of their values in the .cc file.
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAddToHomescreenMessaging;
#endif // defined(OS_ANDROID)
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kApkWebAppInstalls;
#endif // defined(OS_CHROMEOS)
#if defined(OS_MACOSX)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppShimMultiProfile;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppShimRemoteCocoa;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kShow10_9ObsoleteInfobar;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kViewsTaskManager;
#endif // defined(OS_MACOSX)
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppNotificationStatusMessaging;
#endif // defined(OS_ANDROID)
#if !defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppServiceAsh;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppServiceIntentHandling;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppServiceShelf;
#endif // !defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kAsyncDns;
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAutoFetchOnNetErrorPage;
#endif
#if defined(OS_WIN) || defined(OS_LINUX)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kBackgroundModeAllowRestart;
#endif // defined(OS_WIN) || defined(OS_LINUX)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kBlockPromptsIfDismissedOften;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kBlockPromptsIfIgnoredOften;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kBlockRepeatedNotificationPermissionPrompts;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kBrowserHangFixesExperiment;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kBundledConnectionHelpFeature;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCaptionSettings;
#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_MACOSX)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCertDualVerificationTrialFeature;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kChangePictureVideoMode;
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDMServerOAuthForChildUser;
#endif
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kClearOldBrowsingData;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kClickToOpenPDFPlaceholder;
#if defined(OS_MACOSX)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kImmersiveFullscreen;
#endif
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAllowDisableMouseAcceleration;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kCrostini;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCrostiniAdditionalEnterpriseReporting;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCrostiniAdvancedAccessControls;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCrostiniAnsibleInfrastructure;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCrostiniAnsibleSoftwareManagement;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCrostiniForceClose;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCupsPrintersUiOverhaul;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kPluginVm;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUsageTimeLimitPolicy;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kWilcoDtc;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUploadZippedSystemLogs;
#endif
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kTerminalSystemApp;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopCaptureTabSharingInfobar;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsWithoutExtensions;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsCacheDuringDefaultInstall;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsLocalUpdating;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsUnifiedUiController;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsUnifiedLaunch;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsUSS;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDesktopPWAsOmniboxInstall;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDisallowUnsafeHttpDownloads;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const char kDisallowUnsafeHttpDownloadsParamName[];
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDnsOverHttps;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::FeatureParam<bool> kDnsOverHttpsFallbackParam;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam;
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDownloadsLocationChange;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kDriveFcmInvalidations;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kPolicyFcmInvalidations;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kEnableAmbientAuthenticationInGuestSession;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kEnableAmbientAuthenticationInIncognito;
#if !defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kEnterpriseReportingInBrowser;
#endif
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kEventBasedStatusReporting;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kExternalExtensionDefaultButtonControl;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kFocusMode;
// Android expects this string from Java code, so it is always needed.
// TODO(crbug.com/731802): Use #if BUILDFLAG(ENABLE_VR_BROWSING) instead.
#if BUILDFLAG(ENABLE_VR) || defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kVrBrowsing;
#endif
#if BUILDFLAG(ENABLE_VR)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kVrBrowsingExperimentalFeatures;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kVrBrowsingExperimentalRendering;
#if BUILDFLAG(ENABLE_OCULUS_VR)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kOculusVR;
#endif // ENABLE_OCULUS_VR
#if BUILDFLAG(ENABLE_OPENVR)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kOpenVR;
#endif // ENABLE_OPENVR
#if BUILDFLAG(ENABLE_WINDOWS_MR)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kWindowsMixedReality;
#endif // ENABLE_WINDOWS_MR
#if BUILDFLAG(ENABLE_OPENXR)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kOpenXR;
#endif // ENABLE_OPENXR
#endif // ENABLE_VR
#if defined(OS_WIN)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kGdiTextPrinting;
#endif
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kGeoLanguage;
#if !defined(OS_ANDROID) && defined(GOOGLE_CHROME_BUILD)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kGoogleBrandedContextMenu;
#endif
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHappinessTrackingSystem;
#endif
#if !defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHappinessTrackingSurveysForDesktop;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHappinessTrackingSurveysForDesktopDemo;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHTTPAuthCommittedInterstitials;
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kIncompatibleApplicationsWarning;
#endif
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kInSessionPasswordChange;
#endif
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kInstallableAmbientBadgeInfoBar;
#endif // defined(OS_ANDROID)
#if !defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kIntentPicker;
#endif
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kKernelnextVMs;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kKidsManagementUrlClassification;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kLookalikeUrlNavigationSuggestionsUI;
#if defined(OS_MACOSX)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kMacFullSizeContentView;
#endif
#if defined(OS_MACOSX)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kMacMaterialDesignDownloadShelf;
#endif
#if defined(OS_MACOSX)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kMacSystemMediaPermissionsInfoUi;
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAcknowledgeNtpOverrideOnDeactivate;
#endif
#if !defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kOnConnectNative;
#endif
#if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kNativeNotifications;
#endif
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kNewNetErrorPageUI;
#endif
#if defined(OS_POSIX)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kNtlmV2Enabled;
#endif
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kOomIntervention;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUseNewAcceptLanguageHeader;
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kParentAccessCode;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kParentAccessCodeForTimeChange;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kPermissionDelegation;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kPredictivePrefetchingAllowedOnAllConnectionTypes;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kPrerenderFallbackToPreconnect;
#if BUILDFLAG(ENABLE_PLUGINS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kFlashDeprecationWarning;
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCloudPrinterHandler;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kNewPrintPreviewLayout;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kPushMessagingBackgroundMode;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kQuietNotificationPrompts;
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kRemoveSupervisedUsersOnStartup;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kLoadBrokenImagesFromContextMenu;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSafetyTipUI;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSecurityKeyAttestationPrompt;
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kShowTrustedPublisherURL;
#endif
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kSitePerProcess;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSiteIsolationForPasswordSites;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSitePerProcessOnlyForHighMemoryClients;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const char kSitePerProcessOnlyForHighMemoryClientsParamName[];
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kStreamlinedUsbPrinterSetup;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kNativeSmb;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSoundContentSetting;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSubresourceRedirectIncludedMediaSuffixes;
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSysInternals;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSystemWebApps;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAppManagement;
#if !defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kTabMetricsLogging;
#endif
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kThirdPartyModulesBlocking;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kTreatUnsafeDownloadsAsActive;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const char kTreatUnsafeDownloadsAsActiveParamName[];
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHeavyAdIntervention;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHeavyAdBlocklist;
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUsageTimeStateNotifier;
#endif
#if defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUseDisplayWideColorGamut;
COMPONENT_EXPORT(CHROME_FEATURES)
bool UseDisplayWideColorGamut();
#endif
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUseFtlSignalingForCrdHostDelegate;
#endif
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAdaptiveScreenBrightnessLogging;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUserActivityEventLogging;
#endif
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kUseSameCacheForMedia;
#if defined(OS_CHROMEOS)
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kArcCupsApi;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kQuickUnlockPin;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kQuickUnlockPinSignin;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kQuickUnlockFingerprint;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kCrosCompUpdates;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kTPMFirmwareUpdate;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kCrOSEnableUSMUserService;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kMachineLearningService;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kSmartDim;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kUsbguard;
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kUsbbouncer;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kSchedulerConfiguration;
#endif // defined(OS_CHROMEOS)
#if !defined(OS_ANDROID)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kWebRtcRemoteEventLog;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kWebRtcRemoteEventLogGzipped;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kWebUIA11yEnhancements;
#endif
COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kWebUIDarkMode;
#if defined(OS_WIN)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kWin10AcceleratedDefaultBrowserFlow;
#endif // defined(OS_WIN)
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kWriteBasicSystemProfileToPersistentHistogramsFile;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kAccessibilityInternalsPageImprovements;
bool PrefServiceEnabled();
// DON'T ADD RANDOM STUFF HERE. Put it in the main section above in
// alphabetical order, or in one of the ifdefs (also in order in each section).
} // namespace features
#endif // CHROME_COMMON_CHROME_FEATURES_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
af1089f70955e5f61da7f3c8e0df3dc158b71701 | eb2f8b3271e8ef9c9b092fcaeff3ff8307f7af86 | /Grade 8-9/G9S2/Luogu contest/18.6/F.cpp | 1aa67ce85aa39c16f115514411b9890fb6d4eb84 | [] | no_license | Orion545/OI-Record | 0071ecde8f766c6db1f67b9c2adf07d98fd4634f | fa7d3a36c4a184fde889123d0a66d896232ef14c | refs/heads/master | 2022-01-13T19:39:22.590840 | 2019-05-26T07:50:17 | 2019-05-26T07:50:17 | 188,645,194 | 4 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 428 | cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<ctime>
#define ll long long
using namespace std;
inline int read(){
int re=0,flag=1;char ch=getchar();
while(ch>'9'||ch<'0'){
if(ch=='-') flag=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9') re=(re<<1)+(re<<3)+ch-'0',ch=getchar();
return re*flag;
}
int main(){
srand(time(NULL));
ll x=rand()%10000;
cout<<x*x<<' '<<rand()%10000<<'\n';
}
| [
"orion545@qq.com"
] | orion545@qq.com |
e7c60cd9ee5f12674630edf37489e5884cb368e4 | df70cc9edd84358bdd6b6f248e1cdf40b53d5a7b | /cplayer.h | 19920aae506ff0f4045963ad3301f95001140c63 | [] | no_license | Vylfang/agent-assembly | d089ddf767c2de7e419cbfafd61461ef344728b5 | 82dfe69f5a34b5ad3fffae46ef843ff96f35b0bd | refs/heads/master | 2021-07-15T11:55:17.350377 | 2017-10-21T15:07:19 | 2017-10-21T15:07:19 | 107,113,179 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,054 | h | #ifndef CPLAYER_H
#define CPLAYER_H
#include <ccharacter.h>
class CPlayer
{
public:
CPlayer();
~CPlayer();
void HandleEvents(SDL_Event& e);
int GetBind(int number);
void SetBind(int bindnumber, int keybind);
// void ChangeKeySetting(int keytoswitch, SDL_Event& e);
// void FakeDead();
void IsMoving(int screenwidth, int screenheigth);
void LinkCharacter(CCharacter* linkedcharacter);
bool GetStabbing();
void SetStabbing(bool newstab);
bool GetFiring();
void SetFiring(bool newstab);
int GetAmmunition();
void DepleteAmmunition();
void SetAmmunition(int ammunition);
CCharacter m_playercharacter;
private:
int m_keybinddown = SDLK_DOWN;
int m_keybindup = SDLK_UP;
int m_keybindleft = SDLK_LEFT;
int m_keybindright = SDLK_RIGHT;
int m_keybindfire = SDLK_KP_1;
int m_keybindstab = SDLK_KP_2;
int m_keybindspecial = SDLK_KP_3;
int m_tempdx;
int m_tempdy;
bool m_isstabbing;
bool m_isfiring;
int m_ammunition;
};
#endif // CPLAYER_H
| [
"vylfang@gmail.com"
] | vylfang@gmail.com |
866e75bf99f79d14bf15c5e69abe6d082434574c | c5d22b3855c46a9021cde29ed52c9a0aa216a128 | /Unreal/Learn-Unreal-Engine-With-C++/Battery_Collector/Source/Battery_Collector/BatteryMan.cpp | 908c99e61cc241e738f88348d1bc38edc52c65c6 | [] | no_license | PauloKeller/Game-Development | c26dc96d53daf1a124ea720cabfbd1267cdcddb9 | 84c4bfbf715245e104dcfe93c9822d1f02c8b9f8 | refs/heads/master | 2023-09-01T15:07:50.150468 | 2023-08-26T22:52:22 | 2023-08-26T22:52:22 | 196,074,314 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,975 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "BatteryMan.h"
// Sets default values
ABatteryMan::ABatteryMan() {
// Set this character to call Tick() every frame. You can turn this off to
// improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
GetCapsuleComponent()->InitCapsuleSize(42.0f, 96.0f);
bUseControllerRotationPitch = false;
bUseControllerRotationRoll = false;
bUseControllerRotationYaw = false;
GetCharacterMovement()->bOrientRotationToMovement = true;
GetCharacterMovement()->RotationRate = FRotator(0.0f, 540.0f, 0.0f);
GetCharacterMovement()->JumpZVelocity = 600.0f;
GetCharacterMovement()->AirControl = 0.2f;
CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
CameraBoom->SetupAttachment(RootComponent);
CameraBoom->TargetArmLength = 300.0f;
CameraBoom->bUsePawnControlRotation = true;
FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera"));
FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName);
FollowCamera->bUsePawnControlRotation = false;
bDead = false;
Power = 100.0f;
}
void ABatteryMan::OnBeginOverlap(UPrimitiveComponent* HitComp,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex, bool bFromSweep,
const FHitResult& SweepResult) {
if (OtherActor->ActorHasTag("Recharge")) {
Power += 10.0f;
if (Power > 100.0f) Power = 100.0f;
OtherActor->Destroy();
}
}
// Called when the game starts or when spawned
void ABatteryMan::BeginPlay() {
Super::BeginPlay();
GetCapsuleComponent()->OnComponentBeginOverlap.AddDynamic(
this, &ABatteryMan::OnBeginOverlap);
if (PlayerPowerWidgetClass != nullptr) {
PlayerPowerWidget = CreateWidget(GetWorld(), PlayerPowerWidgetClass);
PlayerPowerWidget->AddToViewport();
}
}
// Called every frame
void ABatteryMan::Tick(float DeltaTime) {
Super::Tick(DeltaTime);
Power -= DeltaTime * PowerTreshold;
if (Power <= 0) {
if (!bDead) {
bDead = true;
GetMesh()->SetSimulatePhysics(true);
FTimerHandle UnusedHandle;
GetWorldTimerManager().SetTimer(UnusedHandle, this,
&ABatteryMan::RestartGame, 3.0f, false);
}
}
}
// Called to bind functionality to input
void ABatteryMan::SetupPlayerInputComponent(
UInputComponent* PlayerInputComponent) {
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput);
PlayerInputComponent->BindAxis("LookUp", this,
&APawn::AddControllerPitchInput);
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
PlayerInputComponent->BindAction("Jump", IE_Released, this,
&ACharacter::StopJumping);
PlayerInputComponent->BindAxis("MoveForward", this,
&ABatteryMan::MoveForward);
PlayerInputComponent->BindAxis("MoveRight", this, &ABatteryMan::MoveRight);
}
void ABatteryMan::MoveForward(float Axis) {
if (!bDead) {
const FRotator Rotation = Controller->GetControlRotation();
const FRotator YawRotation(0, Rotation.Yaw, 0);
const FVector Direction =
FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
AddMovementInput(Direction, Axis);
}
}
void ABatteryMan::MoveRight(float Axis) {
if (!bDead) {
const FRotator Rotation = Controller->GetControlRotation();
const FRotator YawRotation(0, Rotation.Yaw, 0);
const FVector Direction =
FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
AddMovementInput(Direction, Axis);
}
}
void ABatteryMan::RestartGame() {
UGameplayStatics::OpenLevel(this, FName(*GetWorld()->GetName()), false);
}
| [
"paulo.vinicius.keller@gmail.com"
] | paulo.vinicius.keller@gmail.com |
59c61d6bc8607b108669b44a666b72badebfcb58 | 0a688a8b2c973962f45b07d3f3b50acab40c4e8f | /LeetCode/412. Fizz Buzz.cpp | da42e5fd94a579a5d968196707c515d2178cd8f8 | [] | no_license | Rajanpandey/Coding-Practice | 2184c1b0ff8b10847abfe2f36091a7239aca2671 | 75d81fdf581fe870dac45c59ba3d20a406e2f4b8 | refs/heads/master | 2021-11-28T08:07:12.859609 | 2021-11-24T15:45:01 | 2021-11-24T15:45:01 | 191,540,122 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 979 | cpp | class Solution {
public:
vector<string> fizzBuzz(int n) {
vector<string> ans;
for (int i = 1; i <= n; i++) {
if (i % 15 == 0) {
ans.push_back("FizzBuzz");
} else if (i % 3 == 0) {
ans.push_back("Fizz");
} else if (i % 5 == 0) {
ans.push_back("Buzz");
} else {
ans.push_back(to_string(i));
}
}
return ans;
}
};
/*
C++ solution without if-else:
class Solution {
public:
vector<string> fizzBuzz(int n) {
vector<string> res(n);
for(int i = 1;i <= n; i++) {
res[i - 1] = to_string(i);
}
for(int i = 2;i < n; i += 3) {
res[i] = "Fizz";
}
for(int i = 4;i < n; i += 5) {
res[i] = "Buzz";
}
for(int i = 14;i < n; i += 15) {
res[i] = "FizzBuzz";
}
return res;
}
};
/*
| [
"rajanpandey2508@gmail.com"
] | rajanpandey2508@gmail.com |
b94cdebec2102f64cf58efdcbf47760b0bd678ae | 5a2349399fa9d57c6e8cc6e0f7226d683391a362 | /src/qt/qtwebkit/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h | 144655f4d5de0f5bf9199cff5b82aac9e1f111eb | [
"BSD-3-Clause"
] | permissive | aharthcock/phantomjs | e70f3c379dcada720ec8abde3f7c09a24808154c | 7d7f2c862347fbc7215c849e790290b2e07bab7c | refs/heads/master | 2023-03-18T04:58:32.428562 | 2023-03-14T05:52:52 | 2023-03-14T05:52:52 | 24,828,890 | 0 | 0 | BSD-3-Clause | 2023-03-14T05:52:53 | 2014-10-05T23:38:56 | C++ | UTF-8 | C++ | false | false | 2,615 | h | /*
* Copyright (C) 2011 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
*/
#ifndef WebContextMenuProxyGtk_h
#define WebContextMenuProxyGtk_h
#if ENABLE(CONTEXT_MENUS)
#include "WebContextMenuProxy.h"
#include <WebCore/ContextMenu.h>
#include <WebCore/IntPoint.h>
namespace WebKit {
class WebContextMenuItemData;
class WebPageProxy;
class WebContextMenuProxyGtk : public WebContextMenuProxy {
public:
static PassRefPtr<WebContextMenuProxyGtk> create(GtkWidget* webView, WebPageProxy* page)
{
return adoptRef(new WebContextMenuProxyGtk(webView, page));
}
~WebContextMenuProxyGtk();
virtual void showContextMenu(const WebCore::IntPoint&, const Vector<WebContextMenuItemData>&);
virtual void hideContextMenu();
void populate(Vector<WebCore::ContextMenuItem>&);
GtkMenu* gtkMenu() const { return m_menu.platformDescription(); }
private:
WebContextMenuProxyGtk(GtkWidget*, WebPageProxy*);
void append(WebCore::ContextMenuItem&);
void populate(const Vector<WebContextMenuItemData>&);
static void menuPositionFunction(GtkMenu*, gint*, gint*, gboolean*, WebContextMenuProxyGtk*);
GtkWidget* m_webView;
WebPageProxy* m_page;
WebCore::ContextMenu m_menu;
WebCore::IntPoint m_popupPosition;
};
} // namespace WebKit
#endif // ENABLE(CONTEXT_MENUS)
#endif // WebContextMenuProxyGtk_h
| [
"ariya.hidayat@gmail.com"
] | ariya.hidayat@gmail.com |
7c666aea789b5a42853484847c9a3a45a0ece475 | ee37b926d929f042031088f35a725416b1000de9 | /include/bsl/remove_pointer.hpp | 65f09a4136f851e4de1eba861ad31f5abe2ede74 | [
"MIT"
] | permissive | connojd/bsl | 6bee5c28b1a9106af312f5d5002b13bd8baa7089 | 9adebf89bf34ac14d92b26007cb19d5508de54ac | refs/heads/master | 2022-12-18T14:20:22.117151 | 2020-06-22T20:53:55 | 2020-06-22T20:53:55 | 287,825,769 | 0 | 0 | NOASSERTION | 2020-08-15T21:19:40 | 2020-08-15T21:13:29 | null | UTF-8 | C++ | false | false | 2,384 | hpp | /// @copyright
/// Copyright (C) 2020 Assured Information Security, Inc.
///
/// @copyright
/// 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:
///
/// @copyright
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// @copyright
/// 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.
///
/// @file remove_pointer.hpp
///
#ifndef BSL_REMOVE_POINTER_HPP
#define BSL_REMOVE_POINTER_HPP
namespace bsl
{
/// @class bsl::remove_pointer
///
/// <!-- description -->
/// @brief Provides the member typedef type which is the same as T,
/// except that its topmost pointer is removed.
/// @include example_remove_pointer_overview.hpp
///
/// <!-- template parameters -->
/// @tparam T the type to remove the pointer from
///
template<typename T>
struct remove_pointer final
{
/// @brief provides the member typedef "type"
using type = T;
};
/// @brief a helper that reduces the verbosity of bsl::remove_pointer
template<typename T>
using remove_pointer_t = typename remove_pointer<T>::type;
/// @cond doxygen off
template<typename T>
struct remove_pointer<T *> final
{
/// @brief provides the member typedef "type"
using type = T;
};
template<typename T>
struct remove_pointer<T *const> final
{
/// @brief provides the member typedef "type"
using type = T;
};
/// @endcond doxygen on
}
#endif
| [
"rianquinn@gmail.com"
] | rianquinn@gmail.com |
ec9645c370ecc8207aa38dc596bad47c37a89253 | 843e191aa20fbac580fce6ec5b44284b6317f280 | /cpp/arrays/majority_element_linear.cpp | 9ee21cb9a6d86a0b996d06ab39fc3707c97ef141 | [] | no_license | vivekanand1101/i-will-hire-you | 9ff43daa60a70126bf1f8e23cf43fdc68a267e52 | 1149995d35684d3edac014ec3ecc9aaa88d3f437 | refs/heads/master | 2021-06-12T07:15:28.658415 | 2017-04-18T05:30:53 | 2017-04-18T05:30:53 | 38,387,492 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 871 | cpp | // Program to find the majority element
// in the array
// http://www.geeksforgeeks.org/check-for-majority-element-in-a-sorted-array/
#include <iostream>
using namespace std;
bool is_majority (int* array, int n, int x)
{
for (int i = 0; i <= n / 2; i++) {
if (array[i] == x and array[n / 2 + i] == x) {
return true;
}
}
return false;
}
int main()
{
int n;
cout << "Enter the size of the array: " << endl;
cin >> n;
int x;
int array[n];
cout << "Enter the elements of the array: " << endl;
for (int i = 0; i < n; i++) {
cin >> array[i];
}
cout << "Enter the element to be checked for: " << endl;
cin >> x;
bool majority = is_majority (array, n, x);
if (majority) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"vivekanand1101@gmail.com"
] | vivekanand1101@gmail.com |
e2aaded375b48946387ab8727a260c55fb1a9ab0 | 5c6ddda20dc4d53bf0b9c0a1e1196ee6e70709bd | /src/algorithms/reuse_setter.h | 9d72d4adecefcb5331bb93323361a4205c142769 | [] | no_license | daadaada/gas | 38927749696ee65334cc78fadeb546f146490a81 | 0dec8acfbccf54b799a15fc1ee523b6b4cc63f35 | refs/heads/master | 2023-01-24T06:41:56.493232 | 2020-12-11T10:34:40 | 2020-12-11T10:34:40 | 318,955,721 | 35 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 444 | h | #pragma once
#include <vector>
#include "src/core/kernel.h"
#include "register_allocator.h"
#include "cfg.h"
namespace dada{
class ReuseSetter{
public:
std::vector<int> reuse_masks_;
Kernel const* kernel_;
CFG const* cfg_;
RegisterAllocator const* register_allocator_;
int const arch_;
public:
ReuseSetter(Kernel const*, CFG const*, RegisterAllocator const*, int arch);
void set();
};
} | [
"no-email"
] | no-email |
778ea0769643892dc490b64ee34efcc73fec9609 | 4b42fae3479a99b3a1f6e16922e92809a0945c82 | /components/metrics/call_stack_profile_params.h | 5aecf65b07dd2f5628f9641c766e6dd4cdfb8046 | [
"BSD-3-Clause"
] | permissive | Jtl12/browser-android-tabs | 5eed5fc4d6c978057c910b58c3ea0445bb619ee9 | f5406ad2a104d373062a86778d913e6b0a556e10 | refs/heads/master | 2023-04-02T05:20:33.277558 | 2018-07-20T12:56:19 | 2018-07-20T12:56:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,127 | h | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_
#define COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_
#include "base/time/time.h"
namespace metrics {
// Parameters to pass back to the metrics provider.
struct CallStackProfileParams {
// The process in which the collection occurred.
enum Process {
UNKNOWN_PROCESS,
BROWSER_PROCESS,
RENDERER_PROCESS,
GPU_PROCESS,
UTILITY_PROCESS,
ZYGOTE_PROCESS,
SANDBOX_HELPER_PROCESS,
PPAPI_PLUGIN_PROCESS,
PPAPI_BROKER_PROCESS
};
// The thread from which the collection occurred.
enum Thread {
UNKNOWN_THREAD,
// Each process has a 'main thread'. In the Browser process, the 'main
// thread' is also often called the 'UI thread'.
MAIN_THREAD,
IO_THREAD,
// Compositor thread (can be in both renderer and gpu processes).
COMPOSITOR_THREAD,
};
// The event that triggered the profile collection.
enum Trigger {
UNKNOWN,
PROCESS_STARTUP,
JANKY_TASK,
THREAD_HUNG,
PERIODIC_COLLECTION,
TRIGGER_LAST = PERIODIC_COLLECTION
};
// Allows the caller to specify whether sample ordering is
// important. MAY_SHUFFLE should always be used to enable better compression,
// unless the use case needs order to be preserved for a specific reason.
enum SampleOrderingSpec {
// The provider may shuffle the sample order to improve compression.
MAY_SHUFFLE,
// The provider will not change the sample order.
PRESERVE_ORDER
};
// The default constructor is required for mojo and should not be used
// otherwise. A valid trigger should always be specified.
constexpr CallStackProfileParams()
: CallStackProfileParams(UNKNOWN_PROCESS, UNKNOWN_THREAD, UNKNOWN) {}
constexpr CallStackProfileParams(Process process,
Thread thread,
Trigger trigger)
: CallStackProfileParams(process, thread, trigger, MAY_SHUFFLE) {}
constexpr CallStackProfileParams(Process process,
Thread thread,
Trigger trigger,
SampleOrderingSpec ordering_spec)
: process(process),
thread(thread),
trigger(trigger),
ordering_spec(ordering_spec) {}
// The collection process.
Process process;
// The collection thread.
Thread thread;
// The triggering event.
Trigger trigger;
// Whether to preserve sample ordering.
SampleOrderingSpec ordering_spec;
// The time at which the CallStackProfileMetricsProvider became aware of the
// request for profiling. In particular, this is when callback was requested
// via CallStackProfileMetricsProvider::GetProfilerCallback(). Used to
// determine if collection was disabled during the collection of the profile.
base::TimeTicks start_timestamp;
};
} // namespace metrics
#endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_
| [
"artem@brave.com"
] | artem@brave.com |
bff0c14c700402559a18c1757df0d4bdccf2be70 | 37a2566ba74b0ccf16308c56263865a24807f38d | /Snake/main.cpp | c9d213ef0c4f4314bc8875a3e6ee21b7b46f12ea | [] | no_license | snatvb/CPPSnake | d59da2af3e6e8575c8288df99c69ac90b576ff1e | ad9ea0dc8081f9c5f51e59764ee6832a0355b74c | refs/heads/master | 2023-02-14T21:33:15.973453 | 2021-01-12T17:24:52 | 2021-01-12T17:24:52 | 328,201,547 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 632 | cpp | #include "SnakeGame.h"
#include <functional>
int main(int argc, char* argv[]) {
const char* title = "Snake Game";
Vector2d<int> position(SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
Size size(800, 800);
SnakeGame game(position, size, title);
game.init();
const int fps = 100;
const int frameDelay = 1000 / fps;
Uint32 frameStart;
int frameTime;
while (game.isRunning()) {
frameStart = SDL_GetTicks();
game.handleEvents();
game.update();
game.render();
frameTime = SDL_GetTicks() - frameStart;
if (frameDelay > frameTime) {
SDL_Delay(frameDelay - frameTime);
}
}
game.clean();
return 0;
}
| [
"a_avsenin@wargaming.net"
] | a_avsenin@wargaming.net |
2b2338c5924a3e6597d0d05100b2ef5cbec340de | 1f171dc7b584d0cd64db77e687dc26d1c166706f | /Template/P3379_LCA/RMQ.cc | b6a570eca03807ce3d967bfc375262bc250eb447 | [] | no_license | lucifer1004/luogu | 416bae1eaebd47f8f2be381fed871b50106711d2 | 55ab2688d6d034090d2f86fd050f430d2ebafa05 | refs/heads/master | 2021-06-24T12:35:34.110602 | 2021-01-11T07:32:28 | 2021-01-11T07:32:28 | 199,382,330 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,018 | cc | #include <cmath>
#include <cstdio>
#include <cstring>
#include <vector>
#define INF 1e8
#define MAX 500005
using namespace std;
int depth[MAX], enter[MAX], euler[MAX * 2];
vector<int> adj[MAX], st[21];
class Tree {
int n, root, step;
void dfs(int i) {
enter[i] = step;
euler[step++] = i;
for (int j : adj[i]) {
if (enter[j] == -1) {
depth[j] = depth[i] + 1;
dfs(j);
euler[step++] = i;
}
}
}
void calculate_sparse_table() {
int upper = 2 * n - 1;
int max_level = log2(upper) + 1;
for (int level = 0; level < max_level; ++level)
for (int i = 0; i < upper; ++i) {
if (level == 0)
st[level].emplace_back(euler[i]);
else {
st[level].emplace_back(st[level - 1][i]);
int right = i + (1 << (level - 1));
if (right < upper &&
depth[st[level - 1][right]] < depth[st[level][i]])
st[level][i] = st[level - 1][right];
}
}
}
public:
Tree(int n, int root) {
this->n = n;
this->root = root;
depth[0] = INF;
}
void add_edge(int u, int v) {
adj[u].emplace_back(v);
adj[v].emplace_back(u);
}
void init() {
step = 0;
dfs(root);
calculate_sparse_table();
}
int query_lca(int u, int v) {
if (u == v)
return u;
int l = min(enter[u], enter[v]);
int r = max(enter[u], enter[v]);
int k = log2(r - l);
int lans = st[k][l];
int rans = st[k][r - (1 << k) + 1];
if (depth[lans] < depth[rans])
return lans;
else
return rans;
}
};
int main() {
memset(depth, 0, sizeof(depth));
memset(enter, -1, sizeof(enter));
memset(euler, 0, sizeof(euler));
int n, m, s;
scanf("%d%d%d", &n, &m, &s);
Tree tree = Tree(n, s);
for (int i = 0; i < n - 1; ++i) {
int u, v;
scanf("%d%d", &u, &v);
tree.add_edge(u, v);
}
tree.init();
for (int i = 0; i < m; ++i) {
int u, v;
scanf("%d%d", &u, &v);
printf("%d\n", tree.query_lca(u, v));
}
} | [
"qqbbnease1004@126.com"
] | qqbbnease1004@126.com |
2b1020ad32360791a48c421937409f2d9a938ddf | 3ba7870cdd086d2366df2deac73270a0ba608446 | /Chap14/ThreadDMA/EventLog.cpp | fbb58ec109c38ec21d16e82679b8f0df00bc93dc | [] | no_license | ljhhh0123/TheWindows2000DeviceDriverBook2dsrc | b6cb83e8aaf771b4ea3d8ba5f37815300e1c4c30 | 206544b5a021ea44d3c21fbebe44204b687b0510 | refs/heads/master | 2020-04-24T22:24:51.456651 | 2019-02-24T08:02:29 | 2019-02-24T08:02:29 | 172,311,312 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,243 | cpp | //++
// File Name:
// Eventlog.cpp
//
// Contents:
// Routines that give kernel-mode drivers
// access to the system Event Log.
//--
//
// Driver-specific header files...
//
#include "Driver.h"
//
// Data global to this module
//
static ULONG LogLevel;
//
// Forward declarations of local functions
//
ULONG
GetStringSize(
IN PWSTR String
);
//++
// Function:
// InitializeEventLog
//
// Description:
// This function sets things up so that
// other parts of the driver can send
// error messages to the Event Log.
//
// Arguments:
// Address of Driver object
//
// Return Value:
// (None)
//--
VOID
InitializeEventLog(
IN PDRIVER_OBJECT pDriverObject
)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
//
// Fabricate a Registry query.
//
RtlZeroMemory( QueryTable, sizeof( QueryTable ));
QueryTable[0].Name = L"EventLogLevel";
QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
QueryTable[0].EntryContext = &LogLevel;
//
// Look for the EventLogLevel value
// in the Registry.
//
if( !NT_SUCCESS(
RtlQueryRegistryValues(
RTL_REGISTRY_SERVICES,
L"THREADDMA\\Parameters",
QueryTable,
NULL, NULL )))
{
LogLevel = DEFAULT_LOG_LEVEL;
}
//
// Log a message saying that logging
// is enabled.
//
ReportEvent(
LOG_LEVEL_DEBUG,
MSG_LOGGING_ENABLED,
ERRORLOG_INIT,
(PVOID)pDriverObject,
NULL, // No IRP
NULL, 0, // No dump data
NULL, 0 ); // No strings
}
//++
// Function:
// ReportEvent
//
// Description:
// This function puts a message in
// the system Event log.
//
// Arguments:
// LOG_LEVEL for this message
// Error message code
// Address of Driver or Device object
// Address of IRP (or NULL)
// Address of dump data array (or NULL)
// Count of ULONGs in dump data array (or zero)
// Address of array of insertion strings
// Count of insertion strings (or zero)
//
//
// Return Value:
// TRUE if the error was logged
// FALSE if there was a problem
//--
BOOLEAN
ReportEvent(
IN ULONG MessageLevel,
IN NTSTATUS ErrorCode,
IN ULONG UniqueErrorValue,
IN PVOID pIoObject,
IN PIRP pIrp,
IN ULONG DumpData[],
IN ULONG DumpDataCount,
IN PWSTR Strings[],
IN ULONG StringCount
)
{
PIO_ERROR_LOG_PACKET pPacket;
PDEVICE_EXTENSION pDE;
PIO_STACK_LOCATION pIrpStack;
PUCHAR pInsertionString;
UCHAR PacketSize;
UCHAR StringSize[ MAX_INSERTION_STRINGS ];
ULONG i;
//
// If we're not logging, or the message
// is out of range, don't do anything.
//
if( ( LogLevel == LOG_LEVEL_NONE ) ||
( MessageLevel > LogLevel ))
{
return TRUE;
}
//
// Start with minimum required packet size
//
PacketSize = sizeof( IO_ERROR_LOG_PACKET );
//
// Add in any dump data. Remember that the
// standard error log packet already has one
// slot in its DumpData array.
//
if( DumpDataCount > 0 )
PacketSize +=
(UCHAR)( sizeof( ULONG ) *
( DumpDataCount - 1 ));
//
// Determine total space needed for any
// insertion strings.
//
if( StringCount > 0 )
{
//
// Take the lesser of what the caller sent
// and what this routine can handle
//
if( StringCount > MAX_INSERTION_STRINGS )
StringCount = MAX_INSERTION_STRINGS;
for( i=0; i<StringCount; i++ )
{
//
// Keep track of individual string sizes
//
StringSize[i] =
(UCHAR)GetStringSize( Strings[i] );
PacketSize += StringSize[i];
}
}
//
// Try to allocate the packet
//
pPacket = (PIO_ERROR_LOG_PACKET)
IoAllocateErrorLogEntry(
pIoObject,
PacketSize );
if( pPacket == NULL ) return FALSE;
//
// Fill in standard parts of the packet
//
pPacket->ErrorCode = ErrorCode;
pPacket->UniqueErrorValue = UniqueErrorValue;
//
// If there's an IRP, then the IoObject must
// be a Device object. In that case, use the
// IRP and the Device Extension to fill in
// additional parts of the packet. Otherwise,
// set these additional fields to zero.
//
if( pIrp != NULL )
{
pIrpStack
= IoGetCurrentIrpStackLocation( pIrp );
pDE = (PDEVICE_EXTENSION)
((PDEVICE_OBJECT)pIoObject)->
DeviceExtension;
pPacket->MajorFunctionCode =
pIrpStack->MajorFunction;
pPacket->RetryCount = pDE->IrpRetryCount;
pPacket->FinalStatus = pIrp->IoStatus.Status;
pPacket->SequenceNumber =
pDE->IrpSequenceNumber;
if( pIrpStack->MajorFunction ==
IRP_MJ_DEVICE_CONTROL ||
pIrpStack->MajorFunction ==
IRP_MJ_INTERNAL_DEVICE_CONTROL )
{
pPacket->IoControlCode =
pIrpStack->Parameters.
DeviceIoControl.
IoControlCode;
}
else pPacket->IoControlCode = 0;
}
else // No IRP
{
pPacket->MajorFunctionCode = 0;
pPacket->RetryCount = 0;
pPacket->FinalStatus = 0;
pPacket->SequenceNumber = 0;
pPacket->IoControlCode = 0;
}
//
// Add the dump data
//
if( DumpDataCount > 0 )
{
pPacket->DumpDataSize =
(USHORT)( sizeof( ULONG ) *
DumpDataCount );
for( i=0; i<DumpDataCount; i++ )
pPacket->DumpData[i] = DumpData[i];
}
else pPacket->DumpDataSize = 0;
//
// Add the insertion strings
//
pPacket->NumberOfStrings = (USHORT)StringCount;
//
// The strings always go just after
// the DumpData array in the packet
//
pPacket->StringOffset =
sizeof( IO_ERROR_LOG_PACKET ) +
( DumpDataCount - 1 ) * sizeof( ULONG );
if( StringCount > 0 )
{
pInsertionString =
(PUCHAR)pPacket + pPacket->StringOffset;
for( i=0; i<StringCount; i++ )
{
//
// Add each new string to the end
// of the existing stuff
//
RtlCopyBytes(
pInsertionString,
Strings[i],
StringSize[i] );
pInsertionString += StringSize[i];
}
}
//
// Log the message
//
IoWriteErrorLogEntry( pPacket );
return TRUE;
}
//++
// Function:
// GetStringSize
//
// Description:
// This function determines the amount of
// space needed to hold a NULL-terminated
// Unicode string.
//
// Arguments:
// Address of string
//
//
// Return Value:
// Size (in bytes) of the string
//--
ULONG
GetStringSize(
IN PWSTR String
)
{
UNICODE_STRING TempString;
//
// Use an RTL routine to get the length
//
RtlInitUnicodeString( &TempString, String );
//
// Size is actually two greater because
// of the UNICODE_NULL at the end.
//
return( TempString.Length + sizeof( WCHAR));
}
| [
"ljhhh0123@139.com"
] | ljhhh0123@139.com |
9b1e8777e81b8776eb0a145f7464fa9811af569b | 79d653bee226be85a05b5549331db6a4c8ee358d | /devel/include/actionlib/TestRequestAction.h | e559dae6612bdbbb7df99256919a0718250d0d86 | [] | no_license | air-bot-in/ros_practise | 17557e3b1b5595571af0076b39549c204b0adbfe | 331c770a80bf96ae713d333aaf34d3ba21e0bebb | refs/heads/master | 2021-03-15T06:21:01.909018 | 2020-03-12T12:38:56 | 2020-03-12T12:38:56 | 246,830,899 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,543 | h | // Generated by gencpp from file actionlib/TestRequestAction.msg
// DO NOT EDIT!
#ifndef ACTIONLIB_MESSAGE_TESTREQUESTACTION_H
#define ACTIONLIB_MESSAGE_TESTREQUESTACTION_H
#include <string>
#include <vector>
#include <map>
#include <ros/types.h>
#include <ros/serialization.h>
#include <ros/builtin_message_traits.h>
#include <ros/message_operations.h>
#include <actionlib/TestRequestActionGoal.h>
#include <actionlib/TestRequestActionResult.h>
#include <actionlib/TestRequestActionFeedback.h>
namespace actionlib
{
template <class ContainerAllocator>
struct TestRequestAction_
{
typedef TestRequestAction_<ContainerAllocator> Type;
TestRequestAction_()
: action_goal()
, action_result()
, action_feedback() {
}
TestRequestAction_(const ContainerAllocator& _alloc)
: action_goal(_alloc)
, action_result(_alloc)
, action_feedback(_alloc) {
(void)_alloc;
}
typedef ::actionlib::TestRequestActionGoal_<ContainerAllocator> _action_goal_type;
_action_goal_type action_goal;
typedef ::actionlib::TestRequestActionResult_<ContainerAllocator> _action_result_type;
_action_result_type action_result;
typedef ::actionlib::TestRequestActionFeedback_<ContainerAllocator> _action_feedback_type;
_action_feedback_type action_feedback;
typedef boost::shared_ptr< ::actionlib::TestRequestAction_<ContainerAllocator> > Ptr;
typedef boost::shared_ptr< ::actionlib::TestRequestAction_<ContainerAllocator> const> ConstPtr;
}; // struct TestRequestAction_
typedef ::actionlib::TestRequestAction_<std::allocator<void> > TestRequestAction;
typedef boost::shared_ptr< ::actionlib::TestRequestAction > TestRequestActionPtr;
typedef boost::shared_ptr< ::actionlib::TestRequestAction const> TestRequestActionConstPtr;
// constants requiring out of line definition
template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::actionlib::TestRequestAction_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::actionlib::TestRequestAction_<ContainerAllocator> >::stream(s, "", v);
return s;
}
} // namespace actionlib
namespace ros
{
namespace message_traits
{
// BOOLTRAITS {'IsFixedSize': False, 'IsMessage': True, 'HasHeader': False}
// {'actionlib': ['/home/hudkmr/ros_project_ws/devel/share/actionlib/msg'], 'std_msgs': ['/opt/ros/kinetic/share/std_msgs/cmake/../msg'], 'actionlib_msgs': ['/opt/ros/kinetic/share/actionlib_msgs/cmake/../msg']}
// !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types']
template <class ContainerAllocator>
struct IsFixedSize< ::actionlib::TestRequestAction_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct IsFixedSize< ::actionlib::TestRequestAction_<ContainerAllocator> const>
: FalseType
{ };
template <class ContainerAllocator>
struct IsMessage< ::actionlib::TestRequestAction_<ContainerAllocator> >
: TrueType
{ };
template <class ContainerAllocator>
struct IsMessage< ::actionlib::TestRequestAction_<ContainerAllocator> const>
: TrueType
{ };
template <class ContainerAllocator>
struct HasHeader< ::actionlib::TestRequestAction_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct HasHeader< ::actionlib::TestRequestAction_<ContainerAllocator> const>
: FalseType
{ };
template<class ContainerAllocator>
struct MD5Sum< ::actionlib::TestRequestAction_<ContainerAllocator> >
{
static const char* value()
{
return "dc44b1f4045dbf0d1db54423b3b86b30";
}
static const char* value(const ::actionlib::TestRequestAction_<ContainerAllocator>&) { return value(); }
static const uint64_t static_value1 = 0xdc44b1f4045dbf0dULL;
static const uint64_t static_value2 = 0x1db54423b3b86b30ULL;
};
template<class ContainerAllocator>
struct DataType< ::actionlib::TestRequestAction_<ContainerAllocator> >
{
static const char* value()
{
return "actionlib/TestRequestAction";
}
static const char* value(const ::actionlib::TestRequestAction_<ContainerAllocator>&) { return value(); }
};
template<class ContainerAllocator>
struct Definition< ::actionlib::TestRequestAction_<ContainerAllocator> >
{
static const char* value()
{
return "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\
\n\
TestRequestActionGoal action_goal\n\
TestRequestActionResult action_result\n\
TestRequestActionFeedback action_feedback\n\
\n\
================================================================================\n\
MSG: actionlib/TestRequestActionGoal\n\
# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\
\n\
Header header\n\
actionlib_msgs/GoalID goal_id\n\
TestRequestGoal goal\n\
\n\
================================================================================\n\
MSG: std_msgs/Header\n\
# Standard metadata for higher-level stamped data types.\n\
# This is generally used to communicate timestamped data \n\
# in a particular coordinate frame.\n\
# \n\
# sequence ID: consecutively increasing ID \n\
uint32 seq\n\
#Two-integer timestamp that is expressed as:\n\
# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
# time-handling sugar is provided by the client library\n\
time stamp\n\
#Frame this data is associated with\n\
# 0: no frame\n\
# 1: global frame\n\
string frame_id\n\
\n\
================================================================================\n\
MSG: actionlib_msgs/GoalID\n\
# The stamp should store the time at which this goal was requested.\n\
# It is used by an action server when it tries to preempt all\n\
# goals that were requested before a certain time\n\
time stamp\n\
\n\
# The id provides a way to associate feedback and\n\
# result message with specific goal requests. The id\n\
# specified must be unique.\n\
string id\n\
\n\
\n\
================================================================================\n\
MSG: actionlib/TestRequestGoal\n\
# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\
int32 TERMINATE_SUCCESS = 0\n\
int32 TERMINATE_ABORTED = 1\n\
int32 TERMINATE_REJECTED = 2\n\
int32 TERMINATE_LOSE = 3\n\
int32 TERMINATE_DROP = 4\n\
int32 TERMINATE_EXCEPTION = 5\n\
int32 terminate_status\n\
bool ignore_cancel # If true, ignores requests to cancel\n\
string result_text\n\
int32 the_result # Desired value for the_result in the Result\n\
bool is_simple_client\n\
duration delay_accept # Delays accepting the goal by this amount of time\n\
duration delay_terminate # Delays terminating for this amount of time\n\
duration pause_status # Pauses the status messages for this amount of time\n\
\n\
================================================================================\n\
MSG: actionlib/TestRequestActionResult\n\
# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\
\n\
Header header\n\
actionlib_msgs/GoalStatus status\n\
TestRequestResult result\n\
\n\
================================================================================\n\
MSG: actionlib_msgs/GoalStatus\n\
GoalID goal_id\n\
uint8 status\n\
uint8 PENDING = 0 # The goal has yet to be processed by the action server\n\
uint8 ACTIVE = 1 # The goal is currently being processed by the action server\n\
uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing\n\
# and has since completed its execution (Terminal State)\n\
uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State)\n\
uint8 ABORTED = 4 # The goal was aborted during execution by the action server due\n\
# to some failure (Terminal State)\n\
uint8 REJECTED = 5 # The goal was rejected by the action server without being processed,\n\
# because the goal was unattainable or invalid (Terminal State)\n\
uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing\n\
# and has not yet completed execution\n\
uint8 RECALLING = 7 # The goal received a cancel request before it started executing,\n\
# but the action server has not yet confirmed that the goal is canceled\n\
uint8 RECALLED = 8 # The goal received a cancel request before it started executing\n\
# and was successfully cancelled (Terminal State)\n\
uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be\n\
# sent over the wire by an action server\n\
\n\
#Allow for the user to associate a string with GoalStatus for debugging\n\
string text\n\
\n\
\n\
================================================================================\n\
MSG: actionlib/TestRequestResult\n\
# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\
int32 the_result\n\
bool is_simple_server\n\
\n\
================================================================================\n\
MSG: actionlib/TestRequestActionFeedback\n\
# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\
\n\
Header header\n\
actionlib_msgs/GoalStatus status\n\
TestRequestFeedback feedback\n\
\n\
================================================================================\n\
MSG: actionlib/TestRequestFeedback\n\
# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\
\n\
";
}
static const char* value(const ::actionlib::TestRequestAction_<ContainerAllocator>&) { return value(); }
};
} // namespace message_traits
} // namespace ros
namespace ros
{
namespace serialization
{
template<class ContainerAllocator> struct Serializer< ::actionlib::TestRequestAction_<ContainerAllocator> >
{
template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
{
stream.next(m.action_goal);
stream.next(m.action_result);
stream.next(m.action_feedback);
}
ROS_DECLARE_ALLINONE_SERIALIZER
}; // struct TestRequestAction_
} // namespace serialization
} // namespace ros
namespace ros
{
namespace message_operations
{
template<class ContainerAllocator>
struct Printer< ::actionlib::TestRequestAction_<ContainerAllocator> >
{
template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::actionlib::TestRequestAction_<ContainerAllocator>& v)
{
s << indent << "action_goal: ";
s << std::endl;
Printer< ::actionlib::TestRequestActionGoal_<ContainerAllocator> >::stream(s, indent + " ", v.action_goal);
s << indent << "action_result: ";
s << std::endl;
Printer< ::actionlib::TestRequestActionResult_<ContainerAllocator> >::stream(s, indent + " ", v.action_result);
s << indent << "action_feedback: ";
s << std::endl;
Printer< ::actionlib::TestRequestActionFeedback_<ContainerAllocator> >::stream(s, indent + " ", v.action_feedback);
}
};
} // namespace message_operations
} // namespace ros
#endif // ACTIONLIB_MESSAGE_TESTREQUESTACTION_H
| [
"hariudkmr@gmail.com"
] | hariudkmr@gmail.com |
2861de6ed7912499225c504b0b6f0eea30f90ad2 | 44b871618d71f9a09c5d12da41b16af8109b7d59 | /Classes/GameStatus.cpp | 342f1cc76e090970373b5d208357ca1f97e29f2b | [] | no_license | lishunan246/mygame | f532cc227fd24e18a1d765d3f3056259768578e4 | 9835ed60c525bf329598fd344012f9ff04e4e9ca | refs/heads/master | 2021-01-01T19:15:11.259217 | 2014-12-26T10:48:56 | 2014-12-26T10:48:56 | 28,139,894 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,489 | cpp | #include "GameStatus.h"
GameStatus::GameStatus(Node* node)
{
this->node = node;
label = Label::createWithTTF("0", font, size);
// position the label on the center of the screen
label->setPosition(700, 1000);
// add the label as a child to this layer
node->addChild(label, 1);
player = Label::createWithTTF("player", font, size);
player->setPosition(700, 1050);
node->addChild(player, 1);
money = Label::createWithTTF("money", font, size);
money->setPosition(900, 1050);
node->addChild(money, 1);
terrain = Label::createWithTTF("terrain", font, size);
terrain->setPosition(900, 1000);
node->addChild(terrain, 1);
positionX = Label::createWithTTF("X:", font, size);
positionX->setPosition(1800, 1050);
node->addChild(positionX, 1);
positionY = Label::createWithTTF("Y:", font, size);
positionY->setPosition(1800, 1000);
node->addChild(positionY, 1);
name = Label::createWithTTF("Name", font, size);
name->setPosition(1200, 1050);
node->addChild(name, 1);
hp = Label::createWithTTF("HP", font, size);
hp->setPosition(1600, 1000);
node->addChild(hp, 1);
owner = Label::createWithTTF("owner", font, size);
owner->setPosition(1400, 1050);
node->addChild(owner, 1);
attack = Label::createWithTTF("attack", font, size);
attack->setPosition(1400, 1000);
node->addChild(attack, 1);
stm = Label::createWithTTF("stm", font, size);
stm->setPosition(1200, 1000);
node->addChild(stm, 1);
}
GameStatus::~GameStatus()
{
}
void GameStatus::setCount(int count)
{
label->setString(GameHelper::intToString(count));
}
void GameStatus::showUnit(GameUnit* unit)
{
if (unit == nullptr)
{
name->setString("");
hp->setString("");
positionX->setString("");
positionY->setString("");
owner->setString("");
attack->setString("");
stm->setString("");
return;
}
name->setString(unit->name);
hp->setString("HP: "+GameHelper::intToString(unit->hp));
positionX->setString("X: "+GameHelper::intToString(unit->x));
positionY->setString("Y: "+GameHelper::intToString(unit->y));
attack->setString("atk: " + GameHelper::intToString(unit->attack));
stm->setString("stm: " + GameHelper::intToString(unit->stamina));
if (unit->owner == 1)
{
owner->setString("Player1");
}
else
{
owner->setString("Player2");
}
}
void GameStatus::showTerrain(string s)
{
terrain->setString(s);
}
void GameStatus::showPlayer(string s)
{
player->setString(s);
}
void GameStatus::showMoney(int m)
{
money->setString("$" + GameHelper::intToString(m));
}
| [
"lishunan246@gmail.com"
] | lishunan246@gmail.com |
d2d41fe5920bc690bc972fb7e348b1043b34a80f | 9478b67fa5ac94bafdac25ac99230c2e2f79c71b | /TemportalEngine/source/asset/Project.cpp | 05b59c50e07c2f7842943efba68306a0b287d7b2 | [
"Apache-2.0"
] | permissive | Hengle/TemportalEngine | 6e4260b6aed008cb10c6eaa0f7ebeaa499ea2218 | 33834f38c66021f33f5b9b1c6be5366efe98be91 | refs/heads/master | 2022-11-08T07:10:31.160464 | 2020-06-24T21:54:43 | 2020-06-24T21:54:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,796 | cpp | #include "asset/Project.hpp"
#include "asset/AssetManager.hpp"
#include <cereal/archives/json.hpp>
#include <cereal/archives/portable_binary.hpp>
#include "..\..\include\asset\Project.hpp"
using namespace asset;
DEFINE_NEWASSET_FACTORY(Project)
DEFINE_EMPTYASSET_FACTORY(Project)
Project::Project(std::filesystem::path filePath) : Asset(filePath)
{
this->mName = this->getFileName();
}
Project::Project(std::string name, Version version) : Asset()
{
this->mName = name;
this->mVersion = version;
this->mGraphicsDevicePreference
.addCriteriaQueueFamily(graphics::QueueFamily::Enum::eGraphics)
.addCriteriaQueueFamily(graphics::QueueFamily::Enum::ePresentation)
.addCriteriaDeviceExtension(graphics::PhysicalDeviceProperties::Extension::SwapChain);
}
std::filesystem::path Project::getAbsoluteDirectoryPath() const
{
return this->mFilePath.parent_path();
}
std::filesystem::path Project::getAssetDirectoryFor(std::filesystem::path projectDir)
{
return projectDir / "assets";
}
std::filesystem::path Project::getAssetDirectory() const
{
return Project::getAssetDirectoryFor(this->getAbsoluteDirectoryPath());
}
#pragma region Properties
std::string Project::getName() const
{
return this->mName;
}
void Project::setName(std::string value)
{
this->mName = value;
}
Version Project::getVersion() const
{
return this->mVersion;
}
void Project::setVersion(Version value)
{
this->mVersion = value;
}
std::string Project::getDisplayName() const
{
return this->getName() + " (" + this->getVersion().toString() + ")";
}
graphics::PhysicalDevicePreference Project::getPhysicalDevicePreference() const
{
return this->mGraphicsDevicePreference;
}
void Project::setPhysicalDevicePreference(graphics::PhysicalDevicePreference const &prefs)
{
this->mGraphicsDevicePreference = prefs;
}
graphics::LogicalDeviceInfo Project::getGraphicsDeviceInitInfo() const
{
auto info = graphics::LogicalDeviceInfo();
for (const auto& prefExtension : this->mGraphicsDevicePreference.getDeviceExtensions())
{
if (!prefExtension.isRequired()) continue;
info.addDeviceExtension(prefExtension.value);
}
for (const auto& prefQueueFamily : this->mGraphicsDevicePreference.getQueueFamilies())
{
if (!prefQueueFamily.isRequired()) continue;
info.addQueueFamily(prefQueueFamily.value);
}
return info;
}
#pragma endregion
CREATE_DEFAULT_SERIALIZATION_DEFINITION(const, Project::write, cereal::JSONOutputArchive, Project::serialize);
CREATE_DEFAULT_SERIALIZATION_DEFINITION(, Project::read, cereal::JSONInputArchive, Project::deserialize);
CREATE_DEFAULT_SERIALIZATION_DEFINITION(const, Project::compile, cereal::PortableBinaryOutputArchive, Project::serialize);
CREATE_DEFAULT_SERIALIZATION_DEFINITION(, Project::decompile, cereal::PortableBinaryInputArchive, Project::deserialize);
| [
"dustin.yost.t@gmail.com"
] | dustin.yost.t@gmail.com |
203398c88d0e7abef144fb0fed17bf9c8082a9dd | 5dc4ea36514927efd678638e2095a4e8e32c0386 | /NPSVisor/tools/svLabelMaker/source/pProperty/svmLineProperty.h | 1263f97f392340328a6a70dbf9a98dc8d0e6508f | [
"Unlicense"
] | permissive | NPaolini/NPS_OpenSource | 732173afe958f9549af13bc39b15de79e5d6470c | 0c7da066b02b57ce282a1903a3901a563d04a28f | refs/heads/main | 2023-03-15T09:34:19.674662 | 2021-03-13T13:22:00 | 2021-03-13T13:22:00 | 342,852,203 | 0 | 0 | null | null | null | null | IBM852 | C++ | false | false | 1,382 | h | //--------------- svmLineProperty.h -----------------------------
//-----------------------------------------------------------
#ifndef svmLineProperty_H_
#define svmLineProperty_H_
//-----------------------------------------------------------
#include "precHeader.h"
#include "svmProperty.h"
//-----------------------------------------------------------
// classe base per primitive di base, linee, rettangoli, ellissi
// aggiunge le proprietÓ di pen e un valore per direzione della
// linea (per non usare dimensioni negative nel rect)
class lineProperty : public Property
{
private:
typedef Property baseClass;
public:
enum elDir { edTopLeft, edTopRight /*, edBottomLeft, edBottomRight */ };
lineProperty() : dir(edTopLeft), idPen(1) {}
virtual ~lineProperty() {}
const lineProperty& operator=(const lineProperty& other) { clone(other); return *this; }
const Property& operator=(const Property& other) { clone(other); return *this; }
virtual void unionBits(DWORD& capable)
{
baseClass::unionBits(capable);
capable |= BIT_POS(unionProperty::eupPen);
}
virtual void initUnion(unionProperty& uProp);
uint dir;
uint idPen;
protected:
virtual void clone(const Property& other);
virtual bool setOtherCommon(const unionProperty& uP);
};
//-----------------------------------------------------------
#endif
| [
"npaolini@ennepisoft.it"
] | npaolini@ennepisoft.it |
1965a5d26ef1f51422b9d83746fb4b62104da5a8 | 385cb811d346a4d7a285fc087a50aaced1482851 | /codeforces/793/B/main.cpp | d23481ddb03b597a83fe30e0def9022991da7d7e | [] | no_license | NoureldinYosri/competitive-programming | aa19f0479420d8d1b10605536e916f0f568acaec | 7739344404bdf4709c69a97f61dc3c0b9deb603c | refs/heads/master | 2022-11-22T23:38:12.853482 | 2022-11-10T20:32:28 | 2022-11-10T20:32:28 | 40,174,513 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,055 | cpp | #include <bits/stdc++.h>
#define loop(i,n) for(int i = 0;i < (n);i++)
#define range(i,a,b) for(int i = (a);i <= (b);i++)
#define all(A) A.begin(),A.end()
#define pb push_back
#define mp make_pair
#define sz(A) ((int)A.size())
#define vi vector<int>
#define vl vector<long long>
#define vd vector<double>
#define vp vector<pair<int,int> >
#define ll long long
#define pi pair<int,int>
#define popcnt(x) __builtin_popcount(x)
#define LSOne(x) ((x) & (-(x)))
#define xx first
#define yy second
#define PQ priority_queue
#define print(A,t) cerr << #A << ": "; copy(all(A),ostream_iterator<t>(cerr," " )); cerr << endl
#define prp(p) cerr << "(" << (p).first << " ," << (p).second << ")";
#define prArr(A,n,t) cerr << #A << ": "; copy(A,A + n,ostream_iterator<t>(cerr," " )); cerr << endl
#define PRESTDIO() cin.tie(0),cerr.tie(0),ios_base::sync_with_stdio(0)
#define what_is(x) cerr << #x << " is " << x << endl
#define bit_lg(x) (assert(x > 0),__builtin_ffsll(x) - 1)
const double PI = acos(-1);
using namespace std;
struct state{
int x,y,lst_dir,cnt;
};
const int MAX = 1111;
char G[MAX][MAX];
int m,n;
int dx[] = {-1,0,1,0},dy[] = {0,-1,0,1};
bool vis[MAX][MAX][4][3];
pi S,T;
bool bfs(){
queue<state> q;
loop(i,4) {
q.push(state({S.xx,S.yy,i,2}));
vis[S.xx][S.yy][i][2] = 1;
}
while(!q.empty()){
state cur = q.front(); q.pop();
if(T == mp(cur.x,cur.y)) return 1;
loop(i,4){
state to = cur;
to.cnt -= to.lst_dir != i;
if(to.cnt < 0) continue;
to.lst_dir = i;
to.x += dx[i];
to.y += dy[i];
if(to.x < 0 || to.y < 0 || to.x >= m || to.y >= n) continue;
if(G[to.x][to.y] == '*') continue;
if(vis[to.x][to.y][to.lst_dir][to.cnt]) continue;
vis[to.x][to.y][to.lst_dir][to.cnt] = 1;
q.push(to);
}
}
return 0;
}
int main(){
#ifdef HOME
freopen("input.in", "r", stdin);
freopen("output.out", "w", stdout);
#endif
scanf("%d %d",&m,&n);
loop(i,m){
scanf("%s",G[i]);
loop(j,n) {
if(G[i][j] == 'S') S = mp(i,j);
if(G[i][j] == 'T') T = mp(i,j);
}
}
puts(bfs() ? "YES" : "NO");
return 0;
}
| [
"noureldinyosri@gmail.com"
] | noureldinyosri@gmail.com |
bdf9fdef6be36f6f067d8a7ec09293470fccf58a | aaf4d782ab424b10861c628eb05f37c90f97dfd5 | /Uva 458 - The Decoder.cpp | 857de4dd8abe88ce8697a7b2d9ce70ae034ac23d | [] | no_license | DK-Shanto/Uva_Problem_Solutions | fc3dc7eb7e8a96c61ee7c0839100ba8280fb4cb3 | cfb5584cb62d95fd748928814a692cc864507bce | refs/heads/master | 2020-03-22T17:15:40.007104 | 2018-07-28T15:35:12 | 2018-07-28T15:35:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 488 | cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
int k=0;
while(cin>>str)
{
k++;
if(k==1)
cout<<"*CDC is the trademark of the Control Data Corporation."<<endl;
else if(k==2)
cout<<"*IBM is a trademark of the International Business Machine Corporation."<<endl;
else if(k==3)
cout<<"*DEC is the trademark of the Digital Equipment Corporation."<<endl;
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
219d85055a80f0033a9e67f4554a432d1df146de | e7e497b20442a4220296dea1550091a457df5a38 | /main_project/search/SearchCache2/src/Util/SearchCacheDataSerialize.h | 3718849fb00e87331b974256de35f97c6a41e719 | [] | no_license | gunner14/old_rr_code | cf17a2dedf8dfcdcf441d49139adaadc770c0eea | bb047dc88fa7243ded61d840af0f8bad22d68dee | refs/heads/master | 2021-01-17T18:23:28.154228 | 2013-12-02T23:45:33 | 2013-12-02T23:45:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,182 | h | #ifndef _SEARCHCACHEDATASERIALIZE_H_
#define _SEARCHCACHEDATASERIALIZE_H_
namespace xce {
namespace searchcache {
class SearchCacheDataSerialize {
public:
template<typename T>
static inline bool UnserializeFromBuffer(const char** p, int& total, T& value) {
value = *(T*)(*p);
*p+=sizeof(T);
total -= sizeof(T);
if (total < 0) {
MCE_WARN("UnserializeFromBuffer is Error! total<0");
return false;
}
return true;
}
static inline bool UnserializeFromBuffer(const char** p, int& total, string& value) {
int strlen = *(int*)(*p);
*p+=sizeof(int);
total -= sizeof(int);
if (total < 0 || strlen < 0) {
MCE_WARN("total=" << total << "strlen =" << strlen);
return false;
}
total -= strlen;
if (total < 0) {
MCE_WARN("total is:"<<total<<"\t"<<"value is:"<<value);
MCE_WARN("total < 0");
return false;
}
value = string(*p, strlen);
*p+=strlen;
return true;
}
static inline void SerializeToBinString(BinStringPtr& binString, char type,
int content, int& totalField){
binString->add(type); //标签
binString->add((int)sizeof(content)); //长度
binString->add(content); //内容
totalField++;
}
static inline void SerializeToBinString(BinStringPtr& binString, char type,
const std::string& content, int& totalField){
if (content.empty()) return;
binString->add(type); //标签
binString->add((int)(sizeof(int) + content.length())); //长度
binString->add((int)content.length());
binString->add(content);//内容
totalField++;
}
static inline void SerializeToBinString(BinStringPtr& binString, char type,
int total, int vec_size, BinString& content, int& totalField) {
binString->add(type);
binString->add(total);
binString->add(vec_size);
binString->add(content);
totalField++;
}
};
}
}
#endif
| [
"liyong19861014@gmail.com"
] | liyong19861014@gmail.com |
a48327ab68036f6098f0dac9330e1109b40d3393 | c04d4dc09e6d1b0862fb2b3d7f9de7ec19633a1f | /Source/Plot/Basic/Axis.h | 1a416255c4b4681eb19abb841415d883e4312df2 | [
"MIT"
] | permissive | Ben20013/CChart | 6d4e7eb46ea37e870b27e702b0bde68acf8661da | 436b97ca803d6c911d954437b1674b2537577654 | refs/heads/master | 2023-07-11T16:31:06.821801 | 2020-10-08T13:16:09 | 2020-10-08T13:16:09 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 15,094 | h | /*============================================================================*/
/* */
/* C O P Y R I G H T */
/* */
/* (C) Copyright 2019 by */
/* Yang Guojun */
/* All Rights Reserved */
/* */
/* The author assumes no responsibility for the use or reliability of */
/* his software. */
/* */
/*============================================================================*/
////////////////////////////////////////////////////////////////////////////////
// 版权申明 //
// 版权所有(C)2006-2019,杨国君 //
// 保留全部权利 //
////////////////////////////////////////////////////////////////////////////////
/* ############################################################################################################################## */
#pragma once
#include <windows.h>
#pragma warning(disable:4786)
#include <vector>
#include <map>
#include "PlotUtility.h"
#include "MyString.h"
using namespace std;
Declare_Namespace_CChart
// Axis locations
enum
{
kLocationLeft = 0,
kLocationBottom,
kLocationRight,
kLocationTop,
kLocationCenterVL,
kLocationCenterVR,
kLocationCenterHB,
kLocationCenterHT,
kLocation2DCount,
kLocationTDX = kLocation2DCount,
kLocationTDY,
kLocationTDZ,
kLocationCount
};
// Tick position
enum
{
kTickPositionNone = 0,
kTickPositionInner,
kTickPositionOuter,
kTickPositionBoth,
kTickPositionCount
};
typedef struct stDataRange
{
double val[2];
}DataRange, *pDataRange;
class CAxis
{
public:
CAxis();
virtual ~CAxis();
protected:
void SetDefaults();
protected:
int m_nApperanceMode;
int m_nTickLength, m_nMinorTickLength; // length of tick marks (logical units)
int m_nTickPosition, m_nMinorTickPosition; // position of the ticks
int m_nTickSize, m_nMinorTickSize; // thickness of the ticks
COLORREF m_crTickColor, m_crMinorTickColor; // color of the ticks
int m_nLineSize; // Size of the line
int m_nLineStyle; // style of the line;
bool m_bVisible; // is axis visible?
bool m_bShowAxisLine;// the line
tstring m_strTitle; // axis title
bool m_bShowTitle; // title visible
int m_nLocation; // location of axis (left, bottom, top, etc.)
int m_nTitleGap; // Gap of title and labels
LOGFONT m_lfTitleFont; // font to use for title
LOGFONT m_lfLabelFont; // font to use for axis labels
COLORREF m_crAxisColor; // color to use for axis and font
COLORREF m_crTitleColor; // color to use for title
bool m_bShowTitleRect;
int m_nTitleRectLineSize;
int m_nTitleRectLineStyle;
// bool m_bRangeSet; // has the range been set?
// bool m_bAutoRange;
int m_nAxisGap;
int m_nLabelGap;
bool m_bDespiteLow;
bool m_bDespiteHigh;
int m_nBrushType;
int m_nHatchStyle;
COLORREF m_crBgColor;
COLORREF m_crHatchColor;
HBITMAP m_hPattern;
bool m_bBorderShow;
int m_nBorderSize;
bool m_bShowMajorTicks;
bool m_bShowMinorTicks;
bool m_bArrowStart;
bool m_bArrowEnd;
int m_nArrowSize;
int m_nArrowRatio;
bool m_bArrowFlatBottom;
bool m_bArrowReverse;
bool m_bTickLabelSEOnly;
bool m_bTickLabelShow;
COLORREF m_crTickLabelColor;
int m_nMarginHorizontal,m_nMarginVertical;
bool m_bSameColor;
bool m_bLighted;
bool m_bSelected;
int m_nTitlePosition;
SIZE m_sizeTitleOffset;
SIZE m_sizeLabelOffset;
bool m_bReplaceLabel;
vector<tstring> m_vstrAlternateLabels;
bool m_bMapAlternateMode;
map<int, tstring> m_mapAlternateLabels;
double m_fMapAlternateStartVal;
tstring m_strLabelSuffix;
tstring m_strLabelPrefix;
tstring m_strLabelFormat;
bool m_bColorBar;
int m_nColorBarWidth;
COLORREF m_crBarColor1, m_crBarColor2;
int m_nColorBarMarginOuter, m_nColorBarMarginInner;
bool m_bTime;
tstring m_strTimeFormat;
//bool m_bIndependent;
bool m_bMinusTicks;
bool m_bTwoStoreyX;
bool m_bSciNotation;
double m_fSnFontRatio;
bool m_bYTitleVerticle;
vector<DataRange> m_vRanges4LabelHiden;
public:
inline int GetTickLength( void ) { return m_nTickLength; }
inline void SetTickLength( int length ) { m_nTickLength=length; }
inline int GetMinorTickLength( void ) { return m_nMinorTickLength; }
inline void SetMinorTickLength( int length ) { m_nMinorTickLength=length; }
inline int GetTickPosition( void ) { return m_nTickPosition; }
inline void SetTickPosition( int position ) { m_nTickPosition=position; }
inline int GetMinorTickPosition( void ) { return m_nMinorTickPosition; }
inline void SetMinorTickPosition( int position ) { m_nMinorTickPosition=position; }
inline int GetTickSize( void ) { return m_nTickSize; }
inline void SetTickSize( int Size ) { m_nTickSize=Size; }
inline int GetMinorTickSize( void ) { return m_nMinorTickSize; }
inline void SetMinorTickSize( int size ) { m_nMinorTickSize=size; }
inline COLORREF GetTickColor( void ) { return m_crTickColor; }
inline void SetTickColor( COLORREF color ) { m_crTickColor=color; }
inline COLORREF GetMinorTickColor( void ) { return m_crMinorTickColor; }
inline void SetMinorTickColor( COLORREF color ) { m_crMinorTickColor=color; }
inline bool IsShowMajorTicks() { return m_bShowMajorTicks; }
inline void SetShowMajorTicks( bool show ) { m_bShowMajorTicks=show; }
inline bool IsShowMinorTicks() { return m_bShowMinorTicks; }
inline void SetShowMinorTicks( bool show ) { m_bShowMinorTicks=show; }
inline bool IsTickLabelSEOnly() { return m_bTickLabelSEOnly; }
inline void SetTickLabelSEOnly( bool se ) { m_bTickLabelSEOnly = se; }
inline int GetAxisGap() { return m_nAxisGap; }
inline void SetAxisGap(int gap) { m_nAxisGap = gap; }
inline int GetLabelGap() { return m_nLabelGap; }
inline void SetLabelGap(int gap) { m_nLabelGap = gap; }
inline bool IsDespiteLow() { return m_bDespiteLow; }
inline void SetDespiteLow( bool des ) { m_bDespiteLow = des; }
inline bool IsDespiteHigh() { return m_bDespiteHigh; }
inline void SetDespiteHigh( bool des ) { m_bDespiteHigh = des; }
inline bool IsMapAlternateMode() { return m_bMapAlternateMode; }
inline void SetMapAlternateMode( bool mode ) { m_bMapAlternateMode = mode; }
inline double GetMapAlternateStartVal() { return m_fMapAlternateStartVal; }
inline void SetMapAlternateStartVal(double val) { m_fMapAlternateStartVal = val; }
void SetAlternateMap(int nVal, tstring strVal);
tstring GetAlternateMap(int nVal);
inline int GetBrushType( void ){ return m_nBrushType; }
inline void SetBrushType( int type ){ m_nBrushType = type; }
inline COLORREF GetBgColor( void ){ return m_crBgColor; }
inline void SetBgColor( COLORREF color ){ m_crBgColor = color; }
inline int GetHatchStyle( void ){ return m_nHatchStyle; }
inline void SetHatchStyle( int style ){ m_nHatchStyle = style; }
inline COLORREF GetHatchColor( void ){ return m_crHatchColor; }
inline void SetHatchColor( COLORREF color ){ m_crHatchColor = color; }
inline HBITMAP GetPattern( void ){ return m_hPattern; }
inline void SetPattern( HBITMAP pattern ){ if(m_hPattern)DeleteObject(m_hPattern); m_hPattern = CopyHBitmap(pattern); }
inline bool IsBorderShow( void ){ return m_bBorderShow; }
inline void SetBorderShow( bool show ){ m_bBorderShow = show; }
inline int GetBorderSize( void ){ return m_nBorderSize; }
inline void SetBorderSize( int size ){ m_nBorderSize = size; }
inline bool IsArrowStart( void ) { return m_bArrowStart; }
inline void SetArrowStart( bool arrow ) { m_bArrowStart = arrow; }
inline bool IsArrowEnd( void ) { return m_bArrowEnd; }
inline void SetArrowEnd( bool arrow ) { m_bArrowEnd = arrow; }
inline int GetArrowSize( void ) { return m_nArrowSize; }
inline void SetArrowSize( int size ) { m_nArrowSize = size; }
inline int GetArrowRatio( void ) { return m_nArrowRatio; }
inline void SetArrowRatio( int ratio ) { m_nArrowRatio = ratio; }
inline bool IsArrowFlatBottom( void ) { return m_bArrowFlatBottom; }
inline void SetArrowFlatBottom( bool flat ) { m_bArrowFlatBottom = flat; }
inline bool IsArrowReverse( void ) { return m_bArrowReverse; }
inline void SetArrowReverse( bool reverse ) { m_bArrowReverse = reverse; }
inline bool IsVisible( void ) { return m_bVisible; }
inline void SetVisible( bool visible ) { m_bVisible=visible; }
inline bool IsShowAxisLine( void ) { return m_bShowAxisLine; }
inline void SetShowAxisLine( bool show ) { m_bShowAxisLine = show; }
inline bool IsShowTitle( void ) { return m_bShowTitle; }
inline void SetShowTitle( bool show ) { m_bShowTitle=show; }
inline tstring GetTitle() { return m_strTitle; }
inline void SetTitle( tstring title ) { m_strTitle = title; }
inline LOGFONT &GetTitleFont() { return m_lfTitleFont; }
inline void SetTitleFont( LOGFONT font) { m_lfTitleFont=font; }
inline LOGFONT &GetLabelFont() { return m_lfLabelFont; }
inline void SetLabelFont( LOGFONT font) { m_lfLabelFont=font; }
inline COLORREF GetTitleColor( void ) { return m_crTitleColor; }
inline void SetTitleColor( COLORREF color ) {m_crTitleColor = color; }
inline bool IsShowTitleRect( void ) { return m_bShowTitleRect; }
inline void SetShowTitleRect( bool show ) { m_bShowTitleRect = show; }
inline int GetTitleRectLineSize( void ) { return m_nTitleRectLineSize; }
inline void SetTitleRectLineSize( int linesize ) { m_nTitleRectLineSize = linesize; }
inline int GetTitleRectLineStyle( void ) { return m_nTitleRectLineStyle; }
inline void SetTitleRectLineStyle( int style ) { m_nTitleRectLineStyle = style; }
inline COLORREF GetTickLabelColor( void ) { return m_crTickLabelColor; }
inline void SetTickLabelColor( COLORREF color ) { m_crTickLabelColor=color; }
inline bool IsTickLabelShow( void ) { return m_bTickLabelShow; }
inline void SetTickLabelShow( bool show ) { m_bTickLabelShow=show; }
inline int GetTitleGap( void ) { return m_nTitleGap; }
inline void SetTitleGap( int gap ) { m_nTitleGap = gap; }
inline int GetMarginHorizontal( void ) { return m_nMarginHorizontal; }
inline void SetMarginHorizontal( int margin ) { m_nMarginHorizontal = margin; }
inline int GetMarginVertical( void ) { return m_nMarginHorizontal; }
inline void SetMarginVertical( int margin ) { m_nMarginHorizontal = margin; }
inline COLORREF GetAxisColor( void ) { return m_crAxisColor; }
inline void SetAxisColor( COLORREF color ) { m_crAxisColor = color; }
inline int GetLineSize( void ) { return m_nLineSize; }
inline void SetLineSize( int size ) { if( size > 0 ) m_nLineSize = size; }
inline int GetLineStyle( void ) { return m_nLineStyle; }
inline void SetLineStyle( int style ) { if( style > 0 ) m_nLineStyle = style; }
inline short GetLocation( void ) { return m_nLocation; }
inline void SetLocation( short location ) { m_nLocation = location; }
inline int GetTitlePosition( void ) { return m_nTitlePosition; }
inline void SetTitlePosition( int pos ) { m_nTitlePosition=pos; }
inline SIZE GetTitleOffset() { return m_sizeTitleOffset; }
inline void SetTitleOffset( SIZE offset ) { m_sizeTitleOffset=offset; }
inline SIZE GetLabelOffset() { return m_sizeLabelOffset; }
inline void SetLabelOffset( SIZE offset ) { m_sizeLabelOffset=offset; }
inline bool IsReplaceLabel() { return m_bReplaceLabel; }
inline void SetReplaceLabel( bool replace ) { m_bReplaceLabel = replace; }
inline tstring GetLabelSuffix() { return m_strLabelSuffix; }
inline void SetLabelSuffix(tstring suffix) { m_strLabelSuffix = suffix; }
inline tstring GetLabelPrefix() { return m_strLabelPrefix; }
inline void SetLabelPrefix(tstring prefix) { m_strLabelPrefix = prefix; }
inline tstring GetLabelFormat() { return m_strLabelFormat; }
inline void SetLabelFormat(tstring fmt) { m_strLabelFormat = fmt; }
inline bool IsLighted(){return m_bLighted;}
inline void SetLighted(bool cur){m_bLighted=cur;}
inline bool IsSelected(){return m_bSelected;}
inline void SetSelected(bool cur){m_bSelected=cur;}
inline bool IsSameColor(){return m_bSameColor;}
inline void SetSameColor(bool same){m_bSameColor=same;}
inline bool IsTime(){return m_bTime;}
inline void SetTime(bool time){m_bTime = time;}
inline tstring GetTimeFormat(){return m_strTimeFormat;}
inline void SetTimeFormat(tstring format){m_strTimeFormat = format;}
inline bool IsShowColorBar(){return m_bColorBar;}
inline void SetShowColorBar( bool crBar ){m_bColorBar = crBar;if(crBar){SetTickPosition(kTickPositionInner); SetMinorTickPosition(kTickPositionInner);} /*else{SetTickPosition(kTickPositionOuter); SetMinorTickPosition(kTickPositionOuter);}*/}
inline int GetColorBarWidth(){return m_nColorBarWidth;}
inline void SetColorBarWidth(int width){m_nColorBarWidth = width;}
inline COLORREF GetBarColor1( void ){ return m_crBarColor1; }
inline void SetBarColor1( COLORREF color ){ m_crBarColor1 = color; }
inline COLORREF GetBarColor2( void ){ return m_crBarColor2; }
inline void SetBarColor2( COLORREF color ){ m_crBarColor2 = color; }
inline int GetColorBarMarginOuter(){return m_nColorBarMarginOuter;}
inline void SetColorBarMarginOuter(int width){m_nColorBarMarginOuter = width;}
inline int GetColorBarMarginInner(){return m_nColorBarMarginInner;}
inline void SetColorBarMarginInner(int width){m_nColorBarMarginInner = width;}
inline bool IsMinusTicks(){return m_bMinusTicks;}
inline void SetMinusTicks( bool minus ){m_bMinusTicks = minus;}
inline bool IsTwoStoreyX(){return m_bTwoStoreyX;}
inline void SetTwoStroeyX(bool two){m_bTwoStoreyX = two;}
inline bool IsSciNotation(){return m_bSciNotation;}
inline void SetSciNotation( bool sn ){m_bSciNotation = sn;}
inline double GetSnFontRatio(){return m_fSnFontRatio;}
inline void SetSnFontRatio(double ratio){m_fSnFontRatio = ratio;}
inline bool IsYTitleVerticle(){return m_bYTitleVerticle;}
inline void SetYTitleVerticle(bool vert){m_bYTitleVerticle = vert;}
inline vector<tstring> &GetAlternateLabels() { return m_vstrAlternateLabels; }
inline map<int, tstring> &GetMapAlternateLabels() { return m_mapAlternateLabels; }
inline vector<DataRange> &GetRanges4LabelHiden(){ return m_vRanges4LabelHiden; }
inline void SetRanges4LabelHiden(vector<DataRange> vRanges){ m_vRanges4LabelHiden = vRanges; }
bool IsXAxis();
int GetApperanceMode();
void SetApperanceMode(int mode);
public:
tstring GetDescription();
static bool IsXAxis(int location);
protected:
void DeleteUsedHandles();
};
Declare_Namespace_End | [
"baita00@hotmail.com"
] | baita00@hotmail.com |
36d3cf29d2a618e03b8578017aae21e5dabfb4f3 | 1ae60d7cc65c8bed2c8ebe2bb90488585fb67e78 | /cpp/openScenarioLib/src/v1_2/catalog/CatalogCacheV1_2.cpp | fb98869413bfbc2ec2b43d17fbb4782571ad7382 | [
"Zlib",
"BSL-1.0",
"Apache-2.0",
"MIT",
"BSD-3-Clause"
] | permissive | RA-Consulting-GmbH/openscenario.api.test | af3e2f30f2567402d1a105cc8a85949959ca488c | 6c6d6c43764029033b35987d1b8d69cea3a873f0 | refs/heads/master | 2023-02-18T23:50:13.415340 | 2023-02-15T13:07:47 | 2023-02-15T13:07:47 | 276,599,487 | 37 | 9 | Apache-2.0 | 2023-02-15T13:48:00 | 2020-07-02T09:05:18 | C++ | UTF-8 | C++ | false | false | 9,205 | cpp | /*
* Copyright 2020 RA Consulting
*
* RA Consulting GmbH licenses this file under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "CatalogCacheV1_2.h"
namespace NET_ASAM_OPENSCENARIO
{
namespace v1_2
{
CatalogCache::CatalogCache(std::shared_ptr<IResourceLocator>& resourceLocator, std::shared_ptr<IParserMessageLogger>& messageLogger) : _resourceLocator(resourceLocator), _messageLogger(messageLogger) {}
void CatalogCache::AddCatalogFile(std::shared_ptr<IScenarioLoaderFactory> scenarioLoaderFactory)
{
_catalogFiles.push_back(scenarioLoaderFactory);
_isAnyCatalogToParse = true;
}
std::shared_ptr<ICatalogElement> CatalogCache::ImportCatalogElement(std::shared_ptr <ICatalogReference>& catalogReference)
{
std::shared_ptr<ICatalogElement> catalogElement = nullptr;
while (catalogElement == nullptr)
{
catalogElement = GetCatalogElementInternal(catalogReference);
if (catalogElement != nullptr || !_isAnyCatalogToParse) {
break;
}
else {
ParseNextCatalog();
}
}
return catalogElement;
}
void CatalogCache::ParseNextCatalog()
{
if (_currentLoaderFactoryIndex >= _catalogFiles.size())
{
_isAnyCatalogToParse = false;
return;
}
else
{
// Parse Catalog
auto scenarioLoaderFactory = _catalogFiles[_currentLoaderFactoryIndex++];
auto loader = scenarioLoaderFactory->CreateLoader(_resourceLocator);
std::shared_ptr<IOpenScenario> openScenario = nullptr;
bool isSuccessfullyParsed = true;
//auto messageLogger = std::make_shared<MessageLoggerDecorator>(_messageLogger);
try
{
openScenario = std::static_pointer_cast<IOpenScenario>(loader->Load(_messageLogger)->GetAdapter(typeid(IOpenScenario).name()));
}
catch (ScenarioLoaderException& e)
{
(void)e;
// Ignore
isSuccessfullyParsed = false;
}
if (isSuccessfullyParsed && _messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(ERROR).empty())
{
auto catalogDefinition = openScenario->GetOpenScenarioCategory()->GetCatalogDefinition();
if (catalogDefinition)
{
auto catalog = catalogDefinition->GetCatalog();
if (catalog)
{
// Does Controller already exists
const auto kCatalogName = catalog->GetName();
auto catalogMap = _catalogElements[kCatalogName];
auto controllers = catalog->GetControllers();
if (!controllers.empty())
{
for (auto&& controller : controllers)
{
auto name = controller->GetName();
if (!name.empty())
catalogMap.emplace(std::make_pair(name, controller));
}
_catalogElements[kCatalogName] = catalogMap;
}
auto vehicles = catalog->GetVehicles();
if (!vehicles.empty())
{
for (auto&& vehicle : vehicles)
{
auto name = vehicle->GetName();
if (!name.empty())
catalogMap.emplace(std::make_pair(name, vehicle));
}
_catalogElements[kCatalogName] = catalogMap;
}
auto miscObjects = catalog->GetMiscObjects();
if (!miscObjects.empty())
{
for (auto&& miscObject : miscObjects)
{
auto name = miscObject->GetName();
if (!name.empty())
catalogMap.emplace(std::make_pair(name, miscObject));
}
_catalogElements[kCatalogName] = catalogMap;
}
auto routes = catalog->GetRoutes();
if (!routes.empty())
{
for (auto&& route : routes)
{
auto name = route->GetName();
if (!name.empty())
catalogMap.emplace(std::make_pair(name, route));
}
_catalogElements[kCatalogName] = catalogMap;
}
auto environments = catalog->GetEnvironments();
if (!environments.empty())
{
for (auto&& environment : environments)
{
auto name = environment->GetName();
if (!name.empty())
catalogMap.emplace(std::make_pair(name, environment));
}
_catalogElements[kCatalogName] = catalogMap;
}
auto pedestrians = catalog->GetPedestrians();
if (!pedestrians.empty())
{
for (auto&& pedestrian : pedestrians)
{
auto name = pedestrian->GetName();
if (!name.empty())
catalogMap.emplace(std::make_pair(name, pedestrian));
}
_catalogElements[kCatalogName] = catalogMap;
}
auto trajectories = catalog->GetTrajectories();
if (!trajectories.empty())
{
for (auto&& trajectory : trajectories)
{
auto name = trajectory->GetName();
if (!name.empty())
catalogMap.emplace(std::make_pair(name, trajectory));
}
_catalogElements[kCatalogName] = catalogMap;
}
auto maneuvers = catalog->GetManeuvers();
if (!maneuvers.empty())
{
for (auto&& maneuver : maneuvers)
{
auto name = maneuver->GetName();
if (!name.empty())
catalogMap.emplace(std::make_pair(name, maneuver));
}
_catalogElements[kCatalogName] = catalogMap;
}
}
}
}
}
}
std::shared_ptr<ICatalogElement> CatalogCache::GetCatalogElementInternal(std::shared_ptr <ICatalogReference> catalogReference)
{
auto catalog = _catalogElements[catalogReference->GetCatalogName()];
if (!catalog.empty())
{
auto catalogElement = catalog[catalogReference->GetEntryName()];
if (catalogElement)
{
// Clone it for import
return std::dynamic_pointer_cast<ICatalogElement>(std::dynamic_pointer_cast<BaseImpl>(catalogElement)->Clone());
}
}
return nullptr;
}
};
}
| [
"a.hege@rac.de"
] | a.hege@rac.de |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.