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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0c360f376a880dcaf7d3bbcff5d276c8a2c9327f | e276303d11773362c146c4a6adbdc92d6dee9b3f | /Classes/Native/UnityEngine_UnityEngine_GUILayoutEntry3828586629.h | b985ac58554759c04eabceb0b867961cf861ea5b | [
"Apache-2.0"
] | permissive | AkishinoShiame/Virtual-Elderly-Chatbot-IOS-Project-IOS-12 | 45d1358bfc7c8b5c5b107b9d50a90b3357dedfe1 | a834966bdb705a2e71db67f9d6db55e7e60065aa | refs/heads/master | 2020-06-14T02:22:06.622907 | 2019-07-02T13:45:08 | 2019-07-02T13:45:08 | 194,865,711 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,233 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_Object2689449295.h"
#include "UnityEngine_UnityEngine_Rect3681755626.h"
// UnityEngine.GUIStyle
struct GUIStyle_t1799908754;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.GUILayoutEntry
struct GUILayoutEntry_t3828586629 : public Il2CppObject
{
public:
// System.Single UnityEngine.GUILayoutEntry::minWidth
float ___minWidth_0;
// System.Single UnityEngine.GUILayoutEntry::maxWidth
float ___maxWidth_1;
// System.Single UnityEngine.GUILayoutEntry::minHeight
float ___minHeight_2;
// System.Single UnityEngine.GUILayoutEntry::maxHeight
float ___maxHeight_3;
// UnityEngine.Rect UnityEngine.GUILayoutEntry::rect
Rect_t3681755626 ___rect_4;
// System.Int32 UnityEngine.GUILayoutEntry::stretchWidth
int32_t ___stretchWidth_5;
// System.Int32 UnityEngine.GUILayoutEntry::stretchHeight
int32_t ___stretchHeight_6;
// UnityEngine.GUIStyle UnityEngine.GUILayoutEntry::m_Style
GUIStyle_t1799908754 * ___m_Style_7;
public:
inline static int32_t get_offset_of_minWidth_0() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629, ___minWidth_0)); }
inline float get_minWidth_0() const { return ___minWidth_0; }
inline float* get_address_of_minWidth_0() { return &___minWidth_0; }
inline void set_minWidth_0(float value)
{
___minWidth_0 = value;
}
inline static int32_t get_offset_of_maxWidth_1() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629, ___maxWidth_1)); }
inline float get_maxWidth_1() const { return ___maxWidth_1; }
inline float* get_address_of_maxWidth_1() { return &___maxWidth_1; }
inline void set_maxWidth_1(float value)
{
___maxWidth_1 = value;
}
inline static int32_t get_offset_of_minHeight_2() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629, ___minHeight_2)); }
inline float get_minHeight_2() const { return ___minHeight_2; }
inline float* get_address_of_minHeight_2() { return &___minHeight_2; }
inline void set_minHeight_2(float value)
{
___minHeight_2 = value;
}
inline static int32_t get_offset_of_maxHeight_3() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629, ___maxHeight_3)); }
inline float get_maxHeight_3() const { return ___maxHeight_3; }
inline float* get_address_of_maxHeight_3() { return &___maxHeight_3; }
inline void set_maxHeight_3(float value)
{
___maxHeight_3 = value;
}
inline static int32_t get_offset_of_rect_4() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629, ___rect_4)); }
inline Rect_t3681755626 get_rect_4() const { return ___rect_4; }
inline Rect_t3681755626 * get_address_of_rect_4() { return &___rect_4; }
inline void set_rect_4(Rect_t3681755626 value)
{
___rect_4 = value;
}
inline static int32_t get_offset_of_stretchWidth_5() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629, ___stretchWidth_5)); }
inline int32_t get_stretchWidth_5() const { return ___stretchWidth_5; }
inline int32_t* get_address_of_stretchWidth_5() { return &___stretchWidth_5; }
inline void set_stretchWidth_5(int32_t value)
{
___stretchWidth_5 = value;
}
inline static int32_t get_offset_of_stretchHeight_6() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629, ___stretchHeight_6)); }
inline int32_t get_stretchHeight_6() const { return ___stretchHeight_6; }
inline int32_t* get_address_of_stretchHeight_6() { return &___stretchHeight_6; }
inline void set_stretchHeight_6(int32_t value)
{
___stretchHeight_6 = value;
}
inline static int32_t get_offset_of_m_Style_7() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629, ___m_Style_7)); }
inline GUIStyle_t1799908754 * get_m_Style_7() const { return ___m_Style_7; }
inline GUIStyle_t1799908754 ** get_address_of_m_Style_7() { return &___m_Style_7; }
inline void set_m_Style_7(GUIStyle_t1799908754 * value)
{
___m_Style_7 = value;
Il2CppCodeGenWriteBarrier(&___m_Style_7, value);
}
};
struct GUILayoutEntry_t3828586629_StaticFields
{
public:
// UnityEngine.Rect UnityEngine.GUILayoutEntry::kDummyRect
Rect_t3681755626 ___kDummyRect_8;
// System.Int32 UnityEngine.GUILayoutEntry::indent
int32_t ___indent_9;
public:
inline static int32_t get_offset_of_kDummyRect_8() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629_StaticFields, ___kDummyRect_8)); }
inline Rect_t3681755626 get_kDummyRect_8() const { return ___kDummyRect_8; }
inline Rect_t3681755626 * get_address_of_kDummyRect_8() { return &___kDummyRect_8; }
inline void set_kDummyRect_8(Rect_t3681755626 value)
{
___kDummyRect_8 = value;
}
inline static int32_t get_offset_of_indent_9() { return static_cast<int32_t>(offsetof(GUILayoutEntry_t3828586629_StaticFields, ___indent_9)); }
inline int32_t get_indent_9() const { return ___indent_9; }
inline int32_t* get_address_of_indent_9() { return &___indent_9; }
inline void set_indent_9(int32_t value)
{
___indent_9 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"akishinoshiame@icloud.com"
] | akishinoshiame@icloud.com |
13b796ce7fc92db8a5a26457d25d0b5c25ee8fa9 | c4bf03dff950e421eae66311bad4b9a6dd59973a | /core/modules/replica/WorkerDeleteRequest.h | aca632979934b9b950893b3baec802f46ae848e2 | [] | no_license | tsengj10/qserv | eee6a1b8de7db2a8eaf99e1bd17d4f008c9617bc | 97a6c2d206c5d8394d0355461674ae6ce5d449ab | refs/heads/master | 2021-06-18T06:00:34.424789 | 2018-08-22T00:16:59 | 2018-08-22T00:16:59 | 96,400,110 | 0 | 0 | null | 2017-07-06T07:13:54 | 2017-07-06T07:13:54 | null | UTF-8 | C++ | false | false | 6,661 | h | // -*- LSST-C++ -*-
/*
* LSST Data Management System
* Copyright 2017 LSST Corporation.
*
* This product includes software developed by the
* LSST Project (http://www.lsst.org/).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the LSST License Statement and
* the GNU General Public License along with this program. If not,
* see <http://www.lsstcorp.org/LegalNotices/>.
*/
#ifndef LSST_QSERV_REPLICA_WORKERDELETEREQUEST_H
#define LSST_QSERV_REPLICA_WORKERDELETEREQUEST_H
/// WorkerDeleteRequest.h declares:
///
/// class WorkerDeleteRequest
/// class WorkerDeleteRequestPOSIX
/// (see individual class documentation for more information)
// System headers
#include <string>
// Qserv headers
#include "proto/replication.pb.h"
#include "replica/ReplicaInfo.h"
#include "replica/WorkerRequest.h"
// This header declarations
namespace lsst {
namespace qserv {
namespace replica {
/**
* Class WorkerDeleteRequest represents a context and a state of replica deletion
* requsts within the worker servers. It can also be used for testing the framework
* operation as its implementation won't make any changes to any files or databases.
*
* Real implementations of the request processing must derive from this class.
*/
class WorkerDeleteRequest
: public WorkerRequest {
public:
/// Pointer to self
typedef std::shared_ptr<WorkerDeleteRequest> Ptr;
/**
* Static factory method is needed to prevent issue with the lifespan
* and memory management of instances created otherwise (as values or via
* low-level pointers).
*
* @param serviceProvider - a host of services for various communications
* @param worker - the name of a worker
* @param id - an identifier of a client request
* @param priority - indicates the importance of the request
* @param database - the name of a database
* @param chunk - the chunk number
*
* @return pointer to the created object
*/
static Ptr create(ServiceProvider::Ptr const& serviceProvider,
std::string const& worker,
std::string const& id,
int priority,
std::string const& database,
unsigned int chunk);
// Default construction and copy semantics are prohibited
WorkerDeleteRequest() = delete;
WorkerDeleteRequest(WorkerDeleteRequest const&) = delete;
WorkerDeleteRequest& operator=(WorkerDeleteRequest const&) = delete;
~WorkerDeleteRequest() override = default;
// Trivial accessors
std::string const& database() const { return _database; }
unsigned int chunk() const { return _chunk; }
/**
* Extract request status into the Protobuf response object.
*
* @param response - Protobuf response to be initialized
*/
void setInfo(proto::ReplicationResponseDelete& response) const;
/**
* @see WorkerRequest::execute
*/
bool execute() override;
protected:
/**
* The normal constructor of the class
*
* @see WorkerDeleteRequest::create()
*/
WorkerDeleteRequest(ServiceProvider::Ptr const& serviceProvider,
std::string const& worker,
std::string const& id,
int priority,
std::string const& database,
unsigned int chunk);
protected:
std::string _database;
unsigned int _chunk;
/// Extended status of the replica deletion request
ReplicaInfo _replicaInfo;
};
/**
* Class WorkerDeleteRequestPOSIX provides an actual implementation for
* the replica deletion based on the direct manipulation of files on
* a POSIX file system.
*/
class WorkerDeleteRequestPOSIX
: public WorkerDeleteRequest {
public:
/// Pointer to self
typedef std::shared_ptr<WorkerDeleteRequestPOSIX> Ptr;
/**
* Static factory method is needed to prevent issue with the lifespan
* and memory management of instances created otherwise (as values or via
* low-level pointers).
*
* @param serviceProvider - a host of services for various communications
* @param worker - the name of a source worker
* @param id - an identifier of a client request
* @param priority - indicates the importance of the request
* @param database - the name of a database
* @param chunk - the chunk number
*
* @return pointer to the created object
*/
static Ptr create(ServiceProvider::Ptr const& serviceProvider,
std::string const& worker,
std::string const& id,
int priority,
std::string const& database,
unsigned int chunk);
// Default construction and copy semantics are prohibited
WorkerDeleteRequestPOSIX() = delete;
WorkerDeleteRequestPOSIX(WorkerDeleteRequestPOSIX const&) = delete;
WorkerDeleteRequestPOSIX& operator=(WorkerDeleteRequestPOSIX const&) = delete;
~WorkerDeleteRequestPOSIX() override = default;
/**
* @see WorkerDeleteRequest::execute()
*/
bool execute() override;
private:
/**
* The normal constructor of the class
*
* @see WorkerDeleteRequestPOSIX::create()
*/
WorkerDeleteRequestPOSIX(ServiceProvider::Ptr const& serviceProvider,
std::string const& worker,
std::string const& id,
int priority,
std::string const& database,
unsigned int chunk);
};
/**
* Class WorkerDeleteRequestFS provides an actual implementation for
* the replica deletion based on the direct manipulation of files on
* a POSIX file system.
*
* Note, this is just a typedef to class WorkerDeleteRequestPOSIX.
*/
typedef WorkerDeleteRequestPOSIX WorkerDeleteRequestFS;
}}} // namespace lsst::qserv::replica
#endif // LSST_QSERV_REPLICA_WORKERDELETEREQUEST_H
| [
"gapon@slac.stanford.edu"
] | gapon@slac.stanford.edu |
59179eeea40dc5b4f5eff9d54d2be83252bbf9a2 | 4268e27c511b193f2e977a4ef96a1225d0ab5692 | /src/dsatur.h | 56ef40f732aac69bfa28baa399a748a350004ca4 | [] | no_license | JulioScholz/DSATUR-algorithm | 57d72770b2fc0cb123020367f1557685612e5d86 | 729e4a230fd0280b68f591446be98fdafd036807 | refs/heads/master | 2020-07-21T12:34:05.591859 | 2019-09-06T20:25:26 | 2019-09-06T20:25:26 | 206,865,904 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 71 | h | #pragma once
class dsatur
{
public:
dsatur();
~dsatur();
};
| [
"noreply@github.com"
] | noreply@github.com |
d1d339bfcd2b49af4457a7762444029799f3bb6b | d900eaef32972ada6e49a7ff3e58c98f2d55c9fb | /Project/RRMProjectR/RRMProject/DropShot.cpp | 01bf7055888caf38c52cacd687dd1a5b25d90ea9 | [] | no_license | hanakita114514/RRMProject | 97a1973aa2f1cb305cf602e3bf93952a24e72acd | bcc366c6479752417858fd6be5fe02aa920bd15d | refs/heads/master | 2021-01-21T19:13:16.861695 | 2017-10-06T04:28:14 | 2017-10-06T04:28:14 | 92,117,623 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 452 | cpp | #include "DropShot.h"
#include "BulletManager.h"
DropShot::DropShot()
{
_bulletNum = 5;
}
DropShot::~DropShot()
{
}
void
DropShot::Create(Vector2 vec, Vector2 pos, Object* owner)
{
_vec = vec;
_vec.y -= _bulletNum;
BulletManager::Instance().Create(BulletType::dropBullet, pos, _vec, owner->GetObjType(), Vector2(0, 0), owner);
_bulletNum--;
if (_bulletNum >= 0)
{
Create(vec,pos,owner);
}
_bulletNum = 5;
}
| [
"tozica18@gmail.com"
] | tozica18@gmail.com |
53a144e89d5b39fad544154293730a1544648ef5 | 9471e34c60a9e0e3571ff4c03d49dd93544b3f0c | /OSGReadLas/OSGReadLas/GraphicsWindowQt.h | f7984993a63ba9549f1a184701b0a07a04e522f3 | [
"MIT"
] | permissive | eglrp/OSGReadLas | 3b4dcff41d5040f9d2a1378297e692892b364aa9 | f98663e9a4c312682632d019924d4ddb5978754e | refs/heads/master | 2020-04-17T13:33:36.418647 | 2018-12-04T05:38:03 | 2018-12-04T05:38:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,365 | h | #ifndef OSGVIEWER_GRAPHICSWINDOWQT
#define OSGVIEWER_GRAPHICSWINDOWQT
#include <QGLWidget>
#include <QtGui/QInputEvent>
#include <QtOpenGL/QGLWidget>
#include <osgViewer/GraphicsWindow>
class GraphWidget : public QGLWidget
{
public:
GraphWidget(const QGLFormat& format, QWidget* parent = 0, const QGLWidget* shareWidget = 0, Qt::WindowFlags f = 0);
inline void setGraphicsWindow(osgViewer::GraphicsWindow* gw) { _gw = gw; }
void setKeyboardModifiers(QInputEvent* event);
virtual void resizeEvent(QResizeEvent* event);
virtual void keyPressEvent(QKeyEvent* event);
virtual void keyReleaseEvent(QKeyEvent* event);
virtual void mousePressEvent(QMouseEvent* event);
virtual void mouseReleaseEvent(QMouseEvent* event);
virtual void mouseDoubleClickEvent(QMouseEvent* event);
virtual void mouseMoveEvent(QMouseEvent* event);
virtual void wheelEvent(QWheelEvent* event);
protected:
osgViewer::GraphicsWindow* _gw;
};
class GraphicsWindowQt : public osgViewer::GraphicsWindow
{
public:
GraphicsWindowQt(osg::GraphicsContext::Traits* traits);
virtual ~GraphicsWindowQt();
inline GraphWidget* getGraphWidget() { return _widget; }
inline const GraphWidget* getGraphWidget() const { return _widget; }
struct WindowData : public osg::Referenced
{
WindowData(GraphWidget* widget) : _widget(widget) {}
GraphWidget* _widget;
};
bool init();
virtual bool setWindowRectangleImplementation(int x, int y, int width, int height);
virtual void getWindowRectangle(int& x, int& y, int& width, int& height);
virtual bool setWindowDecorationImplementation(bool windowDecoration);
virtual bool getWindowDecoration() const;
virtual void grabFocus();
virtual void grabFocusIfPointerInWindow();
virtual void raiseWindow();
virtual void setWindowName(const std::string& name);
virtual std::string getWindowName();
virtual void useCursor(bool cursorOn);
virtual void setCursor(MouseCursor cursor);
virtual bool valid() const;
virtual bool realizeImplementation();
virtual bool isRealizedImplementation() const;
virtual void closeImplementation();
virtual bool makeCurrentImplementation();
virtual bool releaseContextImplementation();
virtual void swapBuffersImplementation();
virtual void requestWarpPointer(float x, float y);
protected:
GraphWidget* _widget;
QCursor _currentCursor;
bool _initialized;
bool _realized;
};
#endif | [
"sxddup@gmail.com"
] | sxddup@gmail.com |
ac04e32946ad2818eb75e22dacbd6de03f961fc6 | b18f02b27db69065ffb2f030dca1e655cd34179c | /tests/json.cc | 71e0f507788946196bea5b5db94cd10e69036880 | [
"MIT"
] | permissive | subailong/iod | 5c1779563708299d08928131737899e46eb93984 | e993a19e8cb4b0470cdfe283e93292ed822786a2 | refs/heads/master | 2021-01-21T02:45:47.206274 | 2015-01-04T15:17:08 | 2015-01-04T15:17:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,673 | cc | #include <iostream>
#include <cassert>
#include <iod/foreach.hh>
#include <iod/sio_utils.hh>
#include <iod/sio.hh>
#include <iod/json.hh>
#include <iod/symbol.hh>
#include "symbols.hh"
int main()
{
using namespace iod;
using namespace s;
{
auto o = D(_Name = "John", _Age = 12, _Children = { 1,2,3,4,5 }, _City = D(_Name = "Paris"));
auto str = json_encode(o);
decltype(o) p;
json_decode(p, str);
assert(str == R"json({"name":"John","age":12,"children":[1,2,3,4,5],"city":{"name":"Paris"}})json");
assert(json_encode(p) == str);
auto s = R"json({"name":"John","age":12, "children":[1,2,3,4,5],"city":{"name":"Paris"}})json";
json_decode(p, s);
}
{
auto o = D(
_Name(_Optional, _Json_key = _My_json_name) = std::string("xxxx")
);
std::cout << json_encode(o) << std::endl;
}
{ // UTF 8
auto o = D(_Name = std::string());
auto s = R"json({"name":"\u00E2\u82AC\u00E2\u82AC\u00E2\u82AC\u00E2\u82AC\u00E2\u82AC"})json";
json_decode(o, s);
assert(o.name.size() == 15 and o.name == "€€€€€");
}
{
typedef decltype(D(_Name(_Json_key = _Username) = std::string(),
_Age(_Json_skip) = int(),
_City = std::string())) User;
User u("John", 23, "NYC");
auto str = json_encode(u);
assert(str == R"({"username":"John","city":"NYC"})");
std::cout << str << std::endl;
User u2;
json_decode(u2, str);
assert(u2.name == "John" and u2.city == "NYC");
// Type missmatch: json_decode(u2, R"({"username":"John","city":22})");
// Missing field: json_decode(u2, R"({"username":"John"})");
}
}
| [
"matthieu.garrigues@gmail.com"
] | matthieu.garrigues@gmail.com |
3e9190310d1c00bb3cd620da4cc20b03423da5ab | f0b7bcc41298354b471a72a7eeafe349aa8655bf | /codebase/apps/mdv_utils/src/Mdv2Grib/Args.hh | b7cc8c56ee0598f664cb7fae02de723e1fbd2e23 | [
"BSD-3-Clause"
] | permissive | NCAR/lrose-core | 23abeb4e4f1b287725dc659fb566a293aba70069 | be0d059240ca442883ae2993b6aa112011755688 | refs/heads/master | 2023-09-01T04:01:36.030960 | 2023-08-25T00:41:16 | 2023-08-25T00:41:16 | 51,408,988 | 90 | 53 | NOASSERTION | 2023-08-18T21:59:40 | 2016-02-09T23:36:25 | C++ | UTF-8 | C++ | false | false | 3,122 | hh | // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
// ** Copyright UCAR (c) 1990 - 2016
// ** University Corporation for Atmospheric Research (UCAR)
// ** National Center for Atmospheric Research (NCAR)
// ** Boulder, Colorado, USA
// ** BSD licence applies - redistribution and use in source and binary
// ** forms, with or without modification, are permitted provided that
// ** the following conditions are met:
// ** 1) If the software is modified to produce derivative works,
// ** such modified software should be clearly marked, so as not
// ** to confuse it with the version available from UCAR.
// ** 2) Redistributions of source code must retain the above copyright
// ** notice, this list of conditions and the following disclaimer.
// ** 3) 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.
// ** 4) Neither the name of UCAR nor the names of its contributors,
// ** if any, may be used to endorse or promote products derived from
// ** this software without specific prior written permission.
// ** DISCLAIMER: THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS
// ** OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
// ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
/* RCS info
* $Author: dixon $
* $Locker: $
* $Date: 2016/03/04 02:22:09 $
* $Id: Args.hh,v 1.5 2016/03/04 02:22:09 dixon Exp $
* $Revision: 1.5 $
* $State: Exp $
*/
/**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**/
/************************************************************************
* Args.hh : header file for the Args class.
*
* RAP, NCAR, Boulder CO
*
* October 2003
*
* Nancy Rehak
*
************************************************************************/
#ifndef Args_HH
#define Args_HH
#include <stdio.h>
#include <string>
#include <vector>
#include <time.h>
#include <tdrp/tdrp.h>
using namespace std;
class Args
{
public:
// Constructor
Args(int argc, char **argv, char *prog_name);
// Destructor
~Args(void);
// TDRP overrides specified in the command line arguments.
tdrp_override_t override;
char *additional_tdrp_file;
////////////////////
// Access methods //
////////////////////
const vector<string>& getInputFileList(void) const
{
return _inputFileList;
}
private:
// The program name for error messages
string _progName;
vector<string> _inputFileList;
// Print the usage for this program.
void _usage(FILE *stream);
};
#endif
| [
"dixon@ucar.edu"
] | dixon@ucar.edu |
8a58a8136ea6336d8e5b9e65d0d527c10701dcab | 5a87c03a0f1dc6cf383fcc636e36de9e2d162f05 | /src/game/command/RenderBoardCommand.cpp | 5531e18334bb060a7fa5e72a9aecd9d869b59dc4 | [] | no_license | zoreslavs/Match-3 | 0aef0895974f5a999723a2dfaecf0963ddc32b57 | 71bfaf90148d2b757eca901b43ac5cd50df5a4ae | refs/heads/master | 2022-12-24T19:09:37.203355 | 2020-09-22T09:25:24 | 2020-09-22T09:25:24 | 297,590,388 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 988 | cpp | #include <array>
#include <utility>
#include "RenderBoardCommand.h"
RenderBoardCommand::RenderBoardCommand(King::Engine* engine,
TILES_ARRAY& tiles,
GEMS_ARRAY& gems)
: mEngine(engine)
, mTiles(tiles)
, mGems(gems)
{
}
bool RenderBoardCommand::Execute()
{
RenderTiles();
RenderGems();
return true;
}
bool RenderBoardCommand::UnExecute()
{
return true;
}
void RenderBoardCommand::RenderTiles()
{
for (size_t i = 0; i < Config::BOARD_HEIGHT; i++)
{
for (size_t j = 0; j < Config::BOARD_WIDTH; j++)
{
Tile* tile = mTiles[i][j];
mEngine->Render(tile->GetTexture(), tile->GetPositionX(), tile->GetPositionY());
}
}
}
void RenderBoardCommand::RenderGems()
{
for (size_t i = 0; i < Config::BOARD_HEIGHT; i++)
{
for (size_t j = 0; j < Config::BOARD_WIDTH; j++)
{
Gem* gem = mGems[i][j];
TEXTURE texture = (gem->IsSelected()) ? gem->GetActiveTexture() : gem->GetTexture();
mEngine->Render(texture, gem->GetPositionX(), gem->GetPositionY());
}
}
}
| [
"zoreslav.slobodyan@gmail.com"
] | zoreslav.slobodyan@gmail.com |
f8d83126477411e826f18ed011224ca52aca22c2 | f57fc2f9dc34517465ff89c5cb818e082d44531e | /binderoo_host/cpp/interface/binderoo/boundobject.h | 7ec5733fecd7f703af422746f3ba8f1a3454e0b1 | [] | no_license | Remedy-Entertainment/binderoo | f902d2a1a26d8b294d2badf7950a8010bfe6a799 | db3f40ec8ff2485b8b8c64ad6bf2c3cf7ab1e74f | refs/heads/master | 2020-05-22T01:12:33.584118 | 2017-07-17T10:48:46 | 2017-07-17T10:48:46 | 65,556,608 | 55 | 6 | null | 2016-09-12T07:56:16 | 2016-08-12T13:48:55 | C++ | UTF-8 | C++ | false | false | 3,184 | h | /*
Binderoo
Copyright (c) 2016, Remedy Entertainment
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.
* Neither the name of the copyright holder (Remedy Entertainment) nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL REMEDY ENTERTAINMENT BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//----------------------------------------------------------------------------
#pragma once
#if !defined( _BINDEROO_BOUNDOBJECT_H_ )
#define _BINDEROO_BOUNDOBJECT_H_
//----------------------------------------------------------------------------
#include "binderoo/defs.h"
#include "binderoo/slice.h"
//----------------------------------------------------------------------------
namespace binderoo
{
typedef void* ( BIND_C_CALL *BoundObjectAllocator ) ( size_t uCount );
typedef void ( BIND_C_CALL *BoundObjectDeallocator ) ( void* pObject );
typedef void* ( BIND_C_CALL *BoundObjectThunk ) ( void* pObject );
typedef const char* ( BIND_C_CALL *BoundObjectSerialise ) ( void* pObject );
typedef void ( BIND_C_CALL *BoundObjectDeserialise ) ( void* pObject, const char* pJSONRepresentation );
//------------------------------------------------------------------------
struct BoundObject
{
enum class Type : int
{
Undefined = 0,
Value,
Reference,
Max,
Min = 0
};
//--------------------------------------------------------------------
DString strFullyQualifiedName;
uint64_t uFullyQualifiedNameHash;
BoundObjectAllocator alloc;
BoundObjectDeallocator free;
BoundObjectThunk thunk;
BoundObjectSerialise serialise;
BoundObjectDeserialise deserialise;
Type eType;
};
//------------------------------------------------------------------------
}
//----------------------------------------------------------------------------
#endif // !defined( _BINDEROO_BOUNDOBJECT_H_ )
//============================================================================
| [
"gooberman@gmail.com"
] | gooberman@gmail.com |
954508bb3dfdf607a6dcfa6b62607bad6c70530f | fd20ba3e0316e84d67b394cc96862590a2a82f33 | /prng.h | f22ec285593fbdc8cce71aff7908be42e66164ec | [] | no_license | YipengJi/ChamberCrawler3000 | ff2e56f1e559ea7a8a086b48007c097c44c8cd27 | ee938b385656433d4e516381cb577adba77ecb6a | refs/heads/master | 2021-09-04T01:16:10.686699 | 2018-01-13T22:58:35 | 2018-01-13T22:58:35 | 117,382,297 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,019 | h | #ifndef PRNG_H_
#define PRNG_H_
namespace game {
class PRNG {
private:
uint32_t seed_; // same results on 32/64-bit architectures
public:
PRNG( uint32_t s = 362436069 ) {
seed_ = s; // set seed
assert( ((void)"invalid seed", seed_ != 0) );
}
uint32_t seed() { // read seed
return seed_;
}
void seed( uint32_t s ) { // reset seed
seed_ = s; // set seed
assert( ((void)"invalid seed", seed_ != 0) );
}
uint32_t operator()() { // [0,UINT_MAX]
seed_ = 36969 * (seed_ & 65535) + (seed_ >> 16); // scramble bits
return seed_;
}
uint32_t operator()( uint32_t u ) { // [0,u]
assert( ((void)"invalid random range", u < (uint32_t)-1) );
return operator()() % (u + 1); // call operator()()
}
uint32_t operator()( uint32_t l, uint32_t u ) { // [l,u]
assert( ((void)"invalid random range", l <= u) );
return operator()( u - l ) + l; // call operator()( uint32_t )
}
};
} //namespace game
#endif //PRNG_H_
| [
"jypenny.lovegood@hotmail.com"
] | jypenny.lovegood@hotmail.com |
36f5fc4dd04e514640bb1b7fe6b6c6da18224f95 | 6a66c5960cb500040241be6b04fea4b9230781d9 | /tensorflow/compiler/aot/ex2/use_graph.cc | 14b2d76881ae0936f101e1e7d78892ec22609c75 | [
"Apache-2.0"
] | permissive | willxujun/tensorflow | 7a97cdc21fd707390840a79d20d49e800a8b8f4f | 5c31a9c4a8aa94d2f41c60880bb3ca699c23328c | refs/heads/r1.12 | 2022-10-15T07:36:07.513897 | 2019-05-24T03:06:50 | 2019-05-24T03:06:50 | 187,225,583 | 0 | 0 | Apache-2.0 | 2022-10-04T23:50:45 | 2019-05-17T13:57:07 | C++ | UTF-8 | C++ | false | false | 663 | cc | #include <iostream>
#include "tensorflow/compiler/aot/ex/test_graph.h"
using namespace std;
int main() {
MatMulAndAddComp compute;
const float args[8] = {1, 2, 3, 4, 5, 6, 7, 8};
std::copy(args + 0, args + 4, compute.arg0_data());
std::copy(args + 4, args + 8, compute.arg1_data());
compute.Run();
const MatMulAndAddComp& compute_const = compute;
for(int i=0; i<4;i++) {
cout << compute_const.arg0(i/2, i%2) << " " << args[i] << endl;
}
for(int i=0; i<4;i++) {
cout << compute_const.result0(i/2, i%2) << " ";
cout << compute_const.result1(i/2, i%2) << endl;
}
return 0;
}
| [
""
] | |
94e16fd43f86bee0140e59e213d29af9009becd0 | 2750ea1414cdb68530242b70a5b303046468e150 | /OOP Lab/Lab2/4.cpp | 1dff9c4752cc45ae036037badcc12b81fce6a2f3 | [
"MIT"
] | permissive | shashikant-sk/Jab-sab-aapki-le-rahe-ho-tab-aap-bhi-kuch-lelo | 98725d680c7c73099fe42c79debb998693571360 | 9ce333be44081d09e88418572a89770db1d10a50 | refs/heads/main | 2023-07-22T12:17:22.808977 | 2021-09-09T11:31:38 | 2021-09-09T11:31:38 | 405,102,343 | 4 | 0 | MIT | 2021-09-10T14:08:12 | 2021-09-10T14:08:11 | null | UTF-8 | C++ | false | false | 735 | cpp | // Write a program to find out area or volume of an shape/object by using one function name as
// FUN-AREA only. If the function takes one argumnet then it will calculate area of a circle, two
// argument for area of rectangle and three argumnet volume of a box. If no argumnet is given to
// the function, then it will display appropriate message.
#include<bits/stdc++.h>
#define pi 3.141
using namespace std;
float area(float r){
return pi*r*r;
}
float area(float l,float b){
return l*b;
}
float area(float l,float b,float h){
return l*b*h;
}
int main(){
cout<<"Area of circle = "<<area(2)<<"\n";
cout<<"Area of rectangle = "<<area(1,2)<<"\n";
cout<<"Volume of box = "<<area(1,2,3)<<"\n";
return 0;
} | [
"64223974+HANS-2002@users.noreply.github.com"
] | 64223974+HANS-2002@users.noreply.github.com |
652c1dd6a783eefde3ac77d7cc7ab04c81f4f19b | a16f8d76f3f376ae63461b11ff588182b14b3f49 | /tests/gtests/test_df1b2_init_number_vector.cpp | 08099716085d3ceb62388e9aa4bd5c5dfb015db2 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | admb-project/admb | 2782c74ed8d49c73e9735f8e0ce95f01d581bf2e | f6b42b0846da23f35c6ffbd28e42ec3cc2f306f0 | refs/heads/main | 2023-08-19T04:23:21.572292 | 2023-08-08T20:34:10 | 2023-08-08T20:34:10 | 29,162,042 | 90 | 24 | NOASSERTION | 2023-08-07T19:17:15 | 2015-01-12T23:14:31 | C++ | UTF-8 | C++ | false | false | 290 | cpp | #include <gtest/gtest.h>
#include "df1b2fun.h"
class test_df1b2_init_number_vector: public ::testing::Test {};
TEST_F(test_df1b2_init_number_vector, constructor)
{
df1b2_init_number_vector v;
ASSERT_FALSE(v.allocated());
ASSERT_EQ(0, v.indexmin());
ASSERT_EQ(-1, v.indexmax());
}
| [
"johnoel@admb-project.org"
] | johnoel@admb-project.org |
a90a1eee00dcfcaaabd22b3dd7f367e297907965 | 536d38e131e53adb381d7308e3929abe4896b037 | /src/mailmessage.cpp | 369f8ca2b32eb0aecffd37aaccff498aa9031654 | [] | no_license | tylermchenry/email_archiver | 7d22bbb9c225cbda45b15d5dc007a3d91d882eda | 2194595a256ea97b279c03f55365c3f9207f4efa | refs/heads/master | 2021-01-25T06:06:11.820783 | 2010-03-31T03:29:06 | 2010-03-31T03:29:06 | 539,970 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,488 | cpp | /*
* mailmessage.cpp
* Part of email_archiver
*
* Created on: Mar 1, 2010
* Author: Tyler McHenry <tyler@nerdland.net>
*/
#include "mailmessage.h"
#include <QTextStream>
MailMessage MailMessage::parseRFC2822(const std::vector<QString>& lines)
{
MailMessage message;
bool finishedHeaders = false;
std::multimap<QString, QString>::iterator prevHeader = message.headers.end();
for (std::vector<QString>::const_iterator i = lines.begin();
i != lines.end(); ++i)
{
if (!finishedHeaders) {
if (i->length() == 0) {
finishedHeaders = true;
} else {
if ((*i)[0] == ' ' || (*i)[0] == '\t') {
// Continuation of previous header; collapse leading whitespace
int begin_pos = 0;
// QString doesn't have an equivalent to find_first_not_of?
while (begin_pos < i->length() &&
((*i)[begin_pos] == ' ' || (*i)[begin_pos] == '\t'))
{
++begin_pos;
}
if (begin_pos < i->length()) {
if (prevHeader != message.headers.end()) {
prevHeader->second.append(" " + i->right(i->size() - begin_pos));
}
}
} else {
int delimiter_pos = i->indexOf(':');
// New header
QString field = i->left(delimiter_pos).toLower();
QString value = i->right(i->size() - delimiter_pos - 1);
prevHeader = message.headers.insert
(std::map<QString, QString>::value_type(field, value));
}
}
}
if (finishedHeaders) {
if (!message.body.empty() || i->length() > 0) {
message.body.push_back(*i);
}
}
}
return message;
}
MailMessage MailMessage::parseRFC2822(QString message)
{
QTextStream stream(&message);
std::vector<QString> lines;
QString line;
while (!(line = stream.readLine()).isNull())
{
lines.push_back(line);
}
return parseRFC2822(lines);
}
MailMessage::MailMessage()
{
}
MailMessage::~MailMessage()
{
}
std::vector<QString> MailMessage::getMultiHeader(const QString& field) const
{
std::vector<QString> mHeader;
std::pair<std::multimap<QString,QString>::const_iterator,
std::multimap<QString,QString>::const_iterator> range =
headers.equal_range(field.toLower());
for(std::multimap<QString,QString>::const_iterator i = range.first;
i != range.second; ++i)
{
mHeader.push_back(i->second);
}
return mHeader;
}
| [
"tyler@nerdland.net"
] | tyler@nerdland.net |
a5ef27ae6d6f80858797fddf8886531b4889a9d3 | be511a29cbcc6ad49d12805430547219d9785b17 | /spider0/receptorIR.h | bbd3e8cd931278883bec707a2cd02ed8c6f52f1d | [] | no_license | farinajf/arduinolab | b09436ddb09e0a5b2039234fc1392679108353fc | eb8014893b593efe8b1ce9494a16ce5431790b8b | refs/heads/master | 2021-12-08T09:53:03.522750 | 2021-09-29T19:40:52 | 2021-09-29T19:40:52 | 202,996,886 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 912 | h | #ifndef RECEPTOR_IR_H
#define RECEPTOR_IR_H
#include "globals.h"
//#include <IRremote.h>
namespace SPIDER {
enum CodigoIR {
IR_OK,
IR_UP,
IR_DOWN,
IR_LEFT,
IR_RIGHT,
IR_ASTERISK,
IR_HASH,
IR_T_0,
IR_T_1,
IR_T_2,
IR_T_3,
IR_T_4,
IR_T_5,
IR_T_6,
IR_T_7,
IR_T_8,
IR_T_9,
IR_CODE_REPEAT,
IR_NONE
};
/**
*
*/
class ReceptorIR {
private:
// const IRrecv _receiver;
CodigoIR _lastResult = IR_NONE;
// void _encoding (const decode_results *results) const;
// void _ircode (const decode_results *results) const;
// void _dumpInfo (const decode_results *results) const;
// CodigoIR _getResultado(const decode_results *results) const;
public:
// ReceptorIR() : _receiver(PIN_IR_RECEIVER) {}
void init();
CodigoIR receive();
};
}
#endif
| [
"farinajf@gmail.com"
] | farinajf@gmail.com |
8f10daf80e10e15223dff5f25369b6d04cb56986 | b5d246e43dcbd416dcabb5775cad76f366f121ea | /ui/accessibility/platform/ax_platform_node_auralinux.cc | a4554aaac2565494a94ce12f36a8fe1d71208954 | [
"BSD-3-Clause"
] | permissive | asdlei99/reeeemium | 75cfcd6ef94cae81486729e76f3799cdc8220afc | 141c44878719abda46b87601cc32301d447b8e5f | refs/heads/master | 2023-06-21T01:57:19.941987 | 2021-07-27T04:17:39 | 2021-07-27T04:30:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 166,118 | 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 "ui/accessibility/platform/ax_platform_node_auralinux.h"
#include <dlfcn.h>
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/debug/leak_annotations.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/numerics/ranges.h"
#include "base/optional.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_enum_util.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_mode_observer.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_role_properties.h"
#include "ui/accessibility/ax_tree_data.h"
#include "ui/accessibility/platform/atk_util_auralinux.h"
#include "ui/accessibility/platform/ax_platform_atk_hyperlink.h"
#include "ui/accessibility/platform/ax_platform_node_delegate.h"
#include "ui/accessibility/platform/ax_platform_node_delegate_base.h"
#include "ui/accessibility/platform/ax_platform_text_boundary.h"
#include "ui/gfx/geometry/rect_conversions.h"
#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 10, 0)
#define ATK_210
#endif
#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 12, 0)
#define ATK_212
#endif
#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 16, 0)
#define ATK_216
#endif
#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 26, 0)
#define ATK_226
#endif
#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 30, 0)
#define ATK_230
#endif
#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 32, 0)
#define ATK_232
#endif
#if defined(ATK_CHECK_VERSION) && ATK_CHECK_VERSION(2, 34, 0)
#define ATK_234
#endif
namespace ui {
namespace {
// IMPORTANT!
// These values are written to logs. Do not renumber or delete
// existing items; add new entries to the end of the list.
enum class UmaAtkApi {
kGetName = 0,
kGetDescription = 1,
kGetNChildren = 2,
kRefChild = 3,
kGetIndexInParent = 4,
kGetParent = 5,
kRefRelationSet = 6,
kGetAttributes = 7,
kGetRole = 8,
kRefStateSet = 9,
// This must always be the last enum. It's okay for its value to
// increase, but none of the other enum values may change.
kMaxValue = kRefStateSet,
};
void RecordAccessibilityAtkApi(UmaAtkApi enum_value) {
UMA_HISTOGRAM_ENUMERATION("Accessibility.ATK-APIs", enum_value);
}
// When accepting input from clients calling the API, an ATK character offset
// of -1 can often represent the length of the string.
static const int kStringLengthOffset = -1;
// We must forward declare this because it is used by the traditional GObject
// type manipulation macros.
namespace atk_object {
GType GetType();
} // namespace atk_object
//
// ax_platform_node_auralinux AtkObject definition and implementation.
//
#define AX_PLATFORM_NODE_AURALINUX_TYPE (atk_object::GetType())
#define AX_PLATFORM_NODE_AURALINUX(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), AX_PLATFORM_NODE_AURALINUX_TYPE, \
AXPlatformNodeAuraLinuxObject))
#define AX_PLATFORM_NODE_AURALINUX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), AX_PLATFORM_NODE_AURALINUX_TYPE, \
AXPlatformNodeAuraLinuxClass))
#define IS_AX_PLATFORM_NODE_AURALINUX(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), AX_PLATFORM_NODE_AURALINUX_TYPE))
#define IS_AX_PLATFORM_NODE_AURALINUX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), AX_PLATFORM_NODE_AURALINUX_TYPE))
#define AX_PLATFORM_NODE_AURALINUX_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), AX_PLATFORM_NODE_AURALINUX_TYPE, \
AXPlatformNodeAuraLinuxClass))
typedef struct _AXPlatformNodeAuraLinuxObject AXPlatformNodeAuraLinuxObject;
typedef struct _AXPlatformNodeAuraLinuxClass AXPlatformNodeAuraLinuxClass;
struct _AXPlatformNodeAuraLinuxObject {
AtkObject parent;
AXPlatformNodeAuraLinux* m_object;
};
struct _AXPlatformNodeAuraLinuxClass {
AtkObjectClass parent_class;
};
// The root-level Application object that's the parent of all top-level windows.
AXPlatformNode* g_root_application = nullptr;
// The last AtkObject with keyboard focus. Tracking this is required to emit the
// ATK_STATE_FOCUSED change to false.
AtkObject* g_current_focused = nullptr;
// The last AtkObject which was the active descendant in the currently-focused
// object (example: The highlighted option within a focused select element).
// As with g_current_focused, we track this to emit events when this object is
// no longer the active descendant.
AtkObject* g_current_active_descendant = nullptr;
// The last object which was selected. Tracking this is required because
// widgets in the browser UI only emit notifications upon becoming selected,
// but clients also expect notifications when items become unselected.
AXPlatformNodeAuraLinux* g_current_selected = nullptr;
// The AtkObject with role=ATK_ROLE_FRAME that represents the toplevel desktop
// window with focus. If this window is not one of our windows, this value
// should be null. This is a weak pointer as well, so its value will also be
// null if if the AtkObject is destroyed.
AtkObject* g_active_top_level_frame = nullptr;
AtkObject* g_active_views_dialog = nullptr;
#if defined(ATK_216)
constexpr AtkRole kStaticRole = ATK_ROLE_STATIC;
constexpr AtkRole kSubscriptRole = ATK_ROLE_SUBSCRIPT;
constexpr AtkRole kSuperscriptRole = ATK_ROLE_SUPERSCRIPT;
#else
constexpr AtkRole kStaticRole = ATK_ROLE_TEXT;
constexpr AtkRole kSubscriptRole = ATK_ROLE_TEXT;
constexpr AtkRole kSuperscriptRole = ATK_ROLE_TEXT;
#endif
#if defined(ATK_226)
constexpr AtkRole kAtkFootnoteRole = ATK_ROLE_FOOTNOTE;
#else
constexpr AtkRole kAtkFootnoteRole = ATK_ROLE_LIST_ITEM;
#endif
#if defined(ATK_234)
constexpr AtkRole kAtkRoleContentDeletion = ATK_ROLE_CONTENT_DELETION;
constexpr AtkRole kAtkRoleContentInsertion = ATK_ROLE_CONTENT_INSERTION;
#else
constexpr AtkRole kAtkRoleContentDeletion = ATK_ROLE_SECTION;
constexpr AtkRole kAtkRoleContentInsertion = ATK_ROLE_SECTION;
#endif
using GetTypeFunc = GType (*)();
using GetColumnHeaderCellsFunc = GPtrArray* (*)(AtkTableCell* cell);
using GetRowHeaderCellsFunc = GPtrArray* (*)(AtkTableCell* cell);
using GetRowColumnSpanFunc = bool (*)(AtkTableCell* cell,
gint* row,
gint* column,
gint* row_span,
gint* col_span);
static GetTypeFunc g_atk_table_cell_get_type;
static GetColumnHeaderCellsFunc g_atk_table_cell_get_column_header_cells;
static GetRowHeaderCellsFunc g_atk_table_cell_get_row_header_cells;
static GetRowColumnSpanFunc g_atk_table_cell_get_row_column_span;
// The ATK API often requires pointers to be used as out arguments, while
// allowing for those pointers to be null if the caller is not interested in
// the value. This function is a simpler helper to avoid continually checking
// for null and to help prevent forgetting to check for null.
void SetIntPointerValueIfNotNull(int* pointer, int value) {
if (pointer)
*pointer = value;
}
#if defined(ATK_230)
bool SupportsAtkComponentScrollingInterface() {
return dlsym(RTLD_DEFAULT, "atk_component_scroll_to_point");
}
#endif
#if defined(ATK_232)
bool SupportsAtkTextScrollingInterface() {
return dlsym(RTLD_DEFAULT, "atk_text_scroll_substring_to_point");
}
#endif
AtkObject* FindAtkObjectParentFrame(AtkObject* atk_object) {
AXPlatformNodeAuraLinux* node =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
while (node) {
if (node->GetAtkRole() == ATK_ROLE_FRAME)
return node->GetNativeViewAccessible();
node = AXPlatformNodeAuraLinux::FromAtkObject(node->GetParent());
}
return nullptr;
}
AtkObject* FindAtkObjectToplevelParentDocument(AtkObject* atk_object) {
AXPlatformNodeAuraLinux* node =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
AtkObject* toplevel_document = nullptr;
while (node) {
if (node->GetAtkRole() == ATK_ROLE_DOCUMENT_WEB)
toplevel_document = node->GetNativeViewAccessible();
node = AXPlatformNodeAuraLinux::FromAtkObject(node->GetParent());
}
return toplevel_document;
}
bool IsFrameAncestorOfAtkObject(AtkObject* frame, AtkObject* atk_object) {
AtkObject* current_frame = FindAtkObjectParentFrame(atk_object);
while (current_frame) {
if (current_frame == frame)
return true;
AXPlatformNodeAuraLinux* frame_node =
AXPlatformNodeAuraLinux::FromAtkObject(current_frame);
current_frame = FindAtkObjectParentFrame(frame_node->GetParent());
}
return false;
}
// Returns a stack of AtkObjects of activated popup menus. Since each popup
// menu and submenu has its own native window, we want to properly manage the
// activated state for their containing frames.
std::vector<AtkObject*>& GetActiveMenus() {
static base::NoDestructor<std::vector<AtkObject*>> active_menus;
return *active_menus;
}
std::map<AtkObject*, FindInPageResultInfo>& GetActiveFindInPageResults() {
static base::NoDestructor<std::map<AtkObject*, FindInPageResultInfo>>
active_results;
return *active_results;
}
// The currently active frame is g_active_top_level_frame, unless there is an
// active menu. If there is an active menu the parent frame of the
// most-recently opened active menu should be the currently active frame.
AtkObject* ComputeActiveTopLevelFrame() {
if (!GetActiveMenus().empty())
return FindAtkObjectParentFrame(GetActiveMenus().back());
return g_active_top_level_frame;
}
const char* GetUniqueAccessibilityGTypeName(
ImplementedAtkInterfaces interface_mask) {
// 37 characters is enough for "AXPlatformNodeAuraLinux%x" with any integer
// value.
static char name[37];
snprintf(name, sizeof(name), "AXPlatformNodeAuraLinux%x",
interface_mask.value());
return name;
}
void SetWeakGPtrToAtkObject(AtkObject** weak_pointer, AtkObject* new_value) {
DCHECK(weak_pointer);
if (*weak_pointer == new_value)
return;
if (*weak_pointer) {
g_object_remove_weak_pointer(G_OBJECT(*weak_pointer),
reinterpret_cast<void**>(weak_pointer));
}
*weak_pointer = new_value;
if (new_value) {
g_object_add_weak_pointer(G_OBJECT(new_value),
reinterpret_cast<void**>(weak_pointer));
}
}
void SetActiveTopLevelFrame(AtkObject* new_top_level_frame) {
SetWeakGPtrToAtkObject(&g_active_top_level_frame, new_top_level_frame);
}
AXCoordinateSystem AtkCoordTypeToAXCoordinateSystem(
AtkCoordType coordinate_type) {
switch (coordinate_type) {
case ATK_XY_SCREEN:
return AXCoordinateSystem::kScreenDIPs;
case ATK_XY_WINDOW:
return AXCoordinateSystem::kRootFrame;
#if defined(ATK_230)
case ATK_XY_PARENT:
// AXCoordinateSystem does not support parent coordinates.
NOTIMPLEMENTED();
return AXCoordinateSystem::kFrame;
#endif
default:
return AXCoordinateSystem::kScreenDIPs;
}
}
const char* BuildDescriptionFromHeaders(AXPlatformNodeDelegate* delegate,
const std::vector<int32_t>& ids) {
std::vector<std::string> names;
for (const auto& node_id : ids) {
if (AXPlatformNode* header = delegate->GetFromNodeID(node_id)) {
if (AtkObject* atk_header = header->GetNativeViewAccessible())
names.push_back(atk_object_get_name(atk_header));
}
}
std::string result = base::JoinString(names, " ");
#if defined(LEAK_SANITIZER) && !defined(OS_NACL)
// http://crbug.com/982839
// atk_table_get_column_description and atk_table_get_row_description return
// const gchar*, which suggests the caller does not gain ownership of the
// returned string. The g_strdup below causes a new allocation, which does not
// fit that pattern and causes a leak in tests.
ScopedLeakSanitizerDisabler lsan_disabler;
#endif
return g_strdup(result.c_str());
}
gfx::Point FindAtkObjectParentCoords(AtkObject* atk_object) {
if (!atk_object)
return gfx::Point(0, 0);
AXPlatformNodeAuraLinux* node =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (node->GetAtkRole() == ATK_ROLE_FRAME) {
int x, y;
atk_component_get_extents(ATK_COMPONENT(atk_object), &x, &y, nullptr,
nullptr, ATK_XY_WINDOW);
gfx::Point window_coords(x, y);
return window_coords;
}
atk_object = node->GetParent();
return FindAtkObjectParentCoords(atk_object);
}
AtkAttributeSet* PrependAtkAttributeToAtkAttributeSet(
const char* name,
const char* value,
AtkAttributeSet* attribute_set) {
AtkAttribute* attribute =
static_cast<AtkAttribute*>(g_malloc(sizeof(AtkAttribute)));
attribute->name = g_strdup(name);
attribute->value = g_strdup(value);
return g_slist_prepend(attribute_set, attribute);
}
AtkObject* GetActiveDescendantOfCurrentFocused() {
if (!g_current_focused)
return nullptr;
auto* node = AXPlatformNodeAuraLinux::FromAtkObject(g_current_focused);
if (!node)
return nullptr;
int32_t id =
node->GetIntAttribute(ax::mojom::IntAttribute::kActivedescendantId);
if (auto* descendant = node->GetDelegate()->GetFromNodeID(id))
return descendant->GetNativeViewAccessible();
return nullptr;
}
void PrependTextAttributeToSet(const std::string& attribute,
const std::string& value,
AtkAttributeSet** attributes) {
DCHECK(attributes);
AtkAttribute* new_attribute =
static_cast<AtkAttribute*>(g_malloc(sizeof(AtkAttribute)));
new_attribute->name = g_strdup(attribute.c_str());
new_attribute->value = g_strdup(value.c_str());
*attributes = g_slist_prepend(*attributes, new_attribute);
}
void PrependAtkTextAttributeToSet(const AtkTextAttribute attribute,
const std::string& value,
AtkAttributeSet** attributes) {
PrependTextAttributeToSet(atk_text_attribute_get_name(attribute), value,
attributes);
}
std::string ToAtkTextAttributeColor(const std::string color) {
// The platform-independent color string is in the form "rgb(r, g, b)",
// but ATK expects a string like "r, g, b". We convert the string here
// by stripping away the unnecessary characters.
DCHECK(base::StartsWith(color, "rgb(", base::CompareCase::INSENSITIVE_ASCII));
DCHECK(base::EndsWith(color, ")", base::CompareCase::INSENSITIVE_ASCII));
return color.substr(4, color.length() - 5);
}
AtkAttributeSet* ToAtkAttributeSet(const TextAttributeList& attributes) {
AtkAttributeSet* copied_attributes = nullptr;
for (const auto& attribute : attributes) {
if (attribute.first == "background-color") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_BG_COLOR,
ToAtkTextAttributeColor(attribute.second),
&copied_attributes);
} else if (attribute.first == "color") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_FG_COLOR,
ToAtkTextAttributeColor(attribute.second),
&copied_attributes);
} else if (attribute.first == "font-family") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_FAMILY_NAME, attribute.second,
&copied_attributes);
} else if (attribute.first == "font-size") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_SIZE, attribute.second,
&copied_attributes);
} else if (attribute.first == "font-weight" && attribute.second == "bold") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_WEIGHT, "700",
&copied_attributes);
} else if (attribute.first == "font-style") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_STYLE, "italic",
&copied_attributes);
} else if (attribute.first == "text-line-through-style") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_STRIKETHROUGH, "true",
&copied_attributes);
} else if (attribute.first == "text-underline-style") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_UNDERLINE, "single",
&copied_attributes);
} else if (attribute.first == "invalid") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_INVALID, attribute.second,
&copied_attributes);
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_UNDERLINE, "error",
&copied_attributes);
} else if (attribute.first == "language") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_LANGUAGE, attribute.second,
&copied_attributes);
} else if (attribute.first == "writing-mode") {
PrependAtkTextAttributeToSet(ATK_TEXT_ATTR_DIRECTION, attribute.second,
&copied_attributes);
} else if (attribute.first == "text-position") {
PrependTextAttributeToSet(attribute.first, attribute.second,
&copied_attributes);
}
}
return g_slist_reverse(copied_attributes);
}
namespace atk_component {
void GetExtents(AtkComponent* atk_component,
gint* x,
gint* y,
gint* width,
gint* height,
AtkCoordType coord_type) {
g_return_if_fail(ATK_IS_COMPONENT(atk_component));
if (x)
*x = 0;
if (y)
*y = 0;
if (width)
*width = 0;
if (height)
*height = 0;
AtkObject* atk_object = ATK_OBJECT(atk_component);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetExtents(x, y, width, height, coord_type);
}
void GetPosition(AtkComponent* atk_component,
gint* x,
gint* y,
AtkCoordType coord_type) {
g_return_if_fail(ATK_IS_COMPONENT(atk_component));
if (x)
*x = 0;
if (y)
*y = 0;
AtkObject* atk_object = ATK_OBJECT(atk_component);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetPosition(x, y, coord_type);
}
void GetSize(AtkComponent* atk_component, gint* width, gint* height) {
g_return_if_fail(ATK_IS_COMPONENT(atk_component));
if (width)
*width = 0;
if (height)
*height = 0;
AtkObject* atk_object = ATK_OBJECT(atk_component);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetSize(width, height);
}
AtkObject* RefAccesibleAtPoint(AtkComponent* atk_component,
gint x,
gint y,
AtkCoordType coord_type) {
g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_component);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
AtkObject* result = obj->HitTestSync(x, y, coord_type);
if (result)
g_object_ref(result);
return result;
}
gboolean GrabFocus(AtkComponent* atk_component) {
g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), FALSE);
AtkObject* atk_object = ATK_OBJECT(atk_component);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return FALSE;
return obj->GrabFocus();
}
#if defined(ATK_230)
gboolean ScrollTo(AtkComponent* atk_component, AtkScrollType scroll_type) {
g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_component));
if (!obj)
return FALSE;
obj->ScrollNodeIntoView(scroll_type);
return TRUE;
}
gboolean ScrollToPoint(AtkComponent* atk_component,
AtkCoordType atk_coord_type,
gint x,
gint y) {
g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_component));
if (!obj)
return FALSE;
obj->ScrollToPoint(atk_coord_type, x, y);
return TRUE;
}
#endif
void Init(AtkComponentIface* iface) {
iface->get_extents = GetExtents;
iface->get_position = GetPosition;
iface->get_size = GetSize;
iface->ref_accessible_at_point = RefAccesibleAtPoint;
iface->grab_focus = GrabFocus;
#if defined(ATK_230)
if (SupportsAtkComponentScrollingInterface()) {
iface->scroll_to = ScrollTo;
iface->scroll_to_point = ScrollToPoint;
}
#endif
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_component
namespace atk_action {
gboolean DoAction(AtkAction* atk_action, gint index) {
g_return_val_if_fail(ATK_IS_ACTION(atk_action), FALSE);
g_return_val_if_fail(!index, FALSE);
AtkObject* atk_object = ATK_OBJECT(atk_action);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return FALSE;
return obj->DoDefaultAction();
}
gint GetNActions(AtkAction* atk_action) {
g_return_val_if_fail(ATK_IS_ACTION(atk_action), 0);
AtkObject* atk_object = ATK_OBJECT(atk_action);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return 0;
return 1;
}
const gchar* GetDescription(AtkAction*, gint) {
// Not implemented. Right now Orca does not provide this and
// Chromium is not providing a string for the action description.
return nullptr;
}
const gchar* GetName(AtkAction* atk_action, gint index) {
g_return_val_if_fail(ATK_IS_ACTION(atk_action), nullptr);
g_return_val_if_fail(!index, nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_action);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return obj->GetDefaultActionName();
}
const gchar* GetKeybinding(AtkAction* atk_action, gint index) {
g_return_val_if_fail(ATK_IS_ACTION(atk_action), nullptr);
g_return_val_if_fail(!index, nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_action);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return obj->GetStringAttribute(ax::mojom::StringAttribute::kAccessKey)
.c_str();
}
void Init(AtkActionIface* iface) {
iface->do_action = DoAction;
iface->get_n_actions = GetNActions;
iface->get_description = GetDescription;
iface->get_name = GetName;
iface->get_keybinding = GetKeybinding;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_action
namespace atk_document {
const gchar* GetDocumentAttributeValue(AtkDocument* atk_doc,
const gchar* attribute) {
g_return_val_if_fail(ATK_IS_DOCUMENT(atk_doc), nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_doc);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return obj->GetDocumentAttributeValue(attribute);
}
AtkAttributeSet* GetDocumentAttributes(AtkDocument* atk_doc) {
g_return_val_if_fail(ATK_IS_DOCUMENT(atk_doc), 0);
AtkObject* atk_object = ATK_OBJECT(atk_doc);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return obj->GetDocumentAttributes();
}
void Init(AtkDocumentIface* iface) {
iface->get_document_attribute_value = GetDocumentAttributeValue;
iface->get_document_attributes = GetDocumentAttributes;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_document
namespace atk_image {
void GetImagePosition(AtkImage* atk_img,
gint* x,
gint* y,
AtkCoordType coord_type) {
g_return_if_fail(ATK_IMAGE(atk_img));
AtkObject* atk_object = ATK_OBJECT(atk_img);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetPosition(x, y, coord_type);
}
const gchar* GetImageDescription(AtkImage* atk_img) {
g_return_val_if_fail(ATK_IMAGE(atk_img), nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_img);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return obj->GetStringAttribute(ax::mojom::StringAttribute::kDescription)
.c_str();
}
void GetImageSize(AtkImage* atk_img, gint* width, gint* height) {
g_return_if_fail(ATK_IMAGE(atk_img));
AtkObject* atk_object = ATK_OBJECT(atk_img);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetSize(width, height);
}
void Init(AtkImageIface* iface) {
iface->get_image_position = GetImagePosition;
iface->get_image_description = GetImageDescription;
iface->get_image_size = GetImageSize;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_image
namespace atk_value {
void GetCurrentValue(AtkValue* atk_value, GValue* value) {
g_return_if_fail(ATK_IS_VALUE(atk_value));
AtkObject* atk_object = ATK_OBJECT(atk_value);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetFloatAttributeInGValue(ax::mojom::FloatAttribute::kValueForRange,
value);
}
void GetMinimumValue(AtkValue* atk_value, GValue* value) {
g_return_if_fail(ATK_IS_VALUE(atk_value));
AtkObject* atk_object = ATK_OBJECT(atk_value);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetFloatAttributeInGValue(ax::mojom::FloatAttribute::kMinValueForRange,
value);
}
void GetMaximumValue(AtkValue* atk_value, GValue* value) {
g_return_if_fail(ATK_IS_VALUE(atk_value));
AtkObject* atk_object = ATK_OBJECT(atk_value);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetFloatAttributeInGValue(ax::mojom::FloatAttribute::kMaxValueForRange,
value);
}
void GetMinimumIncrement(AtkValue* atk_value, GValue* value) {
g_return_if_fail(ATK_IS_VALUE(atk_value));
AtkObject* atk_object = ATK_OBJECT(atk_value);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return;
obj->GetFloatAttributeInGValue(ax::mojom::FloatAttribute::kStepValueForRange,
value);
}
gboolean SetCurrentValue(AtkValue* atk_value, const GValue* value) {
g_return_val_if_fail(ATK_IS_VALUE(atk_value), FALSE);
AtkObject* atk_object = ATK_OBJECT(atk_value);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return FALSE;
std::string new_value;
switch (G_VALUE_TYPE(value)) {
case G_TYPE_FLOAT:
new_value = base::NumberToString(g_value_get_float(value));
break;
case G_TYPE_INT:
new_value = base::NumberToString(g_value_get_int(value));
break;
case G_TYPE_INT64:
new_value = base::NumberToString(g_value_get_int64(value));
break;
case G_TYPE_STRING:
new_value = g_value_get_string(value);
break;
default:
return FALSE;
}
AXActionData data;
data.action = ax::mojom::Action::kSetValue;
data.value = new_value;
obj->GetDelegate()->AccessibilityPerformAction(data);
return TRUE;
}
void Init(AtkValueIface* iface) {
iface->get_current_value = GetCurrentValue;
iface->get_maximum_value = GetMaximumValue;
iface->get_minimum_value = GetMinimumValue;
iface->get_minimum_increment = GetMinimumIncrement;
iface->set_current_value = SetCurrentValue;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_value
namespace atk_hyperlink {
AtkHyperlink* GetHyperlink(AtkHyperlinkImpl* atk_hyperlink_impl) {
g_return_val_if_fail(ATK_HYPERLINK_IMPL(atk_hyperlink_impl), 0);
AtkObject* atk_object = ATK_OBJECT(atk_hyperlink_impl);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return 0;
AtkHyperlink* atk_hyperlink = obj->GetAtkHyperlink();
g_object_ref(atk_hyperlink);
return atk_hyperlink;
}
void Init(AtkHyperlinkImplIface* iface) {
iface->get_hyperlink = GetHyperlink;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_hyperlink
namespace atk_hypertext {
AtkHyperlink* GetLink(AtkHypertext* hypertext, int index) {
g_return_val_if_fail(ATK_HYPERTEXT(hypertext), 0);
auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(hypertext));
if (!obj)
return nullptr;
const AXHypertext& ax_hypertext = obj->GetAXHypertext();
if (index > static_cast<int>(ax_hypertext.hyperlinks.size()) || index < 0)
return nullptr;
int32_t id = ax_hypertext.hyperlinks[index];
auto* link = static_cast<AXPlatformNodeAuraLinux*>(
AXPlatformNodeBase::GetFromUniqueId(id));
if (!link)
return nullptr;
return link->GetAtkHyperlink();
}
int GetNLinks(AtkHypertext* hypertext) {
g_return_val_if_fail(ATK_HYPERTEXT(hypertext), 0);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(hypertext));
return obj ? obj->GetAXHypertext().hyperlinks.size() : 0;
}
int GetLinkIndex(AtkHypertext* hypertext, int char_index) {
g_return_val_if_fail(ATK_HYPERTEXT(hypertext), 0);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(hypertext));
if (!obj)
return -1;
auto it = obj->GetAXHypertext().hyperlink_offset_to_index.find(char_index);
if (it == obj->GetAXHypertext().hyperlink_offset_to_index.end())
return -1;
return it->second;
}
void Init(AtkHypertextIface* iface) {
iface->get_link = GetLink;
iface->get_n_links = GetNLinks;
iface->get_link_index = GetLinkIndex;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_hypertext
namespace atk_text {
gchar* GetText(AtkText* atk_text, gint start_offset, gint end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_text);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
base::string16 text = obj->GetHypertext();
start_offset = obj->UnicodeToUTF16OffsetInText(start_offset);
if (start_offset < 0 || start_offset >= static_cast<int>(text.size()))
return nullptr;
if (end_offset < 0) {
end_offset = text.size();
} else {
end_offset = obj->UnicodeToUTF16OffsetInText(end_offset);
end_offset = base::ClampToRange(int{text.size()}, start_offset, end_offset);
}
DCHECK_GE(start_offset, 0);
DCHECK_GE(end_offset, start_offset);
return g_strdup(
base::UTF16ToUTF8(text.substr(start_offset, end_offset - start_offset))
.c_str());
}
gint GetCharacterCount(AtkText* atk_text) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), 0);
AtkObject* atk_object = ATK_OBJECT(atk_text);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return 0;
return obj->UTF16ToUnicodeOffsetInText(obj->GetHypertext().length());
}
gunichar GetCharacterAtOffset(AtkText* atk_text, int offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), 0);
AtkObject* atk_object = ATK_OBJECT(atk_text);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return 0;
base::string16 text = obj->GetHypertext();
int32_t text_length = text.length();
offset = obj->UnicodeToUTF16OffsetInText(offset);
int32_t limited_offset = base::ClampToRange(offset, 0, text_length);
uint32_t code_point;
base::ReadUnicodeCharacter(text.c_str(), text_length + 1, &limited_offset,
&code_point);
return code_point;
}
// This function returns a single character as a UTF-8 encoded C string because
// the character may be encoded into more than one byte.
char* GetCharacter(AtkText* atk_text,
int offset,
int* start_offset,
int* end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
*start_offset = -1;
*end_offset = -1;
AtkObject* atk_object = ATK_OBJECT(atk_text);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
if (offset < 0 || offset >= GetCharacterCount(atk_text))
return nullptr;
char* text = GetText(atk_text, offset, offset + 1);
if (!text)
return nullptr;
*start_offset = offset;
*end_offset = offset + 1;
return text;
}
char* GetTextWithBoundaryType(AtkText* atk_text,
int offset,
ax::mojom::TextBoundary boundary,
int* start_offset_ptr,
int* end_offset_ptr) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_text);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
if (offset < 0 || offset >= atk_text_get_character_count(atk_text))
return nullptr;
// The offset that we receive from the API is a Unicode character offset.
// Since we calculate boundaries in terms of UTF-16 code point offsets, we
// need to convert this input value.
offset = obj->UnicodeToUTF16OffsetInText(offset);
int start_offset = obj->FindTextBoundary(
boundary, offset, ax::mojom::MoveDirection::kBackward,
ax::mojom::TextAffinity::kDownstream);
int end_offset = obj->FindTextBoundary(boundary, offset,
ax::mojom::MoveDirection::kForward,
ax::mojom::TextAffinity::kDownstream);
if (start_offset < 0 || end_offset < 0)
return nullptr;
DCHECK_LE(start_offset, end_offset)
<< "Start offset should be less than or equal the end offset.";
// The ATK API is also expecting Unicode character offsets as output
// values.
*start_offset_ptr = obj->UTF16ToUnicodeOffsetInText(start_offset);
*end_offset_ptr = obj->UTF16ToUnicodeOffsetInText(end_offset);
base::string16 text = obj->GetHypertext();
DCHECK_LE(end_offset, static_cast<int>(text.size()));
base::string16 substr = text.substr(start_offset, end_offset - start_offset);
return g_strdup(base::UTF16ToUTF8(substr).c_str());
}
char* GetTextAtOffset(AtkText* atk_text,
int offset,
AtkTextBoundary atk_boundary,
int* start_offset,
int* end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
ax::mojom::TextBoundary boundary = FromAtkTextBoundary(atk_boundary);
return GetTextWithBoundaryType(atk_text, offset, boundary, start_offset,
end_offset);
}
char* GetTextAfterOffset(AtkText* atk_text,
int offset,
AtkTextBoundary boundary,
int* start_offset,
int* end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
if (boundary != ATK_TEXT_BOUNDARY_CHAR) {
*start_offset = -1;
*end_offset = -1;
return nullptr;
}
// ATK does not offer support for the special negative index and we don't
// want to do arithmetic on that value below.
if (offset == kStringLengthOffset)
return nullptr;
return GetCharacter(atk_text, offset + 1, start_offset, end_offset);
}
char* GetTextBeforeOffset(AtkText* atk_text,
int offset,
AtkTextBoundary boundary,
int* start_offset,
int* end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
if (boundary != ATK_TEXT_BOUNDARY_CHAR) {
*start_offset = -1;
*end_offset = -1;
return nullptr;
}
// ATK does not offer support for the special negative index and we don't
// want to do arithmetic on that value below.
if (offset == kStringLengthOffset)
return nullptr;
return GetCharacter(atk_text, offset - 1, start_offset, end_offset);
}
gint GetCaretOffset(AtkText* atk_text) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), -1);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (!obj)
return -1;
return obj->GetCaretOffset();
}
gboolean SetCaretOffset(AtkText* atk_text, gint offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (!obj)
return FALSE;
if (!obj->SetCaretOffset(offset))
return FALSE;
// Orca expects atk_text_set_caret_offset to either focus the target element
// or set the sequential focus navigation starting point there.
int utf16_offset = obj->UnicodeToUTF16OffsetInText(offset);
obj->GrabFocusOrSetSequentialFocusNavigationStartingPointAtOffset(
utf16_offset);
return TRUE;
}
int GetNSelections(AtkText* atk_text) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), 0);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (!obj)
return 0;
if (obj->HasSelection())
return 1;
base::Optional<FindInPageResultInfo> result =
obj->GetSelectionOffsetsFromFindInPage();
if (result.has_value() && result->node == ATK_OBJECT(atk_text))
return 1;
return 0;
}
gchar* GetSelection(AtkText* atk_text,
int selection_num,
int* start_offset,
int* end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (!obj)
return nullptr;
if (selection_num != 0)
return nullptr;
return obj->GetSelectionWithText(start_offset, end_offset);
}
gboolean RemoveSelection(AtkText* atk_text, int selection_num) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), FALSE);
if (selection_num != 0)
return FALSE;
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (!obj)
return FALSE;
// Simply collapse the selection to the position of the caret if a caret is
// visible, otherwise set the selection to 0.
int selection_end = obj->UTF16ToUnicodeOffsetInText(
obj->GetIntAttribute(ax::mojom::IntAttribute::kTextSelEnd));
return SetCaretOffset(atk_text, selection_end);
}
gboolean SetSelection(AtkText* atk_text,
int selection_num,
int start_offset,
int end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), FALSE);
if (selection_num != 0)
return FALSE;
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (!obj)
return FALSE;
return obj->SetTextSelectionForAtkText(start_offset, end_offset);
}
gboolean AddSelection(AtkText* atk_text, int start_offset, int end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), FALSE);
// We only support one selection.
return SetSelection(atk_text, 0, start_offset, end_offset);
}
#if defined(ATK_210)
char* GetStringAtOffset(AtkText* atk_text,
int offset,
AtkTextGranularity atk_granularity,
int* start_offset,
int* end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
*start_offset = -1;
*end_offset = -1;
ax::mojom::TextBoundary boundary = FromAtkTextGranularity(atk_granularity);
return GetTextWithBoundaryType(atk_text, offset, boundary, start_offset,
end_offset);
}
#endif
#if defined(ATK_230)
gfx::Rect GetUnclippedParentHypertextRangeBoundsRect(
AXPlatformNodeDelegate* ax_platform_node_delegate,
const int start_offset,
const int end_offset) {
const AXPlatformNode* parent_platform_node =
AXPlatformNode::FromNativeViewAccessible(
ax_platform_node_delegate->GetParent());
if (!parent_platform_node)
return gfx::Rect();
const AXPlatformNodeDelegate* parent_ax_platform_node_delegate =
parent_platform_node->GetDelegate();
if (!parent_ax_platform_node_delegate)
return gfx::Rect();
return ax_platform_node_delegate->GetHypertextRangeBoundsRect(
start_offset, end_offset, AXCoordinateSystem::kRootFrame,
AXClippingBehavior::kUnclipped) -
parent_ax_platform_node_delegate
->GetBoundsRect(AXCoordinateSystem::kRootFrame,
AXClippingBehavior::kClipped)
.OffsetFromOrigin();
}
#endif
void GetCharacterExtents(AtkText* atk_text,
int offset,
int* x,
int* y,
int* width,
int* height,
AtkCoordType coordinate_type) {
g_return_if_fail(ATK_IS_TEXT(atk_text));
gfx::Rect rect;
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (obj) {
switch (coordinate_type) {
#if defined(ATK_230)
case ATK_XY_PARENT:
rect = GetUnclippedParentHypertextRangeBoundsRect(obj->GetDelegate(),
offset, offset + 1);
break;
#endif
default:
rect = obj->GetDelegate()->GetHypertextRangeBoundsRect(
obj->UnicodeToUTF16OffsetInText(offset),
obj->UnicodeToUTF16OffsetInText(offset + 1),
AtkCoordTypeToAXCoordinateSystem(coordinate_type),
AXClippingBehavior::kUnclipped);
break;
}
}
if (x)
*x = rect.x();
if (y)
*y = rect.y();
if (width)
*width = rect.width();
if (height)
*height = rect.height();
}
void GetRangeExtents(AtkText* atk_text,
int start_offset,
int end_offset,
AtkCoordType coordinate_type,
AtkTextRectangle* out_rectangle) {
g_return_if_fail(ATK_IS_TEXT(atk_text));
if (!out_rectangle)
return;
gfx::Rect rect;
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (obj) {
switch (coordinate_type) {
#if defined(ATK_230)
case ATK_XY_PARENT:
rect = GetUnclippedParentHypertextRangeBoundsRect(
obj->GetDelegate(), start_offset, end_offset);
break;
#endif
default:
rect = obj->GetDelegate()->GetHypertextRangeBoundsRect(
obj->UnicodeToUTF16OffsetInText(start_offset),
obj->UnicodeToUTF16OffsetInText(end_offset),
AtkCoordTypeToAXCoordinateSystem(coordinate_type),
AXClippingBehavior::kUnclipped);
break;
}
}
out_rectangle->x = rect.x();
out_rectangle->y = rect.y();
out_rectangle->width = rect.width();
out_rectangle->height = rect.height();
}
AtkAttributeSet* GetRunAttributes(AtkText* atk_text,
gint offset,
gint* start_offset,
gint* end_offset) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
SetIntPointerValueIfNotNull(start_offset, -1);
SetIntPointerValueIfNotNull(end_offset, -1);
if (offset < 0 || offset > GetCharacterCount(atk_text))
return nullptr;
AtkObject* atk_object = ATK_OBJECT(atk_text);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return ToAtkAttributeSet(
obj->GetTextAttributes(offset, start_offset, end_offset));
}
AtkAttributeSet* GetDefaultAttributes(AtkText* atk_text) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), nullptr);
AtkObject* atk_object = ATK_OBJECT(atk_text);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return ToAtkAttributeSet(obj->GetDefaultTextAttributes());
}
#if defined(ATK_232)
gboolean ScrollSubstringTo(AtkText* atk_text,
gint start_offset,
gint end_offset,
AtkScrollType scroll_type) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (!obj)
return FALSE;
return obj->ScrollSubstringIntoView(scroll_type, start_offset, end_offset);
}
gboolean ScrollSubstringToPoint(AtkText* atk_text,
gint start_offset,
gint end_offset,
AtkCoordType atk_coord_type,
gint x,
gint y) {
g_return_val_if_fail(ATK_IS_TEXT(atk_text), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(atk_text));
if (!obj)
return FALSE;
return obj->ScrollSubstringToPoint(start_offset, end_offset, atk_coord_type,
x, y);
}
#endif // ATK_232
void Init(AtkTextIface* iface) {
iface->get_text = GetText;
iface->get_character_count = GetCharacterCount;
iface->get_character_at_offset = GetCharacterAtOffset;
iface->get_text_after_offset = GetTextAfterOffset;
iface->get_text_before_offset = GetTextBeforeOffset;
iface->get_text_at_offset = GetTextAtOffset;
iface->get_caret_offset = GetCaretOffset;
iface->set_caret_offset = SetCaretOffset;
iface->get_character_extents = GetCharacterExtents;
iface->get_range_extents = GetRangeExtents;
iface->get_n_selections = GetNSelections;
iface->get_selection = GetSelection;
iface->add_selection = AddSelection;
iface->remove_selection = RemoveSelection;
iface->set_selection = SetSelection;
iface->get_run_attributes = GetRunAttributes;
iface->get_default_attributes = GetDefaultAttributes;
#if defined(ATK_210)
iface->get_string_at_offset = GetStringAtOffset;
#endif
#if defined(ATK_232)
if (SupportsAtkTextScrollingInterface()) {
iface->scroll_substring_to = ScrollSubstringTo;
iface->scroll_substring_to_point = ScrollSubstringToPoint;
}
#endif
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_text
namespace atk_window {
void Init(AtkWindowIface* iface) {}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_window
namespace atk_selection {
gboolean AddSelection(AtkSelection* selection, gint index) {
g_return_val_if_fail(ATK_IS_SELECTION(selection), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(selection));
if (!obj)
return FALSE;
if (index < 0 || index >= obj->GetChildCount())
return FALSE;
AXPlatformNodeAuraLinux* child =
AXPlatformNodeAuraLinux::FromAtkObject(obj->ChildAtIndex(index));
if (!child)
return FALSE;
if (!child->SupportsSelectionWithAtkSelection())
return FALSE;
bool selected = child->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected);
if (selected)
return TRUE;
AXActionData data;
data.action = ax::mojom::Action::kDoDefault;
return child->GetDelegate()->AccessibilityPerformAction(data);
}
gboolean ClearSelection(AtkSelection* selection) {
g_return_val_if_fail(ATK_IS_SELECTION(selection), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(selection));
if (!obj)
return FALSE;
int child_count = obj->GetChildCount();
bool success = true;
for (int i = 0; i < child_count; ++i) {
AXPlatformNodeAuraLinux* child =
AXPlatformNodeAuraLinux::FromAtkObject(obj->ChildAtIndex(i));
if (!child)
continue;
if (!child->SupportsSelectionWithAtkSelection())
continue;
bool selected =
child->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected);
if (!selected)
continue;
AXActionData data;
data.action = ax::mojom::Action::kDoDefault;
success = success && child->GetDelegate()->AccessibilityPerformAction(data);
}
return success;
}
AtkObject* RefSelection(AtkSelection* selection, gint requested_child_index) {
g_return_val_if_fail(ATK_IS_SELECTION(selection), nullptr);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(selection));
if (!obj)
return nullptr;
if (auto* selected_child = obj->GetSelectedItem(requested_child_index)) {
if (AtkObject* atk_object = selected_child->GetNativeViewAccessible()) {
g_object_ref(atk_object);
return atk_object;
}
}
return nullptr;
}
gint GetSelectionCount(AtkSelection* selection) {
g_return_val_if_fail(ATK_IS_SELECTION(selection), 0);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(selection));
if (!obj)
return 0;
return obj->GetSelectionCount();
}
gboolean IsChildSelected(AtkSelection* selection, gint index) {
g_return_val_if_fail(ATK_IS_SELECTION(selection), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(selection));
if (!obj)
return FALSE;
if (index < 0 || index >= obj->GetChildCount())
return FALSE;
AXPlatformNodeAuraLinux* child =
AXPlatformNodeAuraLinux::FromAtkObject(obj->ChildAtIndex(index));
return child && child->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected);
}
gboolean RemoveSelection(AtkSelection* selection,
gint index_into_selected_children) {
g_return_val_if_fail(ATK_IS_SELECTION(selection), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(selection));
if (!obj)
return FALSE;
int child_count = obj->GetChildCount();
for (int i = 0; i < child_count; ++i) {
AXPlatformNodeAuraLinux* child =
AXPlatformNodeAuraLinux::FromAtkObject(obj->ChildAtIndex(i));
if (!child)
continue;
bool selected =
child->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected);
if (selected && index_into_selected_children == 0) {
if (!child->SupportsSelectionWithAtkSelection())
return FALSE;
AXActionData data;
data.action = ax::mojom::Action::kDoDefault;
return child->GetDelegate()->AccessibilityPerformAction(data);
} else if (selected) {
index_into_selected_children--;
}
}
return FALSE;
}
gboolean SelectAllSelection(AtkSelection* selection) {
g_return_val_if_fail(ATK_IS_SELECTION(selection), FALSE);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(selection));
if (!obj)
return FALSE;
int child_count = obj->GetChildCount();
bool success = true;
for (int i = 0; i < child_count; ++i) {
AXPlatformNodeAuraLinux* child =
AXPlatformNodeAuraLinux::FromAtkObject(obj->ChildAtIndex(i));
if (!child)
continue;
if (!child->SupportsSelectionWithAtkSelection())
continue;
bool selected =
child->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected);
if (selected)
continue;
AXActionData data;
data.action = ax::mojom::Action::kDoDefault;
success = success && child->GetDelegate()->AccessibilityPerformAction(data);
}
return success;
}
void Init(AtkSelectionIface* iface) {
iface->add_selection = AddSelection;
iface->clear_selection = ClearSelection;
iface->ref_selection = RefSelection;
iface->get_selection_count = GetSelectionCount;
iface->is_child_selected = IsChildSelected;
iface->remove_selection = RemoveSelection;
iface->select_all_selection = SelectAllSelection;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_selection
namespace atk_table {
AtkObject* RefAt(AtkTable* table, gint row, gint column) {
g_return_val_if_fail(ATK_IS_TABLE(table), nullptr);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
if (AXPlatformNodeBase* cell = obj->GetTableCell(row, column)) {
if (AtkObject* atk_cell = cell->GetNativeViewAccessible()) {
g_object_ref(atk_cell);
return atk_cell;
}
}
}
return nullptr;
}
gint GetIndexAt(AtkTable* table, gint row, gint column) {
g_return_val_if_fail(ATK_IS_TABLE(table), -1);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
if (const AXPlatformNodeBase* cell = obj->GetTableCell(row, column)) {
DCHECK(cell->GetTableCellIndex().has_value());
return cell->GetTableCellIndex().value();
}
}
return -1;
}
gint GetColumnAtIndex(AtkTable* table, gint index) {
g_return_val_if_fail(ATK_IS_TABLE(table), -1);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
if (const AXPlatformNodeBase* cell = obj->GetTableCell(index)) {
DCHECK(cell->GetTableColumn().has_value());
return cell->GetTableColumn().value();
}
}
return -1;
}
gint GetRowAtIndex(AtkTable* table, gint index) {
g_return_val_if_fail(ATK_IS_TABLE(table), -1);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
if (const AXPlatformNodeBase* cell = obj->GetTableCell(index)) {
DCHECK(cell->GetTableRow().has_value());
return cell->GetTableRow().value();
}
}
return -1;
}
gint GetNColumns(AtkTable* table) {
g_return_val_if_fail(ATK_IS_TABLE(table), 0);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
// If the object is not a table, we return 0.
return obj->GetTableColumnCount().value_or(0);
}
return 0;
}
gint GetNRows(AtkTable* table) {
g_return_val_if_fail(ATK_IS_TABLE(table), 0);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
// If the object is not a table, we return 0.
return obj->GetTableRowCount().value_or(0);
}
return 0;
}
gint GetColumnExtentAt(AtkTable* table, gint row, gint column) {
g_return_val_if_fail(ATK_IS_TABLE(table), 0);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
if (const AXPlatformNodeBase* cell = obj->GetTableCell(row, column)) {
DCHECK(cell->GetTableColumnSpan().has_value());
return cell->GetTableColumnSpan().value();
}
}
return 0;
}
gint GetRowExtentAt(AtkTable* table, gint row, gint column) {
g_return_val_if_fail(ATK_IS_TABLE(table), 0);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
if (const AXPlatformNodeBase* cell = obj->GetTableCell(row, column)) {
DCHECK(cell->GetTableRowSpan().has_value());
return cell->GetTableRowSpan().value();
}
}
return 0;
}
AtkObject* GetColumnHeader(AtkTable* table, gint column) {
g_return_val_if_fail(ATK_IS_TABLE(table), nullptr);
auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table));
if (!obj)
return nullptr;
// AtkTable supports only one column header object. So return the first one
// we find. In the case of multiple headers, ATs can fall back on the column
// description.
std::vector<int32_t> ids = obj->GetDelegate()->GetColHeaderNodeIds(column);
for (const auto& node_id : ids) {
if (AXPlatformNode* header = obj->GetDelegate()->GetFromNodeID(node_id)) {
if (AtkObject* atk_header = header->GetNativeViewAccessible()) {
g_object_ref(atk_header);
return atk_header;
}
}
}
return nullptr;
}
AtkObject* GetRowHeader(AtkTable* table, gint row) {
g_return_val_if_fail(ATK_IS_TABLE(table), nullptr);
auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table));
if (!obj)
return nullptr;
// AtkTable supports only one row header object. So return the first one
// we find. In the case of multiple headers, ATs can fall back on the row
// description.
std::vector<int32_t> ids = obj->GetDelegate()->GetRowHeaderNodeIds(row);
for (const auto& node_id : ids) {
if (AXPlatformNode* header = obj->GetDelegate()->GetFromNodeID(node_id)) {
if (AtkObject* atk_header = header->GetNativeViewAccessible()) {
g_object_ref(atk_header);
return atk_header;
}
}
}
return nullptr;
}
AtkObject* GetCaption(AtkTable* table) {
g_return_val_if_fail(ATK_IS_TABLE(table), nullptr);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table))) {
if (auto* caption = obj->GetTableCaption())
return caption->GetNativeViewAccessible();
}
return nullptr;
}
const gchar* GetColumnDescription(AtkTable* table, gint column) {
g_return_val_if_fail(ATK_IS_TABLE(table), nullptr);
auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table));
if (!obj)
return nullptr;
std::vector<int32_t> ids = obj->GetDelegate()->GetColHeaderNodeIds(column);
return BuildDescriptionFromHeaders(obj->GetDelegate(), ids);
}
const gchar* GetRowDescription(AtkTable* table, gint row) {
g_return_val_if_fail(ATK_IS_TABLE(table), nullptr);
auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(table));
if (!obj)
return nullptr;
std::vector<int32_t> ids = obj->GetDelegate()->GetRowHeaderNodeIds(row);
return BuildDescriptionFromHeaders(obj->GetDelegate(), ids);
}
void Init(AtkTableIface* iface) {
iface->ref_at = RefAt;
iface->get_index_at = GetIndexAt;
iface->get_column_at_index = GetColumnAtIndex;
iface->get_row_at_index = GetRowAtIndex;
iface->get_n_columns = GetNColumns;
iface->get_n_rows = GetNRows;
iface->get_column_extent_at = GetColumnExtentAt;
iface->get_row_extent_at = GetRowExtentAt;
iface->get_column_header = GetColumnHeader;
iface->get_row_header = GetRowHeader;
iface->get_caption = GetCaption;
iface->get_column_description = GetColumnDescription;
iface->get_row_description = GetRowDescription;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_table
// The ATK table cell interface was added in ATK 2.12.
#if defined(ATK_212)
namespace atk_table_cell {
gint GetColumnSpan(AtkTableCell* cell) {
DCHECK(g_atk_table_cell_get_type);
g_return_val_if_fail(
G_TYPE_CHECK_INSTANCE_TYPE((cell), AtkTableCellInterface::GetType()), 0);
if (const AXPlatformNodeBase* obj =
AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(cell))) {
// If the object is not a cell, we return 0.
return obj->GetTableColumnSpan().value_or(0);
}
return 0;
}
GPtrArray* GetColumnHeaderCells(AtkTableCell* cell) {
DCHECK(g_atk_table_cell_get_type);
g_return_val_if_fail(
G_TYPE_CHECK_INSTANCE_TYPE((cell), AtkTableCellInterface::GetType()),
nullptr);
GPtrArray* array = g_ptr_array_new_with_free_func(g_object_unref);
auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(cell));
if (!obj)
return array;
// AtkTableCell is implemented on cells, row headers, and column headers.
// Calling GetColHeaderNodeIds() on a column header cell will include that
// column header, along with any other column headers in the column which
// may or may not describe the header cell in question. Therefore, just return
// headers for non-header cells.
if (obj->GetAtkRole() != ATK_ROLE_TABLE_CELL)
return array;
base::Optional<int> col_index = obj->GetTableColumn();
if (!col_index)
return array;
const std::vector<int32_t> ids =
obj->GetDelegate()->GetColHeaderNodeIds(*col_index);
for (const auto& node_id : ids) {
if (AXPlatformNode* node = obj->GetDelegate()->GetFromNodeID(node_id)) {
if (AtkObject* atk_node = node->GetNativeViewAccessible()) {
g_ptr_array_add(array, g_object_ref(atk_node));
}
}
}
return array;
}
gboolean GetCellPosition(AtkTableCell* cell, gint* row, gint* column) {
DCHECK(g_atk_table_cell_get_type);
g_return_val_if_fail(
G_TYPE_CHECK_INSTANCE_TYPE((cell), AtkTableCellInterface::GetType()),
FALSE);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(cell))) {
base::Optional<int> row_index = obj->GetTableRow();
base::Optional<int> col_index = obj->GetTableColumn();
if (!row_index || !col_index)
return false;
*row = *row_index;
*column = *col_index;
return true;
}
return false;
}
gint GetRowSpan(AtkTableCell* cell) {
DCHECK(g_atk_table_cell_get_type);
g_return_val_if_fail(
G_TYPE_CHECK_INSTANCE_TYPE((cell), AtkTableCellInterface::GetType()), 0);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(cell))) {
// If the object is not a cell, we return 0.
return obj->GetTableRowSpan().value_or(0);
}
return 0;
}
GPtrArray* GetRowHeaderCells(AtkTableCell* cell) {
DCHECK(g_atk_table_cell_get_type);
g_return_val_if_fail(
G_TYPE_CHECK_INSTANCE_TYPE((cell), AtkTableCellInterface::GetType()),
nullptr);
GPtrArray* array = g_ptr_array_new_with_free_func(g_object_unref);
auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(cell));
if (!obj)
return array;
// AtkTableCell is implemented on cells, row headers, and column headers.
// Calling GetRowHeaderNodeIds() on a row header cell will include that
// row header, along with any other row headers in the row which may or
// may not describe the header cell in question. Therefore, just return
// headers for non-header cells.
if (obj->GetAtkRole() != ATK_ROLE_TABLE_CELL)
return array;
base::Optional<int> row_index = obj->GetTableRow();
if (!row_index)
return array;
const std::vector<int32_t> ids =
obj->GetDelegate()->GetRowHeaderNodeIds(*row_index);
for (const auto& node_id : ids) {
if (AXPlatformNode* node = obj->GetDelegate()->GetFromNodeID(node_id)) {
if (AtkObject* atk_node = node->GetNativeViewAccessible()) {
g_ptr_array_add(array, g_object_ref(atk_node));
}
}
}
return array;
}
AtkObject* GetTable(AtkTableCell* cell) {
DCHECK(g_atk_table_cell_get_type);
g_return_val_if_fail(
G_TYPE_CHECK_INSTANCE_TYPE((cell), AtkTableCellInterface::GetType()),
nullptr);
if (auto* obj = AXPlatformNodeAuraLinux::FromAtkObject(ATK_OBJECT(cell))) {
if (auto* table = obj->GetTable())
return table->GetNativeViewAccessible();
}
return nullptr;
}
using AtkTableCellIface = struct _AtkTableCellIface;
void Init(AtkTableCellIface* iface) {
iface->get_column_span = GetColumnSpan;
iface->get_column_header_cells = GetColumnHeaderCells;
iface->get_position = GetCellPosition;
iface->get_row_span = GetRowSpan;
iface->get_row_header_cells = GetRowHeaderCells;
iface->get_table = GetTable;
}
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
nullptr, nullptr};
} // namespace atk_table_cell
#endif // ATK_212
namespace atk_object {
gpointer kAXPlatformNodeAuraLinuxParentClass = nullptr;
const gchar* GetName(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), nullptr);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
if (!obj->IsNameExposed())
return nullptr;
ax::mojom::NameFrom name_from = obj->GetData().GetNameFrom();
if (obj->GetName().empty() &&
name_from != ax::mojom::NameFrom::kAttributeExplicitlyEmpty)
return nullptr;
obj->accessible_name_ = obj->GetName();
return obj->accessible_name_.c_str();
}
const gchar* AtkGetName(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kGetName);
AXPlatformNodeAuraLinux::EnableAXMode();
return GetName(atk_object);
}
const gchar* GetDescription(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), nullptr);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return obj->GetStringAttribute(ax::mojom::StringAttribute::kDescription)
.c_str();
}
const gchar* AtkGetDescription(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kGetDescription);
AXPlatformNodeAuraLinux::EnableAXMode();
return GetDescription(atk_object);
}
gint GetNChildren(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), 0);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return 0;
return obj->GetChildCount();
}
gint AtkGetNChildren(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kGetNChildren);
AXPlatformNodeAuraLinux::EnableAXMode();
return GetNChildren(atk_object);
}
AtkObject* RefChild(AtkObject* atk_object, gint index) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), nullptr);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
if (index < 0 || index >= obj->GetChildCount())
return nullptr;
AtkObject* result = obj->ChildAtIndex(index);
if (result)
g_object_ref(result);
return result;
}
AtkObject* AtkRefChild(AtkObject* atk_object, gint index) {
RecordAccessibilityAtkApi(UmaAtkApi::kRefChild);
AXPlatformNodeAuraLinux::EnableAXMode();
return RefChild(atk_object, index);
}
gint GetIndexInParent(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), -1);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return -1;
return obj->GetIndexInParent().value_or(-1);
}
gint AtkGetIndexInParent(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kGetIndexInParent);
AXPlatformNodeAuraLinux::EnableAXMode();
return GetIndexInParent(atk_object);
}
AtkObject* GetParent(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), nullptr);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return obj->GetParent();
}
AtkObject* AtkGetParent(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kGetParent);
AXPlatformNodeAuraLinux::EnableAXMode();
return GetParent(atk_object);
}
AtkRelationSet* RefRelationSet(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), nullptr);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return atk_relation_set_new();
return obj->GetAtkRelations();
}
AtkRelationSet* AtkRefRelationSet(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kRefRelationSet);
AXPlatformNodeAuraLinux::EnableAXMode();
return RefRelationSet(atk_object);
}
AtkAttributeSet* GetAttributes(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), nullptr);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return nullptr;
return obj->GetAtkAttributes();
}
AtkAttributeSet* AtkGetAttributes(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kGetAttributes);
AXPlatformNodeAuraLinux::EnableAXMode();
return GetAttributes(atk_object);
}
AtkRole GetRole(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), ATK_ROLE_INVALID);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj)
return ATK_ROLE_INVALID;
return obj->GetAtkRole();
}
AtkRole AtkGetRole(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kGetRole);
AXPlatformNodeAuraLinux::EnableAXMode();
return GetRole(atk_object);
}
AtkStateSet* RefStateSet(AtkObject* atk_object) {
g_return_val_if_fail(ATK_IS_OBJECT(atk_object), nullptr);
AtkStateSet* atk_state_set =
ATK_OBJECT_CLASS(kAXPlatformNodeAuraLinuxParentClass)
->ref_state_set(atk_object);
AXPlatformNodeAuraLinux* obj =
AXPlatformNodeAuraLinux::FromAtkObject(atk_object);
if (!obj) {
atk_state_set_add_state(atk_state_set, ATK_STATE_DEFUNCT);
} else {
obj->GetAtkState(atk_state_set);
}
return atk_state_set;
}
AtkStateSet* AtkRefStateSet(AtkObject* atk_object) {
RecordAccessibilityAtkApi(UmaAtkApi::kRefStateSet);
AXPlatformNodeAuraLinux::EnableAXMode();
return RefStateSet(atk_object);
}
void Initialize(AtkObject* atk_object, gpointer data) {
if (ATK_OBJECT_CLASS(kAXPlatformNodeAuraLinuxParentClass)->initialize) {
ATK_OBJECT_CLASS(kAXPlatformNodeAuraLinuxParentClass)
->initialize(atk_object, data);
}
AX_PLATFORM_NODE_AURALINUX(atk_object)->m_object =
reinterpret_cast<AXPlatformNodeAuraLinux*>(data);
}
void Finalize(GObject* atk_object) {
G_OBJECT_CLASS(kAXPlatformNodeAuraLinuxParentClass)->finalize(atk_object);
}
void ClassInit(gpointer class_pointer, gpointer /* class_data */) {
GObjectClass* gobject_class = G_OBJECT_CLASS(class_pointer);
kAXPlatformNodeAuraLinuxParentClass = g_type_class_peek_parent(gobject_class);
gobject_class->finalize = Finalize;
AtkObjectClass* atk_object_class = ATK_OBJECT_CLASS(gobject_class);
atk_object_class->initialize = Initialize;
atk_object_class->get_name = AtkGetName;
atk_object_class->get_description = AtkGetDescription;
atk_object_class->get_parent = AtkGetParent;
atk_object_class->get_n_children = AtkGetNChildren;
atk_object_class->ref_child = AtkRefChild;
atk_object_class->get_role = AtkGetRole;
atk_object_class->ref_state_set = AtkRefStateSet;
atk_object_class->get_index_in_parent = AtkGetIndexInParent;
atk_object_class->ref_relation_set = AtkRefRelationSet;
atk_object_class->get_attributes = AtkGetAttributes;
}
GType GetType() {
AXPlatformNodeAuraLinux::EnsureGTypeInit();
static volatile gsize type_volatile = 0;
if (g_once_init_enter(&type_volatile)) {
static const GTypeInfo type_info = {
sizeof(AXPlatformNodeAuraLinuxClass), // class_size
nullptr, // base_init
nullptr, // base_finalize
atk_object::ClassInit,
nullptr, // class_finalize
nullptr, // class_data
sizeof(AXPlatformNodeAuraLinuxObject), // instance_size
0, // n_preallocs
nullptr, // instance_init
nullptr // value_table
};
GType type = g_type_register_static(
ATK_TYPE_OBJECT, "AXPlatformNodeAuraLinux", &type_info, GTypeFlags(0));
g_once_init_leave(&type_volatile, type);
}
return type_volatile;
}
void Detach(AXPlatformNodeAuraLinuxObject* atk_object) {
if (!atk_object->m_object)
return;
atk_object->m_object = nullptr;
atk_object_notify_state_change(ATK_OBJECT(atk_object), ATK_STATE_DEFUNCT,
TRUE);
}
} // namespace atk_object
} // namespace
// static
NO_SANITIZE("cfi-icall")
GType AtkTableCellInterface::GetType() {
return g_atk_table_cell_get_type();
}
// static
NO_SANITIZE("cfi-icall")
GPtrArray* AtkTableCellInterface::GetColumnHeaderCells(AtkTableCell* cell) {
return g_atk_table_cell_get_column_header_cells(cell);
}
// static
NO_SANITIZE("cfi-icall")
GPtrArray* AtkTableCellInterface::GetRowHeaderCells(AtkTableCell* cell) {
return g_atk_table_cell_get_row_header_cells(cell);
}
// static
NO_SANITIZE("cfi-icall")
bool AtkTableCellInterface::GetRowColumnSpan(AtkTableCell* cell,
gint* row,
gint* column,
gint* row_span,
gint* col_span) {
return g_atk_table_cell_get_row_column_span(cell, row, column, row_span,
col_span);
}
// static
bool AtkTableCellInterface::Exists() {
g_atk_table_cell_get_type = reinterpret_cast<GetTypeFunc>(
dlsym(RTLD_DEFAULT, "atk_table_cell_get_type"));
g_atk_table_cell_get_column_header_cells =
reinterpret_cast<GetColumnHeaderCellsFunc>(
dlsym(RTLD_DEFAULT, "atk_table_cell_get_column_header_cells"));
g_atk_table_cell_get_row_header_cells =
reinterpret_cast<GetRowHeaderCellsFunc>(
dlsym(RTLD_DEFAULT, "atk_table_cell_get_row_header_cells"));
g_atk_table_cell_get_row_column_span = reinterpret_cast<GetRowColumnSpanFunc>(
dlsym(RTLD_DEFAULT, "atk_table_cell_get_row_column_span"));
return *g_atk_table_cell_get_type;
}
void AXPlatformNodeAuraLinux::EnsureGTypeInit() {
#if !GLIB_CHECK_VERSION(2, 36, 0)
static bool first_time = true;
if (UNLIKELY(first_time)) {
g_type_init();
first_time = false;
}
#endif
}
// static
ImplementedAtkInterfaces AXPlatformNodeAuraLinux::GetGTypeInterfaceMask(
const AXNodeData& data) {
// The default implementation set includes the AtkComponent and AtkAction
// interfaces, which are provided by all the AtkObjects that we produce.
ImplementedAtkInterfaces interface_mask;
if (!IsImageOrVideo(data.role)) {
interface_mask.Add(ImplementedAtkInterfaces::Value::kText);
if (!data.IsPlainTextField())
interface_mask.Add(ImplementedAtkInterfaces::Value::kHypertext);
}
if (data.IsRangeValueSupported())
interface_mask.Add(ImplementedAtkInterfaces::Value::kValue);
if (ui::IsDocument(data.role))
interface_mask.Add(ImplementedAtkInterfaces::Value::kDocument);
if (IsImage(data.role))
interface_mask.Add(ImplementedAtkInterfaces::Value::kImage);
// The AtkHyperlinkImpl interface allows getting a AtkHyperlink from an
// AtkObject. It is indeed implemented by actual web hyperlinks, but also by
// objects that will become embedded objects in ATK hypertext, so the name is
// a bit of a misnomer from the ATK API.
if (IsLink(data.role) || data.role == ax::mojom::Role::kAnchor ||
!ui::IsText(data.role)) {
interface_mask.Add(ImplementedAtkInterfaces::Value::kHyperlink);
}
if (data.role == ax::mojom::Role::kWindow)
interface_mask.Add(ImplementedAtkInterfaces::Value::kWindow);
if (IsContainerWithSelectableChildren(data.role))
interface_mask.Add(ImplementedAtkInterfaces::Value::kSelection);
if (IsTableLike(data.role))
interface_mask.Add(ImplementedAtkInterfaces::Value::kTable);
// Because the TableCell Interface is only supported in ATK version 2.12 and
// later, GetAccessibilityGType has a runtime check to verify we have a recent
// enough version. If we don't, GetAccessibilityGType will exclude
// AtkTableCell from the supported interfaces and none of its methods or
// properties will be exposed to assistive technologies.
if (IsCellOrTableHeader(data.role))
interface_mask.Add(ImplementedAtkInterfaces::Value::kTableCell);
return interface_mask;
}
GType AXPlatformNodeAuraLinux::GetAccessibilityGType() {
static const GTypeInfo type_info = {
sizeof(AXPlatformNodeAuraLinuxClass),
(GBaseInitFunc) nullptr,
(GBaseFinalizeFunc) nullptr,
(GClassInitFunc) nullptr,
(GClassFinalizeFunc) nullptr,
nullptr, /* class data */
sizeof(AXPlatformNodeAuraLinuxObject), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) nullptr,
nullptr /* value table */
};
const char* atk_type_name = GetUniqueAccessibilityGTypeName(interface_mask_);
GType type = g_type_from_name(atk_type_name);
if (type)
return type;
type = g_type_register_static(AX_PLATFORM_NODE_AURALINUX_TYPE, atk_type_name,
&type_info, GTypeFlags(0));
// The AtkComponent and AtkAction interfaces are always supported.
g_type_add_interface_static(type, ATK_TYPE_COMPONENT, &atk_component::Info);
g_type_add_interface_static(type, ATK_TYPE_ACTION, &atk_action::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kDocument))
g_type_add_interface_static(type, ATK_TYPE_DOCUMENT, &atk_document::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kImage))
g_type_add_interface_static(type, ATK_TYPE_IMAGE, &atk_image::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kValue))
g_type_add_interface_static(type, ATK_TYPE_VALUE, &atk_value::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kHyperlink)) {
g_type_add_interface_static(type, ATK_TYPE_HYPERLINK_IMPL,
&atk_hyperlink::Info);
}
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kHypertext))
g_type_add_interface_static(type, ATK_TYPE_HYPERTEXT, &atk_hypertext::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kText))
g_type_add_interface_static(type, ATK_TYPE_TEXT, &atk_text::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kWindow))
g_type_add_interface_static(type, ATK_TYPE_WINDOW, &atk_window::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kSelection))
g_type_add_interface_static(type, ATK_TYPE_SELECTION, &atk_selection::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kTable))
g_type_add_interface_static(type, ATK_TYPE_TABLE, &atk_table::Info);
if (interface_mask_.Implements(ImplementedAtkInterfaces::Value::kTableCell)) {
// Run-time check to ensure AtkTableCell is supported (requires ATK 2.12).
if (AtkTableCellInterface::Exists()) {
g_type_add_interface_static(type, AtkTableCellInterface::GetType(),
&atk_table_cell::Info);
}
}
return type;
}
void AXPlatformNodeAuraLinux::SetDocumentParentOnFrameIfNecessary() {
if (GetAtkRole() != ATK_ROLE_DOCUMENT_WEB)
return;
if (!GetDelegate()->IsWebContent())
return;
AtkObject* parent_atk_object = GetParent();
AXPlatformNodeAuraLinux* parent =
AXPlatformNodeAuraLinux::FromAtkObject(parent_atk_object);
if (!parent)
return;
if (parent->GetDelegate()->IsWebContent())
return;
AXPlatformNodeAuraLinux* frame = AXPlatformNodeAuraLinux::FromAtkObject(
FindAtkObjectParentFrame(parent_atk_object));
if (!frame)
return;
frame->SetDocumentParent(parent_atk_object);
}
AtkObject* AXPlatformNodeAuraLinux::FindFirstWebContentDocument() {
for (auto child_iterator_ptr = GetDelegate()->ChildrenBegin();
*child_iterator_ptr != *GetDelegate()->ChildrenEnd();
++(*child_iterator_ptr)) {
AtkObject* child = child_iterator_ptr->GetNativeViewAccessible();
auto* child_node = AXPlatformNodeAuraLinux::FromAtkObject(child);
if (!child_node)
continue;
if (!child_node->GetDelegate()->IsWebContent())
continue;
if (child_node->GetAtkRole() != ATK_ROLE_DOCUMENT_WEB)
continue;
return child;
}
return nullptr;
}
AtkObject* AXPlatformNodeAuraLinux::CreateAtkObject() {
if (GetData().role != ax::mojom::Role::kApplication &&
!GetAccessibilityMode().has_mode(AXMode::kNativeAPIs))
return nullptr;
if (GetDelegate()->IsChildOfLeaf())
return nullptr;
EnsureGTypeInit();
interface_mask_ = GetGTypeInterfaceMask(GetData());
GType type = GetAccessibilityGType();
AtkObject* atk_object = static_cast<AtkObject*>(g_object_new(type, nullptr));
atk_object_initialize(atk_object, this);
SetDocumentParentOnFrameIfNecessary();
return ATK_OBJECT(atk_object);
}
void AXPlatformNodeAuraLinux::DestroyAtkObjects() {
if (atk_hyperlink_) {
ax_platform_atk_hyperlink_set_object(
AX_PLATFORM_ATK_HYPERLINK(atk_hyperlink_), nullptr);
g_object_unref(atk_hyperlink_);
atk_hyperlink_ = nullptr;
}
if (atk_object_) {
// We explicitly clear g_current_focused and g_current_active_descendant
// just in case there is another reference to atk_object_ somewhere.
if (atk_object_ == g_current_focused)
SetWeakGPtrToAtkObject(&g_current_focused, nullptr);
if (atk_object_ == g_current_active_descendant)
SetWeakGPtrToAtkObject(&g_current_active_descendant, nullptr);
atk_object::Detach(AX_PLATFORM_NODE_AURALINUX(atk_object_));
g_object_unref(atk_object_);
atk_object_ = nullptr;
}
}
// static
AXPlatformNode* AXPlatformNode::Create(AXPlatformNodeDelegate* delegate) {
AXPlatformNodeAuraLinux* node = new AXPlatformNodeAuraLinux();
node->Init(delegate);
return node;
}
// static
AXPlatformNode* AXPlatformNode::FromNativeViewAccessible(
gfx::NativeViewAccessible accessible) {
return AXPlatformNodeAuraLinux::FromAtkObject(accessible);
}
//
// AXPlatformNodeAuraLinux implementation.
//
// static
AXPlatformNodeAuraLinux* AXPlatformNodeAuraLinux::FromAtkObject(
const AtkObject* atk_object) {
if (!atk_object)
return nullptr;
if (IS_AX_PLATFORM_NODE_AURALINUX(atk_object)) {
AXPlatformNodeAuraLinuxObject* platform_object =
AX_PLATFORM_NODE_AURALINUX(atk_object);
return platform_object->m_object;
}
return nullptr;
}
// static
void AXPlatformNodeAuraLinux::SetApplication(AXPlatformNode* application) {
g_root_application = application;
}
// static
AXPlatformNode* AXPlatformNodeAuraLinux::application() {
return g_root_application;
}
// static
void AXPlatformNodeAuraLinux::StaticInitialize() {
AtkUtilAuraLinux::GetInstance()->InitializeAsync();
}
// static
void AXPlatformNodeAuraLinux::EnableAXMode() {
// TODO(https://crbug.com/1086506): After figuring out what API calls are
// giving us false positives, enable it again. For now, don't activate AX
// through ATK calls.
// AXPlatformNode::NotifyAddAXModeFlags(kAXModeComplete);
}
AtkRole AXPlatformNodeAuraLinux::GetAtkRole() const {
switch (GetData().role) {
case ax::mojom::Role::kAlert:
return ATK_ROLE_NOTIFICATION;
case ax::mojom::Role::kAlertDialog:
return ATK_ROLE_ALERT;
case ax::mojom::Role::kAnchor:
return ATK_ROLE_LINK;
case ax::mojom::Role::kComment:
case ax::mojom::Role::kSuggestion:
return ATK_ROLE_SECTION;
case ax::mojom::Role::kApplication:
// Only use ATK_ROLE_APPLICATION for elements with no parent, since it
// is only for top level app windows and not ARIA applications.
if (!GetParent()) {
return ATK_ROLE_APPLICATION;
} else {
return ATK_ROLE_EMBEDDED;
}
case ax::mojom::Role::kArticle:
return ATK_ROLE_ARTICLE;
case ax::mojom::Role::kAudio:
return ATK_ROLE_AUDIO;
case ax::mojom::Role::kBanner:
case ax::mojom::Role::kHeader:
return ATK_ROLE_LANDMARK;
case ax::mojom::Role::kBlockquote:
return ATK_ROLE_BLOCK_QUOTE;
case ax::mojom::Role::kCaret:
return ATK_ROLE_UNKNOWN;
case ax::mojom::Role::kButton:
return ATK_ROLE_PUSH_BUTTON;
case ax::mojom::Role::kCanvas:
return ATK_ROLE_CANVAS;
case ax::mojom::Role::kCaption:
return ATK_ROLE_CAPTION;
case ax::mojom::Role::kCell:
return ATK_ROLE_TABLE_CELL;
case ax::mojom::Role::kCheckBox:
return ATK_ROLE_CHECK_BOX;
case ax::mojom::Role::kSwitch:
return ATK_ROLE_TOGGLE_BUTTON;
case ax::mojom::Role::kColorWell:
return ATK_ROLE_PUSH_BUTTON;
case ax::mojom::Role::kColumn:
return ATK_ROLE_UNKNOWN;
case ax::mojom::Role::kColumnHeader:
return ATK_ROLE_COLUMN_HEADER;
case ax::mojom::Role::kComboBoxGrouping:
return ATK_ROLE_COMBO_BOX;
case ax::mojom::Role::kComboBoxMenuButton:
return ATK_ROLE_COMBO_BOX;
case ax::mojom::Role::kComplementary:
return ATK_ROLE_LANDMARK;
case ax::mojom::Role::kContentDeletion:
return kAtkRoleContentDeletion;
case ax::mojom::Role::kContentInsertion:
return kAtkRoleContentInsertion;
case ax::mojom::Role::kContentInfo:
case ax::mojom::Role::kFooter:
return ATK_ROLE_LANDMARK;
case ax::mojom::Role::kDate:
return ATK_ROLE_DATE_EDITOR;
case ax::mojom::Role::kDateTime:
return ATK_ROLE_DATE_EDITOR;
case ax::mojom::Role::kDefinition:
case ax::mojom::Role::kDescriptionListDetail:
return ATK_ROLE_DESCRIPTION_VALUE;
case ax::mojom::Role::kDescriptionList:
return ATK_ROLE_DESCRIPTION_LIST;
case ax::mojom::Role::kDescriptionListTerm:
return ATK_ROLE_DESCRIPTION_TERM;
case ax::mojom::Role::kDetails:
return ATK_ROLE_PANEL;
case ax::mojom::Role::kDialog:
return ATK_ROLE_DIALOG;
case ax::mojom::Role::kDirectory:
return ATK_ROLE_LIST;
case ax::mojom::Role::kDisclosureTriangle:
return ATK_ROLE_TOGGLE_BUTTON;
case ax::mojom::Role::kDocCover:
return ATK_ROLE_IMAGE;
case ax::mojom::Role::kDocBackLink:
case ax::mojom::Role::kDocBiblioRef:
case ax::mojom::Role::kDocGlossRef:
case ax::mojom::Role::kDocNoteRef:
return ATK_ROLE_LINK;
case ax::mojom::Role::kDocBiblioEntry:
case ax::mojom::Role::kDocEndnote:
return ATK_ROLE_LIST_ITEM;
case ax::mojom::Role::kDocNotice:
case ax::mojom::Role::kDocTip:
return ATK_ROLE_COMMENT;
case ax::mojom::Role::kDocFootnote:
return kAtkFootnoteRole;
case ax::mojom::Role::kDocPageBreak:
return ATK_ROLE_SEPARATOR;
case ax::mojom::Role::kDocAcknowledgments:
case ax::mojom::Role::kDocAfterword:
case ax::mojom::Role::kDocAppendix:
case ax::mojom::Role::kDocBibliography:
case ax::mojom::Role::kDocChapter:
case ax::mojom::Role::kDocConclusion:
case ax::mojom::Role::kDocCredits:
case ax::mojom::Role::kDocEndnotes:
case ax::mojom::Role::kDocEpilogue:
case ax::mojom::Role::kDocErrata:
case ax::mojom::Role::kDocForeword:
case ax::mojom::Role::kDocGlossary:
case ax::mojom::Role::kDocIndex:
case ax::mojom::Role::kDocIntroduction:
case ax::mojom::Role::kDocPageList:
case ax::mojom::Role::kDocPart:
case ax::mojom::Role::kDocPreface:
case ax::mojom::Role::kDocPrologue:
case ax::mojom::Role::kDocToc:
return ATK_ROLE_LANDMARK;
case ax::mojom::Role::kDocAbstract:
case ax::mojom::Role::kDocColophon:
case ax::mojom::Role::kDocCredit:
case ax::mojom::Role::kDocDedication:
case ax::mojom::Role::kDocEpigraph:
case ax::mojom::Role::kDocExample:
case ax::mojom::Role::kDocPullquote:
case ax::mojom::Role::kDocQna:
return ATK_ROLE_SECTION;
case ax::mojom::Role::kDocSubtitle:
return ATK_ROLE_HEADING;
case ax::mojom::Role::kDocument:
return ATK_ROLE_DOCUMENT_FRAME;
case ax::mojom::Role::kEmbeddedObject:
return ATK_ROLE_EMBEDDED;
case ax::mojom::Role::kForm:
// TODO(accessibility) Forms which lack an accessible name are no longer
// exposed as forms. http://crbug.com/874384. Forms which have accessible
// names should be exposed as ATK_ROLE_LANDMARK according to Core AAM.
return ATK_ROLE_FORM;
case ax::mojom::Role::kFigure:
case ax::mojom::Role::kFeed:
return ATK_ROLE_PANEL;
case ax::mojom::Role::kGenericContainer:
case ax::mojom::Role::kFooterAsNonLandmark:
case ax::mojom::Role::kHeaderAsNonLandmark:
return ATK_ROLE_SECTION;
case ax::mojom::Role::kGraphicsDocument:
return ATK_ROLE_DOCUMENT_FRAME;
case ax::mojom::Role::kGraphicsObject:
return ATK_ROLE_PANEL;
case ax::mojom::Role::kGraphicsSymbol:
return ATK_ROLE_IMAGE;
case ax::mojom::Role::kGrid:
return ATK_ROLE_TABLE;
case ax::mojom::Role::kGroup:
return ATK_ROLE_PANEL;
case ax::mojom::Role::kHeading:
return ATK_ROLE_HEADING;
case ax::mojom::Role::kIframe:
case ax::mojom::Role::kIframePresentational:
return ATK_ROLE_INTERNAL_FRAME;
case ax::mojom::Role::kIgnored:
return ATK_ROLE_REDUNDANT_OBJECT;
case ax::mojom::Role::kImage:
return ATK_ROLE_IMAGE;
case ax::mojom::Role::kImageMap:
return ATK_ROLE_IMAGE_MAP;
case ax::mojom::Role::kInlineTextBox:
return kStaticRole;
case ax::mojom::Role::kInputTime:
return ATK_ROLE_DATE_EDITOR;
case ax::mojom::Role::kLabelText:
return ATK_ROLE_LABEL;
case ax::mojom::Role::kLegend:
return ATK_ROLE_LABEL;
// Layout table objects are treated the same as Role::kGenericContainer.
case ax::mojom::Role::kLayoutTable:
return ATK_ROLE_SECTION;
case ax::mojom::Role::kLayoutTableCell:
return ATK_ROLE_SECTION;
case ax::mojom::Role::kLayoutTableRow:
return ATK_ROLE_SECTION;
case ax::mojom::Role::kLineBreak:
// TODO(Accessibility) Having a separate accessible object for line breaks
// is inconsistent with other implementations. http://crbug.com/873144#c1.
return kStaticRole;
case ax::mojom::Role::kLink:
return ATK_ROLE_LINK;
case ax::mojom::Role::kList:
return ATK_ROLE_LIST;
case ax::mojom::Role::kListBox:
return ATK_ROLE_LIST_BOX;
// TODO(Accessibility) Use ATK_ROLE_MENU_ITEM inside a combo box, see how
// ax_platform_node_win.cc code does this.
case ax::mojom::Role::kListBoxOption:
return ATK_ROLE_LIST_ITEM;
case ax::mojom::Role::kListGrid:
return ATK_ROLE_TABLE;
case ax::mojom::Role::kListItem:
return ATK_ROLE_LIST_ITEM;
case ax::mojom::Role::kListMarker:
if (!GetChildCount()) {
// There's only a name attribute when using Legacy layout. With Legacy
// layout, list markers have no child and are considered as StaticText.
// We consider a list marker as a group in LayoutNG since it has
// a text child node.
return kStaticRole;
}
return ATK_ROLE_PANEL;
case ax::mojom::Role::kLog:
return ATK_ROLE_LOG;
case ax::mojom::Role::kMain:
return ATK_ROLE_LANDMARK;
case ax::mojom::Role::kMark:
return kStaticRole;
case ax::mojom::Role::kMath:
return ATK_ROLE_MATH;
case ax::mojom::Role::kMarquee:
return ATK_ROLE_MARQUEE;
case ax::mojom::Role::kMenu:
return ATK_ROLE_MENU;
case ax::mojom::Role::kMenuButton:
return ATK_ROLE_MENU;
case ax::mojom::Role::kMenuBar:
return ATK_ROLE_MENU_BAR;
case ax::mojom::Role::kMenuItem:
return ATK_ROLE_MENU_ITEM;
case ax::mojom::Role::kMenuItemCheckBox:
return ATK_ROLE_CHECK_MENU_ITEM;
case ax::mojom::Role::kMenuItemRadio:
return ATK_ROLE_RADIO_MENU_ITEM;
case ax::mojom::Role::kMenuListPopup:
return ATK_ROLE_MENU;
case ax::mojom::Role::kMenuListOption:
return ATK_ROLE_MENU_ITEM;
case ax::mojom::Role::kMeter:
return ATK_ROLE_LEVEL_BAR;
case ax::mojom::Role::kNavigation:
return ATK_ROLE_LANDMARK;
case ax::mojom::Role::kNote:
return ATK_ROLE_COMMENT;
case ax::mojom::Role::kPane:
case ax::mojom::Role::kScrollView:
return ATK_ROLE_PANEL;
case ax::mojom::Role::kParagraph:
return ATK_ROLE_PARAGRAPH;
case ax::mojom::Role::kPdfActionableHighlight:
return ATK_ROLE_PUSH_BUTTON;
case ax::mojom::Role::kPluginObject:
return ATK_ROLE_EMBEDDED;
case ax::mojom::Role::kPopUpButton: {
std::string html_tag =
GetData().GetStringAttribute(ax::mojom::StringAttribute::kHtmlTag);
if (html_tag == "select")
return ATK_ROLE_COMBO_BOX;
return ATK_ROLE_PUSH_BUTTON;
}
case ax::mojom::Role::kPortal:
return ATK_ROLE_PUSH_BUTTON;
case ax::mojom::Role::kPre:
return ATK_ROLE_SECTION;
case ax::mojom::Role::kProgressIndicator:
return ATK_ROLE_PROGRESS_BAR;
case ax::mojom::Role::kRadioButton:
return ATK_ROLE_RADIO_BUTTON;
case ax::mojom::Role::kRadioGroup:
return ATK_ROLE_PANEL;
case ax::mojom::Role::kRegion:
return ATK_ROLE_LANDMARK;
case ax::mojom::Role::kRootWebArea:
return ATK_ROLE_DOCUMENT_WEB;
case ax::mojom::Role::kRow:
return ATK_ROLE_TABLE_ROW;
case ax::mojom::Role::kRowGroup:
return ATK_ROLE_PANEL;
case ax::mojom::Role::kRowHeader:
return ATK_ROLE_ROW_HEADER;
case ax::mojom::Role::kRuby:
return kStaticRole;
case ax::mojom::Role::kRubyAnnotation:
// TODO(accessibility) Panels are generally for containers of widgets.
// This should probably be a section (if a container) or static if text.
return ATK_ROLE_PANEL;
case ax::mojom::Role::kSection: {
if (GetName().empty()) {
// Do not use ARIA mapping for nameless <section>.
return ATK_ROLE_SECTION;
} else {
// Use ARIA mapping.
return ATK_ROLE_LANDMARK;
}
}
case ax::mojom::Role::kScrollBar:
return ATK_ROLE_SCROLL_BAR;
case ax::mojom::Role::kSearch:
return ATK_ROLE_LANDMARK;
case ax::mojom::Role::kSlider:
case ax::mojom::Role::kSliderThumb:
return ATK_ROLE_SLIDER;
case ax::mojom::Role::kSpinButton:
return ATK_ROLE_SPIN_BUTTON;
case ax::mojom::Role::kSplitter:
return ATK_ROLE_SEPARATOR;
case ax::mojom::Role::kStaticText: {
switch (static_cast<ax::mojom::TextPosition>(
GetIntAttribute(ax::mojom::IntAttribute::kTextPosition))) {
case ax::mojom::TextPosition::kSubscript:
return kSubscriptRole;
case ax::mojom::TextPosition::kSuperscript:
return kSuperscriptRole;
default:
break;
}
return kStaticRole;
}
case ax::mojom::Role::kStatus:
return ATK_ROLE_STATUSBAR;
case ax::mojom::Role::kSvgRoot:
return ATK_ROLE_DOCUMENT_FRAME;
case ax::mojom::Role::kTab:
return ATK_ROLE_PAGE_TAB;
case ax::mojom::Role::kTable:
return ATK_ROLE_TABLE;
case ax::mojom::Role::kTableHeaderContainer:
// TODO(accessibility) This mapping is correct, but it doesn't seem to be
// used. We don't necessarily want to always expose these containers, but
// we must do so if they are focusable. http://crbug.com/874043
return ATK_ROLE_PANEL;
case ax::mojom::Role::kTabList:
return ATK_ROLE_PAGE_TAB_LIST;
case ax::mojom::Role::kTabPanel:
return ATK_ROLE_SCROLL_PANE;
case ax::mojom::Role::kTerm:
// TODO(accessibility) This mapping should also be applied to the dfn
// element. http://crbug.com/874411
return ATK_ROLE_DESCRIPTION_TERM;
case ax::mojom::Role::kTitleBar:
return ATK_ROLE_TITLE_BAR;
case ax::mojom::Role::kTextField:
case ax::mojom::Role::kSearchBox:
if (GetData().HasState(ax::mojom::State::kProtected))
return ATK_ROLE_PASSWORD_TEXT;
return ATK_ROLE_ENTRY;
case ax::mojom::Role::kTextFieldWithComboBox:
return ATK_ROLE_COMBO_BOX;
case ax::mojom::Role::kAbbr:
case ax::mojom::Role::kCode:
case ax::mojom::Role::kEmphasis:
case ax::mojom::Role::kStrong:
case ax::mojom::Role::kTime:
return kStaticRole;
case ax::mojom::Role::kTimer:
return ATK_ROLE_TIMER;
case ax::mojom::Role::kToggleButton:
return ATK_ROLE_TOGGLE_BUTTON;
case ax::mojom::Role::kToolbar:
return ATK_ROLE_TOOL_BAR;
case ax::mojom::Role::kTooltip:
return ATK_ROLE_TOOL_TIP;
case ax::mojom::Role::kTree:
return ATK_ROLE_TREE;
case ax::mojom::Role::kTreeItem:
return ATK_ROLE_TREE_ITEM;
case ax::mojom::Role::kTreeGrid:
return ATK_ROLE_TREE_TABLE;
case ax::mojom::Role::kVideo:
return ATK_ROLE_VIDEO;
case ax::mojom::Role::kWebArea:
case ax::mojom::Role::kWebView:
return ATK_ROLE_DOCUMENT_WEB;
case ax::mojom::Role::kWindow:
// In ATK elements with ATK_ROLE_FRAME are windows with titles and
// buttons, while those with ATK_ROLE_WINDOW are windows without those
// elements.
return ATK_ROLE_FRAME;
case ax::mojom::Role::kClient:
case ax::mojom::Role::kDesktop:
return ATK_ROLE_PANEL;
case ax::mojom::Role::kFigcaption:
return ATK_ROLE_CAPTION;
case ax::mojom::Role::kUnknown:
// When we are not in web content, assume that a node with an unknown
// role is a view (which often have the unknown role).
return !GetDelegate()->IsWebContent() ? ATK_ROLE_PANEL : ATK_ROLE_UNKNOWN;
case ax::mojom::Role::kImeCandidate:
case ax::mojom::Role::kKeyboard:
case ax::mojom::Role::kNone:
case ax::mojom::Role::kPresentational:
return ATK_ROLE_REDUNDANT_OBJECT;
}
}
void AXPlatformNodeAuraLinux::GetAtkState(AtkStateSet* atk_state_set) {
AXNodeData data = GetData();
bool menu_active = !GetActiveMenus().empty();
if (!menu_active && atk_object_ == g_active_top_level_frame)
atk_state_set_add_state(atk_state_set, ATK_STATE_ACTIVE);
if (menu_active &&
FindAtkObjectParentFrame(GetActiveMenus().back()) == atk_object_)
atk_state_set_add_state(atk_state_set, ATK_STATE_ACTIVE);
if (atk_object_ && atk_object_ == g_active_views_dialog)
atk_state_set_add_state(atk_state_set, ATK_STATE_ACTIVE);
bool is_minimized = delegate_->IsMinimized();
if (is_minimized && data.role == ax::mojom::Role::kWindow)
atk_state_set_add_state(atk_state_set, ATK_STATE_ICONIFIED);
if (data.HasState(ax::mojom::State::kCollapsed))
atk_state_set_add_state(atk_state_set, ATK_STATE_EXPANDABLE);
if (data.HasState(ax::mojom::State::kDefault))
atk_state_set_add_state(atk_state_set, ATK_STATE_DEFAULT);
if ((data.HasState(ax::mojom::State::kEditable) ||
data.HasState(ax::mojom::State::kRichlyEditable)) &&
data.GetRestriction() != ax::mojom::Restriction::kReadOnly) {
atk_state_set_add_state(atk_state_set, ATK_STATE_EDITABLE);
}
if (data.HasState(ax::mojom::State::kExpanded)) {
atk_state_set_add_state(atk_state_set, ATK_STATE_EXPANDABLE);
atk_state_set_add_state(atk_state_set, ATK_STATE_EXPANDED);
}
if (data.HasState(ax::mojom::State::kFocusable) ||
SelectionAndFocusAreTheSame())
atk_state_set_add_state(atk_state_set, ATK_STATE_FOCUSABLE);
if (data.HasState(ax::mojom::State::kHorizontal))
atk_state_set_add_state(atk_state_set, ATK_STATE_HORIZONTAL);
if (!data.HasState(ax::mojom::State::kInvisible)) {
atk_state_set_add_state(atk_state_set, ATK_STATE_VISIBLE);
if (!delegate_->IsOffscreen() && !is_minimized)
atk_state_set_add_state(atk_state_set, ATK_STATE_SHOWING);
}
if (data.HasState(ax::mojom::State::kMultiselectable))
atk_state_set_add_state(atk_state_set, ATK_STATE_MULTISELECTABLE);
if (data.HasState(ax::mojom::State::kRequired))
atk_state_set_add_state(atk_state_set, ATK_STATE_REQUIRED);
if (data.HasState(ax::mojom::State::kVertical))
atk_state_set_add_state(atk_state_set, ATK_STATE_VERTICAL);
if (data.HasState(ax::mojom::State::kVisited))
atk_state_set_add_state(atk_state_set, ATK_STATE_VISITED);
if (data.HasIntAttribute(ax::mojom::IntAttribute::kInvalidState) &&
data.GetIntAttribute(ax::mojom::IntAttribute::kInvalidState) !=
static_cast<int32_t>(ax::mojom::InvalidState::kFalse))
atk_state_set_add_state(atk_state_set, ATK_STATE_INVALID_ENTRY);
#if defined(ATK_216)
if (IsPlatformCheckable())
atk_state_set_add_state(atk_state_set, ATK_STATE_CHECKABLE);
if (data.HasIntAttribute(ax::mojom::IntAttribute::kHasPopup))
atk_state_set_add_state(atk_state_set, ATK_STATE_HAS_POPUP);
#endif
if (data.GetBoolAttribute(ax::mojom::BoolAttribute::kBusy))
atk_state_set_add_state(atk_state_set, ATK_STATE_BUSY);
if (data.GetBoolAttribute(ax::mojom::BoolAttribute::kModal))
atk_state_set_add_state(atk_state_set, ATK_STATE_MODAL);
if (data.HasBoolAttribute(ax::mojom::BoolAttribute::kSelected))
atk_state_set_add_state(atk_state_set, ATK_STATE_SELECTABLE);
if (data.GetBoolAttribute(ax::mojom::BoolAttribute::kSelected))
atk_state_set_add_state(atk_state_set, ATK_STATE_SELECTED);
if (IsPlainTextField() || IsRichTextField()) {
atk_state_set_add_state(atk_state_set, ATK_STATE_SELECTABLE_TEXT);
if (data.HasState(ax::mojom::State::kMultiline))
atk_state_set_add_state(atk_state_set, ATK_STATE_MULTI_LINE);
else
atk_state_set_add_state(atk_state_set, ATK_STATE_SINGLE_LINE);
}
if (!GetStringAttribute(ax::mojom::StringAttribute::kAutoComplete).empty() ||
data.HasState(ax::mojom::State::kAutofillAvailable))
atk_state_set_add_state(atk_state_set, ATK_STATE_SUPPORTS_AUTOCOMPLETION);
// Checked state
const auto checked_state = GetData().GetCheckedState();
if (checked_state == ax::mojom::CheckedState::kTrue ||
checked_state == ax::mojom::CheckedState::kMixed) {
atk_state_set_add_state(atk_state_set, GetAtkStateTypeForCheckableNode());
}
if (data.GetRestriction() != ax::mojom::Restriction::kDisabled) {
if (IsReadOnlySupported(data.role) && data.IsReadOnlyOrDisabled()) {
#if defined(ATK_216)
atk_state_set_add_state(atk_state_set, ATK_STATE_READ_ONLY);
#endif
} else {
atk_state_set_add_state(atk_state_set, ATK_STATE_ENABLED);
atk_state_set_add_state(atk_state_set, ATK_STATE_SENSITIVE);
}
}
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
if (delegate_->GetFocus() == atk_object)
atk_state_set_add_state(atk_state_set, ATK_STATE_FOCUSED);
// It is insufficient to compare with g_current_activedescendant due to both
// timing and event ordering for objects which implement AtkSelection and also
// have an active descendant. For instance, if we check the state set of a
// selectable child, it will only have ATK_STATE_FOCUSED if we've processed
// the activedescendant change.
if (GetActiveDescendantOfCurrentFocused() == atk_object)
atk_state_set_add_state(atk_state_set, ATK_STATE_FOCUSED);
}
struct AtkIntRelation {
ax::mojom::IntAttribute attribute;
AtkRelationType relation;
base::Optional<AtkRelationType> reverse_relation;
};
static AtkIntRelation kIntRelations[] = {
{ax::mojom::IntAttribute::kMemberOfId, ATK_RELATION_MEMBER_OF,
base::nullopt},
{ax::mojom::IntAttribute::kPopupForId, ATK_RELATION_POPUP_FOR,
base::nullopt},
#if defined(ATK_226)
{ax::mojom::IntAttribute::kErrormessageId, ATK_RELATION_ERROR_MESSAGE,
ATK_RELATION_ERROR_FOR},
#endif
};
struct AtkIntListRelation {
ax::mojom::IntListAttribute attribute;
AtkRelationType relation;
base::Optional<AtkRelationType> reverse_relation;
};
static AtkIntListRelation kIntListRelations[] = {
{ax::mojom::IntListAttribute::kControlsIds, ATK_RELATION_CONTROLLER_FOR,
ATK_RELATION_CONTROLLED_BY},
#if defined(ATK_226)
{ax::mojom::IntListAttribute::kDetailsIds, ATK_RELATION_DETAILS,
ATK_RELATION_DETAILS_FOR},
#endif
{ax::mojom::IntListAttribute::kDescribedbyIds, ATK_RELATION_DESCRIBED_BY,
ATK_RELATION_DESCRIPTION_FOR},
{ax::mojom::IntListAttribute::kFlowtoIds, ATK_RELATION_FLOWS_TO,
ATK_RELATION_FLOWS_FROM},
{ax::mojom::IntListAttribute::kLabelledbyIds, ATK_RELATION_LABELLED_BY,
ATK_RELATION_LABEL_FOR},
};
void AXPlatformNodeAuraLinux::AddRelationToSet(AtkRelationSet* relation_set,
AtkRelationType relation,
AXPlatformNode* target) {
DCHECK(target);
// Avoid adding self-referential relations.
if (target == this)
return;
// If we were compiled with a newer version of ATK than the runtime version,
// it's possible that we might try to add a relation that doesn't exist in
// the runtime version of the AtkRelationType enum. This will cause a runtime
// error, so return early here if we are about to do that.
static base::Optional<int> max_relation_type = base::nullopt;
if (!max_relation_type.has_value()) {
GEnumClass* enum_class =
G_ENUM_CLASS(g_type_class_ref(atk_relation_type_get_type()));
max_relation_type = enum_class->maximum;
g_type_class_unref(enum_class);
}
if (relation > max_relation_type.value())
return;
atk_relation_set_add_relation_by_type(relation_set, relation,
target->GetNativeViewAccessible());
}
AtkRelationSet* AXPlatformNodeAuraLinux::GetAtkRelations() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return nullptr;
AtkRelationSet* relation_set = atk_relation_set_new();
if (GetDelegate()->IsWebContent() && GetAtkRole() == ATK_ROLE_DOCUMENT_WEB) {
AtkObject* parent_frame = FindAtkObjectParentFrame(atk_object);
if (parent_frame) {
atk_relation_set_add_relation_by_type(
relation_set, ATK_RELATION_EMBEDDED_BY, parent_frame);
}
}
if (auto* document_parent = FromAtkObject(document_parent_)) {
AtkObject* document = document_parent->FindFirstWebContentDocument();
if (document) {
atk_relation_set_add_relation_by_type(relation_set, ATK_RELATION_EMBEDS,
document);
}
}
// For each possible relation defined by an IntAttribute, we test that
// attribute and then look for reverse relations. AddRelationToSet handles
// discarding self-referential relations.
for (unsigned i = 0; i < G_N_ELEMENTS(kIntRelations); i++) {
const AtkIntRelation& relation = kIntRelations[i];
if (AXPlatformNode* target =
GetDelegate()->GetTargetNodeForRelation(relation.attribute))
AddRelationToSet(relation_set, relation.relation, target);
if (!relation.reverse_relation.has_value())
continue;
std::set<AXPlatformNode*> target_ids =
GetDelegate()->GetReverseRelations(relation.attribute);
for (AXPlatformNode* target : target_ids) {
AddRelationToSet(relation_set, relation.reverse_relation.value(), target);
}
}
// Now we do the same for each possible relation defined by an
// IntListAttribute. In this case we need to handle each target in the list.
for (const auto& relation : kIntListRelations) {
std::vector<AXPlatformNode*> targets =
GetDelegate()->GetTargetNodesForRelation(relation.attribute);
for (AXPlatformNode* target : targets) {
AddRelationToSet(relation_set, relation.relation, target);
}
if (!relation.reverse_relation.has_value())
continue;
std::set<AXPlatformNode*> reverse_target_ids =
GetDelegate()->GetReverseRelations(relation.attribute);
for (AXPlatformNode* target : reverse_target_ids) {
AddRelationToSet(relation_set, relation.reverse_relation.value(), target);
}
}
return relation_set;
}
AXPlatformNodeAuraLinux::AXPlatformNodeAuraLinux() = default;
AXPlatformNodeAuraLinux::~AXPlatformNodeAuraLinux() {
if (g_current_selected == this)
g_current_selected = nullptr;
DestroyAtkObjects();
SetWeakGPtrToAtkObject(&document_parent_, nullptr);
}
void AXPlatformNodeAuraLinux::Destroy() {
DestroyAtkObjects();
AXPlatformNodeBase::Destroy();
}
void AXPlatformNodeAuraLinux::Init(AXPlatformNodeDelegate* delegate) {
// Initialize ATK.
AXPlatformNodeBase::Init(delegate);
// Only create the AtkObject if we know enough information.
if (GetData().role != ax::mojom::Role::kUnknown)
GetOrCreateAtkObject();
}
bool AXPlatformNodeAuraLinux::IsPlatformCheckable() const {
if (GetData().role == ax::mojom::Role::kToggleButton)
return false;
return AXPlatformNodeBase::IsPlatformCheckable();
}
void AXPlatformNodeAuraLinux::EnsureAtkObjectIsValid() {
if (atk_object_) {
// If the object's role changes and that causes its
// interface mask to change, we need to create a new
// AtkObject for it.
ImplementedAtkInterfaces interface_mask = GetGTypeInterfaceMask(GetData());
if (interface_mask != interface_mask_)
DestroyAtkObjects();
}
if (!atk_object_) {
GetOrCreateAtkObject();
}
}
gfx::NativeViewAccessible AXPlatformNodeAuraLinux::GetNativeViewAccessible() {
return GetOrCreateAtkObject();
}
gfx::NativeViewAccessible AXPlatformNodeAuraLinux::GetOrCreateAtkObject() {
if (!atk_object_) {
atk_object_ = CreateAtkObject();
}
return atk_object_;
}
void AXPlatformNodeAuraLinux::OnActiveDescendantChanged() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
// Active-descendant-changed notifications are typically only relevant when
// the change is within the focused widget.
if (atk_object != g_current_focused)
return;
AtkObject* descendant = GetActiveDescendantOfCurrentFocused();
if (descendant == g_current_active_descendant)
return;
// If selection and focus are the same, when the active descendant changes
// as a result of selection, a focus event will be emitted. We don't want to
// emit duplicate notifications.
{
auto* node = FromAtkObject(descendant);
if (node && node->SelectionAndFocusAreTheSame())
return;
}
// While there is an ATK active-descendant-changed event, it is meant for
// objects which manage their descendants (and claim to do so). The Core-AAM
// specification states that focus events should be emitted when the active
// descendant changes. This behavior is also consistent with Gecko.
if (g_current_active_descendant) {
g_signal_emit_by_name(g_current_active_descendant, "focus-event", false);
atk_object_notify_state_change(ATK_OBJECT(g_current_active_descendant),
ATK_STATE_FOCUSED, false);
}
SetWeakGPtrToAtkObject(&g_current_active_descendant, descendant);
if (g_current_active_descendant) {
g_signal_emit_by_name(g_current_active_descendant, "focus-event", true);
atk_object_notify_state_change(ATK_OBJECT(g_current_active_descendant),
ATK_STATE_FOCUSED, true);
}
}
void AXPlatformNodeAuraLinux::OnCheckedStateChanged() {
AtkObject* obj = GetOrCreateAtkObject();
if (!obj)
return;
atk_object_notify_state_change(
ATK_OBJECT(obj), GetAtkStateTypeForCheckableNode(),
GetData().GetCheckedState() != ax::mojom::CheckedState::kFalse);
}
void AXPlatformNodeAuraLinux::OnExpandedStateChanged(bool is_expanded) {
// When a list box is expanded, it becomes visible. This means that it might
// now have a different role (the role for hidden Views is kUnknown). We
// need to recreate the AtkObject in this case because a change in roles
// might imply a change in ATK interfaces implemented.
EnsureAtkObjectIsValid();
AtkObject* obj = GetOrCreateAtkObject();
if (!obj)
return;
atk_object_notify_state_change(obj, ATK_STATE_EXPANDED, is_expanded);
}
void AXPlatformNodeAuraLinux::OnMenuPopupStart() {
AtkObject* atk_object = GetOrCreateAtkObject();
AtkObject* parent_frame = FindAtkObjectParentFrame(atk_object);
if (!parent_frame)
return;
// Exit early if kMenuPopupStart is sent multiple times for the same menu.
std::vector<AtkObject*>& active_menus = GetActiveMenus();
bool menu_already_open = !active_menus.empty();
if (menu_already_open && active_menus.back() == atk_object)
return;
// We also want to inform the AT that menu the is now showing. Normally this
// event is not fired because the menu will be created with the
// ATK_STATE_SHOWING already set to TRUE.
atk_object_notify_state_change(atk_object, ATK_STATE_SHOWING, TRUE);
// We need to compute this before modifying the active menu stack.
AtkObject* previous_active_frame = ComputeActiveTopLevelFrame();
active_menus.push_back(atk_object);
// We exit early if the newly activated menu has the same AtkWindow as the
// previous one.
if (previous_active_frame == parent_frame)
return;
if (previous_active_frame) {
g_signal_emit_by_name(previous_active_frame, "deactivate");
atk_object_notify_state_change(previous_active_frame, ATK_STATE_ACTIVE,
FALSE);
}
g_signal_emit_by_name(parent_frame, "activate");
atk_object_notify_state_change(parent_frame, ATK_STATE_ACTIVE, TRUE);
}
void AXPlatformNodeAuraLinux::OnMenuPopupEnd() {
AtkObject* atk_object = GetOrCreateAtkObject();
AtkObject* parent_frame = FindAtkObjectParentFrame(atk_object);
if (!parent_frame)
return;
atk_object_notify_state_change(atk_object, ATK_STATE_SHOWING, FALSE);
// kMenuPopupHide may be called multiple times for the same menu, so only
// remove it if our parent frame matches the most recently opened menu.
std::vector<AtkObject*>& active_menus = GetActiveMenus();
DCHECK(!active_menus.empty())
<< "Asymmetrical menupopupend events -- too many";
active_menus.pop_back();
AtkObject* new_active_item = ComputeActiveTopLevelFrame();
if (new_active_item != parent_frame) {
// Newly activated menu has the different AtkWindow as the previous one.
g_signal_emit_by_name(parent_frame, "deactivate");
atk_object_notify_state_change(parent_frame, ATK_STATE_ACTIVE, FALSE);
if (new_active_item) {
g_signal_emit_by_name(new_active_item, "activate");
atk_object_notify_state_change(new_active_item, ATK_STATE_ACTIVE, TRUE);
}
}
// All menus are closed.
if (active_menus.empty())
OnAllMenusEnded();
}
void AXPlatformNodeAuraLinux::ResendFocusSignalsForCurrentlyFocusedNode() {
auto* frame = FromAtkObject(g_active_top_level_frame);
if (!frame)
return;
AtkObject* focused_node = frame->GetDelegate()->GetFocus();
if (!focused_node)
return;
g_signal_emit_by_name(focused_node, "focus-event", true);
atk_object_notify_state_change(focused_node, ATK_STATE_FOCUSED, true);
}
// All menus have closed.
void AXPlatformNodeAuraLinux::OnAllMenusEnded() {
if (!GetActiveMenus().empty() && g_active_top_level_frame &&
ComputeActiveTopLevelFrame() != g_active_top_level_frame) {
g_signal_emit_by_name(g_active_top_level_frame, "activate");
atk_object_notify_state_change(g_active_top_level_frame, ATK_STATE_ACTIVE,
TRUE);
}
GetActiveMenus().clear();
ResendFocusSignalsForCurrentlyFocusedNode();
}
void AXPlatformNodeAuraLinux::OnWindowActivated() {
AtkObject* parent_frame = FindAtkObjectParentFrame(GetOrCreateAtkObject());
if (!parent_frame || parent_frame == g_active_top_level_frame)
return;
SetActiveTopLevelFrame(parent_frame);
g_signal_emit_by_name(parent_frame, "activate");
atk_object_notify_state_change(parent_frame, ATK_STATE_ACTIVE, TRUE);
// We also send a focus event for the currently focused element, so that
// the user knows where the focus is when the toplevel window regains focus.
if (g_current_focused &&
IsFrameAncestorOfAtkObject(parent_frame, g_current_focused)) {
g_signal_emit_by_name(g_current_focused, "focus-event", true);
atk_object_notify_state_change(ATK_OBJECT(g_current_focused),
ATK_STATE_FOCUSED, true);
}
}
void AXPlatformNodeAuraLinux::OnWindowDeactivated() {
AtkObject* parent_frame = FindAtkObjectParentFrame(GetOrCreateAtkObject());
if (!parent_frame || parent_frame != g_active_top_level_frame)
return;
SetActiveTopLevelFrame(nullptr);
g_signal_emit_by_name(parent_frame, "deactivate");
atk_object_notify_state_change(parent_frame, ATK_STATE_ACTIVE, FALSE);
}
void AXPlatformNodeAuraLinux::OnWindowVisibilityChanged() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
if (GetAtkRole() != ATK_ROLE_FRAME)
return;
bool minimized = delegate_->IsMinimized();
if (minimized == was_minimized_)
return;
was_minimized_ = minimized;
if (minimized)
g_signal_emit_by_name(atk_object, "minimize");
else
g_signal_emit_by_name(atk_object, "restore");
atk_object_notify_state_change(atk_object, ATK_STATE_ICONIFIED, minimized);
}
void AXPlatformNodeAuraLinux::OnScrolledToAnchor() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
DCHECK(ATK_IS_TEXT(atk_object));
g_signal_emit_by_name(atk_object, "text-caret-moved", 0);
}
void AXPlatformNodeAuraLinux::SetActiveViewsDialog() {
AtkObject* old_views_dialog = g_active_views_dialog;
AtkObject* new_views_dialog = nullptr;
AtkObject* parent = GetOrCreateAtkObject();
if (!parent)
return;
if (!GetDelegate()->IsWebContent()) {
while (parent) {
if (atk_object::GetRole(parent) == ATK_ROLE_DIALOG) {
new_views_dialog = parent;
break;
}
parent = atk_object::GetParent(parent);
}
}
if (old_views_dialog == new_views_dialog)
return;
SetWeakGPtrToAtkObject(&g_active_views_dialog, new_views_dialog);
if (old_views_dialog)
atk_object_notify_state_change(old_views_dialog, ATK_STATE_ACTIVE, FALSE);
if (new_views_dialog)
atk_object_notify_state_change(new_views_dialog, ATK_STATE_ACTIVE, TRUE);
}
void AXPlatformNodeAuraLinux::OnFocused() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
if (atk_object::GetRole(atk_object) == ATK_ROLE_FRAME) {
OnWindowActivated();
return;
}
if (atk_object == g_current_focused)
return;
SetActiveViewsDialog();
AtkObject* old_effective_focus = g_current_active_descendant
? g_current_active_descendant
: g_current_focused;
if (old_effective_focus) {
g_signal_emit_by_name(old_effective_focus, "focus-event", false);
atk_object_notify_state_change(ATK_OBJECT(old_effective_focus),
ATK_STATE_FOCUSED, false);
}
SetWeakGPtrToAtkObject(&g_current_focused, atk_object);
AtkObject* descendant = GetActiveDescendantOfCurrentFocused();
SetWeakGPtrToAtkObject(&g_current_active_descendant, descendant);
AtkObject* new_effective_focus = g_current_active_descendant
? g_current_active_descendant
: g_current_focused;
g_signal_emit_by_name(new_effective_focus, "focus-event", true);
atk_object_notify_state_change(ATK_OBJECT(new_effective_focus),
ATK_STATE_FOCUSED, true);
}
void AXPlatformNodeAuraLinux::OnSelected() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
if (g_current_selected && !g_current_selected->GetData().GetBoolAttribute(
ax::mojom::BoolAttribute::kSelected)) {
atk_object_notify_state_change(
ATK_OBJECT(g_current_selected->GetOrCreateAtkObject()),
ATK_STATE_SELECTED, false);
}
g_current_selected = this;
if (ATK_IS_OBJECT(atk_object)) {
atk_object_notify_state_change(ATK_OBJECT(atk_object), ATK_STATE_SELECTED,
true);
}
if (SelectionAndFocusAreTheSame())
OnFocused();
}
void AXPlatformNodeAuraLinux::OnSelectedChildrenChanged() {
AtkObject* obj = GetOrCreateAtkObject();
if (!obj)
return;
g_signal_emit_by_name(obj, "selection-changed", true);
}
bool AXPlatformNodeAuraLinux::SelectionAndFocusAreTheSame() {
if (AXPlatformNodeBase* container = GetSelectionContainer()) {
ax::mojom::Role role = container->GetData().role;
// In the browser UI, menus and their descendants emit selection-related
// events only, but we also want to emit platform focus-related events,
// so we treat selection and focus the same for browser UI.
if (role == ax::mojom::Role::kMenuBar || role == ax::mojom::Role::kMenu)
return !GetDelegate()->IsWebContent();
if (role == ax::mojom::Role::kListBox &&
!container->GetData().HasState(ax::mojom::State::kMultiselectable)) {
return container->GetDelegate()->GetFocus() ==
container->GetNativeViewAccessible();
}
}
// TODO(accessibility): GetSelectionContainer returns nullptr when the current
// object is a descendant of a select element with a size of 1. Intentional?
// For now, handle that scenario here.
//
// If the selection is changing on a collapsed select element, focus remains
// on the select element and not the newly-selected descendant.
if (AXPlatformNodeBase* parent = FromAtkObject(GetParent())) {
if (parent->GetData().role == ax::mojom::Role::kMenuListPopup)
return !parent->GetData().HasState(ax::mojom::State::kInvisible);
}
return false;
}
bool AXPlatformNodeAuraLinux::EmitsAtkTextEvents() const {
// If this node is not a static text node, it supports the full AtkText
// interface.
if (GetAtkRole() != kStaticRole)
return true;
// If this node has children it is not a static text leaf node and supports
// the full AtkText interface.
if (GetChildCount())
return true;
return false;
}
void AXPlatformNodeAuraLinux::GetFullSelection(int32_t* anchor_node_id,
int* anchor_offset,
int32_t* focus_node_id,
int* focus_offset) {
DCHECK(anchor_node_id);
DCHECK(anchor_offset);
DCHECK(focus_node_id);
DCHECK(focus_offset);
if (IsPlainTextField() &&
GetIntAttribute(ax::mojom::IntAttribute::kTextSelStart, anchor_offset) &&
GetIntAttribute(ax::mojom::IntAttribute::kTextSelEnd, focus_offset)) {
int32_t node_id = GetData().id != -1 ? GetData().id : GetUniqueId();
*anchor_node_id = *focus_node_id = node_id;
return;
}
AXTree::Selection selection = GetDelegate()->GetUnignoredSelection();
*anchor_node_id = selection.anchor_object_id;
*anchor_offset = selection.anchor_offset;
*focus_node_id = selection.focus_object_id;
*focus_offset = selection.focus_offset;
}
AXPlatformNodeAuraLinux& AXPlatformNodeAuraLinux::FindEditableRootOrDocument() {
if (GetAtkRole() == ATK_ROLE_DOCUMENT_WEB)
return *this;
if (GetData().GetBoolAttribute(ax::mojom::BoolAttribute::kEditableRoot))
return *this;
if (auto* parent = FromAtkObject(GetParent()))
return parent->FindEditableRootOrDocument();
return *this;
}
AXPlatformNodeAuraLinux* AXPlatformNodeAuraLinux::FindCommonAncestor(
AXPlatformNodeAuraLinux* other) {
if (this == other || other->IsDescendantOf(this))
return this;
if (auto* parent = FromAtkObject(GetParent()))
return parent->FindCommonAncestor(other);
return nullptr;
}
void AXPlatformNodeAuraLinux::UpdateSelectionInformation(int32_t anchor_node_id,
int anchor_offset,
int32_t focus_node_id,
int focus_offset) {
had_nonzero_width_selection =
focus_node_id != anchor_node_id || focus_offset != anchor_offset;
current_caret_ = std::make_pair(focus_node_id, focus_offset);
}
void AXPlatformNodeAuraLinux::EmitSelectionChangedSignal(bool had_selection) {
if (!EmitsAtkTextEvents()) {
if (auto* parent = FromAtkObject(GetParent()))
parent->EmitSelectionChangedSignal(had_selection);
return;
}
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
DCHECK(ATK_IS_TEXT(atk_object));
// ATK does not consider a collapsed selection a selection, so
// when the collapsed selection changes (caret movement), we should
// avoid sending text-selection-changed events.
if (HasSelection() || had_selection)
g_signal_emit_by_name(atk_object, "text-selection-changed");
}
void AXPlatformNodeAuraLinux::EmitCaretChangedSignal() {
if (!EmitsAtkTextEvents()) {
if (auto* parent = FromAtkObject(GetParent()))
parent->EmitCaretChangedSignal();
return;
}
DCHECK(HasCaret());
std::pair<int, int> selection = GetSelectionOffsetsForAtk();
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
DCHECK(ATK_IS_TEXT(atk_object));
g_signal_emit_by_name(atk_object, "text-caret-moved",
UTF16ToUnicodeOffsetInText(selection.second));
}
void AXPlatformNodeAuraLinux::OnTextSelectionChanged() {
int32_t anchor_node_id, focus_node_id;
int anchor_offset, focus_offset;
GetFullSelection(&anchor_node_id, &anchor_offset, &focus_node_id,
&focus_offset);
auto* anchor_node = static_cast<AXPlatformNodeAuraLinux*>(
GetDelegate()->GetFromNodeID(anchor_node_id));
auto* focus_node = static_cast<AXPlatformNodeAuraLinux*>(
GetDelegate()->GetFromNodeID(focus_node_id));
if (!anchor_node || !focus_node)
return;
AXPlatformNodeAuraLinux& editable_root = FindEditableRootOrDocument();
AXPlatformNodeAuraLinux* common_ancestor =
focus_node->FindCommonAncestor(anchor_node);
if (common_ancestor) {
common_ancestor->EmitSelectionChangedSignal(
editable_root.HadNonZeroWidthSelection());
}
// It's possible for the selection to change and for the caret to stay in
// place. This might happen if the selection is totally reset with a
// different anchor node, but the same focus node. We should avoid sending a
// caret changed signal in that case.
std::pair<int32_t, int> prev_caret = editable_root.GetCurrentCaret();
if (prev_caret.first != focus_node_id || prev_caret.second != focus_offset)
focus_node->EmitCaretChangedSignal();
editable_root.UpdateSelectionInformation(anchor_node_id, anchor_offset,
focus_node_id, focus_offset);
}
bool AXPlatformNodeAuraLinux::SupportsSelectionWithAtkSelection() {
return SupportsToggle(GetData().role) ||
GetData().role == ax::mojom::Role::kListBoxOption;
}
void AXPlatformNodeAuraLinux::OnDescriptionChanged() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
std::string description;
GetStringAttribute(ax::mojom::StringAttribute::kDescription, &description);
AtkPropertyValues property_values;
property_values.property_name = "accessible-description";
property_values.new_value = G_VALUE_INIT;
g_value_init(&property_values.new_value, G_TYPE_STRING);
g_value_set_string(&property_values.new_value, description.c_str());
g_signal_emit_by_name(G_OBJECT(atk_object),
"property-change::accessible-description",
&property_values, nullptr);
g_value_unset(&property_values.new_value);
}
void AXPlatformNodeAuraLinux::OnSortDirectionChanged() {
// TODO(crbug.com/1074380) fire correct event for aria-sort change.
// AtkObject* atk_object = GetOrCreateAtkObject();
// if (!atk_object)
// return;
// std::string sort;
// GetStringAttribute(ax::mojom::StringAttribute::kSortDirection, &sort);
}
void AXPlatformNodeAuraLinux::OnValueChanged() {
// For the AtkText interface to work on non-web content nodes, we need to
// update the nodes' hypertext and trigger text change signals when the value
// changes. Otherwise, for web and PDF content, this is handled by
// "BrowserAccessibilityAuraLinux".
if (!GetDelegate()->IsWebContent())
UpdateHypertext();
if (!GetData().IsRangeValueSupported())
return;
float float_val;
if (!GetFloatAttribute(ax::mojom::FloatAttribute::kValueForRange, &float_val))
return;
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
AtkPropertyValues property_values;
property_values.property_name = "accessible-value";
property_values.new_value = G_VALUE_INIT;
g_value_init(&property_values.new_value, G_TYPE_DOUBLE);
g_value_set_double(&property_values.new_value,
static_cast<double>(float_val));
g_signal_emit_by_name(G_OBJECT(atk_object),
"property-change::accessible-value", &property_values,
nullptr);
}
void AXPlatformNodeAuraLinux::OnNameChanged() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object) {
return;
}
std::string previous_accessible_name = accessible_name_;
// Calling atk_object_get_name will update the value of accessible_name_.
if (!g_strcmp0(atk_object::GetName(atk_object),
previous_accessible_name.c_str()))
return;
g_object_notify(G_OBJECT(atk_object), "accessible-name");
}
void AXPlatformNodeAuraLinux::OnDocumentTitleChanged() {
if (!g_active_top_level_frame)
return;
// We always want to notify on the top frame.
AXPlatformNodeAuraLinux* window = FromAtkObject(g_active_top_level_frame);
if (window)
window->OnNameChanged();
}
void AXPlatformNodeAuraLinux::OnSubtreeCreated() {
// We might not have a parent, in that case we don't need to send the event.
// We also don't want to notify if this is an ignored node
if (!GetParent() || GetData().IsIgnored())
return;
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
g_signal_emit_by_name(GetParent(), "children-changed::add",
GetIndexInParent().value_or(-1), atk_object);
}
void AXPlatformNodeAuraLinux::OnSubtreeWillBeDeleted() {
// There is a chance there won't be a parent as we're in the deletion process.
// We also don't want to notify if this is an ignored node
if (!GetParent() || GetData().IsIgnored())
return;
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
g_signal_emit_by_name(GetParent(), "children-changed::remove",
GetIndexInParent().value_or(-1), atk_object);
}
void AXPlatformNodeAuraLinux::OnParentChanged() {
if (!atk_object_)
return;
AtkPropertyValues property_values;
property_values.property_name = "accessible-parent";
property_values.new_value = G_VALUE_INIT;
g_value_init(&property_values.new_value, G_TYPE_OBJECT);
g_value_set_object(&property_values.new_value, GetParent());
g_signal_emit_by_name(G_OBJECT(atk_object_),
"property-change::accessible-parent", &property_values,
nullptr);
g_value_unset(&property_values.new_value);
}
void AXPlatformNodeAuraLinux::OnInvalidStatusChanged() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
atk_object_notify_state_change(
ATK_OBJECT(atk_object), ATK_STATE_INVALID_ENTRY,
GetData().GetInvalidState() != ax::mojom::InvalidState::kFalse);
}
void AXPlatformNodeAuraLinux::OnAlertShown() {
DCHECK(ui::IsAlert(GetData().role));
atk_object_notify_state_change(ATK_OBJECT(GetOrCreateAtkObject()),
ATK_STATE_SHOWING, TRUE);
}
void AXPlatformNodeAuraLinux::NotifyAccessibilityEvent(
ax::mojom::Event event_type) {
if (!GetOrCreateAtkObject())
return;
AXPlatformNodeBase::NotifyAccessibilityEvent(event_type);
switch (event_type) {
// kMenuStart/kMenuEnd: the menu system has started / stopped.
// kMenuPopupStart/kMenuPopupEnd: an individual menu/submenu has
// opened/closed.
case ax::mojom::Event::kMenuPopupStart:
OnMenuPopupStart();
break;
case ax::mojom::Event::kMenuPopupEnd:
OnMenuPopupEnd();
break;
case ax::mojom::Event::kActiveDescendantChanged:
OnActiveDescendantChanged();
break;
case ax::mojom::Event::kCheckedStateChanged:
OnCheckedStateChanged();
break;
case ax::mojom::Event::kExpandedChanged:
case ax::mojom::Event::kStateChanged:
OnExpandedStateChanged(GetData().HasState(ax::mojom::State::kExpanded));
break;
case ax::mojom::Event::kFocus:
case ax::mojom::Event::kFocusContext:
OnFocused();
break;
case ax::mojom::Event::kSelection:
OnSelected();
// When changing tabs also fire a name changed event.
if (GetData().role == ax::mojom::Role::kTab)
OnDocumentTitleChanged();
break;
case ax::mojom::Event::kSelectedChildrenChanged:
OnSelectedChildrenChanged();
break;
case ax::mojom::Event::kTextChanged:
OnNameChanged();
break;
case ax::mojom::Event::kTextSelectionChanged:
OnTextSelectionChanged();
break;
case ax::mojom::Event::kValueChanged:
OnValueChanged();
break;
case ax::mojom::Event::kInvalidStatusChanged:
OnInvalidStatusChanged();
break;
case ax::mojom::Event::kWindowActivated:
OnWindowActivated();
break;
case ax::mojom::Event::kWindowDeactivated:
OnWindowDeactivated();
break;
case ax::mojom::Event::kWindowVisibilityChanged:
OnWindowVisibilityChanged();
break;
case ax::mojom::Event::kLoadComplete:
case ax::mojom::Event::kDocumentTitleChanged:
// Sometimes, e.g. upon navigating away from the page, the tree is
// rebuilt rather than modified. The kDocumentTitleChanged event occurs
// prior to the rebuild and so is added on the previous root node. When
// the tree is rebuilt and the old node removed, the events on the old
// node are removed and no new kDocumentTitleChanged will be emitted. To
// ensure we still fire the event, though, we also pay attention to
// kLoadComplete.
OnDocumentTitleChanged();
break;
case ax::mojom::Event::kAlert:
OnAlertShown();
break;
default:
break;
}
}
base::Optional<std::pair<int, int>>
AXPlatformNodeAuraLinux::GetEmbeddedObjectIndicesForId(int id) {
auto iterator =
std::find(hypertext_.hyperlinks.begin(), hypertext_.hyperlinks.end(), id);
if (iterator == hypertext_.hyperlinks.end())
return base::nullopt;
int hyperlink_index = std::distance(hypertext_.hyperlinks.begin(), iterator);
auto offset = std::find_if(hypertext_.hyperlink_offset_to_index.begin(),
hypertext_.hyperlink_offset_to_index.end(),
[&](const std::pair<int32_t, int32_t>& pair) {
return pair.second == hyperlink_index;
});
if (offset == hypertext_.hyperlink_offset_to_index.end())
return base::nullopt;
return std::make_pair(UTF16ToUnicodeOffsetInText(offset->first),
UTF16ToUnicodeOffsetInText(offset->first + 1));
}
base::Optional<std::pair<int, int>>
AXPlatformNodeAuraLinux::GetEmbeddedObjectIndices() {
auto* parent = FromAtkObject(GetParent());
if (!parent)
return base::nullopt;
return parent->GetEmbeddedObjectIndicesForId(GetUniqueId());
}
void AXPlatformNodeAuraLinux::UpdateHypertext() {
EnsureAtkObjectIsValid();
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
AXHypertext old_hypertext = hypertext_;
base::OffsetAdjuster::Adjustments old_adjustments = GetHypertextAdjustments();
UpdateComputedHypertext();
text_unicode_adjustments_ = base::nullopt;
offset_to_text_attributes_.clear();
if ((!GetData().HasState(ax::mojom::State::kEditable) ||
GetData().GetRestriction() == ax::mojom::Restriction::kReadOnly) &&
!IsInLiveRegion()) {
return;
}
if (!EmitsAtkTextEvents())
return;
size_t shared_prefix, old_len, new_len;
ComputeHypertextRemovedAndInserted(old_hypertext, &shared_prefix, &old_len,
&new_len);
if (old_len > 0) {
base::string16 removed_substring =
old_hypertext.hypertext.substr(shared_prefix, old_len);
size_t shared_unicode_prefix = shared_prefix;
base::OffsetAdjuster::AdjustOffset(old_adjustments, &shared_unicode_prefix);
size_t shared_unicode_suffix = shared_prefix + old_len;
base::OffsetAdjuster::AdjustOffset(old_adjustments, &shared_unicode_suffix);
g_signal_emit_by_name(
atk_object, "text-remove",
shared_unicode_prefix, // position of removal
shared_unicode_suffix - shared_prefix, // length of removal
base::UTF16ToUTF8(removed_substring).c_str());
}
if (new_len > 0) {
base::string16 inserted_substring =
hypertext_.hypertext.substr(shared_prefix, new_len);
size_t shared_unicode_prefix = UTF16ToUnicodeOffsetInText(shared_prefix);
size_t shared_unicode_suffix =
UTF16ToUnicodeOffsetInText(shared_prefix + new_len);
g_signal_emit_by_name(
atk_object, "text-insert",
shared_unicode_prefix, // position of insertion
shared_unicode_suffix - shared_unicode_prefix, // length of insertion
base::UTF16ToUTF8(inserted_substring).c_str());
}
}
const AXHypertext& AXPlatformNodeAuraLinux::GetAXHypertext() {
return hypertext_;
}
const base::OffsetAdjuster::Adjustments&
AXPlatformNodeAuraLinux::GetHypertextAdjustments() {
if (text_unicode_adjustments_.has_value())
return *text_unicode_adjustments_;
text_unicode_adjustments_.emplace();
base::string16 text = GetHypertext();
int32_t text_length = text.size();
for (int32_t i = 0; i < text_length; i++) {
uint32_t code_point;
size_t original_i = i;
base::ReadUnicodeCharacter(text.c_str(), text_length + 1, &i, &code_point);
if ((i - original_i + 1) != 1) {
text_unicode_adjustments_->push_back(
base::OffsetAdjuster::Adjustment(original_i, i - original_i + 1, 1));
}
}
return *text_unicode_adjustments_;
}
size_t AXPlatformNodeAuraLinux::UTF16ToUnicodeOffsetInText(
size_t utf16_offset) {
size_t unicode_offset = utf16_offset;
base::OffsetAdjuster::AdjustOffset(GetHypertextAdjustments(),
&unicode_offset);
return unicode_offset;
}
size_t AXPlatformNodeAuraLinux::UnicodeToUTF16OffsetInText(int unicode_offset) {
if (unicode_offset == kStringLengthOffset)
return GetHypertext().size();
size_t utf16_offset = unicode_offset;
base::OffsetAdjuster::UnadjustOffset(GetHypertextAdjustments(),
&utf16_offset);
return utf16_offset;
}
gfx::Vector2d AXPlatformNodeAuraLinux::GetParentOriginInScreenCoordinates()
const {
AtkObject* parent = GetParent();
if (!parent)
return gfx::Vector2d();
const AXPlatformNode* parent_node =
AXPlatformNode::FromNativeViewAccessible(parent);
if (!parent)
return gfx::Vector2d();
return parent_node->GetDelegate()
->GetBoundsRect(AXCoordinateSystem::kScreenDIPs,
AXClippingBehavior::kUnclipped)
.OffsetFromOrigin();
}
gfx::Vector2d AXPlatformNodeAuraLinux::GetParentFrameOriginInScreenCoordinates()
const {
AtkObject* frame = FindAtkObjectParentFrame(atk_object_);
if (!frame)
return gfx::Vector2d();
const AXPlatformNode* frame_node =
AXPlatformNode::FromNativeViewAccessible(frame);
if (!frame_node)
return gfx::Vector2d();
return frame_node->GetDelegate()
->GetBoundsRect(AXCoordinateSystem::kScreenDIPs,
AXClippingBehavior::kUnclipped)
.OffsetFromOrigin();
}
gfx::Rect AXPlatformNodeAuraLinux::GetExtentsRelativeToAtkCoordinateType(
AtkCoordType coord_type) const {
gfx::Rect extents = delegate_->GetBoundsRect(AXCoordinateSystem::kScreenDIPs,
AXClippingBehavior::kUnclipped);
switch (coord_type) {
case ATK_XY_SCREEN:
break;
case ATK_XY_WINDOW: {
gfx::Vector2d window_origin = -GetParentFrameOriginInScreenCoordinates();
extents.Offset(window_origin);
break;
}
#if defined(ATK_230)
case ATK_XY_PARENT: {
gfx::Vector2d parent_origin = -GetParentOriginInScreenCoordinates();
extents.Offset(parent_origin);
break;
}
#endif
}
return extents;
}
void AXPlatformNodeAuraLinux::GetExtents(gint* x,
gint* y,
gint* width,
gint* height,
AtkCoordType coord_type) {
gfx::Rect extents = GetExtentsRelativeToAtkCoordinateType(coord_type);
if (x)
*x = extents.x();
if (y)
*y = extents.y();
if (width)
*width = extents.width();
if (height)
*height = extents.height();
}
void AXPlatformNodeAuraLinux::GetPosition(gint* x,
gint* y,
AtkCoordType coord_type) {
gfx::Rect extents = GetExtentsRelativeToAtkCoordinateType(coord_type);
if (x)
*x = extents.x();
if (y)
*y = extents.y();
}
void AXPlatformNodeAuraLinux::GetSize(gint* width, gint* height) {
gfx::Rect rect_size = gfx::ToEnclosingRect(GetData().relative_bounds.bounds);
if (width)
*width = rect_size.width();
if (height)
*height = rect_size.height();
}
gfx::NativeViewAccessible
AXPlatformNodeAuraLinux::HitTestSync(gint x, gint y, AtkCoordType coord_type) {
gfx::Point scroll_to(x, y);
scroll_to = ConvertPointToScreenCoordinates(scroll_to, coord_type);
AXPlatformNode* current_result = this;
while (true) {
gfx::NativeViewAccessible hit_child =
current_result->GetDelegate()->HitTestSync(scroll_to.x(),
scroll_to.y());
if (!hit_child)
return nullptr;
AXPlatformNode* hit_child_node =
AXPlatformNode::FromNativeViewAccessible(hit_child);
if (!hit_child_node || !hit_child_node->IsDescendantOf(current_result))
break;
// If we get the same node, we're done.
if (hit_child_node == current_result)
break;
// Continue to check recursively. That's because HitTestSync may have
// returned the best result within a particular accessibility tree,
// but we might need to recurse further in a tree of a different type
// (for example, from Views to Web).
current_result = hit_child_node;
}
return current_result->GetNativeViewAccessible();
}
bool AXPlatformNodeAuraLinux::GrabFocus() {
AXActionData action_data;
action_data.action = ax::mojom::Action::kFocus;
return delegate_->AccessibilityPerformAction(action_data);
}
bool AXPlatformNodeAuraLinux::FocusFirstFocusableAncestorInWebContent() {
if (!GetDelegate()->IsWebContent())
return false;
// Don't cross document boundaries in order to avoid having this operation
// cross iframe boundaries or escape to non-document UI elements.
if (GetAtkRole() == ATK_ROLE_DOCUMENT_WEB)
return false;
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return false;
if (GetData().HasState(ax::mojom::State::kFocusable) ||
SelectionAndFocusAreTheSame()) {
if (g_current_focused != atk_object)
GrabFocus();
return true;
}
auto* parent = FromAtkObject(GetParent());
if (!parent)
return false;
// If any of the siblings of this element are focusable, focusing the parent
// would be like moving the focus position backward, so we should fall back
// to setting the sequential focus navigation starting point.
for (auto child_iterator_ptr = parent->GetDelegate()->ChildrenBegin();
*child_iterator_ptr != *parent->GetDelegate()->ChildrenEnd();
++(*child_iterator_ptr)) {
auto* child = FromAtkObject(child_iterator_ptr->GetNativeViewAccessible());
if (!child || child == this)
continue;
if (child->GetData().HasState(ax::mojom::State::kFocusable) ||
child->SelectionAndFocusAreTheSame()) {
return false;
}
}
return parent->FocusFirstFocusableAncestorInWebContent();
}
bool AXPlatformNodeAuraLinux::SetSequentialFocusNavigationStartingPoint() {
AXActionData action_data;
action_data.action =
ax::mojom::Action::kSetSequentialFocusNavigationStartingPoint;
return delegate_->AccessibilityPerformAction(action_data);
}
bool AXPlatformNodeAuraLinux::
GrabFocusOrSetSequentialFocusNavigationStartingPoint() {
// First we try to grab focus on this node if any ancestor in the same
// document is focusable. Otherwise we set the sequential navigation starting
// point.
if (!FocusFirstFocusableAncestorInWebContent())
return SetSequentialFocusNavigationStartingPoint();
else
return true;
}
bool AXPlatformNodeAuraLinux::
GrabFocusOrSetSequentialFocusNavigationStartingPointAtOffset(int offset) {
int child_count = delegate_->GetChildCount();
if (IsPlainTextField() || child_count == 0)
return GrabFocusOrSetSequentialFocusNavigationStartingPoint();
// When this node has children, we walk through them to figure out what child
// node should get focus. We are essentially repeating the process used when
// building the hypertext here.
int current_offset = 0;
for (int i = 0; i < child_count; ++i) {
auto* child = FromAtkObject(delegate_->ChildAtIndex(i));
if (!child)
continue;
if (child->IsTextOnlyObject()) {
current_offset += child->GetName().size();
} else {
// Add an offset for the embedded character.
current_offset += 1;
}
// If the offset is larger than our size, try to work with the last child,
// which is also the behavior of SetCaretOffset.
if (offset <= current_offset || i == child_count - 1)
return child->GrabFocusOrSetSequentialFocusNavigationStartingPoint();
}
NOTREACHED();
return false;
}
bool AXPlatformNodeAuraLinux::DoDefaultAction() {
AXActionData action_data;
action_data.action = ax::mojom::Action::kDoDefault;
return delegate_->AccessibilityPerformAction(action_data);
}
const gchar* AXPlatformNodeAuraLinux::GetDefaultActionName() {
int action;
if (!GetIntAttribute(ax::mojom::IntAttribute::kDefaultActionVerb, &action))
return nullptr;
std::string action_verb =
ui::ToString(static_cast<ax::mojom::DefaultActionVerb>(action));
ATK_AURALINUX_RETURN_STRING(action_verb);
}
AtkAttributeSet* AXPlatformNodeAuraLinux::GetAtkAttributes() {
AtkAttributeSet* attribute_list = nullptr;
ComputeAttributes(&attribute_list);
return attribute_list;
}
AtkStateType AXPlatformNodeAuraLinux::GetAtkStateTypeForCheckableNode() {
if (GetData().GetCheckedState() == ax::mojom::CheckedState::kMixed)
return ATK_STATE_INDETERMINATE;
if (IsPlatformCheckable())
return ATK_STATE_CHECKED;
return ATK_STATE_PRESSED;
}
// AtkDocumentHelpers
const gchar* AXPlatformNodeAuraLinux::GetDocumentAttributeValue(
const gchar* attribute) const {
if (!g_ascii_strcasecmp(attribute, "DocType"))
return delegate_->GetTreeData().doctype.c_str();
else if (!g_ascii_strcasecmp(attribute, "MimeType"))
return delegate_->GetTreeData().mimetype.c_str();
else if (!g_ascii_strcasecmp(attribute, "Title"))
return delegate_->GetTreeData().title.c_str();
else if (!g_ascii_strcasecmp(attribute, "URI"))
return delegate_->GetTreeData().url.c_str();
return nullptr;
}
AtkAttributeSet* AXPlatformNodeAuraLinux::GetDocumentAttributes() const {
AtkAttributeSet* attribute_set = nullptr;
const gchar* doc_attributes[] = {"DocType", "MimeType", "Title", "URI"};
const gchar* value = nullptr;
for (unsigned i = 0; i < G_N_ELEMENTS(doc_attributes); i++) {
value = GetDocumentAttributeValue(doc_attributes[i]);
if (value) {
attribute_set = PrependAtkAttributeToAtkAttributeSet(
doc_attributes[i], value, attribute_set);
}
}
return attribute_set;
}
//
// AtkHyperlink helpers
//
AtkHyperlink* AXPlatformNodeAuraLinux::GetAtkHyperlink() {
if (atk_hyperlink_)
return atk_hyperlink_;
atk_hyperlink_ =
ATK_HYPERLINK(g_object_new(AX_PLATFORM_ATK_HYPERLINK_TYPE, 0));
ax_platform_atk_hyperlink_set_object(
AX_PLATFORM_ATK_HYPERLINK(atk_hyperlink_), this);
return atk_hyperlink_;
}
//
// Misc helpers
//
void AXPlatformNodeAuraLinux::GetFloatAttributeInGValue(
ax::mojom::FloatAttribute attr,
GValue* value) {
float float_val;
if (GetFloatAttribute(attr, &float_val)) {
memset(value, 0, sizeof(*value));
g_value_init(value, G_TYPE_FLOAT);
g_value_set_float(value, float_val);
}
}
void AXPlatformNodeAuraLinux::AddAttributeToList(const char* name,
const char* value,
AtkAttributeSet** attributes) {
*attributes = PrependAtkAttributeToAtkAttributeSet(name, value, *attributes);
}
void AXPlatformNodeAuraLinux::SetDocumentParent(
AtkObject* new_document_parent) {
DCHECK(GetAtkRole() == ATK_ROLE_FRAME);
SetWeakGPtrToAtkObject(&document_parent_, new_document_parent);
}
bool AXPlatformNodeAuraLinux::IsNameExposed() {
const AXNodeData& data = GetData();
switch (data.role) {
case ax::mojom::Role::kListMarker:
return !GetChildCount();
default:
return true;
}
}
int AXPlatformNodeAuraLinux::GetCaretOffset() {
if (!HasCaret()) {
base::Optional<FindInPageResultInfo> result =
GetSelectionOffsetsFromFindInPage();
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return -1;
if (result.has_value() && result->node == atk_object)
return UTF16ToUnicodeOffsetInText(result->end_offset);
return -1;
}
std::pair<int, int> selection = GetSelectionOffsetsForAtk();
return UTF16ToUnicodeOffsetInText(selection.second);
}
bool AXPlatformNodeAuraLinux::SetCaretOffset(int offset) {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return false;
int character_count = atk_text_get_character_count(ATK_TEXT(atk_object));
if (offset < 0 || offset > character_count)
offset = character_count;
// Even if we don't change anything, we still want to act like we
// were successful.
if (offset == GetCaretOffset() && !HasSelection())
return true;
offset = UnicodeToUTF16OffsetInText(offset);
if (!SetHypertextSelection(offset, offset))
return false;
return true;
}
bool AXPlatformNodeAuraLinux::SetTextSelectionForAtkText(int start_offset,
int end_offset) {
start_offset = UnicodeToUTF16OffsetInText(start_offset);
end_offset = UnicodeToUTF16OffsetInText(end_offset);
base::string16 text = GetHypertext();
if (start_offset < 0 || start_offset > int{text.length()})
return false;
if (end_offset < 0 || end_offset > int{text.length()})
return false;
// We must put these in the correct order so that we can do
// a comparison with the existing start and end below.
if (end_offset < start_offset)
std::swap(start_offset, end_offset);
// Even if we don't change anything, we still want to act like we
// were successful.
std::pair<int, int> old_offsets = GetSelectionOffsetsForAtk();
if (old_offsets.first == start_offset && old_offsets.second == end_offset)
return true;
if (!SetHypertextSelection(start_offset, end_offset))
return false;
return true;
}
bool AXPlatformNodeAuraLinux::HasSelection() {
std::pair<int, int> selection = GetSelectionOffsetsForAtk();
return selection.first >= 0 && selection.second >= 0 &&
selection.first != selection.second;
}
void AXPlatformNodeAuraLinux::GetSelectionExtents(int* start_offset,
int* end_offset) {
if (start_offset)
*start_offset = 0;
if (end_offset)
*end_offset = 0;
std::pair<int, int> selection = GetSelectionOffsetsForAtk();
if (selection.first < 0 || selection.second < 0 ||
selection.first == selection.second)
return;
// We should ignore the direction of the selection when exposing start and
// end offsets. According to the ATK documentation the end offset is always
// the offset immediately past the end of the selection. This wouldn't make
// sense if end < start.
if (selection.second < selection.first)
std::swap(selection.first, selection.second);
selection.first = UTF16ToUnicodeOffsetInText(selection.first);
selection.second = UTF16ToUnicodeOffsetInText(selection.second);
if (start_offset)
*start_offset = selection.first;
if (end_offset)
*end_offset = selection.second;
}
// Since this method doesn't return a static gchar*, we expect the caller of
// atk_text_get_selection to free the return value.
gchar* AXPlatformNodeAuraLinux::GetSelectionWithText(int* start_offset,
int* end_offset) {
int selection_start, selection_end;
GetSelectionExtents(&selection_start, &selection_end);
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return nullptr;
if (selection_start < 0 || selection_end < 0 ||
selection_start == selection_end) {
base::Optional<FindInPageResultInfo> find_in_page_result =
GetSelectionOffsetsFromFindInPage();
if (!find_in_page_result.has_value() ||
find_in_page_result->node != atk_object) {
*start_offset = 0;
*end_offset = 0;
return nullptr;
}
selection_start = find_in_page_result->start_offset;
selection_end = find_in_page_result->end_offset;
}
selection_start = UTF16ToUnicodeOffsetInText(selection_start);
selection_end = UTF16ToUnicodeOffsetInText(selection_end);
if (selection_start < 0 || selection_end < 0 ||
selection_start == selection_end) {
return nullptr;
}
if (start_offset)
*start_offset = selection_start;
if (end_offset)
*end_offset = selection_end;
return atk_text::GetText(ATK_TEXT(atk_object), selection_start,
selection_end);
}
bool AXPlatformNodeAuraLinux::IsInLiveRegion() {
return GetData().HasStringAttribute(
ax::mojom::StringAttribute::kContainerLiveStatus);
}
#if defined(ATK_230)
void AXPlatformNodeAuraLinux::ScrollToPoint(AtkCoordType atk_coord_type,
int x,
int y) {
gfx::Point scroll_to(x, y);
scroll_to = ConvertPointToScreenCoordinates(scroll_to, atk_coord_type);
AXActionData action_data;
action_data.target_node_id = GetData().id;
action_data.action = ax::mojom::Action::kScrollToPoint;
action_data.target_point = scroll_to;
GetDelegate()->AccessibilityPerformAction(action_data);
}
void AXPlatformNodeAuraLinux::ScrollNodeRectIntoView(
gfx::Rect rect,
AtkScrollType atk_scroll_type) {
AXActionData action_data;
action_data.target_node_id = GetData().id;
action_data.action = ax::mojom::Action::kScrollToMakeVisible;
action_data.target_rect = rect;
action_data.scroll_behavior = ax::mojom::ScrollBehavior::kScrollIfVisible;
action_data.horizontal_scroll_alignment = ax::mojom::ScrollAlignment::kNone;
action_data.vertical_scroll_alignment = ax::mojom::ScrollAlignment::kNone;
switch (atk_scroll_type) {
case ATK_SCROLL_TOP_LEFT:
action_data.vertical_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentTop;
action_data.horizontal_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentLeft;
break;
case ATK_SCROLL_BOTTOM_RIGHT:
action_data.horizontal_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentRight;
action_data.vertical_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentBottom;
break;
case ATK_SCROLL_TOP_EDGE:
action_data.vertical_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentTop;
break;
case ATK_SCROLL_BOTTOM_EDGE:
action_data.vertical_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentBottom;
break;
case ATK_SCROLL_LEFT_EDGE:
action_data.horizontal_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentLeft;
break;
case ATK_SCROLL_RIGHT_EDGE:
action_data.horizontal_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentRight;
break;
case ATK_SCROLL_ANYWHERE:
action_data.horizontal_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentClosestEdge;
action_data.vertical_scroll_alignment =
ax::mojom::ScrollAlignment::kScrollAlignmentClosestEdge;
break;
}
GetDelegate()->AccessibilityPerformAction(action_data);
}
void AXPlatformNodeAuraLinux::ScrollNodeIntoView(
AtkScrollType atk_scroll_type) {
gfx::Rect rect = GetDelegate()->GetBoundsRect(AXCoordinateSystem::kScreenDIPs,
AXClippingBehavior::kUnclipped);
rect -= rect.OffsetFromOrigin();
ScrollNodeRectIntoView(rect, atk_scroll_type);
}
#endif // defined(ATK_230)
#if defined(ATK_232)
base::Optional<gfx::Rect>
AXPlatformNodeAuraLinux::GetUnclippedHypertextRangeBoundsRect(int start_offset,
int end_offset) {
start_offset = UnicodeToUTF16OffsetInText(start_offset);
end_offset = UnicodeToUTF16OffsetInText(end_offset);
base::string16 text = GetHypertext();
if (start_offset < 0 || start_offset > int{text.length()})
return base::nullopt;
if (end_offset < 0 || end_offset > int{text.length()})
return base::nullopt;
if (end_offset < start_offset)
std::swap(start_offset, end_offset);
return GetDelegate()->GetHypertextRangeBoundsRect(
UnicodeToUTF16OffsetInText(start_offset),
UnicodeToUTF16OffsetInText(end_offset), AXCoordinateSystem::kScreenDIPs,
AXClippingBehavior::kUnclipped);
}
bool AXPlatformNodeAuraLinux::ScrollSubstringIntoView(
AtkScrollType atk_scroll_type,
int start_offset,
int end_offset) {
base::Optional<gfx::Rect> optional_rect =
GetUnclippedHypertextRangeBoundsRect(start_offset, end_offset);
if (!optional_rect.has_value())
return false;
gfx::Rect rect = *optional_rect;
gfx::Rect node_rect = GetDelegate()->GetBoundsRect(
AXCoordinateSystem::kScreenDIPs, AXClippingBehavior::kUnclipped);
rect -= node_rect.OffsetFromOrigin();
ScrollNodeRectIntoView(rect, atk_scroll_type);
return true;
}
bool AXPlatformNodeAuraLinux::ScrollSubstringToPoint(
int start_offset,
int end_offset,
AtkCoordType atk_coord_type,
int x,
int y) {
base::Optional<gfx::Rect> optional_rect =
GetUnclippedHypertextRangeBoundsRect(start_offset, end_offset);
if (!optional_rect.has_value())
return false;
gfx::Rect rect = *optional_rect;
gfx::Rect node_rect = GetDelegate()->GetBoundsRect(
AXCoordinateSystem::kScreenDIPs, AXClippingBehavior::kUnclipped);
ScrollToPoint(atk_coord_type, x - (rect.x() - node_rect.x()),
y - (rect.y() - node_rect.y()));
return true;
}
#endif // defined(ATK_232)
void AXPlatformNodeAuraLinux::ComputeStylesIfNeeded() {
if (!offset_to_text_attributes_.empty())
return;
default_text_attributes_ = ComputeTextAttributes();
TextAttributeMap attributes_map =
GetDelegate()->ComputeTextAttributeMap(default_text_attributes_);
offset_to_text_attributes_.swap(attributes_map);
}
int AXPlatformNodeAuraLinux::FindStartOfStyle(
int start_offset,
ax::mojom::MoveDirection direction) {
int text_length = GetHypertext().length();
DCHECK_GE(start_offset, 0);
DCHECK_LE(start_offset, text_length);
DCHECK(!offset_to_text_attributes_.empty());
switch (direction) {
case ax::mojom::MoveDirection::kBackward: {
auto iterator = offset_to_text_attributes_.upper_bound(start_offset);
--iterator;
return iterator->first;
}
case ax::mojom::MoveDirection::kForward: {
const auto iterator =
offset_to_text_attributes_.upper_bound(start_offset);
if (iterator == offset_to_text_attributes_.end())
return text_length;
return iterator->first;
}
}
NOTREACHED();
return start_offset;
}
const TextAttributeList& AXPlatformNodeAuraLinux::GetTextAttributes(
int offset,
int* start_offset,
int* end_offset) {
ComputeStylesIfNeeded();
DCHECK(!offset_to_text_attributes_.empty());
int utf16_offset = UnicodeToUTF16OffsetInText(offset);
int style_start =
FindStartOfStyle(utf16_offset, ax::mojom::MoveDirection::kBackward);
int style_end =
FindStartOfStyle(utf16_offset, ax::mojom::MoveDirection::kForward);
auto iterator = offset_to_text_attributes_.find(style_start);
DCHECK(iterator != offset_to_text_attributes_.end());
SetIntPointerValueIfNotNull(start_offset,
UTF16ToUnicodeOffsetInText(style_start));
SetIntPointerValueIfNotNull(end_offset,
UTF16ToUnicodeOffsetInText(style_end));
return iterator->second;
}
const TextAttributeList& AXPlatformNodeAuraLinux::GetDefaultTextAttributes() {
ComputeStylesIfNeeded();
return default_text_attributes_;
}
void AXPlatformNodeAuraLinux::TerminateFindInPage() {
ForgetCurrentFindInPageResult();
}
void AXPlatformNodeAuraLinux::ActivateFindInPageResult(int start_offset,
int end_offset) {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
DCHECK(ATK_IS_TEXT(atk_object));
if (!EmitsAtkTextEvents()) {
ActivateFindInPageInParent(start_offset, end_offset);
return;
}
AtkObject* parent_doc = FindAtkObjectToplevelParentDocument(atk_object);
if (!parent_doc)
return;
std::map<AtkObject*, FindInPageResultInfo>& active_results =
GetActiveFindInPageResults();
auto iterator = active_results.find(parent_doc);
FindInPageResultInfo new_info = {atk_object, start_offset, end_offset};
if (iterator != active_results.end() && iterator->second == new_info)
return;
active_results[parent_doc] = new_info;
g_signal_emit_by_name(atk_object, "text-selection-changed");
g_signal_emit_by_name(atk_object, "text-caret-moved",
UTF16ToUnicodeOffsetInText(end_offset));
}
base::Optional<std::pair<int, int>>
AXPlatformNodeAuraLinux::GetHypertextExtentsOfChild(
AXPlatformNodeAuraLinux* child_to_find) {
int current_offset = 0;
for (auto child_iterator_ptr = GetDelegate()->ChildrenBegin();
*child_iterator_ptr != *GetDelegate()->ChildrenEnd();
++(*child_iterator_ptr)) {
auto* child = FromAtkObject(child_iterator_ptr->GetNativeViewAccessible());
if (!child)
continue;
// If this object is a text only object, it is included directly into this
// node's hypertext, otherwise it is represented as an embedded object
// character.
int size = child->IsTextOnlyObject() ? child->GetName().size() : 1;
if (child == child_to_find)
return std::make_pair(current_offset, current_offset + size);
current_offset += size;
}
return base::nullopt;
}
void AXPlatformNodeAuraLinux::ActivateFindInPageInParent(int start_offset,
int end_offset) {
auto* parent = FromAtkObject(GetParent());
if (!parent)
return;
base::Optional<std::pair<int, int>> extents_in_parent =
parent->GetHypertextExtentsOfChild(this);
if (!extents_in_parent.has_value())
return;
DCHECK(IsTextOnlyObject());
parent->ActivateFindInPageResult(extents_in_parent->first + start_offset,
extents_in_parent->first + end_offset);
}
void AXPlatformNodeAuraLinux::ForgetCurrentFindInPageResult() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return;
AtkObject* parent_doc = FindAtkObjectToplevelParentDocument(atk_object);
if (parent_doc)
GetActiveFindInPageResults().erase(parent_doc);
}
base::Optional<FindInPageResultInfo>
AXPlatformNodeAuraLinux::GetSelectionOffsetsFromFindInPage() {
AtkObject* atk_object = GetOrCreateAtkObject();
if (!atk_object)
return base::nullopt;
AtkObject* parent_doc = FindAtkObjectToplevelParentDocument(atk_object);
if (!parent_doc)
return base::nullopt;
std::map<AtkObject*, FindInPageResultInfo>& active_results =
GetActiveFindInPageResults();
auto iterator = active_results.find(parent_doc);
if (iterator == active_results.end())
return base::nullopt;
return iterator->second;
}
gfx::Point AXPlatformNodeAuraLinux::ConvertPointToScreenCoordinates(
const gfx::Point& point,
AtkCoordType atk_coord_type) {
switch (atk_coord_type) {
case ATK_XY_WINDOW:
return point + GetParentFrameOriginInScreenCoordinates();
#if defined(ATK_230)
case ATK_XY_PARENT:
return point + GetParentOriginInScreenCoordinates();
#endif
case ATK_XY_SCREEN:
default:
return point;
}
}
std::pair<int, int> AXPlatformNodeAuraLinux::GetSelectionOffsetsForAtk() {
// In web content we always want to look at the selection from the tree
// instead of the selection that might be set via node attributes. This is
// because the tree selection is the absolute truth about what is visually
// selected, whereas node attributes might contain selection extents that are
// no longer part of the visual selection.
std::pair<int, int> selection;
if (GetDelegate()->IsWebContent()) {
AXTree::Selection unignored_selection =
GetDelegate()->GetUnignoredSelection();
GetSelectionOffsetsFromTree(&unignored_selection, &selection.first,
&selection.second);
} else {
GetSelectionOffsets(&selection.first, &selection.second);
}
return selection;
}
} // namespace ui
| [
"you@example.com"
] | you@example.com |
4ae37a0b90809416886bc2402b681789ba701ddd | 8727d1a506114c2bbab2f74db9bdaf68b5a6c83e | /8/8-0-1.cpp | 08981e97754531cb0311cada5ec3bc5f580f28c9 | [] | no_license | BaiXious/Accelerated-cpp | 5c5525eb9678ad98475208f82ea63b1606e31a86 | 26ad13fe83aa36c8d3ca1caf89b04e90f441d7d7 | refs/heads/master | 2022-01-13T08:11:14.337940 | 2018-08-28T04:06:10 | 2018-08-28T04:06:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,032 | cpp | #include <iostream>
#include <string>
#include <vector>
template <class T>
T mymax(const T& left, const T& right)
{
return left > right ? left : right;
}
template <class In, class X>
In fine(In begin, In end, const X& x)
{
while (begin != end && *begin != x)
++begin;
return begin;
}
template<class In, class Out>
Out copy(In begin, In end, Out dest)
{
while (begin != end)
*dest++ = *begin++;
return dest;
}
template <class For, class X>
void myreplace(For beg, For end, X& x, X& y)//const X& x, const X& y)
{
while (beg != end) {
if (*beg == x)
*beg = y;
++beg;
}
}
int main()
{
std::string s1, s2;
std::vector<std::string> ret;
ret.push_back("hallo");
ret.push_back("good");
ret.push_back("bad");
s1 = "bad";
s2 = "good";
//myreplace(ret.begin(), ret.end(), s1, s2);
myreplace(ret.begin(), ret.end(), "bad", "good");
for (std::vector<std::string>::const_iterator it = ret.begin();
it != ret.end(); ++it)
std::cout << *it << std::endl;
return 0;
}
| [
"1051378379@qq.com"
] | 1051378379@qq.com |
989094040602a03f2d5b8e513670aa57d6d08979 | 1aa371b01d62d51681f84ad048d54e51a80427eb | /source/backend/opencl/core/OpenCLRunningUtils.cpp | 5fb6ffcf019bac315ef4659b8e1558b5695b1af9 | [
"Apache-2.0"
] | permissive | zjd1988/mnn_cuda | e0233676bf6bf7c64202cad71dffb649b3da0ad5 | d487534a2f6ffb0b98e3070a74682348e46ec4d1 | refs/heads/master | 2022-11-06T04:13:57.288709 | 2020-06-28T07:36:46 | 2020-06-28T07:36:46 | 275,532,175 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,142 | cpp | //
// OpenCLRunningUtils.cpp
// MNN
//
// Created by MNN on 2019/02/28.
// Copyright © 2018, Alibaba Group Holding Limited
//
#include "backend/opencl/core/OpenCLRunningUtils.hpp"
#include <algorithm>
#include <string>
#include <vector>
#include "core/Macro.h"
namespace MNN {
namespace OpenCL {
std::vector<uint32_t> turnLocalSize(cl::Kernel *kernel, std::vector<uint32_t> &gws, OpenCLRuntime *runtime) {
uint32_t maxWorkGroupSize = static_cast<uint32_t>(runtime->getMaxWorkGroupSize(*kernel));
int64_t minExecTime = std::numeric_limits<int64_t>::max();
std::vector<uint32_t> optimizedLocalWS = {1, 1, 1};
const int xEnd = 32;
const int yEnd = 32;
for (uint32_t y = 1; y <= yEnd; ++y) {
for (uint32_t x = 1; x <= xEnd; ++x) {
cl::NDRange LocalWorkSize = cl::NDRange(x, y);
const bool invalid_lws = (x * y > maxWorkGroupSize) || (x == 1 && y == 1);
if (invalid_lws) {
continue;
}
std::vector<uint32_t> roundGWS = gws;
for (size_t i = 0; i < 2; ++i) {
MNN_ASSERT(LocalWorkSize[i] != 0);
roundGWS[i] = ROUND_UP(gws[i], LocalWorkSize[i]);
}
int64_t cost_time = 0;
for (int i = 0; i < 3; i++) {
cl::Event event;
cl_int error = CL_SUCCESS;
const int64_t startTime = event.getProfilingInfo<CL_PROFILING_COMMAND_START>();
error = runtime->commandQueue().enqueueNDRangeKernel(
*kernel, cl::NullRange, cl::NDRange(roundGWS[0], roundGWS[1]),
cl::NDRange(LocalWorkSize[0], LocalWorkSize[1]), nullptr, &event);
event.wait();
const int64_t endTime = event.getProfilingInfo<CL_PROFILING_COMMAND_END>();
cost_time += (endTime - startTime);
}
if (cost_time < minExecTime) {
minExecTime = cost_time;
optimizedLocalWS = {x, y};
}
}
}
MNN_PRINT("best lws : [%d, %d] \n", optimizedLocalWS[0], optimizedLocalWS[1]);
return optimizedLocalWS;
}
void getImageShape(const std::vector<int> &shape, const OpenCLBufferFormat type, std::vector<size_t> *imageShape) {
MNN_ASSERT(imageShape != nullptr);
if (type == CONV2D_FILTER) {
(*imageShape).push_back(shape[1]);
(*imageShape).push_back(shape[2] * shape[3] * UP_DIV(shape[0], 4));
} else if (type == DW_CONV2D_FILTER) {
(*imageShape).push_back(shape[0] * shape[2] * shape[3]);
(*imageShape).push_back(UP_DIV(shape[1], 4));
} else if (type == NHWC_BUFFER || type == NCHW_BUFFER) {
(*imageShape).push_back(UP_DIV(shape[3], 4) * shape[2]);
(*imageShape).push_back(shape[0] * shape[1]);
} else if (type == ARGUMENT) {
if (shape.size() == 4) {
(*imageShape).push_back(UP_DIV(shape[3], 4));
(*imageShape).push_back(1);
} else {
(*imageShape).push_back(UP_DIV(shape[0], 4));
(*imageShape).push_back(1);
}
} else if(type == CONV2D1x1_OPT_FILTER){
(*imageShape).push_back(UP_DIV(shape[1], 4));
(*imageShape).push_back(shape[2] * shape[3] * shape[0]);
}else {
MNN_PRINT("type not supported !!! \n");
}
}
std::vector<uint32_t> localWS3DDefault(const std::vector<uint32_t> &gws, const uint32_t maxWorkGroupSize,
OpenCLRuntime *runtime) {
std::vector<uint32_t> lws(4, 0);
GpuType gpuType = runtime->getGpuType();
uint32_t deviceComputeUnits = runtime->deviceComputeUnits();
if (gpuType == GpuType::ADRENO) {
int coreNum = deviceComputeUnits;
int remain = gws[0] % coreNum;
int groupSize = gws[0] / coreNum;
if (remain == 0) {
lws[0] = groupSize;
} else {
while (groupSize) {
int remain = gws[0] % groupSize;
if (remain == 0 && groupSize <= maxWorkGroupSize) {
lws[0] = groupSize;
break;
}
groupSize--;
}
}
lws[0] = std::max<uint32_t>(std::min<uint32_t>(maxWorkGroupSize, lws[0]), 1);
remain = gws[1] % coreNum;
groupSize = gws[1] / coreNum;
if (remain == 0) {
lws[1] = groupSize;
} else {
while (groupSize) {
int remain = gws[1] % groupSize;
if (remain == 0) {
lws[1] = groupSize;
break;
}
groupSize--;
}
}
lws[1] = std::max<uint32_t>(std::min<uint32_t>(maxWorkGroupSize / lws[0], lws[1]), 1);
remain = gws[2] % coreNum;
groupSize = gws[2] / coreNum;
if (remain == 0) {
lws[2] = groupSize;
} else {
while (groupSize) {
int remain = gws[2] % groupSize;
if (remain == 0) {
lws[2] = groupSize;
break;
}
groupSize--;
}
}
lws[2] = std::max<uint32_t>(std::min<uint32_t>(maxWorkGroupSize / (lws[0] * lws[1]), lws[2]), 1);
} else {
lws[0] = deviceComputeUnits * 2;
lws[1] = 4;
lws[2] = 1;
}
return lws;
}
void runTurnKernelLWS2D(const ::cl::Kernel &kernel, const std::vector<uint32_t> &gws, const std::vector<uint32_t> &lws,
OpenCLRuntime *runtime) {
#ifdef LOG_VERBOSE
MNN_PRINT("start runTurnKernelLWS2D !\n");
#endif
std::vector<uint32_t> roundGWS = gws;
for (size_t i = 0; i < 2; ++i) {
MNN_ASSERT(lws[i] != 0);
roundGWS[i] = ROUND_UP(gws[i], std::max((uint32_t)1, lws[i]));
}
cl::Event event;
cl_int error = CL_SUCCESS;
error = runtime->commandQueue().enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(roundGWS[0], roundGWS[1]),
cl::NDRange(lws[0], lws[1]), nullptr, &event);
MNN_CHECK_CL_SUCCESS(error);
#ifdef LOG_VERBOSE
MNN_PRINT("end runTurnKernelLWS2D !\n");
#endif
}
void run3DKernelDefault(const ::cl::Kernel &kernel, const std::vector<uint32_t> &gws, const std::vector<uint32_t> &lws,
OpenCLRuntime *runtime, cl::Event* eventPtr) {
#ifdef LOG_VERBOSE
MNN_PRINT("start run3DKernelDefault !\n");
#endif
MNN_ASSERT(lws.size() >= 3);
std::vector<uint32_t> internalGlobalWS = gws;
for (size_t i = 0; i < 3; ++i) {
internalGlobalWS[i] = ROUND_UP(gws[i], std::max((uint32_t)1, lws[i]));
}
cl_int error = CL_SUCCESS;
if(eventPtr == nullptr){
error = runtime->commandQueue().enqueueNDRangeKernel(
kernel, cl::NullRange, cl::NDRange(internalGlobalWS[0], internalGlobalWS[1], internalGlobalWS[2]),
cl::NDRange(lws[0], lws[1], lws[2]));
}else{
error = runtime->commandQueue().enqueueNDRangeKernel(
kernel, cl::NullRange, cl::NDRange(internalGlobalWS[0], internalGlobalWS[1], internalGlobalWS[2]),
cl::NDRange(lws[0], lws[1], lws[2]), nullptr, eventPtr);
}
MNN_CHECK_CL_SUCCESS(error);
#ifdef LOG_VERBOSE
MNN_PRINT("end run3DKernelDefault !\n");
#endif
}
void runKernel2D(const ::cl::Kernel &kernel, const std::vector<uint32_t> &gws, const std::vector<uint32_t> &lws,
OpenCLRuntime *runtime, cl::Event* eventPtr) {
#ifdef LOG_VERBOSE
MNN_PRINT("start run3DKernelDefault !\n");
#endif
std::vector<uint32_t> internalGlobalWS = gws;
for (size_t i = 0; i < 2; ++i) {
internalGlobalWS[i] = ROUND_UP(gws[i], std::max((uint32_t)1, lws[i]));
}
cl_int error = CL_SUCCESS;
if(eventPtr == nullptr){
error = runtime->commandQueue().enqueueNDRangeKernel(
kernel, cl::NullRange, cl::NDRange(internalGlobalWS[0], internalGlobalWS[1]), cl::NDRange(lws[0], lws[1]));
}else{
error = runtime->commandQueue().enqueueNDRangeKernel(
kernel, cl::NullRange, cl::NDRange(internalGlobalWS[0], internalGlobalWS[1]), cl::NDRange(lws[0], lws[1]), nullptr, eventPtr);
}
MNN_CHECK_CL_SUCCESS(error);
#ifdef LOG_VERBOSE
MNN_PRINT("end run3DKernelDefault !\n");
#endif
}
void run2DKernelDefault(const cl::Kernel &kernel, const uint32_t *gws, const std::vector<uint32_t> &lws,
OpenCLRuntime *runtime) {
cl::Event event;
const std::vector<uint32_t> ¶ms = lws;
MNN_ASSERT(params.size() == 3);
std::vector<uint32_t> internalGlobalWS(gws, gws + 2);
for (size_t i = 0; i < 2; ++i) {
internalGlobalWS[i] = ROUND_UP(gws[i], std::max((uint32_t)1, params[i]));
}
uint32_t block_size = params[2] == 0 ? internalGlobalWS[1] : params[2];
const uint32_t num_blocks = UP_DIV(internalGlobalWS[1], block_size);
for (uint32_t i = 0; i < num_blocks; ++i) {
uint32_t gws1 = block_size;
MNN_CHECK_CL_SUCCESS(runtime->commandQueue().enqueueNDRangeKernel(
kernel, cl::NDRange(0, i * block_size), cl::NDRange(internalGlobalWS[0], gws1),
cl::NDRange(params[0], params[1]), nullptr, &event));
}
}
void copyBufferToImage(OpenCLRuntime *runtime, const cl::Buffer &buffer, const cl::Image &image, int w, int h) {
std::set<std::string> buildOptions;
auto kernel = runtime->buildKernel("copy_buffer_to_image2d", "copy_buffer_to_image2d", buildOptions);
auto status = kernel.setArg(0, buffer);
MNN_ASSERT(status == CL_SUCCESS);
status = kernel.setArg(1, image);
MNN_ASSERT(status == CL_SUCCESS);
status = kernel.setArg(2, w);
MNN_ASSERT(status == CL_SUCCESS);
status = kernel.setArg(3, h);
MNN_ASSERT(status == CL_SUCCESS);
auto comandQueue = runtime->commandQueue();
comandQueue.enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(w, h, 1));
}
} // namespace OpenCL
} // namespace MNN
| [
"942002795@qq.com"
] | 942002795@qq.com |
fba04a9d3b8612f63bc3075e17d8439e5942d110 | 83c67bb96d4856258b360f16505c72de149ae34e | /fib-pro1/jutge/introduction/src/CanviMinim.cc | 9eea39942c76cb2c52d6809d3969600561c44817 | [] | no_license | twinone/upc | bfe89448386641cb61347436eafe056e9daec5a8 | 5f4078b3c251d243c46ff6aa150db39ca6ded126 | refs/heads/master | 2020-03-08T11:37:20.892542 | 2018-04-04T19:58:42 | 2018-04-04T19:58:42 | 128,103,423 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,561 | cc | #include <iostream>
#include <vector>
/**
Statement:
Write a program that, given an amount of euros and cents, computes the minimum number of banknotes and coins needed to get that amount. There are coins of 1, 2, 5, 10, 20 and 50 cents and of 1 and 2 euros, and banknotes of 5, 10, 20, 50, 100, 200 and 500 euros.
Input
Input consists of two natural numbers: the number of euros e and the number of cents c. Assume c<100.
Output
Print the number of banknotes and coins of each type that are are needed to represent the amount of the input, so as to minimize the total number of banknotes and coins.
*/
using namespace std;
int main() {
// We'll work in cents internally, to avoid using floats
int typesArray[] = {50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100, 50, 20, 10, 5, 2, 1};
vector<long> types (typesArray, typesArray + sizeof(typesArray) / sizeof(int));
vector<long> results;
results.reserve(types.size());
long eur;
int cents;
cin >> eur >> cents;
// Convert everything to cents
eur *= 100;
eur += cents;
for (int i = 0; i < types.size(); i++) {
int type = types[i];
int num = eur / type;
if (type > 200) {
cout << "Banknotes of "<< type/100 <<" euros: " << num << endl;
} else if (type == 200) {
cout << "Coins of 2 euros: " << num << endl;
} else if (type == 100) {
cout << "Coins of 1 euro: " << num << endl;
} else if (type > 1) {
cout << "Coins of "<<type<<" cents: " << num << endl;
} else {
cout << "Coins of 1 cent: " << num << endl;
}
eur = eur % type;
}
return 0;
}
| [
"twinonedevs@gmail.com"
] | twinonedevs@gmail.com |
cc721a009358adeef69e533d4a9ea15c76a31f0b | 1240637188c316b6b08aebcde9b77b896159869d | /ref/sycl-spec/handler/useModule.h | a1cbffe9491ec7e77ba4ecf9e005e7f282411a7f | [
"Apache-2.0",
"CC-BY-4.0",
"LicenseRef-scancode-khronos"
] | permissive | hdelassus/DPCPP_Reference | c08619ebe605223f143de6c49287e0fa89de4815 | 6ef0b40fe4c4b6f0883ab8eb02f40613bc86c533 | refs/heads/dpcpp | 2023-05-13T14:06:08.687162 | 2020-10-20T12:27:42 | 2020-10-20T12:27:42 | 369,689,332 | 0 | 0 | NOASSERTION | 2021-05-22T01:21:49 | 2021-05-22T01:21:48 | null | UTF-8 | C++ | false | false | 212 | h | void use_module(const module<module_state::executable> &execModule); // (1)
template <typename T>
void use_module(const module<module_state::executable> &execModule // (2)
T deviceImageSelector); | [
"robert.s.cohn@intel.com"
] | robert.s.cohn@intel.com |
d70062326db61987aaebd14cbf2ce23e785f6196 | ce46583b302d1c872f59a5bcc3160d36072c4f14 | /Http/HttpGetRequestDispatcher.cpp | 4c4baa5a2645bb0d0a2dbfd7db839380fbcf20e1 | [] | no_license | csrss/MusicDrop | 36ca4b6c0f91fe398b011417a5f732655ef553ab | 09b7a9d29fdfb4c970e08829f14fe5297b2a743f | refs/heads/master | 2021-01-24T02:39:54.887617 | 2018-03-24T11:20:33 | 2018-03-24T11:20:33 | 122,857,750 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,003 | cpp | #include "pch.h"
#include "HttpGetRequestDispatcher.h"
#include "HttpGlobals.h"
namespace Http
{
CHttpGetRequestDispatcher::CHttpGetRequestDispatcher(IHttpSongsExposeEvent^ pHttpSongsExposeEvent)
: _pHttpSongsExposeEvent(pHttpSongsExposeEvent)
{
}
CHttpGetRequestDispatcher::~CHttpGetRequestDispatcher(void)
{
}
HRESULT CHttpGetRequestDispatcher::Dispatch(XLib::XObjectPtr<XHttpRequest> pRequest, XLib::XObjectPtr<XHttpSocket> pSocket)
{
XHttpHeaderFieldRequestPtr pField = pRequest->GetHttpHeader()->GetHeaderFields()->FindField<XHttpHeaderFieldRequest>();
if( !pField )
{
return HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
}
if( pField->Type == XHttpRequestType::XHttpRequestTypePost )
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
HRESULT hr = S_OK;
if( pField->Query.ContentType & XHttpContentType::IsQuery )
{
// query
if( pField->Query.File == "/" )
{
// root server directory request
CHAR header[] = "HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n";
hr = pSocket->Send(header, sizeof(header));
if( FAILED(hr) ) return hr;
// Construct html file path
std::wstring strPath = XLib::XStr::Format(L"%s\\index.html", CHttpGlobals::Instance->SrvRoot->Data());
// Create html main page
XLib::XObjectPtr<XHttpHtmlPage> pHttpHtmlPage;
hr = XHttpHtmlPage::CreateObject(&pHttpHtmlPage, strPath.c_str());
if( FAILED(hr) )
{
return hr;
}
// Html page data utf8 encoded
std::string str_utf8 = pHttpHtmlPage->Buffer;
// And at this point, we have to expose our current collection to the user.
if( _pHttpSongsExposeEvent )
{
if( Windows::Foundation::Collections::IVector<CAudioItem^>^ pAudioItems = _pHttpSongsExposeEvent->GetAudioCollection() )
{
std::string strAudioItems = GetStringFromItemsCollection(pAudioItems);
if( !strAudioItems.empty() )
{
std::string str_what = "[audio_collection]";
size_t nPos = str_utf8.find(str_what);
if( nPos != std::string::npos )
{
str_utf8.replace(nPos, str_what.length(), strAudioItems);
}
}
}
}
return pSocket->Send(str_utf8.c_str(), ::strlen(str_utf8.c_str()));
}
else
{
// Currently we do not process any other queries except main page request
}
}
else if( pField->Query.ContentType & XHttpContentType::IsFile )
{
// file
// Construct file path
std::wstring strPath = XLib::XStr::Format(L"%s\\%s", CHttpGlobals::Instance->SrvRoot->Data(), XLib::XStr::A2W(pField->Query.File).c_str());
// Now grab this file size and check if it is valid
UINT fileSize = _getFileSize(strPath.c_str());
if( INVALID_FILE_SIZE == fileSize )
{
return HRESULT_FROM_WIN32(::GetLastError());
}
// Open this damn file.
XLib::XHandle hFile = ::CreateFile2(strPath.c_str(), GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr);
if( !hFile.Valid )
{
return HRESULT_FROM_WIN32(::GetLastError());
}
// Now we have to construct a valid http header to be sent to a client browser.
std::string header;
switch( pField->Query.FileType )
{
case XHttpFileType::Css:
header = XLib::XStr::Format("HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Length: %I64u\r\nContent-Type: text/css\r\n\r\n", fileSize);
break;
case XHttpFileType::Html:
header = XLib::XStr::Format("HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Length: %I64u\r\nContent-Type: text/html\r\n\r\n", fileSize);
break;
case XHttpFileType::JavaScript:
header = XLib::XStr::Format("HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Length: %I64u\r\nContent-Type: text/javascript\r\n\r\n", fileSize);
break;
case XHttpFileType::Jpg:
header = XLib::XStr::Format("HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Length: %I64u\r\nContent-Type: image/jpg\r\n\r\n", fileSize);
break;
case XHttpFileType::Png:
header = XLib::XStr::Format("HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Length: %I64u\r\nContent-Type: image/png\r\n\r\n", fileSize);
break;
case XHttpFileType::Txt:
header = XLib::XStr::Format("HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Length: %I64u\r\nContent-Type: text/plain\r\n\r\n", fileSize);
break;
}
if( pField->Query.ContentType & XHttpContentType::IsDocument )
{
// Create html main page
XLib::XObjectPtr<XHttpHtmlPage> pHttpHtmlPage;
hr = XHttpHtmlPage::CreateObject(&pHttpHtmlPage, strPath.c_str());
if( FAILED(hr) )
{
return hr;
}
// Html page data utf8 encoded
std::string str_utf8 = pHttpHtmlPage->Buffer;
// Sending page data to a client browser
return pSocket->Send(str_utf8.c_str(), ::strlen(str_utf8.c_str()));
}
else if( pField->Query.ContentType & XHttpContentType::IsBinary )
{
DWORD dwBytesRead = 0, dwTotalRead = 0;
BYTE buffer[4096] = { 0x00 };
while( dwTotalRead != fileSize && ::ReadFile(hFile, buffer, sizeof(buffer), &dwBytesRead, NULL) && dwBytesRead > 0 )
{
hr = pSocket->Send((CHAR *)buffer, dwBytesRead);
if( FAILED(hr) ) return hr;
dwTotalRead += dwBytesRead;
}
return hr;
}
}
return E_FAIL;
}
UINT CHttpGetRequestDispatcher::_getFileSize(const WCHAR * pwszPath)
{
WIN32_FILE_ATTRIBUTE_DATA fileInformation = { 0x00 };
if( TRUE == ::GetFileAttributesExW(pwszPath, GetFileExInfoStandard, &fileInformation) )
{
__int64 size = ((__int64)fileInformation.nFileSizeHigh << 32) | fileInformation.nFileSizeLow;
if( size > UINT_MAX )
{
::SetLastError(ERROR_FILE_TOO_LARGE);
return INVALID_FILE_SIZE;
}
return static_cast<UINT>( size );
}
return INVALID_FILE_SIZE;
}
std::string CHttpGetRequestDispatcher::GetStringFromItemsCollection(Windows::Foundation::Collections::IVector<CAudioItem^>^ pAudioItems)
{
std::string strTemp;
for( CAudioItem^ pItem : pAudioItems )
{
strTemp += "<li><table><tr>";
strTemp += "<td width=\"10%\"><button id=\"btn\" class=\"sort btn\" style=\"width:48px;height:48px;background-image:url('appbar.transport.play.rest.png')\" onClick=\"new XMLHttpPlaySongRequest('";
strTemp += XLib::XStr::Escape(pItem->GetName()) + "', '" + XLib::XStr::Escape(pItem->GetArtist()) + "', '" + XLib::XStr::Escape(pItem->GetAlbum());
strTemp += "');\"></button></td><td>";
strTemp += "<span class=\"feature\">";
strTemp += pItem->GetName();
strTemp += "</span><br>";
strTemp += "<small class=\"description\">";
strTemp += pItem->GetArtist();
strTemp += "</small><br>";
strTemp += "<small class=\"information\">";
strTemp += pItem->GetAlbum();
strTemp += "</small></td></tr>";
strTemp += "</table></li>";
}
return strTemp;
}
};
| [
"dmitry@protonmail.ch"
] | dmitry@protonmail.ch |
18ac639ab39ea610f21a4caa97543b9f11f3cb87 | 897868d4960eee6e728597e4ec5576aa03064785 | /libecc/src/c++/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp | b7fa2e3a03cc509943f2b4526371e534d02dbcf2 | [
"MIT",
"NCSA"
] | permissive | martell/ellcc | ab95d98c6023a23402a474044730db125349c843 | b144e161b5f70da528ae64329f27e4dfab489e5a | refs/heads/master | 2021-04-26T11:49:19.551929 | 2016-10-05T09:21:00 | 2016-10-05T09:21:00 | 70,063,491 | 2 | 1 | NOASSERTION | 2020-03-07T21:58:00 | 2016-10-05T13:32:53 | null | UTF-8 | C++ | false | false | 3,145 | cpp | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <tuple>
// template <class... Types> class tuple;
// template <class... UTypes> tuple(const tuple<UTypes...>& u);
// UNSUPPORTED: c++98, c++03
#include <tuple>
#include <utility>
#include <string>
#include <cassert>
struct Explicit {
int value;
explicit Explicit(int x) : value(x) {}
};
struct Implicit {
int value;
Implicit(int x) : value(x) {}
};
struct B
{
int id_;
explicit B(int i) : id_(i) {}
};
struct D
: B
{
explicit D(int i) : B(i) {}
};
#if _LIBCPP_STD_VER > 11
struct A
{
int id_;
constexpr A(int i) : id_(i) {}
friend constexpr bool operator==(const A& x, const A& y) {return x.id_ == y.id_;}
};
struct C
{
int id_;
constexpr explicit C(int i) : id_(i) {}
friend constexpr bool operator==(const C& x, const C& y) {return x.id_ == y.id_;}
};
#endif
int main()
{
{
typedef std::tuple<double> T0;
typedef std::tuple<int> T1;
T0 t0(2.5);
T1 t1 = t0;
assert(std::get<0>(t1) == 2);
}
#if _LIBCPP_STD_VER > 11
{
typedef std::tuple<double> T0;
typedef std::tuple<A> T1;
constexpr T0 t0(2.5);
constexpr T1 t1 = t0;
static_assert(std::get<0>(t1) == 2, "");
}
{
typedef std::tuple<int> T0;
typedef std::tuple<C> T1;
constexpr T0 t0(2);
constexpr T1 t1{t0};
static_assert(std::get<0>(t1) == C(2), "");
}
#endif
{
typedef std::tuple<double, char> T0;
typedef std::tuple<int, int> T1;
T0 t0(2.5, 'a');
T1 t1 = t0;
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
}
{
typedef std::tuple<double, char, D> T0;
typedef std::tuple<int, int, B> T1;
T0 t0(2.5, 'a', D(3));
T1 t1 = t0;
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
assert(std::get<2>(t1).id_ == 3);
}
{
D d(3);
typedef std::tuple<double, char, D&> T0;
typedef std::tuple<int, int, B&> T1;
T0 t0(2.5, 'a', d);
T1 t1 = t0;
d.id_ = 2;
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
assert(std::get<2>(t1).id_ == 2);
}
{
typedef std::tuple<double, char, int> T0;
typedef std::tuple<int, int, B> T1;
T0 t0(2.5, 'a', 3);
T1 t1(t0);
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
assert(std::get<2>(t1).id_ == 3);
}
{
const std::tuple<int> t1(42);
std::tuple<Explicit> t2(t1);
assert(std::get<0>(t2).value == 42);
}
{
const std::tuple<int> t1(42);
std::tuple<Implicit> t2 = t1;
assert(std::get<0>(t2).value == 42);
}
}
| [
"rich@ellcc.org"
] | rich@ellcc.org |
61d26f40c36169f402830538000c98d96d341c35 | 71e295b8b1fbba937e92502856a22c3c69d49e4f | /src/engine/Graphics/Animation/Animator.h | 8154588175c3997c0b94b42b340349e90c5319f4 | [] | no_license | Douidik/GameEngine | a41f9737589e4ca543b44f1dc02f3fe8ef518823 | e43da29402c6cb5d63490a6cc69cfbc972ba017b | refs/heads/master | 2022-06-19T01:10:20.235816 | 2020-05-10T21:25:08 | 2020-05-10T21:25:08 | 262,878,057 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 443 | h | #pragma once
#include "Clip.h"
namespace Animation {
class Animator {
public:
Animator(std::vector<Clip> clips);
Animator() = default;
void play(const std::string &clipName, std::vector<Joint *> &pJoints, glm::mat4 modelMatrix,
glm::mat4 globalInverseTransform, std::map<std::string, unsigned int> boneMapping);
private:
std::vector<Clip> mClips;
};
} | [
"douidikjam@gmail.com"
] | douidikjam@gmail.com |
19516a5403ca4c2445f9b92fa8070d4c6aa7e3de | 6e6542d3e5c491570ae86ee40bd9424e4de6ecc1 | /Data Structures Problems/Recursion and Backtracking/Easy/print_all_leaf_nodes_of_BT_from_left_to_right/main.cpp | 60675f9f31bc6e64e17dfef23c380377cd97c73d | [] | no_license | Ubaid-Manzoor/Interview_Practice | 9b66a920dfdc934f50b171d990e45dbddd9d7b54 | d1ae188123da060b31e4e537713a45349786835a | refs/heads/master | 2023-02-10T15:52:02.851818 | 2020-12-26T14:58:43 | 2020-12-26T14:58:43 | 275,573,186 | 20 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,175 | cpp | #include <iostream>
using namespace std;
// A Binary Tree Node
struct Node
{
int data;
struct Node *left, *right;
};
// function to print leaf
// nodes from left to right
void printLeafNodes(Node *root) {
if(not root)
return;
if(root->left == NULL and root->right == NULL){
cout<<root->data<<" ";
return;
}
printLeafNodes(root->left);
printLeafNodes(root->right);
}
// Utility function to create a new tree node
Node* newNode(int data)
{
Node *temp = new Node;
temp->data = data;
temp->left = temp->right = NULL;
return temp;
}
// Driver program to test above functions
int main()
{
// Let us create binary tree shown in
// above diagram
Node *root = newNode(1);
root->left = newNode(2);
root->right = newNode(3);
root->left->left = newNode(4);
root->right->left = newNode(5);
root->right->right = newNode(8);
root->right->left->left = newNode(6);
root->right->left->right = newNode(7);
root->right->right->left = newNode(9);
root->right->right->right = newNode(10);
// print leaf nodes of the given tree
printLeafNodes(root);
return 0;
}
| [
"ubaidmanzoor12@gmail.com"
] | ubaidmanzoor12@gmail.com |
4bd1d0061f3741304d8d1f2c352a3caff8eee072 | 1e987bd8b8be0dc1c139fa6bf92e8229eb51da27 | /learn/atcxx/arrays.cc | 173d1f9126970c98c73cd4283c6f2c62a12ff2a4 | [] | no_license | tszdanger/phd | c97091b4f1d7712a836f0c8e3c6f819d53bd0dd5 | aab7f16bd1f3546f81e349fc6e2325fb17beb851 | refs/heads/master | 2023-01-01T00:54:20.136122 | 2020-10-21T18:07:42 | 2020-10-21T18:09:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 677 | cc | #include <iostream>
void print_arr1(int* arr, size_t n) {
for (size_t i = 0; i < n; ++i) std::cout << arr[i] << ' ';
std::cout << std::endl;
}
void print_arr2(int arr[5]) {
for (size_t i = 0; i < 5; ++i) std::cout << arr[i] << ' ';
std::cout << std::endl;
}
void double_arr(int arr[5]) {
for (size_t i = 0; i < 5; ++i) arr[i] *= 2;
}
int main() {
int arr1[] = {1, 2, 3, 4, 5};
int arr2[5] = {1, 2, 3, 4, 5};
int arr3[5] = {1, 2, 3};
int arr4[5];
int arr5[5] = {};
print_arr1(arr1, sizeof(arr1) / sizeof(arr1[0]));
print_arr2(arr2);
print_arr2(arr3);
print_arr2(arr4);
print_arr2(arr5);
double_arr(arr1);
print_arr2(arr1);
return 0;
}
| [
"chrisc.101@gmail.com"
] | chrisc.101@gmail.com |
2360c6a85b38d60d4a20591ae83c81f5e8622805 | 72852e07bb30adbee608275d6048b2121a5b9d82 | /algorithms/problem_0053/solution.cpp | e892de2fe833beb51d6a5c3403f31e8b5b91b0b8 | [] | no_license | drlongle/leetcode | e172ae29ea63911ccc3afb815f6dbff041609939 | 8e61ddf06fb3a4fb4a4e3d8466f3367ee1f27e13 | refs/heads/master | 2023-01-08T16:26:12.370098 | 2023-01-03T09:08:24 | 2023-01-03T09:08:24 | 81,335,609 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,555 | cpp | /*
53. Maximum Subarray
Total Accepted: 116338 Total Submissions: 314913 Difficulty: Medium
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [-2,1,-3,4,-1,2,1,-5,4],
the contiguous subarray [4,1,2,1] has the largest sum = 6.
If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle.
*/
#include <algorithm>
#include <array>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define ull unsigned long long
using namespace std;
class Solution {
public:
int maxSubArray(vector<int>& nums)
{
int running = 0;
int res = numeric_limits<int>::min(), nsize = nums.size();
for (int i = 0; i < nsize; ++i)
{
if (running < 0)
running = 0;
running += nums[i];
if (res < running)
res = running;
}
return res;
}
};
int main()
{
Solution sol;
vector<int> nums = {-2,1,-3,4,-1,2,1,-5,4};
int res = sol.maxSubArray(nums);
cout << "Result: " << res << endl;
return 0;
}
| [
"le@bluetang.cs.unc.edu"
] | le@bluetang.cs.unc.edu |
596b74e767ef419ed8e01441adf50382740463fb | b0119c3e2abfe63b57588268c218175ae35569f3 | /src/leveldb/db/write_batch_internal.h | 05848cadc0313606b6af3ee77a10ba06d1c8f15b | [
"MIT",
"BSD-3-Clause"
] | permissive | kvargha/memecoin | 6bab56b789d90c2eaada6d643a808e3d60710ce1 | 07fba0f43bf7a5e3534b36eb0dcb15495bb48879 | refs/heads/master | 2020-03-27T05:35:42.952023 | 2018-08-29T06:35:41 | 2018-08-29T06:35:41 | 144,773,758 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,508 | h | // Copyright (c) 2018 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#ifndef STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
#define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
#include "leveldb/write_batch.h"
namespace leveldb {
class MemTable;
// WriteBatchInternal provides static methods for manipulating a
// WriteBatch that we don't want in the public WriteBatch interface.
class WriteBatchInternal {
public:
// Return the number of entries in the batch.
static int Count(const WriteBatch* batch);
// Set the count for the number of entries in the batch.
static void SetCount(WriteBatch* batch, int n);
// Return the seqeunce number for the start of this batch.
static SequenceNumber Sequence(const WriteBatch* batch);
// Store the specified number as the seqeunce number for the start of
// this batch.
static void SetSequence(WriteBatch* batch, SequenceNumber seq);
static Slice Contents(const WriteBatch* batch) {
return Slice(batch->rep_);
}
static size_t ByteSize(const WriteBatch* batch) {
return batch->rep_.size();
}
static void SetContents(WriteBatch* batch, const Slice& contents);
static Status InsertInto(const WriteBatch* batch, MemTable* memtable);
static void Append(WriteBatch* dst, const WriteBatch* src);
};
} // namespace leveldb
#endif // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
| [
"bob174d@gmail.com"
] | bob174d@gmail.com |
fef7802cb32c0b6690033d6231c138345ec0ff33 | 0fc921c705fa0ae5c1f419a9cc696b36a499ebfc | /src/rpc/blockchain.cpp | 183fa502289b1d742dd6e076b9fc5a50460bf14a | [
"MIT"
] | permissive | criptolot/bsvcoin | b40ff8b6910e23904515b4d9187ac359ebd42f78 | 7081e76ea9960972c82fa1c356119947a92d601e | refs/heads/main | 2023-03-30T17:52:18.592685 | 2021-04-14T13:52:34 | 2021-04-14T13:52:34 | 357,923,071 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 113,861 | cpp | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <rpc/blockchain.h>
#include <amount.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <coins.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <hash.h>
#include <index/blockfilterindex.h>
#include <node/blockstorage.h>
#include <node/coinstats.h>
#include <node/context.h>
#include <node/utxo_snapshot.h>
#include <policy/feerate.h>
#include <policy/fees.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <primitives/transaction.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <streams.h>
#include <sync.h>
#include <txdb.h>
#include <txmempool.h>
#include <undo.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/translation.h>
#include <validation.h>
#include <validationinterface.h>
#include <warnings.h>
#include <stdint.h>
#include <univalue.h>
#include <condition_variable>
#include <memory>
#include <mutex>
struct CUpdatedBlock
{
uint256 hash;
int height;
};
static Mutex cs_blockchange;
static std::condition_variable cond_blockchange;
static CUpdatedBlock latestblock GUARDED_BY(cs_blockchange);
NodeContext& EnsureNodeContext(const std::any& context)
{
auto node_context = util::AnyPtr<NodeContext>(context);
if (!node_context) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Node context not found");
}
return *node_context;
}
CTxMemPool& EnsureMemPool(const std::any& context)
{
const NodeContext& node = EnsureNodeContext(context);
if (!node.mempool) {
throw JSONRPCError(RPC_CLIENT_MEMPOOL_DISABLED, "Mempool disabled or instance not found");
}
return *node.mempool;
}
ChainstateManager& EnsureChainman(const std::any& context)
{
const NodeContext& node = EnsureNodeContext(context);
if (!node.chainman) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Node chainman not found");
}
return *node.chainman;
}
CBlockPolicyEstimator& EnsureFeeEstimator(const std::any& context)
{
NodeContext& node = EnsureNodeContext(context);
if (!node.fee_estimator) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Fee estimation disabled");
}
return *node.fee_estimator;
}
/* Calculate the difficulty for a given block index.
*/
double GetDifficulty(const CBlockIndex* blockindex)
{
CHECK_NONFATAL(blockindex);
int nShift = (blockindex->nBits >> 24) & 0xff;
double dDiff =
(double)0x0000ffff / (double)(blockindex->nBits & 0x00ffffff);
while (nShift < 29)
{
dDiff *= 256.0;
nShift++;
}
while (nShift > 29)
{
dDiff /= 256.0;
nShift--;
}
return dDiff;
}
static int ComputeNextBlockAndDepth(const CBlockIndex* tip, const CBlockIndex* blockindex, const CBlockIndex*& next)
{
next = tip->GetAncestor(blockindex->nHeight + 1);
if (next && next->pprev == blockindex) {
return tip->nHeight - blockindex->nHeight + 1;
}
next = nullptr;
return blockindex == tip ? 1 : -1;
}
UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex)
{
// Serialize passed information without accessing chain state of the active chain!
AssertLockNotHeld(cs_main); // For performance reasons
UniValue result(UniValue::VOBJ);
result.pushKV("hash", blockindex->GetBlockHash().GetHex());
const CBlockIndex* pnext;
int confirmations = ComputeNextBlockAndDepth(tip, blockindex, pnext);
result.pushKV("confirmations", confirmations);
result.pushKV("height", blockindex->nHeight);
result.pushKV("version", blockindex->nVersion);
result.pushKV("versionHex", strprintf("%08x", blockindex->nVersion));
result.pushKV("merkleroot", blockindex->hashMerkleRoot.GetHex());
result.pushKV("time", (int64_t)blockindex->nTime);
result.pushKV("mediantime", (int64_t)blockindex->GetMedianTimePast());
result.pushKV("nonce", (uint64_t)blockindex->nNonce);
result.pushKV("bits", strprintf("%08x", blockindex->nBits));
result.pushKV("difficulty", GetDifficulty(blockindex));
result.pushKV("chainwork", blockindex->nChainWork.GetHex());
result.pushKV("nTx", (uint64_t)blockindex->nTx);
if (blockindex->pprev)
result.pushKV("previousblockhash", blockindex->pprev->GetBlockHash().GetHex());
if (pnext)
result.pushKV("nextblockhash", pnext->GetBlockHash().GetHex());
return result;
}
UniValue blockToJSON(const CBlock& block, const CBlockIndex* tip, const CBlockIndex* blockindex, bool txDetails)
{
UniValue result = blockheaderToJSON(tip, blockindex);
result.pushKV("strippedsize", (int)::GetSerializeSize(block, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS));
result.pushKV("size", (int)::GetSerializeSize(block, PROTOCOL_VERSION));
result.pushKV("weight", (int)::GetBlockWeight(block));
UniValue txs(UniValue::VARR);
if (txDetails) {
CBlockUndo blockUndo;
const bool have_undo = !IsBlockPruned(blockindex) && UndoReadFromDisk(blockUndo, blockindex);
for (size_t i = 0; i < block.vtx.size(); ++i) {
const CTransactionRef& tx = block.vtx.at(i);
// coinbase transaction (i == 0) doesn't have undo data
const CTxUndo* txundo = (have_undo && i) ? &blockUndo.vtxundo.at(i - 1) : nullptr;
UniValue objTx(UniValue::VOBJ);
TxToUniv(*tx, uint256(), objTx, true, RPCSerializationFlags(), txundo);
txs.push_back(objTx);
}
} else {
for (const CTransactionRef& tx : block.vtx) {
txs.push_back(tx->GetHash().GetHex());
}
}
result.pushKV("tx", txs);
return result;
}
static RPCHelpMan getblockcount()
{
return RPCHelpMan{"getblockcount",
"\nReturns the height of the most-work fully-validated chain.\n"
"The genesis block has height 0.\n",
{},
RPCResult{
RPCResult::Type::NUM, "", "The current block count"},
RPCExamples{
HelpExampleCli("getblockcount", "")
+ HelpExampleRpc("getblockcount", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
LOCK(cs_main);
return ::ChainActive().Height();
},
};
}
static RPCHelpMan getbestblockhash()
{
return RPCHelpMan{"getbestblockhash",
"\nReturns the hash of the best (tip) block in the most-work fully-validated chain.\n",
{},
RPCResult{
RPCResult::Type::STR_HEX, "", "the block hash, hex-encoded"},
RPCExamples{
HelpExampleCli("getbestblockhash", "")
+ HelpExampleRpc("getbestblockhash", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
LOCK(cs_main);
return ::ChainActive().Tip()->GetBlockHash().GetHex();
},
};
}
void RPCNotifyBlockChange(const CBlockIndex* pindex)
{
if(pindex) {
LOCK(cs_blockchange);
latestblock.hash = pindex->GetBlockHash();
latestblock.height = pindex->nHeight;
}
cond_blockchange.notify_all();
}
static RPCHelpMan waitfornewblock()
{
return RPCHelpMan{"waitfornewblock",
"\nWaits for a specific new block and returns useful info about it.\n"
"\nReturns the current block on timeout or exit.\n",
{
{"timeout", RPCArg::Type::NUM, /* default */ "0", "Time in milliseconds to wait for a response. 0 indicates no timeout."},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "hash", "The blockhash"},
{RPCResult::Type::NUM, "height", "Block height"},
}},
RPCExamples{
HelpExampleCli("waitfornewblock", "1000")
+ HelpExampleRpc("waitfornewblock", "1000")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
int timeout = 0;
if (!request.params[0].isNull())
timeout = request.params[0].get_int();
CUpdatedBlock block;
{
WAIT_LOCK(cs_blockchange, lock);
block = latestblock;
if(timeout)
cond_blockchange.wait_for(lock, std::chrono::milliseconds(timeout), [&block]() EXCLUSIVE_LOCKS_REQUIRED(cs_blockchange) {return latestblock.height != block.height || latestblock.hash != block.hash || !IsRPCRunning(); });
else
cond_blockchange.wait(lock, [&block]() EXCLUSIVE_LOCKS_REQUIRED(cs_blockchange) {return latestblock.height != block.height || latestblock.hash != block.hash || !IsRPCRunning(); });
block = latestblock;
}
UniValue ret(UniValue::VOBJ);
ret.pushKV("hash", block.hash.GetHex());
ret.pushKV("height", block.height);
return ret;
},
};
}
static RPCHelpMan waitforblock()
{
return RPCHelpMan{"waitforblock",
"\nWaits for a specific new block and returns useful info about it.\n"
"\nReturns the current block on timeout or exit.\n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Block hash to wait for."},
{"timeout", RPCArg::Type::NUM, /* default */ "0", "Time in milliseconds to wait for a response. 0 indicates no timeout."},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "hash", "The blockhash"},
{RPCResult::Type::NUM, "height", "Block height"},
}},
RPCExamples{
HelpExampleCli("waitforblock", "\"0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862\" 1000")
+ HelpExampleRpc("waitforblock", "\"0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862\", 1000")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
int timeout = 0;
uint256 hash(ParseHashV(request.params[0], "blockhash"));
if (!request.params[1].isNull())
timeout = request.params[1].get_int();
CUpdatedBlock block;
{
WAIT_LOCK(cs_blockchange, lock);
if(timeout)
cond_blockchange.wait_for(lock, std::chrono::milliseconds(timeout), [&hash]() EXCLUSIVE_LOCKS_REQUIRED(cs_blockchange) {return latestblock.hash == hash || !IsRPCRunning();});
else
cond_blockchange.wait(lock, [&hash]() EXCLUSIVE_LOCKS_REQUIRED(cs_blockchange) {return latestblock.hash == hash || !IsRPCRunning(); });
block = latestblock;
}
UniValue ret(UniValue::VOBJ);
ret.pushKV("hash", block.hash.GetHex());
ret.pushKV("height", block.height);
return ret;
},
};
}
static RPCHelpMan waitforblockheight()
{
return RPCHelpMan{"waitforblockheight",
"\nWaits for (at least) block height and returns the height and hash\n"
"of the current tip.\n"
"\nReturns the current block on timeout or exit.\n",
{
{"height", RPCArg::Type::NUM, RPCArg::Optional::NO, "Block height to wait for."},
{"timeout", RPCArg::Type::NUM, /* default */ "0", "Time in milliseconds to wait for a response. 0 indicates no timeout."},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "hash", "The blockhash"},
{RPCResult::Type::NUM, "height", "Block height"},
}},
RPCExamples{
HelpExampleCli("waitforblockheight", "100 1000")
+ HelpExampleRpc("waitforblockheight", "100, 1000")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
int timeout = 0;
int height = request.params[0].get_int();
if (!request.params[1].isNull())
timeout = request.params[1].get_int();
CUpdatedBlock block;
{
WAIT_LOCK(cs_blockchange, lock);
if(timeout)
cond_blockchange.wait_for(lock, std::chrono::milliseconds(timeout), [&height]() EXCLUSIVE_LOCKS_REQUIRED(cs_blockchange) {return latestblock.height >= height || !IsRPCRunning();});
else
cond_blockchange.wait(lock, [&height]() EXCLUSIVE_LOCKS_REQUIRED(cs_blockchange) {return latestblock.height >= height || !IsRPCRunning(); });
block = latestblock;
}
UniValue ret(UniValue::VOBJ);
ret.pushKV("hash", block.hash.GetHex());
ret.pushKV("height", block.height);
return ret;
},
};
}
static RPCHelpMan syncwithvalidationinterfacequeue()
{
return RPCHelpMan{"syncwithvalidationinterfacequeue",
"\nWaits for the validation interface queue to catch up on everything that was there when we entered this function.\n",
{},
RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{
HelpExampleCli("syncwithvalidationinterfacequeue","")
+ HelpExampleRpc("syncwithvalidationinterfacequeue","")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
SyncWithValidationInterfaceQueue();
return NullUniValue;
},
};
}
static RPCHelpMan getdifficulty()
{
return RPCHelpMan{"getdifficulty",
"\nReturns the proof-of-work difficulty as a multiple of the minimum difficulty.\n",
{},
RPCResult{
RPCResult::Type::NUM, "", "the proof-of-work difficulty as a multiple of the minimum difficulty."},
RPCExamples{
HelpExampleCli("getdifficulty", "")
+ HelpExampleRpc("getdifficulty", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
LOCK(cs_main);
return GetDifficulty(::ChainActive().Tip());
},
};
}
static std::vector<RPCResult> MempoolEntryDescription() { return {
RPCResult{RPCResult::Type::NUM, "vsize", "virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted."},
RPCResult{RPCResult::Type::NUM, "weight", "transaction weight as defined in BIP 141."},
RPCResult{RPCResult::Type::STR_AMOUNT, "fee", "transaction fee in " + CURRENCY_UNIT + " (DEPRECATED)"},
RPCResult{RPCResult::Type::STR_AMOUNT, "modifiedfee", "transaction fee with fee deltas used for mining priority (DEPRECATED)"},
RPCResult{RPCResult::Type::NUM_TIME, "time", "local time transaction entered pool in seconds since 1 Jan 1970 GMT"},
RPCResult{RPCResult::Type::NUM, "height", "block height when transaction entered pool"},
RPCResult{RPCResult::Type::NUM, "descendantcount", "number of in-mempool descendant transactions (including this one)"},
RPCResult{RPCResult::Type::NUM, "descendantsize", "virtual transaction size of in-mempool descendants (including this one)"},
RPCResult{RPCResult::Type::STR_AMOUNT, "descendantfees", "modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)"},
RPCResult{RPCResult::Type::NUM, "ancestorcount", "number of in-mempool ancestor transactions (including this one)"},
RPCResult{RPCResult::Type::NUM, "ancestorsize", "virtual transaction size of in-mempool ancestors (including this one)"},
RPCResult{RPCResult::Type::STR_AMOUNT, "ancestorfees", "modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)"},
RPCResult{RPCResult::Type::STR_HEX, "wtxid", "hash of serialized transaction, including witness data"},
RPCResult{RPCResult::Type::OBJ, "fees", "",
{
RPCResult{RPCResult::Type::STR_AMOUNT, "base", "transaction fee in " + CURRENCY_UNIT},
RPCResult{RPCResult::Type::STR_AMOUNT, "modified", "transaction fee with fee deltas used for mining priority in " + CURRENCY_UNIT},
RPCResult{RPCResult::Type::STR_AMOUNT, "ancestor", "modified fees (see above) of in-mempool ancestors (including this one) in " + CURRENCY_UNIT},
RPCResult{RPCResult::Type::STR_AMOUNT, "descendant", "modified fees (see above) of in-mempool descendants (including this one) in " + CURRENCY_UNIT},
}},
RPCResult{RPCResult::Type::ARR, "depends", "unconfirmed transactions used as inputs for this transaction",
{RPCResult{RPCResult::Type::STR_HEX, "transactionid", "parent transaction id"}}},
RPCResult{RPCResult::Type::ARR, "spentby", "unconfirmed transactions spending outputs from this transaction",
{RPCResult{RPCResult::Type::STR_HEX, "transactionid", "child transaction id"}}},
RPCResult{RPCResult::Type::BOOL, "bip125-replaceable", "Whether this transaction could be replaced due to BIP125 (replace-by-fee)"},
RPCResult{RPCResult::Type::BOOL, "unbroadcast", "Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)"},
};}
static void entryToJSON(const CTxMemPool& pool, UniValue& info, const CTxMemPoolEntry& e) EXCLUSIVE_LOCKS_REQUIRED(pool.cs)
{
AssertLockHeld(pool.cs);
UniValue fees(UniValue::VOBJ);
fees.pushKV("base", ValueFromAmount(e.GetFee()));
fees.pushKV("modified", ValueFromAmount(e.GetModifiedFee()));
fees.pushKV("ancestor", ValueFromAmount(e.GetModFeesWithAncestors()));
fees.pushKV("descendant", ValueFromAmount(e.GetModFeesWithDescendants()));
info.pushKV("fees", fees);
info.pushKV("vsize", (int)e.GetTxSize());
info.pushKV("weight", (int)e.GetTxWeight());
info.pushKV("fee", ValueFromAmount(e.GetFee()));
info.pushKV("modifiedfee", ValueFromAmount(e.GetModifiedFee()));
info.pushKV("time", count_seconds(e.GetTime()));
info.pushKV("height", (int)e.GetHeight());
info.pushKV("descendantcount", e.GetCountWithDescendants());
info.pushKV("descendantsize", e.GetSizeWithDescendants());
info.pushKV("descendantfees", e.GetModFeesWithDescendants());
info.pushKV("ancestorcount", e.GetCountWithAncestors());
info.pushKV("ancestorsize", e.GetSizeWithAncestors());
info.pushKV("ancestorfees", e.GetModFeesWithAncestors());
info.pushKV("wtxid", pool.vTxHashes[e.vTxHashesIdx].first.ToString());
const CTransaction& tx = e.GetTx();
std::set<std::string> setDepends;
for (const CTxIn& txin : tx.vin)
{
if (pool.exists(txin.prevout.hash))
setDepends.insert(txin.prevout.hash.ToString());
}
UniValue depends(UniValue::VARR);
for (const std::string& dep : setDepends)
{
depends.push_back(dep);
}
info.pushKV("depends", depends);
UniValue spent(UniValue::VARR);
const CTxMemPool::txiter& it = pool.mapTx.find(tx.GetHash());
const CTxMemPoolEntry::Children& children = it->GetMemPoolChildrenConst();
for (const CTxMemPoolEntry& child : children) {
spent.push_back(child.GetTx().GetHash().ToString());
}
info.pushKV("spentby", spent);
// Add opt-in RBF status
bool rbfStatus = false;
RBFTransactionState rbfState = IsRBFOptIn(tx, pool);
if (rbfState == RBFTransactionState::UNKNOWN) {
throw JSONRPCError(RPC_MISC_ERROR, "Transaction is not in mempool");
} else if (rbfState == RBFTransactionState::REPLACEABLE_BIP125) {
rbfStatus = true;
}
info.pushKV("bip125-replaceable", rbfStatus);
info.pushKV("unbroadcast", pool.IsUnbroadcastTx(tx.GetHash()));
}
UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose, bool include_mempool_sequence)
{
if (verbose) {
if (include_mempool_sequence) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Verbose results cannot contain mempool sequence values.");
}
LOCK(pool.cs);
UniValue o(UniValue::VOBJ);
for (const CTxMemPoolEntry& e : pool.mapTx) {
const uint256& hash = e.GetTx().GetHash();
UniValue info(UniValue::VOBJ);
entryToJSON(pool, info, e);
// Mempool has unique entries so there is no advantage in using
// UniValue::pushKV, which checks if the key already exists in O(N).
// UniValue::__pushKV is used instead which currently is O(1).
o.__pushKV(hash.ToString(), info);
}
return o;
} else {
uint64_t mempool_sequence;
std::vector<uint256> vtxid;
{
LOCK(pool.cs);
pool.queryHashes(vtxid);
mempool_sequence = pool.GetSequence();
}
UniValue a(UniValue::VARR);
for (const uint256& hash : vtxid)
a.push_back(hash.ToString());
if (!include_mempool_sequence) {
return a;
} else {
UniValue o(UniValue::VOBJ);
o.pushKV("txids", a);
o.pushKV("mempool_sequence", mempool_sequence);
return o;
}
}
}
static RPCHelpMan getrawmempool()
{
return RPCHelpMan{"getrawmempool",
"\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n"
"\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n",
{
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "True for a json object, false for array of transaction ids"},
{"mempool_sequence", RPCArg::Type::BOOL, /* default */ "false", "If verbose=false, returns a json object with transaction list and mempool sequence number attached."},
},
{
RPCResult{"for verbose = false",
RPCResult::Type::ARR, "", "",
{
{RPCResult::Type::STR_HEX, "", "The transaction id"},
}},
RPCResult{"for verbose = true",
RPCResult::Type::OBJ_DYN, "", "",
{
{RPCResult::Type::OBJ, "transactionid", "", MempoolEntryDescription()},
}},
RPCResult{"for verbose = false and mempool_sequence = true",
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::ARR, "txids", "",
{
{RPCResult::Type::STR_HEX, "", "The transaction id"},
}},
{RPCResult::Type::NUM, "mempool_sequence", "The mempool sequence value."},
}},
},
RPCExamples{
HelpExampleCli("getrawmempool", "true")
+ HelpExampleRpc("getrawmempool", "true")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
bool fVerbose = false;
if (!request.params[0].isNull())
fVerbose = request.params[0].get_bool();
bool include_mempool_sequence = false;
if (!request.params[1].isNull()) {
include_mempool_sequence = request.params[1].get_bool();
}
return MempoolToJSON(EnsureMemPool(request.context), fVerbose, include_mempool_sequence);
},
};
}
static RPCHelpMan getmempoolancestors()
{
return RPCHelpMan{"getmempoolancestors",
"\nIf txid is in the mempool, returns all in-mempool ancestors.\n",
{
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "True for a json object, false for array of transaction ids"},
},
{
RPCResult{"for verbose = false",
RPCResult::Type::ARR, "", "",
{{RPCResult::Type::STR_HEX, "", "The transaction id of an in-mempool ancestor transaction"}}},
RPCResult{"for verbose = true",
RPCResult::Type::OBJ_DYN, "", "",
{
{RPCResult::Type::OBJ, "transactionid", "", MempoolEntryDescription()},
}},
},
RPCExamples{
HelpExampleCli("getmempoolancestors", "\"mytxid\"")
+ HelpExampleRpc("getmempoolancestors", "\"mytxid\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
bool fVerbose = false;
if (!request.params[1].isNull())
fVerbose = request.params[1].get_bool();
uint256 hash = ParseHashV(request.params[0], "parameter 1");
const CTxMemPool& mempool = EnsureMemPool(request.context);
LOCK(mempool.cs);
CTxMemPool::txiter it = mempool.mapTx.find(hash);
if (it == mempool.mapTx.end()) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not in mempool");
}
CTxMemPool::setEntries setAncestors;
uint64_t noLimit = std::numeric_limits<uint64_t>::max();
std::string dummy;
mempool.CalculateMemPoolAncestors(*it, setAncestors, noLimit, noLimit, noLimit, noLimit, dummy, false);
if (!fVerbose) {
UniValue o(UniValue::VARR);
for (CTxMemPool::txiter ancestorIt : setAncestors) {
o.push_back(ancestorIt->GetTx().GetHash().ToString());
}
return o;
} else {
UniValue o(UniValue::VOBJ);
for (CTxMemPool::txiter ancestorIt : setAncestors) {
const CTxMemPoolEntry &e = *ancestorIt;
const uint256& _hash = e.GetTx().GetHash();
UniValue info(UniValue::VOBJ);
entryToJSON(mempool, info, e);
o.pushKV(_hash.ToString(), info);
}
return o;
}
},
};
}
static RPCHelpMan getmempooldescendants()
{
return RPCHelpMan{"getmempooldescendants",
"\nIf txid is in the mempool, returns all in-mempool descendants.\n",
{
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "True for a json object, false for array of transaction ids"},
},
{
RPCResult{"for verbose = false",
RPCResult::Type::ARR, "", "",
{{RPCResult::Type::STR_HEX, "", "The transaction id of an in-mempool descendant transaction"}}},
RPCResult{"for verbose = true",
RPCResult::Type::OBJ_DYN, "", "",
{
{RPCResult::Type::OBJ, "transactionid", "", MempoolEntryDescription()},
}},
},
RPCExamples{
HelpExampleCli("getmempooldescendants", "\"mytxid\"")
+ HelpExampleRpc("getmempooldescendants", "\"mytxid\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
bool fVerbose = false;
if (!request.params[1].isNull())
fVerbose = request.params[1].get_bool();
uint256 hash = ParseHashV(request.params[0], "parameter 1");
const CTxMemPool& mempool = EnsureMemPool(request.context);
LOCK(mempool.cs);
CTxMemPool::txiter it = mempool.mapTx.find(hash);
if (it == mempool.mapTx.end()) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not in mempool");
}
CTxMemPool::setEntries setDescendants;
mempool.CalculateDescendants(it, setDescendants);
// CTxMemPool::CalculateDescendants will include the given tx
setDescendants.erase(it);
if (!fVerbose) {
UniValue o(UniValue::VARR);
for (CTxMemPool::txiter descendantIt : setDescendants) {
o.push_back(descendantIt->GetTx().GetHash().ToString());
}
return o;
} else {
UniValue o(UniValue::VOBJ);
for (CTxMemPool::txiter descendantIt : setDescendants) {
const CTxMemPoolEntry &e = *descendantIt;
const uint256& _hash = e.GetTx().GetHash();
UniValue info(UniValue::VOBJ);
entryToJSON(mempool, info, e);
o.pushKV(_hash.ToString(), info);
}
return o;
}
},
};
}
static RPCHelpMan getmempoolentry()
{
return RPCHelpMan{"getmempoolentry",
"\nReturns mempool data for given transaction\n",
{
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"},
},
RPCResult{
RPCResult::Type::OBJ, "", "", MempoolEntryDescription()},
RPCExamples{
HelpExampleCli("getmempoolentry", "\"mytxid\"")
+ HelpExampleRpc("getmempoolentry", "\"mytxid\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
uint256 hash = ParseHashV(request.params[0], "parameter 1");
const CTxMemPool& mempool = EnsureMemPool(request.context);
LOCK(mempool.cs);
CTxMemPool::txiter it = mempool.mapTx.find(hash);
if (it == mempool.mapTx.end()) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not in mempool");
}
const CTxMemPoolEntry &e = *it;
UniValue info(UniValue::VOBJ);
entryToJSON(mempool, info, e);
return info;
},
};
}
static RPCHelpMan getblockhash()
{
return RPCHelpMan{"getblockhash",
"\nReturns hash of block in best-block-chain at height provided.\n",
{
{"height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The height index"},
},
RPCResult{
RPCResult::Type::STR_HEX, "", "The block hash"},
RPCExamples{
HelpExampleCli("getblockhash", "1000")
+ HelpExampleRpc("getblockhash", "1000")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
LOCK(cs_main);
int nHeight = request.params[0].get_int();
if (nHeight < 0 || nHeight > ::ChainActive().Height())
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
CBlockIndex* pblockindex = ::ChainActive()[nHeight];
return pblockindex->GetBlockHash().GetHex();
},
};
}
static RPCHelpMan getblockheader()
{
return RPCHelpMan{"getblockheader",
"\nIf verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.\n"
"If verbose is true, returns an Object with information about blockheader <hash>.\n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"verbose", RPCArg::Type::BOOL, /* default */ "true", "true for a json object, false for the hex-encoded data"},
},
{
RPCResult{"for verbose = true",
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "hash", "the block hash (same as provided)"},
{RPCResult::Type::NUM, "confirmations", "The number of confirmations, or -1 if the block is not on the main chain"},
{RPCResult::Type::NUM, "height", "The block height or index"},
{RPCResult::Type::NUM, "version", "The block version"},
{RPCResult::Type::STR_HEX, "versionHex", "The block version formatted in hexadecimal"},
{RPCResult::Type::STR_HEX, "merkleroot", "The merkle root"},
{RPCResult::Type::NUM_TIME, "time", "The block time expressed in " + UNIX_EPOCH_TIME},
{RPCResult::Type::NUM_TIME, "mediantime", "The median block time expressed in " + UNIX_EPOCH_TIME},
{RPCResult::Type::NUM, "nonce", "The nonce"},
{RPCResult::Type::STR_HEX, "bits", "The bits"},
{RPCResult::Type::NUM, "difficulty", "The difficulty"},
{RPCResult::Type::STR_HEX, "chainwork", "Expected number of hashes required to produce the current chain"},
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
}},
RPCResult{"for verbose=false",
RPCResult::Type::STR_HEX, "", "A string that is serialized, hex-encoded data for block 'hash'"},
},
RPCExamples{
HelpExampleCli("getblockheader", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"")
+ HelpExampleRpc("getblockheader", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
uint256 hash(ParseHashV(request.params[0], "hash"));
bool fVerbose = true;
if (!request.params[1].isNull())
fVerbose = request.params[1].get_bool();
const CBlockIndex* pblockindex;
const CBlockIndex* tip;
{
LOCK(cs_main);
pblockindex = g_chainman.m_blockman.LookupBlockIndex(hash);
tip = ::ChainActive().Tip();
}
if (!pblockindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
if (!fVerbose)
{
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
ssBlock << pblockindex->GetBlockHeader();
std::string strHex = HexStr(ssBlock);
return strHex;
}
return blockheaderToJSON(tip, pblockindex);
},
};
}
static CBlock GetBlockChecked(const CBlockIndex* pblockindex)
{
CBlock block;
if (IsBlockPruned(pblockindex)) {
throw JSONRPCError(RPC_MISC_ERROR, "Block not available (pruned data)");
}
if (!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus())) {
// Block not found on disk. This could be because we have the block
// header in our index but not yet have the block or did not accept the
// block.
throw JSONRPCError(RPC_MISC_ERROR, "Block not found on disk");
}
return block;
}
static CBlockUndo GetUndoChecked(const CBlockIndex* pblockindex)
{
CBlockUndo blockUndo;
if (IsBlockPruned(pblockindex)) {
throw JSONRPCError(RPC_MISC_ERROR, "Undo data not available (pruned data)");
}
if (!UndoReadFromDisk(blockUndo, pblockindex)) {
throw JSONRPCError(RPC_MISC_ERROR, "Can't read undo data from disk");
}
return blockUndo;
}
static RPCHelpMan getblock()
{
return RPCHelpMan{"getblock",
"\nIf verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.\n"
"If verbosity is 1, returns an Object with information about block <hash>.\n"
"If verbosity is 2, returns an Object with information about block <hash> and information about each transaction. \n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"verbosity|verbose", RPCArg::Type::NUM, /* default */ "1", "0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data"},
},
{
RPCResult{"for verbosity = 0",
RPCResult::Type::STR_HEX, "", "A string that is serialized, hex-encoded data for block 'hash'"},
RPCResult{"for verbosity = 1",
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "hash", "the block hash (same as provided)"},
{RPCResult::Type::NUM, "confirmations", "The number of confirmations, or -1 if the block is not on the main chain"},
{RPCResult::Type::NUM, "size", "The block size"},
{RPCResult::Type::NUM, "strippedsize", "The block size excluding witness data"},
{RPCResult::Type::NUM, "weight", "The block weight as defined in BIP 141"},
{RPCResult::Type::NUM, "height", "The block height or index"},
{RPCResult::Type::NUM, "version", "The block version"},
{RPCResult::Type::STR_HEX, "versionHex", "The block version formatted in hexadecimal"},
{RPCResult::Type::STR_HEX, "merkleroot", "The merkle root"},
{RPCResult::Type::ARR, "tx", "The transaction ids",
{{RPCResult::Type::STR_HEX, "", "The transaction id"}}},
{RPCResult::Type::NUM_TIME, "time", "The block time expressed in " + UNIX_EPOCH_TIME},
{RPCResult::Type::NUM_TIME, "mediantime", "The median block time expressed in " + UNIX_EPOCH_TIME},
{RPCResult::Type::NUM, "nonce", "The nonce"},
{RPCResult::Type::STR_HEX, "bits", "The bits"},
{RPCResult::Type::NUM, "difficulty", "The difficulty"},
{RPCResult::Type::STR_HEX, "chainwork", "Expected number of hashes required to produce the chain up to this block (in hex)"},
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
}},
RPCResult{"for verbosity = 2",
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::ELISION, "", "Same output as verbosity = 1"},
{RPCResult::Type::ARR, "tx", "",
{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::ELISION, "", "The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 \"tx\" result"},
{RPCResult::Type::NUM, "fee", "The transaction fee in " + CURRENCY_UNIT + ", omitted if block undo data is not available"},
}},
}},
}},
},
RPCExamples{
HelpExampleCli("getblock", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"")
+ HelpExampleRpc("getblock", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
uint256 hash(ParseHashV(request.params[0], "blockhash"));
int verbosity = 1;
if (!request.params[1].isNull()) {
if(request.params[1].isNum())
verbosity = request.params[1].get_int();
else
verbosity = request.params[1].get_bool() ? 1 : 0;
}
CBlock block;
const CBlockIndex* pblockindex;
const CBlockIndex* tip;
{
LOCK(cs_main);
pblockindex = g_chainman.m_blockman.LookupBlockIndex(hash);
tip = ::ChainActive().Tip();
if (!pblockindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
block = GetBlockChecked(pblockindex);
}
if (verbosity <= 0)
{
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
ssBlock << block;
std::string strHex = HexStr(ssBlock);
return strHex;
}
return blockToJSON(block, tip, pblockindex, verbosity >= 2);
},
};
}
static RPCHelpMan pruneblockchain()
{
return RPCHelpMan{"pruneblockchain", "",
{
{"height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The block height to prune up to. May be set to a discrete height, or to a " + UNIX_EPOCH_TIME + "\n"
" to prune blocks whose block time is at least 2 hours older than the provided timestamp."},
},
RPCResult{
RPCResult::Type::NUM, "", "Height of the last block pruned"},
RPCExamples{
HelpExampleCli("pruneblockchain", "1000")
+ HelpExampleRpc("pruneblockchain", "1000")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
if (!fPruneMode)
throw JSONRPCError(RPC_MISC_ERROR, "Cannot prune blocks because node is not in prune mode.");
LOCK(cs_main);
int heightParam = request.params[0].get_int();
if (heightParam < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative block height.");
// Height value more than a billion is too high to be a block height, and
// too low to be a block time (corresponds to timestamp from Sep 2001).
if (heightParam > 1000000000) {
// Add a 2 hour buffer to include blocks which might have had old timestamps
CBlockIndex* pindex = ::ChainActive().FindEarliestAtLeast(heightParam - TIMESTAMP_WINDOW, 0);
if (!pindex) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Could not find block with at least the specified timestamp.");
}
heightParam = pindex->nHeight;
}
unsigned int height = (unsigned int) heightParam;
unsigned int chainHeight = (unsigned int) ::ChainActive().Height();
if (chainHeight < Params().PruneAfterHeight())
throw JSONRPCError(RPC_MISC_ERROR, "Blockchain is too short for pruning.");
else if (height > chainHeight)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Blockchain is shorter than the attempted prune height.");
else if (height > chainHeight - MIN_BLOCKS_TO_KEEP) {
LogPrint(BCLog::RPC, "Attempt to prune blocks close to the tip. Retaining the minimum number of blocks.\n");
height = chainHeight - MIN_BLOCKS_TO_KEEP;
}
PruneBlockFilesManual(::ChainstateActive(), height);
const CBlockIndex* block = ::ChainActive().Tip();
CHECK_NONFATAL(block);
while (block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) {
block = block->pprev;
}
return uint64_t(block->nHeight);
},
};
}
CoinStatsHashType ParseHashType(const std::string& hash_type_input)
{
if (hash_type_input == "hash_serialized_2") {
return CoinStatsHashType::HASH_SERIALIZED;
} else if (hash_type_input == "muhash") {
return CoinStatsHashType::MUHASH;
} else if (hash_type_input == "none") {
return CoinStatsHashType::NONE;
} else {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s is not a valid hash_type", hash_type_input));
}
}
static RPCHelpMan gettxoutsetinfo()
{
return RPCHelpMan{"gettxoutsetinfo",
"\nReturns statistics about the unspent transaction output set.\n"
"Note this call may take some time.\n",
{
{"hash_type", RPCArg::Type::STR, /* default */ "hash_serialized_2", "Which UTXO set hash should be calculated. Options: 'hash_serialized_2' (the legacy algorithm), 'muhash', 'none'."},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "height", "The block height (index) of the returned statistics"},
{RPCResult::Type::STR_HEX, "bestblock", "The hash of the block at which these statistics are calculated"},
{RPCResult::Type::NUM, "transactions", "The number of transactions with unspent outputs"},
{RPCResult::Type::NUM, "txouts", "The number of unspent transaction outputs"},
{RPCResult::Type::NUM, "bogosize", "A meaningless metric for UTXO set size"},
{RPCResult::Type::STR_HEX, "hash_serialized_2", /* optional */ true, "The serialized hash (only present if 'hash_serialized_2' hash_type is chosen)"},
{RPCResult::Type::STR_HEX, "muhash", /* optional */ true, "The serialized hash (only present if 'muhash' hash_type is chosen)"},
{RPCResult::Type::NUM, "disk_size", "The estimated size of the chainstate on disk"},
{RPCResult::Type::STR_AMOUNT, "total_amount", "The total amount of coins in the UTXO set"},
}},
RPCExamples{
HelpExampleCli("gettxoutsetinfo", "")
+ HelpExampleRpc("gettxoutsetinfo", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
UniValue ret(UniValue::VOBJ);
CCoinsStats stats;
::ChainstateActive().ForceFlushStateToDisk();
const CoinStatsHashType hash_type{request.params[0].isNull() ? CoinStatsHashType::HASH_SERIALIZED : ParseHashType(request.params[0].get_str())};
CCoinsView* coins_view = WITH_LOCK(::cs_main, return &::ChainstateActive().CoinsDB());
NodeContext& node = EnsureNodeContext(request.context);
if (GetUTXOStats(coins_view, WITH_LOCK(::cs_main, return std::ref(g_chainman.m_blockman)), stats, hash_type, node.rpc_interruption_point)) {
ret.pushKV("height", (int64_t)stats.nHeight);
ret.pushKV("bestblock", stats.hashBlock.GetHex());
ret.pushKV("transactions", (int64_t)stats.nTransactions);
ret.pushKV("txouts", (int64_t)stats.nTransactionOutputs);
ret.pushKV("bogosize", (int64_t)stats.nBogoSize);
if (hash_type == CoinStatsHashType::HASH_SERIALIZED) {
ret.pushKV("hash_serialized_2", stats.hashSerialized.GetHex());
}
if (hash_type == CoinStatsHashType::MUHASH) {
ret.pushKV("muhash", stats.hashSerialized.GetHex());
}
ret.pushKV("disk_size", stats.nDiskSize);
ret.pushKV("total_amount", ValueFromAmount(stats.nTotalAmount));
} else {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Unable to read UTXO set");
}
return ret;
},
};
}
static RPCHelpMan gettxout()
{
return RPCHelpMan{"gettxout",
"\nReturns details about an unspent transaction output.\n",
{
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"},
{"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"},
{"include_mempool", RPCArg::Type::BOOL, /* default */ "true", "Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear."},
},
{
RPCResult{"If the UTXO was not found", RPCResult::Type::NONE, "", ""},
RPCResult{"Otherwise", RPCResult::Type::OBJ, "", "", {
{RPCResult::Type::STR_HEX, "bestblock", "The hash of the block at the tip of the chain"},
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
{RPCResult::Type::STR_AMOUNT, "value", "The transaction value in " + CURRENCY_UNIT},
{RPCResult::Type::OBJ, "scriptPubKey", "", {
{RPCResult::Type::STR, "asm", ""},
{RPCResult::Type::STR_HEX, "hex", ""},
{RPCResult::Type::NUM, "reqSigs", /* optional */ true, "(DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Number of required signatures"},
{RPCResult::Type::STR, "type", "The type, eg pubkeyhash"},
{RPCResult::Type::STR, "address", /* optional */ true, "bitcoin address (only if a well-defined address exists)"},
{RPCResult::Type::ARR, "addresses", /* optional */ true, "(DEPRECATED, returned only if config option -deprecatedrpc=addresses is passed) Array of bitcoin addresses",
{{RPCResult::Type::STR, "address", "bitcoin address"}}},
}},
{RPCResult::Type::BOOL, "coinbase", "Coinbase or not"},
}},
},
RPCExamples{
"\nGet unspent transactions\n"
+ HelpExampleCli("listunspent", "") +
"\nView the details\n"
+ HelpExampleCli("gettxout", "\"txid\" 1") +
"\nAs a JSON-RPC call\n"
+ HelpExampleRpc("gettxout", "\"txid\", 1")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
LOCK(cs_main);
UniValue ret(UniValue::VOBJ);
uint256 hash(ParseHashV(request.params[0], "txid"));
int n = request.params[1].get_int();
COutPoint out(hash, n);
bool fMempool = true;
if (!request.params[2].isNull())
fMempool = request.params[2].get_bool();
Coin coin;
CCoinsViewCache* coins_view = &::ChainstateActive().CoinsTip();
if (fMempool) {
const CTxMemPool& mempool = EnsureMemPool(request.context);
LOCK(mempool.cs);
CCoinsViewMemPool view(coins_view, mempool);
if (!view.GetCoin(out, coin) || mempool.isSpent(out)) {
return NullUniValue;
}
} else {
if (!coins_view->GetCoin(out, coin)) {
return NullUniValue;
}
}
const CBlockIndex* pindex = g_chainman.m_blockman.LookupBlockIndex(coins_view->GetBestBlock());
ret.pushKV("bestblock", pindex->GetBlockHash().GetHex());
if (coin.nHeight == MEMPOOL_HEIGHT) {
ret.pushKV("confirmations", 0);
} else {
ret.pushKV("confirmations", (int64_t)(pindex->nHeight - coin.nHeight + 1));
}
ret.pushKV("value", ValueFromAmount(coin.out.nValue));
UniValue o(UniValue::VOBJ);
ScriptPubKeyToUniv(coin.out.scriptPubKey, o, true);
ret.pushKV("scriptPubKey", o);
ret.pushKV("coinbase", (bool)coin.fCoinBase);
return ret;
},
};
}
static RPCHelpMan verifychain()
{
return RPCHelpMan{"verifychain",
"\nVerifies blockchain database.\n",
{
{"checklevel", RPCArg::Type::NUM, /* default */ strprintf("%d, range=0-4", DEFAULT_CHECKLEVEL),
strprintf("How thorough the block verification is:\n - %s", Join(CHECKLEVEL_DOC, "\n- "))},
{"nblocks", RPCArg::Type::NUM, /* default */ strprintf("%d, 0=all", DEFAULT_CHECKBLOCKS), "The number of blocks to check."},
},
RPCResult{
RPCResult::Type::BOOL, "", "Verified or not"},
RPCExamples{
HelpExampleCli("verifychain", "")
+ HelpExampleRpc("verifychain", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
const int check_level(request.params[0].isNull() ? DEFAULT_CHECKLEVEL : request.params[0].get_int());
const int check_depth{request.params[1].isNull() ? DEFAULT_CHECKBLOCKS : request.params[1].get_int()};
LOCK(cs_main);
return CVerifyDB().VerifyDB(Params(), ::ChainstateActive(), &::ChainstateActive().CoinsTip(), check_level, check_depth);
},
};
}
static void BuriedForkDescPushBack(UniValue& softforks, const std::string &name, int height) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
{
// For buried deployments.
// A buried deployment is one where the height of the activation has been hardcoded into
// the client implementation long after the consensus change has activated. See BIP 90.
// Buried deployments with activation height value of
// std::numeric_limits<int>::max() are disabled and thus hidden.
if (height == std::numeric_limits<int>::max()) return;
UniValue rv(UniValue::VOBJ);
rv.pushKV("type", "buried");
// getblockchaininfo reports the softfork as active from when the chain height is
// one below the activation height
rv.pushKV("active", ::ChainActive().Tip()->nHeight + 1 >= height);
rv.pushKV("height", height);
softforks.pushKV(name, rv);
}
static void BIP9SoftForkDescPushBack(UniValue& softforks, const std::string &name, const Consensus::Params& consensusParams, Consensus::DeploymentPos id) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
{
// For BIP9 deployments.
// Deployments (e.g. testdummy) with timeout value before Jan 1, 2009 are hidden.
// A timeout value of 0 guarantees a softfork will never be activated.
// This is used when merging logic to implement a proposed softfork without a specified deployment schedule.
if (consensusParams.vDeployments[id].nTimeout <= 1230768000) return;
UniValue bip9(UniValue::VOBJ);
const ThresholdState thresholdState = VersionBitsState(::ChainActive().Tip(), consensusParams, id, versionbitscache);
switch (thresholdState) {
case ThresholdState::DEFINED: bip9.pushKV("status", "defined"); break;
case ThresholdState::STARTED: bip9.pushKV("status", "started"); break;
case ThresholdState::LOCKED_IN: bip9.pushKV("status", "locked_in"); break;
case ThresholdState::ACTIVE: bip9.pushKV("status", "active"); break;
case ThresholdState::FAILED: bip9.pushKV("status", "failed"); break;
}
if (ThresholdState::STARTED == thresholdState)
{
bip9.pushKV("bit", consensusParams.vDeployments[id].bit);
}
bip9.pushKV("start_time", consensusParams.vDeployments[id].nStartTime);
bip9.pushKV("timeout", consensusParams.vDeployments[id].nTimeout);
int64_t since_height = VersionBitsStateSinceHeight(::ChainActive().Tip(), consensusParams, id, versionbitscache);
bip9.pushKV("since", since_height);
if (ThresholdState::STARTED == thresholdState)
{
UniValue statsUV(UniValue::VOBJ);
BIP9Stats statsStruct = VersionBitsStatistics(::ChainActive().Tip(), consensusParams, id);
statsUV.pushKV("period", statsStruct.period);
statsUV.pushKV("threshold", statsStruct.threshold);
statsUV.pushKV("elapsed", statsStruct.elapsed);
statsUV.pushKV("count", statsStruct.count);
statsUV.pushKV("possible", statsStruct.possible);
bip9.pushKV("statistics", statsUV);
}
UniValue rv(UniValue::VOBJ);
rv.pushKV("type", "bip9");
rv.pushKV("bip9", bip9);
if (ThresholdState::ACTIVE == thresholdState) {
rv.pushKV("height", since_height);
}
rv.pushKV("active", ThresholdState::ACTIVE == thresholdState);
softforks.pushKV(name, rv);
}
RPCHelpMan getblockchaininfo()
{
return RPCHelpMan{"getblockchaininfo",
"Returns an object containing various state info regarding blockchain processing.\n",
{},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR, "chain", "current network name (main, test, signet, regtest)"},
{RPCResult::Type::NUM, "blocks", "the height of the most-work fully-validated chain. The genesis block has height 0"},
{RPCResult::Type::NUM, "headers", "the current number of headers we have validated"},
{RPCResult::Type::STR, "bestblockhash", "the hash of the currently best block"},
{RPCResult::Type::NUM, "difficulty", "the current difficulty"},
{RPCResult::Type::NUM, "mediantime", "median time for the current best block"},
{RPCResult::Type::NUM, "verificationprogress", "estimate of verification progress [0..1]"},
{RPCResult::Type::BOOL, "initialblockdownload", "(debug information) estimate of whether this node is in Initial Block Download mode"},
{RPCResult::Type::STR_HEX, "chainwork", "total amount of work in active chain, in hexadecimal"},
{RPCResult::Type::NUM, "size_on_disk", "the estimated size of the block and undo files on disk"},
{RPCResult::Type::BOOL, "pruned", "if the blocks are subject to pruning"},
{RPCResult::Type::NUM, "pruneheight", "lowest-height complete block stored (only present if pruning is enabled)"},
{RPCResult::Type::BOOL, "automatic_pruning", "whether automatic pruning is enabled (only present if pruning is enabled)"},
{RPCResult::Type::NUM, "prune_target_size", "the target size used by pruning (only present if automatic pruning is enabled)"},
{RPCResult::Type::OBJ_DYN, "softforks", "status of softforks",
{
{RPCResult::Type::OBJ, "xxxx", "name of the softfork",
{
{RPCResult::Type::STR, "type", "one of \"buried\", \"bip9\""},
{RPCResult::Type::OBJ, "bip9", "status of bip9 softforks (only for \"bip9\" type)",
{
{RPCResult::Type::STR, "status", "one of \"defined\", \"started\", \"locked_in\", \"active\", \"failed\""},
{RPCResult::Type::NUM, "bit", "the bit (0-28) in the block version field used to signal this softfork (only for \"started\" status)"},
{RPCResult::Type::NUM_TIME, "start_time", "the minimum median time past of a block at which the bit gains its meaning"},
{RPCResult::Type::NUM_TIME, "timeout", "the median time past of a block at which the deployment is considered failed if not yet locked in"},
{RPCResult::Type::NUM, "since", "height of the first block to which the status applies"},
{RPCResult::Type::OBJ, "statistics", "numeric statistics about BIP9 signalling for a softfork (only for \"started\" status)",
{
{RPCResult::Type::NUM, "period", "the length in blocks of the BIP9 signalling period"},
{RPCResult::Type::NUM, "threshold", "the number of blocks with the version bit set required to activate the feature"},
{RPCResult::Type::NUM, "elapsed", "the number of blocks elapsed since the beginning of the current period"},
{RPCResult::Type::NUM, "count", "the number of blocks with the version bit set in the current period"},
{RPCResult::Type::BOOL, "possible", "returns false if there are not enough blocks left in this period to pass activation threshold"},
}},
}},
{RPCResult::Type::NUM, "height", "height of the first block which the rules are or will be enforced (only for \"buried\" type, or \"bip9\" type with \"active\" status)"},
{RPCResult::Type::BOOL, "active", "true if the rules are enforced for the mempool and the next block"},
}},
}},
{RPCResult::Type::STR, "warnings", "any network and blockchain warnings"},
}},
RPCExamples{
HelpExampleCli("getblockchaininfo", "")
+ HelpExampleRpc("getblockchaininfo", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
LOCK(cs_main);
const CBlockIndex* tip = ::ChainActive().Tip();
UniValue obj(UniValue::VOBJ);
obj.pushKV("chain", Params().NetworkIDString());
obj.pushKV("blocks", (int)::ChainActive().Height());
obj.pushKV("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1);
obj.pushKV("bestblockhash", tip->GetBlockHash().GetHex());
obj.pushKV("difficulty", (double)GetDifficulty(tip));
obj.pushKV("mediantime", (int64_t)tip->GetMedianTimePast());
obj.pushKV("verificationprogress", GuessVerificationProgress(Params().TxData(), tip));
obj.pushKV("initialblockdownload", ::ChainstateActive().IsInitialBlockDownload());
obj.pushKV("chainwork", tip->nChainWork.GetHex());
obj.pushKV("size_on_disk", CalculateCurrentUsage());
obj.pushKV("pruned", fPruneMode);
if (fPruneMode) {
const CBlockIndex* block = tip;
CHECK_NONFATAL(block);
while (block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) {
block = block->pprev;
}
obj.pushKV("pruneheight", block->nHeight);
// if 0, execution bypasses the whole if block.
bool automatic_pruning = (gArgs.GetArg("-prune", 0) != 1);
obj.pushKV("automatic_pruning", automatic_pruning);
if (automatic_pruning) {
obj.pushKV("prune_target_size", nPruneTarget);
}
}
const Consensus::Params& consensusParams = Params().GetConsensus();
UniValue softforks(UniValue::VOBJ);
BuriedForkDescPushBack(softforks, "bip34", consensusParams.BIP34Height);
BuriedForkDescPushBack(softforks, "bip66", consensusParams.BIP66Height);
BuriedForkDescPushBack(softforks, "bip65", consensusParams.BIP65Height);
BuriedForkDescPushBack(softforks, "csv", consensusParams.CSVHeight);
BuriedForkDescPushBack(softforks, "segwit", consensusParams.SegwitHeight);
BIP9SoftForkDescPushBack(softforks, "testdummy", consensusParams, Consensus::DEPLOYMENT_TESTDUMMY);
BIP9SoftForkDescPushBack(softforks, "taproot", consensusParams, Consensus::DEPLOYMENT_TAPROOT);
obj.pushKV("softforks", softforks);
obj.pushKV("warnings", GetWarnings(false).original);
return obj;
},
};
}
/** Comparison function for sorting the getchaintips heads. */
struct CompareBlocksByHeight
{
bool operator()(const CBlockIndex* a, const CBlockIndex* b) const
{
/* Make sure that unequal blocks with the same height do not compare
equal. Use the pointers themselves to make a distinction. */
if (a->nHeight != b->nHeight)
return (a->nHeight > b->nHeight);
return a < b;
}
};
static RPCHelpMan getchaintips()
{
return RPCHelpMan{"getchaintips",
"Return information about all known tips in the block tree,"
" including the main chain as well as orphaned branches.\n",
{},
RPCResult{
RPCResult::Type::ARR, "", "",
{{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "height", "height of the chain tip"},
{RPCResult::Type::STR_HEX, "hash", "block hash of the tip"},
{RPCResult::Type::NUM, "branchlen", "zero for main chain, otherwise length of branch connecting the tip to the main chain"},
{RPCResult::Type::STR, "status", "status of the chain, \"active\" for the main chain\n"
"Possible values for status:\n"
"1. \"invalid\" This branch contains at least one invalid block\n"
"2. \"headers-only\" Not all blocks for this branch are available, but the headers are valid\n"
"3. \"valid-headers\" All blocks are available for this branch, but they were never fully validated\n"
"4. \"valid-fork\" This branch is not part of the active chain, but is fully validated\n"
"5. \"active\" This is the tip of the active main chain, which is certainly valid"},
}}}},
RPCExamples{
HelpExampleCli("getchaintips", "")
+ HelpExampleRpc("getchaintips", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
ChainstateManager& chainman = EnsureChainman(request.context);
LOCK(cs_main);
/*
* Idea: The set of chain tips is the active chain tip, plus orphan blocks which do not have another orphan building off of them.
* Algorithm:
* - Make one pass through BlockIndex(), picking out the orphan blocks, and also storing a set of the orphan block's pprev pointers.
* - Iterate through the orphan blocks. If the block isn't pointed to by another orphan, it is a chain tip.
* - Add the active chain tip
*/
std::set<const CBlockIndex*, CompareBlocksByHeight> setTips;
std::set<const CBlockIndex*> setOrphans;
std::set<const CBlockIndex*> setPrevs;
for (const std::pair<const uint256, CBlockIndex*>& item : chainman.BlockIndex()) {
if (!chainman.ActiveChain().Contains(item.second)) {
setOrphans.insert(item.second);
setPrevs.insert(item.second->pprev);
}
}
for (std::set<const CBlockIndex*>::iterator it = setOrphans.begin(); it != setOrphans.end(); ++it) {
if (setPrevs.erase(*it) == 0) {
setTips.insert(*it);
}
}
// Always report the currently active tip.
setTips.insert(chainman.ActiveChain().Tip());
/* Construct the output array. */
UniValue res(UniValue::VARR);
for (const CBlockIndex* block : setTips) {
UniValue obj(UniValue::VOBJ);
obj.pushKV("height", block->nHeight);
obj.pushKV("hash", block->phashBlock->GetHex());
const int branchLen = block->nHeight - chainman.ActiveChain().FindFork(block)->nHeight;
obj.pushKV("branchlen", branchLen);
std::string status;
if (chainman.ActiveChain().Contains(block)) {
// This block is part of the currently active chain.
status = "active";
} else if (block->nStatus & BLOCK_FAILED_MASK) {
// This block or one of its ancestors is invalid.
status = "invalid";
} else if (!block->HaveTxsDownloaded()) {
// This block cannot be connected because full block data for it or one of its parents is missing.
status = "headers-only";
} else if (block->IsValid(BLOCK_VALID_SCRIPTS)) {
// This block is fully validated, but no longer part of the active chain. It was probably the active block once, but was reorganized.
status = "valid-fork";
} else if (block->IsValid(BLOCK_VALID_TREE)) {
// The headers for this block are valid, but it has not been validated. It was probably never part of the most-work chain.
status = "valid-headers";
} else {
// No clue.
status = "unknown";
}
obj.pushKV("status", status);
res.push_back(obj);
}
return res;
},
};
}
UniValue MempoolInfoToJSON(const CTxMemPool& pool)
{
// Make sure this call is atomic in the pool.
LOCK(pool.cs);
UniValue ret(UniValue::VOBJ);
ret.pushKV("loaded", pool.IsLoaded());
ret.pushKV("size", (int64_t)pool.size());
ret.pushKV("bytes", (int64_t)pool.GetTotalTxSize());
ret.pushKV("usage", (int64_t)pool.DynamicMemoryUsage());
ret.pushKV("total_fee", ValueFromAmount(pool.GetTotalFee()));
size_t maxmempool = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
ret.pushKV("maxmempool", (int64_t) maxmempool);
ret.pushKV("mempoolminfee", ValueFromAmount(std::max(pool.GetMinFee(maxmempool), ::minRelayTxFee).GetFeePerK()));
ret.pushKV("minrelaytxfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()));
ret.pushKV("unbroadcastcount", uint64_t{pool.GetUnbroadcastTxs().size()});
return ret;
}
static RPCHelpMan getmempoolinfo()
{
return RPCHelpMan{"getmempoolinfo",
"\nReturns details on the active state of the TX memory pool.\n",
{},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::BOOL, "loaded", "True if the mempool is fully loaded"},
{RPCResult::Type::NUM, "size", "Current tx count"},
{RPCResult::Type::NUM, "bytes", "Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted"},
{RPCResult::Type::NUM, "usage", "Total memory usage for the mempool"},
{RPCResult::Type::STR_AMOUNT, "total_fee", "Total fees for the mempool in " + CURRENCY_UNIT + ", ignoring modified fees through prioritizetransaction"},
{RPCResult::Type::NUM, "maxmempool", "Maximum memory usage for the mempool"},
{RPCResult::Type::STR_AMOUNT, "mempoolminfee", "Minimum fee rate in " + CURRENCY_UNIT + "/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee"},
{RPCResult::Type::STR_AMOUNT, "minrelaytxfee", "Current minimum relay fee for transactions"},
{RPCResult::Type::NUM, "unbroadcastcount", "Current number of transactions that haven't passed initial broadcast yet"}
}},
RPCExamples{
HelpExampleCli("getmempoolinfo", "")
+ HelpExampleRpc("getmempoolinfo", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
return MempoolInfoToJSON(EnsureMemPool(request.context));
},
};
}
static RPCHelpMan preciousblock()
{
return RPCHelpMan{"preciousblock",
"\nTreats a block as if it were received before others with the same work.\n"
"\nA later preciousblock call can override the effect of an earlier one.\n"
"\nThe effects of preciousblock are not retained across restarts.\n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to mark as precious"},
},
RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{
HelpExampleCli("preciousblock", "\"blockhash\"")
+ HelpExampleRpc("preciousblock", "\"blockhash\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
uint256 hash(ParseHashV(request.params[0], "blockhash"));
CBlockIndex* pblockindex;
{
LOCK(cs_main);
pblockindex = g_chainman.m_blockman.LookupBlockIndex(hash);
if (!pblockindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
}
BlockValidationState state;
::ChainstateActive().PreciousBlock(state, Params(), pblockindex);
if (!state.IsValid()) {
throw JSONRPCError(RPC_DATABASE_ERROR, state.ToString());
}
return NullUniValue;
},
};
}
static RPCHelpMan invalidateblock()
{
return RPCHelpMan{"invalidateblock",
"\nPermanently marks a block as invalid, as if it violated a consensus rule.\n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to mark as invalid"},
},
RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{
HelpExampleCli("invalidateblock", "\"blockhash\"")
+ HelpExampleRpc("invalidateblock", "\"blockhash\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
uint256 hash(ParseHashV(request.params[0], "blockhash"));
BlockValidationState state;
CBlockIndex* pblockindex;
{
LOCK(cs_main);
pblockindex = g_chainman.m_blockman.LookupBlockIndex(hash);
if (!pblockindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
}
::ChainstateActive().InvalidateBlock(state, Params(), pblockindex);
if (state.IsValid()) {
::ChainstateActive().ActivateBestChain(state, Params());
}
if (!state.IsValid()) {
throw JSONRPCError(RPC_DATABASE_ERROR, state.ToString());
}
return NullUniValue;
},
};
}
static RPCHelpMan reconsiderblock()
{
return RPCHelpMan{"reconsiderblock",
"\nRemoves invalidity status of a block, its ancestors and its descendants, reconsider them for activation.\n"
"This can be used to undo the effects of invalidateblock.\n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to reconsider"},
},
RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{
HelpExampleCli("reconsiderblock", "\"blockhash\"")
+ HelpExampleRpc("reconsiderblock", "\"blockhash\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
uint256 hash(ParseHashV(request.params[0], "blockhash"));
{
LOCK(cs_main);
CBlockIndex* pblockindex = g_chainman.m_blockman.LookupBlockIndex(hash);
if (!pblockindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
::ChainstateActive().ResetBlockFailureFlags(pblockindex);
}
BlockValidationState state;
::ChainstateActive().ActivateBestChain(state, Params());
if (!state.IsValid()) {
throw JSONRPCError(RPC_DATABASE_ERROR, state.ToString());
}
return NullUniValue;
},
};
}
static RPCHelpMan getchaintxstats()
{
return RPCHelpMan{"getchaintxstats",
"\nCompute statistics about the total number and rate of transactions in the chain.\n",
{
{"nblocks", RPCArg::Type::NUM, /* default */ "one month", "Size of the window in number of blocks"},
{"blockhash", RPCArg::Type::STR_HEX, /* default */ "chain tip", "The hash of the block that ends the window."},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM_TIME, "time", "The timestamp for the final block in the window, expressed in " + UNIX_EPOCH_TIME},
{RPCResult::Type::NUM, "txcount", "The total number of transactions in the chain up to that point"},
{RPCResult::Type::STR_HEX, "window_final_block_hash", "The hash of the final block in the window"},
{RPCResult::Type::NUM, "window_final_block_height", "The height of the final block in the window."},
{RPCResult::Type::NUM, "window_block_count", "Size of the window in number of blocks"},
{RPCResult::Type::NUM, "window_tx_count", /* optional */ true, "The number of transactions in the window. Only returned if \"window_block_count\" is > 0"},
{RPCResult::Type::NUM, "window_interval", /* optional */ true, "The elapsed time in the window in seconds. Only returned if \"window_block_count\" is > 0"},
{RPCResult::Type::NUM, "txrate", /* optional */ true, "The average rate of transactions per second in the window. Only returned if \"window_interval\" is > 0"},
}},
RPCExamples{
HelpExampleCli("getchaintxstats", "")
+ HelpExampleRpc("getchaintxstats", "2016")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
const CBlockIndex* pindex;
int blockcount = 30 * 24 * 60 * 60 / Params().GetConsensus().nPowTargetSpacing; // By default: 1 month
if (request.params[1].isNull()) {
LOCK(cs_main);
pindex = ::ChainActive().Tip();
} else {
uint256 hash(ParseHashV(request.params[1], "blockhash"));
LOCK(cs_main);
pindex = g_chainman.m_blockman.LookupBlockIndex(hash);
if (!pindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
if (!::ChainActive().Contains(pindex)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block is not in main chain");
}
}
CHECK_NONFATAL(pindex != nullptr);
if (request.params[0].isNull()) {
blockcount = std::max(0, std::min(blockcount, pindex->nHeight - 1));
} else {
blockcount = request.params[0].get_int();
if (blockcount < 0 || (blockcount > 0 && blockcount >= pindex->nHeight)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid block count: should be between 0 and the block's height - 1");
}
}
const CBlockIndex* pindexPast = pindex->GetAncestor(pindex->nHeight - blockcount);
int nTimeDiff = pindex->GetMedianTimePast() - pindexPast->GetMedianTimePast();
int nTxDiff = pindex->nChainTx - pindexPast->nChainTx;
UniValue ret(UniValue::VOBJ);
ret.pushKV("time", (int64_t)pindex->nTime);
ret.pushKV("txcount", (int64_t)pindex->nChainTx);
ret.pushKV("window_final_block_hash", pindex->GetBlockHash().GetHex());
ret.pushKV("window_final_block_height", pindex->nHeight);
ret.pushKV("window_block_count", blockcount);
if (blockcount > 0) {
ret.pushKV("window_tx_count", nTxDiff);
ret.pushKV("window_interval", nTimeDiff);
if (nTimeDiff > 0) {
ret.pushKV("txrate", ((double)nTxDiff) / nTimeDiff);
}
}
return ret;
},
};
}
template<typename T>
static T CalculateTruncatedMedian(std::vector<T>& scores)
{
size_t size = scores.size();
if (size == 0) {
return 0;
}
std::sort(scores.begin(), scores.end());
if (size % 2 == 0) {
return (scores[size / 2 - 1] + scores[size / 2]) / 2;
} else {
return scores[size / 2];
}
}
void CalculatePercentilesByWeight(CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], std::vector<std::pair<CAmount, int64_t>>& scores, int64_t total_weight)
{
if (scores.empty()) {
return;
}
std::sort(scores.begin(), scores.end());
// 10th, 25th, 50th, 75th, and 90th percentile weight units.
const double weights[NUM_GETBLOCKSTATS_PERCENTILES] = {
total_weight / 10.0, total_weight / 4.0, total_weight / 2.0, (total_weight * 3.0) / 4.0, (total_weight * 9.0) / 10.0
};
int64_t next_percentile_index = 0;
int64_t cumulative_weight = 0;
for (const auto& element : scores) {
cumulative_weight += element.second;
while (next_percentile_index < NUM_GETBLOCKSTATS_PERCENTILES && cumulative_weight >= weights[next_percentile_index]) {
result[next_percentile_index] = element.first;
++next_percentile_index;
}
}
// Fill any remaining percentiles with the last value.
for (int64_t i = next_percentile_index; i < NUM_GETBLOCKSTATS_PERCENTILES; i++) {
result[i] = scores.back().first;
}
}
void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex)
{
ScriptPubKeyToUniv(scriptPubKey, out, fIncludeHex, IsDeprecatedRPCEnabled("addresses"));
}
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex, int serialize_flags, const CTxUndo* txundo)
{
TxToUniv(tx, hashBlock, IsDeprecatedRPCEnabled("addresses"), entry, include_hex, serialize_flags, txundo);
}
template<typename T>
static inline bool SetHasKeys(const std::set<T>& set) {return false;}
template<typename T, typename Tk, typename... Args>
static inline bool SetHasKeys(const std::set<T>& set, const Tk& key, const Args&... args)
{
return (set.count(key) != 0) || SetHasKeys(set, args...);
}
// outpoint (needed for the utxo index) + nHeight + fCoinBase
static constexpr size_t PER_UTXO_OVERHEAD = sizeof(COutPoint) + sizeof(uint32_t) + sizeof(bool);
static RPCHelpMan getblockstats()
{
return RPCHelpMan{"getblockstats",
"\nCompute per block statistics for a given window. All amounts are in satoshis.\n"
"It won't work for some heights with pruning.\n",
{
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The block hash or height of the target block", "", {"", "string or numeric"}},
{"stats", RPCArg::Type::ARR, /* default */ "all values", "Values to plot (see result below)",
{
{"height", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Selected statistic"},
{"time", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Selected statistic"},
},
"stats"},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "avgfee", "Average fee in the block"},
{RPCResult::Type::NUM, "avgfeerate", "Average feerate (in satoshis per virtual byte)"},
{RPCResult::Type::NUM, "avgtxsize", "Average transaction size"},
{RPCResult::Type::STR_HEX, "blockhash", "The block hash (to check for potential reorgs)"},
{RPCResult::Type::ARR_FIXED, "feerate_percentiles", "Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)",
{
{RPCResult::Type::NUM, "10th_percentile_feerate", "The 10th percentile feerate"},
{RPCResult::Type::NUM, "25th_percentile_feerate", "The 25th percentile feerate"},
{RPCResult::Type::NUM, "50th_percentile_feerate", "The 50th percentile feerate"},
{RPCResult::Type::NUM, "75th_percentile_feerate", "The 75th percentile feerate"},
{RPCResult::Type::NUM, "90th_percentile_feerate", "The 90th percentile feerate"},
}},
{RPCResult::Type::NUM, "height", "The height of the block"},
{RPCResult::Type::NUM, "ins", "The number of inputs (excluding coinbase)"},
{RPCResult::Type::NUM, "maxfee", "Maximum fee in the block"},
{RPCResult::Type::NUM, "maxfeerate", "Maximum feerate (in satoshis per virtual byte)"},
{RPCResult::Type::NUM, "maxtxsize", "Maximum transaction size"},
{RPCResult::Type::NUM, "medianfee", "Truncated median fee in the block"},
{RPCResult::Type::NUM, "mediantime", "The block median time past"},
{RPCResult::Type::NUM, "mediantxsize", "Truncated median transaction size"},
{RPCResult::Type::NUM, "minfee", "Minimum fee in the block"},
{RPCResult::Type::NUM, "minfeerate", "Minimum feerate (in satoshis per virtual byte)"},
{RPCResult::Type::NUM, "mintxsize", "Minimum transaction size"},
{RPCResult::Type::NUM, "outs", "The number of outputs"},
{RPCResult::Type::NUM, "subsidy", "The block subsidy"},
{RPCResult::Type::NUM, "swtotal_size", "Total size of all segwit transactions"},
{RPCResult::Type::NUM, "swtotal_weight", "Total weight of all segwit transactions"},
{RPCResult::Type::NUM, "swtxs", "The number of segwit transactions"},
{RPCResult::Type::NUM, "time", "The block time"},
{RPCResult::Type::NUM, "total_out", "Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])"},
{RPCResult::Type::NUM, "total_size", "Total size of all non-coinbase transactions"},
{RPCResult::Type::NUM, "total_weight", "Total weight of all non-coinbase transactions"},
{RPCResult::Type::NUM, "totalfee", "The fee total"},
{RPCResult::Type::NUM, "txs", "The number of transactions (including coinbase)"},
{RPCResult::Type::NUM, "utxo_increase", "The increase/decrease in the number of unspent outputs"},
{RPCResult::Type::NUM, "utxo_size_inc", "The increase/decrease in size for the utxo index (not discounting op_return and similar)"},
}},
RPCExamples{
HelpExampleCli("getblockstats", R"('"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"' '["minfeerate","avgfeerate"]')") +
HelpExampleCli("getblockstats", R"(1000 '["minfeerate","avgfeerate"]')") +
HelpExampleRpc("getblockstats", R"("00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"])") +
HelpExampleRpc("getblockstats", R"(1000, ["minfeerate","avgfeerate"])")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
LOCK(cs_main);
CBlockIndex* pindex;
if (request.params[0].isNum()) {
const int height = request.params[0].get_int();
const int current_tip = ::ChainActive().Height();
if (height < 0) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Target block height %d is negative", height));
}
if (height > current_tip) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Target block height %d after current tip %d", height, current_tip));
}
pindex = ::ChainActive()[height];
} else {
const uint256 hash(ParseHashV(request.params[0], "hash_or_height"));
pindex = g_chainman.m_blockman.LookupBlockIndex(hash);
if (!pindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
if (!::ChainActive().Contains(pindex)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Block is not in chain %s", Params().NetworkIDString()));
}
}
CHECK_NONFATAL(pindex != nullptr);
std::set<std::string> stats;
if (!request.params[1].isNull()) {
const UniValue stats_univalue = request.params[1].get_array();
for (unsigned int i = 0; i < stats_univalue.size(); i++) {
const std::string stat = stats_univalue[i].get_str();
stats.insert(stat);
}
}
const CBlock block = GetBlockChecked(pindex);
const CBlockUndo blockUndo = GetUndoChecked(pindex);
const bool do_all = stats.size() == 0; // Calculate everything if nothing selected (default)
const bool do_mediantxsize = do_all || stats.count("mediantxsize") != 0;
const bool do_medianfee = do_all || stats.count("medianfee") != 0;
const bool do_feerate_percentiles = do_all || stats.count("feerate_percentiles") != 0;
const bool loop_inputs = do_all || do_medianfee || do_feerate_percentiles ||
SetHasKeys(stats, "utxo_size_inc", "totalfee", "avgfee", "avgfeerate", "minfee", "maxfee", "minfeerate", "maxfeerate");
const bool loop_outputs = do_all || loop_inputs || stats.count("total_out");
const bool do_calculate_size = do_mediantxsize ||
SetHasKeys(stats, "total_size", "avgtxsize", "mintxsize", "maxtxsize", "swtotal_size");
const bool do_calculate_weight = do_all || SetHasKeys(stats, "total_weight", "avgfeerate", "swtotal_weight", "avgfeerate", "feerate_percentiles", "minfeerate", "maxfeerate");
const bool do_calculate_sw = do_all || SetHasKeys(stats, "swtxs", "swtotal_size", "swtotal_weight");
CAmount maxfee = 0;
CAmount maxfeerate = 0;
CAmount minfee = MAX_MONEY;
CAmount minfeerate = MAX_MONEY;
CAmount total_out = 0;
CAmount totalfee = 0;
int64_t inputs = 0;
int64_t maxtxsize = 0;
int64_t mintxsize = MAX_BLOCK_SERIALIZED_SIZE;
int64_t outputs = 0;
int64_t swtotal_size = 0;
int64_t swtotal_weight = 0;
int64_t swtxs = 0;
int64_t total_size = 0;
int64_t total_weight = 0;
int64_t utxo_size_inc = 0;
std::vector<CAmount> fee_array;
std::vector<std::pair<CAmount, int64_t>> feerate_array;
std::vector<int64_t> txsize_array;
for (size_t i = 0; i < block.vtx.size(); ++i) {
const auto& tx = block.vtx.at(i);
outputs += tx->vout.size();
CAmount tx_total_out = 0;
if (loop_outputs) {
for (const CTxOut& out : tx->vout) {
tx_total_out += out.nValue;
utxo_size_inc += GetSerializeSize(out, PROTOCOL_VERSION) + PER_UTXO_OVERHEAD;
}
}
if (tx->IsCoinBase()) {
continue;
}
inputs += tx->vin.size(); // Don't count coinbase's fake input
total_out += tx_total_out; // Don't count coinbase reward
int64_t tx_size = 0;
if (do_calculate_size) {
tx_size = tx->GetTotalSize();
if (do_mediantxsize) {
txsize_array.push_back(tx_size);
}
maxtxsize = std::max(maxtxsize, tx_size);
mintxsize = std::min(mintxsize, tx_size);
total_size += tx_size;
}
int64_t weight = 0;
if (do_calculate_weight) {
weight = GetTransactionWeight(*tx);
total_weight += weight;
}
if (do_calculate_sw && tx->HasWitness()) {
++swtxs;
swtotal_size += tx_size;
swtotal_weight += weight;
}
if (loop_inputs) {
CAmount tx_total_in = 0;
const auto& txundo = blockUndo.vtxundo.at(i - 1);
for (const Coin& coin: txundo.vprevout) {
const CTxOut& prevoutput = coin.out;
tx_total_in += prevoutput.nValue;
utxo_size_inc -= GetSerializeSize(prevoutput, PROTOCOL_VERSION) + PER_UTXO_OVERHEAD;
}
CAmount txfee = tx_total_in - tx_total_out;
CHECK_NONFATAL(MoneyRange(txfee));
if (do_medianfee) {
fee_array.push_back(txfee);
}
maxfee = std::max(maxfee, txfee);
minfee = std::min(minfee, txfee);
totalfee += txfee;
// New feerate uses satoshis per virtual byte instead of per serialized byte
CAmount feerate = weight ? (txfee * WITNESS_SCALE_FACTOR) / weight : 0;
if (do_feerate_percentiles) {
feerate_array.emplace_back(std::make_pair(feerate, weight));
}
maxfeerate = std::max(maxfeerate, feerate);
minfeerate = std::min(minfeerate, feerate);
}
}
CAmount feerate_percentiles[NUM_GETBLOCKSTATS_PERCENTILES] = { 0 };
CalculatePercentilesByWeight(feerate_percentiles, feerate_array, total_weight);
UniValue feerates_res(UniValue::VARR);
for (int64_t i = 0; i < NUM_GETBLOCKSTATS_PERCENTILES; i++) {
feerates_res.push_back(feerate_percentiles[i]);
}
UniValue ret_all(UniValue::VOBJ);
ret_all.pushKV("avgfee", (block.vtx.size() > 1) ? totalfee / (block.vtx.size() - 1) : 0);
ret_all.pushKV("avgfeerate", total_weight ? (totalfee * WITNESS_SCALE_FACTOR) / total_weight : 0); // Unit: sat/vbyte
ret_all.pushKV("avgtxsize", (block.vtx.size() > 1) ? total_size / (block.vtx.size() - 1) : 0);
ret_all.pushKV("blockhash", pindex->GetBlockHash().GetHex());
ret_all.pushKV("feerate_percentiles", feerates_res);
ret_all.pushKV("height", (int64_t)pindex->nHeight);
ret_all.pushKV("ins", inputs);
ret_all.pushKV("maxfee", maxfee);
ret_all.pushKV("maxfeerate", maxfeerate);
ret_all.pushKV("maxtxsize", maxtxsize);
ret_all.pushKV("medianfee", CalculateTruncatedMedian(fee_array));
ret_all.pushKV("mediantime", pindex->GetMedianTimePast());
ret_all.pushKV("mediantxsize", CalculateTruncatedMedian(txsize_array));
ret_all.pushKV("minfee", (minfee == MAX_MONEY) ? 0 : minfee);
ret_all.pushKV("minfeerate", (minfeerate == MAX_MONEY) ? 0 : minfeerate);
ret_all.pushKV("mintxsize", mintxsize == MAX_BLOCK_SERIALIZED_SIZE ? 0 : mintxsize);
ret_all.pushKV("outs", outputs);
ret_all.pushKV("subsidy", GetBlockSubsidy(pindex->nHeight, Params().GetConsensus()));
ret_all.pushKV("swtotal_size", swtotal_size);
ret_all.pushKV("swtotal_weight", swtotal_weight);
ret_all.pushKV("swtxs", swtxs);
ret_all.pushKV("time", pindex->GetBlockTime());
ret_all.pushKV("total_out", total_out);
ret_all.pushKV("total_size", total_size);
ret_all.pushKV("total_weight", total_weight);
ret_all.pushKV("totalfee", totalfee);
ret_all.pushKV("txs", (int64_t)block.vtx.size());
ret_all.pushKV("utxo_increase", outputs - inputs);
ret_all.pushKV("utxo_size_inc", utxo_size_inc);
if (do_all) {
return ret_all;
}
UniValue ret(UniValue::VOBJ);
for (const std::string& stat : stats) {
const UniValue& value = ret_all[stat];
if (value.isNull()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid selected statistic %s", stat));
}
ret.pushKV(stat, value);
}
return ret;
},
};
}
static RPCHelpMan savemempool()
{
return RPCHelpMan{"savemempool",
"\nDumps the mempool to disk. It will fail until the previous dump is fully loaded.\n",
{},
RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{
HelpExampleCli("savemempool", "")
+ HelpExampleRpc("savemempool", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
const CTxMemPool& mempool = EnsureMemPool(request.context);
if (!mempool.IsLoaded()) {
throw JSONRPCError(RPC_MISC_ERROR, "The mempool was not loaded yet");
}
if (!DumpMempool(mempool)) {
throw JSONRPCError(RPC_MISC_ERROR, "Unable to dump mempool to disk");
}
return NullUniValue;
},
};
}
namespace {
//! Search for a given set of pubkey scripts
bool FindScriptPubKey(std::atomic<int>& scan_progress, const std::atomic<bool>& should_abort, int64_t& count, CCoinsViewCursor* cursor, const std::set<CScript>& needles, std::map<COutPoint, Coin>& out_results, std::function<void()>& interruption_point)
{
scan_progress = 0;
count = 0;
while (cursor->Valid()) {
COutPoint key;
Coin coin;
if (!cursor->GetKey(key) || !cursor->GetValue(coin)) return false;
if (++count % 8192 == 0) {
interruption_point();
if (should_abort) {
// allow to abort the scan via the abort reference
return false;
}
}
if (count % 256 == 0) {
// update progress reference every 256 item
uint32_t high = 0x100 * *key.hash.begin() + *(key.hash.begin() + 1);
scan_progress = (int)(high * 100.0 / 65536.0 + 0.5);
}
if (needles.count(coin.out.scriptPubKey)) {
out_results.emplace(key, coin);
}
cursor->Next();
}
scan_progress = 100;
return true;
}
} // namespace
/** RAII object to prevent concurrency issue when scanning the txout set */
static std::atomic<int> g_scan_progress;
static std::atomic<bool> g_scan_in_progress;
static std::atomic<bool> g_should_abort_scan;
class CoinsViewScanReserver
{
private:
bool m_could_reserve;
public:
explicit CoinsViewScanReserver() : m_could_reserve(false) {}
bool reserve() {
CHECK_NONFATAL(!m_could_reserve);
if (g_scan_in_progress.exchange(true)) {
return false;
}
m_could_reserve = true;
return true;
}
~CoinsViewScanReserver() {
if (m_could_reserve) {
g_scan_in_progress = false;
}
}
};
static RPCHelpMan scantxoutset()
{
return RPCHelpMan{"scantxoutset",
"\nScans the unspent transaction output set for entries that match certain output descriptors.\n"
"Examples of output descriptors are:\n"
" addr(<address>) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK)\n"
" raw(<hex script>) Outputs whose scriptPubKey equals the specified hex scripts\n"
" combo(<pubkey>) P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey\n"
" pkh(<pubkey>) P2PKH outputs for the given pubkey\n"
" sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys\n"
"\nIn the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one\n"
"or more path elements separated by \"/\", and optionally ending in \"/*\" (unhardened), or \"/*'\" or \"/*h\" (hardened) to specify all\n"
"unhardened or hardened child keys.\n"
"In the latter case, a range needs to be specified by below if different from 1000.\n"
"For more information on output descriptors, see the documentation in the doc/descriptors.md file.\n",
{
{"action", RPCArg::Type::STR, RPCArg::Optional::NO, "The action to execute\n"
"\"start\" for starting a scan\n"
"\"abort\" for aborting the current scan (returns true when abort was successful)\n"
"\"status\" for progress report (in %) of the current scan"},
{"scanobjects", RPCArg::Type::ARR, RPCArg::Optional::OMITTED, "Array of scan objects. Required for \"start\" action\n"
"Every scan object is either a string descriptor or an object:",
{
{"descriptor", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "An output descriptor"},
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "An object with output descriptor and metadata",
{
{"desc", RPCArg::Type::STR, RPCArg::Optional::NO, "An output descriptor"},
{"range", RPCArg::Type::RANGE, /* default */ "1000", "The range of HD chain indexes to explore (either end or [begin,end])"},
}},
},
"[scanobjects,...]"},
},
{
RPCResult{"When action=='abort'", RPCResult::Type::BOOL, "", ""},
RPCResult{"When action=='status' and no scan is in progress", RPCResult::Type::NONE, "", ""},
RPCResult{"When action=='status' and scan is in progress", RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "progress", "The scan progress"},
}},
RPCResult{"When action=='start'", RPCResult::Type::OBJ, "", "", {
{RPCResult::Type::BOOL, "success", "Whether the scan was completed"},
{RPCResult::Type::NUM, "txouts", "The number of unspent transaction outputs scanned"},
{RPCResult::Type::NUM, "height", "The current block height (index)"},
{RPCResult::Type::STR_HEX, "bestblock", "The hash of the block at the tip of the chain"},
{RPCResult::Type::ARR, "unspents", "",
{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "txid", "The transaction id"},
{RPCResult::Type::NUM, "vout", "The vout value"},
{RPCResult::Type::STR_HEX, "scriptPubKey", "The script key"},
{RPCResult::Type::STR, "desc", "A specialized descriptor for the matched scriptPubKey"},
{RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " of the unspent output"},
{RPCResult::Type::NUM, "height", "Height of the unspent transaction output"},
}},
}},
{RPCResult::Type::STR_AMOUNT, "total_amount", "The total amount of all found unspent outputs in " + CURRENCY_UNIT},
}},
},
RPCExamples{""},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR});
UniValue result(UniValue::VOBJ);
if (request.params[0].get_str() == "status") {
CoinsViewScanReserver reserver;
if (reserver.reserve()) {
// no scan in progress
return NullUniValue;
}
result.pushKV("progress", g_scan_progress);
return result;
} else if (request.params[0].get_str() == "abort") {
CoinsViewScanReserver reserver;
if (reserver.reserve()) {
// reserve was possible which means no scan was running
return false;
}
// set the abort flag
g_should_abort_scan = true;
return true;
} else if (request.params[0].get_str() == "start") {
CoinsViewScanReserver reserver;
if (!reserver.reserve()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Scan already in progress, use action \"abort\" or \"status\"");
}
if (request.params.size() < 2) {
throw JSONRPCError(RPC_MISC_ERROR, "scanobjects argument is required for the start action");
}
std::set<CScript> needles;
std::map<CScript, std::string> descriptors;
CAmount total_in = 0;
// loop through the scan objects
for (const UniValue& scanobject : request.params[1].get_array().getValues()) {
FlatSigningProvider provider;
auto scripts = EvalDescriptorStringOrObject(scanobject, provider);
for (const auto& script : scripts) {
std::string inferred = InferDescriptor(script, provider)->ToString();
needles.emplace(script);
descriptors.emplace(std::move(script), std::move(inferred));
}
}
// Scan the unspent transaction output set for inputs
UniValue unspents(UniValue::VARR);
std::vector<CTxOut> input_txos;
std::map<COutPoint, Coin> coins;
g_should_abort_scan = false;
g_scan_progress = 0;
int64_t count = 0;
std::unique_ptr<CCoinsViewCursor> pcursor;
CBlockIndex* tip;
{
LOCK(cs_main);
::ChainstateActive().ForceFlushStateToDisk();
pcursor = std::unique_ptr<CCoinsViewCursor>(::ChainstateActive().CoinsDB().Cursor());
CHECK_NONFATAL(pcursor);
tip = ::ChainActive().Tip();
CHECK_NONFATAL(tip);
}
NodeContext& node = EnsureNodeContext(request.context);
bool res = FindScriptPubKey(g_scan_progress, g_should_abort_scan, count, pcursor.get(), needles, coins, node.rpc_interruption_point);
result.pushKV("success", res);
result.pushKV("txouts", count);
result.pushKV("height", tip->nHeight);
result.pushKV("bestblock", tip->GetBlockHash().GetHex());
for (const auto& it : coins) {
const COutPoint& outpoint = it.first;
const Coin& coin = it.second;
const CTxOut& txo = coin.out;
input_txos.push_back(txo);
total_in += txo.nValue;
UniValue unspent(UniValue::VOBJ);
unspent.pushKV("txid", outpoint.hash.GetHex());
unspent.pushKV("vout", (int32_t)outpoint.n);
unspent.pushKV("scriptPubKey", HexStr(txo.scriptPubKey));
unspent.pushKV("desc", descriptors[txo.scriptPubKey]);
unspent.pushKV("amount", ValueFromAmount(txo.nValue));
unspent.pushKV("height", (int32_t)coin.nHeight);
unspents.push_back(unspent);
}
result.pushKV("unspents", unspents);
result.pushKV("total_amount", ValueFromAmount(total_in));
} else {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid command");
}
return result;
},
};
}
static RPCHelpMan getblockfilter()
{
return RPCHelpMan{"getblockfilter",
"\nRetrieve a BIP 157 content filter for a particular block.\n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hash of the block"},
{"filtertype", RPCArg::Type::STR, /*default*/ "basic", "The type name of the filter"},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "filter", "the hex-encoded filter data"},
{RPCResult::Type::STR_HEX, "header", "the hex-encoded filter header"},
}},
RPCExamples{
HelpExampleCli("getblockfilter", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" \"basic\"") +
HelpExampleRpc("getblockfilter", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\", \"basic\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
uint256 block_hash = ParseHashV(request.params[0], "blockhash");
std::string filtertype_name = "basic";
if (!request.params[1].isNull()) {
filtertype_name = request.params[1].get_str();
}
BlockFilterType filtertype;
if (!BlockFilterTypeByName(filtertype_name, filtertype)) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Unknown filtertype");
}
BlockFilterIndex* index = GetBlockFilterIndex(filtertype);
if (!index) {
throw JSONRPCError(RPC_MISC_ERROR, "Index is not enabled for filtertype " + filtertype_name);
}
const CBlockIndex* block_index;
bool block_was_connected;
{
LOCK(cs_main);
block_index = g_chainman.m_blockman.LookupBlockIndex(block_hash);
if (!block_index) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
block_was_connected = block_index->IsValid(BLOCK_VALID_SCRIPTS);
}
bool index_ready = index->BlockUntilSyncedToCurrentChain();
BlockFilter filter;
uint256 filter_header;
if (!index->LookupFilter(block_index, filter) ||
!index->LookupFilterHeader(block_index, filter_header)) {
int err_code;
std::string errmsg = "Filter not found.";
if (!block_was_connected) {
err_code = RPC_INVALID_ADDRESS_OR_KEY;
errmsg += " Block was not connected to active chain.";
} else if (!index_ready) {
err_code = RPC_MISC_ERROR;
errmsg += " Block filters are still in the process of being indexed.";
} else {
err_code = RPC_INTERNAL_ERROR;
errmsg += " This error is unexpected and indicates index corruption.";
}
throw JSONRPCError(err_code, errmsg);
}
UniValue ret(UniValue::VOBJ);
ret.pushKV("filter", HexStr(filter.GetEncodedFilter()));
ret.pushKV("header", filter_header.GetHex());
return ret;
},
};
}
/**
* Serialize the UTXO set to a file for loading elsewhere.
*
* @see SnapshotMetadata
*/
static RPCHelpMan dumptxoutset()
{
return RPCHelpMan{
"dumptxoutset",
"\nWrite the serialized UTXO set to disk.\n",
{
{"path",
RPCArg::Type::STR,
RPCArg::Optional::NO,
/* default_val */ "",
"path to the output file. If relative, will be prefixed by datadir."},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "coins_written", "the number of coins written in the snapshot"},
{RPCResult::Type::STR_HEX, "base_hash", "the hash of the base of the snapshot"},
{RPCResult::Type::NUM, "base_height", "the height of the base of the snapshot"},
{RPCResult::Type::STR, "path", "the absolute path that the snapshot was written to"},
}
},
RPCExamples{
HelpExampleCli("dumptxoutset", "utxo.dat")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
const fs::path path = fsbridge::AbsPathJoin(GetDataDir(), request.params[0].get_str());
// Write to a temporary path and then move into `path` on completion
// to avoid confusion due to an interruption.
const fs::path temppath = fsbridge::AbsPathJoin(GetDataDir(), request.params[0].get_str() + ".incomplete");
if (fs::exists(path)) {
throw JSONRPCError(
RPC_INVALID_PARAMETER,
path.string() + " already exists. If you are sure this is what you want, "
"move it out of the way first");
}
FILE* file{fsbridge::fopen(temppath, "wb")};
CAutoFile afile{file, SER_DISK, CLIENT_VERSION};
NodeContext& node = EnsureNodeContext(request.context);
UniValue result = CreateUTXOSnapshot(node, node.chainman->ActiveChainstate(), afile);
fs::rename(temppath, path);
result.pushKV("path", path.string());
return result;
},
};
}
UniValue CreateUTXOSnapshot(NodeContext& node, CChainState& chainstate, CAutoFile& afile)
{
std::unique_ptr<CCoinsViewCursor> pcursor;
CCoinsStats stats;
CBlockIndex* tip;
{
// We need to lock cs_main to ensure that the coinsdb isn't written to
// between (i) flushing coins cache to disk (coinsdb), (ii) getting stats
// based upon the coinsdb, and (iii) constructing a cursor to the
// coinsdb for use below this block.
//
// Cursors returned by leveldb iterate over snapshots, so the contents
// of the pcursor will not be affected by simultaneous writes during
// use below this block.
//
// See discussion here:
// https://github.com/bitcoin/bitcoin/pull/15606#discussion_r274479369
//
LOCK(::cs_main);
chainstate.ForceFlushStateToDisk();
if (!GetUTXOStats(&chainstate.CoinsDB(), chainstate.m_blockman, stats, CoinStatsHashType::NONE, node.rpc_interruption_point)) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Unable to read UTXO set");
}
pcursor = std::unique_ptr<CCoinsViewCursor>(chainstate.CoinsDB().Cursor());
tip = g_chainman.m_blockman.LookupBlockIndex(stats.hashBlock);
CHECK_NONFATAL(tip);
}
SnapshotMetadata metadata{tip->GetBlockHash(), stats.coins_count, tip->nChainTx};
afile << metadata;
COutPoint key;
Coin coin;
unsigned int iter{0};
while (pcursor->Valid()) {
if (iter % 5000 == 0) node.rpc_interruption_point();
++iter;
if (pcursor->GetKey(key) && pcursor->GetValue(coin)) {
afile << key;
afile << coin;
}
pcursor->Next();
}
afile.fclose();
UniValue result(UniValue::VOBJ);
result.pushKV("coins_written", stats.coins_count);
result.pushKV("base_hash", tip->GetBlockHash().ToString());
result.pushKV("base_height", tip->nHeight);
return result;
}
void RegisterBlockchainRPCCommands(CRPCTable &t)
{
// clang-format off
static const CRPCCommand commands[] =
{ // category actor (function)
// --------------------- ------------------------
{ "blockchain", &getblockchaininfo, },
{ "blockchain", &getchaintxstats, },
{ "blockchain", &getblockstats, },
{ "blockchain", &getbestblockhash, },
{ "blockchain", &getblockcount, },
{ "blockchain", &getblock, },
{ "blockchain", &getblockhash, },
{ "blockchain", &getblockheader, },
{ "blockchain", &getchaintips, },
{ "blockchain", &getdifficulty, },
{ "blockchain", &getmempoolancestors, },
{ "blockchain", &getmempooldescendants, },
{ "blockchain", &getmempoolentry, },
{ "blockchain", &getmempoolinfo, },
{ "blockchain", &getrawmempool, },
{ "blockchain", &gettxout, },
{ "blockchain", &gettxoutsetinfo, },
{ "blockchain", &pruneblockchain, },
{ "blockchain", &savemempool, },
{ "blockchain", &verifychain, },
{ "blockchain", &preciousblock, },
{ "blockchain", &scantxoutset, },
{ "blockchain", &getblockfilter, },
/* Not shown in help */
{ "hidden", &invalidateblock, },
{ "hidden", &reconsiderblock, },
{ "hidden", &waitfornewblock, },
{ "hidden", &waitforblock, },
{ "hidden", &waitforblockheight, },
{ "hidden", &syncwithvalidationinterfacequeue, },
{ "hidden", &dumptxoutset, },
};
// clang-format on
for (const auto& c : commands) {
t.appendCommand(c.name, &c);
}
}
| [
"criptolot"
] | criptolot |
5f8971359e319b6c193155ad55e06d27d6c13fcb | 6108ed309473eda12e79bac5ef2f8a44420f6df0 | /while/while-8.cpp | b03b3f395cfa235c7eecf0b009413081d1b5c59e | [] | no_license | aditrio/joki-tugas-cpp | dc021608ddae17711405825fd574c04a6be79f5b | d8deba1f48ab17aa9942bedc0ba494ffeb3d6e70 | refs/heads/main | 2023-02-05T17:53:08.159551 | 2020-12-26T18:14:54 | 2020-12-26T18:14:54 | 323,565,842 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 558 | cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
// program sewa mobil
long harga = 256000;
long total_harga = 0;
int hari;
int i = 1;
cout << "harga sewa : Rp.256.000" << endl;
cout << "--------------------------" << endl;
cout << "masukan jumlah hari : ";
cin >> hari;
while(true) {
total_harga+=harga;
if (i == hari)
{
cout << "--------------------------" << endl;
cout << "total harga sewa : Rp." << total_harga << endl;
break;
}
i++;
}
return 0;
}
| [
"30noadi@gmail.com"
] | 30noadi@gmail.com |
13a80e9af14258caa66b2ff6b3b37ca0ba1fc28d | 032a44c3e0a7dc77271bb2213467154212a4e5d3 | /src/mprmpr/util/jsonreader.cc | e9fa213fcc0d7ed53dc62f87068171b7eb4f3636 | [] | no_license | wqx081/mpr_mpr | 94f557e4d1ec696e880f93ce68ce57594da5a11c | cd0546e38f92576df73714088bc59e7f59b645d2 | refs/heads/master | 2021-01-12T10:25:03.208531 | 2016-12-21T14:53:15 | 2016-12-21T14:53:15 | 76,452,236 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,474 | cc | #include "mprmpr/util/jsonreader.h"
#include "mprmpr/base/strings/substitute.h"
using rapidjson::Value;
using std::string;
using std::vector;
using strings::Substitute;
namespace mprmpr {
JsonReader::JsonReader(string text) : text_(std::move(text)) {}
JsonReader::~JsonReader() {
}
Status JsonReader::Init() {
document_.Parse<0>(text_.c_str());
if (document_.HasParseError()) {
return Status::Corruption("JSON text is corrupt", document_.GetParseError());
}
return Status::OK();
}
Status JsonReader::ExtractInt32(const Value* object,
const char* field,
int32_t* result) const {
const Value* val;
RETURN_NOT_OK(ExtractField(object, field, &val));
if (PREDICT_FALSE(!val->IsInt())) {
return Status::InvalidArgument(Substitute(
"Wrong type during field extraction: expected int32 but got $0",
val->GetType()));
}
*result = val->GetUint();
return Status::OK();
}
Status JsonReader::ExtractInt64(const Value* object,
const char* field,
int64_t* result) const {
const Value* val;
RETURN_NOT_OK(ExtractField(object, field, &val));
if (PREDICT_FALSE(!val->IsInt64())) {
return Status::InvalidArgument(Substitute(
"Wrong type during field extraction: expected int64 but got $0",
val->GetType())); }
*result = val->GetUint64();
return Status::OK();
}
Status JsonReader::ExtractString(const Value* object,
const char* field,
string* result) const {
const Value* val;
RETURN_NOT_OK(ExtractField(object, field, &val));
if (PREDICT_FALSE(!val->IsString())) {
if (val->IsNull()) {
*result = "";
return Status::OK();
}
return Status::InvalidArgument(Substitute(
"Wrong type during field extraction: expected string but got $0",
val->GetType())); }
result->assign(val->GetString());
return Status::OK();
}
Status JsonReader::ExtractObject(const Value* object,
const char* field,
const Value** result) const {
const Value* val;
RETURN_NOT_OK(ExtractField(object, field, &val));
if (PREDICT_FALSE(!val->IsObject())) {
return Status::InvalidArgument(Substitute(
"Wrong type during field extraction: expected object but got $0",
val->GetType())); }
*result = val;
return Status::OK();
}
Status JsonReader::ExtractObjectArray(const Value* object,
const char* field,
vector<const Value*>* result) const {
const Value* val;
RETURN_NOT_OK(ExtractField(object, field, &val));
if (PREDICT_FALSE(!val->IsArray())) {
return Status::InvalidArgument(Substitute(
"Wrong type during field extraction: expected object array but got $0",
val->GetType())); }
for (Value::ConstValueIterator iter = val->Begin(); iter != val->End(); ++iter) {
result->push_back(iter);
}
return Status::OK();
}
Status JsonReader::ExtractField(const Value* object,
const char* field,
const Value** result) const {
if (field && PREDICT_FALSE(!object->HasMember(field))) {
return Status::NotFound("Missing field", field);
}
*result = field ? &(*object)[field] : object;
return Status::OK();
}
} // namespace mprmpr
| [
"you@example.com"
] | you@example.com |
d73818a4ca2bc048daada0eae079bada085cafaa | aa2ece1f0612a0df1de4cf5cf9153608eb8ffce0 | /macOS/ups_v03/hiro/gtk/menuradioitem.h | 56f9b58559459592fe30cc8f4394f8b42a2dc9e7 | [] | no_license | Sappharad/Mother3Patchers | 66989f3cf4d6abc0855c853c04c4d5c950da7fba | 8e5bfa783928be971b76e456b6009f2aa54f2746 | refs/heads/master | 2023-02-23T00:28:55.613848 | 2021-01-28T04:36:08 | 2021-01-28T04:36:08 | 291,564,148 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 277 | h | class pMenuRadioItem : public pMenuControl {
public:
void create(MenuRadioItemGroup &group, const char *text = "");
void check();
bool checked();
MenuRadioItem &self;
pMenuRadioItem(MenuRadioItem&);
/* internal */
GtkWidget *item;
GtkWidget* gtk_handle();
};
| [
"Sappharad@users.noreply.github.com"
] | Sappharad@users.noreply.github.com |
7567e103562cd593d254af1b029e9c3fd3189e49 | a18e21fc7f48dfb3f92acc6b9a35792bdd1ecaef | /FroggerObjects/Utilities/HitableObject.cpp | b73c376f5278e8e3d94a23ac45cf18bbad662ea0 | [
"MIT"
] | permissive | RicardoEPRodrigues/FroggerOpenGL | 2728632a09562b94bd2ee7c57b943145eecfa5fa | dc02437dfe14203e9bdb39f160e4877b44363c42 | refs/heads/master | 2020-07-05T22:06:24.244344 | 2017-05-05T14:55:10 | 2017-05-05T14:55:10 | 73,977,828 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,093 | cpp | /*
* HitableObject.cpp
*
* Created on: Oct 30, 2014
* Author: ricardo
*/
#include "HitableObject.h"
HitableObject::HitableObject(Vector3 minBounds, Vector3 maxBounds) {
this->_min_bounds = minBounds;
this->_max_bounds = maxBounds;
}
HitableObject::~HitableObject() {
}
bool HitableObject::hitAux(Vector3 firstMinBounds, Vector3 firstMaxBounds,
Vector3 secondMinBounds, Vector3 secondMaxBounds, bool compareZ) {
bool isXCollision = ((firstMinBounds.getX() >= secondMinBounds.getX()
&& firstMinBounds.getX() <= secondMaxBounds.getX())
|| (firstMaxBounds.getX() >= secondMinBounds.getX()
&& firstMaxBounds.getX() <= secondMaxBounds.getX()));
bool isYCollision = ((firstMinBounds.getY() >= secondMinBounds.getY()
&& firstMinBounds.getY() <= secondMaxBounds.getY())
|| (firstMaxBounds.getY() >= secondMinBounds.getY()
&& firstMaxBounds.getY() <= secondMaxBounds.getY()));
// if compareZ is not active then the comparison if isZCollision is always true.
bool isZCollision =
!compareZ || (firstMinBounds.getZ() >= secondMinBounds.getZ()
&& firstMinBounds.getZ() <= secondMaxBounds.getZ())
|| (firstMaxBounds.getZ() >= secondMinBounds.getZ()
&& firstMaxBounds.getZ()
<= secondMaxBounds.getZ());
return isXCollision && isYCollision && isZCollision;
}
bool HitableObject::isHit(HitableObject* object, bool compareZ) {
Vector3 thisPosMin = (*this->getPosition()) + this->_min_bounds;
Vector3 thisPosMax = (*this->getPosition()) + this->_max_bounds;
Vector3 objPosMin = (*object->getPosition()) + object->getMinBounds();
Vector3 objPosMax = (*object->getPosition()) + object->getMaxBounds();
return hitAux(thisPosMin, thisPosMax, objPosMin, objPosMax, compareZ) ||
hitAux(objPosMin, objPosMax, thisPosMin, thisPosMax, compareZ);
}
| [
"ricardo.e.p.rodrigues@gmail.com"
] | ricardo.e.p.rodrigues@gmail.com |
5bc2acf62c5a252e7ca0557f4c8be3bb28e02862 | 7f99e33c4f2c0084e92fe007e5b682d6114af8cf | /code/vec.cpp | 867028acad14a8416898144b3ba2af8e534561b7 | [] | no_license | ShadowGorn/teambook | aba778c409396e61381b9f4d95277c09c9f739c2 | 93c2a015516633083d73fefbac1c0718c60d0492 | refs/heads/master | 2020-04-05T13:12:10.423976 | 2018-12-01T07:52:19 | 2018-12-01T07:52:19 | 156,891,619 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,007 | cpp | struct Vec {
LL x, y;
explicit Vec(LL x = 0 , LL y = 0) : x(x), y(y) {}
Vec operator+(const Vec& o) const {
return Vec(x + o.x, y + o.y); }
Vec operator-(const Vec& o) const {
return Vec(x - o.x, y - o.y); }
Vec operator*(const LL p) const {
return Vec(x * p, y * p); }
double len() const { return sqrt(x * x + y * y); }
LL cross(const Vec& o) const { return x * o.y - y * o.x; }
LL dot(const Vec& o) const { return x * o.x + y * o.y; }
static Vec read(istream& cin) {
LL x, y;
cin >> x >> y;
return Vec(x, y);
}
};
// CONVEX HULL: last point == first point
vector<Vec> convex_hull(vector<Vec> a) {
int n = a.size(), k = 0;
vector<Vec> p(n * 2);
sort(a.begin(), a.end());
for(int i = 0; i < n; p[k++] = a[i++])
while(k > 1 && (p[k - 1] - p[k - 2])
% (p[k - 1] - a[i]) >= 0) --k;
for(int i = n - 2, w = k; i >= 0; p[k++] = a[i--])
while(k > w && (p[k - 1] - p[k - 2])
% (p[k - 1] - a[i]) >= 0) --k;
p.resize(k);
return p;
}
| [
"temich@yandex-team.ru"
] | temich@yandex-team.ru |
2944923a03f4e3d9e860cec76d0efdaec3c3e159 | 6dbfd79c617915e109cb2d42648a7d96984e9b77 | /programs/3-QuoteOfTheDay/3-QuoteOfTheDay.ino | 7f8670d53f88875dcacf66cae897bbd6bdbdd449 | [] | no_license | raghuprasadks/iotnitimphal | c04c7e60d5049afaaba3bcd0f58d1d03eb7702bc | 4eff9848b4ea12ec105b1f55486181ba2487783e | refs/heads/master | 2020-06-20T01:21:29.508697 | 2019-07-18T04:45:51 | 2019-07-18T04:45:51 | 196,941,748 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,270 | ino | /*
This sketch establishes a TCP connection to a "quote of the day" service.
It sends a "hello" message, and then prints received data.
*/
#include <ESP8266WiFi.h>
#ifndef STASSID
#define STASSID "vivo 1718"
#define STAPSK "satusamhu"
#endif
const char* ssid = STASSID;
const char* password = STAPSK;
const char* host = "djxmmx.net";
const uint16_t port = 17;
void setup() {
Serial.begin(115200);
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
/* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
would try to act as both a client and an access-point and could cause
network-issues with your other WiFi-devices on your WiFi-network. */
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
Serial.print("connecting to ");
Serial.print(host);
Serial.print(':');
Serial.println(port);
// Use WiFiClient class to create TCP connections
WiFiClient client;
if (!client.connect(host, port)) {
Serial.println("connection failed");
delay(5000);
return;
}
// This will send a string to the server
Serial.println("sending data to server");
if (client.connected()) {
client.println("hello from ESP8266");
}
// wait for data to be available
unsigned long timeout = millis();
while (client.available() == 0) {
if (millis() - timeout > 5000) {
Serial.println(">>> Client Timeout !");
client.stop();
delay(60000);
return;
}
}
// Read all the lines of the reply from server and print them to Serial
Serial.println("receiving from remote server");
// not testing 'client.connected()' since we do not need to send data here
while (client.available()) {
char ch = static_cast<char>(client.read());
Serial.print(ch);
}
// Close the connection
Serial.println();
Serial.println("closing connection");
client.stop();
delay(300000); // execute once every 5 minutes, don't flood remote service
}
| [
"prasadraghuks@gmail.com"
] | prasadraghuks@gmail.com |
a134ca5d518a7ade329100567f29afbeb032db75 | dacf17dcc45b8d8a4a8aa9301582ae5e16ea7036 | /psdaq/psdaq/app/AppUtils.cc | 8377132f7ae0bb5d94e1860ab83e2cdc245b9eba | [
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | elliottslaughter/lcls2 | 779a2ec542508f058f1a7e32e29ba429903f1da5 | faecf0387c1fd3a41cf29cb66de702b7b651a60d | refs/heads/master | 2021-06-11T11:26:09.157609 | 2018-10-16T21:57:53 | 2018-10-16T21:58:08 | 113,411,348 | 0 | 0 | null | 2017-12-07T06:21:26 | 2017-12-07T06:21:26 | null | UTF-8 | C++ | false | false | 1,193 | cc | #include "AppUtils.hh"
#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/ip.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <unistd.h>
using namespace Psdaq;
unsigned AppUtils::parse_ip(const char* ipString) {
unsigned ip = 0;
in_addr inp;
if (inet_aton(ipString, &inp)) {
ip = ntohl(inp.s_addr);
}
return ip;
}
unsigned AppUtils::parse_interface(const char* interfaceString) {
unsigned interface = parse_ip(interfaceString);
if (interface == 0) {
int so = socket(AF_INET, SOCK_DGRAM, 0);
if (so < 0) {
perror("Failed to open socket\n");
return 0;
}
ifreq ifr;
strcpy(ifr.ifr_name, interfaceString);
int rv = ioctl(so, SIOCGIFADDR, (char*)&ifr);
close(so);
if (rv != 0) {
printf("Cannot get IP address for network interface %s.\n",interfaceString);
return 0;
}
interface = ntohl( *(unsigned*)&(ifr.ifr_addr.sa_data[2]) );
}
printf("Using interface %s (%d.%d.%d.%d)\n",
interfaceString,
(interface>>24)&0xff,
(interface>>16)&0xff,
(interface>> 8)&0xff,
(interface>> 0)&0xff);
return interface;
}
| [
"weaver@slac.stanford.edu"
] | weaver@slac.stanford.edu |
014dc8cfe0aee512bd6070a1e41a7a18a70e258a | a5c06c717054d4b5c453157efac2a17c45d345fd | /src/bitcoinrpc.h | e90e8cc5e2970d56832dba97ff9389f3dd120841 | [
"MIT"
] | permissive | valliammal/bitcoinwork | d1724a44f3d6ec6e1a17aef5327a569cb8eb829b | 75b30c341a00be7247f8bbfc2c0a8b9bbe57be2b | refs/heads/master | 2022-12-02T03:31:49.550868 | 2020-08-21T09:50:10 | 2020-08-21T09:50:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,624 | h | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef _BITCOINRPC_H_
#define _BITCOINRPC_H_ 1
#include <string>
#include <list>
#include <map>
class CBlockIndex;
#include "json/json_spirit_reader_template.h"
#include "json/json_spirit_writer_template.h"
#include "json/json_spirit_utils.h"
#include "util.h"
#include "checkpoints.h"
// HTTP status codes
enum HTTPStatusCode
{
HTTP_OK = 200,
HTTP_BAD_REQUEST = 400,
HTTP_UNAUTHORIZED = 401,
HTTP_FORBIDDEN = 403,
HTTP_NOT_FOUND = 404,
HTTP_INTERNAL_SERVER_ERROR = 500,
};
// Bitcoin RPC error codes
enum RPCErrorCode
{
// Standard JSON-RPC 2.0 errors
RPC_INVALID_REQUEST = -32600,
RPC_METHOD_NOT_FOUND = -32601,
RPC_INVALID_PARAMS = -32602,
RPC_INTERNAL_ERROR = -32603,
RPC_PARSE_ERROR = -32700,
// General application defined errors
RPC_MISC_ERROR = -1, // std::exception thrown in command handling
RPC_FORBIDDEN_BY_SAFE_MODE = -2, // Server is in safe mode, and command is not allowed in safe mode
RPC_TYPE_ERROR = -3, // Unexpected type was passed as parameter
RPC_INVALID_ADDRESS_OR_KEY = -5, // Invalid address or key
RPC_OUT_OF_MEMORY = -7, // Ran out of memory during operation
RPC_INVALID_PARAMETER = -8, // Invalid, missing or duplicate parameter
RPC_DATABASE_ERROR = -20, // Database error
RPC_DESERIALIZATION_ERROR = -22, // Error parsing or validating structure in raw format
// P2P client errors
RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected
RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10, // Still downloading initial blocks
// Wallet errors
RPC_WALLET_ERROR = -4, // Unspecified problem with wallet (key not found etc.)
RPC_WALLET_INSUFFICIENT_FUNDS = -6, // Not enough funds in wallet or account
RPC_WALLET_INVALID_ACCOUNT_NAME = -11, // Invalid account name
RPC_WALLET_KEYPOOL_RAN_OUT = -12, // Keypool ran out, call keypoolrefill first
RPC_WALLET_UNLOCK_NEEDED = -13, // Enter the wallet passphrase with walletpassphrase first
RPC_WALLET_PASSPHRASE_INCORRECT = -14, // The wallet passphrase entered was incorrect
RPC_WALLET_WRONG_ENC_STATE = -15, // Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)
RPC_WALLET_ENCRYPTION_FAILED = -16, // Failed to encrypt the wallet
RPC_WALLET_ALREADY_UNLOCKED = -17, // Wallet is already unlocked
};
json_spirit::Object JSONRPCError(int code, const std::string& message);
void ThreadRPCServer(void* parg);
int CommandLineRPC(int argc, char *argv[]);
/** Convert parameter values for RPC call from strings to command-specific JSON objects. */
json_spirit::Array RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams);
/*
Type-check arguments; throws JSONRPCError if wrong type given. Does not check that
the right number of arguments are passed, just that any passed are the correct type.
Use like: RPCTypeCheck(params, boost::assign::list_of(str_type)(int_type)(obj_type));
*/
void RPCTypeCheck(const json_spirit::Array& params,
const std::list<json_spirit::Value_type>& typesExpected, bool fAllowNull=false);
/*
Check for expected keys/value types in an Object.
Use like: RPCTypeCheck(object, boost::assign::map_list_of("name", str_type)("value", int_type));
*/
void RPCTypeCheck(const json_spirit::Object& o,
const std::map<std::string, json_spirit::Value_type>& typesExpected, bool fAllowNull=false);
typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool fHelp);
class CRPCCommand
{
public:
std::string name;
rpcfn_type actor;
bool okSafeMode;
bool unlocked;
};
/**
* Bitcoin RPC command dispatcher.
*/
class CRPCTable
{
private:
std::map<std::string, const CRPCCommand*> mapCommands;
public:
CRPCTable();
const CRPCCommand* operator[](std::string name) const;
std::string help(std::string name) const;
/**
* Execute a method.
* @param method Method to execute
* @param params Array of arguments (JSON objects)
* @returns Result of the call.
* @throws an exception (json_spirit::Value) when an error happens.
*/
json_spirit::Value execute(const std::string &method, const json_spirit::Array ¶ms) const;
};
extern const CRPCTable tableRPC;
extern int64 nWalletUnlockTime;
extern int64 AmountFromValue(const json_spirit::Value& value);
extern json_spirit::Value ValueFromAmount(int64 amount);
extern double GetDifficulty(const CBlockIndex* blockindex = NULL);
extern double GetPoSKernelPS();
extern std::string HexBits(unsigned int nBits);
extern std::string HelpRequiringPassphrase();
extern void EnsureWalletIsUnlocked();
//
// Utilities: convert hex-encoded Values
// (throws error if not hex).
//
extern uint256 ParseHashV(const json_spirit::Value& v, std::string strName);
extern uint256 ParseHashO(const json_spirit::Object& o, std::string strKey);
extern std::vector<unsigned char> ParseHexV(const json_spirit::Value& v, std::string strName);
extern std::vector<unsigned char> ParseHexO(const json_spirit::Object& o, std::string strKey);
extern json_spirit::Value getconnectioncount(const json_spirit::Array& params, bool fHelp); // in rpcnet.cpp
extern json_spirit::Value getpeerinfo(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value dumpprivkey(const json_spirit::Array& params, bool fHelp); // in rpcdump.cpp
extern json_spirit::Value importprivkey(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value sendalert(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getgenerate(const json_spirit::Array& params, bool fHelp); // in rpcmining.cpp
extern json_spirit::Value setgenerate(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value gethashespersec(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getmininginfo(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getwork(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getworkaux(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getauxblock(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getworkex(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getblocktemplate(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value submitblock(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getnewaddress(const json_spirit::Array& params, bool fHelp); // in rpcwallet.cpp
extern json_spirit::Value getaccountaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value setaccount(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getaccount(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getaddressesbyaccount(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value sendtoaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value sendtoaddressanon(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value signmessage(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value verifymessage(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getreceivedbyaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getreceivedbyaccount(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getbalance(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value movecmd(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value sendfrom(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value sendmany(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value addmultisigaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listreceivedbyaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listreceivedbyaccount(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listtransactions(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listaddressgroupings(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listaccounts(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listsinceblock(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value gettransaction(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value backupwallet(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value keypoolrefill(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value walletpassphrase(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value walletpassphrasechange(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value walletlock(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value encryptwallet(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value validateaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getinfo(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value reservebalance(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value checkwallet(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value repairwallet(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value resendtx(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value makekeypair(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value validatepubkey(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getnewpubkey(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getnetworkhashps(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getrawtransaction(const json_spirit::Array& params, bool fHelp); // in rcprawtransaction.cpp
extern json_spirit::Value listunspent(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value createrawtransaction(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value decoderawtransaction(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value signrawtransaction(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value sendrawtransaction(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getblockcount(const json_spirit::Array& params, bool fHelp); // in rpcblockchain.cpp
extern json_spirit::Value getdifficulty(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value settxfee(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getrawmempool(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getblockhash(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getblock(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getblockbynumber(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getcheckpoint(const json_spirit::Array& params, bool fHelp);
#endif
| [
"vallir63@gmail.com"
] | vallir63@gmail.com |
0783f5f43aa5edebef0738568525f703374d16f0 | 13508677af95d0940a6774e60002c5bcfba7ae9f | /10067 - Playing with Wheels.cpp | c71069f7eb310af98ff49f2ba91342b2868eaef8 | [] | no_license | kuonanhong/UVa-2 | f40686287e1aa717b6da4af81d0eafa07b0afd17 | f58813d6a926f1ae4f61644d51dc1fe28b923cbd | refs/heads/master | 2021-04-30T15:22:20.138385 | 2016-06-13T06:26:44 | 2016-06-13T06:26:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,963 | cpp | /**
UVa 10067 - Playing with Wheels
by Rico Tiongson
Submitted: October 27, 2013
Accepted 0.122s C++
O(|V| + E) time
*/
#include<iostream>
#include<queue>
#include<cstdio>
#include<cstring>
using namespace std;
struct state{
int a[4];
state() {}
state( const state& s ){
for( int i=0; i<4; ++i ) a[i] = s[i];
}
state( int A, int B, int C, int D ){
a[0] = A;
a[1] = B;
a[2] = C;
a[3] = D;
}
void in(){
for( int i=0; i<4; ++i )
scanf( "%d", a+i );
}
int& operator[]( int i ){
return a[i];
}
int operator[]( int i ) const {
return a[i];
}
bool operator==( const state& s ) const {
for( int i=0; i<4; ++i ){
if( a[i] != s[i] ) return false;
}
return true;
}
};
ostream& operator << ( ostream& out, const state& s ){
return out << s[0] << " " << s[1] << " " << s[2] << " " << s[3];
}
int t, n;
bool vis[10][10][10][10];
state start, end, forbidden;
bool& visited( const state& s ){
return vis[s[0]][s[1]][s[2]][s[3]];
}
bool inRange( const state& s ){
for( int i=0; i<4; ++i ){
if( s[i] < 0 || s[i] > 9 ) return false;
}
return true;
}
int bfs(){
if( visited(start) || visited(end) ) return -1;
if( start == end ) return 0;
queue<state> q;
queue<int> d;
q.push(start);
d.push(0);
visited(start) = true;
while( !q.empty() ){
state s = q.front();
int w = d.front() + 1; d.pop();
for( int i=0; i<4; ++i ){
for( int j=-1; j<2; j+=2 ){
s[i] = (s[i] + j + 10) % 10;
if( !visited(s) ){
visited(s) = true;
if( s==end ){
return w;
}
q.push(s);
d.push(w);
}
s[i] = (s[i] - j + 10) % 10;
}
}
q.pop();
}
return -1;
}
int main(){
scanf( "%d", &t );
while(t--){
start.in();
end.in();
scanf( "%d", &n );
memset( vis, 0, sizeof vis );
while(n--){
forbidden.in();
visited(forbidden) = true;
}
printf( "%d\n", bfs() );
}
}
| [
"thericotiongson@gmail.com"
] | thericotiongson@gmail.com |
70a7d168eaec0e95c1fd68079fd9c3dabe2f64ea | 7fcad83212f0f8c3f4dad1c67998dd5f540ca8ff | /JogoTecProg.cpp | 417a9b28ba3ec67f56c877319237074fbca19421 | [] | no_license | LuisFWerlang/JogoTecProg | 6ae6c5d8e4152a9b0ccf82a6ada5b8eb2c57722b | 199133930724bb33044fb3f113ec7d5e68eb8353 | refs/heads/master | 2023-04-17T08:19:36.565483 | 2021-04-27T22:54:11 | 2021-04-27T22:54:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 46 | cpp | #include "jogo.h"
int main()
{
Jogo jogo;
}
| [
"felipe.lfsw@hotmail.com"
] | felipe.lfsw@hotmail.com |
c3a0cb3b1b41ccdc28ac75433c618fb60531c8d6 | 40751a886c627b094185543359937f705aff2549 | /src/graph.hpp | ae114cc781c0ea17ad9d25cd66eec5add7207395 | [] | no_license | mswietochowski/evotest | 97b55d2a897a13735aa36909c30489a8d3bf938c | c330af8d4c7a12b3375e46781b9bfd58f9f98ed3 | refs/heads/master | 2016-09-06T14:02:41.281865 | 2010-11-17T00:42:57 | 2010-11-17T00:42:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 727 | hpp | #include <map>
#include <vector>
#include <list>
#include <string>
#define MAX_VERTEX_COUNT 10
struct Vertex
{
typedef int key;
key number;
std::string name;
double x, y, z;
double r, g, b;
Vertex() { };
Vertex(Vertex::key k, std::string _name, double _x = 0.0, double _y = 0.0, double _z = 0.0, double r = 255, double g = 255, double b = 255);
};
struct Graph
{
Graph();
bool addVertex(Vertex v);
bool addEdge(Vertex::key v1, Vertex::key v2);
std::map<Vertex::key, Vertex> vertices;
typedef std::map<Vertex::key, Vertex>::iterator vertices_iterator;
typedef std::map<Vertex::key, Vertex>::const_iterator vertices_const_iterator;
bool mtx[MAX_VERTEX_COUNT][MAX_VERTEX_COUNT];
static int maxVertexCount;
};
| [
"m@swietochowski.eu"
] | m@swietochowski.eu |
2fbd569dad9f3a6b5d8dba16937e516823702ccf | 23741074c16d6b392d5fef556b87d26ef0bab677 | /abc/147/a.cpp | 1d13f1f868add8c42f208c43a28209db8341fd48 | [] | no_license | takami228/atcoder | 1a871d357794313056227df037861baf23fd32e2 | 1781fa8b106f3c212307be4f47caec9a1397a769 | refs/heads/master | 2021-09-26T11:22:02.144519 | 2021-09-20T08:31:23 | 2021-09-20T08:31:23 | 177,994,247 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 475 | cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
using ll = long long;
void print_ans(bool flag){
if(flag){
cout << "win" << endl;
} else {
cout << "bust" << endl;
}
}
int main(){
int a, b, c;
cin >> a >> b >> c;
bool res = ((a + b + c) <= 21);
print_ans(res);
return 0;
}
| [
"m.takami228@gmail.com"
] | m.takami228@gmail.com |
23db0c09aa4cc543171e4b87943a85416d448354 | 51346ccaeb088737451f164f47021917d5b15ffb | /protobuf/protobuf-dispatcher/dispatcher.h | a0e8fe19491301156c34311d2968537b7a1fc8ef | [] | no_license | shendian1990/recipes | 090e7dd2247550e6906ce6e6afd7ce8c3c80d598 | aa37f41bee305dda092b886eb9fe7b6ebfafd19c | refs/heads/master | 2020-05-17T07:47:18.647681 | 2020-03-10T02:02:11 | 2020-03-10T02:02:11 | 183,588,224 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,741 | h | #include <google/protobuf/message.h>
#include <map>
#include <functional>
#include<type_traits>
using MessagePtr = std::shared_ptr<google::protobuf::Message>;
class Callback {
public:
virtual ~Callback() = default;
virtual void onMessage(const MessagePtr& message) const = 0;
};
template <typename T>
class CallbackT : public Callback{
static_assert(std::is_base_of<google::protobuf::Message, T>::value,
"T must be derived from gdb::Messsage.");
public:
using ProtobufMessageTCallback = std::function<void(const std::shared_ptr<T>& message)>;
CallbackT(const ProtobufMessageTCallback& callback)
:callback_(callback)
{}
void onMessage(const MessagePtr& message) const override {
std::shared_ptr<T> concrete = std::static_pointer_cast<T>(message);
assert(concrete != nullptr);
callback_(concrete);
}
private:
ProtobufMessageTCallback callback_;
};
class ProtobufDispatcher
{
public:
using ProtobufMessageCallback = std::function<void(const MessagePtr& message)>;
explicit ProtobufDispatcher(const ProtobufMessageCallback& defaultCb)
:defaultCallback_(defaultCb)
{}
void onProtobufMessage(const MessagePtr& message) const {
const auto iter = callbacks_.find(message->GetDescriptor());
if (iter != callbacks_.cend()) {
iter->second->onMessage(message);
}
else {
defaultCallback_(message);
}
}
template<typename T>
void registerMessageCallback(const typename CallbackT<T>::ProtobufMessageTCallback& callback) {
auto pd = std::make_shared<CallbackT<T>>(callback);
callbacks_[T::descriptor()] = pd;
}
private:
using CallbackMap = std::map<const google::protobuf::Descriptor*, std::shared_ptr<Callback>>;
CallbackMap callbacks_;
const ProtobufMessageCallback defaultCallback_;
};
| [
"shendian1990@gmail.com"
] | shendian1990@gmail.com |
307dc770b6226d696349f20b26862762921f2b96 | 08b4f544ebe88b9336c1e176f76f9f17bab5a10c | /spolks_lib/SocketBase.cpp | 746a1518d532eb6f2fa00d08eafc21e9177f41cd | [] | no_license | spolks-2013-2014-sem1/050501_ilyenko | bb4d0a416c8956a6d36d74c7bf132c519d4dceca | 3d643c18ec381799bce8ce395cba08ae4d22aecc | refs/heads/master | 2016-09-10T18:33:42.714546 | 2013-12-06T21:57:13 | 2013-12-06T21:57:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,767 | cpp | #include "SocketBase.h"
SocketBase::SocketBase()
{
ISignalObserver* observer = (ISignalObserver*)this;
SignalHandlerNotifier::Subscribe(observer, SIGINT);
SignalHandlerNotifier::Subscribe(observer, SIGTERM);
SignalHandlerNotifier::Subscribe(observer, SIGQUIT);
}
SocketBase::~SocketBase()
{
CloseAllSockets();
}
int SocketBase::CreateSocket(const char* addressString, const char* portString, const char* protocolName)
{
int socketType = DetermineSocketType(protocolName);
protoent* protocolEntry = getprotobyname(protocolName);
int socketDescriptor = socket(PF_INET, socketType, protocolEntry->p_proto);
if (socketDescriptor == -1) {
exit(EXIT_FAILURE);
}
openedSockets.push_back(socketDescriptor);
return socketDescriptor;
}
sockaddr_in SocketBase::CreateSocketAddress(const char* portString,
const char* address)
{
struct sockaddr_in socketAddress;
memset(&socketAddress, 0, sizeof(socketAddress));
socketAddress.sin_family = AF_INET;
socketAddress.sin_port = htons(( unsigned short) atoi (portString));
if (address == 0) {
socketAddress.sin_addr.s_addr = htonl(INADDR_ANY); // Let's bind it to all interfaces!
} else {
socketAddress.sin_addr.s_addr = inet_addr(address);
}
return socketAddress;
}
int SocketBase::BindSocket(int socketDescriptor, sockaddr* socketAddress)
{
int bindResult = bind(socketDescriptor, socketAddress, sizeof(*socketAddress));
if(bindResult == -1) {
perror("Socket binding failed.");
Close(socketDescriptor);
exit(EXIT_FAILURE);
}
return bindResult;
}
int SocketBase::DetermineSocketType(const char* protocolName)
{
int type = SOCK_STREAM;
if (strcmp( protocolName, "udp") == 0) {
type = SOCK_DGRAM;
} else if (strcmp( protocolName, "tcp") == 0) {
type = SOCK_STREAM;
}
return type;
}
int SocketBase::ShutdownSocket(int socket)
{
int shutdownResult = shutdown(socket, SHUT_RDWR);
if (shutdownResult == -1) {
perror("Can not shutdown socket.");
Close(socket);
}
return shutdownResult;
}
int SocketBase::Close(int socket)
{
close(socket);
openedSockets.pop_back();
return 0;
}
int SocketBase::SetSocketOptions(int socketDescriptor)
{
int option = 1;
setsockopt(socketDescriptor, SOL_SOCKET, SO_REUSEADDR, (void*)&option, sizeof(option));
return 0;
}
void SocketBase::CloseAllSockets()
{
for (unsigned int i = 0; i < openedSockets.size(); ++i) {
Close(openedSockets[i]);
}
}
void SocketBase::SignalCallback(int signum)
{
CloseAllSockets();
printf("\nSocket was halted after receiving the signal %0d.\n", signum);
exit(signum);
} | [
"rnort@r-laptop.(none)"
] | rnort@r-laptop.(none) |
0abad76f2c6594a13e160cb4a9e3e0053943bae9 | 7d5c59d07a268c32ec5b64124d353e4a47efdece | /src/qlift-c-api/qlift-QComboBox.cpp | ad90e9b9d92d8780359dc906772ba552412c644c | [
"MIT"
] | permissive | carson-katri/qlift-c-api | a3f21de001197eabac637079fd9dd02bd7d56a21 | 377aea04aa1ff2e8efc56fd25d24d91f1b78e1cb | refs/heads/master | 2022-12-07T20:17:21.974710 | 2020-07-30T20:09:26 | 2020-07-30T20:09:26 | 283,861,640 | 0 | 1 | MIT | 2020-08-18T19:20:38 | 2020-07-30T19:35:23 | C++ | UTF-8 | C++ | false | false | 1,404 | cpp | #include <QComboBox>
#include "qlift-QComboBox.h"
void* QComboBox_new(void *parent) {
return static_cast<void*>(new QComboBox {static_cast<QWidget*>(parent)});
}
void QComboBox_delete(void *comboBox) {
delete static_cast<QComboBox*>(comboBox);
}
void QComboBox_addItem(void *comboBox, const char *text, void *userData) {
if (userData) {
static_cast<QComboBox*>(comboBox)->addItem(text, *static_cast<QVariant*>(userData));
} else {
static_cast<QComboBox*>(comboBox)->addItem(text);
}
}
void QComboBox_currentIndexChangedInt_connect(void *comboBox, void *receiver, void *context, void (*slot_ptr)(void*, int)) {
QObject::connect(
static_cast<QComboBox*>(comboBox),
static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
static_cast<QObject*>(receiver),
[context, slot_ptr](int index) {
(*slot_ptr)(context, index);
}
);
}
void QComboBox_currentIndexChangedString_connect(void *comboBox, void *receiver, void *context, void (*slot_ptr)(void*, const char*)) {
QObject::connect(
static_cast<QComboBox*>(comboBox),
static_cast<void(QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
static_cast<QObject*>(receiver),
[context, slot_ptr](const QString &text) {
(*slot_ptr)(context, text.toLocal8Bit().data());
}
);
}
| [
"andi.schulz@me.com"
] | andi.schulz@me.com |
3d75bce414505c059e1afc931b24cab4a4a1fb0b | 96fbede8fa64f5ff60653cdc01e389f87bb5dd14 | /SlidingPuzzle/MainFrm.cpp | 19cd5dd8014a57856ffba5ed6be463fee20b7142 | [] | no_license | IvanaAndelic/SlidingPuzzle | c1728bc253a32ab5256cffbb35642d8109e08d0b | b34925e98ea610f9877a22bb788d9b88c93129d9 | refs/heads/main | 2023-08-09T19:29:54.075404 | 2021-09-08T18:26:35 | 2021-09-08T18:26:35 | 375,061,040 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,774 | cpp |
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "pch.h"
#include "framework.h"
#include "SlidingPuzzle.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CREATE()
ON_WM_SETFOCUS()
END_MESSAGE_MAP()
// CMainFrame construction/destruction
CMainFrame::CMainFrame() noexcept
{
// add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// create a view to occupy the client area of the frame
if (!m_wndView.Create(nullptr, nullptr, AFX_WS_DEFAULT_VIEW, CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, nullptr))
{
TRACE0("Failed to create view window\n");
return -1;
}
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// the CREATESTRUCT cs
;
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
cs.lpszClass = AfxRegisterWndClass(0);
return TRUE;
}
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
// CMainFrame message handlers
void CMainFrame::OnSetFocus(CWnd* /*pOldWnd*/)
{
// forward focus to the view window
m_wndView.SetFocus();
}
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// let the view have first crack at the command
if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
// otherwise, do default handling
return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
| [
"ivana.apneli@gmail.com"
] | ivana.apneli@gmail.com |
651464f1ebae9f3e9b6b36b7a5905e2e4f20dbaa | 6e77b2d7d45a22e4e12d3624f6e4186da600fbb8 | /src/Engine/Engine/ACAFTLoader.cpp | a74a97e9591babdd0472790ee7ae094d5002219e | [] | no_license | dgadens/ActionEngine | c414eb216e1a4d99251a079dab4e20164005f521 | 410e04411b55d436c0df2f548444bb5b2bb2052d | refs/heads/master | 2021-01-23T22:42:52.296434 | 2012-11-26T00:35:39 | 2012-11-26T00:35:39 | 5,075,926 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,403 | cpp | #include "ACAFTLoader.h"
FILE* ACAFTLoader::mpFile;
bool ACAFTLoader::CloseFile( bool rBool )
{
// close file
if( mpFile )
{
fclose( mpFile );
mpFile = nullptr;
}
// bye
return rBool;
}
bool ACAFTLoader::LoadFromFile( const char* path, ACFont* outFont)
{
// open the file
mpFile = fopen( path, "rb" );
if( !mpFile ) return false;
outFont->ID = 0;
outFont->Instance = 0;
INT version = 0;
fread( &version, sizeof ( INT ), 1, mpFile );
char name[64];
fread ( &name, sizeof ( char ), 64, mpFile);
outFont->Name = name;
fread ( &outFont->Size, sizeof ( INT ), 1, mpFile);
fread ( &outFont->Width, sizeof ( INT ), 1, mpFile);
fread ( &outFont->Height, sizeof ( INT ), 1, mpFile);
INT charCount = 0;
fread ( &charCount, sizeof ( INT ), 1, mpFile);
//zera toda a estrutura de caracteres
ZeroMemory(&outFont->Characteres[0], sizeof ( ACCharSettings ) * 256);
//pega as configuracoes de todos os 256 characteres
for (int i=0; i < 256; i++)
{
ACCharSettings ch;
ZeroMemory( &ch, sizeof ( ACCharSettings ));
//resgata do arquivo a estrutura
fread (&ch, sizeof ( ACCharSettings ), 1, mpFile);
//copia as informacoes da posicao correta ja para o array, assim eu uso o codigo asc como indice direto
memcpy( &outFont->Characteres[ch.Id], &ch, sizeof ( ACCharSettings ));
}
return CloseFile( true );
}; | [
"degadens@gmail.com"
] | degadens@gmail.com |
ba256f7f11484ae542faf6ac1e99579bda7ee16c | 112a0cb577e1423278efa7685d195c956d5f2e30 | /accepted/p10334_ray_through_glasses/acm.cpp | 830538750a33b3f5e67c2dfb32ad450eec0c560c | [] | no_license | sca1a/acm-valladolid | 8880f406545b29bbf790f74a2d5d73c5a1807119 | d539373779a8b4224160f45aa8d1c4272f48c281 | refs/heads/master | 2020-12-25T05:27:15.327812 | 2012-05-17T03:43:58 | 2012-05-17T03:43:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,271 | cpp | /* @JUDGE_ID: 40922FK 10334 C++ */
/* @BEGIN_OF_SOURCE_CODE */
/**************************************************************************
Solution to Problem 10334 - Ray Through Glasses
by: Francisco Dibar
date: Feb-22-2005
**************************************************************************/
//#define ONLINE_JUDGE
#include <iostream>
#ifndef ONLINE_JUDGE
#include <fstream>
#endif
#include <vector>
using namespace std;
/**************************************************************************
BIGINT Library Header
by: Francisco Dibar
date: Feb-18-2005
**************************************************************************/
#if !defined(_BIGINT_H__)
#define _BIGINT_H__
#define PLUS 1 // positive sign bit
#define MINUS -1 // negative sign bit
#define DEFAULT_DIGITS 64
//#include<vector>
#include<string>
//using namespace std;
class bigint {
private:
vector<char> digits;
int signbit;
int lastdigit; // index of high order digit
protected:
int compare(const bigint &, const bigint &) const;
bigint &zero_justify();
bigint &digit_shift(int);
public:
bigint(long nro = 0, long size = DEFAULT_DIGITS);
bigint(const string &, long size = DEFAULT_DIGITS);
bigint(const bigint &); // constructor copia
friend ostream &operator<<(ostream &, const bigint &);
friend istream &operator>>(istream &, bigint &);
bigint &operator=(const bigint &);
bigint operator+(const bigint &) const;
bigint operator-(const bigint &) const;
bigint operator-() const;
bigint operator*(const bigint &) const;
bigint operator/(const bigint &) const;
bigint operator%(const bigint &) const;
bigint &operator+=(const bigint &);
bigint &operator-=(const bigint &);
bigint &operator*=(const bigint &);
bigint &operator/=(const bigint &);
bool operator==(const bigint &) const;
bool operator!=(const bigint &) const;
bool operator<(const bigint &) const;
bool operator>(const bigint &) const;
bool operator<=(const bigint &) const;
bool operator>=(const bigint &) const;
bigint absolute() const;
bigint &operator++(); // preincremento
bigint operator++(int); // postincremento
bigint &operator--(); // predecremento
bigint operator--(int); // postdecremento
bool is_palindrome() const;
bigint reverse() const;
};
#endif
/**************************************************************************
BIGINT Library Implementation
by: Francisco Dibar
date: Feb-17-2005
**************************************************************************/
//#include <iostream>
///////////////////////////////////////////////////////////////////////////
bigint::bigint(const bigint &nro)
{
digits.resize(nro.lastdigit+1, '0');
digits = nro.digits;
signbit = nro.signbit;
lastdigit = nro.lastdigit;
}
///////////////////////////////////////////////////////////////////////////
bigint::bigint(const string &nro, long size)
// asume nro en formato "-n" o "n", se admiten ceros al comienzo
{
int offset = nro.find_first_of("123456789");
// si no encuentra ninguno de los digitos, inicializar en 0
if (offset == string::npos)
*this = bigint(0);
else {
signbit = (nro[0] == '-') ? MINUS : PLUS;
lastdigit = nro.length() - 1 - offset;
digits.resize(lastdigit + 1, '0');
for (int i = 0; i <= lastdigit; i++)
digits[lastdigit - i] = nro[i + offset];
}
}
///////////////////////////////////////////////////////////////////////////
bigint::bigint(long nro, long size)
{
digits.resize(size, '0');
// setear signo
signbit = (nro >= 0) ? PLUS : MINUS;
// vector inicializa digits en cero
lastdigit = -1;
int t = abs(nro);
while (t > 0) {
lastdigit++;
digits[lastdigit] = (t % 10) + '0';
t /= 10;
}
if (nro == 0) {
lastdigit = 0;
digits[0] = '0';
}
digits.resize(lastdigit+1, '0');
}
///////////////////////////////////////////////////////////////////////////
int bigint::compare(const bigint &a, const bigint &b) const
// devuelve PLUS si a < b, MINUS si b < a, y 0 si a = b
{
if ((a.signbit == MINUS) && (b.signbit == PLUS)) return PLUS;
if ((a.signbit == PLUS) && (b.signbit == MINUS)) return MINUS;
if (b.lastdigit > a.lastdigit) return (PLUS * a.signbit);
if (a.lastdigit > b.lastdigit) return (MINUS * a.signbit);
// tienen = cant de digitos
for (int i = a.lastdigit; i >= 0; i--) {
if (a.digits[i] > b.digits[i])
return (MINUS * a.signbit);
if (b.digits[i] > a.digits[i])
return (PLUS * a.signbit);
}
// a = b
return 0;
}
///////////////////////////////////////////////////////////////////////////
bool bigint::operator==(const bigint &nro) const
{
return (compare(*this, nro) == 0);
}
///////////////////////////////////////////////////////////////////////////
bool bigint::operator!=(const bigint &nro) const
{
return (compare(*this, nro) != 0);
}
///////////////////////////////////////////////////////////////////////////
bool bigint::operator<(const bigint &nro) const
{
return (compare(*this, nro) == 1);
}
///////////////////////////////////////////////////////////////////////////
bool bigint::operator>(const bigint &nro) const
{
return (compare(*this, nro) == -1);
}
///////////////////////////////////////////////////////////////////////////
bool bigint::operator<=(const bigint &nro) const
{
return (compare(*this, nro) >= 0);
}
///////////////////////////////////////////////////////////////////////////
bool bigint::operator>=(const bigint &nro) const
{
return (compare(*this, nro) <= 0);
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::operator=(const bigint &nro)
{
digits.resize(nro.lastdigit+1, '0');
digits = nro.digits;
signbit = nro.signbit;
lastdigit = nro.lastdigit;
return *this;
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::operator--()
// operador -- como prefijo (predecremento)
{
*this -= bigint(1);
return (*this);
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::operator--(int)
// operador -- como sufijo (postdecremento)
{
bigint temp = *this;
*this -= bigint(1);
return temp;
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::operator++()
// operador ++ como prefijo (preincremento)
{
*this += bigint(1);
return (*this);
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::operator++(int)
// operador ++ como sufijo (postincremento)
{
bigint temp = *this;
*this += bigint(1);
return temp;
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::operator+=(const bigint &nro)
{
bigint temp = nro;
*this = *this + temp;
return (*this);
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::operator-=(const bigint &nro)
{
bigint temp = nro;
*this = *this - temp;
return (*this);
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::operator*=(const bigint &nro)
{
bigint temp = nro;
*this = *this * temp;
return (*this);
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::operator/=(const bigint &nro)
{
bigint temp = nro;
*this = *this / temp;
return (*this);
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::operator+(const bigint &nro) const
{
// a + b siendo b = nro
bigint res(*this);
if (signbit == nro.signbit)
res.signbit = signbit;
else {
if (signbit == MINUS){
// devuelvo b - abs(a)
return ((bigint)nro - res.absolute());
} else {
// devuelvo a - abs(b)
return (res - (bigint)nro.absolute());
}
}
// efectuo la suma, independientemente del signo
res.lastdigit = max(lastdigit, nro.lastdigit) + 1;
res.digits.resize(res.lastdigit + 1, '0');
int carry = 0;
for (int i = 0; i <= res.lastdigit; i++) {
int adigit = (i <= lastdigit) ? digits[i] - '0' : 0;
int bdigit = (i <= nro.lastdigit) ? nro.digits[i] - '0' : 0;
int sum = carry + adigit + bdigit;
res.digits[i] = (sum % 10) + '0';
carry = sum / 10;
}
return res.zero_justify();
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::operator-() const
// operador unario, cambia el signo
{
bigint temp(*this);
temp.signbit *= MINUS;
return temp;
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::operator-(const bigint &nro) const
// nro no es const aunque no se modifica, para evitar tener que inicializar
// una variable auxiliar con el signo contrario
{
// a - b siendo b = nro
bigint res(*this);
if ((signbit == MINUS) || (nro.signbit == MINUS)) {
bigint temp = -nro; // (-a) - b = -a + (-b)
res += nro; // a - (-b) = a + b
return res; // (-a) - (-b) = -a + b = b - a
}
if (res < nro) {
res = nro - res;
res.signbit = MINUS;
return res;
}
res.lastdigit = max(lastdigit, nro.lastdigit);
int borrow = 0;
for (int i = 0; i <= res.lastdigit; i++) {
int adigit = (i <= nro.lastdigit) ? nro.digits[i] - '0' : 0;
int v = (res.digits[i] - '0' - borrow - adigit);
if (res.digits[i] > '0')
borrow = 0;
if (v < 0) {
v += 10;
borrow = 1;
}
res.digits[i] = (v % 10) + '0';
}
return res.zero_justify();
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::operator*(const bigint &nro) const
{
bigint res,
row = *this;
for (int i = 0; i <= nro.lastdigit; i++) {
for (int j = 1; j <= nro.digits[i]-'0'; j++)
res += row;
row.digit_shift(1);
}
res.signbit = signbit * nro.signbit;
return res.zero_justify();
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::operator/(const bigint &nro) const
{
// evitar division por cero
if (nro == 0) return (bigint)0;
bigint res = *this, // inicializo para evitar un resize
a = *this,
b = nro;
res.signbit = signbit * nro.signbit;
a.signbit = PLUS;
b.signbit = PLUS;
res.lastdigit = lastdigit;
bigint row; // represent shifted row
for (int i = lastdigit; i >= 0; i--) {
row.digit_shift(1);
row.digits[0] = digits[i];
res.digits[i] = '0';
while (row >= b) {
res.digits[i] ++;
row -= b;
}
}
return res.zero_justify();
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::operator%(const bigint &nro) const
// division modulo, devuelve el resto de dividir por nro
{
bigint res = *this;
res /= nro;
return (*this - (res * nro));
}
///////////////////////////////////////////////////////////////////////////
ostream &operator<<(ostream &os, const bigint &bi)
{
string salida;
if (bi.signbit == MINUS)
salida = "-";
for (int i = bi.lastdigit; i >= 0; i--)
salida += bi.digits[i];
return (os << salida);
}
///////////////////////////////////////////////////////////////////////////
istream &operator>>(istream &is, bigint &bi)
{
string input;
is >> input;
bi = bigint(input);
return is;
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::absolute() const
// devuelve el valor absoluto del nro
{
bigint temp(*this);
temp.signbit = PLUS;
return temp;
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::zero_justify()
{
while ((lastdigit > 0) && (digits[lastdigit] == '0'))
lastdigit--;
if ((lastdigit == 0) && (digits[0] == '0'))
signbit = PLUS; /* hack to avoid -0 */
return *this;
}
///////////////////////////////////////////////////////////////////////////
bigint &bigint::digit_shift(int d)
// multiplica por 10^d
{
if ((lastdigit == 0) && (digits[0] == '0'))
return *this;
// REVISAR: estoy haciendo resize con cada shift. optimizar
digits.resize(lastdigit + d + 1);
for (int i = lastdigit; i >= 0; i--)
digits[i+d] = digits[i];
for (int j = 0; j < d; j++)
digits[j] = '0';
lastdigit += d;
return *this;
}
///////////////////////////////////////////////////////////////////////////
bool bigint::is_palindrome() const
{
int i = 0;
while (i <= (lastdigit / 2)) {
if (digits[i] != digits[lastdigit - i])
return false;
i++;
}
return true;
}
///////////////////////////////////////////////////////////////////////////
bigint bigint::reverse() const
{
bigint temp(*this);
for (int i = 0; (i <= lastdigit); i++) {
temp.digits[i]= digits[lastdigit - i];
}
return temp;
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
bigint fibonacci(int n, int *max, vector<bigint>& vec_fibo)
// vec_fibo es un vector de la serie precalculada (max valores)
{
if (n >= *max) {
// precalcular valores
vec_fibo.resize(n+1);
for (int i = *max; i <= n; i++)
vec_fibo[i] = vec_fibo[i-1] + vec_fibo[i-2];
*max = n;
}
return vec_fibo[n];
}
///////////////////////////////////////////////////////////////////////////
// PROGRAMA PRINCIPAL
///////////////////////////////////////////////////////////////////////////
int main(int argc, char *argv[])
{
// redireccionar la entrada y salida
#ifndef ONLINE_JUDGE
cin.rdbuf((new ifstream("input.txt"))->rdbuf());
cout.rdbuf((new ofstream("output.txt"))->rdbuf());
#endif
int n,
max = 2; // cant de valores precalculados
cin >> n;
vector<bigint> vec_fibo(n + 2); // valores precalculados
vec_fibo[0] = 0;
vec_fibo[1] = 1;
while (!cin.eof()) {
// an = fibonacci(n+2)
cout << fibonacci(n+2, &max, vec_fibo) << endl;
cin >> n;
}
return 0;
}
/* @END_OF_SOURCE_CODE */
| [
"frandibar@gmail.com"
] | frandibar@gmail.com |
7166e1a71d357fffdbb36855a2176453182e2660 | db9d9785501362c689d05a35f7dbc0f1d5e34b7b | /Source/FlecsTest/FlecsTestActor.cpp | 432b2ff562105e78ad00a468b0957c0ef7a70e7e | [] | no_license | mic-code/FlecsUnrealTest | 5a697dec86eb428c25997ed339fb7de03f30d5cc | c020ab89f6f2e726ea1e4eedcbf6d31eacca9762 | refs/heads/master | 2023-02-02T22:07:07.850636 | 2020-12-23T03:46:43 | 2020-12-23T03:46:43 | 323,795,782 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 670 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "FlecsTestActor.h"
#include "SimpleModule.h"
AFlecsTestActor::AFlecsTestActor()
{
PrimaryActorTick.bCanEverTick = true;
}
void AFlecsTestActor::BeginPlay()
{
Super::BeginPlay();
//without this, unreal engine will crash when entering play the second time
flecs::_::component_info<SimpleModule>::reset();
world = flecs::world();
world.import<SimpleModule>();
world.entity("MyEntity")
.set<Position>({ 0, 0 })
.set<Velocity>({ 1, 1 });
}
void AFlecsTestActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
world.progress();
} | [
"michael@overimagined.com"
] | michael@overimagined.com |
4c221e22a1dcf30783d68b3e4599d4574a291a81 | 609f2ae8c95c5c592dc62a08142ce7a84a4b047b | /GraphicsEngine/Material.cpp | e1545540f65ee2fd3cac28b9307e834ba403d620 | [] | no_license | David-Parker/Ray-Tracer | 20cf81e5229fee4c830263cb513b69e3ec56b525 | 435c8fcba1ce35beb4fe66382b2e04f051b83c8c | refs/heads/master | 2020-03-18T02:13:00.030930 | 2018-05-27T02:06:21 | 2018-05-27T02:06:21 | 134,180,117 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 329 | cpp | #include "Material.h"
Material::Material()
{
}
Material::~Material()
{
}
Vector3 Material::GetRandomUnitSphereDirection()
{
Vector3 point;
do
{
point = 2.0*Vector3(CoolMath::RandomScalar(), CoolMath::RandomScalar(), CoolMath::RandomScalar()) - Vector3(1, 1, 1);
} while (point.SquaredLength() >= 1.0);
return point;
} | [
"davidgparker123@utexas.edu"
] | davidgparker123@utexas.edu |
ae63bb30ed9fb88406852d72aabf1ca96ccfbd8e | 6f93ca69f23bf6749b17f6b0f2a626bc37451fa2 | /programs/datastructures/src/Heap.cpp | 6f907076ef0f3daa1fc70aaa8fb626871c3e3a67 | [] | no_license | HolySynnr/Repository | 8f2405886c16cba49cd710df3f3bfa8c5b8ec9ac | b97f5353beb99e872918bf85cb9ca9b675ae251a | refs/heads/master | 2021-01-11T16:29:53.105374 | 2015-05-28T18:59:25 | 2015-05-28T18:59:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 58 | cpp | #include "../inc/Heap.h"
int main(void) {
return 0;
}
| [
"rrangarajan.85@gmail.com"
] | rrangarajan.85@gmail.com |
8680c7742ede57355e5907173ac5908caa17efb4 | bf4d0c11c38a477f248276fa74ae6881a33df91f | /src/net/web_socket.h | a4449296cc26796645ccf5825a706c02ef928583 | [
"MIT"
] | permissive | shriveledDude/MaxestFramework | 41e86b51108e1fec9844c3b9de4e45bc7fcbae54 | 5495948d5fa9ad130ea14ed6baa1c68cc7835627 | refs/heads/master | 2020-04-07T16:54:00.639302 | 2018-11-09T16:34:08 | 2018-11-09T16:34:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,916 | h | // https://github.com/katzarsky/WebSocket
// http://stackoverflow.com/questions/8125507/how-can-i-send-and-receive-websocket-messages-on-the-server-side
// https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers
// http://lucumr.pocoo.org/2012/9/24/websockets-101/
// https://tools.ietf.org/html/rfc6455
#pragma once
#include "../essentials/types.h"
#include "../essentials/string.h"
namespace NMaxestFramework { namespace NNet { namespace NWebSocket
{
enum class EFrameType
{
Error = 0xFF00,
Incomplete = 0xFE00,
Opening = 0x3300,
Closing = 0x3400,
IncompleteText = 0x01,
IncompleteBinary = 0x02,
Text = 0x81,
Binary = 0x82,
Ping = 0x19,
Pong = 0x1A
};
void HandshakeExtractKeyAndProtocol(uint8* data, int dataSize, string& key, string& protocol);
string HandshakeConstructResponse(const string& hashedKey, const string& protocol);
vector<uint8> EncodeFrame(EFrameType frameType, const uint8* data, int dataSize);
vector<uint8> DecodeFrame(uint8* data, int dataSize, EFrameType* frameType = nullptr);
//
inline void HandshakeExtractKeyAndProtocol(uint8* data, int dataSize, string& key, string& protocol)
{
string data_string = NEssentials::ToString(data);
string webSocketKey = string("Sec-WebSocket-Key: ");
string webSocketProtocol = string("Sec-WebSocket-Protocol: ");
int webSocketKeyIndex = (int)(data_string.find(webSocketKey) + webSocketKey.length());
int webSocketProtocolIndex = (int)(data_string.find(webSocketProtocol) + webSocketProtocol.length());
key = protocol = "";
for (int i = webSocketKeyIndex; i < dataSize; i++)
{
if (data[i] == '\n' || data[i] == '\r')
break;
key += data[i];
}
for (int i = webSocketProtocolIndex; i < dataSize; i++)
{
if (data[i] == '\n' || data[i] == '\r')
break;
protocol += data[i];
}
}
inline string HandshakeConstructResponse(const string& hashedKey, const string& protocol)
{
// https://stackoverflow.com/questions/40498032/websocket-server-sending-text-frames-to-client
return
"HTTP/1.1 101 Switching Protocols" + NEssentials::NewLine +
"Upgrade: websocket" + NEssentials::NewLine +
"Connection: Upgrade" + NEssentials::NewLine +
"Sec-WebSocket-Accept: " + hashedKey + NEssentials::NewLine +
"Sec-WebSocket-Protocol: " + protocol + NEssentials::NewLine +
NEssentials::NewLine;
}
inline vector<uint8> EncodeFrame(EFrameType frameType, const uint8* data, int dataSize)
{
vector<uint8> outData;
outData.push_back((uint8)frameType);
if (dataSize <= 125)
{
outData.push_back((uint8)dataSize);
}
else if (dataSize <= 65535)
{
outData.push_back(126);
outData.push_back((dataSize >> 8) & 0xFF);
outData.push_back(dataSize & 0xFF);
}
else
{
outData.push_back(127);
for (int i = 3; i >= 0; i--)
outData.push_back(0);
for (int i = 3; i >= 0; i--)
outData.push_back((dataSize >> 8*i) & 0xFF);
}
int headerSize = (int)outData.size();
outData.resize(headerSize + dataSize);
memcpy(&outData[headerSize], data, dataSize);
return outData;
}
inline vector<uint8> DecodeFrame(uint8* data, int dataSize, EFrameType* frameType)
{
vector<uint8> outData;
if (dataSize < 3)
{
if (frameType)
*frameType = EFrameType::Incomplete;
return outData;
}
uint8 fin = (data[0] >> 7) & 0x01;
uint8 opcode = data[0] & 0x0F;
uint8 masked = (data[1] >> 7) & 0x01;
int payloadLen = data[1] & (~0x80);
int contentOffset = 2;
int contentSize = 0;
if (payloadLen <= 125)
{
contentSize = payloadLen;
}
else if (payloadLen == 126)
{
contentSize = data[2] + (data[3] << 8);
contentOffset += 2;
}
else if (payloadLen == 127)
{
contentSize = data[2] + (data[3] << 8);
contentOffset += 8;
}
if (dataSize < contentOffset + contentSize)
{
if (frameType) *frameType = EFrameType::Incomplete;
return outData;
}
if (masked)
{
uint mask = *((uint*)(data + contentOffset));
contentOffset += 4;
for (int i = 0; i < contentSize; i++)
data[contentOffset + i] = data[contentOffset + i] ^ ((uint8*)(&mask))[i % 4];
}
outData.resize(contentSize);
memcpy(&outData[0], data + contentOffset, contentSize);
if (frameType)
{
if (opcode == 0x0)
*frameType = (fin) ? EFrameType::Text : EFrameType::IncompleteText;
else if (opcode == 0x1)
*frameType = (fin) ? EFrameType::Text : EFrameType::IncompleteText;
else if (opcode == 0x2)
*frameType = (fin) ? EFrameType::Binary : EFrameType::IncompleteBinary;
else if (opcode == 0x9)
*frameType = EFrameType::Ping;
else if (opcode == 0xA)
*frameType = EFrameType::Pong;
else
*frameType = EFrameType::Error;
}
return outData;
}
} } }
| [
"maxest@gct-game.net"
] | maxest@gct-game.net |
5fa5f0853d4fadd97da0f8c7cde221cce6e4e2f8 | 605b238e45360b6522192954f244c40a199fd687 | /blasius_laminar_github/4.65/phi | a3d888294f7593880dc65b11b6ac20f8db6e960c | [] | no_license | Ahmetcansavas/laminar_BL_OPENFOAM | 335a5b69b9ef05ae331ed42161de67912b4992f6 | c0d2dc5fb2e30027ac23e3a3ec0fac6e549471af | refs/heads/master | 2021-05-18T22:32:54.491995 | 2020-04-05T20:28:05 | 2020-04-05T20:28:05 | 251,456,279 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 231,808 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "4.65";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
oriented oriented;
internalField nonuniform List<scalar>
19000
(
1.18804e-06
2.50802e-07
1.08832e-06
-3.46387e-07
1.25599e-06
5.02611e-07
1.1093e-06
1.39142e-06
1.01827e-06
-1.44713e-06
1.21369e-06
9.05469e-07
1.213e-06
1.10846e-06
1.14047e-06
7.17469e-07
1.18989e-06
5.60554e-08
1.14791e-06
-1.69934e-07
1.15555e-06
3.33615e-07
1.13273e-06
5.98739e-07
1.11673e-06
1.72272e-07
1.14818e-06
2.94842e-07
1.17057e-06
1.77559e-07
1.16873e-06
3.52494e-07
1.16908e-06
3.73342e-07
1.16033e-06
3.56412e-07
1.16217e-06
3.25866e-07
3.71902e-07
1.15927e-06
1.24428e-06
2.30779e-07
1.13698e-06
-2.39079e-07
1.31636e-06
3.23223e-07
1.18309e-06
1.52469e-06
1.0927e-06
-1.35673e-06
1.28074e-06
7.17425e-07
1.27575e-06
1.11345e-06
1.20699e-06
7.86224e-07
1.25882e-06
4.2307e-09
1.20932e-06
-1.20438e-07
1.21191e-06
3.31026e-07
1.19781e-06
6.12844e-07
1.17532e-06
1.94762e-07
1.21355e-06
2.56604e-07
1.22711e-06
1.64003e-07
1.23975e-06
3.39859e-07
1.21937e-06
3.93718e-07
1.2351e-06
3.40682e-07
1.20477e-06
3.562e-07
3.32463e-07
1.2442e-06
1.30329e-06
2.10276e-07
1.19046e-06
-1.26257e-07
1.37285e-06
1.40837e-07
1.2748e-06
1.62274e-06
1.17793e-06
-1.25987e-06
1.35055e-06
5.44807e-07
1.34855e-06
1.11546e-06
1.29103e-06
8.43742e-07
1.33489e-06
-3.96291e-08
1.28863e-06
-7.41832e-08
1.27315e-06
3.46509e-07
1.27895e-06
6.07045e-07
1.24128e-06
2.32434e-07
1.2853e-06
2.12584e-07
1.28796e-06
1.61338e-07
1.30906e-06
3.18765e-07
1.28262e-06
4.20153e-07
1.29276e-06
3.30546e-07
1.27521e-06
3.73752e-07
3.2499e-07
1.28268e-06
1.36515e-06
1.89226e-07
1.24946e-06
-1.05656e-08
1.42878e-06
-3.84836e-08
1.37988e-06
1.67164e-06
1.27161e-06
-1.1516e-06
1.42206e-06
3.9436e-07
1.42708e-06
1.11044e-06
1.38403e-06
8.86791e-07
1.40993e-06
-6.5521e-08
1.37528e-06
-3.95413e-08
1.34272e-06
3.79077e-07
1.36159e-06
5.88168e-07
1.31779e-06
2.76232e-07
1.35229e-06
1.78084e-07
1.35526e-06
1.58371e-07
1.37116e-06
3.02861e-07
1.3548e-06
4.36516e-07
1.35249e-06
3.32859e-07
1.34605e-06
3.80191e-07
3.27547e-07
1.34349e-06
1.42943e-06
1.6815e-07
1.31704e-06
1.01827e-07
1.48406e-06
-2.05505e-07
1.48807e-06
1.66763e-06
1.36607e-06
-1.0296e-06
1.48849e-06
2.71937e-07
1.50533e-06
1.0936e-06
1.47595e-06
9.16166e-07
1.47638e-06
-6.59515e-08
1.45511e-06
-1.82688e-08
1.41992e-06
4.14267e-07
1.43895e-06
5.6914e-07
1.40133e-06
3.13853e-07
1.4184e-06
1.61015e-07
1.42498e-06
1.5179e-07
1.43601e-06
2.91834e-07
1.42984e-06
4.42679e-07
1.42326e-06
3.39443e-07
1.4189e-06
3.84554e-07
3.31988e-07
1.41446e-06
1.49559e-06
1.48232e-07
1.39499e-06
2.02432e-07
1.5389e-06
-3.49417e-07
1.58613e-06
1.6204e-06
1.45519e-06
-8.98656e-07
1.54607e-06
1.81052e-07
1.57777e-06
1.0619e-06
1.55901e-06
9.34917e-07
1.53347e-06
-4.04117e-08
1.52136e-06
-6.15215e-09
1.49964e-06
4.35986e-07
1.51304e-06
5.55744e-07
1.48508e-06
3.41803e-07
1.48691e-06
1.59192e-07
1.49295e-06
1.45743e-07
1.50368e-06
2.81113e-07
1.5056e-06
4.40756e-07
1.50061e-06
3.4443e-07
1.49751e-06
3.87656e-07
3.38036e-07
1.49146e-06
1.56366e-06
1.30784e-07
1.48223e-06
2.83867e-07
1.59389e-06
-4.61078e-07
1.6661e-06
1.5482e-06
1.53798e-06
-7.70536e-07
1.59709e-06
1.21941e-07
1.64155e-06
1.01744e-06
1.63118e-06
9.4528e-07
1.587e-06
3.77445e-09
1.57864e-06
2.20957e-09
1.57546e-06
4.39158e-07
1.58536e-06
5.45848e-07
1.56467e-06
3.62498e-07
1.55675e-06
1.67113e-07
1.55857e-06
1.43921e-07
1.57015e-06
2.69533e-07
1.57877e-06
4.32129e-07
1.57755e-06
3.45651e-07
1.57742e-06
3.87789e-07
3.44982e-07
1.57047e-06
1.63441e-06
1.16505e-07
1.57541e-06
3.42866e-07
1.65042e-06
-5.36092e-07
1.72971e-06
1.46891e-06
1.61749e-06
-6.58309e-07
1.64805e-06
9.13757e-08
1.69813e-06
9.6737e-07
1.69561e-06
9.47791e-07
1.6444e-06
5.49911e-08
1.63611e-06
1.04943e-08
1.64503e-06
4.30244e-07
1.65532e-06
5.35558e-07
1.64013e-06
3.77686e-07
1.62737e-06
1.79869e-07
1.62415e-06
1.47144e-07
1.63476e-06
2.5892e-07
1.64749e-06
4.19401e-07
1.64962e-06
3.43521e-07
1.65321e-06
3.84198e-07
3.51446e-07
1.64675e-06
1.70888e-06
1.05197e-07
1.6711e-06
3.80646e-07
1.71103e-06
-5.76025e-07
1.7855e-06
1.39444e-06
1.69708e-06
-5.6989e-07
1.70541e-06
8.30472e-08
1.75298e-06
9.19795e-07
1.75808e-06
9.427e-07
1.71015e-06
1.0292e-07
1.70042e-06
2.02178e-08
1.71124e-06
4.19428e-07
1.72344e-06
5.23359e-07
1.71395e-06
3.87178e-07
1.70024e-06
1.93576e-07
1.69317e-06
1.54218e-07
1.70065e-06
2.51437e-07
1.71427e-06
4.05782e-07
1.71784e-06
3.3995e-07
1.72438e-06
3.7766e-07
3.56323e-07
1.7195e-06
1.78777e-06
9.61506e-08
1.76732e-06
4.01095e-07
1.77859e-06
-5.87298e-07
1.84284e-06
1.33019e-06
1.77849e-06
-5.05538e-07
1.77275e-06
8.87934e-08
1.81297e-06
8.79575e-07
1.82437e-06
9.31301e-07
1.78491e-06
1.42377e-07
1.77361e-06
3.15181e-08
1.77926e-06
4.13777e-07
1.79253e-06
5.10087e-07
1.78915e-06
3.9056e-07
1.77733e-06
2.05395e-07
1.76856e-06
1.62992e-07
1.77205e-06
2.47942e-07
1.78434e-06
3.93494e-07
1.78742e-06
3.36873e-07
1.79524e-06
3.69841e-07
3.59243e-07
1.79232e-06
1.87116e-06
8.87438e-08
1.86361e-06
4.08638e-07
1.85485e-06
-5.78537e-07
1.90786e-06
1.27718e-06
1.86235e-06
-4.60026e-07
1.85056e-06
1.00582e-07
1.88295e-06
8.47181e-07
1.8984e-06
9.15854e-07
1.86733e-06
1.73447e-07
1.8548e-06
4.40468e-08
1.85334e-06
4.1524e-07
1.86633e-06
4.97095e-07
1.86861e-06
3.88275e-07
1.86013e-06
2.13882e-07
1.85179e-06
1.7133e-07
1.85189e-06
2.47839e-07
1.86212e-06
3.83264e-07
1.86368e-06
3.3531e-07
1.87113e-06
3.62393e-07
3.60517e-07
1.86986e-06
1.95885e-06
8.27282e-08
1.9605e-06
4.06992e-07
1.93981e-06
-5.57844e-07
1.98261e-06
1.23438e-06
1.94916e-06
-4.26572e-07
1.93747e-06
1.12269e-07
1.96424e-06
8.20414e-07
1.98143e-06
8.9866e-07
1.95586e-06
1.99018e-07
1.94253e-06
5.73796e-08
1.93564e-06
4.22122e-07
1.9477e-06
4.85035e-07
1.95448e-06
3.81504e-07
1.94934e-06
2.1902e-07
1.94281e-06
1.77854e-07
1.94081e-06
2.49848e-07
1.94921e-06
3.74855e-07
1.94917e-06
3.3535e-07
1.95515e-06
3.56416e-07
3.60738e-07
1.95493e-06
2.0508e-06
7.81204e-08
2.05888e-06
3.98908e-07
2.03227e-06
-5.31231e-07
2.06668e-06
1.19997e-06
2.0397e-06
-3.99596e-07
2.03161e-06
1.20364e-07
2.05531e-06
7.96715e-07
2.07267e-06
8.81297e-07
2.04961e-06
2.22083e-07
2.03595e-06
7.10382e-08
2.0266e-06
4.31471e-07
2.03779e-06
4.73842e-07
2.04764e-06
3.71658e-07
2.0449e-06
2.21762e-07
2.04062e-06
1.82134e-07
2.03773e-06
2.52737e-07
2.0448e-06
3.67784e-07
2.0436e-06
3.36547e-07
2.04765e-06
3.52365e-07
3.60426e-07
2.04796e-06
2.14717e-06
7.49541e-08
2.15963e-06
3.86447e-07
2.13082e-06
-5.02425e-07
2.15901e-06
1.17179e-06
2.13486e-06
-3.75448e-07
2.13139e-06
1.2383e-07
2.15371e-06
7.74398e-07
2.1706e-06
8.64407e-07
2.14828e-06
2.44398e-07
2.13483e-06
8.44933e-08
2.12555e-06
4.40745e-07
2.13615e-06
4.63249e-07
2.14781e-06
3.59993e-07
2.14616e-06
2.23419e-07
2.14384e-06
1.84451e-07
2.14098e-06
2.55591e-07
2.14709e-06
3.61682e-07
2.14539e-06
3.38245e-07
2.14758e-06
3.50173e-07
3.59893e-07
2.14811e-06
2.2483e-06
7.31381e-08
2.26344e-06
3.71311e-07
2.23448e-06
-4.73469e-07
2.25884e-06
1.14743e-06
2.23535e-06
-3.51957e-07
2.23581e-06
1.23363e-07
2.25748e-06
7.52725e-07
2.27398e-06
8.4791e-07
2.25191e-06
2.66474e-07
2.23912e-06
9.72826e-08
2.23143e-06
4.48431e-07
2.24153e-06
4.53153e-07
2.25412e-06
3.47402e-07
2.25233e-06
2.2521e-07
2.25126e-06
1.85515e-07
2.24908e-06
2.57773e-07
2.25443e-06
3.56333e-07
2.25294e-06
3.39737e-07
2.25371e-06
3.49406e-07
3.5927e-07
2.25433e-06
2.35454e-06
7.24766e-08
2.37088e-06
3.54968e-07
2.34282e-06
-4.45411e-07
2.36573e-06
1.12453e-06
2.34164e-06
-3.27872e-07
2.34448e-06
1.20522e-07
2.36567e-06
7.31535e-07
2.38216e-06
8.31421e-07
2.36053e-06
2.88107e-07
2.34871e-06
1.09099e-07
2.3432e-06
4.53941e-07
2.35271e-06
4.43646e-07
2.36574e-06
3.34367e-07
2.36293e-06
2.28028e-07
2.36216e-06
1.86279e-07
2.36104e-06
2.58897e-07
2.36576e-06
3.5161e-07
2.36511e-06
3.40386e-07
2.36514e-06
3.49382e-07
3.58615e-07
2.36579e-06
2.46613e-06
7.27399e-08
2.48248e-06
3.38616e-07
2.4558e-06
-4.18729e-07
2.47927e-06
1.10106e-06
2.454e-06
-3.02599e-07
2.45757e-06
1.16956e-07
2.47813e-06
7.10968e-07
2.4949e-06
8.14653e-07
2.4742e-06
3.08814e-07
2.46356e-06
1.19737e-07
2.46025e-06
4.57251e-07
2.46897e-06
4.3492e-07
2.48228e-06
3.21062e-07
2.47794e-06
2.32372e-07
2.47642e-06
1.87794e-07
2.47647e-06
2.58852e-07
2.48065e-06
3.47428e-07
2.48127e-06
3.39766e-07
2.48135e-06
3.49304e-07
3.57961e-07
2.482e-06
2.58335e-06
7.36802e-08
2.59885e-06
3.23124e-07
2.57361e-06
-3.93493e-07
2.59908e-06
1.07559e-06
2.57254e-06
-2.76066e-07
2.57554e-06
1.13959e-07
2.59519e-06
6.91316e-07
2.61225e-06
7.97597e-07
2.59298e-06
3.28083e-07
2.58372e-06
1.28999e-07
2.58243e-06
4.58543e-07
2.59014e-06
4.27205e-07
2.60366e-06
3.07545e-07
2.59767e-06
2.38355e-07
2.59448e-06
1.90992e-07
2.59554e-06
2.57785e-07
2.59924e-06
3.43726e-07
2.60124e-06
3.37774e-07
2.60216e-06
3.48385e-07
3.57285e-07
2.60283e-06
2.7065e-06
7.50065e-08
2.72061e-06
3.0902e-07
2.69655e-06
-3.6944e-07
2.72485e-06
1.0473e-06
2.6973e-06
-2.4852e-07
2.6989e-06
1.12359e-07
2.71735e-06
6.72871e-07
2.73451e-06
7.80435e-07
2.71707e-06
3.45521e-07
2.70933e-06
1.36733e-07
2.70987e-06
4.58011e-07
2.71635e-06
4.20723e-07
2.72997e-06
2.93924e-07
2.72257e-06
2.45751e-07
2.71712e-06
1.96447e-07
2.7189e-06
2.56004e-07
2.72217e-06
3.40452e-07
2.7253e-06
3.34653e-07
2.72767e-06
3.46006e-07
3.56492e-07
2.72847e-06
2.83588e-06
7.63979e-08
2.84836e-06
2.96536e-07
2.82504e-06
-3.46121e-07
2.8565e-06
1.01584e-06
2.82827e-06
-2.20286e-07
2.82802e-06
1.12601e-07
2.84512e-06
6.55775e-07
2.86224e-06
7.63312e-07
2.84679e-06
3.60974e-07
2.84054e-06
1.42979e-07
2.84276e-06
4.55797e-07
2.84785e-06
4.1563e-07
2.86139e-06
2.80388e-07
2.85308e-06
2.54056e-07
2.8453e-06
2.04231e-07
2.84743e-06
2.53876e-07
2.85033e-06
3.3755e-07
2.85403e-06
3.30947e-07
2.85819e-06
3.41852e-07
3.55423e-07
2.85926e-06
2.97172e-06
7.75717e-08
2.98259e-06
2.8567e-07
2.95959e-06
-3.23123e-07
2.99411e-06
9.8132e-07
2.96544e-06
-1.91615e-07
2.96322e-06
1.14816e-07
2.97906e-06
6.39939e-07
2.99613e-06
7.46244e-07
2.98255e-06
3.74548e-07
2.9775e-06
1.48035e-07
2.9813e-06
4.51994e-07
2.98496e-06
4.11966e-07
2.99816e-06
2.67189e-07
2.98964e-06
2.62574e-07
2.97993e-06
2.13946e-07
2.98205e-06
2.51759e-07
2.98463e-06
3.34972e-07
2.98821e-06
3.27358e-07
2.99409e-06
3.35979e-07
3.53877e-07
2.99563e-06
3.11423e-06
7.83458e-08
3.12362e-06
2.76283e-07
3.10075e-06
-3.00251e-07
3.13787e-06
9.44198e-07
3.1089e-06
-1.62648e-07
3.10484e-06
1.1888e-07
3.1197e-06
6.25074e-07
3.13678e-06
7.29171e-07
3.12477e-06
3.86548e-07
3.12043e-06
1.52378e-07
3.12581e-06
4.46615e-07
3.12811e-06
4.09664e-07
3.14068e-06
2.5462e-07
3.1327e-06
2.70555e-07
3.12176e-06
2.24884e-07
3.12354e-06
2.4998e-07
3.12588e-06
3.32632e-07
3.12865e-06
3.24584e-07
3.13582e-06
3.28816e-07
3.51602e-07
3.13809e-06
3.26361e-06
7.86439e-08
3.2717e-06
2.68197e-07
3.24902e-06
-2.77574e-07
3.28808e-06
9.0514e-07
3.25888e-06
-1.33453e-07
3.25325e-06
1.24509e-07
3.26752e-06
6.10814e-07
3.28466e-06
7.1203e-07
3.27384e-06
3.97365e-07
3.26972e-06
1.56498e-07
3.27678e-06
4.39558e-07
3.27784e-06
4.08604e-07
3.28942e-06
2.43038e-07
3.28263e-06
2.77344e-07
3.27126e-06
2.36255e-07
3.27243e-06
2.48807e-07
3.27469e-06
3.30378e-07
3.27614e-06
3.23132e-07
3.28388e-06
3.21071e-07
3.48289e-07
3.2872e-06
3.42012e-06
7.8451e-08
3.42705e-06
2.61271e-07
3.40482e-06
-2.55347e-07
3.44512e-06
8.64843e-07
3.41575e-06
-1.0408e-07
3.40885e-06
1.31412e-07
3.42283e-06
5.96829e-07
3.4401e-06
6.94757e-07
3.43011e-06
4.07355e-07
3.42582e-06
1.60796e-07
3.43473e-06
4.30641e-07
3.43469e-06
4.08652e-07
3.44488e-06
2.32847e-07
3.43973e-06
2.82489e-07
3.42857e-06
2.47411e-07
3.42899e-06
2.48391e-07
3.43138e-06
3.27992e-07
3.43134e-06
3.23171e-07
3.43882e-06
3.13587e-07
3.43628e-07
3.44348e-06
3.5841e-06
7.77631e-08
3.58996e-06
2.55414e-07
3.56848e-06
-2.33869e-07
3.60942e-06
8.23904e-07
3.57996e-06
-7.46237e-08
3.57195e-06
1.39425e-07
3.58588e-06
5.82893e-07
3.60338e-06
6.77258e-07
3.594e-06
4.16741e-07
3.58923e-06
1.65567e-07
3.60015e-06
4.19718e-07
3.59913e-06
4.09672e-07
3.60752e-06
2.24452e-07
3.60424e-06
2.85774e-07
3.59369e-06
2.57957e-07
3.5933e-06
2.48785e-07
3.59605e-06
3.25242e-07
3.59478e-06
3.24441e-07
3.60118e-06
3.07185e-07
3.37365e-07
3.60744e-06
3.75591e-06
7.65622e-08
3.76077e-06
2.50551e-07
3.74026e-06
-2.13358e-07
3.78136e-06
7.82805e-07
3.75202e-06
-4.52855e-08
3.74289e-06
1.48558e-07
3.75688e-06
5.689e-07
3.77474e-06
6.59394e-07
3.76591e-06
4.25574e-07
3.76045e-06
1.71029e-07
3.77335e-06
4.06821e-07
3.77152e-06
4.11501e-07
3.77779e-06
2.18181e-07
3.77637e-06
2.87189e-07
3.7666e-06
2.67732e-07
3.76539e-06
2.49991e-07
3.76873e-06
3.21898e-07
3.7668e-06
3.26378e-07
3.77155e-06
3.02436e-07
3.29473e-07
3.77944e-06
3.93593e-06
7.48177e-08
3.93991e-06
2.4657e-07
3.92044e-06
-1.9388e-07
3.96128e-06
7.41956e-07
3.93241e-06
-1.64105e-08
3.92204e-06
1.5893e-07
3.93609e-06
5.54844e-07
3.95447e-06
6.41013e-07
3.94629e-06
4.33755e-07
3.93997e-06
1.77358e-07
3.95456e-06
3.92227e-07
3.95214e-06
4.13924e-07
3.95605e-06
2.1427e-07
3.9564e-06
2.86836e-07
3.94739e-06
2.76741e-07
3.9454e-06
2.51982e-07
3.94951e-06
3.17791e-07
3.94761e-06
3.2827e-07
3.95049e-06
2.99562e-07
3.20226e-07
3.95974e-06
4.12457e-06
7.24987e-08
4.12785e-06
2.43294e-07
4.1093e-06
-1.75337e-07
4.1495e-06
7.0176e-07
4.12157e-06
1.15206e-08
4.10984e-06
1.70663e-07
4.12389e-06
5.40785e-07
4.14292e-06
6.21989e-07
4.13557e-06
4.41103e-07
4.12823e-06
1.84696e-07
4.14402e-06
3.76436e-07
4.1413e-06
4.1665e-07
4.1427e-06
2.12866e-07
4.14468e-06
2.84856e-07
4.1364e-06
2.85021e-07
4.13362e-06
2.5476e-07
4.13858e-06
3.12834e-07
4.13742e-06
3.29432e-07
4.13858e-06
2.98397e-07
3.10234e-07
4.14857e-06
4.32222e-06
6.95855e-08
4.32501e-06
2.405e-07
4.30719e-06
-1.57522e-07
4.34632e-06
6.62636e-07
4.31988e-06
3.79532e-08
4.30678e-06
1.83765e-07
4.32074e-06
5.26823e-07
4.34048e-06
6.02256e-07
4.33412e-06
4.47464e-07
4.32566e-06
1.9315e-07
4.34204e-06
3.60058e-07
4.33938e-06
4.19307e-07
4.33819e-06
2.14057e-07
4.34165e-06
2.81401e-07
4.33411e-06
2.92557e-07
4.33053e-06
2.5834e-07
4.3363e-06
3.07067e-07
4.33643e-06
3.29297e-07
4.33634e-06
2.9849e-07
3.00327e-07
4.34625e-06
4.52929e-06
6.60712e-08
4.53181e-06
2.3798e-07
4.51448e-06
-1.40193e-07
4.55212e-06
6.24996e-07
4.52771e-06
6.2364e-08
4.5134e-06
1.98072e-07
4.52714e-06
5.13084e-07
4.54759e-06
5.81812e-07
4.54229e-06
4.52756e-07
4.53268e-06
2.02766e-07
4.54904e-06
3.43696e-07
4.54687e-06
4.21478e-07
4.54306e-06
2.17863e-07
4.5478e-06
2.7666e-07
4.54115e-06
2.99211e-07
4.53673e-06
2.6276e-07
4.54312e-06
3.00682e-07
4.54494e-06
3.2747e-07
4.54423e-06
2.99202e-07
2.91384e-07
4.55317e-06
4.74623e-06
6.19588e-08
4.74861e-06
2.35596e-07
4.73158e-06
-1.23163e-07
4.7674e-06
5.8918e-07
4.74537e-06
8.43873e-08
4.73023e-06
2.13217e-07
4.74359e-06
4.9972e-07
4.76468e-06
5.60724e-07
4.76046e-06
4.56976e-07
4.74971e-06
2.1352e-07
4.76554e-06
3.27858e-07
4.76427e-06
4.22753e-07
4.75793e-06
2.24203e-07
4.76367e-06
2.70923e-07
4.7582e-06
3.04682e-07
4.75286e-06
2.68097e-07
4.75954e-06
2.94e-07
4.76326e-06
3.23751e-07
4.76259e-06
2.99871e-07
2.8401e-07
4.76996e-06
4.9735e-06
5.72576e-08
4.97577e-06
2.33321e-07
4.95897e-06
-1.06356e-07
4.99274e-06
5.55403e-07
4.97323e-06
1.03897e-07
4.95777e-06
2.28679e-07
4.97058e-06
4.86915e-07
4.99219e-06
5.39106e-07
4.98903e-06
4.60142e-07
4.97722e-06
2.2533e-07
4.99215e-06
3.12926e-07
4.99213e-06
4.22778e-07
4.98345e-06
2.32876e-07
4.98975e-06
2.64622e-07
4.9859e-06
3.08541e-07
4.97957e-06
2.74426e-07
4.9861e-06
2.87466e-07
4.99172e-06
3.18135e-07
4.99175e-06
2.99833e-07
2.78445e-07
4.99732e-06
5.21159e-06
5.19847e-08
5.21369e-06
2.31219e-07
5.19714e-06
-8.98003e-08
5.22882e-06
5.23718e-07
5.21169e-06
1.2103e-07
5.19654e-06
2.4383e-07
5.20855e-06
4.74901e-07
5.23053e-06
5.17124e-07
5.22845e-06
4.62222e-07
5.21572e-06
2.38067e-07
5.22948e-06
2.99159e-07
5.23096e-06
4.213e-07
5.2203e-06
2.43538e-07
5.22657e-06
2.58353e-07
5.22483e-06
3.1028e-07
5.21754e-06
2.8171e-07
5.22341e-06
2.816e-07
5.23073e-06
3.1082e-07
5.23196e-06
2.98602e-07
2.74434e-07
5.23597e-06
5.461e-06
4.61719e-08
5.46283e-06
2.29387e-07
5.44662e-06
-7.35898e-08
5.47631e-06
4.94029e-07
5.4612e-06
1.36141e-07
5.44704e-06
2.57989e-07
5.458e-06
4.63941e-07
5.48013e-06
4.95e-07
5.47924e-06
4.63113e-07
5.46573e-06
2.51573e-07
5.47816e-06
2.86725e-07
5.4813e-06
4.18168e-07
5.4691e-06
2.55735e-07
5.47465e-06
2.52806e-07
5.47546e-06
3.0947e-07
5.4675e-06
2.8967e-07
5.47217e-06
2.76922e-07
5.48083e-06
3.02168e-07
5.48351e-06
2.95918e-07
2.71356e-07
5.48659e-06
5.72226e-06
3.98727e-08
5.72374e-06
2.279e-07
5.70798e-06
-5.78287e-08
5.7359e-06
4.6611e-07
5.72229e-06
1.49748e-07
5.7098e-06
2.7048e-07
5.71946e-06
4.54283e-07
5.74143e-06
4.73028e-07
5.74191e-06
4.62634e-07
5.72782e-06
2.65664e-07
5.7388e-06
2.75745e-07
5.74366e-06
4.13309e-07
5.73045e-06
2.68945e-07
5.73459e-06
2.48662e-07
5.73814e-06
3.05921e-07
5.7301e-06
2.97717e-07
5.73307e-06
2.73948e-07
5.74263e-06
2.92608e-07
5.74681e-06
2.91741e-07
2.68526e-07
5.74964e-06
5.9959e-06
3.31655e-08
5.99704e-06
2.26762e-07
5.98177e-06
-4.25654e-08
6.00825e-06
4.39637e-07
5.99556e-06
1.62436e-07
5.9852e-06
2.80839e-07
5.9935e-06
4.45983e-07
6.01497e-06
4.51561e-07
6.01703e-06
4.60575e-07
6.00257e-06
2.80115e-07
6.01198e-06
2.66342e-07
6.01856e-06
4.06727e-07
6.00493e-06
2.8257e-07
6.00712e-06
2.46474e-07
6.01323e-06
2.99809e-07
6.00596e-06
3.04991e-07
6.00681e-06
2.73094e-07
6.01676e-06
2.82661e-07
6.02243e-06
2.86077e-07
2.65502e-07
6.02545e-06
6.2825e-06
2.61521e-08
6.28337e-06
2.25892e-07
6.26856e-06
-2.77569e-08
6.294e-06
4.142e-07
6.28167e-06
1.74761e-07
6.27362e-06
2.88893e-07
6.28074e-06
4.38866e-07
6.30131e-06
4.30986e-07
6.30511e-06
4.56779e-07
6.29059e-06
2.94635e-07
6.2983e-06
2.58627e-07
6.30652e-06
3.98516e-07
6.29312e-06
2.95971e-07
6.293e-06
2.46591e-07
6.30114e-06
2.91669e-07
6.29557e-06
3.10563e-07
6.29421e-06
2.74453e-07
6.30385e-06
2.73017e-07
6.31101e-06
2.78924e-07
2.62084e-07
6.31442e-06
6.58267e-06
1.89518e-08
6.58343e-06
2.25128e-07
6.56893e-06
-1.32483e-08
6.59379e-06
3.89333e-07
6.58144e-06
1.87113e-07
6.57554e-06
2.94797e-07
6.58181e-06
4.32591e-07
6.60113e-06
4.11666e-07
6.60674e-06
4.51173e-07
6.59248e-06
3.08896e-07
6.59839e-06
2.52716e-07
6.60808e-06
3.88819e-07
6.59556e-06
3.08498e-07
6.59306e-06
2.4909e-07
6.60239e-06
2.8234e-07
6.5994e-06
3.13554e-07
6.5961e-06
2.77751e-07
6.60454e-06
2.64578e-07
6.61318e-06
2.70281e-07
2.58169e-07
6.6171e-06
6.89704e-06
1.17005e-08
6.89793e-06
2.24235e-07
6.88347e-06
1.21161e-09
6.90826e-06
3.64547e-07
6.8957e-06
1.99673e-07
6.89151e-06
2.98982e-07
6.89745e-06
4.26659e-07
6.91513e-06
3.93985e-07
6.9225e-06
4.43803e-07
6.90888e-06
3.22513e-07
6.91288e-06
2.48715e-07
6.92384e-06
3.77861e-07
6.91283e-06
3.19504e-07
6.90809e-06
2.53839e-07
6.91764e-06
2.72782e-07
6.91775e-06
3.13449e-07
6.91327e-06
2.82233e-07
6.91962e-06
2.58226e-07
6.92948e-06
2.6042e-07
2.53458e-07
6.93419e-06
7.22629e-06
4.54605e-09
7.2276e-06
2.22928e-07
7.21288e-06
1.59249e-08
7.23798e-06
3.39456e-07
7.22532e-06
2.12334e-07
7.22218e-06
3.02123e-07
7.22832e-06
4.20517e-07
7.2441e-06
3.782e-07
7.25302e-06
4.34886e-07
7.24044e-06
3.35087e-07
7.24252e-06
2.46641e-07
7.25445e-06
3.65931e-07
7.24555e-06
3.28406e-07
7.23892e-06
2.60466e-07
7.24771e-06
2.63988e-07
7.25089e-06
3.10273e-07
7.24625e-06
2.86869e-07
7.24996e-06
2.54522e-07
7.26031e-06
2.50068e-07
2.47325e-07
7.26644e-06
7.57112e-06
-2.35085e-09
7.57317e-06
2.20876e-07
7.55791e-06
3.119e-08
7.58337e-06
3.14e-07
7.57107e-06
2.24628e-07
7.56831e-06
3.04885e-07
7.57504e-06
4.13785e-07
7.58886e-06
3.64384e-07
7.59901e-06
4.24735e-07
7.58782e-06
3.4627e-07
7.58806e-06
2.46402e-07
7.60061e-06
3.53381e-07
7.59425e-06
3.34764e-07
7.58633e-06
2.68388e-07
7.59355e-06
2.56767e-07
7.5995e-06
3.04326e-07
7.59557e-06
2.90798e-07
7.59635e-06
2.53746e-07
7.60595e-06
2.4047e-07
2.39142e-07
7.61413e-06
7.93228e-06
-8.82059e-09
7.93542e-06
2.17732e-07
7.9194e-06
4.7216e-08
7.945e-06
2.88404e-07
7.93375e-06
2.35875e-07
7.93071e-06
3.07919e-07
7.93818e-06
4.0632e-07
7.95025e-06
3.52314e-07
7.96124e-06
4.13742e-07
7.95173e-06
3.55784e-07
7.9503e-06
2.47826e-07
7.96316e-06
3.40529e-07
7.95964e-06
3.38281e-07
7.95115e-06
2.76872e-07
7.95638e-06
2.5154e-07
7.96442e-06
2.96286e-07
7.96185e-06
2.93367e-07
7.95971e-06
2.55887e-07
7.96621e-06
2.33973e-07
2.28278e-07
7.97707e-06
8.31054e-06
-1.4684e-08
8.31514e-06
2.13141e-07
8.29825e-06
6.4097e-08
8.32352e-06
2.63142e-07
8.31405e-06
2.45346e-07
8.3103e-06
3.1166e-07
8.31843e-06
3.98192e-07
8.32909e-06
3.4166e-07
8.3406e-06
4.02232e-07
8.33287e-06
3.63512e-07
8.33003e-06
2.50668e-07
8.34279e-06
3.27769e-07
8.34226e-06
3.38812e-07
8.33413e-06
2.84996e-07
8.33777e-06
2.47902e-07
8.34808e-06
2.85981e-07
8.34995e-06
2.91489e-07
8.34954e-06
2.56296e-07
8.35769e-06
2.25827e-07
2.17874e-07
8.36809e-06
8.70675e-06
-1.97745e-08
8.71306e-06
2.06829e-07
8.69546e-06
8.16998e-08
8.71963e-06
2.38976e-07
8.71279e-06
2.5218e-07
8.70794e-06
3.16513e-07
8.71651e-06
3.89618e-07
8.72617e-06
3.32009e-07
8.73801e-06
3.90391e-07
8.73203e-06
3.69486e-07
8.72814e-06
2.54561e-07
8.7405e-06
3.15412e-07
8.74275e-06
3.36563e-07
8.73598e-06
2.91761e-07
8.74036e-06
2.43526e-07
8.75446e-06
2.71879e-07
8.76375e-06
2.82197e-07
8.76525e-06
2.54803e-07
8.76911e-06
2.21959e-07
2.11783e-07
8.77521e-06
9.1218e-06
-2.39507e-08
9.13e-06
1.98625e-07
9.11192e-06
9.97751e-08
9.13397e-06
2.16931e-07
9.13064e-06
2.55511e-07
9.12495e-06
3.22205e-07
9.1332e-06
3.81364e-07
9.14233e-06
3.22879e-07
9.15429e-06
3.78427e-07
9.15012e-06
3.73662e-07
9.1454e-06
2.59282e-07
9.15728e-06
3.03529e-07
9.16224e-06
3.31604e-07
9.15674e-06
2.97255e-07
9.15987e-06
2.40404e-07
9.1738e-06
2.57949e-07
9.18501e-06
2.70987e-07
9.18785e-06
2.51958e-07
9.19033e-06
2.19479e-07
2.07362e-07
9.19475e-06
9.55658e-06
-2.70734e-08
9.56675e-06
1.88458e-07
9.54864e-06
1.1788e-07
9.5676e-06
1.97976e-07
9.56822e-06
2.54886e-07
9.56215e-06
3.28275e-07
9.56935e-06
3.74168e-07
9.57834e-06
3.13885e-07
9.59045e-06
3.66321e-07
9.58808e-06
3.76033e-07
9.58277e-06
2.64589e-07
9.59431e-06
2.91987e-07
9.60238e-06
3.23536e-07
9.59733e-06
3.02307e-07
9.59405e-06
2.43684e-07
9.60058e-06
2.51421e-07
9.60413e-06
2.67437e-07
9.59987e-06
2.56212e-07
9.59931e-06
2.20041e-07
1.95962e-07
9.61071e-06
1.00121e-05
-2.90759e-08
1.00241e-05
1.76485e-07
1.00066e-05
1.35409e-07
1.00215e-05
1.83096e-07
1.00264e-05
2.49995e-07
1.00208e-05
3.33872e-07
1.00263e-05
3.68611e-07
1.00348e-05
3.05416e-07
1.00474e-05
3.53659e-07
1.00468e-05
3.76639e-07
1.00413e-05
2.70159e-07
1.0051e-05
2.82241e-07
1.00593e-05
3.15232e-07
1.00571e-05
3.04509e-07
1.00586e-05
2.42195e-07
1.00728e-05
2.37272e-07
1.00884e-05
2.51783e-07
1.0097e-05
2.47589e-07
1.00985e-05
2.18586e-07
1.9892e-07
1.00955e-05
1.04895e-05
-2.98906e-08
1.0503e-05
1.62931e-07
1.04867e-05
1.51714e-07
1.04971e-05
1.72659e-07
1.05057e-05
2.41439e-07
1.05017e-05
3.37825e-07
1.05049e-05
3.65406e-07
1.05127e-05
2.9766e-07
1.0526e-05
3.40331e-07
1.05274e-05
3.75292e-07
1.05214e-05
2.76173e-07
1.05299e-05
2.73672e-07
1.05404e-05
3.04774e-07
1.05391e-05
3.05808e-07
1.05336e-05
2.47658e-07
1.05372e-05
2.33742e-07
1.05447e-05
2.44265e-07
1.05454e-05
2.46889e-07
1.05454e-05
2.18566e-07
1.92993e-07
1.05513e-05
1.09897e-05
-2.95651e-08
1.10044e-05
1.48255e-07
1.099e-05
1.66081e-07
1.09959e-05
1.6678e-07
1.10071e-05
2.30203e-07
1.10062e-05
3.38759e-07
1.1007e-05
3.64623e-07
1.10131e-05
2.9155e-07
1.10269e-05
3.26456e-07
1.10303e-05
3.71894e-07
1.1024e-05
2.8254e-07
1.10303e-05
2.67373e-07
1.10402e-05
2.94812e-07
1.104e-05
3.06034e-07
1.10355e-05
2.52219e-07
1.10379e-05
2.31271e-07
1.10472e-05
2.34977e-07
1.10522e-05
2.41873e-07
1.10539e-05
2.16921e-07
1.89416e-07
1.10575e-05
1.1514e-05
-2.81875e-08
1.15292e-05
1.33005e-07
1.15176e-05
1.77708e-07
1.15192e-05
1.65186e-07
1.15317e-05
2.17715e-07
1.15345e-05
3.35909e-07
1.15336e-05
3.65584e-07
1.15371e-05
2.88035e-07
1.15513e-05
3.12211e-07
1.15569e-05
3.66364e-07
1.15505e-05
2.8895e-07
1.15535e-05
2.6437e-07
1.15639e-05
2.8439e-07
1.15666e-05
3.03296e-07
1.15634e-05
2.554e-07
1.15645e-05
2.30224e-07
1.15736e-05
2.25828e-07
1.15816e-05
2.33943e-07
1.15837e-05
2.14757e-07
1.86879e-07
1.15863e-05
1.20636e-05
-2.59366e-08
1.20788e-05
1.1778e-07
1.20704e-05
1.86098e-07
1.20684e-05
1.67167e-07
1.20806e-05
2.055e-07
1.2088e-05
3.28574e-07
1.20863e-05
3.67267e-07
1.20866e-05
2.87741e-07
1.21003e-05
2.98529e-07
1.21081e-05
3.58518e-07
1.21025e-05
2.94533e-07
1.21031e-05
2.63766e-07
1.21136e-05
2.73942e-07
1.2119e-05
2.97895e-07
1.21175e-05
2.56918e-07
1.21177e-05
2.29949e-07
1.21255e-05
2.1807e-07
1.21347e-05
2.24731e-07
1.21382e-05
2.11288e-07
1.84768e-07
1.21403e-05
1.26397e-05
-2.30513e-08
1.26543e-05
1.03219e-07
1.26496e-05
1.90797e-07
1.26449e-05
1.71871e-07
1.26555e-05
1.94902e-07
1.26669e-05
3.17182e-07
1.26659e-05
3.68196e-07
1.26632e-05
2.90476e-07
1.26753e-05
2.86464e-07
1.26854e-05
3.48365e-07
1.26817e-05
2.98211e-07
1.26807e-05
2.64819e-07
1.26902e-05
2.64457e-07
1.26976e-05
2.90468e-07
1.26978e-05
2.56713e-07
1.26981e-05
2.29675e-07
1.27039e-05
2.12212e-07
1.27135e-05
2.15157e-07
1.27189e-05
2.0592e-07
1.82755e-07
1.27209e-05
1.32437e-05
-1.98298e-08
1.32571e-05
8.98564e-08
1.32561e-05
1.9179e-07
1.32497e-05
1.78242e-07
1.32574e-05
1.87186e-07
1.3272e-05
3.0259e-07
1.32739e-05
3.66364e-07
1.32688e-05
2.95481e-07
1.32779e-05
2.77451e-07
1.32898e-05
3.36457e-07
1.32886e-05
2.99371e-07
1.32869e-05
2.66527e-07
1.32948e-05
2.56575e-07
1.33036e-05
2.81696e-07
1.33057e-05
2.54595e-07
1.33065e-05
2.28816e-07
1.33109e-05
2.07845e-07
1.33197e-05
2.06338e-07
1.33268e-05
1.98852e-07
1.80388e-07
1.33292e-05
1.38769e-05
-1.6561e-08
1.38885e-05
7.82152e-08
1.38911e-05
1.89178e-07
1.38842e-05
1.85158e-07
1.38884e-05
1.83053e-07
1.39049e-05
2.86039e-07
1.39108e-05
3.60491e-07
1.39045e-05
3.01756e-07
1.39101e-05
2.7186e-07
1.39228e-05
3.23744e-07
1.39244e-05
2.97778e-07
1.39229e-05
2.68008e-07
1.39291e-05
2.50362e-07
1.39385e-05
2.72313e-07
1.39422e-05
2.50895e-07
1.39438e-05
2.27205e-07
1.39475e-05
2.04215e-07
1.39549e-05
1.98885e-07
1.39629e-05
1.90851e-07
1.76831e-07
1.39665e-05
1.45406e-05
-1.35447e-08
1.45501e-05
6.87273e-08
1.45559e-05
1.83436e-07
1.45495e-05
1.91582e-07
1.455e-05
1.8251e-07
1.45672e-05
2.68874e-07
1.45777e-05
3.49977e-07
1.45715e-05
3.07887e-07
1.45739e-05
2.69481e-07
1.45861e-05
3.11589e-07
1.45902e-05
2.93673e-07
1.45895e-05
2.68702e-07
1.45943e-05
2.45514e-07
1.46038e-05
2.62827e-07
1.46089e-05
2.45811e-07
1.46113e-05
2.24763e-07
1.4615e-05
2.00557e-07
1.46212e-05
1.92706e-07
1.4629e-05
1.82993e-07
1.71808e-07
1.46341e-05
1.52363e-05
-1.10089e-08
1.52434e-05
6.1683e-08
1.52516e-05
1.7525e-07
1.52465e-05
1.96612e-07
1.52441e-05
1.84953e-07
1.52606e-05
2.52369e-07
1.5275e-05
3.35608e-07
1.52707e-05
3.12209e-07
1.52704e-05
2.69708e-07
1.52812e-05
3.00818e-07
1.52874e-05
2.87486e-07
1.52881e-05
2.68e-07
1.52921e-05
2.41497e-07
1.53012e-05
2.53779e-07
1.53074e-05
2.39618e-07
1.53105e-05
2.2158e-07
1.53143e-05
1.96831e-07
1.53198e-05
1.87156e-07
1.53267e-05
1.76089e-07
1.65651e-07
1.53329e-05
1.59654e-05
-9.09099e-09
1.597e-05
5.70564e-08
1.59797e-05
1.65597e-07
1.59767e-05
1.99579e-07
1.59725e-05
1.89183e-07
1.59865e-05
2.38319e-07
1.60037e-05
3.18482e-07
1.60028e-05
3.13111e-07
1.60011e-05
2.71376e-07
1.60102e-05
2.91744e-07
1.60176e-05
2.80087e-07
1.60199e-05
2.65665e-07
1.60234e-05
2.37963e-07
1.60319e-05
2.4536e-07
1.60389e-05
2.32616e-07
1.60429e-05
2.17546e-07
1.60467e-05
1.93061e-07
1.60522e-05
1.81643e-07
1.60583e-05
1.69964e-07
1.59267e-07
1.60647e-05
1.67293e-05
-7.8062e-09
1.67318e-05
5.45324e-08
1.6742e-05
1.5545e-07
1.67414e-05
2.0017e-07
1.67362e-05
1.94346e-07
1.67461e-05
2.28466e-07
1.67652e-05
2.99414e-07
1.67684e-05
3.09841e-07
1.67671e-05
2.72667e-07
1.67744e-05
2.84451e-07
1.67824e-05
2.72154e-07
1.67863e-05
2.6171e-07
1.679e-05
2.34319e-07
1.67978e-05
2.37526e-07
1.68052e-05
2.25158e-07
1.68103e-05
2.12537e-07
1.68141e-05
1.89232e-07
1.68194e-05
1.76313e-07
1.68253e-05
1.64132e-07
1.53498e-07
1.6831e-05
1.75297e-05
-7.10091e-09
1.75305e-05
5.36967e-08
1.75404e-05
1.45527e-07
1.75419e-05
1.98682e-07
1.75368e-05
1.99475e-07
1.75422e-05
2.23013e-07
1.75606e-05
2.8104e-07
1.75688e-05
3.01596e-07
1.75697e-05
2.71798e-07
1.75758e-05
2.78341e-07
1.75837e-05
2.6423e-07
1.7589e-05
2.56502e-07
1.75931e-05
2.30176e-07
1.76004e-05
2.30192e-07
1.7608e-05
2.17582e-07
1.76139e-05
2.0663e-07
1.76181e-05
1.85052e-07
1.7623e-05
1.71447e-07
1.76289e-05
1.58242e-07
1.48091e-07
1.76343e-05
1.83681e-05
-6.85487e-09
1.83677e-05
5.40661e-08
1.83768e-05
1.36472e-07
1.83801e-05
1.95381e-07
1.83762e-05
2.03377e-07
1.8379e-05
2.20234e-07
1.83945e-05
2.65498e-07
1.84061e-05
2.89995e-07
1.84099e-05
2.6798e-07
1.84159e-05
2.72364e-07
1.84235e-05
2.56659e-07
1.84296e-05
2.50356e-07
1.84344e-05
2.25426e-07
1.84416e-05
2.22946e-07
1.84491e-05
2.10082e-07
1.84556e-05
2.00176e-07
1.84605e-05
1.80105e-07
1.84651e-05
1.66839e-07
1.84709e-05
1.52503e-07
1.42676e-07
1.84763e-05
1.92465e-05
-6.922e-09
1.92454e-05
5.50961e-08
1.92532e-05
1.28711e-07
1.92581e-05
1.90481e-07
1.92561e-05
2.0538e-07
1.92578e-05
2.18548e-07
1.92706e-05
2.52655e-07
1.92831e-05
2.77526e-07
1.92895e-05
2.61517e-07
1.92962e-05
2.65697e-07
1.93036e-05
2.49294e-07
1.93104e-05
2.43544e-07
1.93157e-05
2.20143e-07
1.9323e-05
2.15646e-07
1.93305e-05
2.02517e-07
1.93372e-05
1.93562e-07
1.93428e-05
1.74428e-07
1.93476e-05
1.6202e-07
1.93528e-05
1.47384e-07
1.3716e-07
1.93583e-05
2.01667e-05
-7.17102e-09
2.01654e-05
5.63666e-08
2.01718e-05
1.22299e-07
2.01779e-05
1.84369e-07
2.0178e-05
2.05331e-07
2.01796e-05
2.16882e-07
2.01904e-05
2.41843e-07
2.02026e-05
2.6534e-07
2.02109e-05
2.53213e-07
2.02185e-05
2.58096e-07
2.0226e-05
2.41783e-07
2.02332e-05
2.36365e-07
2.0239e-05
2.14314e-07
2.02462e-05
2.0848e-07
2.02541e-05
1.94613e-07
2.02608e-05
1.8683e-07
2.02667e-05
1.68572e-07
2.02722e-05
1.56541e-07
2.02769e-05
1.4265e-07
1.31727e-07
2.02824e-05
2.11307e-05
-7.48352e-09
2.11295e-05
5.75701e-08
2.11348e-05
1.17002e-07
2.11416e-05
1.77528e-07
2.11436e-05
2.03393e-07
2.11459e-05
2.14534e-07
2.11553e-05
2.32452e-07
2.11669e-05
2.53721e-07
2.11763e-05
2.43905e-07
2.11848e-05
2.49578e-07
2.11927e-05
2.33859e-07
2.12002e-05
2.2886e-07
2.12065e-05
2.07978e-07
2.12136e-05
2.01442e-07
2.12215e-05
1.86684e-07
2.12288e-05
1.79528e-07
2.12345e-05
1.62888e-07
2.12405e-05
1.50532e-07
2.12455e-05
1.37659e-07
1.26699e-07
2.12505e-05
2.21408e-05
-7.78076e-09
2.21399e-05
5.84201e-08
2.21444e-05
1.12542e-07
2.21515e-05
1.70376e-07
2.21552e-05
1.9978e-07
2.21584e-05
2.11284e-07
2.2167e-05
2.23896e-07
2.21781e-05
2.42624e-07
2.21878e-05
2.34206e-07
2.21971e-05
2.40265e-07
2.22055e-05
2.25455e-07
2.22134e-05
2.20944e-07
2.22202e-05
2.01195e-07
2.22273e-05
1.94306e-07
2.22349e-05
1.79122e-07
2.22428e-05
1.71611e-07
2.22487e-05
1.56981e-07
2.22546e-05
1.44639e-07
2.22602e-05
1.3204e-07
1.22047e-07
2.22649e-05
2.31991e-05
-8.00237e-09
2.31987e-05
5.87437e-08
2.32026e-05
1.08629e-07
2.32098e-05
1.63199e-07
2.32149e-05
1.94737e-07
2.32191e-05
2.07047e-07
2.32273e-05
2.15721e-07
2.3238e-05
2.31926e-07
2.32478e-05
2.24383e-07
2.32576e-05
2.3042e-07
2.32665e-05
2.16584e-07
2.32748e-05
2.12624e-07
2.32821e-05
1.93965e-07
2.32895e-05
1.86872e-07
2.32967e-05
1.71882e-07
2.33048e-05
1.63594e-07
2.33113e-05
1.50431e-07
2.3317e-05
1.38994e-07
2.3323e-05
1.26034e-07
1.17207e-07
2.33278e-05
2.43079e-05
-8.09431e-09
2.43081e-05
5.84788e-08
2.43118e-05
1.05026e-07
2.43189e-05
1.56076e-07
2.43251e-05
1.88538e-07
2.43303e-05
2.01794e-07
2.43384e-05
2.07651e-07
2.43488e-05
2.21516e-07
2.43587e-05
2.14444e-07
2.43688e-05
2.20325e-07
2.43782e-05
2.07225e-07
2.43869e-05
2.0393e-07
2.43945e-05
1.86395e-07
2.44022e-05
1.7911e-07
2.44095e-05
1.64608e-07
2.44172e-05
1.55899e-07
2.44244e-05
1.43208e-07
2.44301e-05
1.33276e-07
2.44361e-05
1.201e-07
1.11825e-07
2.44415e-05
2.54697e-05
-8.02152e-09
2.54706e-05
5.75624e-08
2.54741e-05
1.01556e-07
2.54811e-05
1.49047e-07
2.54882e-05
1.81403e-07
2.54945e-05
1.95537e-07
2.55026e-05
1.99495e-07
2.55129e-05
2.11281e-07
2.55229e-05
2.04434e-07
2.55332e-05
2.1004e-07
2.55429e-05
1.97532e-07
2.5552e-05
1.94838e-07
2.55599e-05
1.78491e-07
2.55679e-05
1.71114e-07
2.55754e-05
1.57069e-07
2.55828e-05
1.48498e-07
2.55902e-05
1.35766e-07
2.55964e-05
1.27105e-07
2.56021e-05
1.14381e-07
1.06084e-07
2.56079e-05
2.6687e-05
-7.775e-09
2.66886e-05
5.59907e-08
2.66921e-05
9.80269e-08
2.6699e-05
1.42123e-07
2.67069e-05
1.73553e-07
2.67141e-05
1.88331e-07
2.67225e-05
1.91073e-07
2.67327e-05
2.01097e-07
2.67427e-05
1.94455e-07
2.67531e-05
1.99568e-07
2.6763e-05
1.87639e-07
2.67725e-05
1.85402e-07
2.67808e-05
1.7015e-07
2.67889e-05
1.62998e-07
2.67967e-05
1.49258e-07
2.68042e-05
1.41078e-07
2.68115e-05
1.28462e-07
2.68182e-05
1.20349e-07
2.68239e-05
1.08748e-07
1.00175e-07
2.68298e-05
2.79626e-05
-7.36181e-09
2.79646e-05
5.39611e-08
2.79684e-05
9.41595e-08
2.79753e-05
1.35252e-07
2.79838e-05
1.65092e-07
2.79918e-05
1.80292e-07
2.80006e-05
1.82248e-07
2.80108e-05
1.90909e-07
2.80209e-05
1.84436e-07
2.80314e-05
1.89035e-07
2.80414e-05
1.77588e-07
2.8051e-05
1.75807e-07
2.80599e-05
1.61329e-07
2.80682e-05
1.54658e-07
2.80762e-05
1.41273e-07
2.80838e-05
1.33478e-07
2.80909e-05
1.21294e-07
2.80981e-05
1.13239e-07
2.8104e-05
1.02849e-07
9.42418e-08
2.81099e-05
2.92991e-05
-6.812e-09
2.93017e-05
5.13383e-08
2.93059e-05
8.99659e-08
2.93128e-05
1.28391e-07
2.93217e-05
1.56153e-07
2.93305e-05
1.71516e-07
2.93398e-05
1.72951e-07
2.935e-05
1.80659e-07
2.93601e-05
1.74338e-07
2.93707e-05
1.78512e-07
2.93808e-05
1.6746e-07
2.93905e-05
1.66125e-07
2.93995e-05
1.52263e-07
2.94081e-05
1.46066e-07
2.94164e-05
1.33022e-07
2.94242e-05
1.25616e-07
2.94315e-05
1.13995e-07
2.94388e-05
1.05944e-07
2.94452e-05
9.64974e-08
8.82978e-08
2.94511e-05
3.06996e-05
-6.18559e-09
3.07024e-05
4.85201e-08
3.07073e-05
8.50946e-08
3.07143e-05
1.21421e-07
3.07237e-05
1.46748e-07
3.07331e-05
1.62112e-07
3.0743e-05
1.63072e-07
3.07532e-05
1.70413e-07
3.07635e-05
1.64077e-07
3.0774e-05
1.67995e-07
3.0784e-05
1.57442e-07
3.07937e-05
1.56397e-07
3.08029e-05
1.43114e-07
3.08117e-05
1.37268e-07
3.08201e-05
1.24635e-07
3.08283e-05
1.17412e-07
3.08359e-05
1.06381e-07
3.08434e-05
9.84448e-08
3.08502e-05
8.96337e-08
8.20682e-08
3.08565e-05
3.21672e-05
-5.5861e-09
3.21704e-05
4.53384e-08
3.21757e-05
7.96962e-08
3.21829e-05
1.14231e-07
3.21927e-05
1.36958e-07
3.22027e-05
1.52126e-07
3.22132e-05
1.52566e-07
3.22236e-05
1.60078e-07
3.22338e-05
1.53832e-07
3.22444e-05
1.57364e-07
3.22542e-05
1.47698e-07
3.22638e-05
1.46824e-07
3.22728e-05
1.3407e-07
3.22815e-05
1.28569e-07
3.22901e-05
1.16063e-07
3.22986e-05
1.089e-07
3.23067e-05
9.82852e-08
3.23145e-05
9.06108e-08
3.23219e-05
8.22018e-08
7.53033e-08
3.23287e-05
3.37049e-05
-5.06282e-09
3.3708e-05
4.22304e-08
3.37142e-05
7.35734e-08
3.37218e-05
1.06594e-07
3.37323e-05
1.26471e-07
3.37427e-05
1.41723e-07
3.37537e-05
1.4155e-07
3.37643e-05
1.49441e-07
3.37746e-05
1.43547e-07
3.37852e-05
1.46751e-07
3.37948e-05
1.38176e-07
3.38041e-05
1.37516e-07
3.38129e-05
1.25283e-07
3.38213e-05
1.20129e-07
3.38297e-05
1.07651e-07
3.38382e-05
1.00418e-07
3.38464e-05
9.00283e-08
3.38547e-05
8.23566e-08
3.38628e-05
7.41292e-08
6.75183e-08
3.38706e-05
3.53163e-05
-4.67519e-09
3.53195e-05
3.90114e-08
3.53263e-05
6.67263e-08
3.53346e-05
9.8277e-08
3.53455e-05
1.15595e-07
3.53569e-05
1.30345e-07
3.53681e-05
1.30333e-07
3.5379e-05
1.38571e-07
3.53893e-05
1.33238e-07
3.53994e-05
1.36619e-07
3.54086e-05
1.28957e-07
3.54175e-05
1.28653e-07
3.54259e-05
1.16931e-07
3.54343e-05
1.11714e-07
3.54424e-05
9.9517e-08
3.5451e-05
9.18406e-08
3.5459e-05
8.19951e-08
3.54671e-05
7.42245e-08
3.54757e-05
6.55652e-08
5.87428e-08
3.54845e-05
3.70046e-05
-4.44093e-09
3.70087e-05
3.49379e-08
3.70159e-05
5.95088e-08
3.70246e-05
8.95821e-08
3.70359e-05
1.04294e-07
3.70482e-05
1.18066e-07
3.70601e-05
1.18445e-07
3.70715e-05
1.27164e-07
3.70819e-05
1.22821e-07
3.70914e-05
1.27109e-07
3.70997e-05
1.20678e-07
3.7108e-05
1.20332e-07
3.71151e-05
1.09878e-07
3.71234e-05
1.03421e-07
3.71315e-05
9.13793e-08
3.7141e-05
8.23446e-08
3.71487e-05
7.42389e-08
3.71567e-05
6.62192e-08
3.71648e-05
5.75138e-08
5.05105e-08
3.7173e-05
3.87738e-05
-4.46901e-09
3.87778e-05
3.09497e-08
3.87853e-05
5.19519e-08
3.87957e-05
7.92513e-08
3.8808e-05
9.19269e-08
3.88216e-05
1.04448e-07
3.88348e-05
1.0525e-07
3.88468e-05
1.15173e-07
3.88564e-05
1.13253e-07
3.88641e-05
1.19406e-07
3.88696e-05
1.15151e-07
3.88752e-05
1.14757e-07
3.888e-05
1.05113e-07
3.88862e-05
9.72177e-08
3.8894e-05
8.35352e-08
3.89033e-05
7.31099e-08
3.89154e-05
6.20645e-08
3.89283e-05
5.33223e-08
3.8942e-05
4.37985e-08
3.70584e-08
3.89555e-05
4.06274e-05
-4.64255e-09
4.06303e-05
2.80484e-08
4.06375e-05
4.47404e-08
4.06482e-05
6.85636e-08
4.06619e-05
7.82268e-08
4.06767e-05
8.9639e-08
4.06925e-05
8.94803e-08
4.07111e-05
9.65791e-08
4.07332e-05
9.10859e-08
4.076e-05
9.25943e-08
4.07907e-05
8.44691e-08
4.08233e-05
8.214e-08
4.08529e-05
7.55515e-08
4.08791e-05
7.09971e-08
4.08956e-05
6.70542e-08
4.09065e-05
6.22624e-08
4.0913e-05
5.55683e-08
4.09142e-05
5.20596e-08
4.09119e-05
4.61372e-08
4.32578e-08
4.09057e-05
4.25695e-05
-4.87735e-09
4.25758e-05
2.18003e-08
4.25856e-05
3.49439e-08
4.25982e-05
5.59549e-08
4.26134e-05
6.30487e-08
4.2629e-05
7.39776e-08
4.26427e-05
7.5756e-08
4.26545e-05
8.48146e-08
4.26632e-05
8.23723e-08
4.26693e-05
8.65102e-08
4.2671e-05
8.27651e-08
4.26735e-05
7.96424e-08
4.26747e-05
7.43871e-08
4.26779e-05
6.7791e-08
4.2686e-05
5.89239e-08
4.26963e-05
5.192e-08
4.27097e-05
4.22642e-08
4.27251e-05
3.66553e-08
4.27426e-05
2.85549e-08
2.41546e-08
4.27617e-05
4.46078e-05
-8.52684e-09
4.46266e-05
3.0659e-09
4.46544e-05
7.13263e-09
4.46846e-05
2.57053e-08
4.47128e-05
3.4856e-08
4.47389e-05
4.79427e-08
4.47615e-05
5.30732e-08
4.47814e-05
6.49427e-08
4.4798e-05
6.57957e-08
4.4813e-05
7.14523e-08
4.48264e-05
6.94206e-08
4.48404e-05
6.56789e-08
4.48556e-05
5.919e-08
4.4869e-05
5.43268e-08
4.48817e-05
4.62399e-08
4.48904e-05
4.31779e-08
4.48954e-05
3.73295e-08
4.48981e-05
3.39206e-08
4.48989e-05
2.77772e-08
2.41725e-08
4.48989e-05
4.67352e-05
4.67407e-05
4.67521e-05
4.67701e-05
4.67927e-05
4.6818e-05
4.68448e-05
4.68734e-05
4.69007e-05
4.69282e-05
4.69531e-05
4.69745e-05
4.69917e-05
4.70054e-05
4.70181e-05
4.70301e-05
4.70418e-05
4.70522e-05
4.70604e-05
4.70661e-05
8.5059e-07
3.08677e-07
5.63222e-07
2.87368e-07
3.63792e-07
1.99431e-07
2.68212e-07
9.55792e-08
2.28183e-07
4.00297e-08
2.05785e-07
2.23977e-08
1.9046e-07
1.53245e-08
1.78656e-07
1.18041e-08
1.68835e-07
9.82104e-09
1.60627e-07
8.20828e-09
1.53786e-07
6.84079e-09
1.47473e-07
6.31294e-09
1.41141e-07
6.33251e-09
1.35053e-07
6.08771e-09
1.29335e-07
5.71811e-09
1.2412e-07
5.21466e-09
1.1998e-07
4.14029e-09
1.16761e-07
3.21897e-09
1.13647e-07
3.11408e-09
1.10495e-07
3.15232e-09
1.07675e-07
2.81952e-09
1.05214e-07
2.46085e-09
1.02994e-07
2.22074e-09
1.00896e-07
2.09798e-09
9.88172e-08
2.07832e-09
9.68121e-08
2.00516e-09
9.49463e-08
1.86571e-09
9.32192e-08
1.72714e-09
9.15241e-08
1.69509e-09
8.97093e-08
1.81478e-09
8.78901e-08
1.81919e-09
8.62298e-08
1.6603e-09
8.45595e-08
1.67032e-09
8.27901e-08
1.76939e-09
8.10911e-08
1.69898e-09
7.95289e-08
1.56222e-09
7.80376e-08
1.49133e-09
7.65903e-08
1.44728e-09
7.52014e-08
1.38897e-09
7.38515e-08
1.34985e-09
7.24576e-08
1.39393e-09
7.10712e-08
1.38635e-09
6.97479e-08
1.32327e-09
6.85092e-08
1.23871e-09
6.73537e-08
1.15552e-09
6.63072e-08
1.04647e-09
6.53525e-08
9.54724e-10
6.44183e-08
9.34237e-10
6.35162e-08
9.0209e-10
6.27103e-08
8.05937e-10
6.19104e-08
7.99901e-10
6.10616e-08
8.48712e-10
6.01452e-08
9.16465e-10
5.92741e-08
8.7112e-10
5.85139e-08
7.60114e-10
5.78188e-08
6.9517e-10
5.71654e-08
6.53417e-10
5.65201e-08
6.45261e-10
5.58642e-08
6.55937e-10
5.52061e-08
6.58101e-10
5.45645e-08
6.41553e-10
5.39252e-08
6.39295e-10
5.32825e-08
6.42691e-10
5.26855e-08
5.97043e-10
5.20658e-08
6.19671e-10
5.14237e-08
6.42069e-10
5.08408e-08
5.82895e-10
5.02689e-08
5.71935e-10
4.96477e-08
6.21168e-10
4.90466e-08
6.0116e-10
4.84526e-08
5.93928e-10
4.7892e-08
5.60616e-10
4.73102e-08
5.8184e-10
4.67288e-08
5.81344e-10
4.61679e-08
5.60996e-10
4.55762e-08
5.91673e-10
4.49961e-08
5.80051e-10
4.44118e-08
5.84346e-10
4.38866e-08
5.25187e-10
4.33765e-08
5.10077e-10
4.28671e-08
5.09377e-10
4.22772e-08
5.89932e-10
4.17305e-08
5.46662e-10
4.12244e-08
5.06131e-10
4.07004e-08
5.24004e-10
4.02175e-08
4.82945e-10
3.97514e-08
4.66109e-10
3.93099e-08
4.41496e-10
3.88092e-08
5.00704e-10
3.8384e-08
4.25133e-10
3.79561e-08
4.27942e-10
3.74991e-08
4.5703e-10
3.70545e-08
4.44593e-10
3.66684e-08
3.86105e-10
3.62591e-08
4.09244e-10
3.5859e-08
4.00103e-10
3.53258e-08
5.33184e-10
3.48558e-08
4.70027e-10
3.42317e-08
6.24048e-10
3.21108e-10
1.19618e-06
3.56706e-07
1.08117e-06
4.02378e-07
9.42783e-07
3.37814e-07
8.26481e-07
2.1188e-07
7.38574e-07
1.27937e-07
6.68914e-07
9.20579e-08
6.14575e-07
6.96628e-08
5.72814e-07
5.35657e-08
5.40059e-07
4.25762e-08
5.13643e-07
3.46238e-08
4.91427e-07
2.90574e-08
4.71208e-07
2.65313e-08
4.51685e-07
2.58562e-08
4.32704e-07
2.50678e-08
4.14729e-07
2.3694e-08
3.98835e-07
2.1108e-08
3.85758e-07
1.72173e-08
3.74531e-07
1.44465e-08
3.63778e-07
1.38668e-08
3.53449e-07
1.34811e-08
3.44183e-07
1.20857e-08
3.36045e-07
1.05985e-08
3.28705e-07
9.56072e-09
3.21805e-07
8.99871e-09
3.15199e-07
8.68385e-09
3.09022e-07
8.18258e-09
3.03305e-07
7.58234e-09
2.9781e-07
7.22256e-09
2.9226e-07
7.24442e-09
2.86624e-07
7.45086e-09
2.81153e-07
7.28991e-09
2.75884e-07
6.92955e-09
2.70501e-07
7.05316e-09
2.65005e-07
7.26582e-09
2.59701e-07
7.00265e-09
2.54683e-07
6.58074e-09
2.49832e-07
6.3422e-09
2.45084e-07
6.19549e-09
2.40475e-07
5.99708e-09
2.36018e-07
5.80766e-09
2.3163e-07
5.78112e-09
2.27391e-07
5.62559e-09
2.23348e-07
5.36643e-09
2.19532e-07
5.05526e-09
2.15935e-07
4.75238e-09
2.12572e-07
4.40868e-09
2.09397e-07
4.13042e-09
2.06333e-07
3.99773e-09
2.03405e-07
3.83082e-09
2.00646e-07
3.56472e-09
1.97904e-07
3.54196e-09
1.95141e-07
3.61129e-09
1.92372e-07
3.68542e-09
1.89766e-07
3.47745e-09
1.87367e-07
3.15901e-09
1.85099e-07
2.96313e-09
1.82919e-07
2.83359e-09
1.8077e-07
2.79413e-09
1.78628e-07
2.79772e-09
1.76523e-07
2.76323e-09
1.74475e-07
2.68995e-09
1.72449e-07
2.66443e-09
1.70444e-07
2.6482e-09
1.68518e-07
2.52344e-09
1.66553e-07
2.58429e-09
1.64589e-07
2.60596e-09
1.62729e-07
2.44333e-09
1.60867e-07
2.43318e-09
1.58934e-07
2.55479e-09
1.57045e-07
2.48979e-09
1.55175e-07
2.46364e-09
1.53364e-07
2.37197e-09
1.51511e-07
2.43506e-09
1.49665e-07
2.42691e-09
1.47831e-07
2.39479e-09
1.45969e-07
2.45449e-09
1.44155e-07
2.39348e-09
1.42374e-07
2.36583e-09
1.40685e-07
2.21416e-09
1.38985e-07
2.20959e-09
1.37263e-07
2.23126e-09
1.35468e-07
2.38515e-09
1.33777e-07
2.23818e-09
1.32152e-07
2.13052e-09
1.3052e-07
2.15589e-09
1.28982e-07
2.0216e-09
1.27452e-07
1.99595e-09
1.25972e-07
1.92106e-09
1.24439e-07
2.03445e-09
1.23065e-07
1.79831e-09
1.21651e-07
1.84274e-09
1.2024e-07
1.86782e-09
1.18867e-07
1.81723e-09
1.17602e-07
1.65113e-09
1.16279e-07
1.7325e-09
1.14946e-07
1.73338e-09
1.13344e-07
2.13486e-09
1.11955e-07
1.8586e-09
1.09941e-07
2.63847e-09
1.98908e-09
1.28772e-06
3.51662e-07
1.2677e-06
4.22397e-07
1.21991e-06
3.85606e-07
1.16231e-06
2.69483e-07
1.10612e-06
1.84124e-07
1.0495e-06
1.48685e-07
9.94824e-07
1.24335e-07
9.45819e-07
1.02571e-07
9.03481e-07
8.49145e-08
8.67185e-07
7.09195e-08
8.35344e-07
6.08985e-08
8.06064e-07
5.58115e-08
7.78224e-07
5.36959e-08
7.50996e-07
5.22957e-08
7.24285e-07
5.04055e-08
6.99708e-07
4.56846e-08
6.78462e-07
3.84631e-08
6.59382e-07
3.35268e-08
6.40921e-07
3.23283e-08
6.23022e-07
3.13802e-08
6.06496e-07
2.86109e-08
5.91708e-07
2.53868e-08
5.78376e-07
2.28929e-08
5.66031e-07
2.13431e-08
5.54484e-07
2.02309e-08
5.43875e-07
1.87923e-08
5.3419e-07
1.72668e-08
5.24907e-07
1.65061e-08
5.15545e-07
1.66065e-08
5.06235e-07
1.67606e-08
4.97299e-07
1.62259e-08
4.88537e-07
1.56915e-08
4.79521e-07
1.60692e-08
4.70328e-07
1.64585e-08
4.61311e-07
1.60195e-08
4.52594e-07
1.5298e-08
4.44066e-07
1.487e-08
4.35654e-07
1.46077e-08
4.27463e-07
1.41879e-08
4.19597e-07
1.3674e-08
4.11988e-07
1.33901e-08
4.04681e-07
1.29323e-08
3.97707e-07
1.23406e-08
3.91091e-07
1.16714e-08
3.84788e-07
1.10558e-08
3.7878e-07
1.04165e-08
3.73022e-07
9.88826e-09
3.67468e-07
9.55151e-09
3.62139e-07
9.16027e-09
3.57056e-07
8.64722e-09
3.52068e-07
8.52996e-09
3.47149e-07
8.52999e-09
3.42312e-07
8.52277e-09
3.37721e-07
8.06827e-09
3.33403e-07
7.47695e-09
3.29274e-07
7.09203e-09
3.25275e-07
6.83333e-09
3.2135e-07
6.71858e-09
3.17487e-07
6.6605e-09
3.13729e-07
6.52202e-09
3.10076e-07
6.34255e-09
3.06491e-07
6.24951e-09
3.0297e-07
6.16895e-09
2.99556e-07
5.93799e-09
2.96113e-07
6.02711e-09
2.92708e-07
6.0104e-09
2.89425e-07
5.72718e-09
2.86135e-07
5.72289e-09
2.82767e-07
5.92253e-09
2.79459e-07
5.79795e-09
2.76185e-07
5.73754e-09
2.72987e-07
5.57056e-09
2.69731e-07
5.6905e-09
2.66475e-07
5.68339e-09
2.63218e-07
5.65171e-09
2.59962e-07
5.70975e-09
2.56792e-07
5.56346e-09
2.53687e-07
5.47157e-09
2.50654e-07
5.24635e-09
2.47599e-07
5.2646e-09
2.44526e-07
5.30447e-09
2.41422e-07
5.48911e-09
2.38444e-07
5.21639e-09
2.35554e-07
5.02042e-09
2.32665e-07
5.04468e-09
2.29898e-07
4.78865e-09
2.27135e-07
4.75904e-09
2.24464e-07
4.59218e-09
2.21757e-07
4.7415e-09
2.19266e-07
4.2892e-09
2.16713e-07
4.39632e-09
2.14226e-07
4.35436e-09
2.11786e-07
4.25697e-09
2.09492e-07
3.94579e-09
2.07127e-07
4.09679e-09
2.04759e-07
4.1022e-09
2.02032e-07
4.86186e-09
1.99694e-07
4.19571e-09
1.9622e-07
6.11279e-09
5.11862e-09
1.34978e-06
3.45377e-07
1.35205e-06
4.20126e-07
1.34355e-06
3.94104e-07
1.32562e-06
2.87419e-07
1.30437e-06
2.0537e-07
1.27724e-06
1.75811e-07
1.24427e-06
1.57306e-07
1.20986e-06
1.36978e-07
1.1773e-06
1.17482e-07
1.14756e-06
1.00655e-07
1.11978e-06
8.86798e-08
1.09255e-06
8.30381e-08
1.06595e-06
8.03015e-08
1.0401e-06
7.81481e-08
1.01444e-06
7.60643e-08
9.89778e-07
7.03429e-08
9.67188e-07
6.1053e-08
9.45726e-07
5.49893e-08
9.24059e-07
5.39947e-08
9.02056e-07
5.33837e-08
8.80403e-07
5.02635e-08
8.5981e-07
4.59805e-08
8.40542e-07
4.21605e-08
8.22591e-07
3.92946e-08
8.06053e-07
3.67681e-08
7.91118e-07
3.37276e-08
7.77747e-07
3.06375e-08
7.65209e-07
2.9044e-08
7.52721e-07
2.90953e-08
7.40452e-07
2.90293e-08
7.28862e-07
2.78153e-08
7.17562e-07
2.69916e-08
7.05916e-07
2.77152e-08
6.93957e-07
2.84179e-08
6.81972e-07
2.80046e-08
6.70071e-07
2.7199e-08
6.58184e-07
2.67564e-08
6.46253e-07
2.65391e-08
6.34464e-07
2.59765e-08
6.23085e-07
2.50536e-08
6.12144e-07
2.43314e-08
6.01692e-07
2.33839e-08
5.91755e-07
2.22774e-08
5.82345e-07
2.10809e-08
5.7334e-07
2.00617e-08
5.64629e-07
1.91269e-08
5.5614e-07
1.83779e-08
5.47865e-07
1.78265e-08
5.39846e-07
1.71791e-08
5.32134e-07
1.63592e-08
5.24617e-07
1.60467e-08
5.17286e-07
1.58611e-08
5.10135e-07
1.56733e-08
5.0331e-07
1.48932e-08
4.96813e-07
1.39748e-08
4.90554e-07
1.33511e-08
4.84456e-07
1.29311e-08
4.7848e-07
1.26944e-08
4.72637e-07
1.25035e-08
4.66988e-07
1.21711e-08
4.61514e-07
1.18161e-08
4.56185e-07
1.15789e-08
4.51e-07
1.13541e-08
4.45971e-07
1.09672e-08
4.40943e-07
1.10546e-08
4.36004e-07
1.09496e-08
4.31203e-07
1.05284e-08
4.26397e-07
1.05286e-08
4.2151e-07
1.08093e-08
4.16696e-07
1.0612e-08
4.11934e-07
1.05e-08
4.07268e-07
1.02363e-08
4.02531e-07
1.04271e-08
3.97778e-07
1.04364e-08
3.93005e-07
1.04254e-08
3.88259e-07
1.0455e-08
3.83623e-07
1.01997e-08
3.79074e-07
1.00204e-08
3.74575e-07
9.74607e-09
3.70057e-07
9.78176e-09
3.65535e-07
9.82728e-09
3.61016e-07
1.00079e-08
3.56623e-07
9.60896e-09
3.52326e-07
9.31814e-09
3.48024e-07
9.34608e-09
3.43869e-07
8.94392e-09
3.39715e-07
8.91333e-09
3.35693e-07
8.61407e-09
3.31639e-07
8.79487e-09
3.27855e-07
8.07353e-09
3.23992e-07
8.25905e-09
3.20266e-07
8.08051e-09
3.16594e-07
7.92904e-09
3.13115e-07
7.42532e-09
3.0958e-07
7.63106e-09
3.06084e-07
7.59873e-09
3.0214e-07
8.80548e-09
2.98797e-07
7.53881e-09
2.93878e-07
1.10318e-08
9.7344e-09
1.41993e-06
3.399e-07
1.42403e-06
4.16027e-07
1.42371e-06
3.94426e-07
1.41863e-06
2.92494e-07
1.41334e-06
2.10662e-07
1.40484e-06
1.84314e-07
1.38996e-06
1.72191e-07
1.37104e-06
1.55894e-07
1.35158e-06
1.36946e-07
1.33329e-06
1.18938e-07
1.31578e-06
1.06192e-07
1.29734e-06
1.01482e-07
1.27788e-06
9.97574e-08
1.25884e-06
9.71855e-08
1.24079e-06
9.41209e-08
1.22392e-06
8.72063e-08
1.20828e-06
7.66936e-08
1.19264e-06
7.06324e-08
1.17587e-06
7.07592e-08
1.15773e-06
7.15256e-08
1.13818e-06
6.98183e-08
1.11736e-06
6.67975e-08
1.09568e-06
6.38375e-08
1.07393e-06
6.10477e-08
1.0533e-06
5.73984e-08
1.03474e-06
5.22858e-08
1.01851e-06
4.68735e-08
1.00379e-06
4.37647e-08
9.89411e-07
4.34701e-08
9.7534e-07
4.30998e-08
9.62254e-07
4.09016e-08
9.49894e-07
3.93514e-08
9.37467e-07
4.01423e-08
9.24773e-07
4.11123e-08
9.11836e-07
4.09414e-08
8.9859e-07
4.04449e-08
8.84915e-07
4.04316e-08
8.70698e-07
4.07558e-08
8.56132e-07
4.05426e-08
8.4166e-07
3.95257e-08
8.27563e-07
3.84286e-08
8.14079e-07
3.68681e-08
8.01354e-07
3.50018e-08
7.89464e-07
3.29716e-08
7.7822e-07
3.13058e-08
7.67332e-07
3.00146e-08
7.56544e-07
2.91664e-08
7.45794e-07
2.85756e-08
7.35134e-07
2.78393e-08
7.24684e-07
2.681e-08
7.1445e-07
2.62799e-08
7.04508e-07
2.5803e-08
6.94877e-07
2.53051e-08
6.85684e-07
2.40858e-08
6.76881e-07
2.27775e-08
6.68351e-07
2.18811e-08
6.59978e-07
2.13049e-08
6.5173e-07
2.09424e-08
6.43657e-07
2.05762e-08
6.35869e-07
1.99589e-08
6.28339e-07
1.9346e-08
6.21061e-07
1.88573e-08
6.14059e-07
1.83562e-08
6.07311e-07
1.77145e-08
6.00633e-07
1.7733e-08
5.94121e-07
1.74614e-08
5.87781e-07
1.68686e-08
5.81449e-07
1.68606e-08
5.75034e-07
1.72247e-08
5.687e-07
1.69455e-08
5.62435e-07
1.67647e-08
5.56296e-07
1.63755e-08
5.50085e-07
1.66383e-08
5.43847e-07
1.66741e-08
5.37556e-07
1.67167e-08
5.31296e-07
1.67154e-08
5.25137e-07
1.6358e-08
5.19081e-07
1.60763e-08
5.13054e-07
1.57734e-08
5.07034e-07
1.58023e-08
5.01021e-07
1.58402e-08
4.95035e-07
1.59933e-08
4.89154e-07
1.54897e-08
4.83353e-07
1.51196e-08
4.77522e-07
1.51768e-08
4.71854e-07
1.46118e-08
4.66177e-07
1.45911e-08
4.60657e-07
1.41336e-08
4.55091e-07
1.43606e-08
4.49839e-07
1.33262e-08
4.44485e-07
1.36131e-08
4.39331e-07
1.32343e-08
4.34244e-07
1.30161e-08
4.2941e-07
1.22592e-08
4.24558e-07
1.24829e-08
4.19826e-07
1.23313e-08
4.14551e-07
1.408e-08
4.10115e-07
1.1975e-08
4.03786e-07
1.73612e-08
1.58287e-08
1.49642e-06
3.34937e-07
1.50064e-06
4.11815e-07
1.49988e-06
3.9518e-07
1.49506e-06
2.97315e-07
1.49238e-06
2.13346e-07
1.49058e-06
1.86111e-07
1.48496e-06
1.77815e-07
1.47524e-06
1.6561e-07
1.46398e-06
1.48211e-07
1.45319e-06
1.29728e-07
1.44329e-06
1.16093e-07
1.43279e-06
1.11974e-07
1.42064e-06
1.11914e-07
1.40809e-06
1.0973e-07
1.39712e-06
1.05089e-07
1.38874e-06
9.55947e-08
1.38241e-06
8.30218e-08
1.37613e-06
7.69095e-08
1.3686e-06
7.82899e-08
1.3598e-06
8.03253e-08
1.34936e-06
8.02547e-08
1.33623e-06
7.99341e-08
1.31944e-06
8.06242e-08
1.29923e-06
8.12568e-08
1.27757e-06
7.90625e-08
1.25699e-06
7.28664e-08
1.23912e-06
6.47428e-08
1.2237e-06
5.91798e-08
1.2092e-06
5.79764e-08
1.19484e-06
5.74546e-08
1.1813e-06
5.44412e-08
1.16895e-06
5.16992e-08
1.15738e-06
5.17108e-08
1.14623e-06
5.22624e-08
1.13508e-06
5.20946e-08
1.12347e-06
5.20586e-08
1.11103e-06
5.28691e-08
1.09738e-06
5.44056e-08
1.08242e-06
5.55071e-08
1.06651e-06
5.54269e-08
1.05021e-06
5.47288e-08
1.03416e-06
5.29211e-08
1.01891e-06
5.02559e-08
1.00486e-06
4.70142e-08
9.92041e-07
4.41291e-08
9.80059e-07
4.19964e-08
9.68284e-07
4.09415e-08
9.56284e-07
4.05762e-08
9.43886e-07
4.02369e-08
9.31196e-07
3.94995e-08
9.1841e-07
3.9066e-08
9.05839e-07
3.83745e-08
8.93688e-07
3.74561e-08
8.8217e-07
3.56035e-08
8.71186e-07
3.37616e-08
8.60535e-07
3.25323e-08
8.49989e-07
3.18508e-08
8.39472e-07
3.14596e-08
8.29058e-07
3.09895e-08
8.18952e-07
3.0065e-08
8.09153e-07
2.91452e-08
7.99704e-07
2.83069e-08
7.90703e-07
2.7357e-08
7.82128e-07
2.6289e-08
7.7376e-07
2.61009e-08
7.65699e-07
2.55223e-08
7.57889e-07
2.46793e-08
7.50129e-07
2.46199e-08
7.42289e-07
2.5065e-08
7.34528e-07
2.47068e-08
7.26842e-07
2.44509e-08
7.19312e-07
2.39054e-08
7.11731e-07
2.42193e-08
7.04143e-07
2.42616e-08
6.96477e-07
2.43831e-08
6.88821e-07
2.43708e-08
6.81206e-07
2.3973e-08
6.73671e-07
2.36113e-08
6.66128e-07
2.3317e-08
6.58633e-07
2.32974e-08
6.51177e-07
2.32962e-08
6.4378e-07
2.33897e-08
6.36454e-07
2.28159e-08
6.29161e-07
2.24125e-08
6.21776e-07
2.25621e-08
6.14543e-07
2.18443e-08
6.07273e-07
2.18618e-08
6.00164e-07
2.12417e-08
5.92972e-07
2.1553e-08
5.86114e-07
2.01846e-08
5.79107e-07
2.06196e-08
5.72339e-07
2.00028e-08
5.65644e-07
1.97108e-08
5.59267e-07
1.86358e-08
5.5292e-07
1.88305e-08
5.46817e-07
1.84338e-08
5.40082e-07
2.08148e-08
5.34436e-07
1.76215e-08
5.26718e-07
2.5079e-08
2.33802e-08
1.57422e-06
3.3119e-07
1.57889e-06
4.07147e-07
1.57719e-06
3.9688e-07
1.56989e-06
3.04615e-07
1.56509e-06
2.18149e-07
1.56407e-06
1.8713e-07
1.56206e-06
1.79823e-07
1.55669e-06
1.7098e-07
1.54911e-06
1.55784e-07
1.5413e-06
1.37545e-07
1.53452e-06
1.2287e-07
1.52835e-06
1.18145e-07
1.52127e-06
1.18995e-07
1.51325e-06
1.17745e-07
1.50636e-06
1.11984e-07
1.50286e-06
9.90925e-08
1.50297e-06
8.29176e-08
1.50423e-06
7.56488e-08
1.50469e-06
7.783e-08
1.50458e-06
8.04289e-08
1.50418e-06
8.06558e-08
1.50208e-06
8.20374e-08
1.4957e-06
8.70043e-08
1.48317e-06
9.3787e-08
1.46528e-06
9.69475e-08
1.44536e-06
9.27937e-08
1.42715e-06
8.29474e-08
1.41224e-06
7.40913e-08
1.39937e-06
7.08478e-08
1.38661e-06
7.02075e-08
1.37373e-06
6.73266e-08
1.36167e-06
6.37543e-08
1.35123e-06
6.21528e-08
1.34258e-06
6.0911e-08
1.33502e-06
5.96617e-08
1.32758e-06
5.94944e-08
1.31962e-06
6.08343e-08
1.31032e-06
6.36973e-08
1.29889e-06
6.6941e-08
1.28501e-06
6.93113e-08
1.26901e-06
7.07242e-08
1.25187e-06
7.00656e-08
1.2347e-06
6.74258e-08
1.21858e-06
6.31334e-08
1.20426e-06
5.84442e-08
1.19194e-06
5.43229e-08
1.18084e-06
5.20328e-08
1.16986e-06
5.15618e-08
1.158e-06
5.20917e-08
1.14487e-06
5.26324e-08
1.13063e-06
5.33114e-08
1.1159e-06
5.30958e-08
1.10139e-06
5.19677e-08
1.08771e-06
4.92881e-08
1.07488e-06
4.6589e-08
1.06263e-06
4.47793e-08
1.05051e-06
4.39774e-08
1.03822e-06
4.37498e-08
1.02575e-06
4.34553e-08
1.01342e-06
4.23968e-08
1.00131e-06
4.12584e-08
9.89529e-07
4.00839e-08
9.78325e-07
3.85606e-08
9.67764e-07
3.68499e-08
9.57644e-07
3.62214e-08
9.4808e-07
3.50863e-08
9.38938e-07
3.38211e-08
9.29971e-07
3.35869e-08
9.20963e-07
3.40731e-08
9.12014e-07
3.36551e-08
9.03113e-07
3.33518e-08
8.94377e-07
3.26417e-08
8.85619e-07
3.29772e-08
8.7692e-07
3.2961e-08
8.68174e-07
3.31295e-08
8.59456e-07
3.30885e-08
8.50674e-07
3.27543e-08
8.41862e-07
3.24233e-08
8.3291e-07
3.22697e-08
8.24024e-07
3.21835e-08
8.1525e-07
3.20698e-08
8.06632e-07
3.20077e-08
7.98084e-07
3.13643e-08
7.89503e-07
3.09927e-08
7.80707e-07
3.13581e-08
7.71988e-07
3.05636e-08
7.6317e-07
3.06803e-08
7.54492e-07
2.99196e-08
7.45671e-07
3.03742e-08
7.37169e-07
2.8686e-08
7.28436e-07
2.93529e-08
7.19922e-07
2.8517e-08
7.11447e-07
2.81855e-08
7.03331e-07
2.67523e-08
6.95278e-07
2.68825e-08
6.87638e-07
2.60747e-08
6.79301e-07
2.91515e-08
6.72297e-07
2.46249e-08
6.63182e-07
3.4194e-08
3.23589e-08
1.64944e-06
3.28498e-07
1.65516e-06
4.01427e-07
1.65387e-06
3.98169e-07
1.6452e-06
3.13287e-07
1.63812e-06
2.25232e-07
1.63604e-06
1.89201e-07
1.63494e-06
1.80928e-07
1.63134e-06
1.74579e-07
1.62525e-06
1.61873e-07
1.61836e-06
1.44439e-07
1.61241e-06
1.28823e-07
1.60808e-06
1.22467e-07
1.60426e-06
1.22818e-07
1.59962e-06
1.22384e-07
1.59492e-06
1.16681e-07
1.59297e-06
1.01051e-07
1.59543e-06
8.04584e-08
1.60033e-06
7.07481e-08
1.60515e-06
7.30068e-08
1.61006e-06
7.55141e-08
1.61623e-06
7.44941e-08
1.62293e-06
7.5334e-08
1.62704e-06
8.28903e-08
1.62471e-06
9.61176e-08
1.6142e-06
1.07462e-07
1.59768e-06
1.09311e-07
1.58032e-06
1.00306e-07
1.56628e-06
8.81378e-08
1.5558e-06
8.13217e-08
1.54618e-06
7.98332e-08
1.5353e-06
7.81991e-08
1.52373e-06
7.53303e-08
1.51357e-06
7.23106e-08
1.50652e-06
6.79594e-08
1.50225e-06
6.39285e-08
1.49944e-06
6.23091e-08
1.49728e-06
6.29906e-08
1.49489e-06
6.60881e-08
1.49072e-06
7.11184e-08
1.48313e-06
7.68938e-08
1.47142e-06
8.2439e-08
1.45624e-06
8.5247e-08
1.43899e-06
8.46763e-08
1.42127e-06
8.08546e-08
1.40482e-06
7.48926e-08
1.39138e-06
6.77606e-08
1.38133e-06
6.20781e-08
1.37337e-06
5.95208e-08
1.36526e-06
6.02051e-08
1.3551e-06
6.27925e-08
1.34215e-06
6.62631e-08
1.32693e-06
6.83108e-08
1.31075e-06
6.81545e-08
1.29511e-06
6.49215e-08
1.28072e-06
6.09817e-08
1.26754e-06
5.79618e-08
1.25488e-06
5.6632e-08
1.24201e-06
5.66229e-08
1.2285e-06
5.69678e-08
1.21462e-06
5.62728e-08
1.2006e-06
5.52838e-08
1.18664e-06
5.40406e-08
1.17315e-06
5.20533e-08
1.1604e-06
4.95936e-08
1.14838e-06
4.8245e-08
1.1373e-06
4.61665e-08
1.12695e-06
4.41675e-08
1.11706e-06
4.34802e-08
1.1073e-06
4.38354e-08
1.0976e-06
4.33501e-08
1.08787e-06
4.30825e-08
1.07825e-06
4.22639e-08
1.06859e-06
4.26358e-08
1.05906e-06
4.24943e-08
1.04958e-06
4.26058e-08
1.04031e-06
4.23602e-08
1.03097e-06
4.20971e-08
1.02142e-06
4.19748e-08
1.01137e-06
4.2315e-08
1.00123e-06
4.23289e-08
9.91255e-07
4.20411e-08
9.81669e-07
4.15936e-08
9.7231e-07
4.07228e-08
9.62921e-07
4.03821e-08
9.53142e-07
4.11364e-08
9.43235e-07
4.0471e-08
9.3309e-07
4.08254e-08
9.23022e-07
3.99874e-08
9.12741e-07
4.06553e-08
9.02735e-07
3.86919e-08
8.92381e-07
3.97067e-08
8.8215e-07
3.87482e-08
8.71829e-07
3.85067e-08
8.61816e-07
3.67655e-08
8.51844e-07
3.68542e-08
8.42458e-07
3.54611e-08
8.32359e-07
3.92499e-08
8.23825e-07
3.31587e-08
8.13254e-07
4.47656e-08
4.27347e-08
1.72183e-06
3.26171e-07
1.72928e-06
3.93974e-07
1.73001e-06
3.97441e-07
1.72208e-06
3.2121e-07
1.71409e-06
2.33229e-07
1.71082e-06
1.92473e-07
1.70931e-06
1.82437e-07
1.70612e-06
1.77765e-07
1.70073e-06
1.67261e-07
1.69454e-06
1.50636e-07
1.68923e-06
1.34126e-07
1.68609e-06
1.25607e-07
1.68463e-06
1.24278e-07
1.68288e-06
1.24134e-07
1.67988e-06
1.19684e-07
1.67788e-06
1.03046e-07
1.67987e-06
7.84746e-08
1.68499e-06
6.56269e-08
1.69079e-06
6.72086e-08
1.69733e-06
6.89723e-08
1.70627e-06
6.55578e-08
1.71772e-06
6.38775e-08
1.72894e-06
7.16732e-08
1.73524e-06
8.98119e-08
1.73262e-06
1.10083e-07
1.72096e-06
1.20978e-07
1.70535e-06
1.15916e-07
1.69205e-06
1.01431e-07
1.68356e-06
8.98124e-08
1.67736e-06
8.60372e-08
1.66949e-06
8.60686e-08
1.65895e-06
8.58664e-08
1.64833e-06
8.29319e-08
1.64119e-06
7.51041e-08
1.63841e-06
6.67026e-08
1.63859e-06
6.21332e-08
1.64097e-06
6.06129e-08
1.64517e-06
6.18834e-08
1.64955e-06
6.67354e-08
1.65116e-06
7.52898e-08
1.64743e-06
8.61651e-08
1.63791e-06
9.47707e-08
1.62369e-06
9.88912e-08
1.60626e-06
9.82843e-08
1.5876e-06
9.35521e-08
1.57115e-06
8.42187e-08
1.56002e-06
7.3202e-08
1.55468e-06
6.48672e-08
1.55235e-06
6.25312e-08
1.54901e-06
6.61287e-08
1.54165e-06
7.36271e-08
1.52936e-06
8.05968e-08
1.5134e-06
8.41151e-08
1.49641e-06
8.19103e-08
1.48045e-06
7.69438e-08
1.46654e-06
7.18728e-08
1.45431e-06
6.88599e-08
1.44251e-06
6.84272e-08
1.42978e-06
6.97011e-08
1.41588e-06
7.01646e-08
1.40108e-06
7.00844e-08
1.38573e-06
6.93914e-08
1.37031e-06
6.74706e-08
1.35534e-06
6.45633e-08
1.3412e-06
6.23894e-08
1.32848e-06
5.88914e-08
1.31693e-06
5.57118e-08
1.30629e-06
5.4119e-08
1.29623e-06
5.38981e-08
1.28643e-06
5.31536e-08
1.27648e-06
5.30248e-08
1.2665e-06
5.22519e-08
1.25636e-06
5.27751e-08
1.2463e-06
5.25547e-08
1.23632e-06
5.25779e-08
1.22692e-06
5.17637e-08
1.21782e-06
5.11955e-08
1.20856e-06
5.12354e-08
1.19823e-06
5.26465e-08
1.18715e-06
5.34122e-08
1.176e-06
5.31877e-08
1.16555e-06
5.20464e-08
1.15581e-06
5.04577e-08
1.14635e-06
4.98465e-08
1.13642e-06
5.10647e-08
1.12599e-06
5.09031e-08
1.115e-06
5.18167e-08
1.10392e-06
5.10686e-08
1.09255e-06
5.20253e-08
1.0814e-06
4.98409e-08
1.06979e-06
5.1311e-08
1.05816e-06
5.03761e-08
1.0462e-06
5.04733e-08
1.0343e-06
4.86648e-08
1.02226e-06
4.88904e-08
1.01091e-06
4.68131e-08
9.98867e-07
5.12934e-08
9.88613e-07
4.34122e-08
9.76453e-07
5.69257e-08
5.45002e-08
1.79472e-06
3.23766e-07
1.80397e-06
3.84724e-07
1.80754e-06
3.93872e-07
1.80202e-06
3.26729e-07
1.79452e-06
2.40733e-07
1.79053e-06
1.96459e-07
1.78821e-06
1.84756e-07
1.78492e-06
1.81059e-07
1.78012e-06
1.72053e-07
1.77498e-06
1.55778e-07
1.77084e-06
1.38269e-07
1.76901e-06
1.27439e-07
1.7694e-06
1.23883e-07
1.76999e-06
1.2355e-07
1.76854e-06
1.21128e-07
1.7662e-06
1.05386e-07
1.76652e-06
7.81605e-08
1.76978e-06
6.23661e-08
1.77421e-06
6.27748e-08
1.78023e-06
6.29561e-08
1.7896e-06
5.61822e-08
1.80276e-06
5.07164e-08
1.81745e-06
5.6988e-08
1.82914e-06
7.81223e-08
1.83267e-06
1.06547e-07
1.82574e-06
1.27912e-07
1.81241e-06
1.29249e-07
1.79992e-06
1.13922e-07
1.79264e-06
9.70873e-08
1.78905e-06
8.96266e-08
1.78421e-06
9.09135e-08
1.77531e-06
9.47595e-08
1.76424e-06
9.40064e-08
1.75583e-06
8.35168e-08
1.75263e-06
6.99003e-08
1.75346e-06
6.13034e-08
1.75768e-06
5.63883e-08
1.76593e-06
5.36325e-08
1.77736e-06
5.53049e-08
1.78832e-06
6.43345e-08
1.79421e-06
8.02738e-08
1.79276e-06
9.62232e-08
1.7844e-06
1.07255e-07
1.77009e-06
1.12593e-07
1.75081e-06
1.12826e-07
1.73026e-06
1.04772e-07
1.71466e-06
8.88068e-08
1.70852e-06
7.1005e-08
1.71084e-06
6.02098e-08
1.71615e-06
6.08177e-08
1.71838e-06
7.13943e-08
1.71357e-06
8.54123e-08
1.70126e-06
9.64197e-08
1.68453e-06
9.86443e-08
1.66705e-06
9.44211e-08
1.65182e-06
8.71067e-08
1.63999e-06
8.06893e-08
1.63049e-06
7.79207e-08
1.62072e-06
7.94781e-08
1.60908e-06
8.18e-08
1.59541e-06
8.37593e-08
1.58023e-06
8.45698e-08
1.56405e-06
8.36467e-08
1.54735e-06
8.12653e-08
1.53099e-06
7.87517e-08
1.51643e-06
7.34461e-08
1.50359e-06
6.85538e-08
1.49214e-06
6.55754e-08
1.48199e-06
6.40394e-08
1.47276e-06
6.23871e-08
1.46344e-06
6.23479e-08
1.45383e-06
6.18619e-08
1.44387e-06
6.27365e-08
1.43378e-06
6.2638e-08
1.42344e-06
6.29252e-08
1.41385e-06
6.13493e-08
1.40547e-06
5.95784e-08
1.39784e-06
5.88671e-08
1.38883e-06
6.16487e-08
1.37777e-06
6.44796e-08
1.36551e-06
6.54407e-08
1.35389e-06
6.36649e-08
1.34382e-06
6.05289e-08
1.33497e-06
5.86966e-08
1.32611e-06
5.99252e-08
1.31636e-06
6.06567e-08
1.30541e-06
6.27685e-08
1.29393e-06
6.25491e-08
1.28203e-06
6.39224e-08
1.2703e-06
6.15722e-08
1.25807e-06
6.35401e-08
1.24573e-06
6.27171e-08
1.23278e-06
6.34196e-08
1.21941e-06
6.20376e-08
1.20541e-06
6.28914e-08
1.19195e-06
6.02681e-08
1.17777e-06
6.5473e-08
1.16563e-06
5.55543e-08
1.15168e-06
7.08801e-08
6.77085e-08
1.87227e-06
3.21354e-07
1.88259e-06
3.7441e-07
1.88865e-06
3.87806e-07
1.88598e-06
3.29403e-07
1.87977e-06
2.46937e-07
1.87575e-06
2.00483e-07
1.87296e-06
1.87544e-07
1.86979e-06
1.84234e-07
1.86586e-06
1.7598e-07
1.86209e-06
1.59551e-07
1.85938e-06
1.40981e-07
1.85889e-06
1.27929e-07
1.8606e-06
1.2217e-07
1.86267e-06
1.21481e-07
1.86247e-06
1.21323e-07
1.86e-06
1.07856e-07
1.85861e-06
7.95526e-08
1.85922e-06
6.1757e-08
1.86098e-06
6.10102e-08
1.86525e-06
5.8692e-08
1.87386e-06
4.75734e-08
1.88701e-06
3.75603e-08
1.90266e-06
4.13381e-08
1.9168e-06
6.39801e-08
1.92422e-06
9.91339e-08
1.92115e-06
1.30975e-07
1.91041e-06
1.3999e-07
1.89917e-06
1.25166e-07
1.89271e-06
1.03543e-07
1.89062e-06
9.17199e-08
1.888e-06
9.35377e-08
1.88096e-06
1.01793e-07
1.87002e-06
1.04945e-07
1.86017e-06
9.33723e-08
1.85543e-06
7.46379e-08
1.85509e-06
6.1649e-08
1.85865e-06
5.28223e-08
1.86798e-06
4.43091e-08
1.8836e-06
3.96779e-08
1.902e-06
4.59395e-08
1.91686e-06
6.54145e-08
1.9237e-06
8.93777e-08
1.92212e-06
1.08836e-07
1.91292e-06
1.21799e-07
1.89554e-06
1.30199e-07
1.87184e-06
1.28476e-07
1.84952e-06
1.1112e-07
1.83822e-06
8.23046e-08
1.84125e-06
5.71794e-08
1.85362e-06
4.84471e-08
1.86683e-06
5.81843e-08
1.87309e-06
7.91617e-08
1.86839e-06
1.01115e-07
1.8546e-06
1.12431e-07
1.8364e-06
1.12627e-07
1.81893e-06
1.04569e-07
1.80617e-06
9.34578e-08
1.79882e-06
8.52644e-08
1.79351e-06
8.47907e-08
1.78651e-06
8.8799e-08
1.77623e-06
9.40404e-08
1.76322e-06
9.75741e-08
1.74821e-06
9.8664e-08
1.73113e-06
9.83408e-08
1.71287e-06
9.70097e-08
1.69639e-06
8.99328e-08
1.68225e-06
8.26898e-08
1.66976e-06
7.80657e-08
1.65928e-06
7.45227e-08
1.65099e-06
7.06725e-08
1.64316e-06
7.01759e-08
1.63479e-06
7.02385e-08
1.62583e-06
7.16921e-08
1.61664e-06
7.18264e-08
1.60635e-06
7.32141e-08
1.59606e-06
7.1647e-08
1.58776e-06
6.78718e-08
1.58252e-06
6.41152e-08
1.57711e-06
6.70559e-08
1.56822e-06
7.33672e-08
1.55561e-06
7.80556e-08
1.54223e-06
7.70378e-08
1.53101e-06
7.17469e-08
1.52274e-06
6.69693e-08
1.51613e-06
6.65407e-08
1.50883e-06
6.79502e-08
1.49942e-06
7.21766e-08
1.48849e-06
7.34803e-08
1.4768e-06
7.56149e-08
1.46516e-06
7.32085e-08
1.45305e-06
7.5659e-08
1.4409e-06
7.48621e-08
1.42816e-06
7.61568e-08
1.41441e-06
7.57893e-08
1.39909e-06
7.82101e-08
1.3837e-06
7.56595e-08
1.36726e-06
8.19182e-08
1.35315e-06
6.96628e-08
1.33718e-06
8.68448e-08
8.24926e-08
1.95699e-06
3.19295e-07
1.96732e-06
3.64077e-07
1.97485e-06
3.80282e-07
1.97446e-06
3.29793e-07
1.96965e-06
2.51746e-07
1.96612e-06
2.04016e-07
1.96354e-06
1.90123e-07
1.96111e-06
1.86663e-07
1.95844e-06
1.78645e-07
1.95618e-06
1.61816e-07
1.9548e-06
1.42362e-07
1.95535e-06
1.27372e-07
1.95775e-06
1.19772e-07
1.96036e-06
1.18877e-07
1.96094e-06
1.20734e-07
1.95866e-06
1.10144e-07
1.9561e-06
8.2105e-08
1.95426e-06
6.36045e-08
1.95301e-06
6.22559e-08
1.95495e-06
5.67511e-08
1.96205e-06
4.04726e-08
1.97409e-06
2.55185e-08
1.9891e-06
2.63347e-08
2.00363e-06
4.94513e-08
2.01312e-06
8.96426e-08
2.01316e-06
1.30928e-07
2.00535e-06
1.47808e-07
1.99603e-06
1.34481e-07
1.99041e-06
1.09167e-07
1.98893e-06
9.31978e-08
1.98747e-06
9.50014e-08
1.98209e-06
1.07169e-07
1.972e-06
1.15034e-07
1.96123e-06
1.04145e-07
1.9547e-06
8.11715e-08
1.95223e-06
6.41101e-08
1.95361e-06
5.14442e-08
1.96194e-06
3.59791e-08
1.97926e-06
2.23626e-08
2.00263e-06
2.25673e-08
2.0246e-06
4.34481e-08
2.03839e-06
7.55871e-08
2.04257e-06
1.04657e-07
2.03849e-06
1.2587e-07
2.0248e-06
1.43892e-07
2.00019e-06
1.53085e-07
1.97133e-06
1.3998e-07
1.95209e-06
1.01552e-07
1.95153e-06
5.77373e-08
1.96705e-06
3.29242e-08
1.98929e-06
3.59417e-08
2.00743e-06
6.10274e-08
2.01299e-06
9.55509e-08
2.00489e-06
1.20536e-07
1.98755e-06
1.29968e-07
1.96755e-06
1.24569e-07
1.95196e-06
1.09047e-07
1.94508e-06
9.21464e-08
1.9442e-06
8.5671e-08
1.9434e-06
8.95973e-08
1.93848e-06
9.89606e-08
1.92936e-06
1.06695e-07
1.91748e-06
1.10545e-07
1.90212e-06
1.13694e-07
1.88292e-06
1.16211e-07
1.86454e-06
1.08316e-07
1.84941e-06
9.78156e-08
1.83598e-06
9.1497e-08
1.8245e-06
8.60011e-08
1.81691e-06
7.82684e-08
1.81122e-06
7.58599e-08
1.80485e-06
7.66122e-08
1.79754e-06
7.90048e-08
1.79039e-06
7.8973e-08
1.78146e-06
8.21474e-08
1.77025e-06
8.28542e-08
1.76019e-06
7.79312e-08
1.75621e-06
6.80985e-08
1.75614e-06
6.71197e-08
1.75281e-06
7.6702e-08
1.74212e-06
8.87461e-08
1.7269e-06
9.22519e-08
1.71295e-06
8.56967e-08
1.70378e-06
7.61419e-08
1.69958e-06
7.07373e-08
1.69668e-06
7.08549e-08
1.69107e-06
7.77907e-08
1.68214e-06
8.2407e-08
1.67157e-06
8.61811e-08
1.66077e-06
8.40111e-08
1.64942e-06
8.7013e-08
1.63821e-06
8.60667e-08
1.62706e-06
8.73054e-08
1.61479e-06
8.80623e-08
1.5997e-06
9.33049e-08
1.58321e-06
9.21402e-08
1.5646e-06
1.00528e-07
1.54863e-06
8.56366e-08
1.53059e-06
1.04889e-07
9.90196e-08
2.04938e-06
3.17873e-07
2.05888e-06
3.54582e-07
2.06685e-06
3.72308e-07
2.06788e-06
3.28763e-07
2.06414e-06
2.55492e-07
2.06131e-06
2.06846e-07
2.05949e-06
1.91938e-07
2.05838e-06
1.87773e-07
2.05725e-06
1.7978e-07
2.05644e-06
1.62625e-07
2.05607e-06
1.42734e-07
2.05717e-06
1.2627e-07
2.05964e-06
1.17297e-07
2.06197e-06
1.16553e-07
2.06285e-06
1.19849e-07
2.06094e-06
1.12055e-07
2.05788e-06
8.51621e-08
2.05439e-06
6.70983e-08
2.05065e-06
6.59924e-08
2.05031e-06
5.70908e-08
2.05541e-06
3.53714e-08
2.0654e-06
1.55339e-08
2.07857e-06
1.31629e-08
2.09207e-06
3.59525e-08
2.10247e-06
7.9246e-08
2.10524e-06
1.28152e-07
2.10074e-06
1.52313e-07
2.09397e-06
1.41251e-07
2.08924e-06
1.13888e-07
2.08779e-06
9.46503e-08
2.08662e-06
9.61711e-08
2.08251e-06
1.11277e-07
2.07383e-06
1.23718e-07
2.06289e-06
1.15085e-07
2.05484e-06
8.92238e-08
2.05006e-06
6.88844e-08
2.04869e-06
5.28197e-08
2.05509e-06
2.95776e-08
2.07257e-06
4.88553e-09
2.0989e-06
-3.76402e-09
2.12598e-06
1.63668e-08
2.14488e-06
5.66823e-08
2.1529e-06
9.66418e-08
2.15246e-06
1.2631e-07
2.1427e-06
1.53652e-07
2.11934e-06
1.76442e-07
2.08595e-06
1.73373e-07
2.0586e-06
1.28897e-07
2.05199e-06
6.43566e-08
2.06671e-06
1.82043e-08
2.09399e-06
8.65681e-09
2.12188e-06
3.31421e-08
2.13791e-06
7.95166e-08
2.13695e-06
1.21498e-07
2.12212e-06
1.44792e-07
2.10027e-06
1.46422e-07
2.08066e-06
1.28654e-07
2.07205e-06
1.00756e-07
2.0741e-06
8.36241e-08
2.07961e-06
8.40865e-08
2.08113e-06
9.74374e-08
2.07672e-06
1.11114e-07
2.06904e-06
1.18221e-07
2.05753e-06
1.25199e-07
2.03892e-06
1.34824e-07
2.01874e-06
1.28497e-07
2.00311e-06
1.13448e-07
1.98959e-06
1.05016e-07
1.97662e-06
9.89671e-08
1.96878e-06
8.61077e-08
1.96542e-06
7.92239e-08
1.96164e-06
8.03906e-08
1.95606e-06
8.4584e-08
1.95157e-06
8.3461e-08
1.94601e-06
8.77113e-08
1.93515e-06
9.3715e-08
1.92143e-06
9.16526e-08
1.91526e-06
7.427e-08
1.91999e-06
6.23803e-08
1.92557e-06
7.11313e-08
1.92082e-06
9.34879e-08
1.90527e-06
1.07804e-07
1.88723e-06
1.03737e-07
1.87431e-06
8.90621e-08
1.87068e-06
7.43715e-08
1.87316e-06
6.83747e-08
1.87405e-06
7.69016e-08
1.86921e-06
8.72457e-08
1.86091e-06
9.4476e-08
1.85176e-06
9.3165e-08
1.84173e-06
9.70364e-08
1.83166e-06
9.6137e-08
1.82289e-06
9.60813e-08
1.81423e-06
9.67164e-08
1.80189e-06
1.05649e-07
1.78629e-06
1.07744e-07
1.76615e-06
1.20662e-07
1.74866e-06
1.03128e-07
1.72882e-06
1.24728e-07
1.17348e-07
2.14888e-06
3.17109e-07
2.15706e-06
3.46404e-07
2.16488e-06
3.64485e-07
2.16668e-06
3.26963e-07
2.1636e-06
2.58571e-07
2.16143e-06
2.09019e-07
2.16059e-06
1.92773e-07
2.16106e-06
1.87305e-07
2.16146e-06
1.79378e-07
2.16188e-06
1.62206e-07
2.1621e-06
1.4251e-07
2.16318e-06
1.25198e-07
2.16524e-06
1.15235e-07
2.16673e-06
1.15057e-07
2.16751e-06
1.19073e-07
2.16597e-06
1.13595e-07
2.16286e-06
8.82728e-08
2.15873e-06
7.12282e-08
2.15358e-06
7.11377e-08
2.15152e-06
5.91521e-08
2.15446e-06
3.24357e-08
2.1617e-06
8.28938e-09
2.17221e-06
2.65195e-09
2.18369e-06
2.44794e-08
2.19417e-06
6.87634e-08
2.19945e-06
1.22876e-07
2.19851e-06
1.53254e-07
2.19462e-06
1.45138e-07
2.19069e-06
1.17821e-07
2.18884e-06
9.65021e-08
2.18745e-06
9.75597e-08
2.18424e-06
1.14483e-07
2.17728e-06
1.30682e-07
2.16685e-06
1.25509e-07
2.15784e-06
9.82345e-08
2.15111e-06
7.56173e-08
2.1471e-06
5.6827e-08
2.15133e-06
2.53537e-08
2.16803e-06
-1.18168e-08
2.19574e-06
-3.14796e-08
2.2262e-06
-1.40894e-08
2.24859e-06
3.42897e-08
2.25868e-06
8.65498e-08
2.25999e-06
1.25001e-07
2.25329e-06
1.60357e-07
2.23251e-06
1.97226e-07
2.19731e-06
2.0857e-07
2.16386e-06
1.62347e-07
2.15111e-06
7.71002e-08
2.16256e-06
6.76219e-09
2.19067e-06
-1.94529e-08
2.22441e-06
-6.00573e-10
2.24889e-06
5.50369e-08
2.25473e-06
1.15653e-07
2.24333e-06
1.56197e-07
2.22099e-06
1.68763e-07
2.19757e-06
1.52072e-07
2.1859e-06
1.12427e-07
2.18888e-06
8.06441e-08
2.19939e-06
7.35798e-08
2.20728e-06
8.95432e-08
2.2074e-06
1.10996e-07
2.20353e-06
1.22084e-07
2.19711e-06
1.31623e-07
2.18088e-06
1.51053e-07
2.15903e-06
1.50344e-07
2.14317e-06
1.29313e-07
2.13116e-06
1.17026e-07
2.11702e-06
1.13105e-07
2.10771e-06
9.54236e-08
2.10626e-06
8.06721e-08
2.10553e-06
8.11189e-08
2.10132e-06
8.87972e-08
2.09885e-06
8.59257e-08
2.09825e-06
8.83116e-08
2.09062e-06
1.01351e-07
2.07313e-06
1.09135e-07
2.06032e-06
8.70832e-08
2.06615e-06
5.65537e-08
2.08197e-06
5.53121e-08
2.08776e-06
8.76966e-08
2.07526e-06
1.20303e-07
2.05334e-06
1.25653e-07
2.03379e-06
1.08611e-07
2.02678e-06
8.13889e-08
2.03345e-06
6.17045e-08
2.04311e-06
6.72378e-08
2.04492e-06
8.54411e-08
2.04018e-06
9.92121e-08
2.0335e-06
9.98424e-08
2.02551e-06
1.05025e-07
2.01632e-06
1.05336e-07
2.00931e-06
1.03082e-07
2.00557e-06
1.00463e-07
1.99891e-06
1.12309e-07
1.98744e-06
1.19211e-07
1.96738e-06
1.40728e-07
1.949e-06
1.21506e-07
1.92812e-06
1.45606e-07
1.37236e-07
2.25466e-06
3.16778e-07
2.26136e-06
3.39699e-07
2.26881e-06
3.5704e-07
2.27108e-06
3.24697e-07
2.26842e-06
2.61228e-07
2.26675e-06
2.10686e-07
2.26682e-06
1.92712e-07
2.26879e-06
1.85331e-07
2.2705e-06
1.77669e-07
2.27179e-06
1.60916e-07
2.2722e-06
1.42102e-07
2.27271e-06
1.24687e-07
2.27401e-06
1.1393e-07
2.27442e-06
1.14645e-07
2.27485e-06
1.18644e-07
2.27355e-06
1.149e-07
2.27053e-06
9.12874e-08
2.26659e-06
7.5169e-08
2.26122e-06
7.65099e-08
2.25827e-06
6.21062e-08
2.25927e-06
3.1429e-08
2.2636e-06
3.96387e-09
2.27111e-06
-4.85778e-09
2.2799e-06
1.56846e-08
2.28973e-06
5.89404e-08
2.29707e-06
1.1553e-07
2.29954e-06
1.50783e-07
2.29854e-06
1.46138e-07
2.29517e-06
1.21196e-07
2.29265e-06
9.90235e-08
2.29085e-06
9.93562e-08
2.28825e-06
1.17078e-07
2.28309e-06
1.35847e-07
2.27371e-06
1.34885e-07
2.26449e-06
1.07454e-07
2.25661e-06
8.34982e-08
2.25058e-06
6.28539e-08
2.25262e-06
2.33139e-08
2.26757e-06
-2.67591e-08
2.29502e-06
-5.8931e-08
2.32713e-06
-4.62053e-08
2.35165e-06
9.7708e-09
2.36269e-06
7.55083e-08
2.36442e-06
1.23273e-07
2.35964e-06
1.65136e-07
2.34199e-06
2.14884e-07
2.30767e-06
2.42887e-07
2.27124e-06
1.98773e-07
2.25407e-06
9.42713e-08
2.26141e-06
-5.81388e-10
2.28701e-06
-4.50493e-08
2.32236e-06
-3.59462e-08
2.35202e-06
2.53778e-08
2.36296e-06
1.04713e-07
2.35492e-06
1.64229e-07
2.33364e-06
1.90047e-07
2.30793e-06
1.77777e-07
2.29344e-06
1.26921e-07
2.29598e-06
7.8099e-08
2.30935e-06
6.02192e-08
2.32245e-06
7.64436e-08
2.32629e-06
1.07152e-07
2.32463e-06
1.23744e-07
2.32309e-06
1.33164e-07
2.31087e-06
1.63274e-07
2.28767e-06
1.73537e-07
2.27139e-06
1.45595e-07
2.2627e-06
1.25715e-07
2.24874e-06
1.27064e-07
2.237e-06
1.07171e-07
2.23656e-06
8.1105e-08
2.23918e-06
7.85e-08
2.23601e-06
9.19707e-08
2.23379e-06
8.81475e-08
2.23807e-06
8.40312e-08
2.23687e-06
1.02551e-07
2.21817e-06
1.27835e-07
2.19571e-06
1.09544e-07
2.19685e-06
5.54141e-08
2.221e-06
3.11589e-08
2.24044e-06
6.82543e-08
2.23515e-06
1.25592e-07
2.21161e-06
1.49197e-07
2.18441e-06
1.35811e-07
2.16948e-06
9.63152e-08
2.17654e-06
5.46483e-08
2.19564e-06
4.81392e-08
2.20657e-06
7.45097e-08
2.20656e-06
9.92191e-08
2.20286e-06
1.03546e-07
2.19787e-06
1.10013e-07
2.18953e-06
1.13678e-07
2.18232e-06
1.10284e-07
2.18272e-06
1.00068e-07
2.18374e-06
1.1129e-07
2.18044e-06
1.22514e-07
2.16327e-06
1.5789e-07
2.14496e-06
1.39822e-07
2.12418e-06
1.66388e-07
1.58017e-07
2.36605e-06
3.16514e-07
2.37135e-06
3.34407e-07
2.37836e-06
3.50027e-07
2.381e-06
3.22057e-07
2.3787e-06
2.63527e-07
2.37738e-06
2.12001e-07
2.37808e-06
1.92015e-07
2.38129e-06
1.82127e-07
2.38395e-06
1.75006e-07
2.38573e-06
1.59138e-07
2.38602e-06
1.41813e-07
2.38559e-06
1.25109e-07
2.38595e-06
1.13575e-07
2.38525e-06
1.15343e-07
2.38529e-06
1.18603e-07
2.38411e-06
1.16087e-07
2.38114e-06
9.42534e-08
2.37781e-06
7.84962e-08
2.37308e-06
8.12433e-08
2.37003e-06
6.51592e-08
2.36966e-06
3.17934e-08
2.37144e-06
2.18668e-09
2.37612e-06
-9.5438e-09
2.38195e-06
9.85899e-09
2.39039e-06
5.05054e-08
2.39902e-06
1.06897e-07
2.40424e-06
1.45562e-07
2.40584e-06
1.44539e-07
2.40286e-06
1.2417e-07
2.39963e-06
1.02254e-07
2.39745e-06
1.01535e-07
2.39518e-06
1.19352e-07
2.39167e-06
1.39358e-07
2.38371e-06
1.42847e-07
2.37514e-06
1.16023e-07
2.36724e-06
9.14004e-08
2.36015e-06
6.99359e-08
2.36013e-06
2.33413e-08
2.37208e-06
-3.87095e-08
2.39724e-06
-8.40964e-08
2.42898e-06
-7.79447e-08
2.45424e-06
-1.54841e-08
2.46563e-06
6.41192e-08
2.46727e-06
1.21631e-07
2.46363e-06
1.68773e-07
2.44927e-06
2.29241e-07
2.41822e-06
2.73941e-07
2.38229e-06
2.34698e-07
2.3632e-06
1.13364e-07
2.36671e-06
-4.08726e-09
2.38758e-06
-6.59204e-08
2.42079e-06
-6.91617e-08
2.45208e-06
-5.90938e-09
2.46581e-06
9.0982e-08
2.46049e-06
1.69551e-07
2.44169e-06
2.0885e-07
2.41598e-06
2.03489e-07
2.40025e-06
1.42648e-07
2.40212e-06
7.62242e-08
2.4161e-06
4.62457e-08
2.43245e-06
6.00925e-08
2.439e-06
1.00605e-07
2.43752e-06
1.25219e-07
2.43935e-06
1.31333e-07
2.43222e-06
1.70405e-07
2.40845e-06
1.97309e-07
2.39127e-06
1.62776e-07
2.38726e-06
1.29728e-07
2.37548e-06
1.3884e-07
2.36105e-06
1.21604e-07
2.3605e-06
8.16551e-08
2.36641e-06
7.25847e-08
2.3644e-06
9.39856e-08
2.36045e-06
9.21001e-08
2.36758e-06
7.69e-08
2.37454e-06
9.55876e-08
2.35886e-06
1.43519e-07
2.32696e-06
1.41441e-07
2.31813e-06
6.4245e-08
2.34597e-06
3.31289e-09
2.37922e-06
3.50041e-08
2.38418e-06
1.20633e-07
2.36228e-06
1.71095e-07
2.32927e-06
1.68827e-07
2.30368e-06
1.21908e-07
2.30576e-06
5.25647e-08
2.33263e-06
2.12666e-08
2.35436e-06
5.27849e-08
2.35982e-06
9.37556e-08
2.35876e-06
1.04611e-07
2.35761e-06
1.11155e-07
2.3511e-06
1.20188e-07
2.34142e-06
1.19965e-07
2.34286e-06
9.86288e-08
2.35118e-06
1.02966e-07
2.3595e-06
1.14199e-07
2.34912e-06
1.68274e-07
2.33216e-06
1.56774e-07
2.31269e-06
1.85866e-07
1.78682e-07
2.48258e-06
3.15931e-07
2.4867e-06
3.30291e-07
2.49325e-06
3.43479e-07
2.49621e-06
3.19099e-07
2.49431e-06
2.65426e-07
2.49319e-06
2.13117e-07
2.49419e-06
1.91017e-07
2.49827e-06
1.78044e-07
2.50152e-06
1.71753e-07
2.50349e-06
1.57168e-07
2.50355e-06
1.41758e-07
2.50208e-06
1.26572e-07
2.50146e-06
1.14198e-07
2.49978e-06
1.17029e-07
2.49952e-06
1.18861e-07
2.49843e-06
1.17178e-07
2.49544e-06
9.72358e-08
2.49279e-06
8.11539e-08
2.48908e-06
8.49528e-08
2.48645e-06
6.77857e-08
2.48534e-06
3.29024e-08
2.48525e-06
2.27665e-09
2.48766e-06
-1.19467e-08
2.49065e-06
6.86284e-09
2.49719e-06
4.39676e-08
2.50616e-06
9.79253e-08
2.51308e-06
1.3864e-07
2.51675e-06
1.40875e-07
2.51416e-06
1.2676e-07
2.51041e-06
1.05999e-07
2.50796e-06
1.03988e-07
2.50567e-06
1.21644e-07
2.50349e-06
1.41535e-07
2.49714e-06
1.49197e-07
2.49003e-06
1.23132e-07
2.48327e-06
9.81589e-08
2.47626e-06
7.69506e-08
2.47451e-06
2.50937e-08
2.48234e-06
-4.65477e-08
2.5031e-06
-1.04849e-07
2.53206e-06
-1.06913e-07
2.55638e-06
-3.97981e-08
2.56768e-06
5.282e-08
2.5693e-06
1.20013e-07
2.56648e-06
1.71586e-07
2.55547e-06
2.40249e-07
2.52969e-06
2.99727e-07
2.49755e-06
2.66841e-07
2.47912e-06
1.31791e-07
2.47956e-06
-4.52916e-09
2.49451e-06
-8.08671e-08
2.52275e-06
-9.74032e-08
2.55239e-06
-3.55562e-08
2.56666e-06
7.6715e-08
2.56323e-06
1.72984e-07
2.54811e-06
2.23971e-07
2.5248e-06
2.26799e-07
2.50999e-06
1.57456e-07
2.51185e-06
7.43629e-08
2.52462e-06
3.34776e-08
2.54193e-06
4.27838e-08
2.55024e-06
9.22911e-08
2.54739e-06
1.28075e-07
2.5504e-06
1.28319e-07
2.5487e-06
1.72102e-07
2.52568e-06
2.20327e-07
2.50728e-06
1.81183e-07
2.50841e-06
1.28596e-07
2.50073e-06
1.46524e-07
2.48412e-06
1.38212e-07
2.48243e-06
8.33394e-08
2.49103e-06
6.39881e-08
2.49069e-06
9.43253e-08
2.48391e-06
9.88823e-08
2.49082e-06
6.99869e-08
2.50521e-06
8.11961e-08
2.49649e-06
1.52242e-07
2.45856e-06
1.79368e-07
2.43723e-06
8.5573e-08
2.46328e-06
-2.27339e-08
2.50746e-06
-9.17662e-09
2.52326e-06
1.04837e-07
2.50564e-06
1.88715e-07
2.47089e-06
2.03578e-07
2.43527e-06
1.57526e-07
2.4275e-06
6.0335e-08
2.45844e-06
-9.6751e-09
2.49121e-06
2.0015e-08
2.50228e-06
8.26859e-08
2.50246e-06
1.04429e-07
2.50519e-06
1.08429e-07
2.50248e-06
1.22895e-07
2.48921e-06
1.33239e-07
2.48738e-06
1.0046e-07
2.49978e-06
9.05608e-08
2.52105e-06
9.29341e-08
2.52147e-06
1.67854e-07
2.50748e-06
1.70762e-07
2.4902e-06
2.03145e-07
1.98149e-07
2.60403e-06
3.14734e-07
2.60736e-06
3.26959e-07
2.61339e-06
3.3745e-07
2.61657e-06
3.15921e-07
2.61514e-06
2.66856e-07
2.61405e-06
2.14201e-07
2.61499e-06
1.90078e-07
2.61959e-06
1.73449e-07
2.62313e-06
1.68213e-07
2.62514e-06
1.55152e-07
2.62503e-06
1.41872e-07
2.62268e-06
1.28916e-07
2.62123e-06
1.15656e-07
2.61876e-06
1.195e-07
2.61831e-06
1.19309e-07
2.61733e-06
1.18159e-07
2.61436e-06
1.00201e-07
2.61225e-06
8.32665e-08
2.60957e-06
8.7631e-08
2.60756e-06
6.97965e-08
2.60614e-06
3.43236e-08
2.60483e-06
3.58791e-09
2.60559e-06
-1.27076e-08
2.60631e-06
6.14152e-09
2.61087e-06
3.94076e-08
2.61936e-06
8.94345e-08
2.62681e-06
1.31197e-07
2.63181e-06
1.35875e-07
2.62965e-06
1.28915e-07
2.62572e-06
1.09928e-07
2.62312e-06
1.06594e-07
2.62048e-06
1.24278e-07
2.61926e-06
1.42751e-07
2.61456e-06
1.53905e-07
2.60946e-06
1.28231e-07
2.60471e-06
1.02905e-07
2.59878e-06
8.288e-08
2.59594e-06
2.79322e-08
2.59919e-06
-4.97914e-08
2.61393e-06
-1.19591e-07
2.63775e-06
-1.30733e-07
2.65922e-06
-6.12656e-08
2.66987e-06
4.21694e-08
2.67166e-06
1.18218e-07
2.66963e-06
1.73622e-07
2.6619e-06
2.47976e-07
2.64284e-06
3.18788e-07
2.61711e-06
2.92566e-07
2.60154e-06
1.4737e-07
2.5999e-06
-2.89158e-09
2.60864e-06
-8.96119e-08
2.6301e-06
-1.18861e-07
2.65542e-06
-6.08751e-08
2.66837e-06
6.37622e-08
2.66614e-06
1.75221e-07
2.65559e-06
2.34519e-07
2.63672e-06
2.45671e-07
2.6247e-06
1.6947e-07
2.62747e-06
7.15976e-08
2.63786e-06
2.30881e-08
2.65398e-06
2.66654e-08
2.66331e-06
8.29578e-08
2.65846e-06
1.32926e-07
2.66057e-06
1.2621e-07
2.66389e-06
1.68779e-07
2.64337e-06
2.40845e-07
2.62393e-06
2.00626e-07
2.62972e-06
1.22803e-07
2.62727e-06
1.48979e-07
2.6095e-06
1.55979e-07
2.60607e-06
8.67728e-08
2.61613e-06
5.39264e-08
2.61798e-06
9.24718e-08
2.60863e-06
1.08235e-07
2.61255e-06
6.60613e-08
2.63152e-06
6.22321e-08
2.63181e-06
1.51951e-07
2.59297e-06
2.18204e-07
2.5601e-06
1.18443e-07
2.57992e-06
-4.25464e-08
2.63023e-06
-5.94856e-08
2.65496e-06
8.00994e-08
2.64251e-06
2.01168e-07
2.61066e-06
2.35426e-07
2.56896e-06
1.99226e-07
2.54873e-06
8.05685e-08
2.57911e-06
-4.0061e-08
2.62158e-06
-2.24453e-08
2.63778e-06
6.64787e-08
2.63714e-06
1.05068e-07
2.64254e-06
1.03032e-07
2.64579e-06
1.19641e-07
2.62973e-06
1.49299e-07
2.62096e-06
1.09231e-07
2.63239e-06
7.91294e-08
2.665e-06
6.0329e-08
2.67911e-06
1.5374e-07
2.66972e-06
1.80154e-07
2.65496e-06
2.17903e-07
2.15595e-07
2.73038e-06
3.12821e-07
2.73341e-06
3.23932e-07
2.73889e-06
3.3197e-07
2.74215e-06
3.12662e-07
2.74118e-06
2.67827e-07
2.74003e-06
2.15347e-07
2.74057e-06
1.89535e-07
2.74533e-06
1.68696e-07
2.74895e-06
1.64592e-07
2.75102e-06
1.53083e-07
2.75088e-06
1.42006e-07
2.74799e-06
1.3181e-07
2.74597e-06
1.17676e-07
2.74297e-06
1.22499e-07
2.74239e-06
1.19893e-07
2.74148e-06
1.19062e-07
2.73866e-06
1.03021e-07
2.73695e-06
8.49805e-08
2.73514e-06
8.9439e-08
2.7337e-06
7.12398e-08
2.73213e-06
3.589e-08
2.73002e-06
5.70346e-09
2.72963e-06
-1.23249e-08
2.72882e-06
6.95508e-09
2.73167e-06
3.65601e-08
2.73913e-06
8.19725e-08
2.74605e-06
1.24275e-07
2.75158e-06
1.30342e-07
2.74991e-06
1.30584e-07
2.74617e-06
1.13666e-07
2.74356e-06
1.09207e-07
2.74044e-06
1.27404e-07
2.7399e-06
1.43288e-07
2.73672e-06
1.57083e-07
2.73381e-06
1.31146e-07
2.73143e-06
1.05279e-07
2.72726e-06
8.70503e-08
2.72416e-06
3.103e-08
2.72321e-06
-4.88335e-08
2.73138e-06
-1.27771e-07
2.74828e-06
-1.47631e-07
2.76517e-06
-7.81479e-08
2.77446e-06
3.28744e-08
2.77647e-06
1.1621e-07
2.77522e-06
1.74866e-07
2.77051e-06
2.52694e-07
2.75884e-06
3.30454e-07
2.74111e-06
3.10299e-07
2.72983e-06
1.58651e-07
2.72716e-06
-2.20947e-10
2.73027e-06
-9.27273e-08
2.74426e-06
-1.32846e-07
2.76337e-06
-7.99903e-08
2.77376e-06
5.33718e-08
2.77224e-06
1.76744e-07
2.76671e-06
2.40045e-07
2.7536e-06
2.58781e-07
2.74545e-06
1.77627e-07
2.74972e-06
6.73271e-08
2.75719e-06
1.56095e-08
2.77053e-06
1.33333e-08
2.78031e-06
7.31766e-08
2.77385e-06
1.39384e-07
2.77365e-06
1.26408e-07
2.78094e-06
1.61493e-07
2.76467e-06
2.57115e-07
2.74495e-06
2.2034e-07
2.75416e-06
1.13595e-07
2.75699e-06
1.46152e-07
2.73925e-06
1.7372e-07
2.73398e-06
9.2041e-08
2.74391e-06
4.39996e-08
2.74808e-06
8.83029e-08
2.73752e-06
1.18795e-07
2.73691e-06
6.66708e-08
2.75668e-06
4.24579e-08
2.76569e-06
1.42947e-07
2.73095e-06
2.52943e-07
2.69017e-06
1.59218e-07
2.70135e-06
-5.37265e-08
2.75251e-06
-1.10643e-07
2.78278e-06
4.98258e-08
2.77468e-06
2.09269e-07
2.74931e-06
2.608e-07
2.70721e-06
2.41326e-07
2.67484e-06
1.12939e-07
2.70047e-06
-6.56912e-08
2.74989e-06
-7.18719e-08
2.77025e-06
4.61179e-08
2.76683e-06
1.08495e-07
2.77283e-06
9.70243e-08
2.78337e-06
1.09105e-07
2.76686e-06
1.65811e-07
2.74959e-06
1.265e-07
2.75512e-06
7.35951e-08
2.79497e-06
2.04788e-08
2.82349e-06
1.25229e-07
2.81991e-06
1.83734e-07
2.80737e-06
2.30441e-07
2.30667e-07
2.86175e-06
3.10327e-07
2.86495e-06
3.20735e-07
2.86993e-06
3.26985e-07
2.87315e-06
3.09447e-07
2.8726e-06
2.68373e-07
2.8714e-06
2.16546e-07
2.8713e-06
1.89642e-07
2.87586e-06
1.64131e-07
2.87943e-06
1.61026e-07
2.88163e-06
1.50878e-07
2.88162e-06
1.42018e-07
2.87857e-06
1.34865e-07
2.87631e-06
1.19929e-07
2.87307e-06
1.25741e-07
2.87237e-06
1.20597e-07
2.87145e-06
1.19977e-07
2.86892e-06
1.05555e-07
2.86747e-06
8.64284e-08
2.86634e-06
9.05644e-08
2.86533e-06
7.22487e-08
2.86365e-06
3.75779e-08
2.86095e-06
8.39784e-09
2.85967e-06
-1.10441e-08
2.85792e-06
8.70674e-09
2.85935e-06
3.51339e-08
2.86544e-06
7.58758e-08
2.87112e-06
1.18595e-07
2.87651e-06
1.24958e-07
2.87539e-06
1.31696e-07
2.87221e-06
1.16847e-07
2.86981e-06
1.11611e-07
2.86632e-06
1.3089e-07
2.86635e-06
1.43258e-07
2.86451e-06
1.5893e-07
2.86359e-06
1.32066e-07
2.86342e-06
1.05446e-07
2.86123e-06
8.92377e-08
2.85864e-06
3.36276e-08
2.85455e-06
-4.47472e-08
2.85674e-06
-1.29964e-07
2.86601e-06
-1.56895e-07
2.87724e-06
-8.93772e-08
2.88451e-06
2.56021e-08
2.88653e-06
1.14189e-07
2.88607e-06
1.75326e-07
2.88385e-06
2.54918e-07
2.87932e-06
3.34981e-07
2.86987e-06
3.19752e-07
2.86343e-06
1.65091e-07
2.86068e-06
2.5197e-09
2.8594e-06
-9.14438e-08
2.86631e-06
-1.39757e-07
2.87837e-06
-9.20487e-08
2.88567e-06
4.60712e-08
2.88459e-06
1.77823e-07
2.88396e-06
2.40673e-07
2.87706e-06
2.65689e-07
2.87285e-06
1.81829e-07
2.87864e-06
6.15426e-08
2.88318e-06
1.10678e-08
2.8929e-06
3.61546e-09
2.90268e-06
6.33928e-08
2.89572e-06
1.46342e-07
2.89276e-06
1.2937e-07
2.9025e-06
1.51755e-07
2.89175e-06
2.67863e-07
2.87285e-06
2.39237e-07
2.88378e-06
1.02671e-07
2.89097e-06
1.38958e-07
2.87435e-06
1.90341e-07
2.86765e-06
9.87398e-08
2.87583e-06
3.58173e-08
2.88189e-06
8.22499e-08
2.87191e-06
1.2877e-07
2.86662e-06
7.19641e-08
2.88382e-06
2.5258e-08
2.89942e-06
1.27344e-07
2.87237e-06
2.79995e-07
2.82852e-06
2.03068e-07
2.8307e-06
-5.59024e-08
2.87806e-06
-1.58004e-07
2.91017e-06
1.77105e-08
2.90471e-06
2.14726e-07
2.8875e-06
2.78016e-07
2.85043e-06
2.7839e-07
2.80872e-06
1.54656e-07
2.82679e-06
-8.37616e-08
2.87958e-06
-1.2467e-07
2.90269e-06
2.30149e-08
2.89534e-06
1.15838e-07
2.89991e-06
9.24589e-08
2.91765e-06
9.13698e-08
2.90343e-06
1.80022e-07
2.8786e-06
1.51336e-07
2.87524e-06
7.69482e-08
2.91715e-06
-2.14295e-08
2.95826e-06
8.41255e-08
2.96086e-06
1.81133e-07
2.94978e-06
2.41519e-07
2.43476e-07
2.99837e-06
3.07588e-07
3.0021e-06
3.17011e-07
3.00675e-06
3.22327e-07
3.00985e-06
3.06348e-07
3.00973e-06
2.68495e-07
3.0086e-06
2.17678e-07
3.00772e-06
1.90523e-07
3.01177e-06
1.60072e-07
3.01519e-06
1.57614e-07
3.0176e-06
1.48463e-07
3.0178e-06
1.41822e-07
3.01494e-06
1.37727e-07
3.01274e-06
1.22126e-07
3.00954e-06
1.28941e-07
3.00874e-06
1.21391e-07
3.00773e-06
1.20992e-07
3.00558e-06
1.07705e-07
3.00425e-06
8.77544e-08
3.00363e-06
9.11855e-08
3.00293e-06
7.29523e-08
3.00114e-06
3.93704e-08
2.99802e-06
1.15141e-08
2.99589e-06
-8.91169e-09
2.99349e-06
1.1104e-08
2.99361e-06
3.50193e-08
2.99813e-06
7.13468e-08
3.00226e-06
1.14465e-07
3.00709e-06
1.20135e-07
3.00664e-06
1.32145e-07
3.00432e-06
1.19168e-07
3.00237e-06
1.13555e-07
2.99888e-06
1.3438e-07
2.99948e-06
1.42658e-07
2.99874e-06
1.59672e-07
2.99939e-06
1.31416e-07
3.00092e-06
1.03921e-07
3.00053e-06
8.9626e-08
2.99889e-06
3.52605e-08
2.99299e-06
-3.88428e-08
2.99057e-06
-1.27544e-07
2.99264e-06
-1.58966e-07
2.99812e-06
-9.4859e-08
3.00297e-06
2.07513e-08
3.00469e-06
1.12476e-07
3.005e-06
1.75009e-07
3.0046e-06
2.55326e-07
3.00612e-06
3.33457e-07
3.00405e-06
3.21827e-07
3.00213e-06
1.67009e-07
3.00003e-06
4.61454e-09
2.99589e-06
-8.73012e-08
2.99701e-06
-1.40873e-07
3.00225e-06
-9.72933e-08
3.00667e-06
4.16514e-08
3.00594e-06
1.78555e-07
3.00951e-06
2.37106e-07
3.00837e-06
2.66829e-07
3.00742e-06
1.82771e-07
3.01419e-06
5.47806e-08
3.01608e-06
9.17203e-09
3.0221e-06
-2.40535e-09
3.03153e-06
5.39669e-08
3.02547e-06
1.52402e-07
3.02017e-06
1.34668e-07
3.03064e-06
1.41282e-07
3.02588e-06
2.72629e-07
3.00885e-06
2.5626e-07
3.0197e-06
9.18297e-08
3.02976e-06
1.28896e-07
3.01513e-06
2.04968e-07
3.00774e-06
1.06127e-07
3.01294e-06
3.06249e-08
3.01998e-06
7.52059e-08
3.01212e-06
1.36629e-07
3.00303e-06
8.10524e-08
3.01547e-06
1.28228e-08
3.03471e-06
1.08108e-07
3.01699e-06
2.97707e-07
2.97477e-06
2.45296e-07
2.96907e-06
-5.02071e-08
3.00922e-06
-1.98151e-07
3.04005e-06
-1.3119e-08
3.03553e-06
2.1924e-07
3.0263e-06
2.87253e-07
2.99801e-06
3.06674e-07
2.95116e-06
2.01513e-07
2.96061e-06
-9.32154e-08
3.01288e-06
-1.76939e-07
3.03698e-06
-1.09115e-09
3.02574e-06
1.27081e-07
3.02762e-06
9.05798e-08
3.05114e-06
6.78473e-08
3.04135e-06
1.89812e-07
3.01178e-06
1.80913e-07
2.99926e-06
8.94677e-08
3.03846e-06
-6.06327e-08
3.08833e-06
3.42591e-08
3.09645e-06
1.73008e-07
3.08593e-06
2.52043e-07
2.54416e-07
3.14065e-06
3.05028e-07
3.14506e-06
3.12606e-07
3.14967e-06
3.17718e-07
3.15265e-06
3.03371e-07
3.15295e-06
2.68192e-07
3.1521e-06
2.18531e-07
3.15047e-06
1.9215e-07
3.15374e-06
1.56799e-07
3.15692e-06
1.54438e-07
3.15953e-06
1.45849e-07
3.15998e-06
1.41379e-07
3.15758e-06
1.40126e-07
3.15564e-06
1.24068e-07
3.15272e-06
1.31856e-07
3.15192e-06
1.22194e-07
3.15079e-06
1.22123e-07
3.14906e-06
1.09437e-07
3.1477e-06
8.91094e-08
3.14741e-06
9.14723e-08
3.14689e-06
7.34738e-08
3.14503e-06
4.1233e-08
3.14163e-06
1.49106e-08
3.13863e-06
-5.91057e-09
3.13567e-06
1.40613e-08
3.13449e-06
3.62076e-08
3.13741e-06
6.84272e-08
3.14007e-06
1.11799e-07
3.1442e-06
1.1601e-07
3.14449e-06
1.31847e-07
3.14317e-06
1.20494e-07
3.14185e-06
1.14869e-07
3.13876e-06
1.37474e-07
3.13993e-06
1.41487e-07
3.14007e-06
1.59533e-07
3.14179e-06
1.29696e-07
3.14435e-06
1.01364e-07
3.14533e-06
8.86416e-08
3.14476e-06
3.58364e-08
3.13818e-06
-3.22651e-08
3.13279e-06
-1.22158e-07
3.12899e-06
-1.55167e-07
3.12953e-06
-9.53958e-08
3.13194e-06
1.83368e-08
3.13307e-06
1.11352e-07
3.13417e-06
1.73907e-07
3.13489e-06
2.54609e-07
3.14088e-06
3.27459e-07
3.1445e-06
3.18208e-07
3.14619e-06
1.65323e-07
3.14509e-06
5.70956e-09
3.13955e-06
-8.17544e-08
3.13662e-06
-1.37949e-07
3.13622e-06
-9.68854e-08
3.13854e-06
3.93229e-08
3.1382e-06
1.78896e-07
3.14485e-06
2.30464e-07
3.14839e-06
2.63289e-07
3.14958e-06
1.81573e-07
3.1565e-06
4.78672e-08
3.15617e-06
9.4961e-09
3.15895e-06
-5.17941e-09
3.16771e-06
4.5207e-08
3.16382e-06
1.56289e-07
3.15723e-06
1.41257e-07
3.1668e-06
1.31712e-07
3.16757e-06
2.71856e-07
3.15319e-06
2.70643e-07
3.16239e-06
8.26309e-08
3.1737e-06
1.17587e-07
3.16168e-06
2.16987e-07
3.15448e-06
1.1333e-07
3.15604e-06
2.90581e-08
3.16295e-06
6.83026e-08
3.15804e-06
1.41533e-07
3.14657e-06
9.25256e-08
3.15347e-06
5.92396e-09
3.17339e-06
8.81892e-08
3.16485e-06
3.06248e-07
3.12796e-06
2.82183e-07
3.11642e-06
-3.86694e-08
3.14735e-06
-2.29084e-07
3.17468e-06
-4.04406e-08
3.16993e-06
2.23982e-07
3.16719e-06
2.89995e-07
3.14921e-06
3.24655e-07
3.10177e-06
2.48958e-07
3.1031e-06
-9.45489e-08
3.15117e-06
-2.25006e-07
3.17439e-06
-2.43173e-08
3.16026e-06
1.41218e-07
3.15932e-06
9.15198e-08
3.18639e-06
4.07739e-08
3.182e-06
1.94198e-07
3.15137e-06
2.11548e-07
3.13173e-06
1.09102e-07
3.16486e-06
-9.37617e-08
3.21864e-06
-1.95226e-08
3.23079e-06
1.60864e-07
3.22011e-06
2.62726e-07
2.63901e-07
3.28922e-06
3.03003e-07
3.29421e-06
3.07616e-07
3.29912e-06
3.12808e-07
3.30204e-06
3.00452e-07
3.30272e-06
2.67514e-07
3.30239e-06
2.1886e-07
3.30016e-06
1.94377e-07
3.30242e-06
1.54544e-07
3.30526e-06
1.51593e-07
3.30798e-06
1.43131e-07
3.30868e-06
1.40682e-07
3.30691e-06
1.41895e-07
3.30533e-06
1.25643e-07
3.30289e-06
1.34302e-07
3.30219e-06
1.22893e-07
3.30101e-06
1.233e-07
3.29969e-06
1.10753e-07
3.2982e-06
9.06011e-08
3.2981e-06
9.15754e-08
3.29762e-06
7.39502e-08
3.29569e-06
4.31645e-08
3.29211e-06
1.84891e-08
3.28827e-06
-2.06365e-09
3.28482e-06
1.75104e-08
3.28244e-06
3.85855e-08
3.28392e-06
6.69452e-08
3.28548e-06
1.10237e-07
3.28894e-06
1.12551e-07
3.28996e-06
1.30829e-07
3.28954e-06
1.20915e-07
3.28886e-06
1.15546e-07
3.28644e-06
1.39891e-07
3.2881e-06
1.39836e-07
3.28893e-06
1.58703e-07
3.29125e-06
1.27376e-07
3.29423e-06
9.83797e-08
3.29609e-06
8.67777e-08
3.29639e-06
3.55445e-08
3.28991e-06
-2.57927e-08
3.28303e-06
-1.15272e-07
3.27508e-06
-1.47221e-07
3.272e-06
-9.23132e-08
3.27231e-06
1.80266e-08
3.27271e-06
1.10956e-07
3.27458e-06
1.72031e-07
3.27587e-06
2.53325e-07
3.28468e-06
3.1864e-07
3.29208e-06
3.10808e-07
3.29622e-06
1.61186e-07
3.29612e-06
5.8125e-09
3.29025e-06
-7.58875e-08
3.28507e-06
-1.32768e-07
3.28067e-06
-9.24881e-08
3.28196e-06
3.80363e-08
3.28214e-06
1.78712e-07
3.2906e-06
2.22008e-07
3.29743e-06
2.5646e-07
3.29965e-06
1.79351e-07
3.3059e-06
4.16127e-08
3.3038e-06
1.1597e-08
3.30404e-06
-5.41255e-09
3.31185e-06
3.73948e-08
3.31096e-06
1.57174e-07
3.30438e-06
1.47842e-07
3.31176e-06
1.24334e-07
3.3169e-06
2.66711e-07
3.30555e-06
2.81996e-07
3.31206e-06
7.61222e-08
3.32323e-06
1.06415e-07
3.31415e-06
2.2607e-07
3.30793e-06
1.19549e-07
3.3059e-06
3.10849e-08
3.31154e-06
6.26679e-08
3.30962e-06
1.43448e-07
3.29727e-06
1.04874e-07
3.29906e-06
4.13955e-09
3.31727e-06
6.99808e-08
3.31638e-06
3.0713e-07
3.28721e-06
3.11362e-07
3.27221e-06
-2.36722e-08
3.29329e-06
-2.50166e-07
3.31577e-06
-6.29238e-08
3.31027e-06
2.29488e-07
3.31193e-06
2.8833e-07
3.30378e-06
3.32812e-07
3.25979e-06
2.92944e-07
3.25453e-06
-8.92931e-08
3.2954e-06
-2.65871e-07
3.31601e-06
-4.4933e-08
3.30057e-06
1.56661e-07
3.29757e-06
9.45211e-08
3.32573e-06
1.26163e-08
3.32665e-06
1.9328e-07
3.2985e-06
2.39695e-07
3.27505e-06
1.32548e-07
3.3004e-06
-1.19105e-07
3.35332e-06
-7.24476e-08
3.36759e-06
1.46592e-07
3.35651e-06
2.73807e-07
2.72182e-07
3.44485e-06
3.01638e-07
3.4501e-06
3.02361e-07
3.45564e-06
3.07268e-07
3.45863e-06
2.97461e-07
3.45954e-06
2.66608e-07
3.45987e-06
2.18533e-07
3.45731e-06
1.96929e-07
3.45837e-06
1.53488e-07
3.46076e-06
1.49207e-07
3.46343e-06
1.40462e-07
3.46435e-06
1.39759e-07
3.46328e-06
1.42966e-07
3.46212e-06
1.26797e-07
3.46027e-06
1.36151e-07
3.45979e-06
1.23381e-07
3.45869e-06
1.24393e-07
3.45777e-06
1.11674e-07
3.45613e-06
9.22484e-08
3.4561e-06
9.16054e-08
3.45552e-06
7.45227e-08
3.45347e-06
4.52237e-08
3.44973e-06
2.22278e-08
3.44513e-06
2.53412e-09
3.44133e-06
2.13104e-08
3.43807e-06
4.18478e-08
3.43846e-06
6.65531e-08
3.43938e-06
1.09311e-07
3.44227e-06
1.09667e-07
3.44384e-06
1.29255e-07
3.44405e-06
1.20705e-07
3.44385e-06
1.1575e-07
3.44221e-06
1.41527e-07
3.44416e-06
1.37884e-07
3.44554e-06
1.57327e-07
3.44809e-06
1.24829e-07
3.45105e-06
9.54191e-08
3.45336e-06
8.44618e-08
3.45421e-06
3.46958e-08
3.44826e-06
-1.98382e-08
3.4409e-06
-1.07916e-07
3.43047e-06
-1.36792e-07
3.42515e-06
-8.69904e-08
3.42389e-06
1.92813e-08
3.42361e-06
1.11244e-07
3.42617e-06
1.69467e-07
3.42769e-06
2.51804e-07
3.43795e-06
3.08379e-07
3.44746e-06
3.01306e-07
3.45299e-06
1.55649e-07
3.45362e-06
5.18587e-09
3.44806e-06
-7.03284e-08
3.44206e-06
-1.26767e-07
3.43535e-06
-8.57795e-08
3.43654e-06
3.68491e-08
3.4374e-06
1.77847e-07
3.44655e-06
2.12863e-07
3.45534e-06
2.47664e-07
3.45779e-06
1.76903e-07
3.46281e-06
3.65926e-08
3.45935e-06
1.50548e-08
3.45779e-06
-3.84838e-09
3.4644e-06
3.07873e-08
3.46674e-06
1.54837e-07
3.46134e-06
1.53236e-07
3.46579e-06
1.19891e-07
3.47376e-06
2.58734e-07
3.46552e-06
2.90239e-07
3.46893e-06
7.27091e-08
3.47901e-06
9.63369e-08
3.47291e-06
2.32169e-07
3.46823e-06
1.24231e-07
3.46319e-06
3.61263e-08
3.46664e-06
5.92159e-08
3.46708e-06
1.43003e-07
3.4552e-06
1.16759e-07
3.45303e-06
6.30743e-09
3.46794e-06
5.50762e-08
3.4725e-06
3.02562e-07
3.45201e-06
3.31854e-07
3.43584e-06
-7.49661e-09
3.44754e-06
-2.61872e-07
3.46458e-06
-7.99675e-08
3.45831e-06
2.35767e-07
3.46231e-06
2.84326e-07
3.46212e-06
3.32999e-07
3.42457e-06
3.30495e-07
3.41468e-06
-7.94043e-08
3.44636e-06
-2.97552e-07
3.46311e-06
-6.16778e-08
3.44809e-06
1.71685e-07
3.44418e-06
9.84228e-08
3.47118e-06
-1.43812e-08
3.47657e-06
1.87893e-07
3.45362e-06
2.62647e-07
3.42978e-06
1.56383e-07
3.44707e-06
-1.36395e-07
3.49529e-06
-1.20665e-07
3.50995e-06
1.31931e-07
3.49881e-06
2.84947e-07
2.79278e-07
3.60832e-06
3.00765e-07
3.61335e-06
2.97323e-07
3.61974e-06
3.00886e-07
3.62302e-06
2.94173e-07
3.62394e-06
2.65694e-07
3.62487e-06
2.17598e-07
3.62236e-06
1.99443e-07
3.6221e-06
1.53749e-07
3.62386e-06
1.47447e-07
3.62632e-06
1.38005e-07
3.6274e-06
1.38679e-07
3.62701e-06
1.43355e-07
3.62629e-06
1.2751e-07
3.62512e-06
1.37326e-07
3.62492e-06
1.23577e-07
3.62406e-06
1.25251e-07
3.62352e-06
1.12219e-07
3.62179e-06
9.39746e-08
3.62178e-06
9.16231e-08
3.621e-06
7.52953e-08
3.61872e-06
4.75037e-08
3.61479e-06
2.61635e-08
3.60958e-06
7.73826e-09
3.6056e-06
2.529e-08
3.60187e-06
4.55823e-08
3.60156e-06
6.68631e-08
3.60226e-06
1.08614e-07
3.60464e-06
1.07285e-07
3.60652e-06
1.27376e-07
3.60702e-06
1.20203e-07
3.60705e-06
1.15717e-07
3.60617e-06
1.42413e-07
3.60821e-06
1.35838e-07
3.61004e-06
1.55505e-07
3.61256e-06
1.22308e-07
3.61524e-06
9.27391e-08
3.6177e-06
8.20024e-08
3.6188e-06
3.35876e-08
3.61353e-06
-1.45597e-08
3.60624e-06
-1.00634e-07
3.59464e-06
-1.25189e-07
3.58817e-06
-8.05154e-08
3.58593e-06
2.15219e-08
3.58514e-06
1.12029e-07
3.58822e-06
1.6639e-07
3.58988e-06
2.50138e-07
3.60064e-06
2.9762e-07
3.61106e-06
2.90892e-07
3.61722e-06
1.49482e-07
3.61821e-06
4.1979e-09
3.61321e-06
-6.53308e-08
3.60732e-06
-1.20877e-07
3.59964e-06
-7.81001e-08
3.60131e-06
3.51807e-08
3.60298e-06
1.76176e-07
3.61201e-06
2.03839e-07
3.62176e-06
2.37916e-07
3.62408e-06
1.74582e-07
3.62759e-06
3.30773e-08
3.62319e-06
1.94616e-08
3.6205e-06
-1.1608e-09
3.6257e-06
2.55818e-08
3.63088e-06
1.49657e-07
3.6275e-06
1.56617e-07
3.62888e-06
1.18512e-07
3.63814e-06
2.49475e-07
3.63288e-06
2.95495e-07
3.63338e-06
7.22163e-08
3.64185e-06
8.78621e-08
3.63855e-06
2.35467e-07
3.63562e-06
1.27166e-07
3.62845e-06
4.32934e-08
3.62918e-06
5.84913e-08
3.63097e-06
1.41206e-07
3.62055e-06
1.27179e-07
3.61585e-06
1.10079e-08
3.62668e-06
4.425e-08
3.6344e-06
2.94837e-07
3.62237e-06
3.43885e-07
3.60686e-06
8.02012e-09
3.6104e-06
-2.65417e-07
3.62194e-06
-9.15088e-08
3.61524e-06
2.42471e-07
3.61996e-06
2.79601e-07
3.62525e-06
3.27717e-07
3.59577e-06
3.59967e-07
3.58313e-06
-6.67653e-08
3.60481e-06
-3.19229e-07
3.6171e-06
-7.39652e-08
3.60403e-06
1.8475e-07
3.60033e-06
1.02122e-07
3.62438e-06
-3.84278e-08
3.63302e-06
1.79251e-07
3.61682e-06
2.78846e-07
3.59537e-06
1.77838e-07
3.60538e-06
-1.46402e-07
3.64638e-06
-1.61667e-07
3.66022e-06
1.18091e-07
3.64986e-06
2.95304e-07
2.85046e-07
3.78028e-06
2.99924e-07
3.7846e-06
2.93e-07
3.79181e-06
2.93678e-07
3.79573e-06
2.9025e-07
3.79644e-06
2.64991e-07
3.79777e-06
2.16263e-07
3.79566e-06
2.01552e-07
3.79408e-06
1.55329e-07
3.79503e-06
1.46502e-07
3.79712e-06
1.35914e-07
3.79824e-06
1.37551e-07
3.79845e-06
1.43154e-07
3.79816e-06
1.27792e-07
3.79769e-06
1.37797e-07
3.79782e-06
1.23445e-07
3.79733e-06
1.2575e-07
3.79713e-06
1.12414e-07
3.79546e-06
9.56462e-08
3.79544e-06
9.16466e-08
3.79443e-06
7.63005e-08
3.79186e-06
5.00738e-08
3.78768e-06
3.03389e-08
3.78203e-06
1.33902e-08
3.778e-06
2.93266e-08
3.77415e-06
4.94253e-08
3.77343e-06
6.75819e-08
3.77415e-06
1.07899e-07
3.77606e-06
1.05373e-07
3.77799e-06
1.25442e-07
3.7785e-06
1.19695e-07
3.77856e-06
1.15659e-07
3.77833e-06
1.42638e-07
3.78032e-06
1.33854e-07
3.78253e-06
1.53294e-07
3.78488e-06
1.19954e-07
3.78719e-06
9.04296e-08
3.78961e-06
7.95902e-08
3.79076e-06
3.24358e-08
3.78617e-06
-9.97592e-09
3.77913e-06
-9.35937e-08
3.76722e-06
-1.13281e-07
3.76026e-06
-7.35541e-08
3.75753e-06
2.42594e-08
3.75652e-06
1.13036e-07
3.75988e-06
1.63028e-07
3.7618e-06
2.48214e-07
3.77255e-06
2.86877e-07
3.78318e-06
2.80264e-07
3.7895e-06
1.43161e-07
3.79049e-06
3.20067e-09
3.78608e-06
-6.09213e-08
3.78076e-06
-1.1555e-07
3.77299e-06
-7.03346e-08
3.77531e-06
3.28644e-08
3.77786e-06
1.73626e-07
3.78631e-06
1.95383e-07
3.79636e-06
2.27868e-07
3.79856e-06
1.72381e-07
3.80055e-06
3.10876e-08
3.79561e-06
2.44075e-08
3.79237e-06
2.0745e-09
3.7961e-06
2.1855e-08
3.80332e-06
1.42438e-07
3.80228e-06
1.57652e-07
3.801e-06
1.19795e-07
3.81027e-06
2.40204e-07
3.80777e-06
2.98e-07
3.80588e-06
7.41042e-08
3.81258e-06
8.11628e-08
3.81176e-06
2.36286e-07
3.81044e-06
1.28483e-07
3.80208e-06
5.165e-08
3.79998e-06
6.05909e-08
3.80206e-06
1.39134e-07
3.79367e-06
1.35561e-07
3.78773e-06
1.69498e-08
3.79441e-06
3.7572e-08
3.80337e-06
2.85876e-07
3.79871e-06
3.48544e-07
3.78507e-06
2.16617e-08
3.78201e-06
-2.62356e-07
3.78835e-06
-9.78517e-08
3.78178e-06
2.4904e-07
3.78626e-06
2.75129e-07
3.79447e-06
3.19497e-07
3.77342e-06
3.81026e-07
3.75954e-06
-5.28903e-08
3.77149e-06
-3.31179e-07
3.77941e-06
-8.18832e-08
3.76947e-06
1.94689e-07
3.76675e-06
1.04841e-07
3.78658e-06
-5.82552e-08
3.79716e-06
1.68669e-07
3.78813e-06
2.87873e-07
3.77089e-06
1.95084e-07
3.77501e-06
-1.50523e-07
3.80764e-06
-1.94302e-07
3.82011e-06
1.05624e-07
3.81164e-06
3.03777e-07
2.89301e-07
3.96125e-06
2.98413e-07
3.96448e-06
2.89767e-07
3.9722e-06
2.85962e-07
3.97715e-06
2.85299e-07
3.97755e-06
2.6459e-07
3.97893e-06
2.14886e-07
3.97754e-06
2.02939e-07
3.9748e-06
1.58068e-07
3.97475e-06
1.46548e-07
3.97635e-06
1.34319e-07
3.97741e-06
1.36485e-07
3.97804e-06
1.42524e-07
3.97813e-06
1.27703e-07
3.97834e-06
1.37589e-07
3.97879e-06
1.22993e-07
3.97871e-06
1.25832e-07
3.97883e-06
1.12292e-07
3.97735e-06
9.71306e-08
3.97733e-06
9.1667e-08
3.97613e-06
7.74955e-08
3.97327e-06
5.29377e-08
3.96886e-06
3.47534e-08
3.96291e-06
1.93362e-08
3.95885e-06
3.3384e-08
3.95511e-06
5.31673e-08
3.95412e-06
6.85726e-08
3.95491e-06
1.07104e-07
3.95636e-06
1.03931e-07
3.95815e-06
1.23646e-07
3.95851e-06
1.19341e-07
3.95847e-06
1.15696e-07
3.95882e-06
1.42292e-07
3.96066e-06
1.32006e-07
3.96323e-06
1.50727e-07
3.96537e-06
1.17819e-07
3.96732e-06
8.84761e-08
3.96958e-06
7.73281e-08
3.97064e-06
3.13747e-08
3.96671e-06
-6.04077e-09
3.95986e-06
-8.67445e-08
3.94813e-06
-1.01553e-07
3.94099e-06
-6.64112e-08
3.93809e-06
2.71543e-08
3.93715e-06
1.13982e-07
3.94059e-06
1.59586e-07
3.94301e-06
2.45789e-07
3.95355e-06
2.76338e-07
3.96407e-06
2.69748e-07
3.97027e-06
1.36962e-07
3.971e-06
2.47064e-09
3.9671e-06
-5.70208e-08
3.96244e-06
-1.10889e-07
3.95509e-06
-6.29843e-08
3.95792e-06
3.00274e-08
3.96139e-06
1.70161e-07
3.96914e-06
1.87634e-07
3.97911e-06
2.17892e-07
3.98138e-06
1.70111e-07
3.98197e-06
3.0495e-08
3.97689e-06
2.94899e-08
3.97357e-06
5.39234e-09
3.97591e-06
1.95217e-08
3.9842e-06
1.3414e-07
3.9854e-06
1.56457e-07
3.9822e-06
1.2299e-07
3.99064e-06
2.31773e-07
3.99057e-06
2.98068e-07
3.98694e-06
7.77274e-08
3.99188e-06
7.62248e-08
3.99318e-06
2.34992e-07
3.99311e-06
1.28554e-07
3.98434e-06
6.0413e-08
3.97975e-06
6.51846e-08
3.98119e-06
1.37691e-07
3.97498e-06
1.41777e-07
3.96873e-06
2.31974e-08
3.9717e-06
3.46058e-08
3.98058e-06
2.7699e-07
3.98174e-06
3.47384e-07
3.97056e-06
3.28449e-08
3.96246e-06
-2.54259e-07
3.96414e-06
-9.95299e-08
3.95832e-06
2.54861e-07
3.96217e-06
2.71273e-07
3.97119e-06
3.1048e-07
3.95784e-06
3.94383e-07
3.94378e-06
-3.88367e-08
3.94712e-06
-3.34518e-07
3.95125e-06
-8.60095e-08
3.94515e-06
2.00787e-07
3.94381e-06
1.06175e-07
3.95868e-06
-7.31222e-08
3.96997e-06
1.57385e-07
3.96765e-06
2.90188e-07
3.95554e-06
2.07196e-07
3.95542e-06
-1.50408e-07
3.97964e-06
-2.18523e-07
3.9907e-06
9.45666e-08
3.98516e-06
3.09323e-07
2.91936e-07
4.15156e-06
2.95426e-07
4.15364e-06
2.87688e-07
4.16121e-06
2.7839e-07
4.16751e-06
2.79004e-07
4.1678e-06
2.643e-07
4.16877e-06
2.13918e-07
4.16828e-06
2.03429e-07
4.16476e-06
1.61585e-07
4.1636e-06
1.47707e-07
4.16458e-06
1.33342e-07
4.16551e-06
1.35554e-07
4.16635e-06
1.41683e-07
4.16671e-06
1.27346e-07
4.1675e-06
1.36796e-07
4.16822e-06
1.22269e-07
4.16854e-06
1.25522e-07
4.16891e-06
1.11916e-07
4.1677e-06
9.83407e-08
4.1677e-06
9.16693e-08
4.16641e-06
7.87871e-08
4.16332e-06
5.60271e-08
4.15873e-06
3.93442e-08
4.15263e-06
2.54297e-08
4.14853e-06
3.74857e-08
4.14494e-06
5.67557e-08
4.14369e-06
6.9828e-08
4.1445e-06
1.06295e-07
4.14547e-06
1.0296e-07
4.14702e-06
1.2209e-07
4.14719e-06
1.19176e-07
4.14703e-06
1.15854e-07
4.14788e-06
1.41446e-07
4.14959e-06
1.30292e-07
4.15248e-06
1.47838e-07
4.1544e-06
1.15896e-07
4.15605e-06
8.68265e-08
4.15811e-06
7.52702e-08
4.159e-06
3.04867e-08
4.15563e-06
-2.67008e-09
4.14884e-06
-7.996e-08
4.13752e-06
-9.02319e-08
4.1303e-06
-5.91831e-08
4.12744e-06
3.00113e-08
4.1268e-06
1.14625e-07
4.13019e-06
1.5619e-07
4.13339e-06
2.42589e-07
4.14374e-06
2.6599e-07
4.15404e-06
2.59452e-07
4.15994e-06
1.31063e-07
4.16021e-06
2.19619e-09
4.15669e-06
-5.35034e-08
4.15259e-06
-1.06789e-07
4.14591e-06
-5.63021e-08
4.14902e-06
2.69159e-08
4.15342e-06
1.6576e-07
4.16054e-06
1.80516e-07
4.17024e-06
2.08189e-07
4.17277e-06
1.67581e-07
4.17217e-06
3.1096e-08
4.16731e-06
3.43479e-08
4.16424e-06
8.465e-09
4.16541e-06
1.83508e-08
4.17391e-06
1.25642e-07
4.1769e-06
1.53471e-07
4.17267e-06
1.2722e-07
4.17984e-06
2.24603e-07
4.18184e-06
2.96063e-07
4.17705e-06
8.25197e-08
4.1803e-06
7.29779e-08
4.18334e-06
2.31947e-07
4.18405e-06
1.27845e-07
4.17542e-06
6.90477e-08
4.16897e-06
7.16335e-08
4.1692e-06
1.37458e-07
4.16491e-06
1.4607e-07
4.15886e-06
2.92435e-08
4.15883e-06
3.46402e-08
4.16696e-06
2.68862e-07
4.17228e-06
3.42059e-07
4.16362e-06
4.15051e-08
4.15188e-06
-2.42522e-07
4.14956e-06
-9.72045e-08
4.145e-06
2.59418e-07
4.14831e-06
2.67966e-07
4.1566e-06
3.02193e-07
4.1496e-06
4.01382e-07
4.13602e-06
-2.52561e-08
4.13233e-06
-3.30832e-07
4.13346e-06
-8.71387e-08
4.13144e-06
2.02808e-07
4.13161e-06
1.06001e-07
4.14131e-06
-8.2821e-08
4.15229e-06
1.46408e-07
4.15569e-06
2.86782e-07
4.14891e-06
2.13978e-07
4.14616e-06
-1.47651e-07
4.16266e-06
-2.35023e-07
4.17252e-06
8.47028e-08
4.17058e-06
3.11262e-07
2.92972e-07
4.35133e-06
2.90341e-07
4.35267e-06
2.86346e-07
4.35928e-06
2.71785e-07
4.36696e-06
2.71322e-07
4.36765e-06
2.63614e-07
4.36779e-06
2.13778e-07
4.36815e-06
2.0307e-07
4.36442e-06
1.65314e-07
4.36214e-06
1.49983e-07
4.36237e-06
1.33108e-07
4.36315e-06
1.34779e-07
4.36399e-06
1.4084e-07
4.36446e-06
1.26881e-07
4.36568e-06
1.35573e-07
4.36659e-06
1.21354e-07
4.3672e-06
1.24917e-07
4.36773e-06
1.11389e-07
4.36681e-06
9.92617e-08
4.36682e-06
9.1652e-08
4.36554e-06
8.00733e-08
4.36234e-06
5.92275e-08
4.35768e-06
4.39975e-08
4.35158e-06
3.15302e-08
4.34741e-06
4.16596e-08
4.34394e-06
6.02253e-08
4.34238e-06
7.13888e-08
4.34309e-06
1.05587e-07
4.34361e-06
1.02435e-07
4.3449e-06
1.20799e-07
4.34493e-06
1.19143e-07
4.3447e-06
1.16089e-07
4.34598e-06
1.40165e-07
4.3476e-06
1.28671e-07
4.35075e-06
1.44686e-07
4.3525e-06
1.14155e-07
4.35388e-06
8.54399e-08
4.3557e-06
7.34556e-08
4.35635e-06
2.98363e-08
4.35342e-06
2.57888e-10
4.34659e-06
-7.31305e-08
4.33576e-06
-7.94066e-08
4.32849e-06
-5.19041e-08
4.32576e-06
3.27354e-08
4.32559e-06
1.14791e-07
4.32892e-06
1.52867e-07
4.33311e-06
2.38399e-07
4.34336e-06
2.55737e-07
4.35343e-06
2.49384e-07
4.3589e-06
1.25596e-07
4.35861e-06
2.48659e-09
4.35531e-06
-5.02127e-08
4.35156e-06
-1.03034e-07
4.34565e-06
-5.03926e-08
4.3488e-06
2.37627e-08
4.35414e-06
1.60422e-07
4.36083e-06
1.73829e-07
4.37016e-06
1.98862e-07
4.37307e-06
1.64669e-07
4.37152e-06
3.2644e-08
4.36717e-06
3.86992e-08
4.3645e-06
1.11287e-08
4.36481e-06
1.80419e-08
4.37287e-06
1.17583e-07
4.37706e-06
1.49284e-07
4.37261e-06
1.31666e-07
4.37846e-06
2.18752e-07
4.38215e-06
2.92375e-07
4.37662e-06
8.80552e-08
4.37823e-06
7.13666e-08
4.38266e-06
2.27513e-07
4.38372e-06
1.26784e-07
4.3755e-06
7.72674e-08
4.36797e-06
7.91618e-08
4.36679e-06
1.3864e-07
4.36396e-06
1.48897e-07
4.35824e-06
3.49636e-08
4.35597e-06
3.69131e-08
4.36316e-06
2.61669e-07
4.37117e-06
3.34055e-07
4.36474e-06
4.79332e-08
4.35051e-06
-2.28296e-07
4.3449e-06
-9.15967e-08
4.34189e-06
2.62433e-07
4.3449e-06
2.64956e-07
4.35158e-06
2.95511e-07
4.34938e-06
4.03581e-07
4.33663e-06
-1.25016e-08
4.32762e-06
-3.21826e-07
4.32652e-06
-8.60394e-08
4.32837e-06
2.00966e-07
4.33e-06
1.04367e-07
4.33484e-06
-8.76624e-08
4.34484e-06
1.36415e-07
4.35276e-06
2.78856e-07
4.35099e-06
2.15753e-07
4.34692e-06
-1.43584e-07
4.35681e-06
-2.44909e-07
4.36569e-06
7.58225e-08
4.3675e-06
3.09447e-07
2.92561e-07
4.56054e-06
2.82974e-07
4.56202e-06
2.8487e-07
4.56692e-06
2.66878e-07
4.57564e-06
2.6261e-07
4.57744e-06
2.61812e-07
4.57656e-06
2.14653e-07
4.57747e-06
2.02163e-07
4.57415e-06
1.68633e-07
4.57091e-06
1.53219e-07
4.57027e-06
1.33753e-07
4.57088e-06
1.34167e-07
4.5716e-06
1.40123e-07
4.57196e-06
1.26523e-07
4.57342e-06
1.34112e-07
4.57443e-06
1.2034e-07
4.5752e-06
1.24153e-07
4.57573e-06
1.10855e-07
4.57504e-06
9.99551e-08
4.57505e-06
9.16379e-08
4.57384e-06
8.12821e-08
4.57065e-06
6.2418e-08
4.56607e-06
4.85804e-08
4.5601e-06
3.75027e-08
4.55586e-06
4.58939e-08
4.55247e-06
6.3617e-08
4.5506e-06
7.32604e-08
4.55112e-06
1.05064e-07
4.55127e-06
1.02285e-07
4.55233e-06
1.19739e-07
4.55232e-06
1.19155e-07
4.55207e-06
1.16334e-07
4.55372e-06
1.38522e-07
4.55529e-06
1.27099e-07
4.5586e-06
1.41371e-07
4.56019e-06
1.12566e-07
4.56132e-06
8.43072e-08
4.56285e-06
7.19256e-08
4.5632e-06
2.94898e-08
4.56056e-06
2.90067e-09
4.55362e-06
-6.61969e-08
4.54332e-06
-6.91027e-08
4.53605e-06
-4.46292e-08
4.5335e-06
3.52805e-08
4.5339e-06
1.1439e-07
4.5372e-06
1.49566e-07
4.54247e-06
2.33132e-07
4.55273e-06
2.45474e-07
4.56262e-06
2.39499e-07
4.56757e-06
1.20647e-07
4.56667e-06
3.38218e-09
4.56343e-06
-4.69716e-08
4.55976e-06
-9.93605e-08
4.55461e-06
-4.52512e-08
4.55764e-06
2.07372e-08
4.56388e-06
1.54186e-07
4.57038e-06
1.6733e-07
4.5793e-06
1.89932e-07
4.58265e-06
1.61323e-07
4.58044e-06
3.48579e-08
4.57677e-06
4.23637e-08
4.57452e-06
1.33763e-08
4.57424e-06
1.83218e-08
4.5815e-06
1.10333e-07
4.58629e-06
1.44485e-07
4.58227e-06
1.35693e-07
4.58699e-06
2.14025e-07
4.592e-06
2.87372e-07
4.58604e-06
9.40181e-08
4.58605e-06
7.13537e-08
4.59148e-06
2.22083e-07
4.59257e-06
1.25689e-07
4.58487e-06
8.49728e-08
4.577e-06
8.70271e-08
4.57454e-06
1.41104e-07
4.57268e-06
1.50755e-07
4.56714e-06
4.04988e-08
4.56328e-06
4.07787e-08
4.56967e-06
2.55281e-07
4.57918e-06
3.24546e-07
4.5745e-06
5.2614e-08
4.55868e-06
-2.12482e-07
4.55053e-06
-8.34443e-08
4.54906e-06
2.63901e-07
4.55201e-06
2.62007e-07
4.55678e-06
2.90746e-07
4.55794e-06
4.02416e-07
4.54616e-06
-7.22256e-10
4.5334e-06
-3.09061e-07
4.53068e-06
-8.33251e-08
4.5358e-06
1.95846e-07
4.53876e-06
1.01408e-07
4.53949e-06
-8.83918e-08
4.54819e-06
1.27712e-07
4.55945e-06
2.67594e-07
4.56203e-06
2.13175e-07
4.55763e-06
-1.39179e-07
4.56217e-06
-2.49457e-07
4.57015e-06
6.78517e-08
4.57533e-06
3.04261e-07
2.90933e-07
4.77916e-06
2.73773e-07
4.78192e-06
2.82118e-07
4.78485e-06
2.6394e-07
4.79376e-06
2.53702e-07
4.79733e-06
2.58239e-07
4.7957e-06
2.16287e-07
4.79663e-06
2.01232e-07
4.79421e-06
1.71051e-07
4.79038e-06
1.57056e-07
4.78873e-06
1.35398e-07
4.78915e-06
1.33751e-07
4.78973e-06
1.39537e-07
4.78977e-06
1.26488e-07
4.79126e-06
1.32619e-07
4.79228e-06
1.19318e-07
4.79307e-06
1.23368e-07
4.79346e-06
1.10462e-07
4.79288e-06
1.0054e-07
4.79284e-06
9.16746e-08
4.79173e-06
8.23916e-08
4.78864e-06
6.55132e-08
4.78423e-06
5.29835e-08
4.77851e-06
4.32235e-08
4.77429e-06
5.01205e-08
4.77098e-06
6.69225e-08
4.76886e-06
7.53759e-08
4.76919e-06
1.04738e-07
4.76908e-06
1.02397e-07
4.76997e-06
1.18843e-07
4.77e-06
1.19125e-07
4.7698e-06
1.16535e-07
4.77171e-06
1.36615e-07
4.77325e-06
1.25558e-07
4.77661e-06
1.38017e-07
4.77805e-06
1.11122e-07
4.77891e-06
8.34459e-08
4.78011e-06
7.07285e-08
4.78009e-06
2.95123e-08
4.77755e-06
5.43507e-09
4.7705e-06
-5.91471e-08
4.76071e-06
-5.93162e-08
4.75353e-06
-3.74459e-08
4.7512e-06
3.76159e-08
4.75218e-06
1.13404e-07
4.75555e-06
1.46201e-07
4.76185e-06
2.26831e-07
4.77219e-06
2.35137e-07
4.78196e-06
2.29728e-07
4.78637e-06
1.16236e-07
4.78489e-06
4.8591e-09
4.78153e-06
-4.3608e-08
4.77767e-06
-9.55047e-08
4.7732e-06
-4.07787e-08
4.77598e-06
1.79532e-08
4.78301e-06
1.47157e-07
4.78955e-06
1.60789e-07
4.79814e-06
1.81343e-07
4.80196e-06
1.5751e-07
4.79938e-06
3.74365e-08
4.79647e-06
4.52681e-08
4.79454e-06
1.53063e-08
4.79385e-06
1.90106e-08
4.80015e-06
1.04037e-07
4.80508e-06
1.39555e-07
4.80188e-06
1.38895e-07
4.80581e-06
2.10089e-07
4.81182e-06
2.81362e-07
4.8057e-06
1.00145e-07
4.80417e-06
7.28813e-08
4.81016e-06
2.16095e-07
4.81109e-06
1.24756e-07
4.80388e-06
9.21795e-08
4.79627e-06
9.46415e-08
4.7929e-06
1.44477e-07
4.79162e-06
1.52029e-07
4.78601e-06
4.61065e-08
4.781e-06
4.5791e-08
4.78683e-06
2.49456e-07
4.79702e-06
3.14352e-07
4.79354e-06
5.60949e-08
4.77681e-06
-1.95753e-07
4.76684e-06
-7.34735e-08
4.7667e-06
2.64042e-07
4.76969e-06
2.59017e-07
4.77263e-06
2.87806e-07
4.77602e-06
3.99025e-07
4.76521e-06
1.00826e-08
4.74997e-06
-2.93812e-07
4.74608e-06
-7.94414e-08
4.75367e-06
1.88253e-07
4.75776e-06
9.73186e-08
4.75539e-06
-8.60186e-08
4.76281e-06
1.20288e-07
4.77637e-06
2.54035e-07
4.78248e-06
2.07066e-07
4.77836e-06
-1.35054e-07
4.77886e-06
-2.49957e-07
4.78588e-06
6.08276e-08
4.7937e-06
2.96446e-07
2.8835e-07
5.0074e-06
2.63691e-07
5.01238e-06
2.77135e-07
5.01382e-06
2.62501e-07
5.02178e-06
2.45748e-07
5.02737e-06
2.52645e-07
5.02573e-06
2.1793e-07
5.0261e-06
2.00858e-07
5.02476e-06
1.72397e-07
5.02087e-06
1.60942e-07
5.01818e-06
1.38088e-07
5.01829e-06
1.33647e-07
5.01884e-06
1.38984e-07
5.01841e-06
1.26918e-07
5.01972e-06
1.31303e-07
5.02069e-06
1.18356e-07
5.0214e-06
1.22652e-07
5.02152e-06
1.10346e-07
5.0209e-06
1.01163e-07
5.02074e-06
9.18258e-08
5.01972e-06
8.34181e-08
5.01676e-06
6.84717e-08
5.01259e-06
5.71496e-08
5.00721e-06
4.86038e-08
5.00309e-06
5.42432e-08
4.99993e-06
7.00786e-08
4.99771e-06
7.75956e-08
4.9979e-06
1.04558e-07
4.99766e-06
1.02635e-07
4.99846e-06
1.18035e-07
4.9986e-06
1.18992e-07
4.99847e-06
1.16659e-07
5.00054e-06
1.34553e-07
5.00204e-06
1.24057e-07
5.0053e-06
1.34754e-07
5.00659e-06
1.09832e-07
5.00716e-06
8.28762e-08
5.00798e-06
6.99078e-08
5.00753e-06
2.99568e-08
5.00494e-06
8.03177e-09
4.99779e-06
-5.19956e-08
4.9885e-06
-5.00262e-08
4.9815e-06
-3.04455e-08
4.97939e-06
3.97183e-08
4.98092e-06
1.11875e-07
4.98443e-06
1.42691e-07
4.99162e-06
2.19647e-07
5.00205e-06
2.24708e-07
5.01178e-06
2.19993e-07
5.01572e-06
1.12301e-07
5.01374e-06
6.83527e-09
5.01012e-06
-3.99917e-08
5.00587e-06
-9.12483e-08
5.0019e-06
-3.68083e-08
5.00436e-06
1.54904e-08
5.01201e-06
1.3951e-07
5.01877e-06
1.5403e-07
5.02713e-06
1.72979e-07
5.03146e-06
1.53185e-07
5.02881e-06
4.00845e-08
5.02664e-06
4.7431e-08
5.0249e-06
1.705e-08
5.02388e-06
2.00308e-08
5.02922e-06
9.86989e-08
5.03395e-06
1.34824e-07
5.03175e-06
1.41092e-07
5.03526e-06
2.06582e-07
5.04204e-06
2.74583e-07
5.03599e-06
1.0619e-07
5.03305e-06
7.58241e-08
5.03914e-06
2.10004e-07
5.03979e-06
1.24104e-07
5.03301e-06
9.89608e-08
5.02603e-06
1.01623e-07
5.02224e-06
1.48273e-07
5.02132e-06
1.52942e-07
5.01541e-06
5.20225e-08
5.0095e-06
5.16957e-08
5.01498e-06
2.43984e-07
5.02534e-06
3.03987e-07
5.02255e-06
5.88895e-08
5.00537e-06
-1.78575e-07
4.99426e-06
-6.23698e-08
4.99513e-06
2.63175e-07
4.99812e-06
2.56029e-07
4.99954e-06
2.86383e-07
5.00437e-06
3.94202e-07
4.99442e-06
2.00301e-08
4.97763e-06
-2.77026e-07
4.97291e-06
-7.47185e-08
4.98212e-06
1.7904e-07
4.9871e-06
9.23344e-08
4.98269e-06
-8.16081e-08
4.98906e-06
1.13919e-07
5.00407e-06
2.39032e-07
5.01287e-06
1.98263e-07
5.00936e-06
-1.31539e-07
5.007e-06
-2.47597e-07
5.01303e-06
5.47915e-08
5.02261e-06
2.86864e-07
2.85069e-07
5.24575e-06
2.5391e-07
5.25331e-06
2.6958e-07
5.25443e-06
2.61378e-07
5.26039e-06
2.39786e-07
5.26761e-06
2.45425e-07
5.26699e-06
2.18549e-07
5.26647e-06
2.01377e-07
5.26592e-06
1.72953e-07
5.26262e-06
1.64236e-07
5.25903e-06
1.41684e-07
5.2586e-06
1.34071e-07
5.25925e-06
1.38336e-07
5.25836e-06
1.27804e-07
5.25927e-06
1.30394e-07
5.26014e-06
1.1749e-07
5.26076e-06
1.22027e-07
5.26053e-06
1.10577e-07
5.25974e-06
1.01952e-07
5.2594e-06
9.21724e-08
5.2584e-06
8.44159e-08
5.25558e-06
7.12876e-08
5.25166e-06
6.10697e-08
5.24667e-06
5.35944e-08
5.24275e-06
5.81703e-08
5.23981e-06
7.30143e-08
5.23764e-06
7.97634e-08
5.23777e-06
1.04429e-07
5.23754e-06
1.0287e-07
5.23832e-06
1.17251e-07
5.23858e-06
1.18731e-07
5.23854e-06
1.167e-07
5.24066e-06
1.32438e-07
5.2421e-06
1.22616e-07
5.24517e-06
1.31686e-07
5.24628e-06
1.08717e-07
5.24655e-06
8.2606e-08
5.24697e-06
6.94876e-08
5.24608e-06
3.08448e-08
5.24329e-06
1.08259e-08
5.23606e-06
-4.47633e-08
5.22723e-06
-4.11943e-08
5.22047e-06
-2.3692e-08
5.21861e-06
4.15756e-08
5.2206e-06
1.09888e-07
5.2243e-06
1.38989e-07
5.23217e-06
2.11779e-07
5.24266e-06
2.14218e-07
5.25243e-06
2.10224e-07
5.25602e-06
1.08713e-07
5.25367e-06
9.18074e-09
5.24974e-06
-3.60646e-08
5.24495e-06
-8.64593e-08
5.2413e-06
-3.31534e-08
5.24339e-06
1.34021e-08
5.25143e-06
1.3147e-07
5.2585e-06
1.46957e-07
5.26677e-06
1.64709e-07
5.27166e-06
1.48297e-07
5.2692e-06
4.25443e-08
5.26769e-06
4.89365e-08
5.26603e-06
1.87102e-08
5.2647e-06
2.13687e-08
5.26915e-06
9.42452e-08
5.2735e-06
1.30474e-07
5.27231e-06
1.42283e-07
5.27571e-06
2.03182e-07
5.28307e-06
2.67218e-07
5.27733e-06
1.11929e-07
5.27319e-06
7.99643e-08
5.27897e-06
2.04226e-07
5.27926e-06
1.23814e-07
5.27281e-06
1.05411e-07
5.26665e-06
1.07788e-07
5.26289e-06
1.52029e-07
5.26226e-06
1.53569e-07
5.25591e-06
5.83713e-08
5.24925e-06
5.83571e-08
5.25447e-06
2.38764e-07
5.26472e-06
2.9374e-07
5.26219e-06
6.14158e-08
5.24486e-06
-1.6124e-07
5.23323e-06
-5.07424e-08
5.23481e-06
2.61594e-07
5.23766e-06
2.53179e-07
5.23794e-06
2.86107e-07
5.24369e-06
3.88451e-07
5.2344e-06
2.93199e-08
5.21671e-06
-2.59341e-07
5.21141e-06
-6.94188e-08
5.2215e-06
1.68958e-07
5.22712e-06
8.67091e-08
5.22162e-06
-7.61097e-08
5.22725e-06
1.08293e-07
5.24303e-06
2.23256e-07
5.25377e-06
1.87519e-07
5.251e-06
-1.28769e-07
5.24678e-06
-2.43382e-07
5.25188e-06
4.9699e-08
5.26246e-06
2.76282e-07
2.81315e-07
5.49497e-06
2.45527e-07
5.50462e-06
2.59927e-07
5.50695e-06
2.59046e-07
5.51055e-06
2.36191e-07
5.51832e-06
2.37658e-07
5.51961e-06
2.17259e-07
5.51842e-06
2.02559e-07
5.518e-06
1.7338e-07
5.51576e-06
1.66476e-07
5.51165e-06
1.45788e-07
5.51044e-06
1.35281e-07
5.51124e-06
1.37545e-07
5.51009e-06
1.28953e-07
5.51041e-06
1.30073e-07
5.51112e-06
1.16781e-07
5.5117e-06
1.21442e-07
5.51111e-06
1.11164e-07
5.51009e-06
1.02976e-07
5.5095e-06
9.27637e-08
5.50846e-06
8.54505e-08
5.50576e-06
7.39868e-08
5.50205e-06
6.47882e-08
5.49744e-06
5.81993e-08
5.49378e-06
6.183e-08
5.49112e-06
7.56711e-08
5.48913e-06
8.17585e-08
5.48928e-06
1.04283e-07
5.48913e-06
1.03015e-07
5.48994e-06
1.16439e-07
5.49034e-06
1.18334e-07
5.49037e-06
1.16665e-07
5.49245e-06
1.3036e-07
5.49381e-06
1.21255e-07
5.49664e-06
1.28862e-07
5.49758e-06
1.07776e-07
5.49757e-06
8.26137e-08
5.49759e-06
6.94646e-08
5.49627e-06
3.2166e-08
5.4932e-06
1.38961e-08
5.48591e-06
-3.74717e-08
5.47749e-06
-3.27706e-08
5.471e-06
-1.72024e-08
5.46937e-06
4.32022e-08
5.47171e-06
1.0755e-07
5.47561e-06
1.35085e-07
5.48396e-06
2.03434e-07
5.49445e-06
2.03728e-07
5.50429e-06
2.00386e-07
5.50769e-06
1.05314e-07
5.50513e-06
1.17384e-08
5.50091e-06
-3.18521e-08
5.49557e-06
-8.11129e-08
5.49207e-06
-2.96593e-08
5.49377e-06
1.17074e-08
5.50197e-06
1.23271e-07
5.50937e-06
1.39551e-07
5.51765e-06
1.56433e-07
5.52312e-06
1.42825e-07
5.52105e-06
4.46202e-08
5.52008e-06
4.99002e-08
5.51846e-06
2.03344e-08
5.5168e-06
2.30215e-08
5.52048e-06
9.05693e-08
5.52438e-06
1.26576e-07
5.52408e-06
1.4258e-07
5.52761e-06
1.99658e-07
5.5354e-06
2.59422e-07
5.53014e-06
1.17189e-07
5.5251e-06
8.50033e-08
5.53025e-06
1.99078e-07
5.53012e-06
1.23948e-07
5.5239e-06
1.11625e-07
5.51858e-06
1.13113e-07
5.5152e-06
1.55403e-07
5.51485e-06
1.53916e-07
5.50809e-06
6.51399e-08
5.50078e-06
6.56682e-08
5.50574e-06
2.33803e-07
5.51571e-06
2.8377e-07
5.51315e-06
6.39695e-08
5.49582e-06
-1.43902e-07
5.48416e-06
-3.90826e-08
5.48624e-06
2.59506e-07
5.48881e-06
2.50612e-07
5.48827e-06
2.86647e-07
5.49465e-06
3.82076e-07
5.48578e-06
3.81832e-08
5.4676e-06
-2.41158e-07
5.46194e-06
-6.37557e-08
5.47232e-06
1.58577e-07
5.47834e-06
8.06848e-08
5.4725e-06
-7.02643e-08
5.47769e-06
1.03101e-07
5.49372e-06
2.07221e-07
5.5058e-06
1.75443e-07
5.50379e-06
-1.26761e-07
5.49849e-06
-2.38085e-07
5.50279e-06
4.54039e-08
5.51381e-06
2.65263e-07
2.77278e-07
5.75614e-06
2.39021e-07
5.76673e-06
2.49343e-07
5.77144e-06
2.54329e-07
5.7733e-06
2.34333e-07
5.78015e-06
2.3081e-07
5.78359e-06
2.13825e-07
5.78256e-06
2.03585e-07
5.78155e-06
1.74391e-07
5.78041e-06
1.67609e-07
5.77645e-06
1.49755e-07
5.7743e-06
1.37429e-07
5.7751e-06
1.36741e-07
5.77399e-06
1.30061e-07
5.77365e-06
1.30414e-07
5.77409e-06
1.16342e-07
5.77475e-06
1.20781e-07
5.77388e-06
1.12039e-07
5.77256e-06
1.04295e-07
5.77171e-06
9.3612e-08
5.7706e-06
8.65586e-08
5.76801e-06
7.65801e-08
5.76445e-06
6.83471e-08
5.76016e-06
6.24885e-08
5.75677e-06
6.52197e-08
5.7544e-06
7.80411e-08
5.75265e-06
8.35084e-08
5.75286e-06
1.0408e-07
5.75283e-06
1.03038e-07
5.75368e-06
1.15592e-07
5.7542e-06
1.1782e-07
5.7543e-06
1.16557e-07
5.7563e-06
1.28361e-07
5.75757e-06
1.19987e-07
5.76013e-06
1.26299e-07
5.76091e-06
1.07e-07
5.76068e-06
8.28467e-08
5.76035e-06
6.97929e-08
5.75864e-06
3.38729e-08
5.75527e-06
1.72619e-08
5.74794e-06
-3.01393e-08
5.73987e-06
-2.47014e-08
5.73363e-06
-1.09596e-08
5.73219e-06
4.46401e-08
5.73477e-06
1.04972e-07
5.73885e-06
1.31002e-07
5.7475e-06
1.94785e-07
5.75792e-06
1.93305e-07
5.76783e-06
1.90479e-07
5.77119e-06
1.01957e-07
5.76858e-06
1.435e-08
5.76417e-06
-2.74449e-08
5.75834e-06
-7.52818e-08
5.75491e-06
-2.62334e-08
5.75624e-06
1.0384e-08
5.76439e-06
1.15118e-07
5.77208e-06
1.31855e-07
5.78041e-06
1.48109e-07
5.78643e-06
1.36803e-07
5.78486e-06
4.61923e-08
5.78432e-06
5.04402e-08
5.78273e-06
2.19184e-08
5.7808e-06
2.49596e-08
5.78382e-06
8.75487e-08
5.78727e-06
1.23121e-07
5.7877e-06
1.42153e-07
5.79148e-06
1.95874e-07
5.79956e-06
2.51344e-07
5.79488e-06
1.21873e-07
5.78928e-06
9.06042e-08
5.79361e-06
1.94745e-07
5.79301e-06
1.24545e-07
5.78695e-06
1.17684e-07
5.78238e-06
1.17686e-07
5.77957e-06
1.58217e-07
5.77949e-06
1.5399e-07
5.77242e-06
7.22081e-08
5.76461e-06
7.34864e-08
5.76924e-06
2.29169e-07
5.77884e-06
2.74169e-07
5.77608e-06
6.67265e-08
5.75881e-06
-1.26629e-07
5.74746e-06
-2.77316e-08
5.74994e-06
2.57028e-07
5.75213e-06
2.48423e-07
5.75103e-06
2.87742e-07
5.75784e-06
3.75271e-07
5.74918e-06
4.68348e-08
5.73074e-06
-2.22713e-07
5.72488e-06
-5.78965e-08
5.73518e-06
1.48281e-07
5.74139e-06
7.44697e-08
5.73571e-06
-6.45854e-08
5.74073e-06
9.8079e-08
5.75665e-06
1.91306e-07
5.76959e-06
1.62499e-07
5.76831e-06
-1.25475e-07
5.76247e-06
-2.32246e-07
5.76617e-06
4.17029e-08
5.77728e-06
2.54157e-07
2.73099e-07
6.03037e-06
2.34096e-07
6.04042e-06
2.39294e-07
6.04783e-06
2.4692e-07
6.04942e-06
2.32748e-07
6.05418e-06
2.26048e-07
6.05909e-06
2.08914e-07
6.0593e-06
2.03377e-07
6.05737e-06
1.76322e-07
6.05687e-06
1.68108e-07
6.05373e-06
1.52893e-07
6.05077e-06
1.40393e-07
6.05126e-06
1.36243e-07
6.05051e-06
1.30818e-07
6.04962e-06
1.313e-07
6.04958e-06
1.16381e-07
6.05041e-06
1.19949e-07
6.04944e-06
1.13014e-07
6.04781e-06
1.05919e-07
6.04669e-06
9.47352e-08
6.04548e-06
8.77657e-08
6.04297e-06
7.90977e-08
6.03956e-06
7.17567e-08
6.03555e-06
6.64993e-08
6.0324e-06
6.83679e-08
6.03026e-06
8.01745e-08
6.02873e-06
8.50389e-08
6.02898e-06
1.03837e-07
6.02907e-06
1.02944e-07
6.02996e-06
1.14707e-07
6.03056e-06
1.17215e-07
6.03071e-06
1.16403e-07
6.03261e-06
1.26463e-07
6.0338e-06
1.188e-07
6.03614e-06
1.23962e-07
6.03678e-06
1.06358e-07
6.03637e-06
8.3253e-08
6.03575e-06
7.04134e-08
6.03373e-06
3.58963e-08
6.03011e-06
2.08803e-08
6.02277e-06
-2.27995e-08
6.01501e-06
-1.69404e-08
6.00898e-06
-4.92652e-09
6.00766e-06
4.59518e-08
6.01038e-06
1.02259e-07
6.0146e-06
1.26784e-07
6.0234e-06
1.85977e-07
6.03369e-06
1.83015e-07
6.04362e-06
1.80548e-07
6.04705e-06
9.85324e-08
6.04452e-06
1.68753e-08
6.04005e-06
-2.29756e-08
6.03388e-06
-6.91099e-08
6.03049e-06
-2.28458e-08
6.0315e-06
9.37426e-09
6.03946e-06
1.07162e-07
6.04737e-06
1.23949e-07
6.05573e-06
1.39743e-07
6.06221e-06
1.30324e-07
6.06119e-06
4.72125e-08
6.06097e-06
5.06579e-08
6.05946e-06
2.34307e-08
6.0573e-06
2.71156e-08
6.0598e-06
8.50531e-08
6.06287e-06
1.20056e-07
6.06384e-06
1.41178e-07
6.06793e-06
1.91784e-07
6.07614e-06
2.43132e-07
6.07205e-06
1.25965e-07
6.06621e-06
9.64448e-08
6.06968e-06
1.91281e-07
6.06861e-06
1.25606e-07
6.06266e-06
1.23638e-07
6.05869e-06
1.21652e-07
6.05646e-06
1.6045e-07
6.05661e-06
1.53844e-07
6.04941e-06
7.94086e-08
6.04128e-06
8.16165e-08
6.04551e-06
2.2494e-07
6.05467e-06
2.65007e-07
6.05163e-06
6.97666e-08
6.03444e-06
-1.09444e-07
6.02358e-06
-1.68728e-08
6.02638e-06
2.54234e-07
6.02818e-06
2.46622e-07
6.02673e-06
2.89196e-07
6.03381e-06
3.68184e-07
6.02521e-06
5.54393e-08
6.00665e-06
-2.04153e-07
6.00072e-06
-5.19652e-08
6.0107e-06
1.38296e-07
6.01694e-06
6.82311e-08
6.01174e-06
-5.93837e-08
6.0168e-06
9.30188e-08
6.03234e-06
1.7576e-07
6.04582e-06
1.49023e-07
6.04519e-06
-1.24841e-07
6.03914e-06
-2.26204e-07
6.04245e-06
3.83942e-08
6.05346e-06
2.4315e-07
2.68876e-07
6.31841e-06
2.30106e-07
6.32687e-06
2.30835e-07
6.33619e-06
2.37603e-07
6.3392e-06
2.29733e-07
6.34173e-06
2.23518e-07
6.34667e-06
2.0398e-07
6.34881e-06
2.01232e-07
6.34641e-06
1.78721e-07
6.34574e-06
1.68783e-07
6.34381e-06
1.54816e-07
6.3405e-06
1.43703e-07
6.3403e-06
1.36445e-07
6.34002e-06
1.31097e-07
6.33891e-06
1.32412e-07
6.33822e-06
1.17078e-07
6.33919e-06
1.18978e-07
6.33835e-06
1.13849e-07
6.33645e-06
1.07816e-07
6.33507e-06
9.61232e-08
6.33381e-06
8.90236e-08
6.33133e-06
8.15759e-08
6.32801e-06
7.50768e-08
6.32421e-06
7.02986e-08
6.32127e-06
7.13102e-08
6.31935e-06
8.20925e-08
6.31801e-06
8.6376e-08
6.31824e-06
1.03615e-07
6.31837e-06
1.0281e-07
6.31925e-06
1.13824e-07
6.31994e-06
1.16532e-07
6.32013e-06
1.16209e-07
6.32192e-06
1.24668e-07
6.32302e-06
1.17701e-07
6.32516e-06
1.2182e-07
6.32572e-06
1.05802e-07
6.32522e-06
8.37561e-08
6.32438e-06
7.12483e-08
6.32211e-06
3.81684e-08
6.3183e-06
2.46877e-08
6.311e-06
-1.54918e-08
6.30352e-06
-9.46348e-09
6.29767e-06
9.19912e-10
6.29642e-06
4.72045e-08
6.29918e-06
9.94996e-08
6.30348e-06
1.22483e-07
6.31234e-06
1.77117e-07
6.32244e-06
1.72914e-07
6.33233e-06
1.70664e-07
6.33587e-06
9.4988e-08
6.33353e-06
1.92146e-08
6.32913e-06
-1.85756e-08
6.3228e-06
-6.27739e-08
6.31947e-06
-1.95192e-08
6.32025e-06
8.59894e-09
6.32791e-06
9.94927e-08
6.33594e-06
1.15928e-07
6.3443e-06
1.31376e-07
6.35111e-06
1.23522e-07
6.35062e-06
4.76926e-08
6.35065e-06
5.06306e-08
6.34925e-06
2.48343e-08
6.34697e-06
2.93968e-08
6.34907e-06
8.29544e-08
6.35182e-06
1.17299e-07
6.35319e-06
1.39808e-07
6.35757e-06
1.87407e-07
6.36578e-06
2.34925e-07
6.36223e-06
1.29515e-07
6.35642e-06
1.02255e-07
6.35906e-06
1.88634e-07
6.35758e-06
1.2709e-07
6.35171e-06
1.29504e-07
6.34819e-06
1.25178e-07
6.34644e-06
1.62197e-07
6.34671e-06
1.53574e-07
6.33953e-06
8.65853e-08
6.33132e-06
8.98341e-08
6.3351e-06
2.21153e-07
6.34377e-06
2.56339e-07
6.34043e-06
7.31038e-08
6.32335e-06
-9.23586e-08
6.31303e-06
-6.55238e-09
6.31607e-06
2.51195e-07
6.31754e-06
2.45153e-07
6.31588e-06
2.90854e-07
6.32312e-06
3.60939e-07
6.31447e-06
6.40971e-08
6.2959e-06
-1.85585e-07
6.28998e-06
-4.60483e-08
6.29955e-06
1.28732e-07
6.30568e-06
6.20974e-08
6.3011e-06
-5.4805e-08
6.30635e-06
8.77656e-08
6.3214e-06
1.60712e-07
6.33516e-06
1.3526e-07
6.33509e-06
-1.2477e-07
6.32904e-06
-2.20156e-07
6.33212e-06
3.53166e-08
6.34294e-06
2.32328e-07
2.64664e-07
6.62066e-06
2.26542e-07
6.62745e-06
2.24044e-07
6.63723e-06
2.27828e-07
6.6427e-06
2.24259e-07
6.64401e-06
2.2221e-07
6.64737e-06
2.00617e-07
6.65123e-06
1.97372e-07
6.64945e-06
1.80497e-07
6.64798e-06
1.70258e-07
6.64707e-06
1.55721e-07
6.64413e-06
1.46645e-07
6.64303e-06
1.37546e-07
6.64308e-06
1.31054e-07
6.64213e-06
1.33361e-07
6.64068e-06
1.18523e-07
6.64162e-06
1.18042e-07
6.64119e-06
1.14278e-07
6.63913e-06
1.09878e-07
6.6374e-06
9.7853e-08
6.63612e-06
9.03007e-08
6.63376e-06
8.39309e-08
6.63053e-06
7.83149e-08
6.62689e-06
7.39309e-08
6.62408e-06
7.41281e-08
6.62226e-06
8.39057e-08
6.62106e-06
8.75762e-08
6.62125e-06
1.03425e-07
6.6214e-06
1.02665e-07
6.62223e-06
1.12987e-07
6.62295e-06
1.15812e-07
6.62315e-06
1.16016e-07
6.62485e-06
1.22961e-07
6.6259e-06
1.16657e-07
6.62787e-06
1.19844e-07
6.62835e-06
1.05325e-07
6.62779e-06
8.43206e-08
6.62681e-06
7.22202e-08
6.62438e-06
4.06037e-08
6.62048e-06
2.85896e-08
6.61326e-06
-8.27461e-09
6.60605e-06
-2.25436e-09
6.60038e-06
6.59377e-09
6.59913e-06
4.84527e-08
6.60187e-06
9.67602e-08
6.6062e-06
1.18152e-07
6.61502e-06
1.68297e-07
6.62489e-06
1.63046e-07
6.63465e-06
1.60905e-07
6.63832e-06
9.13088e-08
6.63624e-06
2.13013e-08
6.63202e-06
-1.43581e-08
6.62569e-06
-5.6445e-08
6.62247e-06
-1.62954e-08
6.62309e-06
7.98087e-09
6.63043e-06
9.21518e-08
6.63847e-06
1.07885e-07
6.64679e-06
1.23055e-07
6.65378e-06
1.16534e-07
6.65379e-06
4.76818e-08
6.65401e-06
5.04121e-08
6.65274e-06
2.6103e-08
6.65043e-06
3.1704e-08
6.65225e-06
8.1134e-08
6.65479e-06
1.14761e-07
6.65644e-06
1.38162e-07
6.66104e-06
1.82807e-07
6.66912e-06
2.26841e-07
6.66603e-06
1.32607e-07
6.66044e-06
1.07843e-07
6.66238e-06
1.86696e-07
6.66055e-06
1.28919e-07
6.65479e-06
1.35266e-07
6.65155e-06
1.28414e-07
6.65014e-06
1.63609e-07
6.65041e-06
1.533e-07
6.64337e-06
9.36283e-08
6.63528e-06
9.7925e-08
6.63863e-06
2.17802e-07
6.64676e-06
2.48211e-07
6.64315e-06
7.67173e-08
6.62619e-06
-7.53983e-08
6.61636e-06
3.27582e-09
6.61954e-06
2.48008e-07
6.62078e-06
2.4392e-07
6.61904e-06
2.92586e-07
6.62634e-06
3.53642e-07
6.61759e-06
7.28488e-08
6.59911e-06
-1.67104e-07
6.59326e-06
-4.02013e-08
6.60237e-06
1.19619e-07
6.60831e-06
5.6158e-08
6.60438e-06
-5.08703e-08
6.60993e-06
8.22164e-08
6.62445e-06
1.46187e-07
6.63833e-06
1.21382e-07
6.63872e-06
-1.25154e-07
6.63276e-06
-2.14203e-07
6.63572e-06
3.23597e-08
6.64633e-06
2.21719e-07
2.60486e-07
6.93754e-06
2.23189e-07
6.94318e-06
2.1841e-07
6.95211e-06
2.18895e-07
6.95983e-06
2.16536e-07
6.96164e-06
2.20401e-07
6.96258e-06
1.99679e-07
6.96699e-06
1.92957e-07
6.96693e-06
1.80567e-07
6.96476e-06
1.72419e-07
6.96415e-06
1.56332e-07
6.96214e-06
1.48659e-07
6.9603e-06
1.39381e-07
6.96027e-06
1.31089e-07
6.95983e-06
1.33796e-07
6.95779e-06
1.20568e-07
6.95836e-06
1.17469e-07
6.95846e-06
1.14181e-07
6.95651e-06
1.1183e-07
6.95439e-06
9.99648e-08
6.95304e-06
9.16574e-08
6.95085e-06
8.61231e-08
6.94766e-06
8.14976e-08
6.94417e-06
7.74257e-08
6.94152e-06
7.67769e-08
6.93978e-06
8.56451e-08
6.93863e-06
8.8723e-08
6.9387e-06
1.03361e-07
6.93877e-06
1.02594e-07
6.93956e-06
1.12195e-07
6.94033e-06
1.15045e-07
6.94053e-06
1.15816e-07
6.94212e-06
1.21366e-07
6.94309e-06
1.15687e-07
6.94494e-06
1.17991e-07
6.94538e-06
1.04887e-07
6.94479e-06
8.49093e-08
6.94372e-06
7.32972e-08
6.94115e-06
4.31709e-08
6.93722e-06
3.25167e-08
6.93017e-06
-1.2214e-09
6.92325e-06
4.66357e-09
6.91777e-06
1.20735e-08
6.9165e-06
4.97269e-08
6.91917e-06
9.40902e-08
6.92348e-06
1.13839e-07
6.93218e-06
1.59597e-07
6.94177e-06
1.53459e-07
6.95132e-06
1.51353e-07
6.95511e-06
8.75203e-08
6.9533e-06
2.31069e-08
6.94935e-06
-1.04034e-08
6.94318e-06
-5.02784e-08
6.94012e-06
-1.32314e-08
6.94065e-06
7.4501e-09
6.94765e-06
8.51461e-08
6.95563e-06
9.99119e-08
6.96385e-06
1.14829e-07
6.97091e-06
1.09483e-07
6.97134e-06
4.72477e-08
6.97172e-06
5.0033e-08
6.9706e-06
2.72224e-08
6.96835e-06
3.39504e-08
6.96999e-06
7.94938e-08
6.9724e-06
1.12357e-07
6.97424e-06
1.36319e-07
6.97898e-06
1.78067e-07
6.98685e-06
2.18968e-07
6.98413e-06
1.35329e-07
6.97889e-06
1.13087e-07
6.98025e-06
1.85329e-07
6.97817e-06
1.31005e-07
6.97254e-06
1.40888e-07
6.96948e-06
1.31476e-07
6.96825e-06
1.64842e-07
6.96842e-06
1.5313e-07
6.96157e-06
1.0048e-07
6.95377e-06
1.05722e-07
6.95673e-06
2.1484e-07
6.96429e-06
2.40656e-07
6.96043e-06
8.05729e-08
6.94364e-06
-5.86034e-08
6.93421e-06
1.27035e-08
6.93743e-06
2.44788e-07
6.93853e-06
2.42821e-07
6.93683e-06
2.94283e-07
6.9441e-06
3.46376e-07
6.93526e-06
8.16877e-08
6.91695e-06
-1.48796e-07
6.9112e-06
-3.44524e-08
6.91988e-06
1.10941e-07
6.92557e-06
5.04643e-08
6.92222e-06
-4.75194e-08
6.92812e-06
7.63194e-08
6.94217e-06
1.32138e-07
6.95604e-06
1.07505e-07
6.95677e-06
-1.2588e-07
6.95095e-06
-2.08387e-07
6.95386e-06
2.94567e-08
6.96425e-06
2.11326e-07
2.56343e-07
7.26973e-06
2.19896e-07
7.27477e-06
2.13379e-07
7.28227e-06
2.11392e-07
7.29095e-06
2.07851e-07
7.29462e-06
2.16736e-07
7.29365e-06
2.00649e-07
7.29698e-06
1.89628e-07
7.29896e-06
1.78584e-07
7.2971e-06
1.74285e-07
7.29603e-06
1.57394e-07
7.29498e-06
1.49714e-07
7.29298e-06
1.41375e-07
7.29247e-06
1.31604e-07
7.29256e-06
1.337e-07
7.29026e-06
1.22874e-07
7.2902e-06
1.17523e-07
7.29074e-06
1.13647e-07
7.28918e-06
1.13384e-07
7.2867e-06
1.02444e-07
7.28518e-06
9.31844e-08
7.28328e-06
8.80166e-08
7.28022e-06
8.45568e-08
7.27671e-06
8.09406e-08
7.27414e-06
7.93421e-08
7.27249e-06
8.73019e-08
7.27141e-06
8.98056e-08
7.27139e-06
1.03381e-07
7.27135e-06
1.02626e-07
7.27202e-06
1.11533e-07
7.27276e-06
1.14296e-07
7.27296e-06
1.1562e-07
7.27448e-06
1.19852e-07
7.2754e-06
1.14759e-07
7.27712e-06
1.16271e-07
7.2775e-06
1.04513e-07
7.2769e-06
8.55073e-08
7.27579e-06
7.44107e-08
7.27316e-06
4.5798e-08
7.26926e-06
3.64148e-08
7.26241e-06
5.62996e-09
7.25578e-06
1.12947e-08
7.25051e-06
1.73423e-08
7.24921e-06
5.1029e-08
7.25179e-06
9.15115e-08
7.25605e-06
1.09578e-07
7.26457e-06
1.51077e-07
7.27384e-06
1.44186e-07
7.28312e-06
1.4207e-07
7.28699e-06
8.36548e-08
7.28547e-06
2.46225e-08
7.28182e-06
-6.75306e-09
7.27592e-06
-4.43769e-08
7.27306e-06
-1.03709e-08
7.27355e-06
6.95696e-09
7.28023e-06
7.84648e-08
7.28806e-06
9.20851e-08
7.29616e-06
1.06735e-07
7.30318e-06
1.02457e-07
7.30397e-06
4.64582e-08
7.30449e-06
4.95097e-08
7.30353e-06
2.81882e-08
7.30141e-06
3.60648e-08
7.30295e-06
7.79569e-08
7.30528e-06
1.10024e-07
7.30728e-06
1.34325e-07
7.31207e-06
1.73275e-07
7.31967e-06
2.11363e-07
7.31725e-06
1.37758e-07
7.3124e-06
1.1793e-07
7.31333e-06
1.84398e-07
7.31108e-06
1.33261e-07
7.30564e-06
1.4633e-07
7.30268e-06
1.34438e-07
7.30149e-06
1.66028e-07
7.30148e-06
1.5314e-07
7.29484e-06
1.07123e-07
7.28744e-06
1.13118e-07
7.29008e-06
2.12205e-07
7.29703e-06
2.33699e-07
7.29297e-06
8.46356e-08
7.2764e-06
-4.20302e-08
7.26728e-06
2.18251e-08
7.27042e-06
2.41645e-07
7.27147e-06
2.41768e-07
7.26989e-06
2.95861e-07
7.27707e-06
3.39202e-07
7.26818e-06
9.05773e-08
7.25013e-06
-1.30744e-07
7.24448e-06
-2.8808e-08
7.25276e-06
1.02666e-07
7.25819e-06
4.50347e-08
7.25532e-06
-4.46533e-08
7.26157e-06
7.00695e-08
7.27522e-06
1.18484e-07
7.28902e-06
9.37075e-08
7.28997e-06
-1.26832e-07
7.28431e-06
-2.02722e-07
7.2872e-06
2.6569e-08
7.29738e-06
2.01141e-07
2.52225e-07
7.61818e-06
2.15843e-07
7.62291e-06
2.08649e-07
7.62885e-06
2.05455e-07
7.63698e-06
1.99722e-07
7.64272e-06
2.10994e-07
7.64146e-06
2.01906e-07
7.64258e-06
1.88512e-07
7.64595e-06
1.75217e-07
7.64564e-06
1.74591e-07
7.6439e-06
1.5914e-07
7.64319e-06
1.50418e-07
7.64162e-06
1.42947e-07
7.64057e-06
1.32658e-07
7.64099e-06
1.33279e-07
7.63885e-06
1.25008e-07
7.638e-06
1.18374e-07
7.6387e-06
1.12955e-07
7.63785e-06
1.14226e-07
7.63514e-06
1.05159e-07
7.63324e-06
9.50879e-08
7.63157e-06
8.96796e-08
7.62879e-06
8.73395e-08
7.6253e-06
8.443e-08
7.62277e-06
8.18725e-08
7.62117e-06
8.88983e-08
7.62005e-06
9.09271e-08
7.61989e-06
1.0354e-07
7.6198e-06
1.02719e-07
7.6204e-06
1.10936e-07
7.62117e-06
1.13525e-07
7.62133e-06
1.15458e-07
7.62271e-06
1.18475e-07
7.62357e-06
1.13899e-07
7.62519e-06
1.14646e-07
7.62553e-06
1.04171e-07
7.62491e-06
8.61296e-08
7.62373e-06
7.55943e-08
7.62104e-06
4.84843e-08
7.61723e-06
4.0221e-08
7.61067e-06
1.21975e-08
7.60437e-06
1.75879e-08
7.59934e-06
2.23708e-08
7.59802e-06
5.23566e-08
7.60048e-06
8.90522e-08
7.60465e-06
1.05406e-07
7.61293e-06
1.42795e-07
7.62185e-06
1.35269e-07
7.6308e-06
1.33116e-07
7.6347e-06
7.97535e-08
7.63348e-06
2.58495e-08
7.63016e-06
-3.43663e-09
7.62461e-06
-3.88242e-08
7.622e-06
-7.75823e-09
7.62249e-06
6.4663e-09
7.62886e-06
7.20928e-08
7.63647e-06
8.44759e-08
7.64438e-06
9.88171e-08
7.65132e-06
9.55258e-08
7.6524e-06
4.53727e-08
7.65307e-06
4.88435e-08
7.65226e-06
2.89995e-08
7.65032e-06
3.79996e-08
7.65181e-06
7.64703e-08
7.65412e-06
1.07716e-07
7.65624e-06
1.32204e-07
7.661e-06
1.68508e-07
7.66831e-06
2.04053e-07
7.66613e-06
1.39939e-07
7.66171e-06
1.2235e-07
7.66233e-06
1.83782e-07
7.65997e-06
1.35617e-07
7.65474e-06
1.5156e-07
7.65184e-06
1.37338e-07
7.65062e-06
1.67252e-07
7.65039e-06
1.53364e-07
7.64396e-06
1.13554e-07
7.63701e-06
1.20066e-07
7.63938e-06
2.09835e-07
7.64573e-06
2.2735e-07
7.64149e-06
8.88753e-08
7.6252e-06
-2.57381e-08
7.61631e-06
3.07188e-08
7.61928e-06
2.38672e-07
7.62036e-06
2.40694e-07
7.61896e-06
2.97258e-07
7.626e-06
3.32159e-07
7.61711e-06
9.94676e-08
7.59939e-06
-1.13025e-07
7.59385e-06
-2.32593e-08
7.60175e-06
9.47654e-08
7.60692e-06
3.98639e-08
7.60443e-06
-4.21703e-08
7.61101e-06
6.34965e-08
7.62434e-06
1.05151e-07
7.63801e-06
8.0042e-08
7.63908e-06
-1.27905e-07
7.63356e-06
-1.97202e-07
7.63645e-06
2.36735e-08
7.64644e-06
1.91157e-07
2.48116e-07
7.98429e-06
2.08621e-07
7.98871e-06
2.04229e-07
7.99257e-06
2.01593e-07
7.99894e-06
1.93355e-07
8.0061e-06
2.0384e-07
8.00627e-06
2.01727e-07
8.00526e-06
1.89522e-07
8.00863e-06
1.71847e-07
8.01072e-06
1.72504e-07
8.00892e-06
1.60943e-07
8.00779e-06
1.51547e-07
8.00685e-06
1.43889e-07
8.00551e-06
1.33998e-07
8.00582e-06
1.32964e-07
8.00415e-06
1.26684e-07
8.00266e-06
1.1986e-07
8.00309e-06
1.12522e-07
8.00301e-06
1.14306e-07
8.00039e-06
1.07781e-07
7.99808e-06
9.74029e-08
7.99656e-06
9.1201e-08
7.99415e-06
8.97478e-08
7.99062e-06
8.79559e-08
7.98799e-06
8.45025e-08
7.98652e-06
9.03692e-08
7.98549e-06
9.19621e-08
7.98519e-06
1.03832e-07
7.98495e-06
1.02964e-07
7.98538e-06
1.10508e-07
7.98613e-06
1.12768e-07
7.98634e-06
1.15253e-07
7.98764e-06
1.17167e-07
7.98845e-06
1.13093e-07
7.98994e-06
1.13152e-07
7.99022e-06
1.03899e-07
7.9896e-06
8.67471e-08
7.98841e-06
7.67878e-08
7.9857e-06
5.11947e-08
7.98196e-06
4.39591e-08
7.97566e-06
1.8498e-08
7.96969e-06
2.3555e-08
7.96493e-06
2.71289e-08
7.96363e-06
5.36589e-08
7.96598e-06
8.6702e-08
7.97005e-06
1.01336e-07
7.97806e-06
1.34786e-07
7.9866e-06
1.26731e-07
7.99519e-06
1.24525e-07
7.99908e-06
7.58575e-08
7.99813e-06
2.68019e-08
7.99514e-06
-4.50353e-10
7.98997e-06
-3.36482e-08
7.98762e-06
-5.41263e-09
7.98813e-06
5.95583e-09
7.99422e-06
6.60076e-08
8.00156e-06
7.71307e-08
8.00927e-06
9.11088e-08
8.01607e-06
8.87302e-08
8.0174e-06
4.40413e-08
8.01821e-06
4.80348e-08
8.01755e-06
2.96543e-08
8.01584e-06
3.97162e-08
8.01731e-06
7.4995e-08
8.01962e-06
1.05412e-07
8.02185e-06
1.29968e-07
8.02653e-06
1.63829e-07
8.03353e-06
1.97051e-07
8.03157e-06
1.419e-07
8.02757e-06
1.26352e-07
8.02797e-06
1.83379e-07
8.02557e-06
1.38016e-07
8.02058e-06
1.56551e-07
8.01773e-06
1.40191e-07
8.01641e-06
1.68569e-07
8.01597e-06
1.53803e-07
8.00975e-06
1.19774e-07
8.00326e-06
1.26558e-07
8.00541e-06
2.07685e-07
8.01115e-06
2.21613e-07
8.00676e-06
9.32645e-08
7.99081e-06
-9.78739e-09
7.98209e-06
3.94337e-08
7.98483e-06
2.35931e-07
7.98597e-06
2.39552e-07
7.9848e-06
2.98433e-07
7.99169e-06
3.25269e-07
7.98285e-06
1.08307e-07
7.96553e-06
-9.57095e-08
7.96007e-06
-1.77933e-08
7.96761e-06
8.72264e-08
7.97253e-06
3.49383e-08
7.97035e-06
-3.99863e-08
7.97719e-06
5.66512e-08
7.99025e-06
9.2091e-08
8.00374e-06
6.65502e-08
8.00485e-06
-1.29009e-07
7.99947e-06
-1.91822e-07
8.00239e-06
2.07535e-08
8.01218e-06
1.81371e-07
2.44003e-07
8.37255e-06
2.04166e-07
8.37301e-06
2.0377e-07
8.37402e-06
2.00583e-07
8.37807e-06
1.89304e-07
8.38582e-06
1.96087e-07
8.38838e-06
1.99168e-07
8.38654e-06
1.91359e-07
8.38838e-06
1.70012e-07
8.39235e-06
1.68536e-07
8.39177e-06
1.61515e-07
8.38981e-06
1.53515e-07
8.38906e-06
1.44635e-07
8.38797e-06
1.35087e-07
8.38807e-06
1.32861e-07
8.38688e-06
1.27874e-07
8.38506e-06
1.21687e-07
8.3849e-06
1.12681e-07
8.38544e-06
1.13766e-07
8.38326e-06
1.09957e-07
8.38045e-06
1.00212e-07
8.37882e-06
9.28366e-08
8.37696e-06
9.16037e-08
8.37362e-06
9.12929e-08
8.37081e-06
8.7319e-08
8.36927e-06
9.19043e-08
8.36826e-06
9.297e-08
8.36789e-06
1.04202e-07
8.36761e-06
1.03249e-07
8.36797e-06
1.10144e-07
8.36869e-06
1.12051e-07
8.36884e-06
1.15101e-07
8.36998e-06
1.16033e-07
8.37073e-06
1.12341e-07
8.37218e-06
1.11704e-07
8.37243e-06
1.03644e-07
8.37181e-06
8.73687e-08
8.37057e-06
7.80294e-08
8.36785e-06
5.39113e-08
8.36424e-06
4.75727e-08
8.35827e-06
2.44703e-08
8.35263e-06
2.91944e-08
8.34811e-06
3.16463e-08
8.34681e-06
5.49596e-08
8.34902e-06
8.44939e-08
8.35296e-06
9.73964e-08
8.36068e-06
1.27061e-07
8.36885e-06
1.18565e-07
8.37708e-06
1.1629e-07
8.38096e-06
7.19836e-08
8.38027e-06
2.74899e-08
8.37761e-06
2.21385e-09
8.37282e-06
-2.88587e-08
8.37074e-06
-3.33782e-09
8.37127e-06
5.42413e-09
8.37708e-06
6.02019e-08
8.38412e-06
7.00891e-08
8.39158e-06
8.36479e-08
8.39821e-06
8.21041e-08
8.39975e-06
4.25017e-08
8.40071e-06
4.70773e-08
8.4002e-06
3.01565e-08
8.39872e-06
4.12025e-08
8.4002e-06
7.35117e-08
8.40251e-06
1.03099e-07
8.40486e-06
1.27618e-07
8.40941e-06
1.5928e-07
8.41611e-06
1.90354e-07
8.41437e-06
1.43643e-07
8.41077e-06
1.29945e-07
8.41104e-06
1.83117e-07
8.40864e-06
1.40414e-07
8.40391e-06
1.61279e-07
8.40111e-06
1.42988e-07
8.39968e-06
1.70001e-07
8.39903e-06
1.54448e-07
8.39302e-06
1.25787e-07
8.38698e-06
1.32599e-07
8.38896e-06
2.05712e-07
8.39408e-06
2.16486e-07
8.38956e-06
9.77893e-08
8.37399e-06
5.77751e-09
8.36543e-06
4.79967e-08
8.36791e-06
2.33456e-07
8.36915e-06
2.3831e-07
8.36823e-06
2.99354e-07
8.37495e-06
3.18542e-07
8.36621e-06
1.1705e-07
8.34936e-06
-7.88602e-08
8.34397e-06
-1.2399e-08
8.35114e-06
8.00521e-08
8.35583e-06
3.02467e-08
8.35389e-06
-3.80401e-08
8.36095e-06
4.95897e-08
8.37375e-06
7.92927e-08
8.38702e-06
5.32739e-08
8.38809e-06
-1.30072e-07
8.38284e-06
-1.86572e-07
8.38579e-06
1.77962e-08
8.39538e-06
1.71784e-07
2.39875e-07
8.77747e-06
2.01897e-07
8.77536e-06
2.05885e-07
8.77395e-06
2.01989e-07
8.77582e-06
1.87434e-07
8.78317e-06
1.88742e-07
8.78808e-06
1.94257e-07
8.78712e-06
1.92319e-07
8.78679e-06
1.7034e-07
8.7912e-06
1.6413e-07
8.7928e-06
1.59909e-07
8.79061e-06
1.55708e-07
8.78932e-06
1.45927e-07
8.78854e-06
1.35864e-07
8.78853e-06
1.32875e-07
8.78772e-06
1.28682e-07
8.78595e-06
1.23452e-07
8.78499e-06
1.13646e-07
8.78582e-06
1.12932e-07
8.78447e-06
1.11308e-07
8.78143e-06
1.03251e-07
8.77946e-06
9.48128e-08
8.77802e-06
9.30415e-08
8.77495e-06
9.43643e-08
8.77192e-06
9.03434e-08
8.77034e-06
9.34917e-08
8.76945e-06
9.38583e-08
8.76896e-06
1.04691e-07
8.76846e-06
1.03753e-07
8.76864e-06
1.09958e-07
8.76939e-06
1.11304e-07
8.76965e-06
1.14842e-07
8.77075e-06
1.14931e-07
8.77147e-06
1.11622e-07
8.7728e-06
1.10375e-07
8.77302e-06
1.03416e-07
8.77245e-06
8.79438e-08
8.77122e-06
7.92546e-08
8.7685e-06
5.66332e-08
8.76492e-06
5.11506e-08
8.7592e-06
3.0199e-08
8.75385e-06
3.45363e-08
8.74959e-06
3.59076e-08
8.74836e-06
5.6195e-08
8.75045e-06
8.23979e-08
8.75426e-06
9.35871e-08
8.76169e-06
1.19635e-07
8.76949e-06
1.10767e-07
8.77736e-06
1.08417e-07
8.78119e-06
6.81545e-08
8.78075e-06
2.79317e-08
8.77837e-06
4.58776e-09
8.77394e-06
-2.44222e-08
8.77211e-06
-1.51314e-09
8.77267e-06
4.86961e-09
8.77821e-06
5.46596e-08
8.78494e-06
6.33582e-08
8.79214e-06
7.6445e-08
8.79859e-06
7.56597e-08
8.80031e-06
4.07813e-08
8.80141e-06
4.59736e-08
8.80106e-06
3.05073e-08
8.79981e-06
4.24492e-08
8.80131e-06
7.20127e-08
8.80362e-06
1.0079e-07
8.80607e-06
1.25164e-07
8.81047e-06
1.54886e-07
8.81687e-06
1.83954e-07
8.81535e-06
1.45166e-07
8.81215e-06
1.33142e-07
8.81233e-06
1.82937e-07
8.80999e-06
1.42755e-07
8.80556e-06
1.65712e-07
8.80282e-06
1.45725e-07
8.80125e-06
1.71567e-07
8.80041e-06
1.55291e-07
8.79461e-06
1.31588e-07
8.78901e-06
1.38192e-07
8.79085e-06
2.03875e-07
8.79538e-06
2.11954e-07
8.79073e-06
1.02438e-07
8.77559e-06
2.09178e-08
8.76718e-06
5.64104e-08
8.76938e-06
2.31258e-07
8.77074e-06
2.36949e-07
8.77009e-06
3.00001e-07
8.77666e-06
3.11974e-07
8.76806e-06
1.25654e-07
8.75173e-06
-6.25315e-08
8.7464e-06
-7.07229e-09
8.7532e-06
7.32561e-08
8.75766e-06
2.57887e-08
8.75591e-06
-3.62896e-08
8.76313e-06
4.23628e-08
8.77565e-06
6.67728e-08
8.78867e-06
4.02577e-08
8.78963e-06
-1.31031e-07
8.7845e-06
-1.8144e-07
8.7875e-06
1.47948e-08
8.79688e-06
1.62399e-07
2.35722e-07
9.19636e-06
2.0029e-07
9.19532e-06
2.06926e-07
9.19369e-06
2.03615e-07
9.19403e-06
1.87097e-07
9.19987e-06
1.82901e-07
9.20616e-06
1.87971e-07
9.20717e-06
1.91308e-07
9.2053e-06
1.72207e-07
9.20828e-06
1.61156e-07
9.21193e-06
1.56251e-07
9.21088e-06
1.56762e-07
9.20874e-06
1.4807e-07
9.208e-06
1.36603e-07
9.20831e-06
1.32564e-07
9.20772e-06
1.29274e-07
9.20615e-06
1.25015e-07
9.20449e-06
1.15308e-07
9.20512e-06
1.12297e-07
9.20463e-06
1.11801e-07
9.20161e-06
1.0627e-07
9.19908e-06
9.73428e-08
9.19806e-06
9.40598e-08
9.1956e-06
9.68307e-08
9.19242e-06
9.35219e-08
9.19052e-06
9.53855e-08
9.1897e-06
9.4688e-08
9.18928e-06
1.05101e-07
9.18876e-06
1.04276e-07
9.18884e-06
1.09878e-07
9.1895e-06
1.1065e-07
9.18965e-06
1.14691e-07
9.19057e-06
1.14007e-07
9.19126e-06
1.10928e-07
9.19256e-06
1.0908e-07
9.19276e-06
1.03214e-07
9.19216e-06
8.85464e-08
9.19091e-06
8.05086e-08
9.18825e-06
5.92896e-08
9.18486e-06
5.45436e-08
9.17949e-06
3.55627e-08
9.17447e-06
3.95623e-08
9.17042e-06
3.99493e-08
9.16921e-06
5.74061e-08
9.17117e-06
8.04379e-08
9.17482e-06
8.99405e-08
9.18191e-06
1.12542e-07
9.18931e-06
1.0337e-07
9.1968e-06
1.00926e-07
9.20056e-06
6.43907e-08
9.20037e-06
2.81232e-08
9.19832e-06
6.6431e-09
9.19427e-06
-2.03785e-08
9.19272e-06
4.47078e-11
9.19329e-06
4.29893e-09
9.19856e-06
4.93916e-08
9.20494e-06
5.69714e-08
9.21184e-06
6.95516e-08
9.21805e-06
6.94415e-08
9.21992e-06
3.89105e-08
9.22118e-06
4.47214e-08
9.22098e-06
3.07016e-08
9.21998e-06
4.34561e-08
9.22149e-06
7.04943e-08
9.2238e-06
9.84842e-08
9.22635e-06
1.22612e-07
9.23057e-06
1.50668e-07
9.23668e-06
1.77849e-07
9.23539e-06
1.46448e-07
9.2326e-06
1.35938e-07
9.23273e-06
1.82806e-07
9.23047e-06
1.45013e-07
9.22635e-06
1.69829e-07
9.2237e-06
1.48381e-07
9.22201e-06
1.7325e-07
9.22101e-06
1.563e-07
9.21543e-06
1.37165e-07
9.21026e-06
1.43359e-07
9.21196e-06
2.02171e-07
9.21591e-06
2.0801e-07
9.21115e-06
1.07193e-07
9.19648e-06
3.55931e-08
9.18823e-06
6.46631e-08
9.19014e-06
2.29341e-07
9.19163e-06
2.35464e-07
9.19126e-06
3.00365e-07
9.19768e-06
3.05554e-07
9.18927e-06
1.34069e-07
9.17352e-06
-4.6778e-08
9.16825e-06
-1.80978e-09
9.17465e-06
6.68581e-08
9.17888e-06
2.15625e-08
9.1773e-06
-3.47101e-08
9.18464e-06
3.50175e-08
9.19685e-06
5.45673e-08
9.20956e-06
2.75449e-08
9.21037e-06
-1.31844e-07
9.20534e-06
-1.76408e-07
9.20838e-06
1.17579e-08
9.21755e-06
1.53232e-07
2.31535e-07
9.62523e-06
1.85768e-07
9.6333e-06
1.9886e-07
9.63441e-06
2.02502e-07
9.63326e-06
1.88251e-07
9.63711e-06
1.79047e-07
9.64371e-06
1.81376e-07
9.64688e-06
1.88139e-07
9.64495e-06
1.74131e-07
9.64561e-06
1.605e-07
9.64995e-06
1.51908e-07
9.65123e-06
1.55485e-07
9.64867e-06
1.50631e-07
9.64719e-06
1.38081e-07
9.64786e-06
1.31894e-07
9.64769e-06
1.29443e-07
9.64646e-06
1.26244e-07
9.64434e-06
1.17426e-07
9.64436e-06
1.12277e-07
9.6447e-06
1.11465e-07
9.64227e-06
1.08698e-07
9.63908e-06
1.00538e-07
9.63799e-06
9.51466e-08
9.63617e-06
9.86493e-08
9.63306e-06
9.66285e-08
9.63096e-06
9.74928e-08
9.63018e-06
9.54607e-08
9.62981e-06
1.05479e-07
9.62911e-06
1.04977e-07
9.62902e-06
1.09969e-07
9.62972e-06
1.09942e-07
9.63003e-06
1.14383e-07
9.63091e-06
1.13128e-07
9.63149e-06
1.10345e-07
9.63258e-06
1.07993e-07
9.63262e-06
1.0317e-07
9.63198e-06
8.9193e-08
9.6307e-06
8.17819e-08
9.62806e-06
6.1937e-08
9.62476e-06
5.78441e-08
9.61975e-06
4.0574e-08
9.61511e-06
4.42007e-08
9.61143e-06
4.36213e-08
9.61038e-06
5.84583e-08
9.61228e-06
7.85384e-08
9.61576e-06
8.64668e-08
9.62243e-06
1.05873e-07
9.62933e-06
9.64667e-08
9.63635e-06
9.39085e-08
9.63997e-06
6.07664e-08
9.64001e-06
2.80801e-08
9.6383e-06
8.35653e-09
9.63467e-06
-1.67523e-08
9.6334e-06
1.31431e-09
9.63401e-06
3.6971e-09
9.63902e-06
4.43818e-08
9.64507e-06
5.09208e-08
9.65164e-06
6.29814e-08
9.6576e-06
6.34824e-08
9.65957e-06
3.69392e-08
9.66094e-06
4.33489e-08
9.6609e-06
3.07363e-08
9.66015e-06
4.42077e-08
9.66171e-06
6.89374e-08
9.66402e-06
9.61731e-08
9.66667e-06
1.19964e-07
9.67071e-06
1.46628e-07
9.67652e-06
1.72037e-07
9.67546e-06
1.47504e-07
9.67304e-06
1.38362e-07
9.67316e-06
1.82686e-07
9.67102e-06
1.47157e-07
9.66721e-06
1.73632e-07
9.66465e-06
1.50946e-07
9.66289e-06
1.75003e-07
9.66178e-06
1.57417e-07
9.65645e-06
1.4249e-07
9.65166e-06
1.48151e-07
9.65318e-06
2.00657e-07
9.65653e-06
2.04653e-07
9.65173e-06
1.11999e-07
9.63759e-06
4.9733e-08
9.62953e-06
7.2725e-08
9.63115e-06
2.27712e-07
9.63274e-06
2.33877e-07
9.63264e-06
3.00462e-07
9.63892e-06
2.99281e-07
9.63075e-06
1.42234e-07
9.61563e-06
-3.16606e-08
9.61044e-06
3.38954e-09
9.61641e-06
6.08814e-08
9.62042e-06
1.75586e-08
9.61899e-06
-3.32894e-08
9.6264e-06
2.76113e-08
9.63823e-06
4.27371e-08
9.65059e-06
1.51813e-08
9.65124e-06
-1.32485e-07
9.6463e-06
-1.71474e-07
9.64937e-06
8.69496e-09
9.65829e-06
1.44307e-07
2.27309e-07
1.00933e-05
1.87983e-07
1.00932e-05
1.98955e-07
1.00936e-05
2.02103e-07
1.00925e-05
1.89328e-07
1.00953e-05
1.7624e-07
1.01021e-05
1.74636e-07
1.01069e-05
1.83287e-07
1.01061e-05
1.74934e-07
1.01047e-05
1.61939e-07
1.0108e-05
1.48575e-07
1.01116e-05
1.51866e-07
1.011e-05
1.52277e-07
1.01075e-05
1.40575e-07
1.01082e-05
1.31176e-07
1.01086e-05
1.29026e-07
1.01078e-05
1.2709e-07
1.01055e-05
1.19771e-07
1.01046e-05
1.13145e-07
1.01053e-05
1.10784e-07
1.01038e-05
1.10192e-07
1.01001e-05
1.0416e-07
1.00988e-05
9.65007e-08
1.00978e-05
9.96149e-08
1.0095e-05
9.94594e-08
1.00924e-05
1.00088e-07
1.00915e-05
9.63517e-08
1.00913e-05
1.05656e-07
1.00907e-05
1.05567e-07
1.00905e-05
1.10204e-07
1.00911e-05
1.09398e-07
1.00912e-05
1.14213e-07
1.00919e-05
1.12447e-07
1.00925e-05
1.09783e-07
1.00936e-05
1.06874e-07
1.00936e-05
1.0312e-07
1.0093e-05
8.98651e-08
1.00917e-05
8.30521e-08
1.00892e-05
6.4459e-08
1.00861e-05
6.09157e-08
1.00814e-05
4.52393e-08
1.00771e-05
4.85137e-08
1.00736e-05
4.71318e-08
1.00726e-05
5.94916e-08
1.00743e-05
7.67807e-08
1.00776e-05
8.31717e-08
1.0084e-05
9.95486e-08
1.00905e-05
8.99467e-08
1.00971e-05
8.72626e-08
1.01007e-05
5.72352e-08
1.01009e-05
2.78228e-08
1.00995e-05
9.77347e-09
1.00962e-05
-1.34839e-08
1.00952e-05
2.36917e-09
1.00958e-05
3.11233e-09
1.01005e-05
3.96601e-08
1.01062e-05
4.5234e-08
1.01124e-05
5.67531e-08
1.01181e-05
5.78e-08
1.01201e-05
3.48738e-08
1.01216e-05
4.18515e-08
1.01218e-05
3.06103e-08
1.01213e-05
4.47188e-08
1.01228e-05
6.73625e-08
1.01251e-05
9.38749e-08
1.01279e-05
1.17238e-07
1.01317e-05
1.42781e-07
1.01372e-05
1.66513e-07
1.01364e-05
1.48297e-07
1.01344e-05
1.40381e-07
1.01346e-05
1.82541e-07
1.01325e-05
1.49172e-07
1.01291e-05
1.77112e-07
1.01266e-05
1.5339e-07
1.01248e-05
1.76803e-07
1.01236e-05
1.58635e-07
1.01185e-05
1.47555e-07
1.01141e-05
1.52567e-07
1.01155e-05
1.99301e-07
1.01183e-05
2.01848e-07
1.01134e-05
1.16854e-07
1.00998e-05
6.33355e-08
1.0092e-05
8.05721e-08
1.00933e-05
2.26338e-07
1.00951e-05
2.32169e-07
1.00952e-05
3.00284e-07
1.01014e-05
2.93152e-07
1.00935e-05
1.50108e-07
1.00791e-05
-1.72326e-08
1.00739e-05
8.52128e-09
1.00795e-05
5.53553e-08
1.00832e-05
1.37769e-08
1.0082e-05
-3.20129e-08
1.00894e-05
2.01962e-08
1.01008e-05
3.13519e-08
1.01127e-05
3.22641e-09
1.01132e-05
-1.32927e-07
1.01083e-05
-1.6663e-07
1.01114e-05
5.61978e-09
1.01201e-05
1.35639e-07
2.23033e-07
1.0562e-05
1.77353e-07
1.05715e-05
1.89432e-07
1.05761e-05
1.97504e-07
1.05755e-05
1.89952e-07
1.05767e-05
1.7502e-07
1.05823e-05
1.68988e-07
1.0588e-05
1.77607e-07
1.05891e-05
1.73843e-07
1.0587e-05
1.64063e-07
1.05882e-05
1.47382e-07
1.05931e-05
1.46973e-07
1.05935e-05
1.51865e-07
1.05902e-05
1.43841e-07
1.05901e-05
1.3127e-07
1.05912e-05
1.27908e-07
1.05911e-05
1.2722e-07
1.05888e-05
1.22039e-07
1.05871e-05
1.14867e-07
1.05877e-05
1.10205e-07
1.05875e-05
1.10421e-07
1.05838e-05
1.07784e-07
1.05816e-05
9.87502e-08
1.05811e-05
1.00087e-07
1.0579e-05
1.01582e-07
1.05761e-05
1.02936e-07
1.05751e-05
9.74287e-08
1.0575e-05
1.05748e-07
1.05743e-05
1.06242e-07
1.05738e-05
1.10652e-07
1.05744e-05
1.08853e-07
1.05748e-05
1.13827e-07
1.05754e-05
1.1178e-07
1.05759e-05
1.09354e-07
1.05768e-05
1.05926e-07
1.05768e-05
1.03171e-07
1.05761e-05
9.0577e-08
1.05748e-05
8.43122e-08
1.05723e-05
6.6922e-08
1.05693e-05
6.39104e-08
1.0565e-05
4.95785e-08
1.0561e-05
5.24657e-08
1.05579e-05
5.02861e-08
1.0557e-05
6.0367e-08
1.05587e-05
7.5058e-08
1.05618e-05
8.00747e-08
1.05678e-05
9.36364e-08
1.05738e-05
8.39104e-08
1.058e-05
8.10756e-08
1.05833e-05
5.38901e-08
1.05838e-05
2.73754e-08
1.05827e-05
1.0869e-08
1.05798e-05
-1.05945e-08
1.0579e-05
3.19379e-09
1.05796e-05
2.51763e-09
1.0584e-05
3.52101e-08
1.05893e-05
3.98943e-08
1.05952e-05
5.08597e-08
1.06006e-05
5.24076e-08
1.06027e-05
3.27524e-08
1.06043e-05
4.02764e-08
1.06046e-05
3.03466e-08
1.06043e-05
4.4992e-08
1.06059e-05
6.5763e-08
1.06082e-05
9.16024e-08
1.0611e-05
1.14453e-07
1.06146e-05
1.39111e-07
1.06199e-05
1.61263e-07
1.06193e-05
1.48841e-07
1.06177e-05
1.42022e-07
1.06179e-05
1.82346e-07
1.06161e-05
1.51018e-07
1.06129e-05
1.80245e-07
1.06106e-05
1.55702e-07
1.06088e-05
1.78625e-07
1.06075e-05
1.59927e-07
1.06027e-05
1.52342e-07
1.05986e-05
1.56639e-07
1.05998e-05
1.9813e-07
1.06021e-05
1.9957e-07
1.05972e-05
1.21719e-07
1.05842e-05
7.63562e-08
1.05766e-05
8.81651e-08
1.05777e-05
2.25202e-07
1.05796e-05
2.30354e-07
1.058e-05
2.99835e-07
1.0586e-05
2.87157e-07
1.05785e-05
1.57646e-07
1.05648e-05
-3.54368e-09
1.05597e-05
1.35693e-08
1.05648e-05
5.03011e-08
1.05683e-05
1.02149e-08
1.05672e-05
-3.08693e-08
1.05746e-05
1.28154e-08
1.05855e-05
2.04758e-08
1.05969e-05
-8.25716e-09
1.05972e-05
-1.33147e-07
1.05924e-05
-1.61861e-07
1.05955e-05
2.5518e-09
1.06038e-05
1.27249e-07
2.18702e-07
1.10637e-05
1.71139e-07
1.10727e-05
1.80362e-07
1.10799e-05
1.9032e-07
1.10813e-05
1.88613e-07
1.10814e-05
1.74836e-07
1.10858e-05
1.64602e-07
1.10917e-05
1.71745e-07
1.10943e-05
1.71225e-07
1.10928e-05
1.65606e-07
1.10919e-05
1.4825e-07
1.10964e-05
1.42464e-07
1.10994e-05
1.48913e-07
1.10967e-05
1.46538e-07
1.10953e-05
1.3262e-07
1.10965e-05
1.26723e-07
1.10973e-05
1.26401e-07
1.10955e-05
1.23863e-07
1.1093e-05
1.17327e-07
1.10928e-05
1.10443e-07
1.10935e-05
1.09718e-07
1.10906e-05
1.10717e-07
1.10875e-05
1.01776e-07
1.10873e-05
1.00334e-07
1.10861e-05
1.02731e-07
1.1083e-05
1.06049e-07
1.10815e-05
9.89414e-08
1.10817e-05
1.05581e-07
1.10813e-05
1.06607e-07
1.10808e-05
1.11177e-07
1.10811e-05
1.08533e-07
1.10813e-05
1.13613e-07
1.10818e-05
1.11324e-07
1.10821e-05
1.09007e-07
1.10831e-05
1.04963e-07
1.10831e-05
1.03206e-07
1.10822e-05
9.14022e-08
1.10809e-05
8.56312e-08
1.10786e-05
6.92187e-08
1.10759e-05
6.66071e-08
1.1072e-05
5.34765e-08
1.10684e-05
5.60499e-08
1.10655e-05
5.32028e-08
1.10647e-05
6.11987e-08
1.10663e-05
7.34741e-08
1.10692e-05
7.71831e-08
1.10747e-05
8.81355e-08
1.10803e-05
7.82919e-08
1.10861e-05
7.52963e-08
1.10893e-05
5.07059e-08
1.10898e-05
2.67796e-08
1.10891e-05
1.16534e-08
1.10866e-05
-8.1049e-09
1.1086e-05
3.79992e-09
1.10865e-05
1.9405e-09
1.10907e-05
3.1061e-08
1.10956e-05
3.49416e-08
1.11012e-05
4.53448e-08
1.11062e-05
4.73499e-08
1.11084e-05
3.06014e-08
1.111e-05
3.8632e-08
1.11104e-05
2.99507e-08
1.11103e-05
4.50533e-08
1.1112e-05
6.41467e-08
1.11142e-05
8.93449e-08
1.11171e-05
1.11608e-07
1.11206e-05
1.35625e-07
1.11255e-05
1.56289e-07
1.11252e-05
1.49126e-07
1.1124e-05
1.43264e-07
1.11243e-05
1.82075e-07
1.11226e-05
1.52697e-07
1.11198e-05
1.83037e-07
1.11176e-05
1.57856e-07
1.11159e-05
1.80418e-07
1.11145e-05
1.61256e-07
1.111e-05
1.56842e-07
1.11063e-05
1.6039e-07
1.11073e-05
1.97142e-07
1.1109e-05
1.97791e-07
1.11042e-05
1.26575e-07
1.10918e-05
8.8787e-08
1.10844e-05
9.54817e-08
1.10854e-05
2.24276e-07
1.10873e-05
2.28429e-07
1.1088e-05
2.9911e-07
1.10939e-05
2.81282e-07
1.10867e-05
1.64799e-07
1.10738e-05
9.36635e-09
1.10689e-05
1.85191e-08
1.10734e-05
4.57339e-08
1.10768e-05
6.86585e-09
1.10758e-05
-2.9843e-08
1.10831e-05
5.51656e-09
1.10934e-05
1.0169e-08
1.11043e-05
-1.92064e-08
1.11043e-05
-1.33129e-07
1.10996e-05
-1.5715e-07
1.11026e-05
-4.81067e-10
1.11107e-05
1.19157e-07
2.1431e-07
1.15914e-05
1.66034e-07
1.15988e-05
1.72907e-07
1.16069e-05
1.82289e-07
1.16103e-05
1.8515e-07
1.16104e-05
1.74735e-07
1.16134e-05
1.61584e-07
1.16191e-05
1.66051e-07
1.16231e-05
1.67303e-07
1.1623e-05
1.65619e-07
1.1621e-05
1.50273e-07
1.16238e-05
1.3969e-07
1.16284e-05
1.44285e-07
1.16274e-05
1.47598e-07
1.16248e-05
1.35169e-07
1.16253e-05
1.2621e-07
1.16271e-05
1.24659e-07
1.16263e-05
1.24673e-07
1.16235e-05
1.20045e-07
1.16222e-05
1.11734e-07
1.16236e-05
1.08377e-07
1.16219e-05
1.12382e-07
1.16181e-05
1.05578e-07
1.16172e-05
1.01218e-07
1.16172e-05
1.02818e-07
1.16144e-05
1.08762e-07
1.16124e-05
1.00983e-07
1.16125e-05
1.0543e-07
1.16123e-05
1.06893e-07
1.16115e-05
1.11949e-07
1.16118e-05
1.08271e-07
1.16121e-05
1.13217e-07
1.16127e-05
1.10817e-07
1.16129e-05
1.08768e-07
1.16137e-05
1.0415e-07
1.16137e-05
1.03247e-07
1.16129e-05
9.21773e-08
1.16116e-05
8.68886e-08
1.16094e-05
7.14098e-08
1.16068e-05
6.9217e-08
1.16032e-05
5.71353e-08
1.15999e-05
5.93242e-08
1.15973e-05
5.58009e-08
1.15966e-05
6.1874e-08
1.15982e-05
7.1932e-08
1.16009e-05
7.44679e-08
1.1606e-05
8.30505e-08
1.16112e-05
7.30896e-08
1.16165e-05
6.99198e-08
1.16196e-05
4.77011e-08
1.16203e-05
2.60742e-08
1.16197e-05
1.22042e-08
1.16175e-05
-5.93722e-09
1.16171e-05
4.24079e-09
1.16176e-05
1.39266e-09
1.16215e-05
2.71943e-08
1.16261e-05
3.03509e-08
1.16313e-05
4.01639e-08
1.1636e-05
4.25938e-08
1.16382e-05
2.84313e-08
1.16399e-05
3.69553e-08
1.16404e-05
2.9453e-08
1.16405e-05
4.49152e-08
1.16421e-05
6.25293e-08
1.16443e-05
8.71515e-08
1.16472e-05
1.08745e-07
1.16505e-05
1.32307e-07
1.16552e-05
1.51562e-07
1.16552e-05
1.4916e-07
1.16543e-05
1.44128e-07
1.16547e-05
1.81688e-07
1.16533e-05
1.54158e-07
1.16508e-05
1.85464e-07
1.16488e-05
1.59853e-07
1.16471e-05
1.82178e-07
1.16457e-05
1.62611e-07
1.16415e-05
1.61035e-07
1.16381e-05
1.63828e-07
1.16389e-05
1.96338e-07
1.16402e-05
1.96479e-07
1.16354e-05
1.31387e-07
1.16236e-05
1.00604e-07
1.16166e-05
1.02493e-07
1.16173e-05
2.23527e-07
1.16194e-05
2.26389e-07
1.16204e-05
2.98116e-07
1.16261e-05
2.75526e-07
1.16194e-05
1.71528e-07
1.16073e-05
2.14572e-08
1.16025e-05
2.33368e-08
1.16065e-05
4.16617e-08
1.16097e-05
3.73098e-09
1.16088e-05
-2.8916e-08
1.16159e-05
-1.65533e-09
1.16256e-05
4.83822e-10
1.1636e-05
-2.95512e-08
1.16357e-05
-1.32853e-07
1.1631e-05
-1.52474e-07
1.1634e-05
-3.44843e-09
1.16418e-05
1.11377e-07
2.09855e-07
1.21447e-05
1.61615e-07
1.21508e-05
1.66856e-07
1.21588e-05
1.74228e-07
1.21642e-05
1.79765e-07
1.21649e-05
1.74041e-07
1.21668e-05
1.59714e-07
1.21719e-05
1.6097e-07
1.21763e-05
1.62829e-07
1.21781e-05
1.63869e-07
1.2176e-05
1.52369e-07
1.21766e-05
1.39118e-07
1.21817e-05
1.39149e-07
1.2183e-05
1.46273e-07
1.21805e-05
1.37681e-07
1.21797e-05
1.27008e-07
1.21817e-05
1.22714e-07
1.21823e-05
1.2406e-07
1.21798e-05
1.22497e-07
1.21772e-05
1.14337e-07
1.21782e-05
1.07351e-07
1.2178e-05
1.12595e-07
1.21744e-05
1.09232e-07
1.21726e-05
1.03025e-07
1.21732e-05
1.02165e-07
1.21712e-05
1.10757e-07
1.21685e-05
1.0374e-07
1.21685e-05
1.05404e-07
1.21688e-05
1.06581e-07
1.21681e-05
1.12634e-07
1.21682e-05
1.08229e-07
1.21684e-05
1.12935e-07
1.21687e-05
1.10532e-07
1.21689e-05
1.08633e-07
1.21697e-05
1.03319e-07
1.21697e-05
1.03232e-07
1.21689e-05
9.30301e-08
1.21675e-05
8.82289e-08
1.21655e-05
7.34545e-08
1.21632e-05
7.15065e-08
1.216e-05
6.03358e-08
1.21571e-05
6.22376e-08
1.21547e-05
5.81486e-08
1.21541e-05
6.24934e-08
1.21555e-05
7.0499e-08
1.2158e-05
7.19914e-08
1.21627e-05
7.83776e-08
1.21675e-05
6.83166e-08
1.21724e-05
6.49227e-08
1.21753e-05
4.48358e-08
1.21761e-05
2.52905e-08
1.21758e-05
1.25006e-08
1.2174e-05
-4.14745e-09
1.21738e-05
4.49285e-09
1.21743e-05
8.82387e-10
1.21778e-05
2.36339e-08
1.2182e-05
2.61626e-08
1.21868e-05
3.53746e-08
1.21912e-05
3.8193e-08
1.21934e-05
2.62857e-08
1.21951e-05
3.52589e-08
1.21956e-05
2.88707e-08
1.21959e-05
4.46196e-08
1.21975e-05
6.09298e-08
1.21997e-05
8.50084e-08
1.22026e-05
1.05854e-07
1.22057e-05
1.29156e-07
1.22102e-05
1.47092e-07
1.22104e-05
1.48937e-07
1.22099e-05
1.44595e-07
1.22105e-05
1.8116e-07
1.22092e-05
1.55413e-07
1.22071e-05
1.87534e-07
1.22053e-05
1.61668e-07
1.22036e-05
1.83863e-07
1.22023e-05
1.63966e-07
1.21984e-05
1.64924e-07
1.21953e-05
1.66966e-07
1.21959e-05
1.95692e-07
1.21968e-05
1.95585e-07
1.21921e-05
1.36133e-07
1.21808e-05
1.11821e-07
1.21741e-05
1.09198e-07
1.21747e-05
2.22926e-07
1.21769e-05
2.24225e-07
1.21782e-05
2.96842e-07
1.21838e-05
2.69871e-07
1.21776e-05
1.77786e-07
1.21663e-05
3.27107e-08
1.21617e-05
2.79962e-08
1.21652e-05
3.80862e-08
1.21682e-05
7.96806e-10
1.21673e-05
-2.80735e-08
1.21743e-05
-8.65565e-09
1.21833e-05
-8.54311e-09
1.2193e-05
-3.92252e-08
1.21925e-05
-1.32308e-07
1.21878e-05
-1.47809e-07
1.21907e-05
-6.30475e-09
1.21981e-05
1.03936e-07
2.0534e-07
1.27248e-05
1.57708e-07
1.273e-05
1.61694e-07
1.27372e-05
1.6702e-07
1.27438e-05
1.73118e-07
1.27456e-05
1.72249e-07
1.27467e-05
1.58623e-07
1.27509e-05
1.56764e-07
1.27557e-05
1.58058e-07
1.27591e-05
1.60482e-07
1.27579e-05
1.53478e-07
1.2757e-05
1.40022e-07
1.27612e-05
1.34993e-07
1.27643e-05
1.43163e-07
1.27628e-05
1.39192e-07
1.27608e-05
1.29003e-07
1.27621e-05
1.21435e-07
1.27639e-05
1.22276e-07
1.27626e-05
1.23792e-07
1.27592e-05
1.1769e-07
1.27594e-05
1.07176e-07
1.27606e-05
1.11428e-07
1.27577e-05
1.12131e-07
1.27545e-05
1.06161e-07
1.27552e-05
1.01456e-07
1.27546e-05
1.11415e-07
1.27517e-05
1.06628e-07
1.27511e-05
1.06021e-07
1.27517e-05
1.05923e-07
1.2751e-05
1.13357e-07
1.27507e-05
1.0852e-07
1.27511e-05
1.12497e-07
1.27515e-05
1.10134e-07
1.27516e-05
1.08626e-07
1.27522e-05
1.0263e-07
1.27523e-05
1.03165e-07
1.27516e-05
9.37612e-08
1.27504e-05
8.94273e-08
1.27485e-05
7.53235e-08
1.27464e-05
7.36631e-08
1.27434e-05
6.33219e-08
1.27407e-05
6.49081e-08
1.27386e-05
6.02494e-08
1.27381e-05
6.29606e-08
1.27396e-05
6.90726e-08
1.27419e-05
6.96765e-08
1.27461e-05
7.41087e-08
1.27505e-05
6.39266e-08
1.27552e-05
6.03008e-08
1.27579e-05
4.21296e-08
1.27587e-05
2.44207e-08
1.27586e-05
1.26508e-08
1.2757e-05
-2.6137e-09
1.27569e-05
4.61192e-09
1.27574e-05
4.25775e-10
1.27607e-05
2.0354e-08
1.27645e-05
2.23392e-08
1.27689e-05
3.09262e-08
1.2773e-05
3.41035e-08
1.27751e-05
2.41717e-08
1.27768e-05
3.35858e-08
1.27774e-05
2.82404e-08
1.27779e-05
4.4188e-08
1.27794e-05
5.93581e-08
1.27815e-05
8.29674e-08
1.27843e-05
1.0299e-07
1.27874e-05
1.2615e-07
1.27916e-05
1.42841e-07
1.27921e-05
1.48469e-07
1.2792e-05
1.44713e-07
1.27926e-05
1.80474e-07
1.27916e-05
1.56407e-07
1.279e-05
1.89214e-07
1.27883e-05
1.63298e-07
1.27867e-05
1.85476e-07
1.27854e-05
1.65316e-07
1.27818e-05
1.68498e-07
1.2779e-05
1.69805e-07
1.27795e-05
1.95194e-07
1.278e-05
1.95083e-07
1.27753e-05
1.40783e-07
1.27647e-05
1.2242e-07
1.27583e-05
1.1558e-07
1.27588e-05
2.2244e-07
1.27611e-05
2.21935e-07
1.27627e-05
2.95288e-07
1.27682e-05
2.64313e-07
1.27625e-05
1.83539e-07
1.27521e-05
4.31105e-08
1.27476e-05
3.2447e-08
1.27507e-05
3.49948e-08
1.27534e-05
-1.93985e-09
1.27527e-05
-2.72992e-08
1.27595e-05
-1.54381e-08
1.27678e-05
-1.68865e-08
1.27767e-05
-4.81586e-08
1.27759e-05
-1.31474e-07
1.27712e-05
-1.43123e-07
1.27739e-05
-9.00745e-09
1.2781e-05
9.68498e-08
2.00776e-07
1.33325e-05
1.54329e-07
1.33373e-05
1.56918e-07
1.33432e-05
1.61076e-07
1.33505e-05
1.65887e-07
1.33538e-05
1.68886e-07
1.33548e-05
1.57657e-07
1.33583e-05
1.53308e-07
1.33626e-05
1.5369e-07
1.33669e-05
1.56219e-07
1.33674e-05
1.5299e-07
1.33657e-05
1.41737e-07
1.33682e-05
1.32457e-07
1.33723e-05
1.39048e-07
1.33727e-05
1.38848e-07
1.33705e-05
1.31182e-07
1.33704e-05
1.21523e-07
1.33727e-05
1.19953e-07
1.33732e-05
1.2332e-07
1.33696e-05
1.21277e-07
1.33682e-05
1.08597e-07
1.33699e-05
1.0973e-07
1.33686e-05
1.13433e-07
1.33649e-05
1.09834e-07
1.33649e-05
1.01445e-07
1.33654e-05
1.10886e-07
1.33627e-05
1.09373e-07
1.33611e-05
1.07598e-07
1.33622e-05
1.04881e-07
1.33621e-05
1.13439e-07
1.33615e-05
1.09063e-07
1.33618e-05
1.12219e-07
1.33622e-05
1.09707e-07
1.33621e-05
1.08747e-07
1.33628e-05
1.01981e-07
1.3363e-05
1.02947e-07
1.33623e-05
9.44989e-08
1.33609e-05
9.07624e-08
1.33591e-05
7.71112e-08
1.33573e-05
7.55232e-08
1.33547e-05
6.58624e-08
1.33524e-05
6.71999e-08
1.33506e-05
6.20977e-08
1.33502e-05
6.33491e-08
1.33516e-05
6.77024e-08
1.33537e-05
6.75519e-08
1.33575e-05
7.02591e-08
1.33615e-05
5.99359e-08
1.33658e-05
5.60688e-08
1.33683e-05
3.95953e-08
1.33692e-05
2.3492e-08
1.33693e-05
1.26078e-08
1.3368e-05
-1.37865e-09
1.33681e-05
4.56098e-09
1.33685e-05
6.46929e-12
1.33715e-05
1.73699e-08
1.33749e-05
1.89127e-08
1.3379e-05
2.68681e-08
1.33827e-05
3.03789e-08
1.33847e-05
2.21405e-08
1.33864e-05
3.1945e-08
1.3387e-05
2.75723e-08
1.33876e-05
4.36667e-08
1.33891e-05
5.78454e-08
1.3391e-05
8.1021e-08
1.33939e-05
1.00137e-07
1.33968e-05
1.23276e-07
1.34008e-05
1.38825e-07
1.34015e-05
1.47762e-07
1.34017e-05
1.44464e-07
1.34026e-05
1.79603e-07
1.34018e-05
1.57162e-07
1.34005e-05
1.90531e-07
1.33991e-05
1.64726e-07
1.33976e-05
1.86972e-07
1.33963e-05
1.66631e-07
1.3393e-05
1.71765e-07
1.33905e-05
1.72363e-07
1.33908e-05
1.94809e-07
1.3391e-05
1.9492e-07
1.33865e-05
1.45303e-07
1.33765e-05
1.32412e-07
1.33704e-05
1.21642e-07
1.33708e-05
2.22055e-07
1.33732e-05
2.19523e-07
1.33751e-05
2.93447e-07
1.33806e-05
2.58836e-07
1.33754e-05
1.88739e-07
1.33658e-05
5.2656e-08
1.33616e-05
3.66629e-08
1.33642e-05
3.23729e-08
1.33668e-05
-4.48982e-09
1.33661e-05
-2.65901e-08
1.33726e-05
-2.19602e-08
1.33802e-05
-2.45389e-08
1.33884e-05
-5.62917e-08
1.33872e-05
-1.30342e-07
1.33825e-05
-1.38395e-07
1.3385e-05
-1.14996e-08
1.33917e-05
9.01467e-08
1.96176e-07
1.39693e-05
1.51507e-07
1.3974e-05
1.52181e-07
1.3979e-05
1.5611e-07
1.39859e-05
1.58962e-07
1.39908e-05
1.64048e-07
1.39919e-05
1.56555e-07
1.39948e-05
1.50417e-07
1.39986e-05
1.49818e-07
1.40031e-05
1.51725e-07
1.40054e-05
1.50754e-07
1.4004e-05
1.43073e-07
1.40051e-05
1.31349e-07
1.40091e-05
1.3512e-07
1.40109e-05
1.36964e-07
1.40095e-05
1.32655e-07
1.40082e-05
1.22837e-07
1.40099e-05
1.18251e-07
1.40119e-05
1.21236e-07
1.40094e-05
1.23857e-07
1.40066e-05
1.11319e-07
1.40081e-05
1.08246e-07
1.40086e-05
1.12993e-07
1.40048e-05
1.13611e-07
1.40035e-05
1.02767e-07
1.40048e-05
1.09599e-07
1.40032e-05
1.10946e-07
1.40009e-05
1.09857e-07
1.40017e-05
1.04141e-07
1.40022e-05
1.12874e-07
1.40015e-05
1.09824e-07
1.40015e-05
1.12236e-07
1.40021e-05
1.09019e-07
1.4002e-05
1.08875e-07
1.40023e-05
1.01642e-07
1.40026e-05
1.02706e-07
1.40021e-05
9.50059e-08
1.40009e-05
9.19375e-08
1.39993e-05
7.86727e-08
1.39977e-05
7.71245e-08
1.39955e-05
6.8144e-08
1.39934e-05
6.92966e-08
1.39917e-05
6.37672e-08
1.39914e-05
6.36496e-08
1.39928e-05
6.63361e-08
1.39948e-05
6.55502e-08
1.39982e-05
6.6782e-08
1.40019e-05
5.62949e-08
1.40058e-05
5.21631e-08
1.40082e-05
3.72265e-08
1.40091e-05
2.25113e-08
1.40093e-05
1.24145e-08
1.40083e-05
-3.21523e-10
1.40084e-05
4.43601e-09
1.40088e-05
-3.54706e-10
1.40115e-05
1.46702e-08
1.40145e-05
1.58528e-08
1.40182e-05
2.31588e-08
1.40216e-05
2.69644e-08
1.40236e-05
2.01834e-08
1.40252e-05
3.03766e-08
1.40258e-05
2.69075e-08
1.40264e-05
4.30696e-08
1.40279e-05
5.63868e-08
1.40297e-05
7.92065e-08
1.40325e-05
9.73669e-08
1.40352e-05
1.20524e-07
1.40391e-05
1.34993e-07
1.404e-05
1.46824e-07
1.40406e-05
1.43909e-07
1.40416e-05
1.78552e-07
1.40411e-05
1.57642e-07
1.40402e-05
1.91445e-07
1.4039e-05
1.65943e-07
1.40376e-05
1.88349e-07
1.40363e-05
1.67907e-07
1.40334e-05
1.74711e-07
1.40311e-05
1.74647e-07
1.40314e-05
1.94523e-07
1.40312e-05
1.95071e-07
1.40269e-05
1.49677e-07
1.40175e-05
1.4178e-07
1.40118e-05
1.27372e-07
1.40121e-05
2.21736e-07
1.40146e-05
2.17e-07
1.40167e-05
2.91323e-07
1.40221e-05
2.5344e-07
1.40175e-05
1.93347e-07
1.40088e-05
6.13525e-08
1.40049e-05
4.05941e-08
1.40071e-05
3.01897e-08
1.40095e-05
-6.8589e-09
1.40088e-05
-2.59412e-08
1.4015e-05
-2.81686e-08
1.4022e-05
-3.1504e-08
1.40293e-05
-6.35741e-08
1.40278e-05
-1.28891e-07
1.4023e-05
-1.33601e-07
1.40252e-05
-1.37267e-08
1.40315e-05
8.3846e-08
1.91557e-07
1.46365e-05
1.49057e-07
1.4641e-05
1.47703e-07
1.46456e-05
1.51473e-07
1.46515e-05
1.5305e-07
1.46576e-05
1.58025e-07
1.46594e-05
1.54716e-07
1.4662e-05
1.47858e-07
1.46655e-05
1.46256e-07
1.46696e-05
1.47616e-07
1.46732e-05
1.47225e-07
1.46727e-05
1.4349e-07
1.46727e-05
1.31352e-07
1.4676e-05
1.31835e-07
1.46789e-05
1.34141e-07
1.46788e-05
1.32704e-07
1.46772e-05
1.24462e-07
1.46775e-05
1.1789e-07
1.46806e-05
1.1813e-07
1.46799e-05
1.24639e-07
1.46762e-05
1.1503e-07
1.46763e-05
1.08114e-07
1.4678e-05
1.11249e-07
1.46755e-05
1.16182e-07
1.46732e-05
1.05048e-07
1.46744e-05
1.08373e-07
1.46741e-05
1.11233e-07
1.46714e-05
1.12574e-07
1.46713e-05
1.04254e-07
1.46726e-05
1.11544e-07
1.46723e-05
1.10187e-07
1.46717e-05
1.12739e-07
1.46724e-05
1.08397e-07
1.46725e-05
1.08752e-07
1.46727e-05
1.0142e-07
1.46731e-05
1.02369e-07
1.46728e-05
9.52765e-08
1.46716e-05
9.31345e-08
1.467e-05
8.02933e-08
1.46686e-05
7.85114e-08
1.46667e-05
7.00028e-08
1.4665e-05
7.1064e-08
1.46635e-05
6.519e-08
1.46633e-05
6.38504e-08
1.46647e-05
6.50078e-08
1.46665e-05
6.36564e-08
1.46697e-05
6.36671e-08
1.46729e-05
5.30258e-08
1.46765e-05
4.85973e-08
1.46787e-05
3.50666e-08
1.46796e-05
2.15537e-08
1.468e-05
1.20614e-08
1.46791e-05
4.99197e-10
1.46794e-05
4.1993e-09
1.46797e-05
-6.77541e-10
1.46821e-05
1.22305e-08
1.46848e-05
1.31665e-08
1.46882e-05
1.98358e-08
1.46912e-05
2.39072e-08
1.4693e-05
1.8352e-08
1.46945e-05
2.88879e-08
1.46952e-05
2.62459e-08
1.46958e-05
4.24373e-08
1.46972e-05
5.50259e-08
1.46989e-05
7.75255e-08
1.47016e-05
9.46651e-08
1.47042e-05
1.17875e-07
1.47079e-05
1.31361e-07
1.4709e-05
1.45678e-07
1.47099e-05
1.43028e-07
1.47111e-05
1.77287e-07
1.47109e-05
1.57869e-07
1.47104e-05
1.92008e-07
1.47094e-05
1.66946e-07
1.47081e-05
1.89563e-07
1.47069e-05
1.69109e-07
1.47043e-05
1.77343e-07
1.47023e-05
1.76684e-07
1.47025e-05
1.94309e-07
1.47021e-05
1.95465e-07
1.46979e-05
1.53866e-07
1.46892e-05
1.5052e-07
1.46838e-05
1.32774e-07
1.4684e-05
2.21472e-07
1.46866e-05
2.14388e-07
1.4689e-05
2.88909e-07
1.46944e-05
2.48121e-07
1.46904e-05
1.97317e-07
1.46825e-05
6.92091e-08
1.46789e-05
4.42254e-08
1.46807e-05
2.84259e-08
1.46829e-05
-9.04619e-09
1.46823e-05
-2.53729e-08
1.46881e-05
-3.40156e-08
1.46944e-05
-3.77955e-08
1.47008e-05
-6.99651e-08
1.4699e-05
-1.27111e-07
1.46942e-05
-1.28738e-07
1.46961e-05
-1.56328e-08
1.4702e-05
7.79756e-08
1.86939e-07
1.53358e-05
1.46156e-07
1.53397e-05
1.43812e-07
1.53445e-05
1.46588e-07
1.53494e-05
1.48222e-07
1.53558e-05
1.51576e-07
1.53588e-05
1.5173e-07
1.53609e-05
1.45717e-07
1.53644e-05
1.42826e-07
1.5368e-05
1.43999e-07
1.53722e-05
1.43048e-07
1.53732e-05
1.42458e-07
1.53729e-05
1.31659e-07
1.53754e-05
1.29353e-07
1.53783e-05
1.31187e-07
1.53795e-05
1.31509e-07
1.53784e-05
1.25555e-07
1.53774e-05
1.18925e-07
1.53802e-05
1.15355e-07
1.53814e-05
1.23401e-07
1.53782e-05
1.18257e-07
1.53769e-05
1.09425e-07
1.53792e-05
1.08881e-07
1.53782e-05
1.17182e-07
1.53752e-05
1.08088e-07
1.53755e-05
1.0807e-07
1.53764e-05
1.10369e-07
1.53743e-05
1.14666e-07
1.53732e-05
1.05363e-07
1.53746e-05
1.10079e-07
1.53751e-05
1.09725e-07
1.53743e-05
1.13571e-07
1.53746e-05
1.08019e-07
1.53752e-05
1.08228e-07
1.53753e-05
1.01335e-07
1.53753e-05
1.02321e-07
1.53752e-05
9.5391e-08
1.53743e-05
9.40309e-08
1.53728e-05
8.17374e-08
1.53717e-05
7.96517e-08
1.53702e-05
7.1469e-08
1.53687e-05
7.25761e-08
1.53674e-05
6.64893e-08
1.53673e-05
6.39832e-08
1.53686e-05
6.3724e-08
1.53704e-05
6.18754e-08
1.53731e-05
6.08803e-08
1.53761e-05
5.00955e-08
1.53794e-05
4.53125e-08
1.53814e-05
3.30262e-08
1.53823e-05
2.06123e-08
1.53828e-05
1.1597e-08
1.53822e-05
1.12694e-09
1.53824e-05
3.96104e-09
1.53827e-05
-9.22512e-10
1.53848e-05
1.00587e-08
1.53872e-05
1.08307e-08
1.53901e-05
1.68733e-08
1.53929e-05
2.11609e-08
1.53946e-05
1.66147e-08
1.5396e-05
2.75045e-08
1.53966e-05
2.56485e-08
1.53973e-05
4.17849e-08
1.53985e-05
5.37322e-08
1.54001e-05
7.59782e-08
1.54026e-05
9.21097e-08
1.54052e-05
1.15351e-07
1.54087e-05
1.27879e-07
1.541e-05
1.4431e-07
1.54112e-05
1.41888e-07
1.54126e-05
1.75839e-07
1.54126e-05
1.57832e-07
1.54125e-05
1.92185e-07
1.54117e-05
1.67717e-07
1.54107e-05
1.90604e-07
1.54095e-05
1.70237e-07
1.54072e-05
1.79649e-07
1.54054e-05
1.78471e-07
1.54056e-05
1.94138e-07
1.5405e-05
1.96069e-07
1.5401e-05
1.57865e-07
1.53929e-05
1.58625e-07
1.53878e-05
1.37837e-07
1.53881e-05
2.2123e-07
1.53908e-05
2.11712e-07
1.53935e-05
2.86202e-07
1.53987e-05
2.42887e-07
1.53954e-05
2.00621e-07
1.53883e-05
7.62484e-08
1.53851e-05
4.75243e-08
1.53864e-05
2.70278e-08
1.53884e-05
-1.10455e-08
1.5388e-05
-2.48895e-08
1.53934e-05
-3.94413e-08
1.5399e-05
-4.344e-08
1.54045e-05
-7.54502e-08
1.54024e-05
-1.24977e-07
1.53974e-05
-1.23793e-07
1.5399e-05
-1.71653e-08
1.54044e-05
7.25505e-08
1.82339e-07
1.60686e-05
1.42285e-07
1.60718e-05
1.4062e-07
1.60767e-05
1.41605e-07
1.6081e-05
1.43982e-07
1.60869e-05
1.45659e-07
1.60913e-05
1.47311e-07
1.60935e-05
1.43569e-07
1.60968e-05
1.39467e-07
1.61002e-05
1.40585e-07
1.61043e-05
1.38967e-07
1.61067e-05
1.40069e-07
1.61064e-05
1.3197e-07
1.61082e-05
1.27584e-07
1.61111e-05
1.28289e-07
1.61129e-05
1.29702e-07
1.6113e-05
1.25381e-07
1.61115e-05
1.20423e-07
1.61132e-05
1.1371e-07
1.6116e-05
1.20539e-07
1.61142e-05
1.20125e-07
1.61114e-05
1.12213e-07
1.6113e-05
1.07225e-07
1.61136e-05
1.16632e-07
1.6111e-05
1.10639e-07
1.61104e-05
1.08679e-07
1.61119e-05
1.08923e-07
1.61109e-05
1.15667e-07
1.6109e-05
1.07274e-07
1.61099e-05
1.0919e-07
1.61113e-05
1.08249e-07
1.61107e-05
1.14237e-07
1.61103e-05
1.08373e-07
1.6111e-05
1.07586e-07
1.61114e-05
1.00883e-07
1.61114e-05
1.02354e-07
1.61114e-05
9.53853e-08
1.61108e-05
9.46186e-08
1.61094e-05
8.31e-08
1.61083e-05
8.0768e-08
1.61072e-05
7.25818e-08
1.61061e-05
7.37167e-08
1.61049e-05
6.76266e-08
1.61049e-05
6.40447e-08
1.61061e-05
6.24614e-08
1.61078e-05
6.0179e-08
1.61103e-05
5.83547e-08
1.6113e-05
4.74873e-08
1.61159e-05
4.23397e-08
1.61178e-05
3.11321e-08
1.61187e-05
1.97687e-08
1.61192e-05
1.10987e-08
1.61188e-05
1.53778e-09
1.61191e-05
3.6455e-09
1.61192e-05
-1.09831e-09
1.61212e-05
8.12086e-09
1.61232e-05
8.81764e-09
1.61258e-05
1.42712e-08
1.61282e-05
1.87799e-08
1.61298e-05
1.50397e-08
1.6131e-05
2.62157e-08
1.61316e-05
2.50919e-08
1.61323e-05
4.11346e-08
1.61334e-05
5.25695e-08
1.61348e-05
7.45712e-08
1.61373e-05
8.96719e-08
1.61397e-05
1.1293e-07
1.6143e-05
1.24576e-07
1.61445e-05
1.42781e-07
1.61459e-05
1.40483e-07
1.61476e-05
1.74152e-07
1.61479e-05
1.57529e-07
1.61481e-05
1.92023e-07
1.61475e-05
1.6827e-07
1.61467e-05
1.9144e-07
1.61457e-05
1.71257e-07
1.61437e-05
1.81627e-07
1.61421e-05
1.80046e-07
1.61423e-05
1.93995e-07
1.61415e-05
1.96805e-07
1.61377e-05
1.61633e-07
1.61303e-05
1.66085e-07
1.61256e-05
1.42566e-07
1.61258e-05
2.20984e-07
1.61285e-05
2.09002e-07
1.61315e-05
2.83202e-07
1.61367e-05
2.37742e-07
1.61341e-05
2.03228e-07
1.61278e-05
8.24836e-08
1.61249e-05
5.04922e-08
1.61259e-05
2.59681e-08
1.61277e-05
-1.28343e-08
1.61273e-05
-2.45202e-08
1.61323e-05
-4.43949e-08
1.61373e-05
-4.84509e-08
1.61419e-05
-8.00262e-08
1.61394e-05
-1.22477e-07
1.61344e-05
-1.18793e-07
1.61355e-05
-1.82811e-08
1.61404e-05
6.7598e-08
1.77779e-07
1.68357e-05
1.37559e-07
1.68389e-05
1.37472e-07
1.68436e-05
1.36896e-07
1.68481e-05
1.3946e-07
1.68532e-05
1.40572e-07
1.68585e-05
1.41981e-07
1.68611e-05
1.40987e-07
1.68641e-05
1.36494e-07
1.68675e-05
1.37179e-07
1.68711e-05
1.35418e-07
1.68746e-05
1.3657e-07
1.68751e-05
1.31467e-07
1.68763e-05
1.263e-07
1.68792e-05
1.25474e-07
1.68811e-05
1.27715e-07
1.68824e-05
1.24101e-07
1.68813e-05
1.21591e-07
1.68813e-05
1.13625e-07
1.68844e-05
1.17459e-07
1.68845e-05
1.20016e-07
1.68815e-05
1.15231e-07
1.68821e-05
1.06599e-07
1.68839e-05
1.14853e-07
1.68824e-05
1.12166e-07
1.68809e-05
1.10191e-07
1.6882e-05
1.07801e-07
1.68822e-05
1.15469e-07
1.68803e-05
1.09132e-07
1.68802e-05
1.09359e-07
1.68821e-05
1.06314e-07
1.68824e-05
1.13971e-07
1.68815e-05
1.09284e-07
1.68819e-05
1.07099e-07
1.68829e-05
9.98985e-08
1.68828e-05
1.02435e-07
1.68826e-05
9.56441e-08
1.68822e-05
9.49736e-08
1.68812e-05
8.41039e-08
1.68803e-05
8.17299e-08
1.68794e-05
7.34366e-08
1.68787e-05
7.44644e-08
1.68777e-05
6.85885e-08
1.68776e-05
6.41034e-08
1.68789e-05
6.12038e-08
1.68805e-05
5.8581e-08
1.68827e-05
5.61234e-08
1.6885e-05
4.51894e-08
1.68877e-05
3.96704e-08
1.68895e-05
2.9343e-08
1.68904e-05
1.89038e-08
1.68908e-05
1.05995e-08
1.68906e-05
1.79917e-09
1.68909e-05
3.29788e-09
1.6891e-05
-1.16625e-09
1.68927e-05
6.45453e-09
1.68944e-05
7.12255e-09
1.68966e-05
1.19973e-08
1.68987e-05
1.67222e-08
1.69001e-05
1.36025e-08
1.69013e-05
2.50293e-08
1.69018e-05
2.46419e-08
1.69024e-05
4.05136e-08
1.69035e-05
5.14949e-08
1.69048e-05
7.3279e-08
1.6907e-05
8.74029e-08
1.69093e-05
1.10661e-07
1.69125e-05
1.21408e-07
1.69142e-05
1.4105e-07
1.69158e-05
1.38864e-07
1.69177e-05
1.72289e-07
1.69182e-05
1.56988e-07
1.69187e-05
1.91503e-07
1.69184e-05
1.68572e-07
1.69178e-05
1.9204e-07
1.69169e-05
1.72165e-07
1.69153e-05
1.83276e-07
1.69139e-05
1.81398e-07
1.69141e-05
1.93844e-07
1.69133e-05
1.97624e-07
1.69097e-05
1.6516e-07
1.69029e-05
1.72892e-07
1.68985e-05
1.46954e-07
1.68988e-05
2.20691e-07
1.69015e-05
2.06297e-07
1.69048e-05
2.79901e-07
1.69099e-05
2.32692e-07
1.6908e-05
2.05139e-07
1.69025e-05
8.79536e-08
1.68999e-05
5.31285e-08
1.69007e-05
2.51667e-08
1.69022e-05
-1.43892e-08
1.6902e-05
-2.42647e-08
1.69064e-05
-4.88213e-08
1.69108e-05
-5.28517e-08
1.69145e-05
-8.37223e-08
1.69116e-05
-1.19582e-07
1.69065e-05
-1.1374e-07
1.69072e-05
-1.89441e-08
1.69117e-05
6.31317e-08
1.73274e-07
1.76393e-05
1.32483e-07
1.76431e-05
1.33679e-07
1.76472e-05
1.32778e-07
1.76521e-05
1.34607e-07
1.76564e-05
1.36245e-07
1.76616e-05
1.3678e-07
1.76653e-05
1.37364e-07
1.7668e-05
1.33762e-07
1.76716e-05
1.33522e-07
1.76749e-05
1.32174e-07
1.76788e-05
1.32617e-07
1.76804e-05
1.29894e-07
1.76811e-05
1.25571e-07
1.76839e-05
1.22699e-07
1.76859e-05
1.25694e-07
1.76876e-05
1.22426e-07
1.76876e-05
1.21619e-07
1.76868e-05
1.14392e-07
1.76894e-05
1.14855e-07
1.76914e-05
1.18036e-07
1.76891e-05
1.17552e-07
1.76884e-05
1.07285e-07
1.76902e-05
1.13071e-07
1.76899e-05
1.12466e-07
1.76883e-05
1.11778e-07
1.76888e-05
1.07242e-07
1.76899e-05
1.14446e-07
1.76888e-05
1.10171e-07
1.76877e-05
1.10478e-07
1.76894e-05
1.04628e-07
1.76909e-05
1.12451e-07
1.76899e-05
1.10284e-07
1.76895e-05
1.07475e-07
1.76909e-05
9.85751e-08
1.76913e-05
1.02003e-07
1.76909e-05
9.60612e-08
1.76906e-05
9.52523e-08
1.769e-05
8.4734e-08
1.76892e-05
8.24989e-08
1.76885e-05
7.41764e-08
1.76881e-05
7.4878e-08
1.76874e-05
6.92759e-08
1.76873e-05
6.41795e-08
1.76885e-05
6.00071e-08
1.769e-05
5.70332e-08
1.7692e-05
5.41224e-08
1.76941e-05
4.31361e-08
1.76965e-05
3.72646e-08
1.76981e-05
2.77306e-08
1.76989e-05
1.80778e-08
1.76994e-05
1.01571e-08
1.76992e-05
1.98244e-09
1.76996e-05
2.8827e-09
1.76996e-05
-1.19851e-09
1.77011e-05
5.04153e-09
1.77024e-05
5.73285e-09
1.77044e-05
1.0012e-08
1.77061e-05
1.50003e-08
1.77074e-05
1.23866e-08
1.77084e-05
2.39623e-08
1.77088e-05
2.42518e-08
1.77094e-05
3.99209e-08
1.77103e-05
5.05684e-08
1.77115e-05
7.21293e-08
1.77136e-05
8.52545e-08
1.77158e-05
1.0849e-07
1.77188e-05
1.18409e-07
1.77206e-05
1.39217e-07
1.77224e-05
1.37076e-07
1.77245e-05
1.70192e-07
1.77253e-05
1.56178e-07
1.77262e-05
1.90648e-07
1.77261e-05
1.68652e-07
1.77258e-05
1.92394e-07
1.7725e-05
1.72928e-07
1.77237e-05
1.84577e-07
1.77226e-05
1.82537e-07
1.77227e-05
1.9367e-07
1.77219e-05
1.9845e-07
1.77186e-05
1.68417e-07
1.77125e-05
1.7903e-07
1.77084e-05
1.51015e-07
1.77088e-05
2.20311e-07
1.77115e-05
2.03627e-07
1.77151e-05
2.76302e-07
1.77201e-05
2.27737e-07
1.77188e-05
2.06344e-07
1.77141e-05
9.26639e-08
1.77118e-05
5.54607e-08
1.77124e-05
2.45827e-08
1.77137e-05
-1.56571e-08
1.77135e-05
-2.41481e-08
1.77174e-05
-5.26812e-08
1.77212e-05
-5.66335e-08
1.7724e-05
-8.65797e-08
1.77207e-05
-1.1628e-07
1.77157e-05
-1.08658e-07
1.77158e-05
-1.91389e-08
1.77198e-05
5.91773e-08
1.68844e-07
1.84811e-05
1.27674e-07
1.84854e-05
1.29324e-07
1.84891e-05
1.29086e-07
1.84939e-05
1.29811e-07
1.84984e-05
1.31763e-07
1.85031e-05
1.3212e-07
1.85077e-05
1.3275e-07
1.85106e-05
1.30876e-07
1.85142e-05
1.29896e-07
1.85174e-05
1.28996e-07
1.8521e-05
1.29018e-07
1.85238e-05
1.27069e-07
1.85246e-05
1.24802e-07
1.8527e-05
1.20242e-07
1.85294e-05
1.2334e-07
1.85311e-05
1.20675e-07
1.85323e-05
1.20421e-07
1.85316e-05
1.15124e-07
1.85329e-05
1.13507e-07
1.85357e-05
1.15271e-07
1.85347e-05
1.1855e-07
1.85334e-05
1.08576e-07
1.85348e-05
1.11649e-07
1.85357e-05
1.11584e-07
1.85347e-05
1.12844e-07
1.85346e-05
1.07332e-07
1.85357e-05
1.13286e-07
1.85358e-05
1.10127e-07
1.85344e-05
1.11813e-07
1.85351e-05
1.04007e-07
1.85374e-05
1.10101e-07
1.85372e-05
1.10441e-07
1.8536e-05
1.08685e-07
1.85372e-05
9.73696e-08
1.85385e-05
1.00743e-07
1.85381e-05
9.64586e-08
1.85376e-05
9.58004e-08
1.85372e-05
8.50914e-08
1.85368e-05
8.28608e-08
1.85363e-05
7.47291e-08
1.8536e-05
7.51224e-08
1.85356e-05
6.96767e-08
1.85356e-05
6.42051e-08
1.85367e-05
5.8903e-08
1.85383e-05
5.54904e-08
1.854e-05
5.23663e-08
1.85418e-05
4.13634e-08
1.8544e-05
3.51044e-08
1.85454e-05
2.63264e-08
1.85462e-05
1.72609e-08
1.85467e-05
9.67442e-09
1.85465e-05
2.16571e-09
1.85469e-05
2.46588e-09
1.85469e-05
-1.19803e-09
1.8548e-05
3.89499e-09
1.85491e-05
4.67351e-09
1.85508e-05
8.31724e-09
1.85522e-05
1.35619e-08
1.85533e-05
1.13568e-08
1.85542e-05
2.30154e-08
1.85545e-05
2.39714e-08
1.8555e-05
3.93848e-08
1.85558e-05
4.97516e-08
1.85569e-05
7.10945e-08
1.85589e-05
8.32575e-08
1.85609e-05
1.06478e-07
1.85637e-05
1.15568e-07
1.85657e-05
1.37228e-07
1.85677e-05
1.35125e-07
1.85699e-05
1.67927e-07
1.85709e-05
1.55164e-07
1.85721e-05
1.89458e-07
1.85723e-05
1.68477e-07
1.85722e-05
1.92453e-07
1.85716e-05
1.73527e-07
1.85707e-05
1.85553e-07
1.85697e-05
1.83465e-07
1.857e-05
1.93444e-07
1.85692e-05
1.99215e-07
1.85662e-05
1.71389e-07
1.85608e-05
1.84464e-07
1.85571e-05
1.54742e-07
1.85576e-05
2.19794e-07
1.85602e-05
2.01022e-07
1.85641e-05
2.72401e-07
1.8569e-05
2.22863e-07
1.85684e-05
2.06875e-07
1.85644e-05
9.66518e-08
1.85624e-05
5.75335e-08
1.85628e-05
2.41249e-08
1.85638e-05
-1.65997e-08
1.85638e-05
-2.41481e-08
1.8567e-05
-5.59481e-08
1.85702e-05
-5.97851e-08
1.85723e-05
-8.86631e-08
1.85685e-05
-1.12551e-07
1.85635e-05
-1.03566e-07
1.85632e-05
-1.88574e-08
1.85666e-05
5.57581e-08
1.64512e-07
1.93629e-05
1.23077e-07
1.93675e-05
1.24696e-07
1.93715e-05
1.25059e-07
1.9376e-05
1.25343e-07
1.9381e-05
1.26781e-07
1.93852e-05
1.27924e-07
1.939e-05
1.2797e-07
1.93933e-05
1.27493e-07
1.93967e-05
1.26557e-07
1.94003e-05
1.25378e-07
1.94035e-05
1.25798e-07
1.94071e-05
1.23522e-07
1.94085e-05
1.23398e-07
1.94104e-05
1.18348e-07
1.94133e-05
1.20455e-07
1.94149e-05
1.19046e-07
1.94167e-05
1.1862e-07
1.94167e-05
1.15126e-07
1.9417e-05
1.13194e-07
1.942e-05
1.12225e-07
1.94206e-05
1.18021e-07
1.94194e-05
1.09708e-07
1.94201e-05
1.10941e-07
1.94214e-05
1.10328e-07
1.94212e-05
1.1309e-07
1.94209e-05
1.07612e-07
1.94218e-05
1.1241e-07
1.94227e-05
1.0921e-07
1.94219e-05
1.126e-07
1.94214e-05
1.04444e-07
1.94239e-05
1.07633e-07
1.94252e-05
1.09194e-07
1.94236e-05
1.10262e-07
1.94238e-05
9.71075e-08
1.94258e-05
9.8768e-08
1.9426e-05
9.62415e-08
1.94252e-05
9.65982e-08
1.94249e-05
8.54632e-08
1.94249e-05
8.28289e-08
1.94247e-05
7.49243e-08
1.94245e-05
7.52788e-08
1.94243e-05
6.99076e-08
1.94245e-05
6.40701e-08
1.94254e-05
5.79132e-08
1.94269e-05
5.40496e-08
1.94285e-05
5.07563e-08
1.943e-05
3.98486e-08
1.9432e-05
3.31165e-08
1.94332e-05
2.50982e-08
1.94339e-05
1.65861e-08
1.94344e-05
9.17181e-09
1.94342e-05
2.36987e-09
1.94345e-05
2.13754e-09
1.94345e-05
-1.20983e-09
1.94355e-05
2.93698e-09
1.94362e-05
3.9474e-09
1.94376e-05
6.89752e-09
1.94388e-05
1.23761e-08
1.94396e-05
1.05471e-08
1.94404e-05
2.22507e-08
1.94406e-05
2.37981e-08
1.94411e-05
3.88744e-08
1.94418e-05
4.90646e-08
1.94426e-05
7.02225e-08
1.94445e-05
8.13976e-08
1.94465e-05
1.04523e-07
1.94492e-05
1.12861e-07
1.94512e-05
1.35164e-07
1.94532e-05
1.33105e-07
1.94557e-05
1.65489e-07
1.94569e-05
1.53937e-07
1.94584e-05
1.8793e-07
1.94588e-05
1.68071e-07
1.94591e-05
1.92223e-07
1.94587e-05
1.73931e-07
1.94581e-05
1.86168e-07
1.94574e-05
1.84153e-07
1.94577e-05
1.93141e-07
1.9457e-05
1.99849e-07
1.94544e-05
1.74075e-07
1.94496e-05
1.8917e-07
1.94462e-05
1.58151e-07
1.94469e-05
2.19087e-07
1.94495e-05
1.98485e-07
1.94537e-05
2.68224e-07
1.94585e-05
2.18052e-07
1.94586e-05
2.06764e-07
1.94553e-05
9.99017e-08
1.94535e-05
5.94e-08
1.94538e-05
2.37571e-08
1.94544e-05
-1.7172e-08
1.94545e-05
-2.42345e-08
1.94572e-05
-5.86262e-08
1.94597e-05
-6.22652e-08
1.9461e-05
-9.00363e-08
1.94569e-05
-1.0839e-07
1.94518e-05
-9.84548e-08
1.9451e-05
-1.81236e-08
1.94539e-05
5.28789e-08
1.60291e-07
2.02871e-05
1.18292e-07
2.02917e-05
1.20094e-07
2.02962e-05
1.20551e-07
2.03003e-05
1.2134e-07
2.03053e-05
1.21746e-07
2.03096e-05
1.23601e-07
2.0314e-05
1.23537e-07
2.03182e-05
1.23324e-07
2.03215e-05
1.23246e-07
2.03254e-05
1.21545e-07
2.03284e-05
1.22769e-07
2.03319e-05
1.20032e-07
2.03345e-05
1.2073e-07
2.03361e-05
1.16764e-07
2.03392e-05
1.17392e-07
2.03411e-05
1.17134e-07
2.0343e-05
1.16766e-07
2.03441e-05
1.14006e-07
2.03439e-05
1.13364e-07
2.03465e-05
1.09638e-07
2.03481e-05
1.16427e-07
2.03475e-05
1.1034e-07
2.03479e-05
1.10514e-07
2.03492e-05
1.08995e-07
2.03498e-05
1.12509e-07
2.03498e-05
1.07617e-07
2.03502e-05
1.11957e-07
2.03515e-05
1.07961e-07
2.03517e-05
1.12373e-07
2.03508e-05
1.05335e-07
2.03525e-05
1.05989e-07
2.03549e-05
1.06749e-07
2.0354e-05
1.11178e-07
2.03531e-05
9.80357e-08
2.03552e-05
9.66899e-08
2.03565e-05
9.49348e-08
2.03557e-05
9.73619e-08
2.0355e-05
8.61854e-08
2.03552e-05
8.25722e-08
2.03556e-05
7.45912e-08
2.03556e-05
7.52115e-08
2.03553e-05
7.01914e-08
2.03556e-05
6.38072e-08
2.03566e-05
5.68906e-08
2.03579e-05
5.27423e-08
2.03594e-05
4.92768e-08
2.03607e-05
3.85794e-08
2.03625e-05
3.13493e-08
2.03635e-05
2.4004e-08
2.0364e-05
1.61104e-08
2.03646e-05
8.6407e-09
2.03644e-05
2.52439e-09
2.03646e-05
1.97217e-09
2.03645e-05
-1.14039e-09
2.03653e-05
2.11902e-09
2.03657e-05
3.51293e-09
2.03668e-05
5.8102e-09
2.03677e-05
1.1469e-08
2.03684e-05
9.87349e-09
2.03691e-05
2.16141e-08
2.03691e-05
2.37972e-08
2.03695e-05
3.84394e-08
2.03701e-05
4.84954e-08
2.03708e-05
6.94461e-08
2.03726e-05
7.96772e-08
2.03744e-05
1.02675e-07
2.03769e-05
1.1036e-07
2.03791e-05
1.33015e-07
2.03812e-05
1.30971e-07
2.03838e-05
1.62863e-07
2.03852e-05
1.52547e-07
2.0387e-05
1.86104e-07
2.03877e-05
1.67443e-07
2.03882e-05
1.91685e-07
2.0388e-05
1.74098e-07
2.03877e-05
1.86451e-07
2.03873e-05
1.8459e-07
2.03877e-05
1.9274e-07
2.03873e-05
2.0025e-07
2.03849e-05
1.76458e-07
2.0381e-05
1.93102e-07
2.03779e-05
1.61233e-07
2.03788e-05
2.18167e-07
2.03813e-05
1.96011e-07
2.03857e-05
2.6379e-07
2.03905e-05
2.13258e-07
2.03912e-05
2.06064e-07
2.03887e-05
1.02436e-07
2.0387e-05
6.11262e-08
2.03873e-05
2.34245e-08
2.03875e-05
-1.73545e-08
2.03876e-05
-2.43422e-08
2.03897e-05
-6.07326e-08
2.03915e-05
-6.40427e-08
2.03922e-05
-9.07473e-08
2.03876e-05
-1.03812e-07
2.03825e-05
-9.33225e-08
2.03813e-05
-1.69626e-08
2.03836e-05
5.05616e-08
1.56211e-07
2.12555e-05
1.13304e-07
2.12599e-05
1.15654e-07
2.12647e-05
1.15807e-07
2.12687e-05
1.17301e-07
2.12735e-05
1.1701e-07
2.12783e-05
1.18743e-07
2.12825e-05
1.19341e-07
2.12871e-05
1.18777e-07
2.12905e-05
1.19771e-07
2.12943e-05
1.17791e-07
2.12979e-05
1.19169e-07
2.13011e-05
1.16859e-07
2.13045e-05
1.17318e-07
2.13062e-05
1.15041e-07
2.1309e-05
1.14591e-07
2.13116e-05
1.14566e-07
2.13133e-05
1.1504e-07
2.13154e-05
1.11939e-07
2.13154e-05
1.13279e-07
2.13172e-05
1.07836e-07
2.13197e-05
1.14019e-07
2.13197e-05
1.10273e-07
2.13202e-05
1.10026e-07
2.13214e-05
1.07822e-07
2.13223e-05
1.11632e-07
2.13229e-05
1.06954e-07
2.13233e-05
1.11589e-07
2.13245e-05
1.0677e-07
2.13256e-05
1.1122e-07
2.1325e-05
1.05992e-07
2.13256e-05
1.05354e-07
2.13285e-05
1.03881e-07
2.1329e-05
1.10653e-07
2.13274e-05
9.96862e-08
2.13286e-05
9.54424e-08
2.1331e-05
9.25848e-08
2.13309e-05
9.74167e-08
2.13298e-05
8.72657e-08
2.13299e-05
8.25001e-08
2.13307e-05
7.37867e-08
2.13313e-05
7.46114e-08
2.13309e-05
7.05777e-08
2.13311e-05
6.36261e-08
2.13323e-05
5.56919e-08
2.13335e-05
5.157e-08
2.13347e-05
4.80209e-08
2.13358e-05
3.74692e-08
2.13374e-05
2.98153e-08
2.13384e-05
2.29598e-08
2.13387e-05
1.58383e-08
2.13391e-05
8.25055e-09
2.1339e-05
2.58359e-09
2.1339e-05
1.97084e-09
2.13388e-05
-9.0263e-10
2.13395e-05
1.41398e-09
2.13397e-05
3.28293e-09
2.13405e-05
5.06133e-09
2.13411e-05
1.08568e-08
2.13416e-05
9.34301e-09
2.13421e-05
2.11159e-08
2.13419e-05
2.40055e-08
2.13423e-05
3.80369e-08
2.13428e-05
4.80036e-08
2.13434e-05
6.88219e-08
2.13449e-05
7.82038e-08
2.13467e-05
1.00867e-07
2.13491e-05
1.07936e-07
2.13513e-05
1.3078e-07
2.13535e-05
1.28824e-07
2.13562e-05
1.60128e-07
2.13578e-05
1.51017e-07
2.13599e-05
1.8397e-07
2.13608e-05
1.6654e-07
2.13616e-05
1.90847e-07
2.13617e-05
1.73994e-07
2.13618e-05
1.86412e-07
2.13616e-05
1.84738e-07
2.13621e-05
1.9224e-07
2.1362e-05
2.00361e-07
2.13599e-05
1.78546e-07
2.13568e-05
1.96228e-07
2.13541e-05
1.63951e-07
2.13553e-05
2.16989e-07
2.13577e-05
1.93539e-07
2.13624e-05
2.59147e-07
2.13672e-05
2.08438e-07
2.13684e-05
2.04853e-07
2.13666e-05
1.04244e-07
2.1365e-05
6.27481e-08
2.13653e-05
2.31248e-08
2.13651e-05
-1.71484e-08
2.13651e-05
-2.43609e-08
2.13666e-05
-6.22814e-08
2.13677e-05
-6.50769e-08
2.13678e-05
-9.08496e-08
2.13628e-05
-9.88347e-08
2.13576e-05
-8.8138e-08
2.13561e-05
-1.54163e-08
2.13578e-05
4.87828e-08
1.5228e-07
2.22698e-05
1.08353e-07
2.22744e-05
1.11098e-07
2.22792e-05
1.11019e-07
2.22837e-05
1.12771e-07
2.2288e-05
1.12665e-07
2.22931e-05
1.13623e-07
2.22974e-05
1.15117e-07
2.23019e-05
1.14272e-07
2.2306e-05
1.15674e-07
2.23097e-05
1.14046e-07
2.23138e-05
1.15126e-07
2.23167e-05
1.13923e-07
2.23202e-05
1.13831e-07
2.23226e-05
1.126e-07
2.23251e-05
1.12126e-07
2.23282e-05
1.11433e-07
2.23301e-05
1.13176e-07
2.23325e-05
1.0949e-07
2.23335e-05
1.12273e-07
2.23346e-05
1.06733e-07
2.23375e-05
1.11187e-07
2.23383e-05
1.09491e-07
2.23387e-05
1.09541e-07
2.23401e-05
1.06419e-07
2.23411e-05
1.10702e-07
2.23424e-05
1.05677e-07
2.2343e-05
1.10922e-07
2.23438e-05
1.05991e-07
2.23456e-05
1.09458e-07
2.23457e-05
1.05861e-07
2.23457e-05
1.05303e-07
2.23482e-05
1.01416e-07
2.23502e-05
1.08691e-07
2.23488e-05
1.01013e-07
2.23488e-05
9.54917e-08
2.23515e-05
8.9865e-08
2.23527e-05
9.62417e-08
2.23516e-05
8.8369e-08
2.23512e-05
8.29314e-08
2.23521e-05
7.28352e-08
2.23535e-05
7.32025e-08
2.23533e-05
7.08351e-08
2.2353e-05
6.38583e-08
2.23544e-05
5.43435e-08
2.23557e-05
5.02835e-08
2.23566e-05
4.70872e-08
2.23575e-05
3.6528e-08
2.23589e-05
2.84742e-08
2.23598e-05
2.20108e-08
2.23599e-05
1.57259e-08
2.23601e-05
8.07789e-09
2.23601e-05
2.60599e-09
2.236e-05
2.01085e-09
2.23596e-05
-4.27115e-10
2.236e-05
9.41162e-10
2.23602e-05
3.15713e-09
2.23606e-05
4.58968e-09
2.23609e-05
1.06501e-08
2.23612e-05
8.97067e-09
2.23617e-05
2.06207e-08
2.23613e-05
2.44353e-08
2.23615e-05
3.77905e-08
2.23619e-05
4.76556e-08
2.23625e-05
6.82304e-08
2.23638e-05
7.68714e-08
2.23656e-05
9.9099e-08
2.23678e-05
1.05714e-07
2.237e-05
1.28554e-07
2.23722e-05
1.26626e-07
2.23751e-05
1.57213e-07
2.23768e-05
1.49325e-07
2.23792e-05
1.81597e-07
2.23803e-05
1.65421e-07
2.23814e-05
1.89751e-07
2.23818e-05
1.7357e-07
2.23822e-05
1.86056e-07
2.23824e-05
1.84537e-07
2.2383e-05
1.916e-07
2.23833e-05
2.00078e-07
2.23816e-05
1.80305e-07
2.23792e-05
1.98565e-07
2.23769e-05
1.66286e-07
2.23783e-05
2.15586e-07
2.23808e-05
1.91009e-07
2.23857e-05
2.54319e-07
2.23906e-05
2.03517e-07
2.23923e-05
2.03165e-07
2.23911e-05
1.05362e-07
2.23896e-05
6.42981e-08
2.23898e-05
2.28991e-08
2.23892e-05
-1.65764e-08
2.23891e-05
-2.42082e-08
2.23901e-05
-6.33272e-08
2.23904e-05
-6.53311e-08
2.23899e-05
-9.03491e-08
2.23846e-05
-9.34975e-08
2.23793e-05
-8.28492e-08
2.23774e-05
-1.35105e-08
2.23786e-05
4.75457e-08
1.4852e-07
2.33325e-05
1.03612e-07
2.33374e-05
1.06267e-07
2.3342e-05
1.06412e-07
2.33469e-05
1.07819e-07
2.33511e-05
1.08477e-07
2.33561e-05
1.08614e-07
2.33608e-05
1.10458e-07
2.33653e-05
1.09784e-07
2.33698e-05
1.11154e-07
2.33734e-05
1.10415e-07
2.33776e-05
1.10926e-07
2.3381e-05
1.10522e-07
2.33845e-05
1.10337e-07
2.33877e-05
1.09438e-07
2.33902e-05
1.09616e-07
2.33934e-05
1.08203e-07
2.33956e-05
1.11006e-07
2.33979e-05
1.07184e-07
2.33999e-05
1.10308e-07
2.34007e-05
1.05891e-07
2.34034e-05
1.08531e-07
2.34052e-05
1.0763e-07
2.34059e-05
1.08861e-07
2.34078e-05
1.04557e-07
2.34088e-05
1.09667e-07
2.34101e-05
1.04356e-07
2.34115e-05
1.09542e-07
2.3412e-05
1.05496e-07
2.34139e-05
1.07529e-07
2.34149e-05
1.04866e-07
2.34149e-05
1.05296e-07
2.34167e-05
9.96748e-08
2.34193e-05
1.06014e-07
2.34192e-05
1.01111e-07
2.34183e-05
9.64012e-08
2.34205e-05
8.77401e-08
2.34229e-05
9.37604e-08
2.34225e-05
8.88071e-08
2.34215e-05
8.38891e-08
2.34221e-05
7.22888e-08
2.34243e-05
7.10181e-08
2.34246e-05
7.04745e-08
2.34238e-05
6.47022e-08
2.3425e-05
5.31228e-08
2.34267e-05
4.8606e-08
2.34273e-05
4.64704e-08
2.34279e-05
3.59287e-08
2.34292e-05
2.72097e-08
2.34301e-05
2.11339e-08
2.343e-05
1.57557e-08
2.343e-05
8.13104e-09
2.34298e-05
2.73024e-09
2.34297e-05
2.11726e-09
2.34292e-05
1.17726e-10
2.34293e-05
8.46975e-10
2.34293e-05
3.15414e-09
2.34296e-05
4.31232e-09
2.34294e-05
1.07742e-08
2.34295e-05
8.89008e-09
2.343e-05
2.01491e-08
2.34294e-05
2.5074e-08
2.34295e-05
3.76552e-08
2.34298e-05
4.73594e-08
2.34303e-05
6.76745e-08
2.34314e-05
7.58505e-08
2.3433e-05
9.7449e-08
2.34352e-05
1.03543e-07
2.34375e-05
1.26258e-07
2.34397e-05
1.24384e-07
2.34427e-05
1.54249e-07
2.34445e-05
1.47508e-07
2.34471e-05
1.79021e-07
2.34485e-05
1.63985e-07
2.34499e-05
1.88382e-07
2.34506e-05
1.72808e-07
2.34513e-05
1.85429e-07
2.34518e-05
1.83994e-07
2.34526e-05
1.90809e-07
2.34533e-05
1.99401e-07
2.34519e-05
1.81675e-07
2.34504e-05
2.001e-07
2.34486e-05
1.68104e-07
2.34502e-05
2.13933e-07
2.34529e-05
1.88343e-07
2.34578e-05
2.49367e-07
2.34629e-05
1.98469e-07
2.3465e-05
2.01061e-07
2.34645e-05
1.05845e-07
2.34631e-05
6.57371e-08
2.34632e-05
2.27764e-08
2.34623e-05
-1.56747e-08
2.34618e-05
-2.37447e-08
2.34623e-05
-6.38015e-08
2.34618e-05
-6.48231e-08
2.34607e-05
-8.92366e-08
2.34551e-05
-8.78898e-08
2.34496e-05
-7.7424e-08
2.34474e-05
-1.12904e-08
2.34482e-05
4.68006e-08
1.44949e-07
2.4446e-05
9.90793e-08
2.44511e-05
1.0119e-07
2.44556e-05
1.01891e-07
2.44607e-05
1.02703e-07
2.44652e-05
1.03996e-07
2.447e-05
1.03789e-07
2.4475e-05
1.05417e-07
2.44794e-05
1.05399e-07
2.44842e-05
1.06428e-07
2.44881e-05
1.06484e-07
2.44924e-05
1.06599e-07
2.44963e-05
1.06674e-07
2.44997e-05
1.06847e-07
2.45032e-05
1.05992e-07
2.4506e-05
1.0685e-07
2.45092e-05
1.04941e-07
2.4512e-05
1.08215e-07
2.45144e-05
1.04834e-07
2.4517e-05
1.07696e-07
2.45182e-05
1.04623e-07
2.45204e-05
1.06404e-07
2.4523e-05
1.05019e-07
2.45238e-05
1.08022e-07
2.45256e-05
1.0274e-07
2.45273e-05
1.07999e-07
2.45285e-05
1.03143e-07
2.45308e-05
1.07264e-07
2.45316e-05
1.04726e-07
2.45332e-05
1.05873e-07
2.4535e-05
1.03053e-07
2.45354e-05
1.04942e-07
2.45366e-05
9.84809e-08
2.45393e-05
1.03341e-07
2.45404e-05
9.99399e-08
2.45396e-05
9.72635e-08
2.45405e-05
8.68157e-08
2.45436e-05
9.06465e-08
2.45444e-05
8.79804e-08
2.45434e-05
8.48958e-08
2.45432e-05
7.25566e-08
2.45456e-05
6.8532e-08
2.45472e-05
6.88826e-08
2.4546e-05
6.59186e-08
2.45465e-05
5.26358e-08
2.45488e-05
4.63241e-08
2.45494e-05
4.58472e-08
2.45493e-05
3.60108e-08
2.45505e-05
2.60099e-08
2.45515e-05
2.0205e-08
2.45512e-05
1.60139e-08
2.45509e-05
8.38902e-09
2.45507e-05
2.99877e-09
2.45504e-05
2.3737e-09
2.45499e-05
6.53566e-10
2.45496e-05
1.13241e-09
2.45494e-05
3.38796e-09
2.45495e-05
4.13045e-09
2.45491e-05
1.11826e-08
2.45488e-05
9.22275e-09
2.45493e-05
1.96785e-08
2.45485e-05
2.57975e-08
2.45485e-05
3.77276e-08
2.45486e-05
4.72544e-08
2.45491e-05
6.71607e-08
2.455e-05
7.49401e-08
2.45516e-05
9.5835e-08
2.45537e-05
1.01479e-07
2.45559e-05
1.24058e-07
2.45582e-05
1.22117e-07
2.45612e-05
1.51213e-07
2.45632e-05
1.45487e-07
2.45659e-05
1.76282e-07
2.45677e-05
1.62282e-07
2.45693e-05
1.86759e-07
2.45704e-05
1.7168e-07
2.45713e-05
1.8452e-07
2.45723e-05
1.83041e-07
2.45733e-05
1.89812e-07
2.45744e-05
1.98299e-07
2.45734e-05
1.82607e-07
2.45726e-05
2.00922e-07
2.45713e-05
1.69408e-07
2.45732e-05
2.1207e-07
2.45761e-05
1.8544e-07
2.45812e-05
2.44237e-07
2.45864e-05
1.93237e-07
2.4589e-05
1.98502e-07
2.45891e-05
1.05779e-07
2.45877e-05
6.70691e-08
2.45876e-05
2.28683e-08
2.45864e-05
-1.4482e-08
2.45856e-05
-2.29418e-08
2.45856e-05
-6.37722e-08
2.45843e-05
-6.35537e-08
2.45826e-05
-8.74645e-08
2.45767e-05
-8.19957e-08
2.45711e-05
-7.18208e-08
2.45685e-05
-8.69585e-09
2.45688e-05
4.65177e-08
1.4156e-07
2.56125e-05
9.44589e-08
2.56177e-05
9.59506e-08
2.56225e-05
9.7115e-08
2.56276e-05
9.75956e-08
2.56326e-05
9.90181e-08
2.56372e-05
9.917e-08
2.56424e-05
1.00261e-07
2.5647e-05
1.0082e-07
2.56519e-05
1.01441e-07
2.56562e-05
1.02201e-07
2.56604e-05
1.02375e-07
2.56646e-05
1.02561e-07
2.56682e-05
1.03174e-07
2.56719e-05
1.02325e-07
2.5675e-05
1.03765e-07
2.56783e-05
1.01594e-07
2.56816e-05
1.04989e-07
2.5684e-05
1.02343e-07
2.5687e-05
1.04755e-07
2.56891e-05
1.02515e-07
2.5691e-05
1.04527e-07
2.56938e-05
1.02154e-07
2.56955e-05
1.06369e-07
2.56971e-05
1.01144e-07
2.56995e-05
1.05616e-07
2.57006e-05
1.02048e-07
2.57029e-05
1.04915e-07
2.57044e-05
1.03223e-07
2.57057e-05
1.04628e-07
2.5708e-05
1.00689e-07
2.57091e-05
1.03859e-07
2.57101e-05
9.74564e-08
2.57127e-05
1.00778e-07
2.57146e-05
9.79873e-08
2.57147e-05
9.72054e-08
2.57147e-05
8.67964e-08
2.57176e-05
8.78089e-08
2.57196e-05
8.59049e-08
2.57192e-05
8.53202e-08
2.57181e-05
7.36664e-08
2.572e-05
6.66491e-08
2.5723e-05
6.59059e-08
2.57222e-05
6.66919e-08
2.57214e-05
5.34585e-08
2.57239e-05
4.37909e-08
2.57253e-05
4.44763e-08
2.57243e-05
3.69694e-08
2.57251e-05
2.51844e-08
2.57264e-05
1.8909e-08
2.5726e-05
1.64599e-08
2.57254e-05
8.96565e-09
2.57251e-05
3.31897e-09
2.57245e-05
2.9503e-09
2.5724e-05
1.17093e-09
2.57235e-05
1.66954e-09
2.57229e-05
3.92729e-09
2.57229e-05
4.19246e-09
2.57223e-05
1.16972e-08
2.57217e-05
9.91678e-09
2.5722e-05
1.93671e-08
2.57212e-05
2.66001e-08
2.57209e-05
3.80204e-08
2.57209e-05
4.7229e-08
2.57214e-05
6.66355e-08
2.57221e-05
7.42091e-08
2.57236e-05
9.43769e-08
2.57256e-05
9.94969e-08
2.57277e-05
1.21911e-07
2.57301e-05
1.19761e-07
2.57331e-05
1.48186e-07
2.57353e-05
1.43261e-07
2.57382e-05
1.73433e-07
2.57402e-05
1.60308e-07
2.57421e-05
1.84855e-07
2.57436e-05
1.70194e-07
2.57447e-05
1.8335e-07
2.57461e-05
1.81705e-07
2.57474e-05
1.88523e-07
2.57488e-05
1.96821e-07
2.57485e-05
1.82978e-07
2.57483e-05
2.01043e-07
2.57477e-05
1.70016e-07
2.57498e-05
2.1e-07
2.57529e-05
1.82297e-07
2.57582e-05
2.38984e-07
2.57636e-05
1.87883e-07
2.57666e-05
1.95472e-07
2.57671e-05
1.0527e-07
2.5766e-05
6.81592e-08
2.57657e-05
2.31925e-08
2.57642e-05
-1.3013e-08
2.57629e-05
-2.16566e-08
2.57623e-05
-6.30986e-08
2.57603e-05
-6.15699e-08
2.57578e-05
-8.50049e-08
2.57518e-05
-7.59762e-08
2.5746e-05
-6.60289e-08
2.57431e-05
-5.84646e-09
2.5743e-05
4.66952e-08
1.38384e-07
2.68347e-05
8.9512e-08
2.684e-05
9.07156e-08
2.68451e-05
9.19766e-08
2.68502e-05
9.25273e-08
2.68555e-05
9.3649e-08
2.68603e-05
9.4396e-08
2.68656e-05
9.50002e-08
2.68704e-05
9.59364e-08
2.68754e-05
9.64427e-08
2.68801e-05
9.75414e-08
2.68844e-05
9.80615e-08
2.68888e-05
9.81579e-08
2.68927e-05
9.92572e-08
2.68966e-05
9.84218e-08
2.69e-05
1.00391e-07
2.69033e-05
9.83126e-08
2.69069e-05
1.01398e-07
2.69096e-05
9.9633e-08
2.69126e-05
1.01737e-07
2.69153e-05
9.9858e-08
2.69174e-05
1.02415e-07
2.69202e-05
9.93274e-08
2.69229e-05
1.03699e-07
2.69246e-05
9.94617e-08
2.69273e-05
1.02917e-07
2.6929e-05
1.00343e-07
2.69311e-05
1.02752e-07
2.69335e-05
1.00834e-07
2.69347e-05
1.03429e-07
2.69369e-05
9.84676e-08
2.69388e-05
1.01994e-07
2.69397e-05
9.6579e-08
2.6942e-05
9.84637e-08
2.69442e-05
9.57413e-08
2.69452e-05
9.61997e-08
2.69453e-05
8.67696e-08
2.69473e-05
8.57503e-08
2.69502e-05
8.29911e-08
2.69511e-05
8.44371e-08
2.69499e-05
7.49393e-08
2.69504e-05
6.61003e-08
2.69542e-05
6.21128e-08
2.6955e-05
6.59264e-08
2.69529e-05
5.55104e-08
2.69546e-05
4.21329e-08
2.69573e-05
4.17225e-08
2.69559e-05
3.83487e-08
2.69556e-05
2.55223e-08
2.69573e-05
1.71765e-08
2.6957e-05
1.67623e-08
2.69559e-05
1.01009e-08
2.69555e-05
3.6871e-09
2.69547e-05
3.74966e-09
2.6954e-05
1.86888e-09
2.69534e-05
2.32803e-09
2.69526e-05
4.69496e-09
2.69522e-05
4.59867e-09
2.69516e-05
1.22824e-08
2.69506e-05
1.09681e-08
2.69505e-05
1.93963e-08
2.69498e-05
2.73606e-08
2.69493e-05
3.84796e-08
2.69492e-05
4.73097e-08
2.69496e-05
6.62813e-08
2.69502e-05
7.36226e-08
2.69516e-05
9.29843e-08
2.69536e-05
9.75002e-08
2.69556e-05
1.19878e-07
2.6958e-05
1.17372e-07
2.6961e-05
1.45189e-07
2.69634e-05
1.40866e-07
2.69664e-05
1.70432e-07
2.69686e-05
1.58096e-07
2.69708e-05
1.82599e-07
2.69727e-05
1.68363e-07
2.69741e-05
1.81887e-07
2.69759e-05
1.79991e-07
2.69775e-05
1.86864e-07
2.69793e-05
1.95018e-07
2.69796e-05
1.8274e-07
2.69801e-05
2.00527e-07
2.69801e-05
1.70031e-07
2.69824e-05
2.07643e-07
2.69859e-05
1.78836e-07
2.69914e-05
2.33417e-07
2.6997e-05
1.82358e-07
2.70005e-05
1.91946e-07
2.70014e-05
1.04397e-07
2.70004e-05
6.9113e-08
2.69998e-05
2.38081e-08
2.69981e-05
-1.12749e-08
2.69964e-05
-2.00204e-08
2.69951e-05
-6.18224e-08
2.69925e-05
-5.89232e-08
2.69893e-05
-8.17642e-08
2.6983e-05
-6.96881e-08
2.69769e-05
-5.99693e-08
2.69736e-05
-2.55144e-09
2.69731e-05
4.72005e-08
1.35393e-07
2.81152e-05
8.42175e-08
2.81205e-05
8.54272e-08
2.81259e-05
8.65045e-08
2.81311e-05
8.73384e-08
2.81367e-05
8.80503e-08
2.81419e-05
8.91886e-08
2.81472e-05
8.97108e-08
2.81524e-05
9.07894e-08
2.81575e-05
9.13631e-08
2.81626e-05
9.24042e-08
2.81671e-05
9.35272e-08
2.81716e-05
9.36432e-08
2.81758e-05
9.51274e-08
2.81798e-05
9.44197e-08
2.81836e-05
9.65971e-08
2.81869e-05
9.50062e-08
2.81908e-05
9.74287e-08
2.81939e-05
9.65943e-08
2.8197e-05
9.86342e-08
2.82001e-05
9.67435e-08
2.82027e-05
9.98377e-08
2.82053e-05
9.66906e-08
2.82083e-05
1.00706e-07
2.82104e-05
9.73719e-08
2.82131e-05
1.00256e-07
2.82156e-05
9.78344e-08
2.82177e-05
1.00618e-07
2.82205e-05
9.80002e-08
2.82225e-05
1.01427e-07
2.82244e-05
9.6578e-08
2.82271e-05
9.92676e-08
2.82285e-05
9.52649e-08
2.82306e-05
9.6376e-08
2.82331e-05
9.32361e-08
2.82345e-05
9.47673e-08
2.8235e-05
8.62986e-08
2.82362e-05
8.44624e-08
2.82389e-05
8.02938e-08
2.82411e-05
8.22871e-08
2.82404e-05
7.56645e-08
2.82396e-05
6.68271e-08
2.8243e-05
5.87753e-08
2.82458e-05
6.30883e-08
2.82438e-05
5.74993e-08
2.82434e-05
4.25244e-08
2.82473e-05
3.78548e-08
2.82469e-05
3.87512e-08
2.82449e-05
2.74948e-08
2.82465e-05
1.55862e-08
2.8247e-05
1.63124e-08
2.82453e-05
1.17693e-08
2.82447e-05
4.33786e-09
2.82438e-05
4.62577e-09
2.82427e-05
2.9211e-09
2.82419e-05
3.1558e-09
2.8241e-05
5.54859e-09
2.82402e-05
5.47776e-09
2.82394e-05
1.30205e-08
2.82383e-05
1.21201e-08
2.82379e-05
1.97717e-08
2.82371e-05
2.81171e-08
2.82364e-05
3.92079e-08
2.82362e-05
4.74754e-08
2.82365e-05
6.59817e-08
2.8237e-05
7.31282e-08
2.82383e-05
9.16777e-08
2.82403e-05
9.55588e-08
2.82421e-05
1.18023e-07
2.82446e-05
1.14963e-07
2.82475e-05
1.42234e-07
2.82501e-05
1.38242e-07
2.82533e-05
1.67286e-07
2.82556e-05
1.55738e-07
2.82583e-05
1.79975e-07
2.82604e-05
1.66235e-07
2.82622e-05
1.80095e-07
2.82642e-05
1.77927e-07
2.82664e-05
1.84737e-07
2.82685e-05
1.92934e-07
2.82694e-05
1.81807e-07
2.82706e-05
1.99352e-07
2.82713e-05
1.69328e-07
2.82739e-05
2.04979e-07
2.82776e-05
1.75189e-07
2.82834e-05
2.27573e-07
2.82889e-05
1.76834e-07
2.82931e-05
1.8778e-07
2.82943e-05
1.03254e-07
2.82936e-05
6.97227e-08
2.82928e-05
2.46851e-08
2.82907e-05
-9.19039e-09
2.82885e-05
-1.78781e-08
2.82865e-05
-5.97569e-08
2.82832e-05
-5.56432e-08
2.82793e-05
-7.78256e-08
2.82729e-05
-6.33005e-08
2.82667e-05
-5.37676e-08
2.82631e-05
9.7863e-10
2.82622e-05
4.81685e-08
1.32619e-07
2.94567e-05
7.86956e-08
2.94622e-05
7.9921e-08
2.94679e-05
8.07738e-08
2.94734e-05
8.18284e-08
2.94791e-05
8.23178e-08
2.94847e-05
8.35822e-08
2.94902e-05
8.42302e-08
2.94957e-05
8.52885e-08
2.9501e-05
8.60808e-08
2.95063e-05
8.70724e-08
2.95112e-05
8.86515e-08
2.95158e-05
8.90201e-08
2.95203e-05
9.06687e-08
2.95244e-05
9.03307e-08
2.95285e-05
9.24415e-08
2.95319e-05
9.16734e-08
2.95358e-05
9.34969e-08
2.95394e-05
9.29868e-08
2.95427e-05
9.53721e-08
2.95461e-05
9.3318e-08
2.95492e-05
9.67588e-08
2.95521e-05
9.38157e-08
2.95553e-05
9.74313e-08
2.95581e-05
9.46217e-08
2.95608e-05
9.75289e-08
2.95636e-05
9.5048e-08
2.95661e-05
9.81428e-08
2.95687e-05
9.53917e-08
2.95713e-05
9.8764e-08
2.95731e-05
9.48086e-08
2.95759e-05
9.64742e-08
2.9578e-05
9.31263e-08
2.95799e-05
9.45019e-08
2.95828e-05
9.03046e-08
2.95848e-05
9.27707e-08
2.9586e-05
8.51468e-08
2.95874e-05
8.30827e-08
2.95895e-05
7.8186e-08
2.95926e-05
7.91706e-08
2.95931e-05
7.51915e-08
2.95918e-05
6.80794e-08
2.95935e-05
5.71188e-08
2.95975e-05
5.90755e-08
2.95972e-05
5.77936e-08
2.95946e-05
4.51293e-08
2.95979e-05
3.45873e-08
2.95995e-05
3.71249e-08
2.95965e-05
3.04883e-08
2.95967e-05
1.53983e-08
2.95982e-05
1.48193e-08
2.95964e-05
1.35378e-08
2.95951e-05
5.60536e-09
2.95944e-05
5.33849e-09
2.95931e-05
4.27365e-09
2.95919e-05
4.27722e-09
2.95912e-05
6.32944e-09
2.95899e-05
6.70892e-09
2.95889e-05
1.4052e-08
2.95876e-05
1.34569e-08
2.95867e-05
2.06241e-08
2.95859e-05
2.89604e-08
2.95849e-05
4.01951e-08
2.95847e-05
4.76324e-08
2.95849e-05
6.58269e-08
2.95851e-05
7.28814e-08
2.95863e-05
9.04775e-08
2.95883e-05
9.3594e-08
2.95901e-05
1.16217e-07
2.95925e-05
1.1255e-07
2.95955e-05
1.39284e-07
2.95982e-05
1.35506e-07
2.96015e-05
1.63936e-07
2.9604e-05
1.53262e-07
2.96072e-05
1.76842e-07
2.96095e-05
1.63848e-07
2.96117e-05
1.77934e-07
2.96141e-05
1.75523e-07
2.96167e-05
1.82105e-07
2.96191e-05
1.90558e-07
2.96207e-05
1.8021e-07
2.96226e-05
1.97501e-07
2.96238e-05
1.68125e-07
2.96269e-05
2.0185e-07
2.96308e-05
1.71271e-07
2.96371e-05
2.21248e-07
2.96428e-05
1.71154e-07
2.96475e-05
1.83141e-07
2.96489e-05
1.01843e-07
2.96483e-05
7.02527e-08
2.96472e-05
2.58107e-08
2.96449e-05
-6.87532e-09
2.96425e-05
-1.54587e-08
2.96397e-05
-5.70206e-08
2.96359e-05
-5.17965e-08
2.96311e-05
-7.29982e-08
2.96244e-05
-5.66023e-08
2.96178e-05
-4.71885e-08
2.96138e-05
5.00323e-09
2.96126e-05
4.93719e-08
1.30043e-07
3.08623e-05
7.29006e-08
3.08681e-05
7.40641e-08
3.08741e-05
7.4789e-08
3.088e-05
7.59415e-08
3.08859e-05
7.6441e-08
3.08918e-05
7.76294e-08
3.08976e-05
7.84239e-08
3.09033e-05
7.9577e-08
3.09088e-05
8.0577e-08
3.09143e-05
8.16242e-08
3.09196e-05
8.33655e-08
3.09244e-05
8.41828e-08
3.09292e-05
8.59174e-08
3.09334e-05
8.60783e-08
3.09378e-05
8.80848e-08
3.09415e-05
8.79159e-08
3.09453e-05
8.97101e-08
3.09494e-05
8.89371e-08
3.09528e-05
9.19158e-08
3.09564e-05
8.97652e-08
3.09599e-05
9.32339e-08
3.0963e-05
9.07356e-08
3.09665e-05
9.39305e-08
3.09695e-05
9.15719e-08
3.09728e-05
9.43059e-08
3.09757e-05
9.20637e-08
3.09789e-05
9.49583e-08
3.09817e-05
9.26169e-08
3.09848e-05
9.56385e-08
3.09872e-05
9.24434e-08
3.09895e-05
9.41449e-08
3.09925e-05
9.0187e-08
3.09942e-05
9.27955e-08
3.09969e-05
8.75521e-08
3.09994e-05
9.03194e-08
3.10005e-05
8.40194e-08
3.10022e-05
8.14028e-08
3.10038e-05
7.65561e-08
3.10068e-05
7.6135e-08
3.10089e-05
7.31551e-08
3.10081e-05
6.89017e-08
3.10084e-05
5.68122e-08
3.10121e-05
5.53129e-08
3.10144e-05
5.55016e-08
3.10113e-05
4.82163e-08
3.10123e-05
3.36589e-08
3.10158e-05
3.36066e-08
3.10137e-05
3.26068e-08
3.10116e-05
1.74918e-08
3.10134e-05
1.29772e-08
3.10124e-05
1.45527e-08
3.10102e-05
7.84169e-09
3.10094e-05
6.0567e-09
3.10079e-05
5.82394e-09
3.10061e-05
6.0207e-09
3.10053e-05
7.16637e-09
3.1004e-05
7.99284e-09
3.10026e-05
1.55191e-08
3.10011e-05
1.49404e-08
3.1e-05
2.16595e-08
3.09993e-05
2.96882e-08
3.0998e-05
4.15243e-08
3.09978e-05
4.78549e-08
3.09979e-05
6.56992e-08
3.0998e-05
7.27987e-08
3.09991e-05
8.93353e-08
3.1001e-05
9.16794e-08
3.10027e-05
1.14529e-07
3.10049e-05
1.10326e-07
3.10079e-05
1.36348e-07
3.10107e-05
1.32656e-07
3.10143e-05
1.60335e-07
3.10168e-05
1.50762e-07
3.10204e-05
1.73272e-07
3.1023e-05
1.61207e-07
3.10256e-05
1.75371e-07
3.10284e-05
1.72763e-07
3.10315e-05
1.79e-07
3.10341e-05
1.87872e-07
3.10364e-05
1.77951e-07
3.1039e-05
1.94861e-07
3.10408e-05
1.6634e-07
3.10445e-05
1.98228e-07
3.10485e-05
1.67219e-07
3.10552e-05
2.14508e-07
3.10609e-05
1.65516e-07
3.10662e-05
1.77804e-07
3.10679e-05
1.00191e-07
3.10676e-05
7.04783e-08
3.10663e-05
2.71427e-08
3.10635e-05
-4.07272e-09
3.10606e-05
-1.25846e-08
3.1057e-05
-5.33854e-08
3.10526e-05
-4.73863e-08
3.10471e-05
-6.75459e-08
3.10403e-05
-4.97383e-08
3.10336e-05
-4.05304e-08
3.10293e-05
9.30023e-09
3.10277e-05
5.10286e-08
1.27666e-07
3.2335e-05
6.6645e-08
3.23413e-05
6.76844e-08
3.23478e-05
6.83467e-08
3.23541e-05
6.95913e-08
3.23604e-05
7.02233e-08
3.23667e-05
7.13151e-08
3.23729e-05
7.22159e-08
3.23788e-05
7.36127e-08
3.23845e-05
7.49362e-08
3.23899e-05
7.61726e-08
3.23953e-05
7.79993e-08
3.24003e-05
7.91622e-08
3.24051e-05
8.10944e-08
3.24096e-05
8.15726e-08
3.24141e-05
8.36468e-08
3.24183e-05
8.3679e-08
3.24221e-05
8.5889e-08
3.24264e-05
8.467e-08
3.24305e-05
8.78535e-08
3.24342e-05
8.60122e-08
3.24383e-05
8.91438e-08
3.24417e-05
8.73487e-08
3.24455e-05
9.01433e-08
3.24487e-05
8.83163e-08
3.24523e-05
9.07691e-08
3.24554e-05
8.89651e-08
3.24587e-05
9.16088e-08
3.24618e-05
8.95031e-08
3.24649e-05
9.25615e-08
3.24681e-05
8.92703e-08
3.24704e-05
9.18702e-08
3.24737e-05
8.68092e-08
3.24763e-05
9.01944e-08
3.24789e-05
8.49612e-08
3.24823e-05
8.70034e-08
3.24838e-05
8.24914e-08
3.24857e-05
7.95134e-08
3.24873e-05
7.49005e-08
3.24896e-05
7.38202e-08
3.24925e-05
7.02966e-08
3.24926e-05
6.88235e-08
3.2492e-05
5.7412e-08
3.24941e-05
5.31467e-08
3.24978e-05
5.18674e-08
3.24961e-05
4.98551e-08
3.24945e-05
3.53258e-08
3.24979e-05
3.0188e-08
3.24981e-05
3.23778e-08
3.24944e-05
2.12172e-08
3.24952e-05
1.21729e-08
3.24956e-05
1.41042e-08
3.24929e-05
1.05986e-08
3.24919e-05
7.04809e-09
3.24908e-05
6.92245e-09
3.24886e-05
8.22398e-09
3.24874e-05
8.36494e-09
3.24864e-05
9.02397e-09
3.24846e-05
1.72705e-08
3.24825e-05
1.70918e-08
3.24811e-05
2.30335e-08
3.24803e-05
3.04875e-08
3.24785e-05
4.33389e-08
3.2478e-05
4.83352e-08
3.24782e-05
6.55406e-08
3.24779e-05
7.30096e-08
3.24789e-05
8.83461e-08
3.24808e-05
8.9836e-08
3.24826e-05
1.12729e-07
3.24846e-05
1.08271e-07
3.24877e-05
1.33318e-07
3.24906e-05
1.29741e-07
3.24945e-05
1.56447e-07
3.2497e-05
1.48179e-07
3.25011e-05
1.69187e-07
3.2504e-05
1.58321e-07
3.2507e-05
1.72393e-07
3.25102e-05
1.69568e-07
3.25138e-05
1.75426e-07
3.25169e-05
1.84735e-07
3.25197e-05
1.75153e-07
3.25231e-05
1.91477e-07
3.25252e-05
1.64221e-07
3.25294e-05
1.9405e-07
3.25337e-05
1.62924e-07
3.25409e-05
2.07288e-07
3.25467e-05
1.59674e-07
3.25524e-05
1.72112e-07
3.25544e-05
9.82687e-08
3.25542e-05
7.06726e-08
3.25527e-05
2.85704e-08
3.25498e-05
-1.13037e-09
3.25468e-05
-9.56042e-09
3.25425e-05
-4.91204e-08
3.25376e-05
-4.24663e-08
3.25313e-05
-6.12251e-08
3.2524e-05
-4.2507e-08
3.25169e-05
-3.34301e-08
3.25121e-05
1.40941e-08
3.25102e-05
5.29292e-08
1.25546e-07
3.38776e-05
5.95906e-08
3.38847e-05
6.0552e-08
3.38918e-05
6.12542e-08
3.3899e-05
6.2384e-08
3.39061e-05
6.31461e-08
3.3913e-05
6.4402e-08
3.39196e-05
6.56321e-08
3.39259e-05
6.73583e-08
3.39317e-05
6.91033e-08
3.39372e-05
7.07215e-08
3.39424e-05
7.27452e-08
3.39474e-05
7.41735e-08
3.39521e-05
7.6394e-08
3.39566e-05
7.7036e-08
3.3961e-05
7.93043e-08
3.39654e-05
7.92594e-08
3.39695e-05
8.17964e-08
3.39737e-05
8.04538e-08
3.39782e-05
8.33312e-08
3.39821e-05
8.20998e-08
3.39865e-05
8.47504e-08
3.39904e-05
8.34954e-08
3.39945e-05
8.59967e-08
3.39983e-05
8.45644e-08
3.40021e-05
8.69754e-08
3.40057e-05
8.53059e-08
3.40092e-05
8.8125e-08
3.40129e-05
8.58479e-08
3.4016e-05
8.94117e-08
3.40195e-05
8.58507e-08
3.40221e-05
8.92447e-08
3.40248e-05
8.40804e-08
3.4028e-05
8.69859e-08
3.40303e-05
8.26669e-08
3.40336e-05
8.37051e-08
3.40359e-05
8.01627e-08
3.40377e-05
7.77777e-08
3.404e-05
7.25557e-08
3.40422e-05
7.16015e-08
3.40454e-05
6.71674e-08
3.40472e-05
6.70089e-08
3.40467e-05
5.79076e-08
3.40477e-05
5.21191e-08
3.40513e-05
4.83076e-08
3.40521e-05
4.90638e-08
3.40495e-05
3.78927e-08
3.40508e-05
2.8885e-08
3.40532e-05
2.99865e-08
3.40498e-05
2.46528e-08
3.40481e-05
1.37829e-08
3.40494e-05
1.28864e-08
3.40469e-05
1.30238e-08
3.40448e-05
9.17928e-09
3.40437e-05
8.00177e-09
3.40414e-05
1.05809e-08
3.40391e-05
1.06199e-08
3.40383e-05
9.86553e-09
3.40368e-05
1.87633e-08
3.4034e-05
1.98784e-08
3.40324e-05
2.46247e-08
3.4032e-05
3.08545e-08
3.403e-05
4.53234e-08
3.40293e-05
4.90836e-08
3.40296e-05
6.52389e-08
3.40293e-05
7.33187e-08
3.40301e-05
8.75052e-08
3.40318e-05
8.81965e-08
3.40336e-05
1.10861e-07
3.40353e-05
1.06564e-07
3.40383e-05
1.30321e-07
3.40413e-05
1.26782e-07
3.40454e-05
1.52324e-07
3.40481e-05
1.45495e-07
3.40525e-05
1.64765e-07
3.40557e-05
1.55149e-07
3.40591e-05
1.69032e-07
3.40627e-05
1.65921e-07
3.40666e-05
1.71566e-07
3.40702e-05
1.81133e-07
3.40735e-05
1.71784e-07
3.40778e-05
1.87188e-07
3.40805e-05
1.61563e-07
3.40853e-05
1.8926e-07
3.40898e-05
1.5844e-07
3.40975e-05
1.99603e-07
3.41034e-05
1.53742e-07
3.41097e-05
1.65818e-07
3.41119e-05
9.60432e-08
3.41118e-05
7.07466e-08
3.41102e-05
3.01808e-08
3.41067e-05
2.35161e-09
3.41033e-05
-6.07615e-09
3.40981e-05
-4.39973e-08
3.40926e-05
-3.69515e-08
3.40858e-05
-5.44079e-08
3.40783e-05
-3.49792e-08
3.40711e-05
-2.62067e-08
3.4066e-05
1.91589e-08
3.40637e-05
5.5241e-08
1.2358e-07
3.54925e-05
5.15491e-08
3.5501e-05
5.21204e-08
3.55097e-05
5.24765e-08
3.55183e-05
5.38004e-08
3.55266e-05
5.48363e-08
3.55343e-05
5.67227e-08
3.55416e-05
5.83823e-08
3.55481e-05
6.08023e-08
3.55542e-05
6.3061e-08
3.55596e-05
6.52408e-08
3.55648e-05
6.75679e-08
3.55697e-05
6.92586e-08
3.55743e-05
7.1826e-08
3.55789e-05
7.24495e-08
3.55833e-05
7.49099e-08
3.5588e-05
7.45443e-08
3.55925e-05
7.72877e-08
3.55968e-05
7.61215e-08
3.56015e-05
7.86834e-08
3.56058e-05
7.78123e-08
3.56102e-05
8.03155e-08
3.56143e-05
7.93683e-08
3.56186e-05
8.17495e-08
3.56225e-05
8.06807e-08
3.56263e-05
8.3114e-08
3.56301e-05
8.1566e-08
3.56338e-05
8.43751e-08
3.56376e-05
8.20277e-08
3.56414e-05
8.56458e-08
3.5645e-05
8.22506e-08
3.56487e-05
8.55721e-08
3.56516e-05
8.11271e-08
3.56553e-05
8.33313e-08
3.56583e-05
7.96721e-08
3.56611e-05
8.08302e-08
3.56641e-05
7.72137e-08
3.56656e-05
7.62928e-08
3.56677e-05
7.042e-08
3.56697e-05
6.96136e-08
3.5672e-05
6.49186e-08
3.56745e-05
6.44652e-08
3.56745e-05
5.79525e-08
3.56746e-05
5.19565e-08
3.56771e-05
4.58656e-08
3.56792e-05
4.68723e-08
3.56778e-05
3.93726e-08
3.56768e-05
2.98423e-08
3.56797e-05
2.70549e-08
3.56783e-05
2.60628e-08
3.56752e-05
1.68792e-08
3.5676e-05
1.21354e-08
3.56751e-05
1.38856e-08
3.56727e-05
1.16445e-08
3.56714e-05
9.28576e-09
3.567e-05
1.19272e-08
3.5667e-05
1.36106e-08
3.56657e-05
1.11923e-08
3.5665e-05
1.94806e-08
3.56614e-05
2.34889e-08
3.56589e-05
2.70956e-08
3.56585e-05
3.12822e-08
3.56562e-05
4.76298e-08
3.56546e-05
5.06353e-08
3.56548e-05
6.50607e-08
3.56543e-05
7.37938e-08
3.5655e-05
8.68651e-08
3.56563e-05
8.6845e-08
3.56584e-05
1.08794e-07
3.56599e-05
1.05018e-07
3.56629e-05
1.27315e-07
3.56659e-05
1.23776e-07
3.56703e-05
1.4798e-07
3.56733e-05
1.42508e-07
3.5678e-05
1.60018e-07
3.56815e-05
1.51654e-07
3.56853e-05
1.65238e-07
3.56895e-05
1.61698e-07
3.56938e-05
1.67322e-07
3.5698e-05
1.76938e-07
3.57018e-05
1.6798e-07
3.57066e-05
1.82344e-07
3.57096e-05
1.586e-07
3.57148e-05
1.84097e-07
3.57195e-05
1.53679e-07
3.57274e-05
1.91666e-07
3.57336e-05
1.4756e-07
3.57402e-05
1.59266e-07
3.57426e-05
9.35844e-08
3.57427e-05
7.06563e-08
3.57412e-05
3.17584e-08
3.57378e-05
5.73936e-09
3.57343e-05
-2.60156e-09
3.57287e-05
-3.8404e-08
3.57229e-05
-3.1117e-08
3.57153e-05
-4.68751e-08
3.57076e-05
-2.72031e-08
3.56999e-05
-1.85618e-08
3.56944e-05
2.46565e-08
3.56917e-05
5.79728e-08
1.2202e-07
3.71822e-05
4.24231e-08
3.71925e-05
4.17911e-08
3.72037e-05
4.1245e-08
3.72144e-05
4.30885e-08
3.72245e-05
4.4801e-08
3.72329e-05
4.82739e-08
3.72401e-05
5.11463e-08
3.72463e-05
5.46991e-08
3.72518e-05
5.74874e-08
3.72572e-05
5.98642e-08
3.72619e-05
6.28812e-08
3.72667e-05
6.44283e-08
3.72712e-05
6.73423e-08
3.72762e-05
6.74402e-08
3.7281e-05
7.00787e-08
3.72863e-05
6.93369e-08
3.72914e-05
7.21838e-08
3.72961e-05
7.13784e-08
3.7301e-05
7.38215e-08
3.73056e-05
7.32091e-08
3.73104e-05
7.54538e-08
3.73148e-05
7.4963e-08
3.73196e-05
7.6941e-08
3.73238e-05
7.65253e-08
3.73282e-05
7.87123e-08
3.73321e-05
7.76344e-08
3.73362e-05
8.02964e-08
3.73401e-05
7.81696e-08
3.73439e-05
8.1814e-08
3.73474e-05
7.87267e-08
3.7351e-05
8.19816e-08
3.73542e-05
7.7924e-08
3.73575e-05
8.00494e-08
3.73611e-05
7.60901e-08
3.73641e-05
7.77797e-08
3.73675e-05
7.37964e-08
3.73702e-05
7.36635e-08
3.73724e-05
6.81512e-08
3.73754e-05
6.66984e-08
3.73775e-05
6.27821e-08
3.73807e-05
6.13064e-08
3.7382e-05
5.66562e-08
3.73819e-05
5.20131e-08
3.73834e-05
4.44002e-08
3.73857e-05
4.44963e-08
3.73857e-05
3.93862e-08
3.73838e-05
3.17851e-08
3.73851e-05
2.5756e-08
3.73853e-05
2.57996e-08
3.7382e-05
2.02106e-08
3.73807e-05
1.34597e-08
3.73805e-05
1.41053e-08
3.73779e-05
1.41615e-08
3.73752e-05
1.20265e-08
3.73743e-05
1.28593e-08
3.73709e-05
1.69979e-08
3.73681e-05
1.39502e-08
3.73683e-05
1.93153e-08
3.7365e-05
2.68292e-08
3.73615e-05
3.05402e-08
3.73613e-05
3.14463e-08
3.73597e-05
4.92896e-08
3.73578e-05
5.25325e-08
3.7358e-05
6.48247e-08
3.73577e-05
7.41054e-08
3.73582e-05
8.64126e-08
3.73592e-05
8.57905e-08
3.73613e-05
1.06691e-07
3.73626e-05
1.03707e-07
3.73656e-05
1.24351e-07
3.73685e-05
1.20833e-07
3.7373e-05
1.43529e-07
3.73763e-05
1.39167e-07
3.73813e-05
1.55062e-07
3.73851e-05
1.47889e-07
3.73892e-05
1.61067e-07
3.73938e-05
1.57083e-07
3.73983e-05
1.62864e-07
3.74031e-05
1.72171e-07
3.74075e-05
1.63552e-07
3.74132e-05
1.76657e-07
3.74169e-05
1.54922e-07
3.74227e-05
1.78256e-07
3.74277e-05
1.48634e-07
3.74362e-05
1.8321e-07
3.74426e-05
1.41144e-07
3.74497e-05
1.52213e-07
3.74524e-05
9.08275e-08
3.74524e-05
7.06627e-08
3.74506e-05
3.35506e-08
3.74467e-05
9.69186e-09
3.74427e-05
1.3671e-09
3.74363e-05
-3.20056e-08
3.74298e-05
-2.46403e-08
3.74218e-05
-3.88432e-08
3.74136e-05
-1.90043e-08
3.74055e-05
-1.04871e-08
3.73998e-05
3.03483e-08
3.73969e-05
6.08715e-08
1.20543e-07
3.89681e-05
2.9801e-08
3.89805e-05
2.94437e-08
3.89925e-05
2.92266e-08
3.90036e-05
3.19344e-08
3.90132e-05
3.5216e-08
3.90206e-05
4.09395e-08
3.90268e-05
4.4865e-08
3.90326e-05
4.89661e-08
3.90371e-05
5.29839e-08
3.90414e-05
5.55552e-08
3.90453e-05
5.89846e-08
3.90499e-05
5.97648e-08
3.90544e-05
6.28756e-08
3.90592e-05
6.26705e-08
3.90638e-05
6.54891e-08
3.90683e-05
6.48058e-08
3.90733e-05
6.72256e-08
3.90778e-05
6.68233e-08
3.9083e-05
6.8669e-08
3.90876e-05
6.86156e-08
3.90928e-05
7.02318e-08
3.90971e-05
7.05959e-08
3.9102e-05
7.20956e-08
3.91062e-05
7.22726e-08
3.91107e-05
7.42477e-08
3.91151e-05
7.3265e-08
3.91192e-05
7.61533e-08
3.91237e-05
7.37005e-08
3.91279e-05
7.76524e-08
3.91322e-05
7.44221e-08
3.91361e-05
7.80226e-08
3.914e-05
7.40447e-08
3.91435e-05
7.65825e-08
3.91467e-05
7.28554e-08
3.91501e-05
7.4342e-08
3.91527e-05
7.12058e-08
3.91557e-05
7.06635e-08
3.91574e-05
6.6504e-08
3.91596e-05
6.44499e-08
3.91617e-05
6.06679e-08
3.91637e-05
5.93254e-08
3.91661e-05
5.42562e-08
3.91662e-05
5.19058e-08
3.91669e-05
4.36964e-08
3.91694e-05
4.20572e-08
3.91702e-05
3.85691e-08
3.91694e-05
3.25182e-08
3.91693e-05
2.59294e-08
3.91705e-05
2.46185e-08
3.91692e-05
2.151e-08
3.91665e-05
1.6152e-08
3.91669e-05
1.36751e-08
3.91659e-05
1.51319e-08
3.91627e-05
1.5253e-08
3.91625e-05
1.30662e-08
3.916e-05
1.94569e-08
3.91561e-05
1.79163e-08
3.91562e-05
1.91796e-08
3.91536e-05
2.94185e-08
3.9149e-05
3.51685e-08
3.91478e-05
3.26354e-08
3.91464e-05
5.07203e-08
3.91436e-05
5.53197e-08
3.9143e-05
6.53758e-08
3.91427e-05
7.44564e-08
3.91426e-05
8.6457e-08
3.91433e-05
8.51156e-08
3.91454e-05
1.04559e-07
3.91466e-05
1.02512e-07
3.91496e-05
1.21416e-07
3.91526e-05
1.17847e-07
3.9157e-05
1.39132e-07
3.91608e-05
1.35325e-07
3.91659e-05
1.49909e-07
3.91701e-05
1.43731e-07
3.91747e-05
1.56421e-07
3.91799e-05
1.51975e-07
3.91847e-05
1.57982e-07
3.91901e-05
1.66858e-07
3.91948e-05
1.58779e-07
3.92007e-05
1.70812e-07
3.92046e-05
1.50958e-07
3.92106e-05
1.72308e-07
3.92158e-05
1.43413e-07
3.92243e-05
1.74755e-07
3.92308e-05
1.34595e-07
3.92381e-05
1.44948e-07
3.92409e-05
8.79899e-08
3.92414e-05
7.01435e-08
3.92398e-05
3.52216e-08
3.92363e-05
1.31562e-08
3.92326e-05
5.05035e-09
3.92261e-05
-2.54969e-08
3.92196e-05
-1.81397e-08
3.92113e-05
-3.05637e-08
3.92031e-05
-1.081e-08
3.9195e-05
-2.40845e-09
3.91889e-05
3.65332e-08
3.91852e-05
6.45332e-08
1.19681e-07
4.08982e-05
3.72326e-08
4.08898e-05
3.79203e-08
4.08821e-05
3.69108e-08
4.08765e-05
3.75617e-08
4.08759e-05
3.57799e-08
4.08795e-05
3.73485e-08
4.08846e-05
3.97046e-08
4.08914e-05
4.22149e-08
4.08984e-05
4.60087e-08
4.09058e-05
4.81679e-08
4.09126e-05
5.21788e-08
4.09191e-05
5.32801e-08
4.09249e-05
5.70671e-08
4.09298e-05
5.77719e-08
4.09343e-05
6.09121e-08
4.0938e-05
6.1168e-08
4.09423e-05
6.28859e-08
4.09461e-05
6.30363e-08
4.09508e-05
6.39783e-08
4.09551e-05
6.43531e-08
4.09603e-05
6.49938e-08
4.09652e-05
6.56481e-08
4.09703e-05
6.70638e-08
4.09753e-05
6.71971e-08
4.09799e-05
6.96937e-08
4.09848e-05
6.83407e-08
4.09889e-05
7.21042e-08
4.09934e-05
6.91912e-08
4.09976e-05
7.34425e-08
4.10017e-05
7.03135e-08
4.1006e-05
7.37045e-08
4.10096e-05
7.04913e-08
4.10138e-05
7.23202e-08
4.10168e-05
6.99241e-08
4.10211e-05
7.00231e-08
4.10243e-05
6.799e-08
4.10277e-05
6.7247e-08
4.10308e-05
6.33989e-08
4.10328e-05
6.25051e-08
4.10361e-05
5.73825e-08
4.10377e-05
5.76298e-08
4.10404e-05
5.16167e-08
4.10417e-05
5.05689e-08
4.10414e-05
4.39967e-08
4.10437e-05
3.97702e-08
4.10443e-05
3.79386e-08
4.10442e-05
3.27064e-08
4.10435e-05
2.66263e-08
4.1043e-05
2.50831e-08
4.10432e-05
2.12693e-08
4.10396e-05
1.9812e-08
4.10382e-05
1.50518e-08
4.10381e-05
1.52577e-08
4.10338e-05
1.95113e-08
4.10327e-05
1.42293e-08
4.1031e-05
2.10956e-08
4.1026e-05
2.29677e-08
4.1025e-05
2.01168e-08
4.10236e-05
3.0842e-08
4.1019e-05
3.97619e-08
4.10167e-05
3.49508e-08
4.1016e-05
5.14426e-08
4.10135e-05
5.78335e-08
4.10125e-05
6.62883e-08
4.10126e-05
7.44178e-08
4.10126e-05
8.64641e-08
4.10127e-05
8.49431e-08
4.10149e-05
1.02371e-07
4.1016e-05
1.01407e-07
4.10189e-05
1.18529e-07
4.10219e-05
1.1485e-07
4.10265e-05
1.34563e-07
4.10306e-05
1.31192e-07
4.10361e-05
1.44435e-07
4.10406e-05
1.39213e-07
4.10457e-05
1.51354e-07
4.10509e-05
1.46728e-07
4.10563e-05
1.52586e-07
4.10623e-05
1.60846e-07
4.10677e-05
1.53397e-07
4.10743e-05
1.64245e-07
4.10791e-05
1.46165e-07
4.10858e-05
1.6559e-07
4.10913e-05
1.37895e-07
4.11005e-05
1.65611e-07
4.11073e-05
1.27727e-07
4.11151e-05
1.3716e-07
4.11182e-05
8.49296e-08
4.11185e-05
6.98323e-08
4.11166e-05
3.71063e-08
4.11126e-05
1.7207e-08
4.11084e-05
9.19263e-09
4.11011e-05
-1.82089e-08
4.10939e-05
-1.09592e-08
4.10849e-05
-2.15087e-08
4.10761e-05
-2.02023e-09
4.10671e-05
6.6283e-09
4.10608e-05
4.28212e-08
4.10571e-05
6.81808e-08
1.18888e-07
4.27803e-05
1.86839e-08
4.27997e-05
1.85087e-08
4.2818e-05
1.85867e-08
4.28346e-05
2.09666e-08
4.28456e-05
2.47605e-08
4.28531e-05
2.9879e-08
4.2858e-05
3.48438e-08
4.28617e-05
3.84614e-08
4.28643e-05
4.34226e-08
4.28667e-05
4.58022e-08
4.28692e-05
4.97021e-08
4.28719e-05
5.05094e-08
4.28758e-05
5.31525e-08
4.28801e-05
5.35495e-08
4.28856e-05
5.53523e-08
4.2891e-05
5.57411e-08
4.28974e-05
5.65583e-08
4.29029e-05
5.74689e-08
4.29085e-05
5.8387e-08
4.29136e-05
5.93217e-08
4.29184e-05
6.01652e-08
4.29234e-05
6.06826e-08
4.29277e-05
6.27682e-08
4.29326e-05
6.22443e-08
4.2937e-05
6.53095e-08
4.2942e-05
6.33705e-08
4.29467e-05
6.7351e-08
4.29512e-05
6.46641e-08
4.29563e-05
6.83738e-08
4.29604e-05
6.62054e-08
4.29654e-05
6.87671e-08
4.29688e-05
6.69978e-08
4.29731e-05
6.80859e-08
4.29761e-05
6.68684e-08
4.29792e-05
6.69131e-08
4.29826e-05
6.46177e-08
4.29846e-05
6.52172e-08
4.29876e-05
6.04027e-08
4.29891e-05
6.10353e-08
4.29914e-05
5.50531e-08
4.29937e-05
5.54055e-08
4.29953e-05
5.00355e-08
4.2998e-05
4.78396e-08
4.29981e-05
4.39187e-08
4.29998e-05
3.80056e-08
4.30016e-05
3.61774e-08
4.30017e-05
3.26131e-08
4.30023e-05
2.59679e-08
4.30016e-05
2.58284e-08
4.30026e-05
2.02977e-08
4.30016e-05
2.07246e-08
4.2999e-05
1.76933e-08
4.30002e-05
1.40813e-08
4.2998e-05
2.17094e-08
4.29957e-05
1.65079e-08
4.29958e-05
2.09667e-08
4.29916e-05
2.72362e-08
4.29885e-05
2.31677e-08
4.2988e-05
3.13158e-08
4.2984e-05
4.38071e-08
4.29799e-05
3.90333e-08
4.29786e-05
5.27915e-08
4.29759e-05
6.04548e-08
4.2974e-05
6.82435e-08
4.29735e-05
7.49031e-08
4.29732e-05
8.67632e-08
4.29727e-05
8.54713e-08
4.29745e-05
1.00575e-07
4.29758e-05
1.0005e-07
4.29785e-05
1.15901e-07
4.29813e-05
1.12057e-07
4.29859e-05
1.29867e-07
4.29903e-05
1.26819e-07
4.29958e-05
1.38988e-07
4.30009e-05
1.34052e-07
4.30065e-05
1.4576e-07
4.30119e-05
1.41395e-07
4.30177e-05
1.46701e-07
4.30242e-05
1.54363e-07
4.30296e-05
1.47981e-07
4.3036e-05
1.57878e-07
4.3041e-05
1.41189e-07
4.30476e-05
1.59004e-07
4.30528e-05
1.32655e-07
4.30615e-05
1.56875e-07
4.30683e-05
1.21002e-07
4.30759e-05
1.29526e-07
4.30791e-05
8.1782e-08
4.308e-05
6.88406e-08
4.30786e-05
3.85433e-08
4.30754e-05
2.04292e-08
4.30719e-05
1.27053e-08
4.3065e-05
-1.13791e-08
4.30584e-05
-4.30761e-09
4.30499e-05
-1.29844e-08
4.30418e-05
6.09082e-09
4.30331e-05
1.53318e-08
4.30265e-05
4.93604e-08
4.30218e-05
7.28609e-08
1.18931e-07
4.48981e-05
1.95038e-08
4.48974e-05
1.91291e-08
4.48965e-05
1.95596e-08
4.48961e-05
2.1365e-08
4.48963e-05
2.44929e-08
4.48986e-05
2.76197e-08
4.49015e-05
3.19641e-08
4.4905e-05
3.49301e-08
4.49095e-05
3.89155e-08
4.49143e-05
4.10106e-08
4.49198e-05
4.42016e-08
4.49246e-05
4.57423e-08
4.49299e-05
4.78504e-08
4.49346e-05
4.88645e-08
4.49399e-05
5.00187e-08
4.49447e-05
5.09064e-08
4.49495e-05
5.17851e-08
4.49542e-05
5.27762e-08
4.49588e-05
5.37358e-08
4.49638e-05
5.43296e-08
4.49683e-05
5.56628e-08
4.49735e-05
5.55599e-08
4.49782e-05
5.80688e-08
4.49833e-05
5.71089e-08
4.49883e-05
6.02808e-08
4.49931e-05
5.85901e-08
4.49985e-05
6.19984e-08
4.50029e-05
6.02444e-08
4.50081e-05
6.30975e-08
4.50124e-05
6.19138e-08
4.50173e-05
6.38881e-08
4.50215e-05
6.27816e-08
4.50256e-05
6.3974e-08
4.50299e-05
6.259e-08
4.50331e-05
6.36944e-08
4.50372e-05
6.06032e-08
4.50402e-05
6.22032e-08
4.50432e-05
5.7406e-08
4.50459e-05
5.83182e-08
4.50478e-05
5.30929e-08
4.50507e-05
5.25412e-08
4.50523e-05
4.84552e-08
4.50546e-05
4.55228e-08
4.50559e-05
4.2579e-08
4.50562e-05
3.7755e-08
4.50583e-05
3.40822e-08
4.50582e-05
3.27106e-08
4.50583e-05
2.5857e-08
4.50582e-05
2.59677e-08
4.50571e-05
2.13225e-08
4.50575e-05
2.03733e-08
4.50545e-05
2.07351e-08
4.50532e-05
1.53209e-08
4.50528e-05
2.21514e-08
4.50488e-05
2.0494e-08
4.50481e-05
2.16533e-08
4.50458e-05
2.95537e-08
4.50404e-05
2.85788e-08
4.50395e-05
3.22e-08
4.50374e-05
4.59091e-08
4.50321e-05
4.42848e-08
4.50304e-05
5.45114e-08
4.50285e-05
6.2408e-08
4.50264e-05
7.03203e-08
4.50258e-05
7.54829e-08
4.50257e-05
8.6839e-08
4.50249e-05
8.6259e-08
4.50265e-05
9.90623e-08
4.5028e-05
9.84773e-08
4.50309e-05
1.13007e-07
4.50334e-05
1.09567e-07
4.50385e-05
1.24733e-07
4.50434e-05
1.21913e-07
4.5049e-05
1.33462e-07
4.50546e-05
1.28435e-07
4.50609e-05
1.39472e-07
4.50661e-05
1.36203e-07
4.50724e-05
1.40379e-07
4.50797e-05
1.47006e-07
4.50858e-05
1.41948e-07
4.50927e-05
1.50958e-07
4.50985e-05
1.35435e-07
4.51058e-05
1.51633e-07
4.51115e-05
1.27005e-07
4.5121e-05
1.47327e-07
4.51283e-05
1.13689e-07
4.51366e-05
1.21226e-07
4.514e-05
7.84245e-08
4.51409e-05
6.79226e-08
4.51393e-05
4.01868e-08
4.51356e-05
2.41421e-08
4.51317e-05
1.66095e-08
4.51241e-05
-3.82923e-09
4.51167e-05
3.08103e-09
4.51072e-05
-3.43101e-09
4.50983e-05
1.49374e-08
4.50886e-05
2.50151e-08
4.50818e-05
5.61816e-08
4.50771e-05
7.7566e-08
1.19048e-07
4.70686e-05
4.70692e-05
4.70683e-05
4.70669e-05
4.70658e-05
4.70653e-05
4.70659e-05
4.70672e-05
4.70697e-05
4.70726e-05
4.70765e-05
4.70806e-05
4.70853e-05
4.70898e-05
4.70944e-05
4.70986e-05
4.7103e-05
4.71075e-05
4.71119e-05
4.71167e-05
4.71213e-05
4.71263e-05
4.71314e-05
4.71365e-05
4.71419e-05
4.71469e-05
4.71526e-05
4.71574e-05
4.71626e-05
4.71672e-05
4.71717e-05
4.71758e-05
4.71792e-05
4.71827e-05
4.71853e-05
4.7188e-05
4.71905e-05
4.71924e-05
4.71948e-05
4.71962e-05
4.71986e-05
4.72006e-05
4.72026e-05
4.7205e-05
4.72057e-05
4.7208e-05
4.72095e-05
4.721e-05
4.72115e-05
4.72114e-05
4.72128e-05
4.72123e-05
4.72108e-05
4.72121e-05
4.72099e-05
4.72084e-05
4.72079e-05
4.72028e-05
4.72004e-05
4.7199e-05
4.71935e-05
4.71901e-05
4.71876e-05
4.71846e-05
4.71829e-05
4.71821e-05
4.71808e-05
4.71816e-05
4.71829e-05
4.71857e-05
4.71879e-05
4.71927e-05
4.71978e-05
4.72031e-05
4.7209e-05
4.72159e-05
4.72214e-05
4.72278e-05
4.72356e-05
4.72415e-05
4.72479e-05
4.72534e-05
4.72604e-05
4.72655e-05
4.7274e-05
4.72807e-05
4.72882e-05
4.72917e-05
4.72935e-05
4.72928e-05
4.72904e-05
4.72874e-05
4.72813e-05
4.7275e-05
4.72671e-05
4.72594e-05
4.72503e-05
4.72434e-05
4.72373e-05
)
;
boundaryField
{
zeroGradientPlanes
{
type calculated;
value nonuniform List<scalar>
220
(
-2.70429e-07
4.46103e-07
-6.70283e-07
-1.24472e-06
1.53815e-06
-1.10088e-06
-1.10778e-06
-6.44933e-07
-1.05482e-07
2.11916e-07
-3.41256e-07
-5.75913e-07
-1.56272e-07
-3.26293e-07
-1.99956e-07
-3.50647e-07
-3.73697e-07
-3.47663e-07
-3.27703e-07
-3.68999e-07
3.39106e-08
1.08273e-07
1.93091e-07
2.89262e-07
3.97691e-07
5.19167e-07
6.54204e-07
8.02878e-07
9.64687e-07
1.13847e-06
1.3224e-06
1.51406e-06
1.71049e-06
1.90823e-06
2.10339e-06
2.29202e-06
2.47073e-06
2.63752e-06
2.7923e-06
2.93697e-06
3.07499e-06
3.21062e-06
3.34823e-06
3.49171e-06
3.64409e-06
3.80738e-06
3.98252e-06
4.16954e-06
4.36791e-06
4.57696e-06
4.79628e-06
5.02589e-06
5.26621e-06
5.51785e-06
5.78145e-06
6.05768e-06
6.34716e-06
6.65051e-06
6.96839e-06
7.3015e-06
7.65055e-06
8.01629e-06
8.39951e-06
8.80104e-06
9.22173e-06
9.66252e-06
1.01243e-05
1.06082e-05
1.11151e-05
1.16462e-05
1.22026e-05
1.27856e-05
1.33963e-05
1.40362e-05
1.47066e-05
1.5409e-05
1.6145e-05
1.69162e-05
1.77242e-05
1.85709e-05
1.94581e-05
2.03877e-05
2.13618e-05
2.23824e-05
2.34517e-05
2.45721e-05
2.57461e-05
2.69761e-05
2.82649e-05
2.96151e-05
3.103e-05
3.25124e-05
3.40656e-05
3.56932e-05
3.73984e-05
3.91861e-05
4.10579e-05
4.30218e-05
4.5077e-05
4.72359e-05
-7.37068e-09
-2.39614e-09
-4.269e-09
7.696e-09
1.22604e-08
2.25886e-08
2.62605e-08
3.63853e-08
3.84715e-08
4.39361e-08
4.45775e-08
4.42486e-08
4.19936e-08
4.05933e-08
3.35544e-08
3.12066e-08
2.56597e-08
2.3525e-08
1.95781e-08
1.8442e-08
1.69896e-08
1.84933e-08
2.04835e-08
2.27369e-08
2.56368e-08
2.81548e-08
3.13535e-08
3.35968e-08
3.63883e-08
3.81796e-08
4.0279e-08
4.16685e-08
4.31124e-08
4.43459e-08
4.54839e-08
4.66159e-08
4.74727e-08
4.82264e-08
4.93721e-08
4.95482e-08
5.10364e-08
5.05249e-08
5.29923e-08
5.20357e-08
5.48145e-08
5.35721e-08
5.63951e-08
5.54376e-08
5.78555e-08
5.72694e-08
5.9401e-08
5.87627e-08
6.05563e-08
5.90569e-08
6.10861e-08
5.79142e-08
5.96782e-08
5.55149e-08
5.59824e-08
5.16262e-08
5.01091e-08
4.65243e-08
4.35227e-08
4.01492e-08
3.70939e-08
3.17455e-08
3.12332e-08
2.53651e-08
2.44143e-08
2.14904e-08
1.89394e-08
2.11948e-08
1.68295e-08
2.083e-08
2.27419e-08
2.31071e-08
3.01096e-08
3.36268e-08
3.46559e-08
4.72652e-08
4.97853e-08
5.79306e-08
6.49621e-08
7.33257e-08
7.71777e-08
8.75565e-08
8.75861e-08
9.82804e-08
9.71881e-08
1.10224e-07
1.07292e-07
1.19984e-07
1.16849e-07
1.28129e-07
1.22498e-07
1.32558e-07
1.30732e-07
1.33959e-07
1.3927e-07
1.35993e-07
1.44557e-07
1.30003e-07
1.44601e-07
1.21894e-07
1.38824e-07
1.06961e-07
1.13713e-07
7.49196e-08
6.62093e-08
4.08784e-08
2.65436e-08
1.95363e-08
2.30081e-09
9.37039e-09
4.5049e-09
2.26595e-08
3.41262e-08
6.30722e-08
8.36582e-08
1.20455e-07
)
;
}
inlet
{
type calculated;
value nonuniform List<scalar>
80
(
-1.16841e-06
-1.22426e-06
-1.28278e-06
-1.3441e-06
-1.40835e-06
-1.47568e-06
-1.54622e-06
-1.62013e-06
-1.69757e-06
-1.77872e-06
-1.86375e-06
-1.95284e-06
-2.04619e-06
-2.144e-06
-2.24649e-06
-2.35388e-06
-2.4664e-06
-2.58429e-06
-2.70783e-06
-2.83727e-06
-2.9729e-06
-3.11501e-06
-3.26391e-06
-3.41993e-06
-3.58341e-06
-3.75471e-06
-3.93419e-06
-4.12225e-06
-4.3193e-06
-4.52577e-06
-4.74211e-06
-4.9688e-06
-5.20632e-06
-5.45519e-06
-5.71596e-06
-5.98919e-06
-6.27549e-06
-6.57547e-06
-6.88979e-06
-7.21914e-06
-7.56423e-06
-7.92581e-06
-8.30468e-06
-8.70166e-06
-9.11762e-06
-9.55346e-06
-1.00101e-05
-1.04886e-05
-1.099e-05
-1.15154e-05
-1.20658e-05
-1.26426e-05
-1.32469e-05
-1.38802e-05
-1.45437e-05
-1.52389e-05
-1.59673e-05
-1.67306e-05
-1.75304e-05
-1.83683e-05
-1.92464e-05
-2.01664e-05
-2.11304e-05
-2.21405e-05
-2.31988e-05
-2.43078e-05
-2.54698e-05
-2.66873e-05
-2.7963e-05
-2.92997e-05
-3.07002e-05
-3.21678e-05
-3.37055e-05
-3.53166e-05
-3.70049e-05
-3.87738e-05
-4.06272e-05
-4.25693e-05
-4.46042e-05
-4.67364e-05
)
;
}
plate
{
type calculated;
value uniform 0;
}
frontAndBack
{
type empty;
value nonuniform 0();
}
}
// ************************************************************************* //
| [
"savasah@itu.edu.tr"
] | savasah@itu.edu.tr | |
5dc04aace8fb74c98a467abb0255fd62b430f255 | 6a0f99ea56ec5bd1f374d38113c667d8426be299 | /http_server/evhtp-executor-service.h | 632e986e529cc95352bfb294c612cd8e25554c18 | [] | no_license | cangyingzhijia/common | 11c4e94b00616e752f4d18c6553ec261c655475b | 58e9b00afafcdea040f564c81abb365dd595c43f | refs/heads/master | 2021-01-19T02:24:49.675885 | 2016-11-06T02:24:46 | 2016-11-06T02:24:46 | 49,878,625 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,096 | h | //
// Author: cangyingzhijia@126.com
// Date: 2014-06-25
//
//
#ifndef HTTP_SERVER_EVHTP_EXECUTOR_SERVICE_H_
#define HTTP_SERVER_EVHTP_EXECUTOR_SERVICE_H_
#include "common/base/closure.h"
#include "common/base/executor-service.h"
#include "common/http_server/evhtp/evthr.h"
namespace common {
namespace http_server {
class EvhtpExecutorService : public common::ExecutorService{
public:
EvhtpExecutorService(int thread_num);
EvhtpExecutorService(evthr_pool_t * thr_pool, bool is_own_thr_pool = false);
virtual ~EvhtpExecutorService();
//提交一个 closure任务用于执行
virtual void Submit(Closure* closure);
void Submit(evthr_t * thread, Closure* closure);
// 启动一次顺序关闭,执行以前提交的任务,但不接受新任务
virtual void Shutdown();
// 如果此执行程序已关闭,则返回 true
virtual bool IsShutdown();
private:
evthr_pool_t * thr_pool_;
bool is_own_thr_pool_;
bool is_shutdown_;
};
} // namespace http_server
} // namespace common
#endif // HTTP_SERVER_EVHTP_EXECUTOR_SERVICE_H_
| [
"cangyingzhijia@users.noreply.github.com"
] | cangyingzhijia@users.noreply.github.com |
be78396402806c7e76408d62d26afe9fd6517f24 | 058f6cf55de8b72a7cdd6e592d40243a91431bde | /tests/cpu_checking/dynamic/test_fp32_cancellation/compute.cpp | bff9674fe8875d6e12f7b4ce6f2e7436e3dee3b9 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | LLNL/FPChecker | 85e8ebf1d321b3208acee7ddfda2d8878a238535 | e665ef0f050316f6bc4dfc64c1f17355403e771b | refs/heads/master | 2023-08-30T23:24:43.749418 | 2022-04-14T19:57:44 | 2022-04-14T19:57:44 | 177,033,795 | 24 | 6 | Apache-2.0 | 2022-09-19T00:09:50 | 2019-03-21T22:34:14 | Python | UTF-8 | C++ | false | false | 230 | cpp |
#include <stdio.h>
float compute(float *x, int n) {
float res = 0.0;
for (int i=0; i < n; ++i) {
//res = res + x[i];
// Cancellation
float tmp = x[i] - (x[i]+0.0000000001);
res += tmp;
}
return res;
}
| [
"ilaguna@llnl.gov"
] | ilaguna@llnl.gov |
947b2b70e3e4a97dde9c7034b439903540b85648 | cc17c3e9dc5a5be54fb6a6ba3e509d922940f874 | /RecurringService.cpp | b055cd6ea1789359a90992472819c20e5a5baada | [] | no_license | IanMagnusson/coworking-membership-system | a9cdcee1d7ea60041ddd6a31e7b0f2c067925dd0 | b9d24bb69245153ccce5f7555b5082a3a752ee68 | refs/heads/master | 2023-02-21T03:44:08.956710 | 2018-07-07T01:00:13 | 2018-07-07T01:00:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,527 | cpp | /*
RecurringService.cpp
code by Jack Magnusson 5/3/18
Final Assignment csci-e53
*/
#include "RecurringService.h"
using namespace std;
////////////////////////// constructors /////////////////////////////
RecurringService::RecurringService(unsigned id, unsigned acctId, const Product & prod, unsigned membId) :
m_id(id),
m_associatedAccount(acctId),
m_associatedMember(membId),
m_productName(prod.getName()),
m_price(prod.getPrice()),
m_billingPeriod(prod.getBillingPeriod()),
m_lastBilledOn(-m_billingPeriod), // so it always bills the first time
m_startedOn(currentTime)
{
if (m_productName == "Inactive")
m_endingOn = 0;
}
RecurringService::RecurringService(unsigned id, const Member & memb, const Product & prod):
m_id(id),
m_associatedAccount(memb.getAccountId()),
m_associatedMember(memb.getId()),
m_productName(prod.getName()),
m_price(prod.getPrice()),
m_billingPeriod(prod.getBillingPeriod()),
m_lastBilledOn(-m_billingPeriod), // so it always bills the first time
m_startedOn(currentTime)
{
if (m_productName == "Inactive")
m_endingOn = 0;
}
// WARNING: memb and prod must be Cached!!!!
RecurringService::RecurringService(unsigned id, CachedData &cd) :
m_id(id),
m_associatedAccount(cd.getMemb().getAccountId()),
m_associatedMember(cd.getMemb().getId()),
m_productName(cd.getProd().getName()),
m_price(cd.getProd().getPrice()),
m_billingPeriod(cd.getProd().getBillingPeriod()),
m_lastBilledOn(-m_billingPeriod), // so it always bills the first time
m_startedOn(currentTime)
{
if (m_productName == "Inactive")
m_endingOn = 0;
}
// display
void RecurringService::display() const
{
cout << endl << "recurring service ID: " << m_id << endl;
cout << "associated account ID: " << m_associatedAccount << endl;
cout << "associated member ID: " << m_associatedMember << endl;
cout << "product type: " << m_productName << endl;
cout << "price: " << m_price << endl;
cout << "billing Period: " << m_billingPeriod << endl;
cout << "last billed on: " << m_lastBilledOn << endl;
cout << "started on: " << m_startedOn << endl;
cout << "ending on: " << (m_endingOn >= 0 ? to_string(m_endingOn) : "not set") << endl;
}
// returns true if billing needed; assumes billing carried out and updates lastBilledOn
bool RecurringService::billMeIfTime()
{
// check RecurringService is still active
if (!(m_endingOn < 0) && m_endingOn <= currentTime)
return false;
// check if billing period has elapse since last billing
if ((currentTime - m_lastBilledOn) >= m_billingPeriod)
{
m_lastBilledOn = currentTime;
return true;
}
else
return false;
}
////////////////////////// set methods ////////////////////////////
void RecurringService::setPrice(double newPrice)
{
m_price = newPrice;
}
void RecurringService::setBillingPeriod(time_t newBillingPeriod)
{
m_billingPeriod = newBillingPeriod;
}
void RecurringService::setEndingOn(time_t newEndingOn)
{
m_endingOn = newEndingOn;
}
//////////////////////////////// get methods ///////////////////////////////////////////
unsigned RecurringService::getId() const
{
return m_id;
}
unsigned RecurringService::getAccount() const
{
return m_associatedAccount;
}
unsigned RecurringService::getMember() const
{
return m_associatedMember;
}
std::string RecurringService::getProductName()
{
return m_productName;
}
double RecurringService::getPrice()
{
return m_price;
}
time_t RecurringService::getBillingPeriod()
{
return m_billingPeriod;
}
time_t RecurringService::getLastBilledOn()
{
return m_lastBilledOn;
}
| [
"40903802+jagnusson@users.noreply.github.com"
] | 40903802+jagnusson@users.noreply.github.com |
b7543b211366c663686a8abea15d7f3b062f53a5 | 61d4e279bb59dab28e11ac17f99e466cf8aba3cc | /src/server/scripts/Commands/cs_misc.cpp | c2e2725da3e5d1e3c8e4a747c9eeb5c91829ce6b | [] | no_license | dufernst/5.4.8-Wow-source | a840af25441ec9c38622c16de40b2997d4605ad1 | 5511dffb1e9ad2e2e0b794288c4b9ea5041112d5 | refs/heads/master | 2021-01-16T22:12:12.568039 | 2015-08-19T22:55:05 | 2015-08-19T22:55:05 | 41,120,934 | 2 | 10 | null | 2015-08-20T22:03:56 | 2015-08-20T22:03:56 | null | UTF-8 | C++ | false | false | 113,961 | cpp | /*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Chat.h"
#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
#include "Group.h"
#include "InstanceSaveMgr.h"
#include "MovementGenerator.h"
#include "ObjectAccessor.h"
#include "SpellAuras.h"
#include "TargetedMovementGenerator.h"
#include "WeatherMgr.h"
#include "ace/INET_Addr.h"
#include "DB2Structure.h"
#include "DB2Stores.h"
#include "LFGMgr.h"
#include <fstream>
class misc_commandscript : public CommandScript
{
public:
misc_commandscript() : CommandScript("misc_commandscript") { }
ChatCommand* GetCommands() const
{
static ChatCommand groupCommandTable[] =
{
{ "leader", SEC_ADMINISTRATOR, false, &HandleGroupLeaderCommand, "", NULL },
{ "disband", SEC_ADMINISTRATOR, false, &HandleGroupDisbandCommand, "", NULL },
{ "remove", SEC_ADMINISTRATOR, false, &HandleGroupRemoveCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand petCommandTable[] =
{
{ "create", SEC_GAMEMASTER, false, &HandleCreatePetCommand, "", NULL },
{ "learn", SEC_GAMEMASTER, false, &HandlePetLearnCommand, "", NULL },
{ "unlearn", SEC_GAMEMASTER, false, &HandlePetUnlearnCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand sendCommandTable[] =
{
{ "items", SEC_ADMINISTRATOR, true, &HandleSendItemsCommand, "", NULL },
{ "mail", SEC_MODERATOR, true, &HandleSendMailCommand, "", NULL },
{ "message", SEC_ADMINISTRATOR, true, &HandleSendMessageCommand, "", NULL },
{ "money", SEC_ADMINISTRATOR, true, &HandleSendMoneyCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand auraCommandTable[] =
{
{ "duration", SEC_ADMINISTRATOR, true, &HandleAuraDurationCommand, "", NULL },
{ "charges", SEC_ADMINISTRATOR, true, &HandleAuraChargesCommand, "", NULL },
{ "", SEC_ADMINISTRATOR, true, &HandleAuraCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "lfgstatus", SEC_ADMINISTRATOR, false, &HandleLfgStatus, "", NULL },
{ "blackmarketwon", SEC_ADMINISTRATOR, false, &HandleBlackMarketWon, "", NULL },
{ "setarch", SEC_ADMINISTRATOR, false, &HandleSetArchCommand, "", NULL },
{ "lootroll", SEC_ADMINISTRATOR, false, &HandleSendLootRollCommand, "", NULL },
{ "startmirror", SEC_ADMINISTRATOR, false, &HandleMirrorTimerStartCommand, "", NULL },
{ "stopmirror", SEC_ADMINISTRATOR, false, &HandleMirrorTimerStopCommand, "", NULL },
{ "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL },
{ "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL },
{ "aura", SEC_ADMINISTRATOR, false, NULL, "", auraCommandTable },
{ "unaura", SEC_ADMINISTRATOR, false, &HandleUnAuraCommand, "", NULL },
{ "appear", SEC_MODERATOR, false, &HandleAppearCommand, "", NULL },
{ "summon", SEC_MODERATOR, false, &HandleSummonCommand, "", NULL },
{ "groupsummon", SEC_MODERATOR, false, &HandleGroupSummonCommand, "", NULL },
{ "commands", SEC_PLAYER, true, &HandleCommandsCommand, "", NULL },
{ "die", SEC_ADMINISTRATOR, false, &HandleDieCommand, "", NULL },
{ "revive", SEC_ADMINISTRATOR, true, &HandleReviveCommand, "", NULL },
{ "dismount", SEC_PLAYER, false, &HandleDismountCommand, "", NULL },
{ "guid", SEC_GAMEMASTER, false, &HandleGUIDCommand, "", NULL },
{ "help", SEC_PLAYER, true, &HandleHelpCommand, "", NULL },
{ "itemmove", SEC_GAMEMASTER, false, &HandleItemMoveCommand, "", NULL },
{ "cooldown", SEC_ADMINISTRATOR, false, &HandleCooldownCommand, "", NULL },
{ "distance", SEC_ADMINISTRATOR, false, &HandleGetDistanceCommand, "", NULL },
{ "recall", SEC_MODERATOR, false, &HandleRecallCommand, "", NULL },
{ "save", SEC_PLAYER, false, &HandleSaveCommand, "", NULL },
{ "saveall", SEC_MODERATOR, true, &HandleSaveAllCommand, "", NULL },
{ "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL },
{ "start", SEC_PLAYER, false, &HandleStartCommand, "", NULL },
{ "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL },
{ "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL },
{ "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL },
{ "hidearea", SEC_ADMINISTRATOR, false, &HandleHideAreaCommand, "", NULL },
{ "additem", SEC_ADMINISTRATOR, false, &HandleAddItemCommand, "", NULL },
{ "additemset", SEC_ADMINISTRATOR, false, &HandleAddItemSetCommand, "", NULL },
{ "bank", SEC_ADMINISTRATOR, false, &HandleBankCommand, "", NULL },
{ "wchange", SEC_ADMINISTRATOR, false, &HandleChangeWeather, "", NULL },
{ "setskill", SEC_ADMINISTRATOR, false, &HandleSetSkillCommand, "", NULL },
{ "pinfo", SEC_GAMEMASTER, true, &HandlePInfoCommand, "", NULL },
{ "respawn", SEC_ADMINISTRATOR, false, &HandleRespawnCommand, "", NULL },
{ "send", SEC_MODERATOR, true, NULL, "", sendCommandTable },
{ "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable },
{ "mute", SEC_MODERATOR, true, &HandleMuteCommand, "", NULL },
{ "unmute", SEC_MODERATOR, true, &HandleUnmuteCommand, "", NULL },
{ "movegens", SEC_ADMINISTRATOR, false, &HandleMovegensCommand, "", NULL },
{ "cometome", SEC_ADMINISTRATOR, false, &HandleComeToMeCommand, "", NULL },
{ "damage", SEC_ADMINISTRATOR, false, &HandleDamageCommand, "", NULL },
{ "damagetest", SEC_ADMINISTRATOR, false, &HandleDamageTestCommand, "", NULL },
{ "mailtest", SEC_ADMINISTRATOR, false, &HandleMailTestCommand, "", NULL },
{ "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "", NULL },
{ "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "", NULL },
{ "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "", NULL },
{ "freeze", SEC_MODERATOR, false, &HandleFreezeCommand, "", NULL },
{ "unfreeze", SEC_MODERATOR, false, &HandleUnFreezeCommand, "", NULL },
{ "listfreeze", SEC_MODERATOR, false, &HandleListFreezeCommand, "", NULL },
{ "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable },
{ "possess", SEC_ADMINISTRATOR, false, &HandlePossessCommand, "", NULL },
{ "unpossess", SEC_ADMINISTRATOR, false, &HandleUnPossessCommand, "", NULL },
{ "bindsight", SEC_ADMINISTRATOR, false, &HandleBindSightCommand, "", NULL },
{ "unbindsight", SEC_ADMINISTRATOR, false, &HandleUnbindSightCommand, "", NULL },
{ "playall", SEC_GAMEMASTER, false, &HandlePlayAllCommand, "", NULL },
{ "selectfaction", SEC_ADMINISTRATOR, false, &HandleSelectFactionCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}
static bool HandleDevCommand(ChatHandler* handler, char const* args)
{
if (!*args)
{
if (handler->GetSession()->GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER))
handler->GetSession()->SendNotification(LANG_DEV_ON);
else
handler->GetSession()->SendNotification(LANG_DEV_OFF);
return true;
}
std::string argstr = (char*)args;
if (argstr == "on")
{
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER);
handler->GetSession()->SendNotification(LANG_DEV_ON);
return true;
}
if (argstr == "off")
{
handler->GetSession()->GetPlayer()->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER);
handler->GetSession()->SendNotification(LANG_DEV_OFF);
return true;
}
handler->SendSysMessage(LANG_USE_BOL);
handler->SetSentErrorMessage(true);
return false;
}
static bool HandleGPSCommand(ChatHandler* handler, char const* args)
{
WorldObject* object = NULL;
if (*args)
{
uint64 guid = handler->extractGuidFromLink((char*)args);
if (guid)
object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
if (!object)
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
handler->SetSentErrorMessage(true);
return false;
}
}
else
{
object = handler->getSelectedUnit();
if (!object)
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
}
CellCoord cellCoord = WoWSource::ComputeCellCoord(object->GetPositionX(), object->GetPositionY());
Cell cell(cellCoord);
uint32 zoneId, areaId;
object->GetZoneAndAreaId(zoneId, areaId);
MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId());
AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId);
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId);
float zoneX = object->GetPositionX();
float zoneY = object->GetPositionY();
Map2ZoneCoordinates(zoneX, zoneY, zoneId);
Map const* map = object->GetMap();
float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
GridCoord gridCoord = WoWSource::ComputeGridCoord(object->GetPositionX(), object->GetPositionY());
// 63? WHY?
int gridX = 63 - gridCoord.x_coord;
int gridY = 63 - gridCoord.y_coord;
uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
if (haveVMap)
{
if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()))
handler->PSendSysMessage("You are outdoors");
else
handler->PSendSysMessage("You are indoors");
}
else
handler->PSendSysMessage("no VMAP available for area info");
handler->PSendSysMessage(LANG_MAP_POSITION,
object->GetMapId(), (mapEntry ? mapEntry->name : "<unknown>"),
zoneId, (zoneEntry ? zoneEntry->area_name : "<unknown>"),
areaId, (areaEntry ? areaEntry->area_name : "<unknown>"),
object->GetPhaseMask(),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap);
LiquidData liquidStatus;
ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus);
if (status)
handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status);
return true;
}
static bool HandleAuraCommand(ChatHandler* handler, char const* args)
{
Unit* target = handler->getSelectedUnit();
if (!target)
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellId = handler->extractSpellIdFromLink((char*)args);
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, target, target, spellInfo->spellPower);
return true;
}
static bool HandleAuraDurationCommand(ChatHandler* handler, char const* args)
{
Unit* target = handler->getSelectedUnit();
if (!target)
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellId = handler->extractSpellIdFromLink((char*)args);
if (!spellId)
return false;
char const* dduration = strtok(NULL, " ");
int32 duration = 1000;
if (dduration)
duration = strtol(dduration, NULL, 10);
if (!duration)
target->RemoveAurasDueToSpell(spellId);
else
{
if (AuraPtr aura = target->GetAura(spellId))
aura->SetDuration(duration);
else
return false;
}
return true;
}
static bool HandleAuraChargesCommand(ChatHandler* handler, char const* args)
{
Unit* target = handler->getSelectedUnit();
if (!target)
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellId = handler->extractSpellIdFromLink((char*)args);
if (!spellId)
return false;
char const* ccharges = strtok(NULL, " ");
int32 charges = 1;
if (ccharges)
charges = strtol(ccharges, NULL, 10);
if (!charges)
target->RemoveAurasDueToSpell(spellId);
else
{
if (AuraPtr aura = target->GetAura(spellId))
aura->SetCharges(charges);
else
return false;
}
return true;
}
static bool HandleUnAuraCommand(ChatHandler* handler, char const* args)
{
Unit* target = handler->getSelectedUnit();
if (!target)
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
std::string argstr = args;
if (argstr == "all")
{
target->RemoveAllAuras();
return true;
}
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellId = handler->extractSpellIdFromLink((char*)args);
if (!spellId)
return false;
target->RemoveAurasDueToSpell(spellId);
return true;
}
// Teleport to Player
static bool HandleAppearCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
Player* _player = handler->GetSession()->GetPlayer();
if (target == _player || targetGuid == _player->GetGUID())
{
handler->SendSysMessage(LANG_CANT_TELEPORT_SELF);
handler->SetSentErrorMessage(true);
return false;
}
if (target)
{
// check online security
if (handler->HasLowerSecurity(target, 0))
return false;
std::string chrNameLink = handler->playerLink(targetName);
Map* map = target->GetMap();
if (map->IsBattlegroundOrArena())
{
// only allow if gm mode is on
if (!_player->isGameMaster())
{
handler->PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
// if both players are in different bgs
else if (_player->GetBattlegroundId() && _player->GetBattlegroundId() != target->GetBattlegroundId())
_player->LeaveBattleground(false); // Note: should be changed so _player gets no Deserter debuff
// all's well, set bg id
// when porting out from the bg, it will be reset to 0
_player->SetBattlegroundId(target->GetBattlegroundId(), target->GetBattlegroundTypeId());
// remember current position as entry point for return at bg end teleportation
if (!_player->GetMap()->IsBattlegroundOrArena())
_player->SetBattlegroundEntryPoint();
}
else if (map->IsDungeon())
{
// we have to go to instance, and can go to player only if:
// 1) we are in his group (either as leader or as member)
// 2) we are not bound to any group and have GM mode on
if (_player->GetGroup())
{
// we are in group, we can go only if we are in the player group
if (_player->GetGroup() != target->GetGroup())
{
handler->PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
}
else
{
// we are not in group, let's verify our GM mode
if (!_player->isGameMaster())
{
handler->PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
}
// if the player or the player's group is bound to another instance
// the player will not be bound to another one
InstancePlayerBind* bind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(map->IsRaid()));
if (!bind)
{
Group* group = _player->GetGroup();
// if no bind exists, create a solo bind
InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
if (!gBind)
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId()))
_player->BindToInstance(save, !save->CanReset());
}
if (map->IsRaid())
_player->SetRaidDifficulty(target->GetRaidDifficulty());
else
_player->SetDungeonDifficulty(target->GetDungeonDifficulty());
}
handler->PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
// stop flight if need
if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
_player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
_player->SaveRecallPosition();
// to point to see at target with same orientation
float x, y, z;
target->GetContactPoint(_player, x, y, z);
_player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
_player->SetPhaseMask(target->GetPhaseMask(), true);
}
else
{
// check offline security
if (handler->HasLowerSecurity(NULL, targetGuid))
return false;
std::string nameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
// to point where player stay (if loaded)
float x, y, z, o;
uint32 map;
bool in_flight;
if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, targetGuid))
return false;
// stop flight if need
if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
_player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
_player->SaveRecallPosition();
_player->TeleportTo(map, x, y, z, _player->GetOrientation());
}
return true;
}
// Summon Player
static bool HandleSummonCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
Player* _player = handler->GetSession()->GetPlayer();
if (target == _player || targetGuid == _player->GetGUID())
{
handler->PSendSysMessage(LANG_CANT_TELEPORT_SELF);
handler->SetSentErrorMessage(true);
return false;
}
if (target)
{
std::string nameLink = handler->playerLink(targetName);
// check online security
if (handler->HasLowerSecurity(target, 0))
return false;
if (target->IsBeingTeleported())
{
handler->PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
Map* map = handler->GetSession()->GetPlayer()->GetMap();
if (map->IsBattlegroundOrArena())
{
// only allow if gm mode is on
if (!_player->isGameMaster())
{
handler->PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
// if both players are in different bgs
else if (target->GetBattlegroundId() && handler->GetSession()->GetPlayer()->GetBattlegroundId() != target->GetBattlegroundId())
target->LeaveBattleground(false); // Note: should be changed so target gets no Deserter debuff
// all's well, set bg id
// when porting out from the bg, it will be reset to 0
target->SetBattlegroundId(handler->GetSession()->GetPlayer()->GetBattlegroundId(), handler->GetSession()->GetPlayer()->GetBattlegroundTypeId());
// remember current position as entry point for return at bg end teleportation
if (!target->GetMap()->IsBattlegroundOrArena())
target->SetBattlegroundEntryPoint();
}
else if (map->IsDungeon())
{
Map* map = target->GetMap();
if (map->Instanceable() && map->GetInstanceId() != map->GetInstanceId())
target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficulty(), true);
// we are in instance, and can summon only player in our group with us as lead
if (!handler->GetSession()->GetPlayer()->GetGroup() || !target->GetGroup() ||
(target->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))
// the last check is a bit excessive, but let it be, just in case
{
handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
}
handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
if (handler->needReportToTarget(target))
ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName()).c_str());
// stop flight if need
if (target->isInFlight())
{
target->GetMotionMaster()->MovementExpired();
target->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
target->SaveRecallPosition();
// before GM
float x, y, z;
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize());
target->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation());
target->SetPhaseMask(handler->GetSession()->GetPlayer()->GetPhaseMask(), true);
}
else
{
// check offline security
if (handler->HasLowerSecurity(NULL, targetGuid))
return false;
std::string nameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), handler->GetTrinityString(LANG_OFFLINE));
// in point where GM stay
Player::SavePositionInDB(handler->GetSession()->GetPlayer()->GetMapId(),
handler->GetSession()->GetPlayer()->GetPositionX(),
handler->GetSession()->GetPlayer()->GetPositionY(),
handler->GetSession()->GetPlayer()->GetPositionZ(),
handler->GetSession()->GetPlayer()->GetOrientation(),
handler->GetSession()->GetPlayer()->GetZoneId(),
targetGuid);
}
return true;
}
// Summon group of player
static bool HandleGroupSummonCommand(ChatHandler* handler, char const* args)
{
Player* target;
if (!handler->extractPlayerTarget((char*)args, &target))
return false;
// check online security
if (handler->HasLowerSecurity(target, 0))
return false;
Group* group = target->GetGroup();
std::string nameLink = handler->GetNameLink(target);
if (!group)
{
handler->PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
Map* gmMap = handler->GetSession()->GetPlayer()->GetMap();
bool toInstance = gmMap->Instanceable();
// we are in instance, and can summon only player in our group with us as lead
if (toInstance && (
!handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())))
// the last check is a bit excessive, but let it be, just in case
{
handler->SendSysMessage(LANG_CANNOT_SUMMON_TO_INST);
handler->SetSentErrorMessage(true);
return false;
}
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* player = itr->getSource();
if (!player || player == handler->GetSession()->GetPlayer() || !player->GetSession())
continue;
// check online security
if (handler->HasLowerSecurity(player, 0))
return false;
std::string plNameLink = handler->GetNameLink(player);
if (player->IsBeingTeleported() == true)
{
handler->PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
if (toInstance)
{
Map* playerMap = player->GetMap();
if (playerMap->Instanceable() && playerMap->GetInstanceId() != gmMap->GetInstanceId())
{
// cannot summon from instance to instance
handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
}
handler->PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), "");
if (handler->needReportToTarget(player))
ChatHandler(player).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str());
// stop flight if need
if (player->isInFlight())
{
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
player->SaveRecallPosition();
// before GM
float x, y, z;
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize());
player->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation());
}
return true;
}
static bool HandleCommandsCommand(ChatHandler* handler, char const* /*args*/)
{
handler->ShowHelpForCommand(handler->getCommandTable(), "");
return true;
}
static bool HandleDieCommand(ChatHandler* handler, char const* /*args*/)
{
Unit* target = handler->getSelectedUnit();
if (!target || !handler->GetSession()->GetPlayer()->GetSelection())
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
if (target->GetTypeId() == TYPEID_PLAYER)
{
if (handler->HasLowerSecurity((Player*)target, 0, false))
return false;
}
if (target->isAlive())
{
if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE))
handler->GetSession()->GetPlayer()->Kill(target);
else
handler->GetSession()->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
return true;
}
static bool HandleReviveCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
return false;
if (target)
{
target->ResurrectPlayer(!AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()) ? 1.0f : 0.5f);
target->SpawnCorpseBones();
target->SaveToDB();
}
else
// will resurrected at login without corpse
sObjectAccessor->ConvertCorpseForPlayer(targetGuid);
return true;
}
static bool HandleDismountCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
// If player is not mounted, so go out :)
if (!player->IsMounted())
{
handler->SendSysMessage(LANG_CHAR_NON_MOUNTED);
handler->SetSentErrorMessage(true);
return false;
}
if (player->isInFlight())
{
handler->SendSysMessage(LANG_YOU_IN_FLIGHT);
handler->SetSentErrorMessage(true);
return false;
}
player->Dismount();
player->RemoveAurasByType(SPELL_AURA_MOUNTED);
return true;
}
static bool HandleGUIDCommand(ChatHandler* handler, char const* /*args*/)
{
uint64 guid = handler->GetSession()->GetPlayer()->GetSelection();
if (guid == 0)
{
handler->SendSysMessage(LANG_NO_SELECTION);
handler->SetSentErrorMessage(true);
return false;
}
handler->PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid));
return true;
}
static bool HandleHelpCommand(ChatHandler* handler, char const* args)
{
char const* cmd = strtok((char*)args, " ");
if (!cmd)
{
handler->ShowHelpForCommand(handler->getCommandTable(), "help");
handler->ShowHelpForCommand(handler->getCommandTable(), "");
}
else
{
if (!handler->ShowHelpForCommand(handler->getCommandTable(), cmd))
handler->SendSysMessage(LANG_NO_HELP_CMD);
}
return true;
}
// move item to other slot
static bool HandleItemMoveCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
char const* param1 = strtok((char*)args, " ");
if (!param1)
return false;
char const* param2 = strtok(NULL, " ");
if (!param2)
return false;
uint8 srcSlot = uint8(atoi(param1));
uint8 dstSlot = uint8(atoi(param2));
if (srcSlot == dstSlot)
return true;
if (!handler->GetSession()->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, srcSlot, true))
return false;
if (!handler->GetSession()->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, dstSlot, false))
return false;
uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcSlot);
uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstSlot);
handler->GetSession()->GetPlayer()->SwapItem(src, dst);
return true;
}
static bool HandleCooldownCommand(ChatHandler* handler, char const* args)
{
Player* target = handler->getSelectedPlayer();
if (!target)
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
handler->SetSentErrorMessage(true);
return false;
}
std::string nameLink = handler->GetNameLink(target);
if (!*args)
{
target->RemoveAllSpellCooldown();
handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink.c_str());
}
else
{
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellIid = handler->extractSpellIdFromLink((char*)args);
if (!spellIid)
return false;
if (!sSpellMgr->GetSpellInfo(spellIid))
{
handler->PSendSysMessage(LANG_UNKNOWN_SPELL, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
target->RemoveSpellCooldown(spellIid, true);
handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
}
return true;
}
static bool HandleGetDistanceCommand(ChatHandler* handler, char const* args)
{
WorldObject* obj = NULL;
if (*args)
{
uint64 guid = handler->extractGuidFromLink((char*)args);
if (guid)
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
if (!obj)
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
handler->SetSentErrorMessage(true);
return false;
}
}
else
{
obj = handler->getSelectedUnit();
if (!obj)
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
}
handler->PSendSysMessage(LANG_DISTANCE, handler->GetSession()->GetPlayer()->GetDistance(obj), handler->GetSession()->GetPlayer()->GetDistance2d(obj), handler->GetSession()->GetPlayer()->GetExactDist(obj), handler->GetSession()->GetPlayer()->GetExactDist2d(obj));
return true;
}
// Teleport player to last position
static bool HandleRecallCommand(ChatHandler* handler, char const* args)
{
Player* target;
if (!handler->extractPlayerTarget((char*)args, &target))
return false;
// check online security
if (handler->HasLowerSecurity(target, 0))
return false;
if (target->IsBeingTeleported())
{
handler->PSendSysMessage(LANG_IS_TELEPORTED, handler->GetNameLink(target).c_str());
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
if (target->isInFlight())
{
target->GetMotionMaster()->MovementExpired();
target->CleanupAfterTaxiFlight();
}
target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
return true;
}
static bool HandleSaveCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
// save GM account without delay and output message
if (!AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity()))
{
if (Player* target = handler->getSelectedPlayer())
target->SaveToDB();
else
player->SaveToDB();
handler->SendSysMessage(LANG_PLAYER_SAVED);
return true;
}
// save if the player has last been saved over 20 seconds ago
uint32 saveInterval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
if (saveInterval == 0 || (saveInterval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= saveInterval - 20 * IN_MILLISECONDS))
player->SaveToDB();
return true;
}
// Save all players in the world
static bool HandleSaveAllCommand(ChatHandler* handler, char const* /*args*/)
{
sObjectAccessor->SaveAllPlayers();
handler->SendSysMessage(LANG_PLAYERS_SAVED);
return true;
}
// kick player
static bool HandleKickPlayerCommand(ChatHandler* handler, char const* args)
{
Player* target = NULL;
std::string playerName;
if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
return false;
if (handler->GetSession() && target == handler->GetSession()->GetPlayer())
{
handler->SendSysMessage(LANG_COMMAND_KICKSELF);
handler->SetSentErrorMessage(true);
return false;
}
// check online security
if (handler->HasLowerSecurity(target, 0))
return false;
if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
else
handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
target->GetSession()->KickPlayer();
return true;
}
static bool HandleStartCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
if (player->isInFlight())
{
handler->SendSysMessage(LANG_YOU_IN_FLIGHT);
handler->SetSentErrorMessage(true);
return false;
}
if (player->isInCombat())
{
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
handler->SetSentErrorMessage(true);
return false;
}
if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
{
// if player is dead and stuck, send ghost to graveyard
player->RepopAtGraveyard();
return true;
}
// cast spell Stuck
player->CastSpell(player, 7355, false);
return true;
}
static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
char* px = strtok((char*)args, " ");
if (!px)
return false;
uint32 graveyardId = uint32(atoi(px));
uint32 team;
char* px2 = strtok(NULL, " ");
if (!px2)
team = 0;
else if (strncmp(px2, "horde", 6) == 0)
team = HORDE;
else if (strncmp(px2, "alliance", 9) == 0)
team = ALLIANCE;
else
return false;
WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(graveyardId);
if (!graveyard)
{
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, graveyardId);
handler->SetSentErrorMessage(true);
return false;
}
Player* player = handler->GetSession()->GetPlayer();
uint32 zoneId = player->GetZoneId();
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
if (!areaEntry || areaEntry->zone !=0)
{
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId);
handler->SetSentErrorMessage(true);
return false;
}
if (sObjectMgr->AddGraveYardLink(graveyardId, zoneId, team))
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, graveyardId, zoneId);
else
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, graveyardId, zoneId);
return true;
}
static bool HandleNearGraveCommand(ChatHandler* handler, char const* args)
{
uint32 team;
size_t argStr = strlen(args);
if (!*args)
team = 0;
else if (strncmp((char*)args, "horde", argStr) == 0)
team = HORDE;
else if (strncmp((char*)args, "alliance", argStr) == 0)
team = ALLIANCE;
else
return false;
Player* player = handler->GetSession()->GetPlayer();
uint32 zone_id = player->GetZoneId();
WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), team);
if (graveyard)
{
uint32 graveyardId = graveyard->ID;
GraveYardData const* data = sObjectMgr->FindGraveYardData(graveyardId, zone_id);
if (!data)
{
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, graveyardId);
handler->SetSentErrorMessage(true);
return false;
}
team = data->team;
std::string team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_NOTEAM);
if (team == 0)
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
else if (team == HORDE)
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
else if (team == ALLIANCE)
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, graveyardId, team_name.c_str(), zone_id);
}
else
{
std::string team_name;
if (team == 0)
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
else if (team == HORDE)
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
else if (team == ALLIANCE)
team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
if (team == ~uint32(0))
handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id);
else
handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str());
}
return true;
}
static bool HandleShowAreaCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
Player* playerTarget = handler->getSelectedPlayer();
if (!playerTarget)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
return false;
}
int32 area = GetAreaFlagByAreaID(atoi((char*)args));
int32 offset = area / 32;
uint32 val = uint32((1 << (area % 32)));
if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields | val)));
handler->SendSysMessage(LANG_EXPLORE_AREA);
return true;
}
static bool HandleHideAreaCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
Player* playerTarget = handler->getSelectedPlayer();
if (!playerTarget)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
return false;
}
int32 area = GetAreaFlagByAreaID(atoi((char*)args));
int32 offset = area / 32;
uint32 val = uint32((1 << (area % 32)));
if (area < 0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields ^ val)));
handler->SendSysMessage(LANG_UNEXPLORE_AREA);
return true;
}
static bool HandleAddItemCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
uint32 itemId = 0;
if (args[0] == '[') // [name] manual form
{
char const* itemNameStr = strtok((char*)args, "]");
if (itemNameStr && itemNameStr[0])
{
std::string itemName = itemNameStr+1;
WorldDatabase.EscapeString(itemName);
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME);
stmt->setString(0, itemName);
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
{
handler->PSendSysMessage(LANG_COMMAND_COULDNOTFIND, itemNameStr+1);
handler->SetSentErrorMessage(true);
return false;
}
itemId = result->Fetch()->GetUInt32();
}
else
return false;
}
else // item_id or [name] Shift-click form |color|Hitem:item_id:0:0:0|h[name]|h|r
{
char const* id = handler->extractKeyFromLink((char*)args, "Hitem");
if (!id)
return false;
itemId = uint32(atol(id));
}
char const* ccount = strtok(NULL, " ");
int32 count = 1;
if (ccount)
count = strtol(ccount, NULL, 10);
if (count == 0)
count = 1;
Player* player = handler->GetSession()->GetPlayer();
Player* playerTarget = handler->getSelectedPlayer();
if (!playerTarget)
playerTarget = player;
sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_ADDITEM), itemId, count);
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
if (!itemTemplate)
{
handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
handler->SetSentErrorMessage(true);
return false;
}
// Subtract
if (count < 0)
{
playerTarget->DestroyItemCount(itemId, -count, true, false);
handler->PSendSysMessage(LANG_REMOVEITEM, itemId, -count, handler->GetNameLink(playerTarget).c_str());
return true;
}
// Adding items
uint32 noSpaceForCount = 0;
// check space and find places
ItemPosCountVec dest;
InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount);
if (msg != EQUIP_ERR_OK) // convert to possible store amount
count -= noSpaceForCount;
if (count == 0 || dest.empty()) // can't add any
{
handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
handler->SetSentErrorMessage(true);
return false;
}
Item* item = playerTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
// remove binding (let GM give it to another player later)
if (player == playerTarget)
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
if (Item* item1 = player->GetItemByPos(itr->pos))
item1->SetBinding(false);
if (count > 0 && item)
{
player->SendNewItem(item, count, false, true);
if (player != playerTarget)
playerTarget->SendNewItem(item, count, true, false);
}
if (noSpaceForCount > 0)
handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
return true;
}
static bool HandleAddItemSetCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
char const* id = handler->extractKeyFromLink((char*)args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r
if (!id)
return false;
uint32 itemSetId = atol(id);
// prevent generation all items with itemset field value '0'
if (itemSetId == 0)
{
handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId);
handler->SetSentErrorMessage(true);
return false;
}
Player* player = handler->GetSession()->GetPlayer();
Player* playerTarget = handler->getSelectedPlayer();
if (!playerTarget)
playerTarget = player;
sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_ADDITEMSET), itemSetId);
bool found = false;
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
{
if (itr->second.ItemSet == itemSetId)
{
found = true;
ItemPosCountVec dest;
InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itr->second.ItemId, 1);
if (msg == EQUIP_ERR_OK)
{
Item* item = playerTarget->StoreNewItem(dest, itr->second.ItemId, true);
// remove binding (let GM give it to another player later)
if (player == playerTarget)
item->SetBinding(false);
player->SendNewItem(item, 1, false, true);
if (player != playerTarget)
playerTarget->SendNewItem(item, 1, true, false);
}
else
{
player->SendEquipError(msg, NULL, NULL, itr->second.ItemId);
handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itr->second.ItemId, 1);
}
}
}
if (!found)
{
handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId);
handler->SetSentErrorMessage(true);
return false;
}
return true;
}
static bool HandleBankCommand(ChatHandler* handler, char const* /*args*/)
{
handler->GetSession()->SendShowBank(handler->GetSession()->GetPlayer()->GetGUID());
return true;
}
static bool HandleChangeWeather(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
// Weather is OFF
if (!sWorld->getBoolConfig(CONFIG_WEATHER))
{
handler->SendSysMessage(LANG_WEATHER_DISABLED);
handler->SetSentErrorMessage(true);
return false;
}
// *Change the weather of a cell
char const* px = strtok((char*)args, " ");
char const* py = strtok(NULL, " ");
if (!px || !py)
return false;
uint32 type = uint32(atoi(px)); //0 to 3, 0: fine, 1: rain, 2: snow, 3: sand
float grade = float(atof(py)); //0 to 1, sending -1 is instand good weather
Player* player = handler->GetSession()->GetPlayer();
uint32 zoneid = player->GetZoneId();
Weather* weather = WeatherMgr::FindWeather(zoneid);
if (!weather)
weather = WeatherMgr::AddWeather(zoneid);
if (!weather)
{
handler->SendSysMessage(LANG_NO_WEATHER);
handler->SetSentErrorMessage(true);
return false;
}
weather->SetWeather(WeatherType(type), grade);
return true;
}
static bool HandleSetSkillCommand(ChatHandler* handler, char const* args)
{
// number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r
char const* skillStr = handler->extractKeyFromLink((char*)args, "Hskill");
if (!skillStr)
return false;
char const* levelStr = strtok(NULL, " ");
if (!levelStr)
return false;
char const* maxPureSkill = strtok(NULL, " ");
int32 skill = atoi(skillStr);
if (skill <= 0)
{
handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
handler->SetSentErrorMessage(true);
return false;
}
int32 level = uint32(atol(levelStr));
Player* target = handler->getSelectedPlayer();
if (!target)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
return false;
}
SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skill);
if (!skillLine)
{
handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
handler->SetSentErrorMessage(true);
return false;
}
std::string tNameLink = handler->GetNameLink(target);
if (!target->GetSkillValue(skill))
{
handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name);
handler->SetSentErrorMessage(true);
return false;
}
uint16 max = maxPureSkill ? atol (maxPureSkill) : target->GetPureMaxSkillValue(skill);
if (level <= 0 || level > max || max <= 0)
return false;
target->SetSkill(skill, target->GetSkillStep(skill), level, max);
handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, tNameLink.c_str(), level, max);
return true;
}
// show info of player
static bool HandlePInfoCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
std::string targetName;
uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER);
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
{
target = sObjectMgr->GetPlayerByLowGUID(parseGUID);
targetGuid = parseGUID;
}
else if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
uint32 accId = 0;
uint32 money = 0;
uint32 totalPlayerTime = 0;
uint8 level = 0;
uint32 latency = 0;
uint8 race;
uint8 Class;
int64 muteTime = 0;
int64 banTime = -1;
uint32 mapId;
uint32 areaId;
uint32 phase = 0;
// get additional information from Player object
if (target)
{
// check online security
if (handler->HasLowerSecurity(target, 0))
return false;
accId = target->GetSession()->GetAccountId();
money = target->GetMoney();
totalPlayerTime = target->GetTotalPlayedTime();
level = target->getLevel();
latency = target->GetSession()->GetLatency();
race = target->getRace();
Class = target->getClass();
muteTime = target->GetSession()->m_muteTime;
mapId = target->GetMapId();
areaId = target->GetAreaId();
phase = target->GetPhaseMask();
}
// get additional information from DB
else
{
// check offline security
if (handler->HasLowerSecurity(NULL, targetGuid))
return false;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO);
stmt->setUInt32(0, GUID_LOPART(targetGuid));
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
return false;
Field* fields = result->Fetch();
totalPlayerTime = fields[0].GetUInt32();
level = fields[1].GetUInt8();
money = fields[2].GetUInt32();
accId = fields[3].GetUInt32();
race = fields[4].GetUInt8();
Class = fields[5].GetUInt8();
mapId = fields[6].GetUInt16();
areaId = fields[7].GetUInt16();
}
std::string userName = handler->GetTrinityString(LANG_ERROR);
std::string eMail = handler->GetTrinityString(LANG_ERROR);
std::string lastIp = handler->GetTrinityString(LANG_ERROR);
uint32 security = 0;
std::string lastLogin = handler->GetTrinityString(LANG_ERROR);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
stmt->setInt32(0, int32(realmID));
stmt->setUInt32(1, accId);
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)
{
Field* fields = result->Fetch();
userName = fields[0].GetString();
security = fields[1].GetUInt8();
eMail = fields[2].GetString();
muteTime = fields[5].GetUInt64();
if (eMail.empty())
eMail = "-";
if (!handler->GetSession() || handler->GetSession()->GetSecurity() >= AccountTypes(security))
{
lastIp = fields[3].GetString();
lastLogin = fields[4].GetString();
uint32 ip = inet_addr(lastIp.c_str());
#if TRINITY_ENDIAN == BIGENDIAN
EndianConvertReverse(ip);
#endif
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY);
stmt->setUInt32(0, ip);
PreparedQueryResult result2 = WorldDatabase.Query(stmt);
if (result2)
{
Field* fields2 = result2->Fetch();
lastIp.append(" (");
lastIp.append(fields2[0].GetString());
lastIp.append(")");
}
}
else
{
lastIp = "-";
lastLogin = "-";
}
}
std::string nameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_PINFO_ACCOUNT, (target ? "" : handler->GetTrinityString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(targetGuid), userName.c_str(), accId, eMail.c_str(), security, lastIp.c_str(), lastLogin.c_str(), latency);
std::string bannedby = "unknown";
std::string banreason = "";
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
stmt->setUInt32(0, accId);
PreparedQueryResult result2 = LoginDatabase.Query(stmt);
if (!result2)
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS);
stmt->setUInt32(0, GUID_LOPART(targetGuid));
result2 = CharacterDatabase.Query(stmt);
}
if (result2)
{
Field* fields = result2->Fetch();
banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32());
bannedby = fields[2].GetString();
banreason = fields[3].GetString();
}
if (muteTime > 0)
handler->PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str());
if (banTime >= 0)
handler->PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str());
std::string raceStr, ClassStr;
switch (race)
{
case RACE_HUMAN:
raceStr = "Human";
break;
case RACE_ORC:
raceStr = "Orc";
break;
case RACE_DWARF:
raceStr = "Dwarf";
break;
case RACE_NIGHTELF:
raceStr = "Night Elf";
break;
case RACE_UNDEAD_PLAYER:
raceStr = "Undead";
break;
case RACE_TAUREN:
raceStr = "Tauren";
break;
case RACE_GNOME:
raceStr = "Gnome";
break;
case RACE_TROLL:
raceStr = "Troll";
break;
case RACE_BLOODELF:
raceStr = "Blood Elf";
break;
case RACE_DRAENEI:
raceStr = "Draenei";
break;
case RACE_GOBLIN:
raceStr = "Goblin";
break;
case RACE_WORGEN:
raceStr = "Worgen";
break;
case RACE_PANDAREN_ALLI:
raceStr = "Pandaren alliance";
break;
case RACE_PANDAREN_HORDE:
raceStr = "Pandaren horde";
break;
case RACE_PANDAREN_NEUTRAL:
raceStr = "Pandaren neutral";
break;
}
switch (Class)
{
case CLASS_WARRIOR:
ClassStr = "Warrior";
break;
case CLASS_PALADIN:
ClassStr = "Paladin";
break;
case CLASS_HUNTER:
ClassStr = "Hunter";
break;
case CLASS_ROGUE:
ClassStr = "Rogue";
break;
case CLASS_PRIEST:
ClassStr = "Priest";
break;
case CLASS_DEATH_KNIGHT:
ClassStr = "Death Knight";
break;
case CLASS_SHAMAN:
ClassStr = "Shaman";
break;
case CLASS_MAGE:
ClassStr = "Mage";
break;
case CLASS_WARLOCK:
ClassStr = "Warlock";
break;
case CLASS_MONK:
ClassStr = "Monk";
break;
case CLASS_DRUID:
ClassStr = "Druid";
break;
}
std::string timeStr = secsToTimeString(totalPlayerTime, true, true);
uint32 gold = money /GOLD;
uint32 silv = (money % GOLD) / SILVER;
uint32 copp = (money % GOLD) % SILVER;
handler->PSendSysMessage(LANG_PINFO_LEVEL, raceStr.c_str(), ClassStr.c_str(), timeStr.c_str(), level, gold, silv, copp);
// Add map, zone, subzone and phase to output
std::string areaName = "<unknown>";
std::string zoneName = "";
MapEntry const* map = sMapStore.LookupEntry(mapId);
AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
if (area)
{
areaName = area->area_name;
AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
if (zone)
zoneName = zone->area_name;
}
if (target)
{
if (!zoneName.empty())
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, zoneName.c_str(), areaName.c_str(), phase);
else
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, areaName.c_str(), "<unknown>", phase);
}
else
handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name, areaName.c_str());
return true;
}
static bool HandleRespawnCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
// accept only explicitly selected target (not implicitly self targeting case)
Unit* target = handler->getSelectedUnit();
if (player->GetSelection() && target)
{
if (target->GetTypeId() != TYPEID_UNIT || target->isPet())
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
if (target->isDead())
target->ToCreature()->Respawn();
return true;
}
CellCoord p(WoWSource::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()));
Cell cell(p);
cell.SetNoCreate();
WoWSource::RespawnDo u_do;
WoWSource::WorldObjectWorker<WoWSource::RespawnDo> worker(player, u_do);
TypeContainerVisitor<WoWSource::WorldObjectWorker<WoWSource::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange());
return true;
}
// mute player for some times
static bool HandleMuteCommand(ChatHandler* handler, char const* args)
{
char* nameStr;
char* delayStr;
handler->extractOptFirstArg((char*)args, &nameStr, &delayStr);
if (!delayStr)
return false;
char const* muteReason = strtok(NULL, "\r");
std::string muteReasonStr = "No reason";
if (muteReason != NULL)
muteReasonStr = muteReason;
Player* target;
uint64 targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
return false;
uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
// find only player from same account if any
if (!target)
if (WorldSession* session = sWorld->FindSession(accountId))
target = session->GetPlayer();
uint32 notSpeakTime = uint32(atoi(delayStr));
// must have strong lesser security level
if (handler->HasLowerSecurity (target, targetGuid, true))
return false;
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
if (target)
{
// Target is online, mute will be in effect right away.
int64 muteTime = time(NULL) + notSpeakTime * MINUTE;
target->GetSession()->m_muteTime = muteTime;
stmt->setInt64(0, muteTime);
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteReasonStr.c_str());
}
else
{
// Target is offline, mute will be in effect starting from the next login.
int32 muteTime = -int32(notSpeakTime * MINUTE);
stmt->setInt64(0, muteTime);
}
stmt->setUInt32(1, accountId);
LoginDatabase.Execute(stmt);
std::string nameLink = handler->playerLink(targetName);
handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str());
if (sWorld->getBoolConfig(CONFIG_ANNOUNCE_MUTE))
{
std::string announce;
announce = "The character '";
if (nameStr) announce += nameStr;
announce += "' was muted for ";
if (delayStr) announce += delayStr;
announce += " minutes by the character '";
announce += handler->GetSession()? handler->GetSession()->GetPlayerName(): "";
announce += "'. The reason is: ";
announce += muteReasonStr;
char buff[2048];
sprintf(buff, handler->GetTrinityString(LANG_SYSTEMMESSAGE), announce.c_str());
sWorld->SendServerMessage(SERVER_MSG_STRING, buff);
}
return true;
}
// unmute player
static bool HandleUnmuteCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
// find only player from same account if any
if (!target)
if (WorldSession* session = sWorld->FindSession(accountId))
target = session->GetPlayer();
// must have strong lesser security level
if (handler->HasLowerSecurity (target, targetGuid, true))
return false;
if (target)
{
if (target->CanSpeak())
{
handler->SendSysMessage(LANG_CHAT_ALREADY_ENABLED);
handler->SetSentErrorMessage(true);
return false;
}
target->GetSession()->m_muteTime = 0;
}
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
stmt->setInt64(0, 0);
stmt->setUInt32(1, accountId);
LoginDatabase.Execute(stmt);
if (target)
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_ENABLED);
std::string nameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_YOU_ENABLE_CHAT, nameLink.c_str());
return true;
}
static bool HandleMovegensCommand(ChatHandler* handler, char const* /*args*/)
{
Unit* unit = handler->getSelectedUnit();
if (!unit)
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
handler->PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUIDLow());
MotionMaster* motionMaster = unit->GetMotionMaster();
float x, y, z;
motionMaster->GetDestination(x, y, z);
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
{
MovementGenerator* movementGenerator = motionMaster->GetMotionSlot(i);
if (!movementGenerator)
{
handler->SendSysMessage("Empty");
continue;
}
switch (movementGenerator->GetMovementGeneratorType())
{
case IDLE_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_IDLE);
break;
case RANDOM_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_RANDOM);
break;
case WAYPOINT_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_WAYPOINT);
break;
case ANIMAL_RANDOM_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_ANIMAL_RANDOM);
break;
case CONFUSED_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_CONFUSED);
break;
case CHASE_MOTION_TYPE:
{
Unit* target = NULL;
if (unit->GetTypeId() == TYPEID_PLAYER)
target = static_cast<ChaseMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
else
target = static_cast<ChaseMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
if (!target)
handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
else if (target->GetTypeId() == TYPEID_PLAYER)
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUIDLow());
else
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUIDLow());
break;
}
case FOLLOW_MOTION_TYPE:
{
Unit* target = NULL;
if (unit->GetTypeId() == TYPEID_PLAYER)
target = static_cast<FollowMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
else
target = static_cast<FollowMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
if (!target)
handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
else if (target->GetTypeId() == TYPEID_PLAYER)
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUIDLow());
else
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUIDLow());
break;
}
case HOME_MOTION_TYPE:
{
if (unit->GetTypeId() == TYPEID_UNIT)
handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
else
handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
break;
}
case FLIGHT_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_FLIGHT);
break;
case POINT_MOTION_TYPE:
{
handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
break;
}
case FLEEING_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_FEAR);
break;
case DISTRACT_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_DISTRACT);
break;
case EFFECT_MOTION_TYPE:
handler->SendSysMessage(LANG_MOVEGENS_EFFECT);
break;
default:
handler->PSendSysMessage(LANG_MOVEGENS_UNKNOWN, movementGenerator->GetMovementGeneratorType());
break;
}
}
return true;
}
/*
ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator
Without this function 3rd party scripting library will get linking errors (unresolved external)
when attempting to use the PointMovementGenerator
*/
static bool HandleComeToMeCommand(ChatHandler* handler, char const* args)
{
char const* newFlagStr = strtok((char*)args, " ");
if (!newFlagStr)
return false;
Creature* caster = handler->getSelectedCreature();
if (!caster)
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
Player* player = handler->GetSession()->GetPlayer();
caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
return true;
}
static bool HandleDamageTestCommand(ChatHandler* handler, char const* args)
{
Unit* target = handler->GetSession()->GetPlayer();
SpellSchoolMask schoolmask = SPELL_SCHOOL_MASK_NORMAL;
uint32 damage = 0;
uint32 absorb = 0;
uint32 resist = 0;
handler->GetSession()->GetPlayer()->SendAttackStateUpdate(HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
return true;
}
static bool HandleBlackMarketWon(ChatHandler* handler, char const* args)
{
uint32 a1 = 1;
uint32 a2 = 1;
uint32 a3 = 1;
WorldPacket data(SMSG_BLACKMARKET_WON, 12);
data << uint32(a1);
data << uint32(a2);
data << uint32(a3);
handler->GetSession()->SendPacket(&data);
return true;
}
static bool HandleLfgStatus(ChatHandler* handler, char const* args)
{
Player* player = handler->GetSession()->GetPlayer();
LfgUpdateData updateData = sLFGMgr->GetLfgStatus(player->GetGUID());
sLFGMgr->SendUpdateStatus(player, updateData);
return true;
}
static bool HandleSetArchCommand(ChatHandler* handler, char const* args)
{
char* str = strtok((char*)args, " ");
uint32 field = atoi(str);
char* str2 = strtok(NULL, " ");
uint32 value = atoi(str);
handler->GetSession()->GetPlayer()->SetDynamicUInt32Value(PLAYER_DYNAMIC_RESEARCH_SITES, field, value);
return true;
}
static bool HandleSendLootRollCommand(ChatHandler* handler, char const* args)
{
Item* item = handler->GetSession()->GetPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
if (!item)
return false;
uint32 itementry = item->GetEntry();
uint32 itemcount = 58981;
uint32 unk32_3 = 14095;
uint32 unk32_4 = 53434;
uint32 unk32_5 = 49267;
WorldPacket data(SMSG_LOOT_ALL_PASSED, (8 + 4 + 8 + 4 + 4 + 4 + 1 + 1 + 1));
ObjectGuid target = item->GetGUID();
data.WriteBit(target[2]);
data.WriteBit(target[7]);
data.WriteBit(!false);
data.WriteBit(target[1]);
data.WriteBit(target[0]);
data.WriteBit(!true);
data.WriteBit(target[4]);
data.WriteBit(false);
data.WriteBit(target[6]);
data.WriteBits(0, 2);
data.WriteBits(5, 3);
data.WriteBit(target[5]);
data.WriteBit(target[3]);
data.FlushBits();
data << itementry;
data << itemcount;
data.WriteByteSeq(target[5]);
data.WriteByteSeq(target[4]);
data.WriteByteSeq(target[3]);
data.WriteByteSeq(target[1]);
if (false)
data << uint8(1);
data << unk32_3;
data.WriteByteSeq(target[0]);
if (true)
data << uint8(1);
data << unk32_4;
data.WriteByteSeq(target[7]);
data << unk32_4;
data.WriteByteSeq(target[6]);
data.WriteByteSeq(target[2]);
data << uint32(0); // unk bytes
handler->GetSession()->SendPacket(&data);
return true;
}
static bool HandleMirrorTimerStartCommand(ChatHandler* handler, char const* args)
{
MirrorTimerType type = BREATH_TIMER;
uint32 max = 180000;
WorldPacket data(SMSG_START_MIRROR_TIMER, (21));
data << max;
data << uint32(0); // spell id
data << max;
data << int32(-1);
data << uint32(type);
data.WriteBit(0);
handler->GetSession()->SendPacket(&data);
return true;
}
static bool HandleMirrorTimerStopCommand(ChatHandler* handler, char const* args)
{
MirrorTimerType type = BREATH_TIMER;
WorldPacket data(SMSG_STOP_MIRROR_TIMER, 4);
data << uint32(type);
handler->GetSession()->SendPacket(&data);
return true;
}
static bool HandleMailTestCommand(ChatHandler* handler, char const* args)
{
uint32 mailId = 1;
MailResponseType mailAction = MAIL_SEND;
MailResponseResult mailError = MAIL_OK;
uint32 equipError = 0;
uint32 item_guid = 0;
uint32 item_count = 0;
////handler->GetSession()->GetPlayer()->SendNewMail();
handler->GetSession()->GetPlayer()->SendMailResult(mailId, mailAction, mailError, equipError, item_guid, item_count);
return true;
}
static bool HandleDamageCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
char* str = strtok((char*)args, " ");
if (strcmp(str, "go") == 0)
{
char* guidStr = strtok(NULL, " ");
if (!guidStr)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
int32 guid = atoi(guidStr);
if (!guid)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
char* damageStr = strtok(NULL, " ");
if (!damageStr)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
int32 damage = atoi(damageStr);
if (!damage)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
if (Player* player = handler->GetSession()->GetPlayer())
{
GameObject* go = NULL;
if (GameObjectData const* goData = sObjectMgr->GetGOData(guid))
go = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guid, goData->id);
if (!go)
{
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guid);
handler->SetSentErrorMessage(true);
return false;
}
if (!go->IsDestructibleBuilding())
{
handler->SendSysMessage(LANG_INVALID_GAMEOBJECT_TYPE);
handler->SetSentErrorMessage(true);
return false;
}
go->ModifyHealth(-damage, player);
handler->PSendSysMessage(LANG_GAMEOBJECT_DAMAGED, go->GetName(), guid, -damage, go->GetGOValue()->Building.Health);
}
return true;
}
Unit* target = handler->getSelectedUnit();
if (!target || !handler->GetSession()->GetPlayer()->GetSelection())
{
handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
if (target->GetTypeId() == TYPEID_PLAYER)
{
if (handler->HasLowerSecurity((Player*)target, 0, false))
return false;
}
if (!target->isAlive())
return true;
char* damageStr = strtok((char*)args, " ");
if (!damageStr)
return false;
int32 damage_int = atoi((char*)damageStr);
if (damage_int <= 0)
return true;
uint32 damage = damage_int;
char* schoolStr = strtok((char*)NULL, " ");
// flat melee damage without resistence/etc reduction
if (!schoolStr)
{
handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
if (target != handler->GetSession()->GetPlayer())
handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0);
return true;
}
uint32 school = schoolStr ? atoi((char*)schoolStr) : SPELL_SCHOOL_NORMAL;
if (school >= MAX_SPELL_SCHOOL)
return false;
SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);
if (Unit::IsDamageReducedByArmor(schoolmask))
damage = handler->GetSession()->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK);
char* spellStr = strtok((char*)NULL, " ");
// melee damage by specific school
if (!spellStr)
{
uint32 absorb = 0;
uint32 resist = 0;
handler->GetSession()->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
if (damage <= absorb + resist)
return true;
damage -= absorb + resist;
handler->GetSession()->GetPlayer()->DealDamageMods(target, damage, &absorb);
handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
return true;
}
// non-melee damage
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellid = handler->extractSpellIdFromLink((char*)args);
if (!spellid || !sSpellMgr->GetSpellInfo(spellid))
return false;
handler->GetSession()->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage);
return true;
}
static bool HandleCombatStopCommand(ChatHandler* handler, char const* args)
{
Player* target = NULL;
if (args && strlen(args) > 0)
{
target = sObjectAccessor->FindPlayerByName(args);
if (!target)
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
handler->SetSentErrorMessage(true);
return false;
}
}
if (!target)
{
if (!handler->extractPlayerTarget((char*)args, &target))
return false;
}
// check online security
if (handler->HasLowerSecurity(target, 0))
return false;
target->CombatStop();
target->getHostileRefManager().deleteReferences();
return true;
}
static bool HandleFlushArenaPointsCommand(ChatHandler* /*handler*/, char const* /*args*/)
{
//sArenaTeamMgr->DistributeArenaPoints();
return true;
}
static bool HandleRepairitemsCommand(ChatHandler* handler, char const* args)
{
Player* target;
if (!handler->extractPlayerTarget((char*)args, &target))
return false;
// check online security
if (handler->HasLowerSecurity(target, 0))
return false;
// Repair items
target->DurabilityRepairAll(false, 0, false);
handler->PSendSysMessage(LANG_YOU_REPAIR_ITEMS, handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, handler->GetNameLink().c_str());
return true;
}
// Send mail by command
static bool HandleSendMailCommand(ChatHandler* handler, char const* args)
{
// format: name "subject text" "mail text"
Player* target;
uint64 targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
char* tail1 = strtok(NULL, "");
if (!tail1)
return false;
char const* msgSubject = handler->extractQuotedArg(tail1);
if (!msgSubject)
return false;
char* tail2 = strtok(NULL, "");
if (!tail2)
return false;
char const* msgText = handler->extractQuotedArg(tail2);
if (!msgText)
return false;
// msgSubject, msgText isn't NUL after prev. check
std::string subject = msgSubject;
std::string text = msgText;
// from console show not existed sender
MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
//- TODO: Fix poor design
SQLTransaction trans = CharacterDatabase.BeginTransaction();
MailDraft(subject, text)
.SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender);
CharacterDatabase.CommitTransaction(trans);
std::string nameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
return true;
}
// Send items by mail
static bool HandleSendItemsCommand(ChatHandler* handler, char const* args)
{
// format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12]
Player* receiver;
uint64 receiverGuid;
std::string receiverName;
if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName))
return false;
char* tail1 = strtok(NULL, "");
if (!tail1)
return false;
char const* msgSubject = handler->extractQuotedArg(tail1);
if (!msgSubject)
return false;
char* tail2 = strtok(NULL, "");
if (!tail2)
return false;
char const* msgText = handler->extractQuotedArg(tail2);
if (!msgText)
return false;
// msgSubject, msgText isn't NUL after prev. check
std::string subject = msgSubject;
std::string text = msgText;
// extract items
typedef std::pair<uint32, uint32> ItemPair;
typedef std::list< ItemPair > ItemPairs;
ItemPairs items;
// get all tail string
char* tail = strtok(NULL, "");
// get from tail next item str
while (char* itemStr = strtok(tail, " "))
{
// and get new tail
tail = strtok(NULL, "");
// parse item str
char const* itemIdStr = strtok(itemStr, ":");
char const* itemCountStr = strtok(NULL, " ");
uint32 itemId = atoi(itemIdStr);
if (!itemId)
return false;
ItemTemplate const* item_proto = sObjectMgr->GetItemTemplate(itemId);
if (!item_proto)
{
handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
handler->SetSentErrorMessage(true);
return false;
}
uint32 itemCount = itemCountStr ? atoi(itemCountStr) : 1;
if (itemCount < 1 || (item_proto->MaxCount > 0 && itemCount > uint32(item_proto->MaxCount)))
{
handler->PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, itemCount, itemId);
handler->SetSentErrorMessage(true);
return false;
}
while (itemCount > item_proto->GetMaxStackSize())
{
items.push_back(ItemPair(itemId, item_proto->GetMaxStackSize()));
itemCount -= item_proto->GetMaxStackSize();
}
items.push_back(ItemPair(itemId, itemCount));
if (items.size() > MAX_MAIL_ITEMS)
{
handler->PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS);
handler->SetSentErrorMessage(true);
return false;
}
}
// from console show not existed sender
MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
// fill mail
MailDraft draft(subject, text);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr)
{
if (Item* item = Item::CreateItem(itr->first, itr->second, handler->GetSession() ? handler->GetSession()->GetPlayer() : 0))
{
item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted
draft.AddItem(item);
}
}
draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
CharacterDatabase.CommitTransaction(trans);
std::string nameLink = handler->playerLink(receiverName);
handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
return true;
}
/// Send money by mail
static bool HandleSendMoneyCommand(ChatHandler* handler, char const* args)
{
/// format: name "subject text" "mail text" money
Player* receiver;
uint64 receiverGuid;
std::string receiverName;
if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName))
return false;
char* tail1 = strtok(NULL, "");
if (!tail1)
return false;
char* msgSubject = handler->extractQuotedArg(tail1);
if (!msgSubject)
return false;
char* tail2 = strtok(NULL, "");
if (!tail2)
return false;
char* msgText = handler->extractQuotedArg(tail2);
if (!msgText)
return false;
char* moneyStr = strtok(NULL, "");
int32 money = moneyStr ? atoi(moneyStr) : 0;
if (money <= 0)
return false;
// msgSubject, msgText isn't NUL after prev. check
std::string subject = msgSubject;
std::string text = msgText;
// from console show not existed sender
MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
MailDraft(subject, text)
.AddMoney(money)
.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
CharacterDatabase.CommitTransaction(trans);
std::string nameLink = handler->playerLink(receiverName);
handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
return true;
}
/// Send a message to a player in game
static bool HandleSendMessageCommand(ChatHandler* handler, char const* args)
{
/// - Find the player
Player* player;
if (!handler->extractPlayerTarget((char*)args, &player))
return false;
char* msgStr = strtok(NULL, "");
if (!msgStr)
return false;
///- Check that he is not logging out.
if (player->GetSession()->isLogingOut())
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
handler->SetSentErrorMessage(true);
return false;
}
/// - Send the message
// Use SendAreaTriggerMessage for fastest delivery.
player->GetSession()->SendAreaTriggerMessage("%s", msgStr);
player->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r");
// Confirmation message
std::string nameLink = handler->GetNameLink(player);
handler->PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msgStr);
return true;
}
static bool HandleCreatePetCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
Creature* creatureTarget = handler->getSelectedCreature();
if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
{
handler->PSendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
CreatureTemplate const* creatrueTemplate = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry());
// Creatures with family 0 crashes the server
if (!creatrueTemplate->family)
{
handler->PSendSysMessage("This creature cannot be tamed. (family id: 0).");
handler->SetSentErrorMessage(true);
return false;
}
if (player->GetPetGUID())
{
handler->PSendSysMessage("You already have a pet");
handler->SetSentErrorMessage(true);
return false;
}
// Everything looks OK, create new pet
Pet* pet = new Pet(player, HUNTER_PET);
if (!pet->CreateBaseAtCreature(creatureTarget))
{
delete pet;
handler->PSendSysMessage("Error 1");
return false;
}
creatureTarget->setDeathState(JUST_DIED);
creatureTarget->RemoveCorpse();
creatureTarget->SetHealth(0); // just for nice GM-mode view
pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction());
if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
{
sLog->outError(LOG_FILTER_GENERAL, "InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
handler->PSendSysMessage("Error 2");
delete pet;
return false;
}
// prepare visual effect for levelup
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
// this enables pet details window (Shift+P)
pet->InitPetCreateSpells();
pet->SetFullHealth();
pet->GetMap()->AddToMap(pet->ToCreature());
// visual effect for levelup
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel());
player->SetMinion(pet, true, PET_SLOT_UNK_SLOT);
pet->SavePetToDB(PET_SLOT_ACTUAL_PET_SLOT);
player->PetSpellInitialize();
return true;
}
static bool HandlePetLearnCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
Player* player = handler->GetSession()->GetPlayer();
Pet* pet = player->GetPet();
if (!pet)
{
handler->PSendSysMessage("You have no pet");
handler->SetSentErrorMessage(true);
return false;
}
uint32 spellId = handler->extractSpellIdFromLink((char*)args);
if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
return false;
// Check if pet already has it
if (pet->HasSpell(spellId))
{
handler->PSendSysMessage("Pet already has spell: %u", spellId);
handler->SetSentErrorMessage(true);
return false;
}
// Check if spell is valid
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo))
{
handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
handler->SetSentErrorMessage(true);
return false;
}
pet->learnSpell(spellId);
handler->PSendSysMessage("Pet has learned spell %u", spellId);
return true;
}
static bool HandlePetUnlearnCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
Player* player = handler->GetSession()->GetPlayer();
Pet* pet = player->GetPet();
if (!pet)
{
handler->PSendSysMessage("You have no pet");
handler->SetSentErrorMessage(true);
return false;
}
uint32 spellId = handler->extractSpellIdFromLink((char*)args);
if (pet->HasSpell(spellId))
pet->removeSpell(spellId, false);
else
handler->PSendSysMessage("Pet doesn't have that spell");
return true;
}
static bool HandleFreezeCommand(ChatHandler* handler, char const* args)
{
std::string name;
Player* player;
char const* TargetName = strtok((char*)args, " "); // get entered name
if (!TargetName) // if no name entered use target
{
player = handler->getSelectedPlayer();
if (player) //prevent crash with creature as target
{
name = player->GetName();
normalizePlayerName(name);
}
}
else // if name entered
{
name = TargetName;
normalizePlayerName(name);
player = sObjectAccessor->FindPlayerByName(name.c_str());
}
if (!player)
{
handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
return true;
}
if (player == handler->GetSession()->GetPlayer())
{
handler->SendSysMessage(LANG_COMMAND_FREEZE_ERROR);
return true;
}
// effect
if (player && (player != handler->GetSession()->GetPlayer()))
{
handler->PSendSysMessage(LANG_COMMAND_FREEZE, name.c_str());
// stop combat + make player unattackable + duel stop + stop some spells
player->setFaction(35);
player->CombatStop();
if (player->IsNonMeleeSpellCasted(true))
player->InterruptNonMeleeSpells(true);
player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
// if player class = hunter || warlock remove pet if alive
if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK))
{
if (Pet* pet = player->GetPet())
{
pet->SavePetToDB(PET_SLOT_ACTUAL_PET_SLOT);
// not let dismiss dead pet
if (pet && pet->isAlive())
player->RemovePet(pet, PET_SLOT_HUNTER_FIRST, false, pet->m_Stampeded);
}
}
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(9454))
Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player, spellInfo->spellPower);
// save player
player->SaveToDB();
}
return true;
}
static bool HandleUnFreezeCommand(ChatHandler* handler, char const*args)
{
std::string name;
Player* player;
char* targetName = strtok((char*)args, " "); // Get entered name
if (targetName)
{
name = targetName;
normalizePlayerName(name);
player = sObjectAccessor->FindPlayerByName(name.c_str());
}
else // If no name was entered - use target
{
player = handler->getSelectedPlayer();
if (player)
name = player->GetName();
}
if (player)
{
handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
// Reset player faction + allow combat + allow duels
player->setFactionForRace(player->getRace());
player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
// Remove Freeze spell (allowing movement and spells)
player->RemoveAurasDueToSpell(9454);
// Save player
player->SaveToDB();
}
else
{
if (targetName)
{
// Check for offline players
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME);
stmt->setString(0, name);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
return true;
}
// If player found: delete his freeze aura
Field* fields = result->Fetch();
uint32 lowGuid = fields[0].GetUInt32();
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
stmt->setUInt32(0, lowGuid);
CharacterDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
return true;
}
else
{
handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
return true;
}
}
return true;
}
static bool HandleListFreezeCommand(ChatHandler* handler, char const* /*args*/)
{
// Get names from DB
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
handler->SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS);
return true;
}
// Header of the names
handler->PSendSysMessage(LANG_COMMAND_LIST_FREEZE);
// Output of the results
do
{
Field* fields = result->Fetch();
std::string player = fields[0].GetString();
handler->PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, player.c_str());
}
while (result->NextRow());
return true;
}
static bool HandleGroupLeaderCommand(ChatHandler* handler, char const* args)
{
Player* player = NULL;
Group* group = NULL;
uint64 guid = 0;
char* nameStr = strtok((char*)args, " ");
if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid))
if (group && group->GetLeaderGUID() != guid)
{
group->ChangeLeader(guid);
group->SendUpdate();
}
return true;
}
static bool HandleGroupDisbandCommand(ChatHandler* handler, char const* args)
{
Player* player = NULL;
Group* group = NULL;
uint64 guid = 0;
char* nameStr = strtok((char*)args, " ");
if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid))
if (group)
group->Disband();
return true;
}
static bool HandleGroupRemoveCommand(ChatHandler* handler, char const* args)
{
Player* player = NULL;
Group* group = NULL;
uint64 guid = 0;
char* nameStr = strtok((char*)args, " ");
if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid, true))
if (group)
group->RemoveMember(guid);
return true;
}
static bool HandlePlayAllCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
uint32 soundId = atoi((char*)args);
if (!sSoundEntriesStore.LookupEntry(soundId))
{
handler->PSendSysMessage(LANG_SOUND_NOT_EXIST, soundId);
handler->SetSentErrorMessage(true);
return false;
}
WorldPacket data(SMSG_PLAY_SOUND, 4);
ObjectGuid guid = handler->GetSession()->GetPlayer()->GetGUID();
uint8 bitsOrder[8] = { 1, 6, 7, 5, 4, 3, 0, 2 };
data.WriteBitInOrder(guid, bitsOrder);
data.FlushBits();
data.WriteByteSeq(guid[3]);
data.WriteByteSeq(guid[6]);
data.WriteByteSeq(guid[5]);
data.WriteByteSeq(guid[4]);
data << uint32(soundId);
data.WriteByteSeq(guid[1]);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[7]);
sWorld->SendGlobalMessage(&data);
handler->PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId);
return true;
}
static bool HandlePossessCommand(ChatHandler* handler, char const* /*args*/)
{
Unit* unit = handler->getSelectedUnit();
if (!unit)
return false;
handler->GetSession()->GetPlayer()->CastSpell(unit, 530, true);
return true;
}
static bool HandleUnPossessCommand(ChatHandler* handler, char const* /*args*/)
{
Unit* unit = handler->getSelectedUnit();
if (!unit)
unit = handler->GetSession()->GetPlayer();
unit->RemoveCharmAuras();
return true;
}
static bool HandleBindSightCommand(ChatHandler* handler, char const* /*args*/)
{
Unit* unit = handler->getSelectedUnit();
if (!unit)
return false;
handler->GetSession()->GetPlayer()->CastSpell(unit, 6277, true);
return true;
}
static bool HandleUnbindSightCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
if (player->isPossessing())
return false;
player->StopCastingBindSight();
return true;
}
static bool HandleSelectFactionCommand(ChatHandler* handler, char const* /*args*/)
{
handler->GetSession()->GetPlayer()->ShowNeutralPlayerFactionSelectUI();
return true;
}
};
void AddSC_misc_commandscript()
{
new misc_commandscript();
}
| [
"andra778@yahoo.com"
] | andra778@yahoo.com |
4a0b98d7bbede07d0bdf9a5f520f835f94faefc6 | fc39fb19e9cc22abcf2db6bc5952a8fea0c804c5 | /ext/v8/upstream/2.3.3/src/circular-queue.cc | af650de5e79fcd17b21c94d208322274c9f578f0 | [
"BSD-3-Clause",
"MIT"
] | permissive | aler/therubyracer-heroku | aaa33ab1ac9a16c42382c3164e3391175806a219 | f7c42f8689828c48f2d6e97a0aa1abb942890a60 | refs/heads/master | 2021-01-18T08:38:49.777442 | 2011-02-02T00:16:19 | 2011-02-02T00:16:19 | 1,277,683 | 36 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 5,043 | cc | // Copyright 2010 the V8 project authors. 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.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "v8.h"
#include "circular-queue-inl.h"
namespace v8 {
namespace internal {
SamplingCircularQueue::SamplingCircularQueue(int record_size_in_bytes,
int desired_chunk_size_in_bytes,
int buffer_size_in_chunks)
: record_size_(record_size_in_bytes / sizeof(Cell)),
chunk_size_in_bytes_(desired_chunk_size_in_bytes / record_size_in_bytes *
record_size_in_bytes),
chunk_size_(chunk_size_in_bytes_ / sizeof(Cell)),
buffer_size_(chunk_size_ * buffer_size_in_chunks),
// The distance ensures that producer and consumer never step on
// each other's chunks and helps eviction of produced data from
// the CPU cache (having that chunk size is bigger than the cache.)
producer_consumer_distance_(2 * chunk_size_),
buffer_(NewArray<Cell>(buffer_size_ + 1)) {
ASSERT(buffer_size_in_chunks > 2);
// Only need to keep the first cell of a chunk clean.
for (int i = 0; i < buffer_size_; i += chunk_size_) {
buffer_[i] = kClear;
}
buffer_[buffer_size_] = kEnd;
// Layout producer and consumer position pointers each on their own
// cache lines to avoid cache lines thrashing due to simultaneous
// updates of positions by different processor cores.
const int positions_size =
RoundUp(1, kProcessorCacheLineSize) +
RoundUp(static_cast<int>(sizeof(ProducerPosition)),
kProcessorCacheLineSize) +
RoundUp(static_cast<int>(sizeof(ConsumerPosition)),
kProcessorCacheLineSize);
positions_ = NewArray<byte>(positions_size);
producer_pos_ = reinterpret_cast<ProducerPosition*>(
RoundUp(positions_, kProcessorCacheLineSize));
producer_pos_->enqueue_pos = buffer_;
consumer_pos_ = reinterpret_cast<ConsumerPosition*>(
reinterpret_cast<byte*>(producer_pos_) + kProcessorCacheLineSize);
ASSERT(reinterpret_cast<byte*>(consumer_pos_ + 1) <=
positions_ + positions_size);
consumer_pos_->dequeue_chunk_pos = buffer_;
consumer_pos_->dequeue_chunk_poll_pos = buffer_ + producer_consumer_distance_;
consumer_pos_->dequeue_pos = NULL;
}
SamplingCircularQueue::~SamplingCircularQueue() {
DeleteArray(positions_);
DeleteArray(buffer_);
}
void* SamplingCircularQueue::StartDequeue() {
if (consumer_pos_->dequeue_pos != NULL) {
return consumer_pos_->dequeue_pos;
} else {
if (*consumer_pos_->dequeue_chunk_poll_pos != kClear) {
consumer_pos_->dequeue_pos = consumer_pos_->dequeue_chunk_pos;
consumer_pos_->dequeue_end_pos = consumer_pos_->dequeue_pos + chunk_size_;
return consumer_pos_->dequeue_pos;
} else {
return NULL;
}
}
}
void SamplingCircularQueue::FinishDequeue() {
consumer_pos_->dequeue_pos += record_size_;
if (consumer_pos_->dequeue_pos < consumer_pos_->dequeue_end_pos) return;
// Move to next chunk.
consumer_pos_->dequeue_pos = NULL;
*consumer_pos_->dequeue_chunk_pos = kClear;
consumer_pos_->dequeue_chunk_pos += chunk_size_;
WrapPositionIfNeeded(&consumer_pos_->dequeue_chunk_pos);
consumer_pos_->dequeue_chunk_poll_pos += chunk_size_;
WrapPositionIfNeeded(&consumer_pos_->dequeue_chunk_poll_pos);
}
void SamplingCircularQueue::FlushResidualRecords() {
// Eliminate producer / consumer distance.
consumer_pos_->dequeue_chunk_poll_pos = consumer_pos_->dequeue_chunk_pos;
}
} } // namespace v8::internal
| [
"cowboyd@thefrontside.net"
] | cowboyd@thefrontside.net |
aed16da8b03ed563206a48d6d0ca68faacbf4f4e | 8213da010e50e4bb35f286b30d35ceac01b33992 | /Projects/WebAthl/BoolResultSet.cpp | b41593c644958ab75b48c6f3d2303a2a61a3744f | [
"Apache-2.0"
] | permissive | 15831944/WebAthl | 16f7f24d2bebc16b49f5bfdf60e728d130cc0367 | daf916b169983375022a39645419f79c7f3cbfed | refs/heads/master | 2021-12-04T10:45:33.271953 | 2015-03-14T07:02:36 | 2015-03-14T07:02:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,225 | cpp | // BoolResultSet.cpp : implementation file
//
#include "stdafx.h"
#include "CSV.h"
#include "StringStream.h"
#include "RecordsetEx.h"
#include "BoolResultSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBoolResultSet
IMPLEMENT_DYNAMIC(CBoolResultSet, CRecordsetEx)
CBoolResultSet::CBoolResultSet(CDatabase* pdb)
: CRecordsetEx(pdb)
{
//{{AFX_FIELD_INIT(CBoolResultSet)
m_Result = 0;
m_nFields = 1;
//}}AFX_FIELD_INIT
m_nDefaultType = dynaset;
}
CString CBoolResultSet::GetDefaultConnect()
{
return _T("");
}
CString CBoolResultSet::GetDefaultSQL()
{
return _T("");
}
void CBoolResultSet::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CBoolResultSet)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("[Result]"), m_Result);
//}}AFX_FIELD_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CBoolResultSet diagnostics
#ifdef _DEBUG
void CBoolResultSet::AssertValid() const
{
CRecordsetEx::AssertValid();
}
void CBoolResultSet::Dump(CDumpContext& dc) const
{
CRecordsetEx::Dump(dc);
}
#endif //_DEBUG
| [
"darian.bridge@gmail.com"
] | darian.bridge@gmail.com |
6fc22cb9b87bc8eb480b7d8f659a704b43ac410a | da93228ede8cae317ee74c96592fb4fda5ff7eab | /src/pack.cpp | 073c01d5fc267c9a2734c087008a2d05737fbbd8 | [] | no_license | meersuri/text-compression | be3e48922c510606766b4b156af58816ae787051 | 83429999529fc56f719af9770c7b70c2719c205e | refs/heads/master | 2023-08-07T20:32:37.915782 | 2023-07-24T02:23:21 | 2023-07-24T02:23:21 | 291,274,760 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,424 | cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cassert>
#include<fstream>
#include<cstdio>
#include<unordered_set>
#include<memory>
#include "pack.hpp"
std::shared_ptr<PackedData> pack(const std::vector<std::string>& encoded) {
auto packed = std::make_shared<PackedData>();
packed->content_len = encoded.size();
char chunk = 0;
uint8_t chunk_width = 8;
uint8_t pos = -1;
for (const auto& code: encoded) {
for (int i = 0; i < code.size(); ++i) {
if (pos == chunk_width - 1) {
packed->data.push_back(chunk);
chunk = 0;
pos = -1;
}
chunk <<= 1;
if (code[i] == '1')
chunk |= 1;
++pos;
}
}
if (pos < chunk_width - 1) {
chunk <<= chunk_width - pos - 1;
packed->data.push_back(chunk);
}
return packed;
}
std::vector<std::string> unpack(const std::shared_ptr<PackedData> packed, std::unordered_set<std::string> codes) {
std::vector<std::string> encoded;
uint8_t chunk_width = 8;
std::string code;
for (const char& chunk: packed->data) {
for (int i = 0; i < chunk_width; ++i) {
if (chunk & (1 << chunk_width - i - 1))
code += "1";
else
code += "0";
if (codes.find(code) != codes.end()) {
encoded.emplace_back(code);
code = "";
}
}
}
encoded.resize(packed->content_len);
return encoded;
}
void save_compressed(std::string fpath, const std::vector<std::string> &codebook, const std::shared_ptr<PackedData> packed) {
auto file = std::ofstream(fpath, std::ios::binary);
if (!file.is_open())
throw std::runtime_error("Couldn't open file");
uint64_t file_size = packed->data.size();
uint64_t content_len = packed->content_len;
uint32_t codebook_size = codebook.size();
file.write(reinterpret_cast<const char*>(&file_size), 8);
file.write(reinterpret_cast<const char*>(&content_len), 8);
file.write(reinterpret_cast<const char*>(&codebook_size), 4);
for (const auto &code: codebook) {
assert (code.size() <= 255);
uint8_t code_size = static_cast<uint8_t>(code.size());
file.put(code_size);
}
uint8_t chunk = 0;
uint32_t pos = 0;
uint32_t packed_codebook_size = 0;
for (const auto &code: codebook) {
for (int i = 0; i < code.size(); ++i) {
if (pos == 8) {
file.put(chunk);
pos = 0;
chunk = 0;
packed_codebook_size++;
}
if (code[i] == '1')
chunk |= 1;
pos++;
if (pos < 8)
chunk <<= 1;
}
}
if (pos < 8)
chunk <<= 7 - pos;
file.put(chunk);
packed_codebook_size++;
file.write(packed->data.data(), packed->data.size());
file.put(EOF);
file.close();
auto header_size = 8 + 8 + 4 + codebook.size() + packed_codebook_size;
std::cout << "serialized bytes: " << packed->data.size() << "+" << header_size << std::endl;
}
void save(std::string fpath, const std::vector<char> raw) {
auto file = std::ofstream(fpath, std::ios::binary);
if (!file.is_open())
throw std::runtime_error("Couldn't open file");
file.write(raw.data(), raw.size());
file.put(EOF);
file.close();
}
std::vector<char> load(std::string fpath) {
auto file = std::ifstream(fpath, std::ios::binary);
if (!file.is_open())
throw std::runtime_error("Couldn't open file");
file.seekg(0, std::ios_base::end);
auto file_size = file.tellg();
file.seekg(0, std::ios_base::beg);
std::vector<char> bytes(file_size);
file.read(bytes.data(), file_size);
file.close();
return bytes;
}
int run() {
std::unordered_set<std::string> codes{
"01",
"101",
"1100",
"1110",
"11111"
};
std::vector<std::string> encoded{
"01",
"1110",
"1100",
"1100",
"01",
"11111",
"1100",
"101",
"11111",
"01",
"1110"
};
auto packed = pack(encoded);
std::cout << "packed:\n";
for (const auto& x: packed->data)
std::cout << static_cast<int>(x) << ",";
std::cout << '\n';
return 0;
}
| [
"meersuri@gmail.com"
] | meersuri@gmail.com |
d4655cb6aa32baf19a34125e0b1a18f8bd91dcde | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/cpp-qt5/generated/client/OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties.h | 7229a5892b101ce50d2935cb7b268503db9b73dc | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | C++ | false | false | 1,782 | h | /**
* Adobe Experience Manager OSGI config (AEM) API
* Swagger AEM OSGI is an OpenAPI specification for Adobe Experience Manager (AEM) OSGI Configurations API
*
* OpenAPI spec version: 1.0.0-pre.0
* Contact: opensource@shinesolutions.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties.h
*
*
*/
#ifndef OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties_H_
#define OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties_H_
#include <QJsonObject>
#include "OAIOAIConfigNodePropertyBoolean.h"
#include "OAIObject.h"
namespace OpenAPI {
class OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties: public OAIObject {
public:
OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties();
OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties(QString json);
~OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties();
void init();
void cleanup();
QString asJson () override;
QJsonObject asJsonObject() override;
void fromJsonObject(QJsonObject json) override;
OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties* fromJson(QString jsonString) override;
OAIConfigNodePropertyBoolean* getIsTransactionRecordingEnabled();
void setIsTransactionRecordingEnabled(OAIConfigNodePropertyBoolean* is_transaction_recording_enabled);
virtual bool isSet() override;
private:
OAIConfigNodePropertyBoolean* is_transaction_recording_enabled;
bool m_is_transaction_recording_enabled_isSet;
};
}
#endif /* OAIComAdobeAemTransactionCoreImplTransactionRecorderProperties_H_ */
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
34bd8e18f34a16f9c74549e2c0ca99d82ddf51b7 | 9fd8dfaeb822390c80d5b7b708f935b9a682ff43 | /PraxisWissenC++NewStd/PraxisWissenC++NewStd/PieChartView.cpp | d133887d2fa17c02b65ea106c7c0a08eef90af14 | [] | no_license | Oxid2178/PraxisWissenC-NewStd | 7ad4c88e0ff772a40ab3b651ed8675e46fcfa5e5 | 9e8c64724b9208c75bcee4af580988fc8b25e63d | refs/heads/master | 2020-03-25T23:48:39.754325 | 2018-09-11T15:25:33 | 2018-09-11T15:25:33 | 144,294,069 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 45 | cpp | #include "stdafx.h"
#include "PieChartView.h" | [
"antonio.carlucci@sunrise.ch"
] | antonio.carlucci@sunrise.ch |
30ac5095c8aa06c08e32b2b94348f1884ff43e14 | 8989d2b1129b3993d1e2fe05463307bdee046580 | /H264Extension/src/lib/H264AVCDecoderLib/SliceDecoder.h | 5d42c0982e6758838c67b9210f0b8ab07a4f8708 | [] | no_license | ssah8524/SVC-Layer-multiplexing-demultiplexing | ca74f37a4a593afe2e6dc7fb95ea3b0fed5a6f0d | c50ef87df013536602760cc6b01922ce0ad66ddf | refs/heads/master | 2021-01-17T19:59:10.912529 | 2016-10-23T21:38:20 | 2016-10-23T21:38:20 | 71,729,778 | 3 | 1 | null | 2017-05-03T19:41:22 | 2016-10-23T21:07:05 | C++ | UTF-8 | C++ | false | false | 2,282 | h |
#if !defined(AFX_SLICEDECODER_H__A0183156_A54B_425D_8CF1_D350651F638C__INCLUDED_)
#define AFX_SLICEDECODER_H__A0183156_A54B_425D_8CF1_D350651F638C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "H264AVCCommonLib/ControlMngIf.h"
H264AVC_NAMESPACE_BEGIN
class MbDecoder;
class Frame;
class SliceDecoder
{
protected:
SliceDecoder();
virtual ~SliceDecoder();
public:
static ErrVal create ( SliceDecoder*& rpcSliceDecoder );
ErrVal destroy ();
ErrVal init ( MbDecoder* pcMbDecoder,
ControlMngIf* pcControlMng );
ErrVal uninit ();
ErrVal decode ( SliceHeader& rcSH,
MbDataCtrl* pcMbDataCtrl,
MbDataCtrl* pcMbDataCtrlBase,
Frame* pcFrame,
Frame* pcResidual,
Frame* pcBaseLayer,
Frame* pcBaseLayerResidual,
RefFrameList* pcRefFrameList0,
RefFrameList* pcRefFrameList1,
MbDataCtrl* pcMbDataCtrl0L1,
Bool bReconstructAll );
ErrVal decodeMbAff ( SliceHeader& rcSH,
MbDataCtrl* pcMbDataCtrl,
MbDataCtrl* pcMbDataCtrlBase,
MbDataCtrl* pcMbDataCtrlBaseField,
Frame* pcFrame,
Frame* pcResidual,
Frame* pcBaseLayer,
Frame* pcBaseLayerResidual,
RefFrameList* pcRefFrameList0,
RefFrameList* pcRefFrameList1,
MbDataCtrl* pcMbDataCtrl0L1,
Bool bReconstructAll );
protected:
Bool m_bInitDone;
ControlMngIf* m_pcControlMng;
MbDecoder* m_pcMbDecoder;
};
H264AVC_NAMESPACE_END
#endif // !defined(AFX_SLICEDECODER_H__A0183156_A54B_425D_8CF1_D350651F638C__INCLUDED_)
| [
"amirhs.hosseini@gmail.com"
] | amirhs.hosseini@gmail.com |
9206932c80f2ad4ce1dd2e65d6bbba9fcffb48ef | 1baeafe52f4f014a54fb91081107b147ec1343ab | /Headers/Order.h | 7c0c2217efae7440ed4431a3c2858f8b66f60357 | [
"MIT"
] | permissive | Pladque/Own-Language-FREEDOM- | 7eb26e587b49a92aa081ba2f88aeb75c3f6e0ac7 | 5640d14b4d3d8e53aa69400472bd47caa65b39bd | refs/heads/main | 2023-08-03T16:18:29.052769 | 2021-09-16T20:36:29 | 2021-09-16T20:36:29 | 348,493,312 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,566 | h | #include <deque>
#include "Token.h"
#include "Lexer.h"
#ifndef ORDER_H
#define ORDER_H
class Order
{
public:
std::deque < Token > tokens;
enum Type { term, text, declar, loop_start, loop_stop, if_statement, if_stop, print, printValues, revalue, revalueSTR, skip};
Type type;
std::string GetTypeSTR()
{
switch (type)
{
case term:
return "term";
case declar:
return "declar";
case loop_start:
return "loop_start";
case loop_stop:
return "loop_stop";
case if_statement:
return "if_statement";
case if_stop:
return "if_stop";
case print:
return "print";
case revalue:
return "revalue";
default:
return "Unknown type";
}
}
void printTokens(std::unordered_map<std::string, Token> variables)
{
Lexer lexer("", "");
for (int i = 0; i < tokens.size(); i++)
{
if (tokens[i].Type == lexer.TT_VARNAME)
{
std::cout << variables[tokens[i].Value].Value;
}
else if (tokens[i].Value != "None")
std::cout << tokens[i].Value << ' ';
else
{
bool found = false;
Lexer lexer("", "");
for (auto const& x : lexer.GetOpSymb())
{
if (x.second == tokens[i].Type)
{
std::cout << x.first << ' ';
found = true;
break;
}
}
if (!found)
for (auto const& x : lexer.GetKeyWords())
{
if (x.second == tokens[i].Type)
{
std::cout << x.first << ' ';
break;
}
}
}
}
std::cout << std::endl;
}
};
#endif
| [
"noreply@github.com"
] | noreply@github.com |
7cdc8e65f6d83d31526601d89633baec77c0ea91 | 9335efe35993239fd92f3101876d8660372d9a4e | /Programmers/Lv3/Lv3_가장먼노드.cpp | acd637911f0f7126f0a7e1f06abbe0ac465f0c57 | [] | no_license | Seung-minnn/Programmers-Algorithm-1 | a4bc98e37a4b9f1a22160bdbc6ffa86c2fc52fb6 | 2434eabb0d5aaa9c1c2dabd1a70befad908be576 | refs/heads/master | 2022-04-15T12:05:01.448760 | 2020-03-29T09:09:56 | 2020-03-29T09:09:56 | null | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 1,006 | cpp | #include <string>
#include <vector>
#include <queue>
#include <list>
#include <algorithm>
#include <limits>
using namespace std;
// 다익스트라 알고리즘보다 BFS가 훨씬 빠름.
// 가중치가 1일 때는 BFS를 이용하자!
int solution(int n, vector<vector<int>> edge) {
int answer = 0;
int inf = 0;
vector<list<int> > graph(n+1, list<int>());
vector<int> dist(n+1, 0);
vector<bool> check(n+1, false);
queue<int> q;
for (auto i = edge.begin(); i != edge.end(); i++) { // 1-2, 2-1 두 개로 저장
graph[(*i).front()].push_back((*i).back());
graph[(*i).back()].push_back((*i).front());
}
q.push(1);
check[1] = true;
dist[1] = 0;
while (!q.empty()) {
int start = q.front();
q.pop();
for (auto i : graph[start]) {
if (check[i]==false) {
check[i] = true;
dist[i] = dist[start] + 1;
q.push(i);
}
}
}
sort(dist.begin(), dist.end());
inf = dist.back();
for (int i = 1; i <= n; i++) {
if (dist[i] == inf)
answer++;
}
return answer;
}
| [
"93negaro@gmail.com"
] | 93negaro@gmail.com |
82d59a0e2ee27c5f1cd407c6e76ae9b60915844d | 4cf6c53fa49cbcd74da88edc66bc2ee6314b181a | /util/test/raygrid_dump.h | c7cee58bc771349eef084e09a4ed6c6ce9ac2cdc | [] | no_license | pinzino/wire-cell-toolkit | 5f7acb6c4f7cac7324ef81f4556f65238cf2abd7 | f0ec58c8fa0b6df921861e0e28b37fb78e606e5b | refs/heads/master | 2022-10-31T07:42:15.808564 | 2020-04-29T18:05:08 | 2020-04-29T18:05:08 | 261,223,184 | 0 | 1 | null | 2020-05-04T15:28:01 | 2020-05-04T15:28:00 | null | UTF-8 | C++ | false | false | 1,725 | h |
#include <json/json.h>
class JsonEvent {
const WireCell::RayGrid::Coordinates& coords;
Json::Value blobs, points;
public:
JsonEvent(const WireCell::RayGrid::Coordinates& coords) : coords(coords) {}
void operator()(const Point& pt, double charge=1.0) {
Json::Value jpt;
jpt[0] = pt.x();
jpt[1] = pt.y();
jpt[2] = pt.z();
Json::Value jpv;
jpv["point"] = jpt;
jpv["values"]["charge"] = charge;
points.append(jpv);
}
Json::Value convert(const WireCell::RayGrid::crossing_t& corner,
double x) {
Json::Value jcorner = Json::arrayValue;
auto pt = coords.ray_crossing(corner.first, corner.second);
jcorner.append(x);
jcorner.append(pt.y());
jcorner.append(pt.z());
return jcorner;
}
Json::Value convert(const WireCell::RayGrid::crossings_t& corners,
double x) {
Json::Value jcorners = Json::arrayValue;
for (const auto& corner : corners) {
jcorners.append(convert(corner, x));
}
return jcorners;
}
void operator()(const WireCell::RayGrid::Blob& blob,
double x, double charge=1.0, int slice = 1, int number=0) {
Json::Value jblob;
jblob["points"] = convert(blob.corners(), x);
jblob["values"]["charge"] = charge;
jblob["values"]["slice"] = slice;
jblob["values"]["number"] = number;
blobs.append(jblob);
}
void dump(const std::string& filename) {
Json::Value top;
top["points"] = points;
top["blobs"] = blobs;
ofstream fstr(filename);
fstr << top;
}
};
| [
"brett.viren@gmail.com"
] | brett.viren@gmail.com |
5736606b0b87e4f0adea44d39d02a76958e26880 | 54485318384fccc4031e9ce640cd0ec3b176e52f | /baekjoon/2588.cpp | 12cd7958e304e02d3a65fa4eedc8791857d997e9 | [] | no_license | lazymonday/PS | f67afc2be9b40af861dcd9824c644595f8325a07 | 79750b485727ef46dc6017b582b058c27b4e8fb1 | refs/heads/main | 2023-01-20T08:46:02.561418 | 2020-12-01T14:01:37 | 2020-12-01T14:01:37 | 303,917,059 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 381 | cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int MAX = 1e6;
const int INF = 2e9;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int a, b;
cin >> a >> b;
int bb = b;
while(bb) {
int r = bb % 10;
cout << a * r << "\n";
bb /= 10;
}
cout << a * b;
return 0;
}
| [
"lazymonday@gmail.com"
] | lazymonday@gmail.com |
0a841d37516caec8728036a20473803521e60c0a | 4bcc9806152542ab43fc2cf47c499424f200896c | /tensorflow/lite/delegates/gpu/gl/object_manager.cc | 905454eb1f01eecaa5fd4577d6b7e57be643e2f3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause"
] | permissive | tensorflow/tensorflow | 906276dbafcc70a941026aa5dc50425ef71ee282 | a7f3934a67900720af3d3b15389551483bee50b8 | refs/heads/master | 2023-08-25T04:24:41.611870 | 2023-08-25T04:06:24 | 2023-08-25T04:14:08 | 45,717,250 | 208,740 | 109,943 | Apache-2.0 | 2023-09-14T20:55:50 | 2015-11-07T01:19:20 | C++ | UTF-8 | C++ | false | false | 3,495 | cc | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/lite/delegates/gpu/gl/object_manager.h"
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/types/span.h"
#include "tensorflow/lite/delegates/gpu/common/convert.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
namespace tflite {
namespace gpu {
namespace gl {
absl::Status CreatePHWC4BufferFromTensor(const TensorFloat32& tensor,
GlBuffer* gl_buffer) {
std::vector<float> transposed(GetElementsSizeForPHWC4(tensor.shape));
RETURN_IF_ERROR(
ConvertToPHWC4(tensor.data, tensor.shape, absl::MakeSpan(transposed)));
return CreateReadOnlyShaderStorageBuffer<float>(transposed, gl_buffer);
}
absl::Status CreatePHWC4BufferFromTensorRef(const TensorRef<BHWC>& tensor_ref,
GlBuffer* gl_buffer) {
return CreateReadWriteShaderStorageBuffer<float>(
GetElementsSizeForPHWC4(tensor_ref.shape), gl_buffer);
}
absl::Status CopyFromPHWC4Buffer(const GlBuffer& buffer,
TensorFloat32* tensor) {
return buffer.MappedRead<float>([tensor](absl::Span<const float> data) {
tensor->data.resize(tensor->shape.DimensionsProduct());
return ConvertFromPHWC4(absl::MakeConstSpan(data), tensor->shape,
absl::MakeSpan(tensor->data));
});
}
absl::Status ObjectManager::RegisterBuffer(uint32_t id, GlBuffer buffer) {
if (id >= buffers_.size()) {
buffers_.resize(id + 1);
}
buffers_[id] = std::make_unique<GlBuffer>(std::move(buffer));
return absl::OkStatus();
}
void ObjectManager::RemoveBuffer(uint32_t id) {
if (id < buffers_.size()) {
buffers_[id].reset(nullptr);
}
}
GlBuffer* ObjectManager::FindBuffer(uint32_t id) const {
return id >= buffers_.size() ? nullptr : buffers_[id].get();
}
absl::Status ObjectManager::RegisterTexture(uint32_t id, GlTexture texture) {
if (id >= textures_.size()) {
textures_.resize(id + 1);
}
textures_[id] = std::make_unique<GlTexture>(std::move(texture));
return absl::OkStatus();
}
void ObjectManager::RemoveTexture(uint32_t id) {
if (id < textures_.size()) {
textures_[id].reset(nullptr);
}
}
GlTexture* ObjectManager::FindTexture(uint32_t id) const {
return id >= textures_.size() ? nullptr : textures_[id].get();
}
ObjectsStats ObjectManager::stats() const {
ObjectsStats stats;
for (auto& texture : textures_) {
if (!texture || !texture->has_ownership()) continue;
stats.textures.count++;
stats.textures.total_bytes += texture->bytes_size();
}
for (auto& buffer : buffers_) {
if (!buffer || !buffer->has_ownership()) continue;
stats.buffers.count++;
stats.buffers.total_bytes += buffer->bytes_size();
}
return stats;
}
} // namespace gl
} // namespace gpu
} // namespace tflite
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
e6e148d5a57dabc2618eb9ef159fba22ccf3bd03 | adf4db5421039a7551b8fb24381550d4cbb24b03 | /src/masternodeman.h | f89f3908c9f4ba007b29cd6d65d5b522af1b2048 | [
"MIT"
] | permissive | developertask/RUPEE | 8ea8f9f3f98be94e73a23fb5be5aff25371154a7 | a39a1d8318a50d95235e0d164fa3cf942bb14af8 | refs/heads/master | 2020-03-14T19:29:23.610811 | 2018-05-01T20:53:15 | 2018-05-01T20:53:15 | 131,755,379 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,611 | h | // Copyright (c) 2014-2017 The Dash developers
//---
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef MASTERNODEMAN_H
#define MASTERNODEMAN_H
#include "base58.h"
#include "key.h"
#include "main.h"
#include "masternode.h"
#include "net.h"
#include "sync.h"
#include "util.h"
#define MASTERNODES_DUMP_SECONDS (15 * 60)
#define MASTERNODES_DSEG_SECONDS (3 * 60 * 60)
using namespace std;
class CMasternodeMan;
extern CMasternodeMan mnodeman;
void DumpMasternodes();
/** Access to the MN database (mncache.dat)
*/
class CMasternodeDB
{
private:
boost::filesystem::path pathMN;
std::string strMagicMessage;
public:
enum ReadResult {
Ok,
FileError,
HashReadError,
IncorrectHash,
IncorrectMagicMessage,
IncorrectMagicNumber,
IncorrectFormat
};
CMasternodeDB();
bool Write(const CMasternodeMan& mnodemanToSave);
ReadResult Read(CMasternodeMan& mnodemanToLoad, bool fDryRun = false);
};
class CMasternodeMan
{
private:
// critical section to protect the inner data structures
mutable CCriticalSection cs;
// critical section to protect the inner data structures specifically on messaging
mutable CCriticalSection cs_process_message;
// map to hold all MNs
std::vector<CMasternode> vMasternodes;
// who's asked for the Masternode list and the last time
std::map<CNetAddr, int64_t> mAskedUsForMasternodeList;
// who we asked for the Masternode list and the last time
std::map<CNetAddr, int64_t> mWeAskedForMasternodeList;
// which Masternodes we've asked for
std::map<COutPoint, int64_t> mWeAskedForMasternodeListEntry;
public:
// Keep track of all broadcasts I've seen
map<uint256, CMasternodeBroadcast> mapSeenMasternodeBroadcast;
// Keep track of all pings I've seen
map<uint256, CMasternodePing> mapSeenMasternodePing;
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
LOCK(cs);
READWRITE(vMasternodes);
READWRITE(mAskedUsForMasternodeList);
READWRITE(mWeAskedForMasternodeList);
READWRITE(mWeAskedForMasternodeListEntry);
READWRITE(mapSeenMasternodeBroadcast);
READWRITE(mapSeenMasternodePing);
}
CMasternodeMan();
CMasternodeMan(CMasternodeMan& other);
/// Add an entry
bool Add(CMasternode& mn);
/// Ask (source) node for mnb
void AskForMN(CNode* pnode, CTxIn& vin);
/// Check all Masternodes
void Check();
/// Check all Masternodes and remove inactive
void CheckAndRemove(bool forceExpiredRemoval = false);
/// Clear Masternode vector
void Clear();
int CountEnabled(int protocolVersion = -1);
void CountNetworks(int protocolVersion, int& ipv4, int& ipv6, int& onion);
void DsegUpdate(CNode* pnode);
/// Find an entry
CMasternode* Find(const CScript& payee);
CMasternode* Find(const CTxIn& vin);
CMasternode* Find(const CPubKey& pubKeyMasternode);
/// Find an entry in the masternode list that is next to be paid
CMasternode* GetNextMasternodeInQueueForPayment(int nBlockHeight, bool fFilterSigTime, int& nCount);
/// Find a random entry
CMasternode* FindRandomNotInVec(std::vector<CTxIn>& vecToExclude, int protocolVersion = -1);
/// Get the current winner for this block
CMasternode* GetCurrentMasterNode(int mod = 1, int64_t nBlockHeight = 0, int minProtocol = 0);
std::vector<CMasternode> GetFullMasternodeVector()
{
Check();
return vMasternodes;
}
std::vector<pair<int, CMasternode> > GetMasternodeRanks(int64_t nBlockHeight, int minProtocol = 0);
int GetMasternodeRank(const CTxIn& vin, int64_t nBlockHeight, int minProtocol = 0, bool fOnlyActive = true);
CMasternode* GetMasternodeByRank(int nRank, int64_t nBlockHeight, int minProtocol = 0, bool fOnlyActive = true);
void ProcessMasternodeConnections();
void ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv);
/// Return the number of (unique) Masternodes
int size() { return vMasternodes.size(); }
/// Return the number of Masternodes older than (default) 8000 seconds
int stable_size ();
std::string ToString() const;
void Remove(CTxIn vin);
/// Update masternode list and maps using provided CMasternodeBroadcast
void UpdateMasternodeList(CMasternodeBroadcast mnb);
};
#endif
| [
"shamim.ice.ewu@gmail.com"
] | shamim.ice.ewu@gmail.com |
f7ad885135992d1fa423fee4b72f788c5e6cb959 | 44e2a537ca3472fc3b00a3edd4c22e07e859e40e | /storage/browser/blob/blob_storage_context.h | 3b936397257078352cc95d2dcd15dce3a76cc16d | [
"BSD-3-Clause"
] | permissive | JACB920/chromium | cd6f836f5dbc6b44f4c7836a33ffbbcc8270f4bb | c8af0e6f42e95a02af31801aa386f4feaedb2b46 | refs/heads/master | 2023-02-26T20:36:17.814303 | 2020-01-15T22:11:38 | 2020-01-15T22:11:38 | 234,184,746 | 1 | 0 | null | 2020-01-15T22:18:50 | 2020-01-15T22:18:49 | null | UTF-8 | C++ | false | false | 11,370 | h | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef STORAGE_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_
#define STORAGE_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_
#include <stddef.h>
#include <stdint.h>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "base/callback_forward.h"
#include "base/component_export.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/trace_event/memory_dump_provider.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "storage/browser/blob/blob_data_handle.h"
#include "storage/browser/blob/blob_entry.h"
#include "storage/browser/blob/blob_memory_controller.h"
#include "storage/browser/blob/blob_storage_constants.h"
#include "storage/browser/blob/blob_storage_registry.h"
#include "storage/browser/blob/mojom/blob_storage_context.mojom.h"
#include "third_party/blink/public/mojom/blob/blob.mojom.h"
class GURL;
namespace content {
class BlobDispatcherHost;
class BlobDispatcherHostTest;
class ChromeBlobStorageContext;
class ShareableBlobDataItem;
}
namespace storage {
class BlobDataBuilder;
class BlobDataHandle;
class BlobDataSnapshot;
// This class handles the logistics of blob storage within the browser process.
// This class is not threadsafe, access on IO thread. In Chromium there is one
// instance per profile.
class COMPONENT_EXPORT(STORAGE_BROWSER) BlobStorageContext
: public base::trace_event::MemoryDumpProvider,
public mojom::BlobStorageContext {
public:
using TransportAllowedCallback = BlobEntry::TransportAllowedCallback;
using BuildAbortedCallback = BlobEntry::BuildAbortedCallback;
// Initializes the context without disk support.
BlobStorageContext();
// Disk support is enabled if |file_runner| isn't null.
BlobStorageContext(const base::FilePath& profile_directory,
const base::FilePath& blob_storage_directory,
scoped_refptr<base::TaskRunner> file_runner);
~BlobStorageContext() override;
// The following three methods all lookup a BlobDataHandle based on some
// input. If no blob matching the input exists these methods return null.
std::unique_ptr<BlobDataHandle> GetBlobDataFromUUID(const std::string& uuid);
mojo::PendingRemote<blink::mojom::Blob> GetBlobFromPublicURL(const GURL& url);
// If this BlobStorageContext is deleted before this method finishes, the
// callback will still be called with null.
void GetBlobDataFromBlobRemote(
mojo::PendingRemote<blink::mojom::Blob> blob,
base::OnceCallback<void(std::unique_ptr<BlobDataHandle>)> callback);
// Always returns a handle to a blob. Use BlobStatus::GetBlobStatus() and
// BlobStatus::RunOnConstructionComplete(callback) to determine construction
// completion and possible errors.
std::unique_ptr<BlobDataHandle> AddFinishedBlob(
std::unique_ptr<BlobDataBuilder> builder);
std::unique_ptr<BlobDataHandle> AddFinishedBlob(
const std::string& uuid,
const std::string& content_type,
const std::string& content_disposition,
std::vector<scoped_refptr<ShareableBlobDataItem>> items);
std::unique_ptr<BlobDataHandle> AddBrokenBlob(
const std::string& uuid,
const std::string& content_type,
const std::string& content_disposition,
BlobStatus reason);
// Useful for coining blob urls from within the browser process.
bool RegisterPublicBlobURL(const GURL& url,
mojo::PendingRemote<blink::mojom::Blob> blob);
void RevokePublicBlobURL(const GURL& url);
size_t blob_count() const { return registry_.blob_count(); }
const BlobStorageRegistry& registry() { return registry_; }
// This builds a blob with the given |input_builder| and returns a handle to
// the constructed Blob. Blob metadata and data should be accessed through
// this handle.
// If there is data present that needs further population then we will call
// |transport_allowed_callback| when we're ready for the user data to be
// populated with the PENDING_DATA_POPULATION status. This can happen
// synchronously or asynchronously. Otherwise |transport_allowed_callback|
// should be null. In the further population case, the caller must call either
// NotifyTransportComplete or CancelBuildingBlob after
// |transport_allowed_callback| is called to signify the data is finished
// populating or an error occurred (respectively).
// If the returned handle is broken, then the possible error cases are:
// * OUT_OF_MEMORY if we don't have enough memory to store the blob,
// * REFERENCED_BLOB_BROKEN if a referenced blob is broken or we're
// referencing ourself.
std::unique_ptr<BlobDataHandle> BuildBlob(
std::unique_ptr<BlobDataBuilder> input_builder,
TransportAllowedCallback transport_allowed_callback);
// Similar to BuildBlob, but this merely registers a blob that will be built
// in the future. The caller must later call either BuildPreregisteredBlob
// (to actually start building the blob), or CancelBuildingBlob (if an error
// occured).
// The returned BlobDataHandle (as well as any handles returned by
// GetBlobDataFromUUID before BuildPreregisteredBlob is called) will always
// have kUnknownSize for its size. A BlobDataHandle with the correct size is
// later returned by BuildPreregisteredBlob.
std::unique_ptr<BlobDataHandle> AddFutureBlob(
const std::string& uuid,
const std::string& content_type,
const std::string& content_disposition,
BuildAbortedCallback build_aborted_callback);
// Same as BuildBlob, but for a blob that was previously registered by calling
// AddFutureBlob.
std::unique_ptr<BlobDataHandle> BuildPreregisteredBlob(
std::unique_ptr<BlobDataBuilder> input_builder,
TransportAllowedCallback transport_allowed_callback);
// This breaks a blob that is currently being built by using the BuildBlob
// method above. Any callbacks waiting on this blob, including the
// |transport_allowed_callback| callback given to BuildBlob, will be called
// with this status code.
void CancelBuildingBlob(const std::string& uuid, BlobStatus code);
// After calling BuildBlob above, the caller should call this method to
// notify the construction system that the unpopulated data in the given blob
// has been. populated. Caller must have all pending items populated in the
// original builder |input_builder| given in BuildBlob or we'll check-fail.
// If there is no pending data in the |input_builder| for the BuildBlob call,
// then this method doesn't need to be called.
void NotifyTransportComplete(const std::string& uuid);
const BlobMemoryController& memory_controller() { return memory_controller_; }
base::WeakPtr<BlobStorageContext> AsWeakPtr() {
return ptr_factory_.GetWeakPtr();
}
void Bind(mojo::PendingReceiver<mojom::BlobStorageContext> receiver);
void set_limits_for_testing(const BlobStorageLimits& limits) {
mutable_memory_controller()->set_limits_for_testing(limits);
}
void DisableFilePagingForTesting() {
mutable_memory_controller()->DisableFilePaging(base::File::FILE_OK);
}
protected:
friend class content::BlobDispatcherHost;
friend class content::BlobDispatcherHostTest;
friend class content::ChromeBlobStorageContext;
friend class BlobBuilderFromStream;
friend class BlobDataHandle;
friend class BlobDataHandle::BlobDataHandleShared;
friend class BlobRegistryImplTest;
friend class BlobStorageContextTest;
friend class BlobURLTokenImpl;
enum class TransportQuotaType { MEMORY, FILE };
void IncrementBlobRefCount(const std::string& uuid);
void DecrementBlobRefCount(const std::string& uuid);
// This will return an empty snapshot until the blob is complete.
// TODO(dmurph): After we make the snapshot method in BlobHandle private, then
// make this DCHECK on the blob not being complete.
std::unique_ptr<BlobDataSnapshot> CreateSnapshot(const std::string& uuid);
BlobStatus GetBlobStatus(const std::string& uuid) const;
// Runs |done| when construction completes with the final status of the blob.
void RunOnConstructionComplete(const std::string& uuid,
BlobStatusCallback done_callback);
// Runs |done| when construction begins (when the blob is no longer
// PENDING_CONSTRUCTION) with the new status of the blob.
void RunOnConstructionBegin(const std::string& uuid,
BlobStatusCallback done_callback);
BlobStorageRegistry* mutable_registry() { return ®istry_; }
BlobMemoryController* mutable_memory_controller() {
return &memory_controller_;
}
private:
std::unique_ptr<BlobDataHandle> BuildBlobInternal(
BlobEntry* entry,
std::unique_ptr<BlobDataBuilder> input_builder,
TransportAllowedCallback transport_allowed_callback);
std::unique_ptr<BlobDataHandle> CreateHandle(const std::string& uuid,
BlobEntry* entry);
void NotifyTransportCompleteInternal(BlobEntry* entry);
void CancelBuildingBlobInternal(BlobEntry* entry, BlobStatus reason);
void FinishBuilding(BlobEntry* entry);
void RequestTransport(
BlobEntry* entry,
std::vector<BlobMemoryController::FileCreationInfo> files);
// The files array is empty for memory quota request responses.
void OnEnoughSpaceForTransport(
const std::string& uuid,
std::vector<BlobMemoryController::FileCreationInfo> files,
bool can_fit);
void OnEnoughSpaceForCopies(const std::string& uuid, bool can_fit);
void OnDependentBlobFinished(const std::string& owning_blob_uuid,
BlobStatus reason);
void ClearAndFreeMemory(BlobEntry* entry);
// base::trace_event::MemoryDumpProvider implementation.
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) override;
// storage::mojom::BlobStorageContext implementation.
void RegisterFromDataItem(mojo::PendingReceiver<blink::mojom::Blob> blob,
const std::string& uuid,
mojom::BlobDataItemPtr item) override;
void RegisterFromMemory(mojo::PendingReceiver<::blink::mojom::Blob> blob,
const std::string& uuid,
mojo_base::BigBuffer data) override;
void WriteBlobToFile(mojo::PendingRemote<::blink::mojom::Blob> blob,
const base::FilePath& path,
bool flush_on_write,
base::Optional<base::Time> last_modified,
WriteBlobToFileCallback callback) override;
base::FilePath profile_directory_;
BlobStorageRegistry registry_;
BlobMemoryController memory_controller_;
mojo::ReceiverSet<mojom::BlobStorageContext> receivers_;
base::WeakPtrFactory<BlobStorageContext> ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(BlobStorageContext);
};
} // namespace storage
#endif // STORAGE_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
53aca83482c51847da2eddf021afbaa35b0890c2 | e6062564a0f0b2bca8d2aca24dc9d5c9071adcac | /InterviewBit/Binary-Search/sqrt(x).cpp | daa721ea941f671036ad528a3a66db253f13aa97 | [] | no_license | iShubhamRana/DSA-Prep | 22e29b85a8ee7dc278c0d89c62dcb33f29b99699 | 611d1a3fb824cce2fab051194bd5f7d0eee83f05 | refs/heads/main | 2023-06-25T06:59:45.599109 | 2021-07-27T18:30:18 | 2021-07-27T18:30:18 | 418,046,414 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 334 | cpp | int Solution::sqrt(int A)
{
int start = 1, end = A, res = 0;
while (start <= end)
{
int mid = start + (end - start) / 2;
if ((long)mid * mid <= A)
{
res = mid;
start = mid + 1;
}
else
{
end = mid - 1;
}
}
return res;
}
| [
"sakshamkapoor1729@gmail.com"
] | sakshamkapoor1729@gmail.com |
79038587dd79b3f1b5f46132b3e9b09bae2fb070 | 998130ca695e84ac3cb90191168324ba5f252065 | /lab6_reloaded/FileSaver.h | 000ed185c91acd12e6a65d77cf5417873b20e710 | [] | no_license | AvramPop/OOP | e52e0cb08fc13ab96d57f6d1a5db238efc581fa3 | 68139e87c2a04f0cdc2a4767b12f067c79eb768d | refs/heads/master | 2022-01-13T02:00:13.129245 | 2019-05-30T06:47:50 | 2019-05-30T06:47:50 | 174,018,741 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,173 | h | //
// Created by dani on 4/26/19.
//
#ifndef LAB6_RELOADED_FILESAVER_H
#define LAB6_RELOADED_FILESAVER_H
#include <string>
#include <vector>
#include <fstream>
#include "VictimFile.h"
template <typename TemplateClass>
class FormattedFileSaver {
std::string path;
public:
std::string getPath() { return path; }
virtual ~FormattedFileSaver() {};
FormattedFileSaver(std::string path) : path(path) {};
virtual void save(std::vector<TemplateClass> list) = 0;
};
template <typename TemplateClass>
class HTMLSaver : public FormattedFileSaver<TemplateClass> {
public:
virtual void save(std::vector<TemplateClass> list) override{
std::ofstream fout(this->getPath());
if(list.size() > 0){
string outputHTML;
outputHTML += topHTML();
for(int i = 0; i < list.size(); i++){
outputHTML += formattedVictimFile(list[i]);
}
outputHTML += bottomHTML();
fout << outputHTML;
fout.close();
}
}
private:
string topHTML() {
string result = "<!DOCTYPE html><html><head><title>Transfer list</title></head><body><table border=\"1\"><tr><td>Victim Name</td><td>Place of origin</td><td>Age</td><td>Photograph</td></tr>";
return result;
}
string bottomHTML() {
string result = "</table></body></html>";
return result;
}
string formattedVictimFile(VictimFile victimFile){
string result = "<tr><td>";
result +=victimFile.getName();
result += "</td><td>";
result += victimFile.getPlaceOfOrigin();
result += "</td><td>";
result += to_string(victimFile.getAge());
result += "</td><td>";
result += victimFile.getPhotograph();
result += "</td></tr>";
return result;
};
public:
HTMLSaver(std::string path) : FormattedFileSaver<TemplateClass>(path){};
};
template <typename TemplateClass>
class CSVSaver : public FormattedFileSaver<TemplateClass> {
public:
virtual void save(std::vector<TemplateClass> list) override {
std::ofstream fout(this->getPath());
fout << "";
if(list.size() > 0){
for(int i = 0; i < list.size(); i++){
VictimFile currentVictimFile = list[i];
fout << currentVictimFile.getName() << "," << currentVictimFile.getPlaceOfOrigin() << ","
<< currentVictimFile.getAge() << "," << currentVictimFile.getPhotograph() << "\n";
}
}
fout.close();
}
CSVSaver(std::string path) : FormattedFileSaver<TemplateClass>(path){};
};
template <typename TemplateClass>
class TXTSaver : public FormattedFileSaver<TemplateClass> {
public:
virtual void save(std::vector<TemplateClass> list) override {
std::ofstream fout(this->getPath());
fout << "";
if(list.size() > 0){
for(int i = 0; i < list.size(); i++){
fout << list[i].toFormattedString() << std::endl;
}
}
fout.close();
}
TXTSaver(std::string path) : FormattedFileSaver<TemplateClass>(path){};
};
#endif //LAB6_RELOADED_FILESAVER_H
| [
"daniel.avram.pop@gmail.com"
] | daniel.avram.pop@gmail.com |
e612f27cac783b3414c9ef4fab2bc07cf04331e4 | 21a221c20313339ac7380f8d92f8006e5435ef1d | /src/scripts/Tournament_Maker_ingame/Globals.cpp | cae6f088c2d74b1351f8342bed26c1125e8b825a | [] | no_license | AwkwardDev/Descent-core-scripts-3.3.5 | a947a98d0fdedae36a488c542642fcf61472c3d7 | d773b1a41ed3f9f970d81962235e858d0848103f | refs/heads/master | 2021-01-18T10:16:03.750112 | 2014-08-12T16:28:15 | 2014-08-12T16:28:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 33,511 | cpp | #include "StdAfx.h"
#include "Setup.h"
#include "globals.h"
uint32 cur_tournament_id = 1; //guid
uint32 cur_team_id = 1; //guid
Tournament_Info Tournaments[ TOURNAMENT_TYPE_COUNT ];
uint32 global_update_next_stamp = 0; //do not spam updates in case there are multiple supervizor spawns
Mutex UpdateMutex;
uint32 teamsize_limitations[ TOURNAMENT_TYPE_COUNT ] = { 2, 3, 4, 5 };
uint32 debug_commands = SUPERVIZOR_COMMAND_NONE;
bool IsInrangeSQ( Object *t1, Object *t2,float sq_r)
{
if( !t1 || !t2 )
return false;
float distx=t1->GetPositionX()-t2->GetPositionX();
float disty=t1->GetPositionY()-t2->GetPositionY();
float dist = distx*distx + disty*disty;
return dist <= sq_r;
}
bool IsInrangeSQ( float x1, float y1,float x2, float y2, float sq_r)
{
float distx=x1-x2;
float disty=y1-y2;
float dist = distx*distx + disty*disty;
return dist <= sq_r;
}
bool IsUnitInsideBattleRing(uint32 TournamentType, uint32 map, float x, float y)
{
if(
TournamentType < TOURNAMENT_TYPE_COUNT
&& Tournaments[ TournamentType ].map_id == map
&& IsInrangeSQ(x,y,Tournaments[ TournamentType ].center_x,Tournaments[ TournamentType ].center_y,Tournaments[ TournamentType ].arena_range_sq)
)
return true;
return false;
}
bool IsUnitInsideAnyBattleRing(uint32 map, float x, float y)
{
for(uint32 i=0;i<TOURNAMENT_TYPE_COUNT;i++)
if( IsUnitInsideBattleRing( i, map, x, y) == true )
return true;
return false;
}
bool IsPlayerSpectator( Player *plr )
{
if( IsUnitInsideAnyBattleRing( plr->GetMapId(), plr->GetPositionX(), plr->GetPositionY() ) )
{
//check if he is participant in any of the active tournaments
uint64 PGUID = plr->GetGUID();
for(uint32 i=0;i<TOURNAMENT_TYPE_COUNT;i++)
//check if insight fighting team
if( Tournaments[ i ].status >= TS_TELEPORT_PLAYERS && Tournaments[ i ].status <= TS_WAIT_FOR_FIGHT )
{
uint32 T1 = Tournaments[ i ].fighting_teams[ 0 ];
uint32 T2 = Tournaments[ i ].fighting_teams[ 1 ];
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( Tournaments[ i ].teams_registered[ T1 ].player_guids[ k ] == PGUID
||
Tournaments[ i ].teams_registered[ T2 ].player_guids[ k ] == PGUID
)
return false;
}
//maybe tournament did not start yet
else if( (Tournaments[ i ].status < TS_TELEPORT_PLAYERS || Tournaments[ i ].status > TS_WAIT_FOR_FIGHT) && IsUnitInsideBattleRing( i, plr->GetMapId(), plr->GetPositionX(), plr->GetPositionY() ) == true )
return false;
return true;
}
return false;
}
uint32 GetTeamMemberCount(uint32 TournamentType,uint32 team)
{
return 0;
}
//crossing fingers that this function will always finish before 1 update cycle or lag might build up
void UpdateTournaments( )
{
//mutex to not update multi thrreaded way
UpdateMutex.Acquire();
if( GetTickCount() < global_update_next_stamp )
{
UpdateMutex.Release();
return;
}
global_update_next_stamp = GetTickCount() + SUPERVISOR_UPDATE_INTERVAL;
uint32 local_gm_command = debug_commands;
debug_commands = SUPERVIZOR_COMMAND_NONE;
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//make a list that we will use internally of players while we update and check tournament statuses
uint32 good_team_count[TOURNAMENT_TYPE_COUNT];
uint32 tick_count_now = GetTickCount();
//first let's check what players are not usable anymore
for(uint32 i=0;i<TOURNAMENT_TYPE_COUNT;i++)
{
good_team_count[i] = 0;
uint32 MinLevel = 255;
uint32 MaxLevel = 0;
for(uint32 j=0;j<MAX_TEAMS_PER_TOURNAMENT;j++)
{
if( Tournaments[ i ].teams_registered[ j ].is_used != 0 )
{
uint32 player_counter = 0;
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( Tournaments[ i ].teams_registered[ j ].player_guids[ k ] )
{
//check if player is still ingame
Player *p = objmgr.GetPlayer( Tournaments[ i ].teams_registered[ j ].player_guids[ k ] );
if( p != NULL && p->m_bg != NULL )
{
Tournaments[ i ].teams_registered[ j ].player_guids[ k ] = 0;
Tournaments[ i ].teams_registered[ j ].players_for_local_acces[ k ] = NULL;
if( p )
p->BroadcastMessage("You have been removed from the Tournamen Queue");
continue;
}
if( p )
{
if( MinLevel > p->getLevel() )
MinLevel = p->getLevel();
if( MaxLevel < p->getLevel() )
MaxLevel = p->getLevel();
//we monitor contribution so we may reward accordingly
Tournaments[ i ].teams_registered[ j ].player_dmg_contri[ k ] = p->m_dmg_made_since_login;
Tournaments[ i ].teams_registered[ j ].player_heal_contri[ k ] = p->m_heal_made_since_login;
player_counter++;
}
Tournaments[ i ].teams_registered[ j ].players_for_local_acces[ k ] = p;
}
else
Tournaments[ i ].teams_registered[ j ].players_for_local_acces[ k ] = NULL;
//seems like a team we could use to start tournament
if( player_counter != 0 )
good_team_count[i]++;
//this team left the game so we can simply remove them from our list
else
{
Tournaments[ i ].teams_registered[ j ].is_used = 0 ;
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
{
Tournaments[ i ].teams_registered[ j ].player_guids[ k ] = 0;
Tournaments[ i ].teams_registered[ j ].players_for_local_acces[ k ] = NULL;
}
}
}
}
if( MinLevel == 255 )
MinLevel = 0;
Tournaments[ i ].MinLevel = MinLevel;
Tournaments[ i ].MaxLevel = MaxLevel;
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//now check if we could start any of the tournaments
for(uint32 i=0;i<TOURNAMENT_TYPE_COUNT;i++)
if( good_team_count[i] >= MAX_TEAMS_PER_TOURNAMENT || local_gm_command == SUPERVIZOR_COMMAND_FORCESTART )
{
if( ( Tournaments[ i ].status == TS_NOT_STARTED || Tournaments[ i ].status == TS_WAITING_LAST_TEAM_JOIN ) && local_gm_command == SUPERVIZOR_COMMAND_FORCESTART )
{
Tournaments[ i ].next_state_change_stamp = tick_count_now;
Tournaments[ i ].status = TS_WAITING_LAST_TEAM_JOIN_FORCED;
Tournaments[ i ].ladder_step = 0; //we are searching for teams with 0 wins
#ifdef TOURNAMENT_TYPE_WEAKEST_VS_WEAKEST
BroadcastToTournament( i, "Enough players joined the tournament queue. You will get teleported when your fight starts. All teams fight all other teams");
#endif
#ifdef TOURNAMENT_TYPE_LADDER
BroadcastToTournament( i, "Enough players joined the tournament queue. You will get teleported when your fight starts. If any team looses then it is eliminated");
#endif
}
//we wait some time to check if they are all ready
else if( Tournaments[ i ].status == TS_NOT_STARTED )
{
Tournaments[ i ].next_state_change_stamp = tick_count_now + WAIT_FOR_LAST_TEAM_TO_JOIN;
Tournaments[ i ].status = TS_WAITING_LAST_TEAM_JOIN;
Tournaments[ i ].ladder_step = 0; //we are searching for teams with 0 wins
#ifdef TOURNAMENT_TYPE_WEAKEST_VS_WEAKEST
BroadcastToTournament( i, "Enough players joined the tournament queue. You will get teleported when your fight starts. All teams fight all other teams");
#endif
#ifdef TOURNAMENT_TYPE_LADDER
BroadcastToTournament( i, "Enough players joined the tournament queue. You will get teleported when your fight starts. If any team looses then it is eliminated");
#endif
//in case we want the whole tournament to watch. Note that this means 50 players if 5 vs 5
//this step is optional
Tournament_Info *tur = &Tournaments[ i ];
for(uint32 j=0;j<MAX_TEAMS_PER_TOURNAMENT;j++)
{
Team_Info *team = &tur->teams_registered[ j ];
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( team->players_for_local_acces[ k ] )
{
Player * chr = team->players_for_local_acces[ k ];
if( chr->IsBeingTeleported() == false && sEventMgr.HasEvent(chr, EVENT_PLAYER_TELEPORT) == false )
sEventMgr.AddEvent(chr, &Player::EventTeleport, tur->map_id, tur->center_x, tur->center_y, tur->center_z, EVENT_PLAYER_TELEPORT, 1, 1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
}
}
}
}
//reset waiting if one of the teams left before we could even start the tournament
else if( Tournaments[ i ].status == TS_WAITING_LAST_TEAM_JOIN )
{
Tournaments[ i ].status = TS_NOT_STARTED;
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//now check if we can start any of the tournaments
for(uint32 i=0;i<TOURNAMENT_TYPE_COUNT;i++)
{
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//we are over waiting for teams to build up. Move to next step
if( ( Tournaments[ i ].status == TS_WAITING_LAST_TEAM_JOIN || Tournaments[ i ].status == TS_WAITING_LAST_TEAM_JOIN_FORCED )
&& tick_count_now >= Tournaments[ i ].next_state_change_stamp )
{
//just pick 2 teams that will fight each other
PickNext2TeamsToFight( i );
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//keep trying to teleport players to arena. This does not depend on time but expires after a while
if( Tournaments[ i ].status == TS_TELEPORT_PLAYERS )
{
//try to port all players to our tournament place that are no yet in range
uint32 managed_to_teleport_all = 1;
Tournament_Info *tur = &Tournaments[ i ];
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
{
Team_Info *team = &tur->teams_registered[ tur->fighting_teams[ j ] ];
static const int32 shift_x_placement[2]={-15,15};
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( team->players_for_local_acces[ k ] )
{
Player * chr = team->players_for_local_acces[ k ];
float intended_x = tur->center_x + shift_x_placement[ j ];
float intended_y = tur->center_y - 2 + k;
chr->bInvincible = true;
if( chr->IsBeingTeleported() == true )
managed_to_teleport_all = 0;
else if( chr->GetMapId() != tur->map_id
|| IsInrangeSQ( chr->GetPositionX(), chr->GetPositionY(), intended_x, intended_y, 5*5 ) == false )
{
if( !sEventMgr.HasEvent(chr, EVENT_PLAYER_TELEPORT) )
sEventMgr.AddEvent(chr, &Player::EventTeleport, tur->map_id, intended_x, intended_y, tur->center_z, EVENT_PLAYER_TELEPORT, 1, 1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
managed_to_teleport_all = 0;
}
}
}
//in case all players are in place or teleport retry count is exhausted then we move on to next step
if( managed_to_teleport_all == 1 || tick_count_now >= Tournaments[ i ].next_state_change_stamp )
{
Tournaments[ i ].next_state_change_stamp = tick_count_now;
Tournaments[ i ].status = TS_TELEPORT_WAIT_PLAYERS;
}
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//if we are in the process of changing maps then we wait a bit
if( Tournaments[ i ].status == TS_TELEPORT_WAIT_PLAYERS && tick_count_now >= Tournaments[ i ].next_state_change_stamp )
{
//set next state
Tournaments[ i ].status = TS_PREPARE_PLAYERS;
Tournaments[ i ].next_state_change_stamp = tick_count_now + PLAYER_PREBUFF_WAIT;
//broadcast to players that we are waiting for them to buff each others and prepare
// m_Unit->SendChatMessage(SUPERVISOR_ANNOUNCE_TYPE, SUPERVISOR_ANNOUNCE_LANG, SUPERVISOR_ANNOUNCE_TXT_PLAYERS_BUFF);
//now cleanup players so they are tidy :P
Tournament_Info *tur = &Tournaments[ i ];
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
{
Team_Info *team = &tur->teams_registered[ tur->fighting_teams[ j ] ];
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( team->players_for_local_acces[ k ] )
{
Player * chr = team->players_for_local_acces[ k ];
//resurrect the dead
if( chr->IsDead() )
chr->ResurrectPlayer();
//remove all buffs except static ones
for(uint32 buffitr=0;buffitr<MAX_AURAS;buffitr++)
if( chr->m_auras[ buffitr ] )
chr->m_auras[ buffitr ]->Remove();
//set max health
chr->SetUInt32Value(UNIT_FIELD_HEALTH, chr->GetUInt32Value(UNIT_FIELD_MAXHEALTH) );
//reset energy
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_MANA, chr->GetUInt32Value(UNIT_FIELD_MAXPOWER1 + POWER_TYPE_MANA) );
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_RAGE, 0 );
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_FOCUS, 0 );
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_ENERGY, chr->GetUInt32Value(UNIT_FIELD_MAXPOWER1 + POWER_TYPE_ENERGY) );
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_RUNIC_POWER, 0 );
//set FFA and PVP - need it for cross faction buffs
chr->SetPvPFlag();
chr->SetFFAPvPFlag();
//clear cooldowns
chr->ResetAllCooldowns();
//tell him what is happening
chr->BroadcastMessage("Prepare to fight. You have %u seconds to buff team mates. ReGroup in case you need. At the end of the %u seconds your HP will be reseted",PLAYER_PREBUFF_WAIT/1000,PLAYER_PREBUFF_WAIT/1000);
//root players so they do not start fighting each others
chr->Root();
}
}
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//players are prepared so we can start fighting
if( Tournaments[ i ].status == TS_PREPARE_PLAYERS && tick_count_now >= Tournaments[ i ].next_state_change_stamp )
{
//set next state
Tournaments[ i ].status = TS_PREPARE_COUNTDOWN_6;
Tournaments[ i ].next_state_change_stamp = tick_count_now + 2000;
//reset player status again
Tournament_Info *tur = &Tournaments[ i ];
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
BroadcastToTournamentTeam( i, tur->fighting_teams[ j ], "Prepare to fight : 6" );
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//players are prepared so we can start fighting
if( Tournaments[ i ].status == TS_PREPARE_COUNTDOWN_6 && tick_count_now >= Tournaments[ i ].next_state_change_stamp )
{
//set next state
Tournaments[ i ].status = TS_PREPARE_COUNTDOWN_4;
Tournaments[ i ].next_state_change_stamp = tick_count_now + 2000;
//notify players
Tournament_Info *tur = &Tournaments[ i ];
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
BroadcastToTournamentTeam( i, tur->fighting_teams[ j ], "Prepare to fight : 4" );
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//players are prepared so we can start fighting
if( Tournaments[ i ].status == TS_PREPARE_COUNTDOWN_4 && tick_count_now >= Tournaments[ i ].next_state_change_stamp )
{
//set next state
Tournaments[ i ].status = TS_PREPARE_COUNTDOWN_2;
Tournaments[ i ].next_state_change_stamp = tick_count_now + SUPERVISOR_UPDATE_INTERVAL;
//notify players
Tournament_Info *tur = &Tournaments[ i ];
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
BroadcastToTournamentTeam( i, tur->fighting_teams[ j ], "Prepare to fight : 2" );
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//players are prepared so we can start fighting
if( Tournaments[ i ].status == TS_PREPARE_COUNTDOWN_2 && tick_count_now >= Tournaments[ i ].next_state_change_stamp )
{
//set next state
Tournaments[ i ].status = TS_WAIT_FOR_FIGHT;
Tournaments[ i ].next_state_change_stamp = tick_count_now + TOURNAMENT_WAIT_TEAM_MATCH;
//notify players
Tournament_Info *tur = &Tournaments[ i ];
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
{
Team_Info *team = &tur->teams_registered[ tur->fighting_teams[ j ] ];
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( team->players_for_local_acces[ k ] )
{
Player * chr = team->players_for_local_acces[ k ];
//resurrect the dead. Fucking people just can't wait the buff timer
if( chr->IsDead() )
chr->ResurrectPlayer();
//set max health
chr->SetUInt32Value(UNIT_FIELD_HEALTH, chr->GetUInt32Value(UNIT_FIELD_MAXHEALTH) );
//reset energy
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_MANA, chr->GetUInt32Value(UNIT_FIELD_MAXPOWER1 + POWER_TYPE_MANA) );
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_RAGE, 0 );
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_FOCUS, 0 );
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_ENERGY, chr->GetUInt32Value(UNIT_FIELD_MAXPOWER1 + POWER_TYPE_ENERGY) );
chr->SetUInt32Value(UNIT_FIELD_POWER1 + POWER_TYPE_RUNIC_POWER, 0 );
//set FFA and PVP
chr->SetPvPFlag();
chr->SetFFAPvPFlag();
chr->SetFlag(PLAYER_FLAGS, PLAYER_FLAG_PVP_TOGGLE);
chr->SetByteFlag(UNIT_FIELD_BYTES_2,1,UNIT_BYTE2_FLAG_PVP);
//clear cooldowns
chr->ResetAllCooldowns();
//tell him what is happening
chr->BroadcastMessage("Prepare to fight : fight !");
//unroot players so they do not start fighting each others
chr->Unroot();
//remove godmode
chr->bInvincible = false;
}
}
//set sudden death counter
Tournaments[ i ].sudden_death_stamp = tick_count_now + SUDDEN_DEATH_TIMER;
Tournaments[ i ].sudden_death_counter = 1;
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//in case fight is timouted. This should happen only as last resort
if( Tournaments[ i ].status == TS_WAIT_FOR_FIGHT && tick_count_now >= Tournaments[ i ].next_state_change_stamp )
{
//What a lamer team. Should not happen. No idea what to do. Right now they both get disqualified
BroadcastToTournament( i, "Tournament fight takes too long. Abuser protection is eliminating both teams");
PickNext2TeamsToFight( i );
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//fight monitor. Should not depend on any timer
if( Tournaments[ i ].status == TS_WAIT_FOR_FIGHT )
{
//check if one of team players are all dead
uint32 all_team_players_dead[TEAMS_TO_FIGHT_AT_SAME_TIME];
Tournament_Info *tur = &Tournaments[ i ];
uint32 T1 = tur->fighting_teams[0];
uint32 T2 = tur->fighting_teams[1];
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
{
all_team_players_dead[j] = 1;
Team_Info *team = &tur->teams_registered[ tur->fighting_teams[ j ] ];
if( team->is_used != 0 )
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( team->players_for_local_acces[ k ] )
{
Player * chr = team->players_for_local_acces[ k ];
if( IsUnitInsideBattleRing( i, chr->GetMapId(), chr->GetPositionX(), chr->GetPositionY() ) == false )
{
chr->BroadcastMessage("You are outside the Tournament ring. Get back or get disqualified");
chr->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAG_PVP_TOGGLE);
chr->RemoveByteFlag(UNIT_FIELD_BYTES_2,1,UNIT_BYTE2_FLAG_PVP);
continue;
}
//what about corpse ?
if( chr->isAlive() == true
&& chr->IsDead() == false
)
{
//make sure due to revive they did not loose FFA flag
chr->SetFlag(PLAYER_FLAGS, PLAYER_FLAG_PVP_TOGGLE);
chr->SetByteFlag(UNIT_FIELD_BYTES_2,1,UNIT_BYTE2_FLAG_PVP);
//this match is not over yet
all_team_players_dead[j] = 0;
//actually let's make sure all players have FFA flag and notified if they left the zone
// break;
}
}
}
if( all_team_players_dead[0] == all_team_players_dead[1] && all_team_players_dead[0] == 1 )
{
//match was a draw
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
{
Team_Info *team = &tur->teams_registered[ tur->fighting_teams[ j ] ];
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( team->players_for_local_acces[ k ] )
{
Player * chr = team->players_for_local_acces[ k ];
chr->BroadcastMessage(" Match ended in a draw. (happens to offline teams also)");
}
//let them both fight in the next match if team is indeed dead instead of quit
if( team->is_used )
{
team->matches_won_total++;
team->matches_played_total++;
}
}
PickNext2TeamsToFight( i );
}
else if( all_team_players_dead[0] == 0 && all_team_players_dead[1] != 0 )
{
//team 1 is winner
Tournaments[ i ].teams_registered[ T1 ].matches_won_total++;
Tournaments[ i ].teams_registered[ T1 ].matches_played_total++;
Tournaments[ i ].teams_registered[ T2 ].matches_played_total++;
PickNext2TeamsToFight( i );
}
else if( all_team_players_dead[1] == 0 && all_team_players_dead[0] != 0 )
{
//team 2 is winner
Tournaments[ i ].teams_registered[ T2 ].matches_won_total++;
Tournaments[ i ].teams_registered[ T1 ].matches_played_total++;
Tournaments[ i ].teams_registered[ T2 ].matches_played_total++;
PickNext2TeamsToFight( i );
}
//sudden death is a parralel state to combat waiting and will try to kill players in time
if( tick_count_now >= tur->sudden_death_stamp )
{
Tournament_Info *tur = &Tournaments[ i ];
uint32 damage_to_deal = tur->sudden_death_counter * SUDDEN_DEATH_DAMAGE;
tur->sudden_death_counter++;
tur->sudden_death_stamp = tick_count_now + SUDDEN_DEATH_REPEAT_TIMER;
for(uint32 j=0;j<TEAMS_TO_FIGHT_AT_SAME_TIME;j++)
{
Team_Info *team = &tur->teams_registered[ tur->fighting_teams[ j ] ];
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( team->players_for_local_acces[ k ] )
{
Player * chr = team->players_for_local_acces[ k ];
if( chr->IsInWorld() && chr->isAlive() )
// chr->DealDamage( chr, damage_to_deal, 0, 0, SUDDEN_DEATH_SPELL_ID, true );
chr->DealDamage( chr, damage_to_deal, 0, 0, 0, true );
}
}
}
}
}
//morron protection. Clear out local variables
for(uint32 i=0;i<TOURNAMENT_TYPE_COUNT;i++)
for(uint32 j=0;j<MAX_TEAMS_PER_TOURNAMENT;j++)
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
Tournaments[ i ].teams_registered[ j ].players_for_local_acces[ k ] = NULL;
UpdateMutex.Release();
}
//function is called from a threadsafe enviroment
//Note this function should be only called from PickNext2TeamsToFight() since it relies on local data
void RemoveTournamentStatesFromPlayers( uint32 TournamentID )
{
for(uint32 j=0;j<MAX_TEAMS_PER_TOURNAMENT;j++)
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( Tournaments[ TournamentID ].teams_registered[ j ].players_for_local_acces[ k ] != NULL )
{
Player * chr = Tournaments[ TournamentID ].teams_registered[ j ].players_for_local_acces[ k ];
//normal remove
chr->RemovePvPFlag();
chr->RemoveFFAPvPFlag();
//forced remove
chr->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAG_PVP_TOGGLE);
chr->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
chr->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
chr->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAG_FREE_FOR_ALL_PVP);
if( chr->IsDead() )
chr->ResurrectPlayer();
chr->bInvincible = false;
}
}
//function is called from a threadsafe enviroment
//Note this function should be only called from UpdateTournaments() since it relies on local data
void PickNext2TeamsToFight( uint32 TournamentID )
{
//just make sure we remove PVP from old teams. Putting this here to remove redundancy :(
RemoveTournamentStatesFromPlayers( TournamentID );
//there are 2 methods that usually tournaments follow :
// 1) ladder. 2 teams fight and eliminated team is eliminated forever
// 2) all on all. All teams fight each other and team with most kills is the winner. With 10 teams this would mean 100 matches. Each match 5 minutes = almost 10 hours
Tournament_Info *tur = &Tournaments[ TournamentID ];
#ifdef TOURNAMENT_TYPE_LADDER
//////////////
// ladder type
//////////////
//seems to finish too quickly
//get max matches made until now
uint32 reamining_ladder_teams = 0;
uint32 next_round_matches = 0;
uint32 possible_winner_team;
for(uint32 j=0;j<MAX_TEAMS_PER_TOURNAMENT;j++)
if( tur->teams_registered[ j ].is_used != 0 )
{
Team_Info *team = &tur->teams_registered[ j ];
//if we won all matches that we played until now and we belong to this "level" of ladder then we are a good to go team
if( tur->ladder_step == team->matches_won_total
&& team->matches_won_total == team->matches_played_total
)
{
reamining_ladder_teams++;
possible_winner_team = j;
}
if( tur->ladder_step < team->matches_won_total )
next_round_matches++;
}
//seems like the winner team quitted ? I mean the tournament winner team. What should we do now ?
if( reamining_ladder_teams == 0 && next_round_matches == 0 )
{
BroadcastToTournament( TournamentID, "Lol,all teams that should fight for the win have quitted the tournament. Canceling Tournament" );
ResetTournamentForNew( TournamentID );
return;
}
//seems like this team has no pair at this level. We declare them winners and move on to the next level of the tournament
if( reamining_ladder_teams == 1 && next_round_matches != 0 )
{
tur->teams_registered[ possible_winner_team ].matches_won_total++;
tur->teams_registered[ possible_winner_team ].matches_played_total++;
tur->ladder_step++;
PickNext2TeamsToFight( TournamentID );
return;
}
//1 team and no next level = win
if( reamining_ladder_teams == 1 && next_round_matches == 0 )
{
HandleTournamentWin( TournamentID, possible_winner_team );
ResetTournamentForNew( TournamentID );
return;
}
//pick the next 2 (or 1 ) teams to fight
if( reamining_ladder_teams == 0 && next_round_matches > 0 )
{
tur->ladder_step++;
PickNext2TeamsToFight( TournamentID );
return;
}
//pick the next 2 (or 1 ) teams to fight
if( reamining_ladder_teams >= 2 )
{
int32 T1 = -1, T2 = -1;
for(uint32 j=0;j<MAX_TEAMS_PER_TOURNAMENT;j++)
if( tur->teams_registered[ j ].is_used != 0 )
{
Team_Info *team = &tur->teams_registered[ j ];
//if we won all matches that we played until now and we belong to this "level" of ladder then we are a good to go team
if( tur->ladder_step == team->matches_won_total
&& team->matches_won_total == team->matches_played_total
)
{
if( T1 == -1 )
T1 = j;
else if( T2 == -1 )
{
T2 = j;
break;
}
}
}
//sanity check. Should never happen
if( T1 == -1 && T2 == -1 )
{
BroadcastToTournament( TournamentID, "Something bad happened. Tell the devs that error -2 ocured" );
ResetTournamentForNew( TournamentID );
return;
}
//check if there is only 1 team remaining = win
if( T2 == -1 && T1 != -1 )
{
HandleTournamentWin( TournamentID, T1 );
ResetTournamentForNew( TournamentID );
return;
}
tur->fighting_teams[ 0 ] = T1;
tur->fighting_teams[ 1 ] = T2;
tur->next_state_change_stamp = GetTickCount() + PLAYER_TELEPORT_WAIT;
tur->status = TS_TELEPORT_PLAYERS;
//tell the others who is going to fight
char tell_what[500];
sprintf( tell_what,"Tournament : %s, Teams Fighting : '%s' vs '%s'",TournamentTypeNames[ TournamentID ],Tournaments[ TournamentID ].teams_registered[ T1 ].name, Tournaments[ TournamentID ].teams_registered[ T2 ].name );
BroadcastToTournament( TournamentID, tell_what );
BroadcastToTournamentTeam( TournamentID, Tournaments[ TournamentID ].fighting_teams[0], "Prepare to port to fight");
BroadcastToTournamentTeam( TournamentID, Tournaments[ TournamentID ].fighting_teams[1], "Prepare to port to fight");
}
#endif
#ifdef TOURNAMENT_TYPE_WEAKEST_VS_WEAKEST
/////////////
// all vs all
/////////////
//might take more then an hour with 10 teams
//get the 2 lowest score teams
//1 team is eliminated on each MAX_TEAMS_PER_TOURNAMENT match...
int32 team1;
int32 team2;
int32 last_valid_team=-1; //this might be winner team
uint32 total_match_count=(MAX_TEAMS_PER_TOURNAMENT-1)*MAX_TEAMS_PER_TOURNAMENT/2;
for(uint32 all=0;all<total_match_count;all++)
{
team1 = -1;
team2 = -1;
for(uint32 j=0;j<MAX_TEAMS_PER_TOURNAMENT;j++)
if( tur->teams_registered[ j ].is_used != 0
&& tur->teams_registered[ j ].matches_won_total == all
)
{
last_valid_team = j;
if( team1 == -1 )
team1 = j;
else if( team2 == -1 )
team2 = j;
else
break;
}
//did we find a match ?
if( team1 != -1 && team2 != -1 )
break;
}
//seems like there are no more teams to be able to match up. This is the winner team
if( team2 == -1 && ( team1 != -1 || last_valid_team != -1 ) )
{
HandleTournamentWin( TournamentID, last_valid_team );
ResetTournamentForNew( TournamentID );
}
//sanity check. Should never happen
else if( team2 == -1 && team1 == -1 )
{
BroadcastToTournament( TournamentID, "Something bad happened. Tell the devs that error -3 ocured" );
ResetTournamentForNew( TournamentID );
return;
}
else if( team2 != -1 && team1 != -1 )
{
//set fighting teams
tur->fighting_teams[ 0 ] = team1;
tur->fighting_teams[ 1 ] = team2;
//set next tournament state
tur->next_state_change_stamp = GetTickCount();
tur->status = TS_TELEPORT_PLAYERS;
//tell the others who is going to fight
char tell_what[500];
sprintf( tell_what,"Tournament : %s, Teams Fighting : '%s' vs '%s'",TournamentTypeNames[ TournamentID ],Tournaments[ TournamentID ].teams_registered[ team1 ].name, Tournaments[ TournamentID ].teams_registered[ team2 ].name );
BroadcastToTournament( TournamentID, tell_what );
BroadcastToTournamentTeam( TournamentID, Tournaments[ TournamentID ].fighting_teams[0], "Prepare to port to fight");
BroadcastToTournamentTeam( TournamentID, Tournaments[ TournamentID ].fighting_teams[1], "Prepare to port to fight");
}/**/
#endif
}
//function is called from a threadsafe enviroment
//Note this function should be only called from PickNext2TeamsToFight() since it relies on local data
void HandleTournamentWin( uint32 TournamentID, uint32 teamID)
{
//reset special states
RemoveTournamentStatesFromPlayers( TournamentID );
//award
Team_Info *team = &Tournaments[ TournamentID ].teams_registered[ teamID ];
char say_what[500];
sprintf(say_what,"Team '%s' has won the tournament",team->name );
BroadcastToTournament( TournamentID, say_what );
for(uint32 k=0;k<MAX_PLAYERS_PER_TEAM; k++ )
if( team->players_for_local_acces[ k ] )
{
Player * chr = team->players_for_local_acces[ k ];
//get next available free title and award it
for( uint32 i=PVPTITLE_THE_ARGENT_DEFENDER;i>0;i--)
if( chr->HasKnownTitle( (RankTitles)i ) == false )
{
chr->SetKnownTitle( (RankTitles)i, true );
break;
}
}
}
void ResetTournamentForNew( uint32 TournamentID )
{
//reset special states
RemoveTournamentStatesFromPlayers( TournamentID );
//mark all team places as free to be ocupied by new match participants
for(uint32 k=0;k<MAX_TEAMS_PER_TOURNAMENT; k++ )
{
Tournaments[ TournamentID ].teams_registered[ k ].is_used = 0; //clear used up slot
strcpy( Tournaments[ TournamentID ].teams_registered[ k ].name,""); //clear name
//clear out team player slots
Team_Info *team = &Tournaments[ TournamentID ].teams_registered[ k ];
for(uint32 i=0;i<MAX_PLAYERS_PER_TEAM; i++ )
team->players_for_local_acces[ i ] = 0; //clear used up slot
}
Tournaments[ TournamentID ].next_state_change_stamp = GetTickCount();
Tournaments[ TournamentID ].status = TS_NOT_STARTED;
Tournaments[ TournamentID ].fighting_teams[0] = Tournaments[ TournamentID ].fighting_teams[1] = 0;
}
//function is called from a threadsafe enviroment
//Note this function should be only called from PickNext2TeamsToFight() or UpdateTournaments() since it relies on local data
void BroadcastToTournament( uint32 TournamentID, const char *what )
{
for(uint32 k=0;k<MAX_TEAMS_PER_TOURNAMENT; k++ )
if( Tournaments[ TournamentID ].teams_registered[ k ].is_used != 0 )
BroadcastToTournamentTeam( TournamentID, k, what );
}
//function is called from a threadsafe enviroment
//Note this function should be only called from BroadcastToTournament() or UpdateTournaments() since it relies on local data
void BroadcastToTournamentTeam( uint32 TournamentID, uint32 TeamID, const char *what )
{
Team_Info *team = &Tournaments[ TournamentID ].teams_registered[ TeamID ];
for(uint32 i=0;i<MAX_PLAYERS_PER_TEAM; i++ )
if( team->players_for_local_acces[ i ] )
team->players_for_local_acces[i]->BroadcastMessage( what );
} | [
"jozsab1@gmail.com"
] | jozsab1@gmail.com |
1d8d5e52f8d4ee6df21df21f27349126348fa643 | c3dc08fe8319c9d71f10473d80b055ac8132530e | /challenge-115/paulo-custodio/cpp/ch-1.cpp | 979ffb7daf262daba91ef37a60b2c888fa683aa8 | [] | no_license | southpawgeek/perlweeklychallenge-club | d4b70d9d8e4314c4dfc4cf7a60ddf457bcaa7a1e | 63fb76188e132564e50feefd2d9d5b8491568948 | refs/heads/master | 2023-01-08T19:43:56.982828 | 2022-12-26T07:13:05 | 2022-12-26T07:13:05 | 241,471,631 | 1 | 0 | null | 2020-02-18T21:30:34 | 2020-02-18T21:30:33 | null | UTF-8 | C++ | false | false | 1,723 | cpp | /*
Challenge 115
TASK #1 - String Chain
Submitted by: Mohammad S Anwar
You are given an array of strings.
Write a script to find out if the given strings can be chained to form a
circle. Print 1 if found otherwise 0.
A string $S can be put before another string $T in circle if the last
character of $S is same as first character of $T.
Examples:
Input: @S = ("abc", "dea", "cd")
Output: 1 as we can form circle e.g. "abc", "cd", "dea".
Input: @S = ("ade", "cbd", "fgh")
Output: 0 as we can't form circle.
*/
#include <iostream>
#include <list>
#include <string>
using namespace std;
bool is_chain(const string& word1, const string& word2) {
if (word1.back() == word2.front())
return true;
else
return false;
}
bool found_solution = false;
bool is_circle(list<string> pending, list<string> path) {
if (found_solution) return true;
if (pending.empty()) {
if (!found_solution) found_solution = is_chain(path.back(), path.front());
}
else {
for (auto& word : pending) {
if (!found_solution) {
if (path.empty() || is_chain(path.back(), word)) {
list<string> new_pending{ pending };
new_pending.remove(word);
list<string> new_path{ path };
new_path.push_back(word);
if (!found_solution) found_solution = is_circle(new_pending, new_path);
}
}
}
}
return found_solution;
}
int main(int argc, char* argv[]) {
list<string> words;
for (int i = 1; i < argc; i++)
words.push_back(argv[i]);
bool found = is_circle(words, list<string>{});
cout << (found ? 1 : 0) << endl;
}
| [
"pauloscustodio@gmail.com"
] | pauloscustodio@gmail.com |
e26bacceb4fcd6293967b626ff10950cc0997d39 | 14fd701e374fad507a4b2086e39a3080bc40d8ef | /src/ContourNode.cpp | b9bc2a00bbb57f99f3c3eb70c37361014a96e33a | [] | no_license | Jackwongupc/Mycontour | 43f880db054c1d148d638e7014ba092c556f6e9e | 23077f7b388d94aae7828bb52ed08a86b959697f | refs/heads/master | 2020-03-19T01:35:12.887959 | 2018-05-31T11:40:11 | 2018-05-31T11:53:10 | 135,556,388 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 29,175 | cpp | #include <osg/ComputeBoundsVisitor>
#include <osg/LineWidth>
#include <osg/LineStipple>
#include <osg/MatrixTransform>
#include <osgDB/ReadFile>
#include <osgText/Text>
#include <osgText/Text3D>
#include <gdal.h>
#include <gdal_priv.h>
#include <ogrsf_frmts.h>
#include "ContourNode.h"
#include "TextureManager.h"
#include "TerrainTileManager.h"
#include "FileReadFunc.h"
const std::string m_contourVShaderPath = "shaders/LineRender.vert";
const std::string m_contourFShaderPath = "shaders/LineRender.frag";
const std::string m_contourLabelVShaderPath = "shaders/LabelRender.vert";
const std::string m_contourLabelFShaderpath = "shaders/LabelRender.frag";
ContourNode::ContourNode():
m_id(""),
m_viewer(NULL),
m_stateSet(NULL),
m_contourLabelGroup(new osg::Group()),
m_width(1.0f),
m_color(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f)),
m_contourStyle(""),
m_allContourPointNum(0),
m_terrainNode(NULL),
m_demTextureManager(NULL),
m_demTextureIndex(0),
m_xOffset(0.0f),
m_yOffset(0.0f),
m_xBaseNum(100000.0f),
m_yBaseNum(100000.0f),
m_terrainScaleZ(1.0f),
m_labelSize(100.0f)
{
}
ContourNode::~ContourNode()
{
}
void ContourNode::init()
{
//获取状态集
m_stateSet = getOrCreateStateSet();
//创建program对象加载shader
osg::ref_ptr<osg::Program> pProgram = new osg::Program();
osg::ref_ptr<osg::Shader> pVShader = osg::Shader::readShaderFile(osg::Shader::VERTEX, m_sourcePath + m_contourVShaderPath);
osg::ref_ptr<osg::Shader> pFShader = osg::Shader::readShaderFile(osg::Shader::FRAGMENT, m_sourcePath + m_contourFShaderPath);
pProgram->addShader(pVShader);
pProgram->addShader(pFShader);
m_stateSet->setAttribute(pProgram);
//判断是否存在地形
bool isTerrainExist = false;
if(m_terrainNode)
{
isTerrainExist = true;
m_demTextureManager = new TextureManager(m_terrainNode);
m_demTextureManager->setSourcePath(m_sourcePath);
m_demTextureManager->init();
addChild(m_demTextureManager);
osg::ref_ptr<osg::Texture2D> pDemTexture = m_demTextureManager->getOrCreateDemTexture();
osg::ref_ptr<osg::Uniform> pUniformTexture = new osg::Uniform("terrainTexture", m_demTextureIndex);
m_stateSet->addUniform(pUniformTexture);
m_stateSet->setTextureAttributeAndModes(m_demTextureIndex, pDemTexture);
osg::Vec3 minCoord(m_demTextureManager->getTerrainBoundingBox()._min);
osg::Vec3 maxCoord(m_demTextureManager->getTerrainBoundingBox()._max);
minCoord.x() -= m_xOffset;
maxCoord.x() -= m_xOffset;
minCoord.y() -= m_yOffset;
maxCoord.y() -= m_yOffset;
osg::ref_ptr<osg::Uniform> pUniformMinCoord = new osg::Uniform("minCoord", minCoord);
osg::ref_ptr<osg::Uniform> pUniformMaxCoord = new osg::Uniform("maxCoord", maxCoord);
m_stateSet->addUniform(pUniformMinCoord);
m_stateSet->addUniform(pUniformMaxCoord);
osg::ref_ptr<osg::Uniform> pTerrainScaleUniform = new osg::Uniform("terrainScale", m_terrainScaleZ);
m_stateSet->addUniform(pTerrainScaleUniform);
}
osg::ref_ptr<osg::Uniform> pUniformColor = new osg::Uniform("color", m_color);
m_stateSet->addUniform(pUniformColor);
osg::ref_ptr<osg::LineWidth> pLineWidth = new osg::LineWidth();
pLineWidth->setWidth(m_width);
m_stateSet->setAttribute(pLineWidth, osg::StateAttribute::ON);
m_stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF|osg::StateAttribute::PROTECTED);
m_stateSet->setMode(GL_BLEND, osg::StateAttribute::ON);
m_stateSet->setMode(GL_LINE_SMOOTH, osg::StateAttribute::ON);
m_stateSet->setRenderingHint(GL_LINE_SMOOTH_HINT);
//反走样的fastest效果设置
m_stateSet->setRenderingHint(GL_FASTEST);
//允许设置线的样式
m_stateSet->setMode(GL_LINE_STIPPLE, osg::StateAttribute::ON);
//线样式的设置
osg::ref_ptr<osg::LineStipple> pLineStipple = new osg::LineStipple(1, 0xFFFF/*0x27FF*/);
m_stateSet->setAttribute(pLineStipple, osg::StateAttribute::ON);
//根据x、y的坐标基数为变换矩阵的偏移量
/*osg::ref_ptr<osg::MatrixTransform> pMatrixTransform = new osg::MatrixTransform();
pMatrixTransform->setMatrix(osg::Matrix::translate(m_xOffset, m_yOffset, 0.0f));
pMatrixTransform->addChild(this);
addChild(pMatrixTransform);*/
//addChild(m_contourLabelGroup);
computeContourBoundingBox();
computeContourInfo();
computeAllContourPointNum();
}
void ContourNode::initLabel()
{
//获取状态集
osg::ref_ptr<osg::StateSet> pstateSet = m_contourLabelGroup->getOrCreateStateSet();
//创建program对象加载shader
osg::ref_ptr<osg::Program> pProgram = new osg::Program();
osg::ref_ptr<osg::Shader> pVShader = osg::Shader::readShaderFile(osg::Shader::VERTEX, m_sourcePath + m_contourLabelVShaderPath);
osg::ref_ptr<osg::Shader> pFShader = osg::Shader::readShaderFile(osg::Shader::FRAGMENT, m_sourcePath + m_contourLabelFShaderpath);
pProgram->addShader(pVShader);
pProgram->addShader(pFShader);
pstateSet->setAttribute(pProgram);
//判断是否存在地形
bool isTerrainExist = false;
if(m_terrainNode)
{
isTerrainExist = true;
osg::ref_ptr<TextureManager> pdemTextureManager = m_demTextureManager; /*new TextureManager(m_terrainNode)*/;
//pdemTextureManager->setSourcePath(m_sourcePath);
//pdemTextureManager->init();
m_contourLabelGroup->addChild(pdemTextureManager);
osg::ref_ptr<osg::Texture2D> pDemTexture = pdemTextureManager->getOrCreateDemTexture();
osg::ref_ptr<osg::Uniform> pUniformTexture = new osg::Uniform("terrainTexture", 1);
pstateSet->addUniform(pUniformTexture);
pstateSet->setTextureAttributeAndModes(1, pDemTexture);
osg::Vec3 minCoord(pdemTextureManager->getTerrainBoundingBox()._min);
osg::Vec3 maxCoord(pdemTextureManager->getTerrainBoundingBox()._max);
minCoord.x() -= m_xOffset;
maxCoord.x() -= m_xOffset;
minCoord.y() -= m_yOffset;
maxCoord.y() -= m_yOffset;
osg::ref_ptr<osg::Uniform> pUniformMinCoord = new osg::Uniform("minCoord", minCoord);
osg::ref_ptr<osg::Uniform> pUniformMaxCoord = new osg::Uniform("maxCoord", maxCoord);
pstateSet->addUniform(pUniformMinCoord);
pstateSet->addUniform(pUniformMaxCoord);
/*osg::ref_ptr<osg::Uniform> pTerrainScaleUniform = new osg::Uniform("terrainScale", m_terrainScaleZ);
pstateSet->addUniform(pTerrainScaleUniform);*/
}
osg::Vec4 labelColor = osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f);
osg::ref_ptr<osg::Uniform> pUniformColor = new osg::Uniform("color", labelColor);
pstateSet->addUniform(pUniformColor);
//根据x、y的坐标基数为变换矩阵的偏移量
/*osg::ref_ptr<osg::MatrixTransform> pMatrixTransform = new osg::MatrixTransform();
pMatrixTransform->setMatrix(osg::Matrix::translate(m_xOffset, m_yOffset, 0.0f));
pMatrixTransform->addChild(m_contourLabelGroup);
addChild(pMatrixTransform);*/
addChild(m_contourLabelGroup);
}
void ContourNode::setID(const std::string& id)
{
m_id = id;
}
std::string ContourNode::getID() const
{
return m_id;
}
void ContourNode::setContourLabelGroup(osg::Group* pContourLabelGroup)
{
m_contourLabelGroup = pContourLabelGroup;
}
osg::ref_ptr<osg::Group> ContourNode::getContourLabelGroup()
{
return m_contourLabelGroup;
}
void ContourNode::setContourWidth(const float& width)
{
m_width = width;
osg::ref_ptr<osg::LineWidth> pLineWidth = new osg::LineWidth();
pLineWidth->setWidth(m_width);
m_stateSet->setAttribute(pLineWidth, osg::StateAttribute::ON);
}
float ContourNode::getContourWidth() const
{
return m_width;
}
void ContourNode::setContourColor(const osg::Vec4& color)
{
m_color = color;
osg::ref_ptr<osg::Uniform> pUniformColor = new osg::Uniform("color", m_color);
m_stateSet->addUniform(pUniformColor);
}
osg::Vec4 ContourNode::getContourColor() const
{
return m_color;
}
void ContourNode::setLabelColor(const osg::Vec4& pColor)
{
osg::ref_ptr<osg::Uniform> pUniformColor = new osg::Uniform("color", pColor);
osg::ref_ptr<osg::StateSet> pLabelStateSet = m_contourLabelGroup->getOrCreateStateSet();
pLabelStateSet->addUniform(pUniformColor);
}
void ContourNode::setContourStyle(const std::string& pContourStyle)
{
m_contourStyle = pContourStyle;
std::map<unsigned int,osg::ref_ptr<ContourGeode>>::iterator Iter = m_contourGeodeMap.begin();
for(; Iter != m_contourGeodeMap.end(); Iter++)
{
osg::ref_ptr<ContourGeode> pContourGeode = Iter->second;
pContourGeode->setContourStyle(pContourStyle);
}
}
std::string ContourNode::getContourStyle() const
{
return m_contourStyle;
}
void ContourNode::computeAllContourPointNum()
{
std::map<unsigned int,osg::ref_ptr<ContourGeode>>::iterator Iter = m_contourGeodeMap.begin();
for(; Iter != m_contourGeodeMap.end(); Iter++)
{
osg::ref_ptr<ContourGeode> pContourGeode = Iter->second;
m_allContourPointNum = m_allContourPointNum + (long)pContourGeode->getCtrlPointNum();
}
}
unsigned int ContourNode::getAllContourPointNum()
{
return m_allContourPointNum;
}
osg::BoundingBox ContourNode::computeContourBoundingBox()
{
osg::ComputeBoundsVisitor cbVisitor;
accept(cbVisitor);
m_box = cbVisitor.getBoundingBox();
return m_box;
}
void ContourNode::setTerrainNode(osg::Node* pTerrainNode)
{
m_terrainNode = pTerrainNode;
}
osg::Node* ContourNode::getTerrainNode()
{
return m_terrainNode;
}
void ContourNode::setSourcePath(const std::string& sourcePath)
{
m_sourcePath = sourcePath;
}
void ContourNode::setContourViewer(osgViewer::Viewer* pViewer)
{
m_viewer = pViewer;
}
void ContourNode::computeContourInfo()
{
size_t dotPosition = m_id.find_last_of('.');
if(dotPosition == std::string::npos)
{
std::cerr<<"文件名字有错误"<<std::endl;
return;
}
std::string extensionName = m_id.substr(dotPosition + 1);
std::transform(extensionName.begin(), extensionName.end(),extensionName.begin(), toupper);
if(extensionName == "SHP")
computeContourInfoFromSHP();
else if(extensionName == "CON")
computeContourInfoFromCON();
/*
m_info.m_xMin = m_box.xMin();
m_info.m_yMin = m_box.yMin();
m_info.m_xMax = m_box.xMax();
m_info.m_yMax = m_box.yMax();
std::sort(m_values.begin(),m_values.end());
m_info.m_minElevation = *(m_values.begin());
m_info.m_maxElevation = *(m_values.end() - 1);
float value = *(m_values.begin());
float currentValue = *(m_values.begin());
std::vector<float>::iterator Iter = m_values.begin();
for(; Iter != m_values.end(); Iter++)
{
currentValue = *Iter;
if(currentValue != value)
break;
}
m_info.m_step = fabs(currentValue - value);*/
}
void ContourNode::computeContourInfoFromSHP()
{
FILE* file = NULL;
char* fileBuf;
if((file = fopen(m_id.c_str(), "rb")) == NULL)
{
std::cout<<"SHP文件无法打开!"<<std::endl;
return ;
}
long fileSize = KLValueOfFile::sizeOfFile(file);
fileBuf = new char[fileSize];
fread(fileBuf, fileSize, 1 ,file);
int ShapeType;
ShapeType = KLValueOfFile::littleEndianIntRead(fileBuf, 32);
if(ShapeType!=3 && ShapeType != 13)
{
std::cout<<"此文件内容非等值线"<<std::endl;
return;
}
m_info.m_xMin = KLValueOfFile::littleEndianDoubleRead(fileBuf, 36);
m_info.m_yMin = KLValueOfFile::littleEndianDoubleRead(fileBuf, 44);
m_info.m_xMax = KLValueOfFile::littleEndianDoubleRead(fileBuf, 52);
m_info.m_yMax = KLValueOfFile::littleEndianDoubleRead(fileBuf, 60);
double minHeight = KLValueOfFile::littleEndianDoubleRead(fileBuf, 68);
double MaxHeight = KLValueOfFile::littleEndianDoubleRead(fileBuf, 76);
delete []fileBuf;
fclose(file);
std::vector<float> pValues;
std::vector<float>::iterator Iter = m_values.begin();
for(; Iter != m_values.end(); Iter++)
{
pValues.push_back(*Iter);
}
std::sort(pValues.begin(),pValues.end());
m_info.m_minElevation = *(pValues.begin());
m_info.m_maxElevation = *(pValues.end() - 1);
float value = *(pValues.begin());
float currentValue = *(pValues.begin());
std::vector<float>::iterator Iter2 = pValues.begin();
for(; Iter2 != pValues.end(); Iter2++)
{
currentValue = *Iter2;
if(currentValue != value)
break;
}
m_info.m_step = fabs(currentValue - value);
}
void ContourNode::computeContourInfoFromCON()
{
}
ContourInfo ContourNode::getContourInfo()
{
return m_info;
}
float ContourNode::getXOffset()
{
return m_xOffset;
}
float ContourNode::getYOffset()
{
return m_yOffset;
}
void ContourNode::setTerrainScale(osg::MatrixTransform* mt)
{
osg::Matrix invertMatrix = mt->getInverseMatrix();
m_terrainScaleZ = (invertMatrix.getScale()).z();
}
/*
void ContourNode::generateContourNodeFromSHP(const std::string& fileName)
{
long startTime = clock();
osg::ref_ptr<osg::Geode> pGeode = dynamic_cast<osg::Geode*>(osgDB::readNodeFile(fileName));
long endTime = clock();
std::cout<<"OSG插件读取SHP文件所用时间:"<< (endTime - startTime)/1000 <<"秒!"<<std::endl;
TerrainTileManager* pTerrainTileManager = new TerrainTileManager(m_terrainNode);
pTerrainTileManager->gatherCurrentOSGScenceTerrainTile();
osg::ref_ptr<osg::Geometry> p_Geometry = pGeode->getDrawable(0)->asGeometry();
osg::ref_ptr<osg::Array> p_Array = p_Geometry->getVertexArray();
unsigned int num = p_Array->getType();
osg::ref_ptr<osg::Vec3Array> p_VecArray = dynamic_cast<osg::Vec3Array*>(p_Geometry->getVertexArray());
float xBase = 0.0f;
float yBase = 0.0f;
float sampleXCoord = (*p_VecArray)[0].x();
float sampleYCoord = (*p_VecArray)[0].y();
xBase = floorf(sampleXCoord / m_xBaseNum);
yBase = floorf(sampleYCoord / m_yBaseNum);
(xBase >= 1.0) ? m_xOffset = xBase * m_xBaseNum : m_xOffset = 0.0f;
(yBase >= 1.0) ? m_yOffset = yBase * m_yBaseNum : m_yOffset = 0.0f;
unsigned int NumOfGeo = pGeode->getNumDrawables();
for(unsigned int i = 0; i < NumOfGeo; i++)
{
osg::ref_ptr<ContourGeode> pContourGeode = new ContourGeode();
osg::ref_ptr<osg::Vec3Array> coor = new osg::Vec3Array();
m_currentCoords.push_back(coor);
osg::ref_ptr<osg::Geometry> pGeometry = pGeode->getDrawable(i)->asGeometry();
osg::ref_ptr<osg::Vec3Array> pVec3Array = dynamic_cast<osg::Vec3Array*>(pGeometry->getVertexArray());
osg::ref_ptr<osg::Vec3Array> pCtrlArray = new osg::Vec3Array();
unsigned int NumOfArr = pVec3Array->size();
bool signal = false;
for(unsigned int j = 0; j < NumOfArr; j++)
{
pTerrainTileManager->getValue((*pVec3Array)[j].x(),(*pVec3Array)[j].y(),(*pVec3Array)[j].z());
if((*pVec3Array)[j].z() > 0 && signal == false)
{
m_values.push_back(ceil((*pVec3Array)[j].z()));
signal = true;
}
m_currentCoords[i]->push_back(osg::Vec3((*pVec3Array)[j].x(),(*pVec3Array)[j].y(),(*pVec3Array)[j].z()));
(*pVec3Array)[j].x() = (*pVec3Array)[j].x() - m_xOffset;
(*pVec3Array)[j].y() = (*pVec3Array)[j].y() - m_yOffset;
pCtrlArray->push_back(osg::Vec3((*pVec3Array)[j].x(),(*pVec3Array)[j].y(),(*pVec3Array)[j].z()));
}
if(signal == false)
m_values.push_back(0.0f);
pContourGeode->setID(i+1);
pContourGeode->setCtrlPointArray(pCtrlArray);
pContourGeode->setXOffset(m_xOffset);
pContourGeode->setYOffset(m_yOffset);
pContourGeode->init();
addChild(pContourGeode);
m_contourGeodeMap.insert(std::pair<unsigned int,osg::ref_ptr<ContourGeode>>(i+1, pContourGeode));
//std::cout<<"生成第"<< i + 1<<"条线"<<std::endl;
}
delete pTerrainTileManager;
pTerrainTileManager = NULL;
}
*/
void ContourNode::generateContourNodeFromSHP(const std::string& fileName)
{
m_id = fileName;
//读取Shp文件的高程,暂时将dbf文件转化成txt文件,读取txt文件
KLValueOfFile::readContourHeightFromTxt(fileName, m_values);
long startTime = clock();
osg::ref_ptr<osg::Geode> pGeode = dynamic_cast<osg::Geode*>(osgDB::readNodeFile(fileName));
long endTime = clock();
std::cout<<"OSG插件读取SHP文件所用时间:"<< (endTime - startTime)/1000 <<"秒!"<<std::endl;
TerrainTileManager* pTerrainTileManager = new TerrainTileManager(m_terrainNode);
pTerrainTileManager->gatherCurrentOSGScenceTerrainTile();
osg::ref_ptr<osg::Geometry> p_Geometry = pGeode->getDrawable(0)->asGeometry();
osg::ref_ptr<osg::Array> p_Array = p_Geometry->getVertexArray();
unsigned int num = p_Array->getType();
osg::ref_ptr<osg::Vec3Array> p_VecArray = dynamic_cast<osg::Vec3Array*>(p_Geometry->getVertexArray());
float xBase = 0.0f;
float yBase = 0.0f;
float sampleXCoord = (*p_VecArray)[0].x();
float sampleYCoord = (*p_VecArray)[0].y();
xBase = floorf(sampleXCoord / m_xBaseNum);
yBase = floorf(sampleYCoord / m_yBaseNum);
(xBase >= 1.0) ? m_xOffset = xBase * m_xBaseNum : m_xOffset = 0.0f;
(yBase >= 1.0) ? m_yOffset = yBase * m_yBaseNum : m_yOffset = 0.0f;
unsigned int NumOfGeo = pGeode->getNumDrawables();
for(unsigned int i = 0; i < NumOfGeo; i++)
{
osg::ref_ptr<ContourGeode> pContourGeode = new ContourGeode();
osg::ref_ptr<osg::Geometry> pGeometry = pGeode->getDrawable(i)->asGeometry();
osg::ref_ptr<osg::Vec3Array> pCtrlArray = dynamic_cast<osg::Vec3Array*>(pGeometry->getVertexArray());
unsigned int NumOfArr = pCtrlArray->size();
for(unsigned int j = 0; j < NumOfArr; j++)
{
pTerrainTileManager->getValue((*pCtrlArray)[j].x(),(*pCtrlArray)[j].y(),(*pCtrlArray)[j].z());
(*pCtrlArray)[j].x() = (*pCtrlArray)[j].x() - m_xOffset;
(*pCtrlArray)[j].y() = (*pCtrlArray)[j].y() - m_yOffset;
}
pContourGeode->setID(i+1);
pContourGeode->setCtrlPointArray(pCtrlArray);
pContourGeode->setContourHeight(m_values[i]);
pContourGeode->setXOffset(m_xOffset);
pContourGeode->setYOffset(m_yOffset);
pContourGeode->init();
addChild(pContourGeode);
m_contourGeodeMap.insert(std::pair<unsigned int,osg::ref_ptr<ContourGeode>>(i+1, pContourGeode));
//std::cout<<"生成第"<< i + 1<<"条线"<<std::endl;
}
std::cout<<"等值线总共的条数是:"<<NumOfGeo<<std::endl;
delete pTerrainTileManager;
pTerrainTileManager = NULL;
}
void ContourNode::generateContourNodeFromShpByGDAL(const std::string& fileName)
{
m_id = fileName;
//读取Shp文件的高程,暂时将dbf文件转化成txt文件,读取txt文件
//KLValueOfFile::readContourHeightFromTxt(fileName, m_values);
KLValueOfFile::readDbfFunc(fileName, m_values);
TerrainTileManager* pTerrainTileManager = new TerrainTileManager(m_terrainNode);
pTerrainTileManager->gatherCurrentOSGScenceTerrainTile();
bool signal = false;
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8","NO" );
OGRRegisterAll();
OGRDataSource* poDS = (OGRDataSource*)OGRSFDriverRegistrar::Open(fileName.c_str(),FALSE);
if(poDS == NULL)
{
std::cout<<"文件无法打开"<<std::endl;
return ;
}
int mmm=0;
mmm= poDS->GetLayerCount();
OGRLayer* poLayer = poDS->GetLayer(0);
poLayer->ResetReading();
OGRFeature *poFeature;
unsigned int num = 0;
while((poFeature = poLayer->GetNextFeature()) != NULL)
{
OGRGeometry *poGeometry=poFeature->GetGeometryRef();
if (poGeometry!=NULL)
{
switch (wkbFlatten(poGeometry->getGeometryType()))
{
case wkbLineString:
num++;
OGRLineString *poLine = (OGRLineString*)poGeometry;
osg::ref_ptr<ContourGeode> pContourGeode = new ContourGeode();
osg::ref_ptr<osg::Vec3Array> pCtrlArray = new osg::Vec3Array();
for(int i = 0;i<poLine->getNumPoints();i++)
{
float x = poLine->getX(i);
float y = poLine->getY(i);
float z ;//= poLine->getZ(i);
pTerrainTileManager->getValue(x, y, z);
if(i==0 && signal == false)
{
float xBase = 0.0f;
float yBase = 0.0f;
float sampleXCoord = x;
float sampleYCoord = y;
xBase = floorf(sampleXCoord / m_xBaseNum);
yBase = floorf(sampleYCoord / m_yBaseNum);
(xBase >= 1.0) ? m_xOffset = xBase * m_xBaseNum : m_xOffset = 0.0f;
(yBase >= 1.0) ? m_yOffset = yBase * m_yBaseNum : m_yOffset = 0.0f;
signal = true;
}
x = x - m_xOffset;
y = y - m_yOffset;
pCtrlArray->push_back(osg::Vec3(x, y, z));
}
pContourGeode->setID(num);
pContourGeode->setCtrlPointArray(pCtrlArray);
pContourGeode->setContourHeight(m_values[num-1]);
pContourGeode->setXOffset(m_xOffset);
pContourGeode->setYOffset(m_yOffset);
pContourGeode->init();
addChild(pContourGeode);
m_contourGeodeMap.insert(std::pair<unsigned int,osg::ref_ptr<ContourGeode>>(num, pContourGeode));
OGRFeature::DestroyFeature( poFeature );
break;
}
}
}
std::cout<<"等值线总共的条数是:"<<num<<std::endl;
delete pTerrainTileManager;
pTerrainTileManager = NULL;
}
void ContourNode::generateContourNodeFromCon(const std::string& fileName)
{
m_id = fileName;
std::ifstream file(fileName.c_str());
std::string line;
bool readValueBegun = false;
float x = 0.0f;
float y = 0.0f;
float height = 0.0f;
int number = 0;
int currentNumber = 0;
bool signal = false;
long beginTime = clock();
while(!file.eof())
{
std::getline(file,line);
if(readValueBegun)
{
std::istringstream iss(line);
iss >> x >> y >> height >> number;
if(number != currentNumber)
{
osg::ref_ptr<osg::Vec3Array> pCtrlArray = new osg::Vec3Array;
m_values.push_back(height);
m_currentCoords.push_back(pCtrlArray);
currentNumber = number;
}
if(signal == false)
{
float xBase = 0.0f;
float yBase = 0.0f;
float sampleXCoord = x;
float sampleYCoord = y;
xBase = floorf(sampleXCoord / m_xBaseNum);
yBase = floorf(sampleYCoord / m_yBaseNum);
(xBase >= 1.0) ? m_xOffset = xBase * m_xBaseNum : m_xOffset = 0.0f;
(yBase >= 1.0) ? m_yOffset = yBase * m_yBaseNum : m_yOffset = 0.0f;
signal = true;
}
x = x - m_xOffset;
y = y - m_yOffset;
m_currentCoords[currentNumber - 1]->push_back(osg::Vec3(x, y ,m_values[currentNumber - 1]));
}
else
{
if(line.size() && line[0] == '#')
{
readValueBegun = true;
}
}
}
file.close();
long endTime = clock();
std::cout<<"读取con文件的时间是:"<<(endTime-beginTime)/1000<<"秒!"<<std::endl;
for(unsigned int i = 0; i < m_currentCoords.size(); i++)
{
osg::ref_ptr<ContourGeode> pContourGeode = new ContourGeode();
osg::ref_ptr<osg::Vec3Array> pCtrlArray = m_currentCoords[i];
pContourGeode->setID(i + 1);
pContourGeode->setCtrlPointArray(pCtrlArray);
pContourGeode->setContourHeight(m_values[i]);
pContourGeode->setXOffset(m_xOffset);
pContourGeode->setYOffset(m_yOffset);
pContourGeode->init();
addChild(pContourGeode);
m_contourGeodeMap.insert(std::pair<unsigned int,osg::ref_ptr<ContourGeode>>(i + 1, pContourGeode));
}
}
ContourGeodeMap ContourNode::getContourGeodeMap()
{
return m_contourGeodeMap;
}
void ContourNode::contourRarefying()
{
//当等值线所有的控制点的数量低于1000000的时候,不再做抽稀处理
if(m_allContourPointNum <= 1000000)
{
//this->setNodeMask(true);
return;
}
//this->setNodeMask(true);
osg::Camera* pCamera = m_viewer->getCamera();
osg::Vec3d eye;
osg::Vec3d center;
osg::Vec3d up;
pCamera->getViewMatrixAsLookAt(eye, center, up);
double distance = fabs(eye.z());
/*if(distance < 30000)
this->setNodeMask(true);
else
this->setNodeMask(false);*/
float pContourStep = m_info.m_step;
float pMinHeight = m_info.m_minElevation;
float pMaxHeight = m_info.m_maxElevation;
unsigned int Num = ceil(distance/10000.0f) + 1;
//场景中显示的等值线总共的点数量
unsigned int disPlayPointNum = 0;
if(Num < 3)
{
//pContourStep = pContourStep * Num;
std::map<unsigned int,osg::ref_ptr<ContourGeode>>::iterator Iter = m_contourGeodeMap.begin();
for(; Iter != m_contourGeodeMap.end(); Iter++)
{
osg::ref_ptr<ContourGeode> pContourGeode = Iter->second;
pContourGeode->setNodeMask(true);
osg::ref_ptr<osg::Geode> pTextGeode = pContourGeode->getTextGeode();
if(pTextGeode)
pTextGeode->setNodeMask(true);
disPlayPointNum += pContourGeode->getCtrlPointNum();
}
}
else
{
//首先将所有的等值线(标注)隐藏
std::map<unsigned int,osg::ref_ptr<ContourGeode>>::iterator Iter = m_contourGeodeMap.begin();
for(; Iter != m_contourGeodeMap.end(); Iter++)
{
osg::ref_ptr<ContourGeode> pContourGeode = Iter->second;
pContourGeode->setNodeMask(false);
osg::ref_ptr<osg::Geode> pTextGeode = pContourGeode->getTextGeode();
if(pTextGeode)
pTextGeode->setNodeMask(false);
}
pContourStep = pContourStep * Num;
float contourExtension = pMaxHeight - pMinHeight;
if(pContourStep > contourExtension)
return;
unsigned int circulateNum = (unsigned int)(contourExtension/pContourStep);
for(unsigned int i = 0; i <= circulateNum; i++)
{
unsigned int contourNum = 0;
std::map<unsigned int,osg::ref_ptr<ContourGeode>>::iterator Iter = m_contourGeodeMap.begin();
for(; Iter != m_contourGeodeMap.end(); Iter++)
{
osg::ref_ptr<ContourGeode> pContourGeode = Iter->second;
if(pContourGeode->getContourHeight() == (pMinHeight + pContourStep*i))
{
pContourGeode->setNodeMask(true);
osg::ref_ptr<osg::Geode> pTextGeode = pContourGeode->getTextGeode();
if(pTextGeode)
pTextGeode->setNodeMask(true);
contourNum++;
disPlayPointNum += pContourGeode->getCtrlPointNum();
}
}
std::cout<<"高程为"<< (pMinHeight + pContourStep*i) <<"m的等值线找到"<<contourNum<<"条"<<std::endl;
}
std::cout<<std::endl;
}
std::cout<<"场景中现有等值线的点的数量是:"<<disPlayPointNum<<std::endl;
std::cout<<std::endl;
}
void ContourNode::notContourRarefying()
{
std::map<unsigned int,osg::ref_ptr<ContourGeode>>::iterator Iter = m_contourGeodeMap.begin();
for(; Iter != m_contourGeodeMap.end(); Iter++)
{
osg::ref_ptr<ContourGeode> pContourGeode = Iter->second;
pContourGeode->setNodeMask(true);
osg::ref_ptr<osg::Geode> pTextGeode = pContourGeode->getTextGeode();
if(pTextGeode)
pTextGeode->setNodeMask(true);
}
}
void ContourNode::computeOrReadFileGenerateLabel()
{
size_t dotPosition = m_id.find_last_of('.');
if(dotPosition == std::string::npos)
{
std::cerr<<"文件名字有错误"<<std::endl;
return;
}
std::string fileBaseName = m_id.substr(0,dotPosition);
std::string fileNameOfLabelTxt = fileBaseName + "_label.txt";
std::fstream file(fileNameOfLabelTxt);
//如果文件为空需要计算生成标注文件
if(!file)
{
std::cout<<"标注文件不存在,需要生成标注文件,请耐心等待......"<<std::endl;
unsigned int lineNum = 0;
long startTime = clock();
ContourGeodeMap pcontourGeodeMap = this->getContourGeodeMap();
std::map<unsigned int,osg::ref_ptr<ContourGeode>>::iterator Iter = pcontourGeodeMap.begin();
for(; Iter != pcontourGeodeMap.end(); Iter++)
{
lineNum++;
osg::ref_ptr<ContourGeode> pContourGeode = Iter->second;
pContourGeode->computeLabelPositon();
std::cout<<"计算完第"<<lineNum<<"条!"<<std::endl;
osg::ref_ptr<osg::Geode> ptextGeode = pContourGeode->getTextGeode();
m_contourLabelGroup->addChild(ptextGeode);
std::vector<osg::Vec2d> ptextPositionVector = pContourGeode->getLabelPosition();
//向文件写数据
}
initLabel();
long endTime = clock();
std::cout<<"标注文件已生成,耗时为:"<< (endTime - startTime)/1000 <<"秒!"<<std::endl;
}
else
{
std::cout<<"标注文件存在,需要读取生成标注节点,请耐心等待......"<<std::endl;
}
file.close();
}
osg::ref_ptr<osg::Group> ContourNode::generateContourLabelNode(std::vector<osg::ref_ptr<osg::Vec3Array>> pcurrentCoords)
{
m_occupied = new std::vector<OccupyingRectangle>();
osg::ref_ptr<osg::Group> pGroup = new osg::Group();
for(std::vector<int>::size_type i = 0; i < pcurrentCoords.size(); i++)
{
if(i % (0 + 1) == 0)
{
std::stringstream value;
value << m_values[i];
bool found = false;
osg::Vec3 position;
for(osg::Vec3Array::size_type j = 0; j < pcurrentCoords[i]->size(); ++j)
{
position = pcurrentCoords[i]->at(j);
position.x() -= m_xOffset;
position.y() -= m_yOffset;
if(!isOccupied(position, value.str().size()))
{
found = true;
break;
}
}
if(found)
{
//osgText::Text3D *text = new osgText::Text3D();
osgText::Text* text = new osgText::Text();
osg::ref_ptr<osgText::Font> font= new osgText::Font();
font = osgText::readFontFile("simhei.ttf");
text->setFont(font.get());
text->setCharacterSize(m_labelSize);
text->setColor(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
text->setText(value.str());
//用shader时显示标注的位置
text->setPosition(osg::Vec3(position.x(), position.y(), m_values[i] + 30));
//非shader时显示标注的位置
//text->setPosition(osg::Vec3(position.x() + m_xOffset, position.y() + m_yOffset, m_values[i] + 30));
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
geode->addDrawable(text);
pGroup->addChild(geode);
}
}
}
delete m_occupied;
return pGroup;
}
bool ContourNode::isOccupied(osg::Vec3 position, std::string::size_type size)
{
float labelSize = m_labelSize * 1.2f;
float x01 = position.x();
float y01 = position.y();
float x02 = x01 + labelSize * static_cast<float>(size)/1.6f;
float y02 = y01 + labelSize;
std::vector<OccupyingRectangle>::iterator Iter;
for(Iter = m_occupied->begin(); Iter != m_occupied->end(); Iter++)
{
if(x01 < Iter->x2 && Iter->x1 < x02 && y01 < Iter->y2 && Iter->y1 < y02)
{
return true;
}
}
m_occupied->push_back(OccupyingRectangle(x01, x02, y01, y02));
return false;
}
std::vector<osg::ref_ptr<osg::Vec3Array>> ContourNode::getCurrentCoords()
{
return m_currentCoords;
} | [
"jackwongupc@163.com"
] | jackwongupc@163.com |
be8e8e6c97601dbfce23c8cf31cadeeddf9763aa | 378d404d4b8ec12dd9548470fa3b33d3dec087ff | /Codeforce/round670/round670b.cpp | 9d15d4526e586ea86bb3781c3b78258bd639ec95 | [] | no_license | kk-katayama/com_pro | d0e8871aff88e7939d439c37f9cafd2d11a870fc | a3a6a3bcb846e2eded42d1fed5d9495e53a73e41 | refs/heads/master | 2021-06-25T18:49:35.320092 | 2021-02-05T06:50:38 | 2021-02-05T06:50:38 | 200,748,000 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,811 | cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <cmath>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep1(i,n) for(int i = 1; i <= n; ++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }
typedef long long ll;
int main()
{
int t; cin >> t;
while(t-- > 0) {
int n,k; cin >> n;
k = 5;
vector<ll> a(n);
rep(i,n) cin >> a[i];
sort(a.begin(), a.end(), [](ll x, ll y) {
return abs(x) > abs(y);
});
ll cnt = 0;
ll sum = 1;
ll emin = -1, omin = -1, emax = -1, omax = -1;
rep(i,k) {
sum *= abs(a[i]);
if(a[i] > 0) {
emin = i;
}
else if(a[i] < 0) {
omin = i;
cnt++;
}
}
if(cnt % 2 == 0) {
cout << sum << "\n";
continue;
}
for (ll i = k; i < n; ++i) {
if(a[i] > 0 && emax == -1) emax = i;
else if(a[i] < 0 && omax == -1) omax = i;
}
bool fx = ((emin == -1) || (omax == -1));
bool fy = ((omin == -1) || (emax == -1));
if(fx && fy) {
ll tmp = 1;
rep(i,k) {
tmp *= (ll)abs(a[n - 1 - i]);
}
ll res = 0;
res -= tmp;
cout << res << "\n";
}
else if(fx) {
sum /= (ll)abs(a[omin]);
sum *= (ll)abs(a[emax]);
cout << sum << "\n";
}
else if(fy) {
sum /= (ll)abs(a[emin]);
sum *= (ll)abs(a[omax]);
cout << sum << "\n";
}
else {
if(a[omin] * a[omax] < a[emin] * a[emax]) {
sum /= (ll)abs(a[omin]);
sum *= (ll)abs(a[emax]);
}
else {
sum /= (ll)abs(a[emin]);
sum *= (ll)abs(a[omax]);
}
cout << sum << "\n";
}
}
return 0;
}
| [
"galapagos4444@gmail.com"
] | galapagos4444@gmail.com |
0e2ce070f3a8171c58702be6b90c6692607840ad | a75bfdb61d2bfa20f71d2a1548188db18a8e5e6d | /Codeforces/363/b.cpp | 5069bd1e60c741ddcf38362d2aed24c205fb887b | [] | no_license | Ra1nWarden/Online-Judges | 79bbe269fd35bfb1b4a5b3ea68b806fb39b49e15 | 6d8516bb1560f3620bdc2fc429863a1551d60e6a | refs/heads/master | 2022-05-01T17:50:00.253901 | 2022-04-18T06:55:25 | 2022-04-18T06:55:25 | 18,355,773 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 747 | cpp | #include <cstdio>
#include <cstring>
using namespace std;
const int maxn = 1000;
int row[maxn+5], col[maxn+5];
char board[maxn+5][maxn+5];
int n, m;
int main() {
scanf("%d%d\n", &n, &m);
for(int i = 0; i < n; i++)
scanf("%s\n", board[i]);
int total = 0;
memset(row, 0, sizeof row);
memset(col, 0, sizeof col);
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
if(board[i][j] == '*') {
row[i]++;
col[j]++;
total++;
}
}
}
bool ans = false;
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
int cur = row[i] + col[j];
if(board[i][j] == '*')
cur--;
if(cur == total) {
printf("YES\n%d %d\n", i+1, j+1);
return 0;
}
}
}
printf("NO\n");
return 0;
}
| [
"wzh19921016@gmail.com"
] | wzh19921016@gmail.com |
36cede6c30ef6d33d93110e8e17fc4a80446c699 | ad74f7a42e8dec14ec7576252fcbc3fc46679f27 | /AresProtector/AresDialog.h | c23564f7cab03dcd08e9f9246ded82eb5cf3d21a | [] | no_license | radtek/TrapperKeeper | 56fed7afa259aee20d6d81e71e19786f2f0d9418 | 63f87606ae02e7c29608fedfdf8b7e65339b8e9a | refs/heads/master | 2020-05-29T16:49:29.708375 | 2013-05-15T08:33:23 | 2013-05-15T08:33:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,375 | h | #pragma once
#include "resource.h"
#include "afxcmn.h"
#include "afxwin.h"
#include <pdh.h>
#include "..\tkcom\vector.h"
// CAresDialog dialog
class CAresDialog : public CDialog
{
DECLARE_DYNAMIC(CAresDialog)
/*
class ByteSentEvent : public Object{
CTime m_time;
UINT m_amount;
ByteSentEvent(UINT amount){
m_time=CTime::GetCurrentTime();
m_amount=amount;
}
}*/
private:
void OnUltrapeerSelectionChange(void);
public:
CAresDialog(CWnd* pParent = NULL); // standard constructor
virtual ~CAresDialog();
// Dialog Data
enum { IDD = IDD_ARESDIALOG };
protected:
Vector mv_selected_peer;
Vector mv_selected_packet;
HQUERY m_pdh;
string m_keynames[5];
HCOUNTER m_pdh_counters[5];
bool m_performance_counters_initialized;
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
afx_msg void OnTimer(UINT nIDEvent);
protected:
void UpdateGUI(void);
public:
CListCtrl m_ultra_peers;
CStatic m_known_ultra_peers;
CStatic m_connected_ultra_peers;
bool CheckPerformanceCounters(void);
CStatic m_system_status;
CStatic m_total_cpu;
CStatic m_ares_cpu;
CStatic m_receive_bandwidth;
CStatic m_send_bandwidth;
CStatic m_system_memory;
CStatic m_tk_memory;
bool InitPerformanceCounters(void);
void ClosePerformanceCounters(void);
CString FormatNumberForDisplay(UINT number);
CListCtrl m_peers;
CSliderCtrl m_event_time_slider;
CStatic m_event_time;
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
CButton m_record_events;
afx_msg void OnBnClickedRecordEvents();
afx_msg void OnClickUltrapeers(NMHDR *pNMHDR, LRESULT *pResult);
CListCtrl m_event_list;
afx_msg void OnLvnKeydownUltrapeers(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnBnClickedPurgedeadconnectionsnow();
CStatic m_ultra_peers_with_files;
CStatic m_spoofs_loaded;
CRichEditCtrl m_hex_view;
CStatic m_file_transfer_peer_count;
CStatic m_send_queue_size;
CStatic m_interdiction_target_count;
CStatic m_interdiction_transfer_amount;
CStatic m_interdiction_connection_count;
CStatic m_interdiction_connection_transfer_count;
CStatic m_interdiction_banned_client_ratio;
CStatic m_interdiction_queue_size;
void UpdateLogs(void);
CStatic m_hash_cache_efficiency;
};
| [
"occupymyday@gmail.com"
] | occupymyday@gmail.com |
65175afc5efe017ee6af7a5695e0a661268a5b73 | baec2acf0f463834b08b02776def1936900d1bb1 | /Carrinho/Ultrasonic.h | 126963fa0ebf3806169d84151b7507707eda4b0a | [] | no_license | joaozanlorensi/smart-autonomous-and-remote-controlled-car | b037397256aa34515ff85977f744b2256f20a284 | 2f786828677b8777fb95a2a85c1a5b5867ac7373 | refs/heads/master | 2020-05-20T23:34:13.643613 | 2019-08-28T14:09:13 | 2019-08-28T14:09:13 | 185,804,271 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 186 | h | #pragma once
class Ultrasonic {
short trigPin, echoPin;
public:
Ultrasonic(short trigPin, short echoPin);
float getDistance();
float getAveragedDistance(short numOfSamples);
}; | [
"shigueo.miamoto@gmail.com"
] | shigueo.miamoto@gmail.com |
75a4ca02c5de1b7da60c769670fb30ef78348477 | e98110347c57de92c6b68d5eb2e2674cb5d97bd3 | /PipingDemo/Fibo.cpp | 7a588260032efd43ff032069788676d130fe9b5c | [] | no_license | likeawalrus/School | 1a45096262dff6ef0d6176e116bd6a96a25cd9d7 | f28d10ea7555f7665c66d497a8cbf6ce72838cb1 | refs/heads/master | 2021-01-11T20:10:52.064899 | 2017-01-25T02:37:48 | 2017-01-25T02:37:48 | 79,059,573 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,251 | cpp | //Cole Hannel
//CSCI 176 Program 1
//Program takes a command line input that is a number n and returns the time it
//takes to iteratively and recursive reach the nth Fibonacci number
//Program uses four processes, one control process and one process for each of
//the methods of running Fibo. It uses pipes to communicate between the processes
#include <unistd.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include <sstream>
#include <ctime>
#include <wait.h>
using namespace std;
long iterativeFibo(int);
long recursiveFibo(int);
int main(int argc, char* argv[]){
int pid[4];
int satus, i;
int p1[2],p2[2], p3[2], p4[2];
istringstream ss(argv[1]);
int x, y;
int res1, res2;
double timeiterative, timerecursive, timecontit = 0.0, timecontrec = 0.0;
ss >> x;
y = x;
//I dislike having lots of spare processes that do nothing
//So I came up with this as a method to get three children
//and only three children using forks
pid[0]=0;pid[1]=0;pid[2]=0;pid[3]=0;
pipe(p1); pipe(p2);pipe(p3);pipe(p4);
pid[0] = fork();
for(i = 1; i <= 2; i ++){
if(pid[i-1] != 0)
pid[i] = fork();
}
//cout <<pid[0]<<" "<<pid[1]<<" "<<pid[2]<<endl;
//control process
if(pid[0] == 0 && pid[1] == 0 && pid[2] == 0){
write(p1[1], &x, sizeof(int));
write(p2[1], &y, sizeof(int));
//close(p1[0]);close(p2[0]);
while(read(p4[0], &timecontit, sizeof(double)) <= 0);
while(read(p3[0], &timecontrec, sizeof(double)) <= 0);
cout<<"Recursive took "<<timecontrec<<" seconds"<<endl;
//cout<<"Recursive Number "<<a<<endl;
cout<<"Iterative took "<<timecontit<<" seconds"<<endl;
//cout<<"Iterative number "<<a<<endl;
}//recursive process
else if(pid[1] == 0 && pid[2] == 0){
read(p1[0], &res1, sizeof(int));
clock_t begin1 = clock();
long answer = recursiveFibo(res1);
clock_t end1 = clock();
timerecursive = double(end1 - begin1) / CLOCKS_PER_SEC;
cout<<"Recursive Fib number "<<answer<<endl;
write(p3[1], &timerecursive, sizeof(double));
}//iterative process
else if(pid[2] == 0){
read(p2[0], &res2, sizeof(int));
clock_t begin1 = clock();
long answer = iterativeFibo(res2);
clock_t end1 = clock();
timeiterative = double(end1 - begin1) / CLOCKS_PER_SEC;
cout<<"Iterative Fib number "<<answer<<endl;
write(p4[1], &timeiterative, sizeof(double));
}
else {
//parent waits here for children to die
while (wait(NULL) > 0) {
}
//waitpid(-1, NULL, 0);
cout<<"fin"<<endl;
}
}
//Iterative version of Fibonacci function
long iterativeFibo(int length){
long a = 1, b = 1, c = 1;
for(int i = 2; i < length; i++){
c = a + b;
a = b;
b = c;
}
return c;
}
//Recursive version of Fibonacci function
long recursiveFibo(int length){
if(length == 0){
return 0;
}
else if(length < 3){
return 1;
}
else{
return recursiveFibo(length-1) + recursiveFibo(length-2);
}
}
| [
"colejh2010@yahoo.com"
] | colejh2010@yahoo.com |
86f2bac91369ea20dec0b7ca3ec26a0e375a71b7 | fc3375d34220530b6d126354e364d23f65decc81 | /ex01/Dog.hpp | 69517180cea252a2dc68a2e8a30ed09788278509 | [] | no_license | kLyArSo/D4CPP | eb34fef5e18405f7ab5c87bd3b1aac5d1f1416f8 | 057aba2d7228d35d7d0dbdc8cf7ffa3113447105 | refs/heads/main | 2023-08-27T07:46:20.984768 | 2021-10-30T16:19:17 | 2021-10-30T16:19:17 | 422,930,999 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 386 | hpp | #ifndef _DOG_HPP
#define _DOG_HPP
#include "Animal.hpp"
#include "Brain.hpp"
class Dog : public Animal
{
private:
Brain *Braiinzzzzz;
public:
Dog();
Dog(const Dog&);
Dog(std::string idea);
void operator=(const Dog&);
~Dog();
Brain *Get_Brainz(){return Braiinzzzzz;}
void makeSound() const ;
};
#endif | [
"noreply@github.com"
] | noreply@github.com |
3328ab2ff7934f79a586c438ed5b04d02e5d1c7c | 5671c626ee367c9aacb909cd76a06d2fadf941e2 | /frameworks/core/components/font/rosen_font_manager.cpp | 72f5784a5456da83e1f4b7c9e11672c9a9e7cf92 | [
"Apache-2.0"
] | permissive | openharmony/ace_ace_engine | fa3f2abad9866bbb329524fb039fa89dd9517592 | c9be21d0e8cb9662d5f4f93184fdfdb538c9d4e1 | refs/heads/master | 2022-07-21T19:32:59.377634 | 2022-05-06T11:18:20 | 2022-05-06T11:18:20 | 400,083,641 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,124 | cpp | /*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "core/components/font/rosen_font_manager.h"
#include "core/components/font/rosen_font_collection.h"
namespace OHOS::Ace {
void RosenFontManager::VaryFontCollectionWithFontWeightScale()
{
if (GreatNotEqual(fontWeightScale_, 0.0)) {
RosenFontCollection::GetInstance().VaryFontCollectionWithFontWeightScale(fontWeightScale_);
NotifyVariationNodes();
}
}
void RosenFontManager::LoadSystemFont()
{
RosenFontCollection::GetInstance().LoadSystemFont();
}
} // namespace OHOS::Ace
| [
"sunfei.sun@huawei.com"
] | sunfei.sun@huawei.com |
e2bdbbe7cc4fc2e43631072e7584511e20f17ee6 | 7e3f5fb9723805abb7100927389d7a7ac3da2e3a | /freeglut project 3D/TAfin.h | f039a3391c8b0fb6ee377b3981e0e42b3d0027a4 | [] | no_license | SeppukuAK/IG2-OpenGL | 4b6b791bcd45165ad3865c854dd8f0ace9b536fe | 34d4e53a6bd73d9d5efb2335be9c11b7857d0d16 | refs/heads/master | 2021-05-04T14:39:31.784389 | 2018-02-04T18:06:46 | 2018-02-04T18:06:46 | 120,205,936 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 561 | h | #ifndef _H_TAfin_H_
#define _H_TAfin_H_
#include <Windows.h>
#include <gl/GL.h>
#include "PuntoVector3D.h"
//Contiene la matriz por la que es necesario POSTmultiplicar la de modelado vista antes de dibujarlo
class TAfin
{
public:
TAfin();
~TAfin();
void traslada(PuntoVector3D * v);
void rota(GLfloat a, GLfloat x, GLfloat y, GLfloat z);//En sentido antihorario
void escala(PuntoVector3D * v);
void postMultiplica(GLfloat* m1);
inline GLfloat * getM() const { return m; };
private:
GLfloat *m; //Matriz: Enumerados por columnas
//...
};
#endif
| [
"raulse01@ucm.es"
] | raulse01@ucm.es |
f9bd6b472484a4c693033ea9ecad73b9486f5e5d | 0757a28db8864314bf597aa13ff6af548ac310a5 | /lmyunit/compile_bench/MFile__GetAccessDateTime/test.cpp | 91e13c054e553a94c546b3d18b8bbc7ccbf78506 | [] | no_license | greshem/lmyunit | 25a3f6fc7b7d04d8b3e5bdab5406003d68fd4ca6 | a5036c67b36e4e58472bd91fbfdd7d1c29018687 | refs/heads/master | 2021-07-11T01:01:45.599991 | 2017-10-08T12:36:30 | 2017-10-08T12:36:30 | 106,174,697 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 155 | cpp | #include <unitcode/mfile.h>
int main(int argc, char *argv[])
{
MFile* file = new MFile();
file->GetAccessDateTime(); //target call
return 0;
}
| [
"qianzhongjie@gmail.com"
] | qianzhongjie@gmail.com |
49e6753257345fe4a6fd810d675cab48793514cd | 753a57645d0824a750fa07176bdf7e37369940f6 | /Engine/Plugins/UnrealCS/Source/MonoPlugin/Private/GeneratedScriptLibraries/RecastNavMeshDataChunk.script.h | 8e9b51e785ab470438ee50ac1d227856e6765335 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | marynate/UnrealCS | 5782c4dd1b3fe6e136dcee54ce430aabd97b70a4 | de43f7e42ca037445202d59c8114fafc30e031ec | refs/heads/master | 2021-01-19T13:01:35.048880 | 2017-02-22T02:18:33 | 2017-02-22T02:18:33 | 82,354,770 | 2 | 1 | null | 2017-02-18T02:17:07 | 2017-02-18T02:17:06 | null | UTF-8 | C++ | false | false | 321 | h | #pragma once
namespace UnrealEngine
{
class _URecastNavMeshDataChunk
{
static UClass* StaticClass(){return URecastNavMeshDataChunk::StaticClass();}
public:
static void BindFunctions()
{
mono_add_internal_call("UnrealEngine.URecastNavMeshDataChunk::StaticClass",(const void*)StaticClass);
}
}
;
}
| [
"xg_55@126.com"
] | xg_55@126.com |
03a7a92b4646905b4c9ee97e6b5dbb537ac1e859 | 3282ccae547452b96c4409e6b5a447f34b8fdf64 | /SimModel_Python_API/simmodel_swig/SimModel_Dll_lib/framework/SimPlacement_Axis2Placement3D.hxx | 51ce5a0be5b1e4ee098d6e5aea6c7f6eeb6ea8ac | [
"MIT"
] | permissive | EnEff-BIM/EnEffBIM-Framework | c8bde8178bb9ed7d5e3e5cdf6d469a009bcb52de | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | refs/heads/master | 2021-01-18T00:16:06.546875 | 2017-04-18T08:03:40 | 2017-04-18T08:03:40 | 28,960,534 | 3 | 0 | null | 2017-04-18T08:03:40 | 2015-01-08T10:19:18 | C++ | UTF-8 | C++ | false | false | 10,834 | hxx | // Copyright (c) 2005-2014 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD, an XML Schema to
// C++ data binding compiler.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// Furthermore, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//
#ifndef SIM_PLACEMENT_AXIS2PLACEMENT3D_HXX
#define SIM_PLACEMENT_AXIS2PLACEMENT3D_HXX
#ifndef XSD_USE_CHAR
#define XSD_USE_CHAR
#endif
#ifndef XSD_CXX_TREE_USE_CHAR
#define XSD_CXX_TREE_USE_CHAR
#endif
// Begin prologue.
//
//
// End prologue.
#include <xsd/cxx/config.hxx>
#if (XSD_INT_VERSION != 4000000L)
//#error XSD runtime version mismatch
#endif
#include <xsd/cxx/pre.hxx>
#include <xsd/cxx/xml/char-utf8.hxx>
#include <xsd/cxx/tree/exceptions.hxx>
#include <xsd/cxx/tree/elements.hxx>
#include <xsd/cxx/tree/types.hxx>
#include <xsd/cxx/xml/error-handler.hxx>
#include <xsd/cxx/xml/dom/auto-ptr.hxx>
#include <xsd/cxx/tree/parsing.hxx>
#include <xsd/cxx/tree/parsing/byte.hxx>
#include <xsd/cxx/tree/parsing/unsigned-byte.hxx>
#include <xsd/cxx/tree/parsing/short.hxx>
#include <xsd/cxx/tree/parsing/unsigned-short.hxx>
#include <xsd/cxx/tree/parsing/int.hxx>
#include <xsd/cxx/tree/parsing/unsigned-int.hxx>
#include <xsd/cxx/tree/parsing/long.hxx>
#include <xsd/cxx/tree/parsing/unsigned-long.hxx>
#include <xsd/cxx/tree/parsing/boolean.hxx>
#include <xsd/cxx/tree/parsing/float.hxx>
#include <xsd/cxx/tree/parsing/double.hxx>
#include <xsd/cxx/tree/parsing/decimal.hxx>
namespace xml_schema
{
// anyType and anySimpleType.
//
typedef ::xsd::cxx::tree::type type;
typedef ::xsd::cxx::tree::simple_type< char, type > simple_type;
typedef ::xsd::cxx::tree::type container;
// 8-bit
//
typedef signed char byte;
typedef unsigned char unsigned_byte;
// 16-bit
//
typedef short short_;
typedef unsigned short unsigned_short;
// 32-bit
//
typedef int int_;
typedef unsigned int unsigned_int;
// 64-bit
//
typedef long long long_;
typedef unsigned long long unsigned_long;
// Supposed to be arbitrary-length integral types.
//
typedef long long integer;
typedef long long non_positive_integer;
typedef unsigned long long non_negative_integer;
typedef unsigned long long positive_integer;
typedef long long negative_integer;
// Boolean.
//
typedef bool boolean;
// Floating-point types.
//
typedef float float_;
typedef double double_;
typedef double decimal;
// String types.
//
typedef ::xsd::cxx::tree::string< char, simple_type > string;
typedef ::xsd::cxx::tree::normalized_string< char, string > normalized_string;
typedef ::xsd::cxx::tree::token< char, normalized_string > token;
typedef ::xsd::cxx::tree::name< char, token > name;
typedef ::xsd::cxx::tree::nmtoken< char, token > nmtoken;
typedef ::xsd::cxx::tree::nmtokens< char, simple_type, nmtoken > nmtokens;
typedef ::xsd::cxx::tree::ncname< char, name > ncname;
typedef ::xsd::cxx::tree::language< char, token > language;
// ID/IDREF.
//
typedef ::xsd::cxx::tree::id< char, ncname > id;
typedef ::xsd::cxx::tree::idref< char, ncname, type > idref;
typedef ::xsd::cxx::tree::idrefs< char, simple_type, idref > idrefs;
// URI.
//
typedef ::xsd::cxx::tree::uri< char, simple_type > uri;
// Qualified name.
//
typedef ::xsd::cxx::tree::qname< char, simple_type, uri, ncname > qname;
// Binary.
//
typedef ::xsd::cxx::tree::buffer< char > buffer;
typedef ::xsd::cxx::tree::base64_binary< char, simple_type > base64_binary;
typedef ::xsd::cxx::tree::hex_binary< char, simple_type > hex_binary;
// Date/time.
//
typedef ::xsd::cxx::tree::time_zone time_zone;
typedef ::xsd::cxx::tree::date< char, simple_type > date;
typedef ::xsd::cxx::tree::date_time< char, simple_type > date_time;
typedef ::xsd::cxx::tree::duration< char, simple_type > duration;
typedef ::xsd::cxx::tree::gday< char, simple_type > gday;
typedef ::xsd::cxx::tree::gmonth< char, simple_type > gmonth;
typedef ::xsd::cxx::tree::gmonth_day< char, simple_type > gmonth_day;
typedef ::xsd::cxx::tree::gyear< char, simple_type > gyear;
typedef ::xsd::cxx::tree::gyear_month< char, simple_type > gyear_month;
typedef ::xsd::cxx::tree::time< char, simple_type > time;
// Entity.
//
typedef ::xsd::cxx::tree::entity< char, ncname > entity;
typedef ::xsd::cxx::tree::entities< char, simple_type, entity > entities;
typedef ::xsd::cxx::tree::content_order content_order;
// Flags and properties.
//
typedef ::xsd::cxx::tree::flags flags;
typedef ::xsd::cxx::tree::properties< char > properties;
// Parsing/serialization diagnostics.
//
typedef ::xsd::cxx::tree::severity severity;
typedef ::xsd::cxx::tree::error< char > error;
typedef ::xsd::cxx::tree::diagnostics< char > diagnostics;
// Exceptions.
//
typedef ::xsd::cxx::tree::exception< char > exception;
typedef ::xsd::cxx::tree::bounds< char > bounds;
typedef ::xsd::cxx::tree::duplicate_id< char > duplicate_id;
typedef ::xsd::cxx::tree::parsing< char > parsing;
typedef ::xsd::cxx::tree::expected_element< char > expected_element;
typedef ::xsd::cxx::tree::unexpected_element< char > unexpected_element;
typedef ::xsd::cxx::tree::expected_attribute< char > expected_attribute;
typedef ::xsd::cxx::tree::unexpected_enumerator< char > unexpected_enumerator;
typedef ::xsd::cxx::tree::expected_text_content< char > expected_text_content;
typedef ::xsd::cxx::tree::no_prefix_mapping< char > no_prefix_mapping;
typedef ::xsd::cxx::tree::no_type_info< char > no_type_info;
typedef ::xsd::cxx::tree::not_derived< char > not_derived;
// Error handler callback interface.
//
typedef ::xsd::cxx::xml::error_handler< char > error_handler;
// DOM interaction.
//
namespace dom
{
// Automatic pointer for DOMDocument.
//
using ::xsd::cxx::xml::dom::auto_ptr;
#ifndef XSD_CXX_TREE_TREE_NODE_KEY__XML_SCHEMA
#define XSD_CXX_TREE_TREE_NODE_KEY__XML_SCHEMA
// DOM user data key for back pointers to tree nodes.
//
const XMLCh* const tree_node_key = ::xsd::cxx::tree::user_data_keys::node;
#endif
}
}
// Forward declarations.
//
namespace schema
{
namespace simxml
{
namespace ResourcesGeometry
{
class SimPlacement_Axis2Placement3D;
}
}
}
#include <memory> // ::std::auto_ptr
#include <limits> // std::numeric_limits
#include <algorithm> // std::binary_search
#include <xsd/cxx/xml/char-utf8.hxx>
#include <xsd/cxx/tree/exceptions.hxx>
#include <xsd/cxx/tree/elements.hxx>
#include <xsd/cxx/tree/containers.hxx>
#include <xsd/cxx/tree/list.hxx>
#include <xsd/cxx/xml/dom/parsing-header.hxx>
#include "simplacement.hxx"
namespace schema
{
namespace simxml
{
namespace ResourcesGeometry
{
class __declspec(dllexport) SimPlacement_Axis2Placement3D: public ::schema::simxml::ResourcesGeometry::SimPlacement
{
public:
// Axis
//
typedef ::xml_schema::idref Axis_type;
typedef ::xsd::cxx::tree::optional< Axis_type, false > Axis_optional;
typedef ::xsd::cxx::tree::traits< Axis_type, char > Axis_traits;
const Axis_optional&
Axis () const;
Axis_optional&
Axis ();
void
Axis (const Axis_type& x);
void
Axis (const Axis_optional& x);
void
Axis (::std::auto_ptr< Axis_type > p);
// RefDirection
//
typedef ::xml_schema::idref RefDirection_type;
typedef ::xsd::cxx::tree::optional< RefDirection_type, false > RefDirection_optional;
typedef ::xsd::cxx::tree::traits< RefDirection_type, char > RefDirection_traits;
const RefDirection_optional&
RefDirection () const;
RefDirection_optional&
RefDirection ();
void
RefDirection (const RefDirection_type& x);
void
RefDirection (const RefDirection_optional& x);
void
RefDirection (::std::auto_ptr< RefDirection_type > p);
// Constructors.
//
SimPlacement_Axis2Placement3D ();
SimPlacement_Axis2Placement3D (const RefId_type&);
SimPlacement_Axis2Placement3D (const ::xercesc::DOMElement& e,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
SimPlacement_Axis2Placement3D (const SimPlacement_Axis2Placement3D& x,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
virtual SimPlacement_Axis2Placement3D*
_clone (::xml_schema::flags f = 0,
::xml_schema::container* c = 0) const;
SimPlacement_Axis2Placement3D&
operator= (const SimPlacement_Axis2Placement3D& x);
virtual
~SimPlacement_Axis2Placement3D ();
// Implementation.
//
protected:
void
parse (::xsd::cxx::xml::dom::parser< char >&,
::xml_schema::flags);
protected:
Axis_optional Axis_;
RefDirection_optional RefDirection_;
};
}
}
}
#include <iosfwd>
#include <xercesc/sax/InputSource.hpp>
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMErrorHandler.hpp>
namespace schema
{
namespace simxml
{
namespace ResourcesGeometry
{
}
}
}
#include <xsd/cxx/post.hxx>
// Begin epilogue.
//
//
// End epilogue.
#endif // SIM_PLACEMENT_AXIS2PLACEMENT3D_HXX
| [
"PRemmen@eonerc.rwth-aachen.de"
] | PRemmen@eonerc.rwth-aachen.de |
e07956d4f0d0a72ff5b61fd9ec18b2cc6b12a720 | a412df10a9624b68079bc2d5009169d4f04f69fc | /tests/models/projectmodeltest.cpp | cce84ac48adc24d8fc373c72a3f374a00d5e91cc | [] | no_license | aroquemaurel/FactDev | b0b7f2b8e5ba83458776cc78c97f9c0775a0cf0a | a008484b8c4e772edbb57375abee81a45efcc49f | refs/heads/S3 | 2021-01-15T13:14:25.495270 | 2015-02-26T16:37:00 | 2015-02-26T16:37:00 | 28,183,115 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,007 | cpp | #include "projectmodeltest.h"
#include "database/projectdatabase.h"
#include "gui/widgets/widgetsmodels/projectstablemodel.h"
ProjectModelTest::ProjectModelTest()
{
p1.setName("vehicula");
p1.setDescription("a, facilisis non, bibendum sed, est. Nunc laoreet lectus quis massa. Mauris vestibulum, neque sed dictum eleifend, nunc risus varius orci, in consequat enim diam");
p1.setDailyRate(13);
p2.setName("vehicula");
p2.setDescription("a, facilisis non, bibendum sed, est. Nunc laoreet lectus quis massa. Mauris vestibulum, neque sed dictum eleifend, nunc risus varius orci, in consequat enim diam");
p2.setDailyRate(13);
}
void ProjectModelTest::equals1()
{
p1.setCustomer(QSharedPointer<Customer>(new Customer(14)));
p2.setCustomer(QSharedPointer<Customer>(new Customer(14)));
QVERIFY(p1 == p2);
}
void ProjectModelTest::equals2()
{
Project p;
p.setDailyRate(13);
p.setName("Not the same name");
p.setCustomer(QSharedPointer<Customer>(new Customer(14)));
p.setDescription("a, facilisis non, bibendum sed, est. Nunc laoreet lectus quis massa. Mauris vestibulum, neque sed dictum eleifend, nunc risus varius orci, in consequat enim diam");
QVERIFY(!(p == p2));
}
void ProjectModelTest::notEquals()
{
Project p;
p.setDailyRate(13);
p.setName("Not the same name");
p.setCustomer(QSharedPointer<Customer>(new Customer(14)));
p.setDescription("a, facilisis non, bibendum sed, est. Nunc laoreet lectus quis massa. Mauris vestibulum, neque sed dictum eleifend, nunc risus varius orci, in consequat enim diam");
QVERIFY(p != p2);
}
void ProjectModelTest::commitInsert()
{
p1.setId(0);
p1.commit();
Project* p2 = Databases::ProjectDatabase::instance()->getProject(p1.getId());
QVERIFY(*p2 == p1);
}
void ProjectModelTest::commitUpdate()
{
int id = Databases::ProjectDatabase::instance()->addProject(p1);
p1.setName("NEW NAME");
p1.setId(id);
p1.commit();
Project* p2 = Databases::ProjectDatabase::instance()->getProject(id);
QVERIFY(*p2 == p1);
}
void ProjectModelTest::hydrat()
{
Project p2 = Project(1);
p1.setName("vehicula");
p1.setDescription("a, facilisis non, bibendum sed, est. Nunc laoreet lectus quis massa. Mauris vestibulum, neque sed dictum eleifend, nunc risus varius orci, in consequat enim diam");
p1.setDailyRate(13);
QVERIFY(p1 == p2);
}
void ProjectModelTest::remove()
{
p1.remove();
QVERIFY(Databases::ProjectDatabase::instance()->getProject(p1.getId()) == NULL);
}
void ProjectModelTest::getProjectsTable(void) {
WdgModels::ProjectsTableModel* w = Databases::ProjectDatabase::instance()->getProjectsTable(1);
for(Project p : w->getProjects()) {
switch(p.getId()) {
case 9:
case 14:
case 47:
case 48:
QVERIFY(true);
break;
default:
QVERIFY2(false, QString("Oups: "+QString::number(p.getId())).toStdString().c_str());
}
}
}
| [
"antoine.roquemaurel@gmail.com"
] | antoine.roquemaurel@gmail.com |
48374e86262b91ab773352c06ec388bc14c37f11 | 352317d68ceb6143f2c7511a6f133a82e9d682c3 | /Projects/dll_mix_gui_1/dll_mix_gui_1/main.cpp | 71ae026b0ba88a240d7a6591eddb41b3632bc154 | [] | no_license | fythatthepce/c-DLL-universal-feez | 613a1429f170c41a65a842c02b9caba4a9f1d8cb | 47f429d05ac081b3e9617514b1ecaa0cb97326ea | refs/heads/master | 2020-03-28T22:12:29.512071 | 2017-06-17T17:48:00 | 2017-06-17T17:48:00 | 94,625,650 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 731 | cpp | #include <Windows.h>
//#include "User_Interface.h"
//creds to Dark at http://www.gamersoul.com/forums/showthread.php?12572-Tut-C-Form-In-DLL for the tut on linking the user interface to the dll
extern int UIMain(); //LOOK ouside main for the User interface function
/*TODO: Find a way to overwrite a string in game in order to tell
the user whats up, E.G. UNLIM AMMO TURNED OFF AND OF*/
DWORD WINAPI Main_thread(LPVOID lpParam)
{
UIMain();
return S_OK;
}
//HINSTANCE hDll;
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD _reason,
LPVOID lpReserved
)
{
//we only care if it attaches
if (_reason == DLL_PROCESS_ATTACH)
{
//hDll = (HINSTANCE)hModule;
CreateThread(0, 0x1000, &Main_thread, 0, 0, NULL);
}
return TRUE;
} | [
"fythatthepce@gmail.com"
] | fythatthepce@gmail.com |
4f5e1347873abf051fb292703cbce9fc4462fcc5 | 59959353175a5f6245824821edf87f3078633b15 | /semantic-server-flask-docker/AnnService/src/Server/ServiceContext.cpp | 8d62b2c7aff9fcd3cade620a83d0e3acf3eb7613 | [
"MIT"
] | permissive | liamca/covid19search | bf24b32ddb2f98f122dae70eca98d2824e3ebcfe | 4c71c76f243684e7ea7baafd14b641f46481cb36 | refs/heads/master | 2023-04-18T08:03:15.580256 | 2021-04-30T19:05:41 | 2021-04-30T19:05:41 | 261,308,162 | 17 | 6 | MIT | 2020-05-04T22:28:12 | 2020-05-04T22:20:38 | JavaScript | UTF-8 | C++ | false | false | 2,582 | cpp | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "inc/Server/ServiceContext.h"
#include "inc/Helper/SimpleIniReader.h"
#include "inc/Helper/CommonHelper.h"
#include "inc/Helper/StringConvert.h"
using namespace SPTAG;
using namespace SPTAG::Service;
ServiceContext::ServiceContext(const std::string& p_configFilePath)
: m_initialized(false)
{
Helper::IniReader iniReader;
if (ErrorCode::Success != iniReader.LoadIniFile(p_configFilePath))
{
return;
}
m_settings.reset(new ServiceSettings);
m_settings->m_listenAddr = iniReader.GetParameter("Service", "ListenAddr", std::string("0.0.0.0"));
m_settings->m_listenPort = iniReader.GetParameter("Service", "ListenPort", std::string("8000"));
m_settings->m_threadNum = iniReader.GetParameter("Service", "ThreadNumber", static_cast<std::uint32_t>(8));
m_settings->m_socketThreadNum = iniReader.GetParameter("Service", "SocketThreadNumber", static_cast<std::uint32_t>(8));
m_settings->m_defaultMaxResultNumber = iniReader.GetParameter("QueryConfig", "DefaultMaxResultNumber", static_cast<SizeType>(10));
m_settings->m_vectorSeparator = iniReader.GetParameter("QueryConfig", "DefaultSeparator", std::string("|"));
const std::string emptyStr;
std::string indexListStr = iniReader.GetParameter("Index", "List", emptyStr);
const auto& indexList = Helper::StrUtils::SplitString(indexListStr, ",");
for (const auto& indexName : indexList)
{
std::string sectionName("Index_");
sectionName += indexName.c_str();
if (!iniReader.DoesParameterExist(sectionName, "IndexFolder"))
{
continue;
}
std::string indexFolder = iniReader.GetParameter(sectionName, "IndexFolder", emptyStr);
std::shared_ptr<VectorIndex> vectorIndex;
if (ErrorCode::Success == VectorIndex::LoadIndex(indexFolder, vectorIndex))
{
vectorIndex->SetIndexName(indexName);
m_fullIndexList.emplace(indexName, vectorIndex);
}
else
{
fprintf(stderr, "Failed loading index: %s\n", indexName.c_str());
}
}
m_initialized = true;
}
ServiceContext::~ServiceContext()
{
}
const std::map<std::string, std::shared_ptr<VectorIndex>>&
ServiceContext::GetIndexMap() const
{
return m_fullIndexList;
}
const std::shared_ptr<ServiceSettings>&
ServiceContext::GetServiceSettings() const
{
return m_settings;
}
bool
ServiceContext::IsInitialized() const
{
return m_initialized;
}
| [
"liamca@microsoft.com"
] | liamca@microsoft.com |
3390520d8ec0d9db2db9e445a8a7f9d4075e0ba4 | d7371aa584aa4483ca37fc61bcda316085e5aa1b | /Combination Lock.cpp | 2c1aa2d09b2a867cb02bebbd5f602199a8f459df | [] | no_license | avivilla/usaco_practice | 2ffcefb15ae39ba89d53be61188df1f4ffc64b0c | 47b941a3732309c3b131092d90ae3bdc3f45a6bd | refs/heads/master | 2021-01-18T20:56:01.613248 | 2017-04-03T07:42:06 | 2017-04-03T07:42:06 | 87,002,208 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,912 | cpp | /*ID: avimall1
LANG: C++
TASK: combo
*/
#include<bits/stdc++.h>
#define pii pair<int,int>
#define mkp make_pair
#define fs first
#define sc second
#define pb push_back
#define ppb pop_back()
#define pcase(x) cout<<"Case "<<x<<": ";
#define hi cout<<"hi"<<endl;
#define mx 1000000007
#define inf 1000000007
#define pi acos(-1.0)
#define mem(arr,x) memset((arr), (x), sizeof((arr)));
#define FOR(i,x) for(int i=0;i<(x); i++)
#define FOR1(i,x) for(int i = 1; i<=(x) ; i++)
#define jora(a,b) make_pair(a,b)
using namespace std;
typedef long long int lint;
typedef double dbl;
set<vector<int> >s;
vector<int>a;
void solve(int node,vector<int>vt[])
{
if(node==3)
{
s.insert(a);
return ;
}
FOR(i,vt[node].size())
{
a.push_back(vt[node][i]);
//b.push_back(john[node][i]);
solve(node+1,vt);
a.pop_back();
//b.pop_back();
}
return ;
}
int main()
{
ios_base::sync_with_stdio(false);
int test,case_no=1;
freopen("combo.in","r",stdin);
freopen("combo.out","w",stdout);
int n;
int x;
vector<int>john[5],master[5];
cin>>n;
FOR(j,3)
{
cin>>x;
FOR1(i,n)
{
if(n+x-1==i || n+x-2==i || x-1==i || x-2==i ||x==i || x+1==i || x+2==i ||x+1-n==i || x+2-n==i)
{
john[j].push_back(i);
//cout<<j<<" "<<i<<endl;
}
}
}
FOR(j,3)
{
cin>>x;
FOR1(i,n)
{
if(n+x-1==i || n+x-2==i || x-1==i || x-2==i ||x==i || x+1==i || x+2==i ||x+1-n==i || x+2-n==i)
{
//cout<<j<<" "<<i<<endl;
master[j].push_back(i);
}
}
}
solve(0,john);
solve(0,master);
cout<<s.size()<<endl;
// set<std::vector<int> >::iterator it;
// for(it=s.begin();it!=s.end();it++)
// {
// a=*it;
// FOR(i,a.size())
// {
// cout<<a[i]<<" ";
// }
// cout<<endl;
// }
return 0;
}
| [
"avimallick999@gmail.com"
] | avimallick999@gmail.com |
7fa2178b1b3484ffd8ce115f0ad32e5eda70f0bd | 81ee26b2b0b42f05b9bc56a4775d2ba04338ce87 | /c++/src/robo_lib/src/tool_estimator.cpp | 073c08999dbf42283d6f84d544d3191813aa95c8 | [] | no_license | Slifer64/as64_libs | 70557d14a054c02eb533a5664454a8f6c851172d | 3c5b92aaf94ed549731dd89ddf1a91f8c9b90023 | refs/heads/master | 2021-06-20T16:48:57.422972 | 2021-05-08T15:31:01 | 2021-05-08T15:31:01 | 189,250,226 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,499 | cpp | /*******************************************************************************
* Copyright (c) 2016-2019 Automation and Robotics Lab, AUTh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
******************************************************************************/
#include <robo_lib/tool_estimator.h>
#include <cassert>
#include <robo_lib/xml_parser.h>
using namespace Eigen;
namespace as64_
{
namespace robo_
{
namespace tool_est_
{
Eigen::Matrix<double, 3, 3> skewSymmetric(const Eigen::Vector3d &input)
{
Eigen::Matrix<double, 3, 3> result = Eigen::Matrix<double, 3, 3>::Zero();
result(0, 1) = -input(2);
result(0, 2) = input(1);
result(1, 0) = input(2);
result(1, 2) = -input(0);
result(2, 0) = -input(1);
result(2, 1) = input(0);
return result;
}
}
ToolEstimator::ToolEstimator()
{
this->setMass(0.0);
this->setCoM(Eigen::Vector3d::Zero());
gravity_vector_world = Eigen::Vector3d(0, 0, -GRAVITY_ACC);
}
ToolEstimator::ToolEstimator(const Vector3d &the_gravity_vector)
{
this->setMass(0.0);
this->setCoM(Eigen::Vector3d::Zero());
gravity_vector_world = the_gravity_vector;
}
ToolEstimator::~ToolEstimator()
{
}
void ToolEstimator::estimatePayload(const std::vector<Vector6d>& wrench_data, const std::vector<Quaterniond>& quat_data)
{
assert(wrench_data.size() == quat_data.size());
unsigned n_data = wrench_data.size();
VectorXd torque(3 * n_data), fz_world(n_data);
MatrixXd minus_skew_force(3 * n_data, 3);
int k = 0;
for (unsigned int i = 0; i < n_data; i++)
{
torque.segment(k, 3) = wrench_data.at(i).segment(3, 3);
Eigen::Vector3d f = wrench_data.at(i).segment(0, 3);
Eigen::Vector3d f_world = quat_data.at(i).toRotationMatrix() * f;
fz_world(i) = f_world(2);
minus_skew_force.block(k, 0, 3, 3) = -tool_est_::skewSymmetric(f);
// Vector3d gravity_vector_tool = quat_data.at(i).toRotationMatrix().transpose() * this->gravity_vector_world;
// minus_skew_force.block(k, 0, 3, 3) = -tool_est_::skewSymmetric(gravity_vector_tool);
k+=3;
}
// Estimate mass
double mass = fz_world.cwiseAbs().sum() / (n_data * std::fabs(this->gravity_vector_world(2)));
this->setMass(mass);
// minus_skew_force *= mass;
// Estimate center of mass with least squares for torques = CoM x ( mass*gravity )
// Use normal equations for least squares:
Eigen::Vector3d CoM = (minus_skew_force.transpose() * minus_skew_force).inverse() * minus_skew_force.transpose() * torque;
this->setCoM(CoM);
// this->CoM = skew.bdcSvd(ComputeThinU | ComputeThinV).solve(torque); // This segfaults for some reason
}
// void ToolEstimator::estimatePayload(const std::vector<Vector6d>& wrench_data, const std::vector<Quaterniond>& quat_data)
// {
// assert(wrench_data.size() == quat_data.size());
//
// unsigned n_data = wrench_data.size();
// VectorXd force(3 * n_data), torque(3 * n_data), gravity_vector(3 * n_data);
// MatrixXd skew(3 * n_data, 3);
//
// for (unsigned int i = 0; i < n_data; i++)
// {
// force.segment(3 * i, 3) = wrench_data.at(i).segment(0, 3);
// torque.segment(3 * i, 3) = wrench_data.at(i).segment(3, 3);
//
// Vector3d gravity_vector_tool = quat_data.at(i).toRotationMatrix().transpose() * this->gravity_vector_world;
// gravity_vector.segment(3 * i, 3) = gravity_vector_tool;
//
// skew.block(3 * i, 0, 3, 3) = tool_est_::skewSymmetric(gravity_vector_tool);
// }
//
// // Calculate mass with least squares for f = mg
// double mass = (gravity_vector.transpose() * gravity_vector).inverse() * gravity_vector.transpose() * force;
// this->setMass(mass);
//
// // Calculate center of mass with least squares for torques = CoM x ( mass*gravity )
// skew = - this->mass * skew;
// // Use normal equations for least squares:
// Eigen::Vector3d CoM = (skew.transpose() * skew).inverse() * skew.transpose() * torque;
// // this->CoM = skew.bdcSvd(ComputeThinU | ComputeThinV).solve(torque); // This segfaults for some reason
// this->setCoM(CoM);
// }
Vector6d ToolEstimator::getToolWrench(const Quaterniond& orientation) const
{
Vector6d wrench;
Vector3d force = orientation.toRotationMatrix().transpose() * (this->gravity_vector_world * this->getMass());
Vector3d torque = this->getCoM().cross(force);
wrench << force, torque;
return wrench;
}
arma::vec ToolEstimator::getToolWrench(const arma::vec &quat) const
{
Eigen::Vector6d Ftool = getToolWrench(Eigen::Quaterniond(quat(0),quat(1),quat(2),quat(3)));
return arma::vec({Ftool(0), Ftool(1), Ftool(2), Ftool(3), Ftool(4), Ftool(5)});
}
arma::vec ToolEstimator::getToolWrench(const arma::mat &Rotm_base_tool) const
{
static const arma::vec g = {0, 0, -GRAVITY_ACC};
arma::vec wrench(6);
wrench.subvec(0,2) = Rotm_base_tool.t() * (g * this->getMass());
wrench.subvec(3,5) = arma::cross( this->getCoM(true), wrench.subvec(0,2));
return wrench;
}
void ToolEstimator::initFromFile(const std::string &path)
{
double mass;
arma::vec CoM;
robo_::XmlParser parser(path);
if (!parser.getParam("mass", mass)) throw std::runtime_error("[ToolEstimator::initFromFile]: Failed to read param \"mass\".");
if (!parser.getParam("CoM", CoM)) throw std::runtime_error("[ToolEstimator::initFromFile]: Failed to read param \"CoM\".");
this->setMass(mass);
Eigen::Vector3d center_of_mass;
center_of_mass << CoM(0), CoM(1), CoM(2);
this->setCoM(center_of_mass);
}
} // namespace robo_
} // namespace as64_
| [
"antosidi64@yahoo.gr"
] | antosidi64@yahoo.gr |
3191900840f45032495626e9a4c7c75ccfbc018f | b64d6212a63aa8e0281fa52174af5080ded0ad88 | /Game_Engine/Core/Utility/string_utility.h | 3a8c485bd76adc6e9f848a9c73281f18204908cd | [] | no_license | CMilby/Game_Engine | 34426cdda76b40f9ba78d49c8be486d95ea2d444 | 58fdd2297f0e044c87d07ab6b32ab52a70a99c04 | refs/heads/master | 2020-04-12T06:32:27.149482 | 2017-01-20T02:56:08 | 2017-01-20T02:56:08 | 44,833,768 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 800 | h | //
// string_utility.h
// Game_Engine_New
//
// Created by Craig Milby on 10/14/16.
// Copyright © 2016 Craig Milby. All rights reserved.
//
#ifndef __STRING_UTILITY_H__
#define __STRING_UTILITY_H__
#include <string>
#include <vector>
namespace StringUtility {
bool EndsWith( const std::string &pStr, const std::string &pEnding );
int LastIndexOf( const std::string &pStr, char pDelim );
std::string ToUpper( const std::string &pStr );
std::vector<std::string> Split( const std::string &pStr, char pDelim );
std::vector<std::string> Split( const std::string &pStr, char pDelim, std::vector<std::string> &pElems );
void Trim( std::string &pStr );
void LTrim( std::string &pStr );
void RTrim( std::string &pStr) ;
}
#endif /* string_utility_h */
| [
"cmilby99@gmail.com"
] | cmilby99@gmail.com |
cfc461500c4d2c769b2c9b83a79110a48ed84b2b | 4e68f2d448e2fc396001b5e6450f6820ed99628f | /CppApplication_3/Empleado.cpp | 660ee457d7572a6f0f86edf22da059a07918b72f | [] | no_license | enzocr/Laboratorios-CENFO | 51ac7588be8bee3337b88229bacaf4b983686cf8 | 7f5a5e160ddbf64a3a00b1b964708f0307d8db0d | refs/heads/master | 2022-04-26T18:57:39.530878 | 2020-04-26T22:52:27 | 2020-04-26T22:52:27 | 259,148,767 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,768 | cpp |
//
// empleado.cpp
// proyecto 1 verano
//
// Created by Rafa Cerdas on 12/11/19.
// Copyright © 2019 Rafa Cerdas. All rights reserved.
//
#include "empleado.h"// esto es lo mismo que el inlcude empleado.cpp
Empleado::Empleado()
{
nombre=" ";
salario=0;
puesto=" ";
estado=false;
ocupacion=0;
}
Empleado::Empleado(string n, string id, float s, string p,bool e,int oc)
{
nombre=n;
this->id=id;
salario=s;
puesto=p;
estado=e;
ocupacion=oc;
}
void Empleado::setNombre(string n)
{
this->nombre=n;
}
string Empleado::getNombre()
{
return nombre;
}
void Empleado::setId(string id)
{
this->id=id;
}
string Empleado::getId()
{
return id;
}
void Empleado::setSalario(float s)
{
salario=s;
}
float Empleado::getSalario()
{
return salario;
}
void Empleado::setPuesto(string p)
{
puesto=p;
}
string Empleado::getPuesto()
{
return puesto;
}
void Empleado::setEstado(bool e)
{
estado=e;
}
bool Empleado::getEstado()
{
return estado;
}
void Empleado::setOcupacion(int oc)
{
ocupacion=oc;
}
int Empleado::getOcupacion()
{
return ocupacion;
}
//1.2. Verificar si el salario es inferior al mínimo: Este proceso debe revisar un salario especifico de
// un empleado con base en su identificador único, y debe indicar si el salario es menor o no
void Empleado::verificaSalarioMen()
{
char valor='0';
do{ cout<< "prueba"<<endl;
cout <<"Digite el estado "<<endl;
cout<<"digite 1 si usted es Trabajador en ocupación NO Calificada"<<endl;
cout<<"digite 2 si usted es Trabajador en ocupación Semi-calificada"<<endl;
cout<<"digite 3 si usted es Trabajador en ocupación Calificada"<<endl;
cin>>valor;
Empleado::setOcupacion(valor);
switch (valor)
{
case '1':
{
system("cls");
cout << endl;
cout << endl;
cout << "case 1" << endl;
if (Empleado::getSalario() < TONC)
{
Empleado::setEstado(true);
cout<<Empleado::getEstado()<<endl;
}
else
{
Empleado::setEstado(false);
cout<<Empleado::getEstado()<<endl;
}
cout << endl;
cout << endl;
system("pause");
system("cls");
break;
break;
}
case '2':
{
system("cls");
cout << endl;
cout << endl;
cout << "case 2" << endl;
if (Empleado::getSalario() < TOSC)
{
Empleado::setEstado(true);
cout<<Empleado::getEstado()<<endl;
}
else
{
Empleado::setEstado(false);
cout<<Empleado::getEstado()<<endl;
}
cout << endl;
cout << endl;
system("pause");
system("cls");
break;
break;
}
case '3':
{
system("cls");
cout << endl;
cout << endl;
cout << "case 3" << endl;
cout << endl;
if (Empleado::getSalario() < TOC)
{
Empleado::setEstado(true);
cout<<Empleado::getEstado()<<endl;
}
else
{
Empleado::setEstado(false);
cout<<Empleado::getEstado()<<endl;
}
cout << endl;
cout << endl;
system("pause");
system("cls");
break;
break;
}
case '4':
system("cls");
cout << endl;
cout << endl;
cout << "case 4" << endl;// regresa al menu principal (tengo que arreglarlo porque no funciona asi solo tengo que cambiar algo pero pongo esto para no olvidar arreglarlo)
cout << endl;// creo que se arregla quitando esta opcion pero lo arreglo ahora
cout << endl;
system("pause");
system("cls");
break;
break;
default:
{
system("cls");
cout << endl;
cout << endl;
cout << "ha ingresado una opcion que no esta dentro de las opciones aceptadas, por favor intentelo de nuevo." << endl;
cout << endl;
cout << endl;
system("pause");
system("cls");
}
}
} while (valor!='4') ;{}
}
//1.3. Incrementar salarios por debajo del mínimo: utilizando el método del apartado 1.2 se verifica si
// el salario del empleado es menor al mínimo establecido por ley, en caso que esto sea cierto, se
// debe, utilizando la tabla de salarios mínimos, asignar al empleado el monto mínimo establecido
// por ley
void Empleado::incrementaSalariosBajos()
{
if (getOcupacion()==1)
{
if (Empleado::getEstado()==true )
{
cout <<"su salario es inferior a el que la ley demanda:"<<endl;
cout <<"se efectuara un ajuste al monto actual :"<<endl;
Empleado::setSalario(TONC);
cout <<"el ajuste de salario se ha efectuado"<<endl;
cout <<"el nuevo salario es:"<<endl;
cout <<Empleado::getSalario()<<endl;
}
}
if (getOcupacion()==2)
{
if (Empleado::getEstado()==true)
{
cout <<"su salario es inferior a el que la ley demanda:"<<endl;
cout <<"se efectuara un ajuste al monto actual :"<<endl;
Empleado::setSalario(TOSC);
cout <<"el ajuste de salario se ha efectuado"<<endl;
cout <<"el nuevo salario es:"<<endl;
cout <<Empleado::getSalario()<<endl;
}
}
if (getOcupacion()==3)
{
if (Empleado::getEstado()==true)
{
cout <<"su salario es inferior a el que la ley demanda:"<<endl;
cout <<"se efectuara un ajuste al monto actual :"<<endl;
Empleado::setSalario(TOC);
cout <<"el ajuste de salario se ha efectuado"<<endl;
cout <<"el nuevo salario es:"<<endl;
cout <<Empleado::getSalario()<<endl;
}
}
}
string Empleado::toString()
{
stringstream s;
s<<"el nombre es :"<<getNombre()<<endl;
s<<"la identificacion es :"<<getId()<<endl;
s<<"el nombre es :"<<getNombre()<<endl;
s<<"el salaro es :"<< getSalario()<<endl;
s<<"el puesto es :"<<getPuesto()<<endl;;
s<<"el estado es :"<<getEstado()<<endl;;
s<<"la ocupacion es:"<<getOcupacion()<<endl;
return s.str();
}
void Empleado::inicializarDato()
{
cout <<"Digite el nombre del empleado:"<< endl;
cin>>this->nombre;
cout <<"Digite la identificacion del empleado:"<< endl;
cin>>this->id;
cout <<"Digite el salario del empleado:"<< endl;
cin>>this->salario;
cout <<"Digite el puesto que desempeña el empleado:"<<endl;
cin>>this->puesto;
}
Empleado::~Empleado(){}
| [
"equartinoz@ucenfotec.ac.cr"
] | equartinoz@ucenfotec.ac.cr |
a6a4e46309a8afa0cc6d0ade170e95678f8a858d | 5ebd5cee801215bc3302fca26dbe534e6992c086 | /blazetest/src/mathtest/smatdmatmult/MCbM5x5a.cpp | e65d9d6dd65d05972d477073c0d6593ed73fddbd | [
"BSD-3-Clause"
] | permissive | mhochsteger/blaze | c66d8cf179deeab4f5bd692001cc917fe23e1811 | fd397e60717c4870d942055496d5b484beac9f1a | refs/heads/master | 2020-09-17T01:56:48.483627 | 2019-11-20T05:40:29 | 2019-11-20T05:41:35 | 223,951,030 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,195 | cpp | //=================================================================================================
/*!
// \file src/mathtest/smatdmatmult/MCbM5x5a.cpp
// \brief Source file for the MCbM5x5a sparse matrix/dense matrix multiplication math test
//
// Copyright (C) 2012-2019 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <cstdlib>
#include <iostream>
#include <blaze/math/CompressedMatrix.h>
#include <blaze/math/StaticMatrix.h>
#include <blazetest/mathtest/Creator.h>
#include <blazetest/mathtest/smatdmatmult/OperationTest.h>
#include <blazetest/system/MathTest.h>
#ifdef BLAZE_USE_HPX_THREADS
# include <hpx/hpx_main.hpp>
#endif
//=================================================================================================
//
// MAIN FUNCTION
//
//=================================================================================================
//*************************************************************************************************
int main()
{
std::cout << " Running 'MCbM5x5a'..." << std::endl;
using blazetest::mathtest::TypeA;
using blazetest::mathtest::TypeB;
try
{
// Matrix type definitions
using MCb = blaze::CompressedMatrix<TypeB>;
using M5x5a = blaze::StaticMatrix<TypeA,5UL,5UL>;
// Creator type definitions
using CMCb = blazetest::Creator<MCb>;
using CM5x5a = blazetest::Creator<M5x5a>;
// Running the tests
for( size_t i=0UL; i<=7UL; ++i ) {
RUN_SMATDMATMULT_OPERATION_TEST( CMCb( i, 5UL, 0UL ), CM5x5a() );
RUN_SMATDMATMULT_OPERATION_TEST( CMCb( i, 5UL, i*5UL*0.25 ), CM5x5a() );
RUN_SMATDMATMULT_OPERATION_TEST( CMCb( i, 5UL, i*5UL*0.5 ), CM5x5a() );
RUN_SMATDMATMULT_OPERATION_TEST( CMCb( i, 5UL, i*5UL*0.75 ), CM5x5a() );
RUN_SMATDMATMULT_OPERATION_TEST( CMCb( i, 5UL, i*5UL ), CM5x5a() );
}
}
catch( std::exception& ex ) {
std::cerr << "\n\n ERROR DETECTED during sparse matrix/dense matrix multiplication:\n"
<< ex.what() << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
//*************************************************************************************************
| [
"klaus.iglberger@gmail.com"
] | klaus.iglberger@gmail.com |
7d630cb317b7833e6080dc88f74fb26fef599293 | e3825dc64459cf6bf7bf668cf2481623fa4f1f21 | /Assignment_6/Grading/main.cpp | 9aa45aa6a35dd7fe1f3502027fcd748f32c96665 | [] | no_license | ZevTheBunny/CIS-5 | 3b03ea5c954a8d7f03d7805453cbd25121c882cd | 49684ccc8c88b1a35eac9b21f4817c90f306826c | refs/heads/master | 2022-10-15T01:28:38.592256 | 2020-06-07T23:22:44 | 2020-06-07T23:22:44 | 257,690,517 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,313 | cpp | /*
* File: main.cpp
* Author: David Seitz
* Created on May 28, 2020 at 11:59 AM
* Purpose: Compare the answer sheet to the key
* and grade
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <string> //String Library
using namespace std;
//User Libraries
//Global Constants, no Global Variables are allowed
//Math/Physics/Conversions/Higher Dimensions - i.e. PI, e, etc...
//Function Prototypes
void printGrad(char [], char,float);
void read(char [],char,string);
float compare(char [],char [],char [], char);
//Execution Begins Here!
int main(int argc, char** argv) {
//Set the random number seed
//Declare Variables
const char SIZE =20;//Number of questions on the test.
char key[SIZE],//The awnser key
ans[SIZE],//The student's results
cor[SIZE];//The scored test
float pRight;//The Percentage that is correct
//Initialize or input i.e. set variable values
read(key,SIZE,"Key");//Reads in the key
read(ans,SIZE,"Answers");//Reads in the student's test;
//Score the exam
pRight = compare(key,ans,cor,SIZE);//Grades the test
//Display the outputs
printGrad(cor,SIZE,pRight);//Prints the graded test
//Exit stage right or left!
return 0;
}
void printGrad(char correct[],char SIZE, float pRight){//Prints the graed test
cout<<"C/W ";//Annonces output
for (char i = 0; i < SIZE; i++) {cout<<correct[i]<<" ";}//Loops trough all the questions and outputs if it correct or incorrect
cout<<endl
<<"Percentage Correct = "<<(pRight*100)<<"%"<<endl;//outputs the score
}
void read(char vals[],char SIZE,string cat){
string temp;//checks to make sure the user is inputing the right thing
cin>>temp;
if(temp == cat){
for (char i = 0; i<SIZE; i++){//Inputs all the letters
cin>>vals[i];
}
}
}
float compare(char key[], char ans[],char cor[], char SIZE){
char p = 0;//calculates the p value
for (char i = 0; i < SIZE;i++){//loops trough all the elements
cor[i] = key[i] == ans[i]?//if the key and student align,
'C':'W';//adds a c; otherwise a w
p += cor[i]=='C'?//if its a c
1:0;//increases the pvalue
}
return (float)p/SIZE;//returns the Percentage correct.
} | [
"47234179+ZevTheBunny@users.noreply.github.com"
] | 47234179+ZevTheBunny@users.noreply.github.com |
9c8e51d8bc5e997b3336a9f7521cdc59a866cd18 | aac2f7b52c9104f683b98f88bfa40ec9e89ad360 | /课程c++代码/大一上程序设计代码/我写的木马/12-17/天涯觅知音/main.cpp | fa56caa2bff68e10e9f890bd23eb9b5e3eaf46c4 | [] | no_license | sjyjytu/My-All-Code | 988a21429782b9901a0ee3c4cd19e73e9521f685 | 0456bcc8b6fe7aabb58b747facfb92b578371912 | refs/heads/master | 2020-05-04T00:33:07.525129 | 2019-04-02T02:47:08 | 2019-04-02T02:47:08 | 178,886,944 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 6,563 | cpp | #include <iostream>
#include <windows.h>
using namespace std;
int main()
{
const int k=500;
cout << "欢" <<" ";Sleep(k);
cout << "迎" <<" ";Sleep(k);
cout << "来" <<" ";Sleep(k);
cout << "到" <<" ";Sleep(k);
cout << "天" <<" ";Sleep(k);
cout << "涯" <<" ";Sleep(k);
cout << "觅" <<" ";Sleep(k);
cout << "知" <<" ";Sleep(k);
cout << "音" <<" ";Sleep(k);
cout << "," <<" ";Sleep(k);
cout << "我" <<" ";Sleep(k);
cout << "是" <<" ";Sleep(k);
cout << "主" <<" ";Sleep(k);
cout << "持" <<" ";Sleep(k);
cout << "人" <<" ";Sleep(k);
cout << "--" <<" ";Sleep(k);
cout << "客" <<" ";Sleep(k);
cout << "天" <<" ";Sleep(k);
cout << "涯" <<" ";Sleep(k);
cout << "*-*" <<" ";Sleep(k);
cout <<endl<<"请选择你要我说的语言:"<<"汉语请按1,英语请按2,日语请按3,韩语请按4,泰语请按5";
int n;cin>>n;
switch (n)
{
case 1:
cout << "下" <<" ";Sleep(k);
cout << "面" <<" ";Sleep(k);
cout << "进" <<" ";Sleep(k);
cout << "入" <<" ";Sleep(k);
cout << "汉" <<" ";Sleep(k);
cout << "语" <<" ";Sleep(k);
cout << "模" <<" ";Sleep(k);
cout << "式" <<" ";Sleep(k);
cout << "。" <<" ";Sleep(k);
break;
default:
cout << "滚" <<" ";Sleep(k);
cout << "犊" <<" ";Sleep(k);
cout << "子" <<" ";Sleep(k);
cout << "!" <<" ";Sleep(k);
cout << "老" <<" ";Sleep(k);
cout << "子" <<" ";Sleep(k);
cout << "只" <<" ";Sleep(k);
cout << "会" <<" ";Sleep(k);
cout << "说" <<" ";Sleep(k);
cout << "汉" <<" ";Sleep(k);
cout << "语" <<" ";Sleep(k);
cout << "(微笑)" <<" ";Sleep(k);
}
cout << "你有什么心事想倾诉吗?" <<" ";Sleep(2000);
cout << "1.被人耍了?" <<" ";Sleep(2000);
cout << "2.被朋友亏待了?" <<" ";Sleep(2000);
cout << "3.考试炸了?" <<" ";Sleep(2000);
cout << "4.作业不会?" <<" ";Sleep(2000);
int p;cin>>p;
switch (p)
{
case 1:
cout << "天" <<" ";Sleep(k);
cout << "涯" <<" ";Sleep(k);
cout << "何" <<" ";Sleep(k);
cout << "处" <<" ";Sleep(k);
cout << "无" <<" ";Sleep(k);
cout << "芳" <<" ";Sleep(k);
cout << "草" <<" ";Sleep(k);
cout << "," <<" ";Sleep(k);
cout << "何" <<" ";Sleep(k);
cout << "必" <<" ";Sleep(k);
cout << "独" <<" ";Sleep(k);
cout << "恋" <<" ";Sleep(k);
cout << "一" <<" ";Sleep(k);
cout << "坨" <<" ";Sleep(k);
cout << "屎" <<" ";Sleep(k);
cout << "。" <<" ";Sleep(k);
cout << "施主," <<" ";Sleep(k);
cout << "搞基也行的嘛。" <<" ";Sleep(3000);
break;
case 2:
cout << "打" <<" ";Sleep(k);
cout << "他" <<" ";Sleep(k);
cout << "一" <<" ";Sleep(k);
cout << "顿" <<" ";Sleep(k);
cout << "啊" <<" ";Sleep(k);
cout << "。" <<" ";Sleep(k);
cout << "没有什么是一顿打解决不了的," <<" ";Sleep(3000);
cout << "如果有," <<" ";Sleep(k);
cout << "那就两顿!" <<" ";Sleep(2000);
cout << "嘿嘿。" <<" ";Sleep(k);
cout << "找" <<" ";Sleep(k);
cout << "他|她聊聊呗" <<" ";Sleep(k);
cout << "本" <<" ";Sleep(k);
cout << "爷" <<" ";Sleep(k);
cout << "只能" <<" ";Sleep(k);
cout << "帮你到这了" <<" ";Sleep(k);
cout << "拜拜," <<" ";Sleep(3000);
break;
case 3:
cout << "考" <<" ";Sleep(k);
cout << "试" <<" ";Sleep(k);
cout << "嘛" <<" ";Sleep(k);
cout << "," <<" ";Sleep(k);
cout << "总" <<" ";Sleep(k);
cout << "会" <<" ";Sleep(k);
cout << "炸" <<" ";Sleep(k);
cout << "几" <<" ";Sleep(k);
cout << "炸的" <<" ";Sleep(k);
cout << "下" <<" ";Sleep(k);
cout << "次" <<" ";Sleep(k);
cout << "考" <<" ";Sleep(k);
cout << "好" <<" ";Sleep(k);
cout << "点" <<" ";Sleep(k);
cout << "不就" <<" ";Sleep(k);
cout << "好了" <<" ";Sleep(k);
cout << "。" <<" ";Sleep(k);
cout << "下一个~" <<" ";Sleep(3000);
break;
case 4:
cout << "哪" <<" ";Sleep(k);
cout << "道" <<" ";Sleep(k);
cout << "题" <<" ";Sleep(k);
cout << "?" <<" ";Sleep(k);
cout << "说" <<" ";Sleep(k);
cout << "来" <<" ";Sleep(k);
cout << "听" <<" ";Sleep(k);
cout << "听" <<" ";Sleep(k);
cout << "。" <<" ";Sleep(k);
cout << "我" <<" ";Sleep(k);
cout << "是" <<" ";Sleep(k);
cout << "电脑" <<" ";Sleep(k);
cout << "," <<" ";Sleep(k);
cout << "我" <<" ";Sleep(k);
cout << "无所不能" <<" ";Sleep(k);
cout << "。" <<" ";Sleep(5000);
cout << "可是," <<" ";Sleep(3000);
cout << "我版本太低了,回答不了问题---下一个~" <<" ";Sleep(3000);
break;
default:
cout << "滚" <<" ";Sleep(k);
cout << "犊" <<" ";Sleep(k);
cout << "子" <<" ";Sleep(k);
cout << "!" <<" ";Sleep(k);
cout << "就" <<" ";Sleep(k);
cout << "知道" <<" ";Sleep(k);
cout << "你" <<" ";Sleep(k);
cout << "会" <<" ";Sleep(k);
cout << "顽皮" <<" ";Sleep(k);
cout << "," <<" ";Sleep(k);
cout << "能不能好好选" <<" ";Sleep(5000);
cout << "(微笑)" <<" ";Sleep(k);
}
cout<<"很高兴为你服务,我要return0了,给个好评喔~拜拜~";Sleep(2000);
return 0;
}
| [
"1332372004@qq.com"
] | 1332372004@qq.com |
9328e46591008c167c80e8b1f9dfac0d05210e84 | 8cbadcedfd8e44d56ca492024cf59afefed0f452 | /Qt Graphics/object.cpp | f33e995e3485fa84bcbee61ac584e0236e60a202 | [] | no_license | LuisSilva96/proximity_detector | 6dc5648c777f1bfe11297039c0145599e25cd6cd | 15bcca85dd8bc3525ee4fed7caad5e1b6b2e4870 | refs/heads/master | 2020-09-07T18:01:15.346076 | 2019-11-11T00:28:32 | 2019-11-11T00:28:32 | 220,863,549 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,837 | cpp | # include <object.h>
Object::Object(int & x, int & y, int & height, int & width, int & color)
{
create_palette();
object = new QRect(x, y, width, height);
brush = new QBrush(QColor(palette[color][0],palette[color][1],palette[color][2]));
position.setX(x);
position.setY(y);
}
void Object::create_palette()
{
palette[0][0] = 240;
palette[0][1] = 98;
palette[0][2] = 146;
palette[1][0] = 156;
palette[1][1] = 39;
palette[1][2] = 176;
palette[2][0] = 244;
palette[2][1] = 67;
palette[2][2] = 54;
palette[3][0] = 81;
palette[3][1] = 45;
palette[3][2] = 168;
palette[4][0] = 48;
palette[4][1] = 63;
palette[4][2] = 159;
palette[5][0] = 25;
palette[5][1] = 118;
palette[5][2] = 210;
palette[6][0] = 1;
palette[6][1] = 87;
palette[6][2] = 155;
palette[7][0] = 0;
palette[7][1] = 131;
palette[7][2] = 143;
palette[8][0] = 0;
palette[8][1] = 105;
palette[8][2] = 92;
palette[9][0] = 67;
palette[9][1] = 160;
palette[9][2] = 71;
palette[10][0] = 124;
palette[10][1] = 179;
palette[10][2] = 66;
palette[11][0] = 175;
palette[11][1] = 180;
palette[11][2] = 43;
palette[12][0] = 251;
palette[12][1] = 192;
palette[12][2] = 45;
palette[13][0] = 121;
palette[13][1] = 85;
palette[13][2] = 72;
palette[14][0] = 117;
palette[14][1] = 117;
palette[14][2] = 117;
}
QRect Object::get_rect()
{
return *object;
}
int Object::get_x()
{
return position.x();
}
int Object::get_y()
{
return position.y();
}
QVector2D Object::get_position()
{
return position;
}
int Object::height()
{
return object->height();
}
int Object::width()
{
return object->width();
}
void Object::draw(QPainter & painter)
{
painter.fillRect(*object, get_brush());
}
QBrush Object::get_brush()
{
return *brush;
}
Object::~Object()
{
//empty
}
| [
"luissilva7045@gmail.com"
] | luissilva7045@gmail.com |
b3234a0915afab4f7d2157847d156456cac3f5fd | dfb83f9e1d2a64e719c3d61004b25650f372f5a2 | /src/hydrogen-escape-analysis.cc | f797ec43b8f97fc83054fa5e588237e482850a8b | [] | no_license | kingland/v8-MinGW | 8ae0a89ebe9ad022bd88612f7e38398cfd50287e | 83c03915b0005faf60a517b7fe1938c08dd44d18 | refs/heads/master | 2021-01-10T08:27:14.667611 | 2015-10-01T04:17:59 | 2015-10-01T04:17:59 | 43,477,682 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,308 | cc | // Copyright 2013 the V8 project 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 "hydrogen-escape-analysis.h"
namespace v8 {
namespace internal {
bool HEscapeAnalysisPhase::HasNoEscapingUses(HValue* value, int size) {
for (HUseIterator it(value->uses()); !it.Done(); it.Advance()) {
HValue* use = it.value();
if (use->HasEscapingOperandAt(it.index())) {
if (FLAG_trace_escape_analysis) {
PrintF("#%d (%s) escapes through #%d (%s) @%d\n", value->id(),
value->Mnemonic(), use->id(), use->Mnemonic(), it.index());
}
return false;
}
if (use->HasOutOfBoundsAccess(size)) {
if (FLAG_trace_escape_analysis) {
PrintF("#%d (%s) out of bounds at #%d (%s) @%d\n", value->id(),
value->Mnemonic(), use->id(), use->Mnemonic(), it.index());
}
return false;
}
int redefined_index = use->RedefinedOperandIndex();
if (redefined_index == it.index() && !HasNoEscapingUses(use, size)) {
if (FLAG_trace_escape_analysis) {
PrintF("#%d (%s) escapes redefinition #%d (%s) @%d\n", value->id(),
value->Mnemonic(), use->id(), use->Mnemonic(), it.index());
}
return false;
}
}
return true;
}
void HEscapeAnalysisPhase::CollectCapturedValues() {
int block_count = graph()->blocks()->length();
for (int i = 0; i < block_count; ++i) {
HBasicBlock* block = graph()->blocks()->at(i);
for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
HInstruction* instr = it.Current();
if (!instr->IsAllocate()) continue;
HAllocate* allocate = HAllocate::cast(instr);
if (!allocate->size()->IsInteger32Constant()) continue;
int size_in_bytes = allocate->size()->GetInteger32Constant();
if (HasNoEscapingUses(instr, size_in_bytes)) {
if (FLAG_trace_escape_analysis) {
PrintF("#%d (%s) is being captured\n", instr->id(),
instr->Mnemonic());
}
captured_.Add(instr, zone());
}
}
}
}
HCapturedObject* HEscapeAnalysisPhase::NewState(HInstruction* previous) {
Zone* zone = graph()->zone();
HCapturedObject* state =
new(zone) HCapturedObject(number_of_values_, number_of_objects_, zone);
state->InsertAfter(previous);
return state;
}
// Create a new state for replacing HAllocate instructions.
HCapturedObject* HEscapeAnalysisPhase::NewStateForAllocation(
HInstruction* previous) {
HConstant* undefined = graph()->GetConstantUndefined();
HCapturedObject* state = NewState(previous);
for (int index = 0; index < number_of_values_; index++) {
state->SetOperandAt(index, undefined);
}
return state;
}
// Create a new state full of phis for loop header entries.
HCapturedObject* HEscapeAnalysisPhase::NewStateForLoopHeader(
HInstruction* previous,
HCapturedObject* old_state) {
HBasicBlock* block = previous->block();
HCapturedObject* state = NewState(previous);
for (int index = 0; index < number_of_values_; index++) {
HValue* operand = old_state->OperandAt(index);
HPhi* phi = NewPhiAndInsert(block, operand, index);
state->SetOperandAt(index, phi);
}
return state;
}
// Create a new state by copying an existing one.
HCapturedObject* HEscapeAnalysisPhase::NewStateCopy(
HInstruction* previous,
HCapturedObject* old_state) {
HCapturedObject* state = NewState(previous);
for (int index = 0; index < number_of_values_; index++) {
HValue* operand = old_state->OperandAt(index);
state->SetOperandAt(index, operand);
}
return state;
}
// Insert a newly created phi into the given block and fill all incoming
// edges with the given value.
HPhi* HEscapeAnalysisPhase::NewPhiAndInsert(HBasicBlock* block,
HValue* incoming_value,
int index) {
Zone* zone = graph()->zone();
HPhi* phi = new(zone) HPhi(HPhi::kInvalidMergedIndex, zone);
for (int i = 0; i < block->predecessors()->length(); i++) {
phi->AddInput(incoming_value);
}
block->AddPhi(phi);
return phi;
}
// Insert a newly created value check as a replacement for map checks.
HValue* HEscapeAnalysisPhase::NewMapCheckAndInsert(HCapturedObject* state,
HCheckMaps* mapcheck) {
Zone* zone = graph()->zone();
HValue* value = state->map_value();
// TODO(mstarzinger): This will narrow a map check against a set of maps
// down to the first element in the set. Revisit and fix this.
HCheckValue* check = HCheckValue::New(
zone, NULL, value, mapcheck->maps()->at(0), false);
check->InsertBefore(mapcheck);
return check;
}
// Replace a field load with a given value, forcing Smi representation if
// necessary.
HValue* HEscapeAnalysisPhase::NewLoadReplacement(
HLoadNamedField* load, HValue* load_value) {
HValue* replacement = load_value;
Representation representation = load->representation();
if (representation.IsSmiOrInteger32() || representation.IsDouble()) {
Zone* zone = graph()->zone();
HInstruction* new_instr =
HForceRepresentation::New(zone, NULL, load_value, representation);
new_instr->InsertAfter(load);
replacement = new_instr;
}
return replacement;
}
// Performs a forward data-flow analysis of all loads and stores on the
// given captured allocation. This uses a reverse post-order iteration
// over affected basic blocks. All non-escaping instructions are handled
// and replaced during the analysis.
void HEscapeAnalysisPhase::AnalyzeDataFlow(HInstruction* allocate) {
HBasicBlock* allocate_block = allocate->block();
block_states_.AddBlock(NULL, graph()->blocks()->length(), zone());
// Iterate all blocks starting with the allocation block, since the
// allocation cannot dominate blocks that come before.
int start = allocate_block->block_id();
for (int i = start; i < graph()->blocks()->length(); i++) {
HBasicBlock* block = graph()->blocks()->at(i);
HCapturedObject* state = StateAt(block);
// Skip blocks that are not dominated by the captured allocation.
if (!allocate_block->Dominates(block) && allocate_block != block) continue;
if (FLAG_trace_escape_analysis) {
PrintF("Analyzing data-flow in B%d\n", block->block_id());
}
// Go through all instructions of the current block.
for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
HInstruction* instr = it.Current();
switch (instr->opcode()) {
case HValue::kAllocate: {
if (instr != allocate) continue;
state = NewStateForAllocation(allocate);
break;
}
case HValue::kLoadNamedField: {
HLoadNamedField* load = HLoadNamedField::cast(instr);
int index = load->access().offset() / kPointerSize;
if (load->object() != allocate) continue;
DCHECK(load->access().IsInobject());
HValue* replacement =
NewLoadReplacement(load, state->OperandAt(index));
load->DeleteAndReplaceWith(replacement);
if (FLAG_trace_escape_analysis) {
PrintF("Replacing load #%d with #%d (%s)\n", load->id(),
replacement->id(), replacement->Mnemonic());
}
break;
}
case HValue::kStoreNamedField: {
HStoreNamedField* store = HStoreNamedField::cast(instr);
int index = store->access().offset() / kPointerSize;
if (store->object() != allocate) continue;
DCHECK(store->access().IsInobject());
state = NewStateCopy(store->previous(), state);
state->SetOperandAt(index, store->value());
if (store->has_transition()) {
state->SetOperandAt(0, store->transition());
}
if (store->HasObservableSideEffects()) {
state->ReuseSideEffectsFromStore(store);
}
store->DeleteAndReplaceWith(store->ActualValue());
if (FLAG_trace_escape_analysis) {
PrintF("Replacing store #%d%s\n", instr->id(),
store->has_transition() ? " (with transition)" : "");
}
break;
}
case HValue::kArgumentsObject:
case HValue::kCapturedObject:
case HValue::kSimulate: {
for (int i = 0; i < instr->OperandCount(); i++) {
if (instr->OperandAt(i) != allocate) continue;
instr->SetOperandAt(i, state);
}
break;
}
case HValue::kCheckHeapObject: {
HCheckHeapObject* check = HCheckHeapObject::cast(instr);
if (check->value() != allocate) continue;
check->DeleteAndReplaceWith(check->ActualValue());
break;
}
case HValue::kCheckMaps: {
HCheckMaps* mapcheck = HCheckMaps::cast(instr);
if (mapcheck->value() != allocate) continue;
NewMapCheckAndInsert(state, mapcheck);
mapcheck->DeleteAndReplaceWith(mapcheck->ActualValue());
break;
}
default:
// Nothing to see here, move along ...
break;
}
}
// Propagate the block state forward to all successor blocks.
for (int i = 0; i < block->end()->SuccessorCount(); i++) {
HBasicBlock* succ = block->end()->SuccessorAt(i);
if (!allocate_block->Dominates(succ)) continue;
if (succ->predecessors()->length() == 1) {
// Case 1: This is the only predecessor, just reuse state.
SetStateAt(succ, state);
} else if (StateAt(succ) == NULL && succ->IsLoopHeader()) {
// Case 2: This is a state that enters a loop header, be
// pessimistic about loop headers, add phis for all values.
SetStateAt(succ, NewStateForLoopHeader(succ->first(), state));
} else if (StateAt(succ) == NULL) {
// Case 3: This is the first state propagated forward to the
// successor, leave a copy of the current state.
SetStateAt(succ, NewStateCopy(succ->first(), state));
} else {
// Case 4: This is a state that needs merging with previously
// propagated states, potentially introducing new phis lazily or
// adding values to existing phis.
HCapturedObject* succ_state = StateAt(succ);
for (int index = 0; index < number_of_values_; index++) {
HValue* operand = state->OperandAt(index);
HValue* succ_operand = succ_state->OperandAt(index);
if (succ_operand->IsPhi() && succ_operand->block() == succ) {
// Phi already exists, add operand.
HPhi* phi = HPhi::cast(succ_operand);
phi->SetOperandAt(succ->PredecessorIndexOf(block), operand);
} else if (succ_operand != operand) {
// Phi does not exist, introduce one.
HPhi* phi = NewPhiAndInsert(succ, succ_operand, index);
phi->SetOperandAt(succ->PredecessorIndexOf(block), operand);
succ_state->SetOperandAt(index, phi);
}
}
}
}
}
// All uses have been handled.
DCHECK(allocate->HasNoUses());
allocate->DeleteAndReplaceWith(NULL);
}
void HEscapeAnalysisPhase::PerformScalarReplacement() {
for (int i = 0; i < captured_.length(); i++) {
HAllocate* allocate = HAllocate::cast(captured_.at(i));
// Compute number of scalar values and start with clean slate.
int size_in_bytes = allocate->size()->GetInteger32Constant();
number_of_values_ = size_in_bytes / kPointerSize;
number_of_objects_++;
block_states_.Rewind(0);
// Perform actual analysis step.
AnalyzeDataFlow(allocate);
cumulative_values_ += number_of_values_;
DCHECK(allocate->HasNoUses());
DCHECK(!allocate->IsLinked());
}
}
void HEscapeAnalysisPhase::Run() {
// TODO(mstarzinger): We disable escape analysis with OSR for now, because
// spill slots might be uninitialized. Needs investigation.
if (graph()->has_osr()) return;
int max_fixpoint_iteration_count = FLAG_escape_analysis_iterations;
for (int i = 0; i < max_fixpoint_iteration_count; i++) {
CollectCapturedValues();
if (captured_.is_empty()) break;
PerformScalarReplacement();
captured_.Rewind(0);
}
}
} } // namespace v8::internal
| [
"sarayu.noo@gmail.com"
] | sarayu.noo@gmail.com |
92f9a469e835a8b1c484181ab52772a339508c40 | 2d5a651995ca6ba53b169b5e58ef75159715e886 | /Source/Core/Utility/Endian.h | 894249137d601ea81d46cfae612afd859e0528ed | [
"BSD-3-Clause"
] | permissive | GoTamura/KVS | 4a4aabd5dac5c5362b7404f4d9b50ae33bb0cbb6 | 121ede0b9b81da56e9ea698a45ccfd71ff64ed41 | refs/heads/develop | 2021-06-12T05:27:34.959934 | 2019-04-11T23:57:26 | 2019-04-11T23:57:26 | 181,405,935 | 0 | 0 | BSD-3-Clause | 2019-04-15T03:29:11 | 2019-04-15T03:29:09 | null | UTF-8 | C++ | false | false | 22,490 | h | /****************************************************************************/
/**
* @file Endian.h
*/
/*----------------------------------------------------------------------------
*
* Copyright (c) Visualization Laboratory, Kyoto University.
* All rights reserved.
* See http://www.viz.media.kyoto-u.ac.jp/kvs/copyright/ for details.
*
* $Id: Endian.h 1146 2012-05-30 11:24:35Z s.yamada0808@gmail.com $
*/
/****************************************************************************/
#ifndef KVS__ENDIAN_H_INCLUDE
#define KVS__ENDIAN_H_INCLUDE
#include <kvs/Type>
#include <string>
#include <utility>
namespace kvs
{
class Endian
{
public:
static bool IsBig();
static bool IsLittle();
static void Swap( kvs::Int8* value );
static void Swap( kvs::Int16* value );
static void Swap( kvs::Int32* value );
static void Swap( kvs::Int64* value );
static void Swap( kvs::UInt8* value );
static void Swap( kvs::UInt16* value );
static void Swap( kvs::UInt32* value );
static void Swap( kvs::UInt64* value );
static void Swap( kvs::Real32* value );
static void Swap( kvs::Real64* value );
static void Swap( kvs::Int8* values, size_t n );
static void Swap( kvs::Int16* values, size_t n );
static void Swap( kvs::Int32* values, size_t n );
static void Swap( kvs::Int64* values, size_t n );
static void Swap( kvs::UInt8* values, size_t n );
static void Swap( kvs::UInt16* values, size_t n );
static void Swap( kvs::UInt32* values, size_t n );
static void Swap( kvs::UInt64* values, size_t n );
static void Swap( kvs::Real32* values, size_t n );
static void Swap( kvs::Real64* values, size_t n );
#if KVS_ENABLE_DEPRECATED
enum ByteOrder
{
Unknown = -1,
Little = 0,
Big = 1
};
ByteOrder Check();
static void Swap( kvs::Int8& value );
static void Swap( kvs::Int16& value );
static void Swap( kvs::Int32& value );
static void Swap( kvs::Int64& value );
static void Swap( kvs::UInt8& value );
static void Swap( kvs::UInt16& value );
static void Swap( kvs::UInt32& value );
static void Swap( kvs::UInt64& value );
static void Swap( kvs::Real32& value );
static void Swap( kvs::Real64& value );
static void Swap( std::string& value );
static void Swap( std::string* values, size_t n );
#endif
private:
static void Swap2Bytes( void* value );
static void Swap4Bytes( void* value );
static void Swap8Bytes( void* value );
static void Swap2Bytes( void* values, size_t n );
static void Swap4Bytes( void* values, size_t n );
static void Swap8Bytes( void* values, size_t n );
private:
Endian();
};
/*===========================================================================*/
/**
* @brief Swaps the two bytes value.
* @param value [in] value in two bytes
*/
/*===========================================================================*/
inline void Endian::Swap2Bytes( void* value )
{
unsigned char* v = static_cast<unsigned char*>( value );
std::swap( v[0], v[1] );
}
/*===========================================================================*/
/**
* @brief Swaps the four bytes value.
* @param value [in] value in four bytes
*/
/*===========================================================================*/
inline void Endian::Swap4Bytes( void* value )
{
unsigned char* v = static_cast<unsigned char*>( value );
std::swap( v[0], v[3] );
std::swap( v[1], v[2] );
}
/*===========================================================================*/
/**
* @brief Swaps the eight bytes value.
* @param value [in] value in eight bytes
*/
/*===========================================================================*/
inline void Endian::Swap8Bytes( void* value )
{
unsigned char* v = static_cast<unsigned char*>( value );
std::swap( v[0], v[7] );
std::swap( v[1], v[6] );
std::swap( v[2], v[5] );
std::swap( v[3], v[4] );
}
/*===========================================================================*/
/**
* @brief Swaps the array of value in increments of two bytes.
* @param value [in] pointer to the values
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap2Bytes( void* values, size_t n )
{
unsigned char* v = static_cast<unsigned char*>( values );
unsigned char* vend = v + n * 2;
while ( v != vend )
{
Swap2Bytes( v );
v += 2;
}
}
/*===========================================================================*/
/**
* @brief Swaps the array of value in increments of four bytes.
* @param value [in] pointer to the values
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap4Bytes( void* values, size_t n )
{
unsigned char* v = static_cast<unsigned char*>( values );
unsigned char* vend = v + n * 4;
while ( v != vend )
{
Swap4Bytes( v );
v += 4;
}
}
/*===========================================================================*/
/**
* @brief Swaps the array of value in increments of eight bytes.
* @param value [in] pointer to the values
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap8Bytes( void* values, size_t n )
{
unsigned char* v = static_cast<unsigned char*>( values );
unsigned char* vend = v + n * 8;
while ( v != vend )
{
Swap8Bytes( v );
v += 8;
}
}
/*===========================================================================*/
/**
* @brief Returns true if endian type is big endian.
* @return true, if big endian
*/
/*===========================================================================*/
inline bool Endian::IsBig()
{
return !IsLittle();
}
/*===========================================================================*/
/**
* @brief Returns true if endian type is little endian.
* @return true, if little endian
*/
/*===========================================================================*/
inline bool Endian::IsLittle()
{
const int i = 1;
return *( (char*)&i ) != 0;
}
/*===========================================================================*/
/**
* @brief Swaps 8-bit integer value. (inaction)
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int8* )
{
}
/*===========================================================================*/
/**
* @brief Swaps 8-bit unsigned integer value. (inaction)
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt8* )
{
}
/*===========================================================================*/
/**
* @brief Swaps 16-bit integer value.
* @param value [in] 16-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int16* value )
{
Swap2Bytes( value );
}
/*===========================================================================*/
/**
* @brief Swaps 16-bit integer value.
* @param value [in] 16-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt16* value )
{
Swap2Bytes( value );
}
/*===========================================================================*/
/**
* @brief Swaps 32-bit integer value.
* @param value [in] 32-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int32* value )
{
Swap4Bytes( value );
}
/*===========================================================================*/
/**
* @brief Swaps 32-bit integer value.
* @param value [in] 32-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt32* value )
{
Swap4Bytes( value );
}
/*===========================================================================*/
/**
* @brief Swaps 64-bit integer value.
* @param value [in] 64-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int64* value )
{
Swap8Bytes( value );
}
/*===========================================================================*/
/**
* @brief Swaps 64-bit integer value.
* @param value [in] 64-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt64* value )
{
Swap8Bytes( value );
}
/*===========================================================================*/
/**
* @brief Swaps 32-bit floating-point value.
* @param value [in] 32-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Real32* value )
{
Swap4Bytes( value );
}
/*===========================================================================*/
/**
* @brief Swaps 64-bit floating-point value.
* @param value [in] 64-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Real64* value )
{
Swap8Bytes( value );
}
/*===========================================================================*/
/**
* @brief Swaps the array of 8-bit integer value. (inaction)
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int8*, size_t )
{
}
/*===========================================================================*/
/**
* @brief Swaps the array of 8-bit integer value. (inaction)
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt8*, size_t )
{
}
/*===========================================================================*/
/**
* @brief Swaps the array of 16-bit integer value.
* @param value [in] 16-bit value
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int16* values, size_t n )
{
Swap2Bytes( values, n );
}
/*===========================================================================*/
/**
* @brief Swaps the array of 16-bit integer value.
* @param value [in] 16-bit value
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt16* values, size_t n )
{
Swap2Bytes( values, n );
}
/*===========================================================================*/
/**
* @brief Swaps the array of 32-bit integer value.
* @param value [in] 32-bit value
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int32* values, size_t n )
{
Swap4Bytes( values, n );
}
/*===========================================================================*/
/**
* @brief Swaps the array of 32-bit integer value.
* @param value [in] 32-bit value
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt32* values, size_t n )
{
Swap4Bytes( values, n );
}
/*===========================================================================*/
/**
* @brief Swaps the array of 64-bit integer value.
* @param value [in] 64-bit value
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int64* values, size_t n )
{
Swap8Bytes( values, n );
}
/*===========================================================================*/
/**
* @brief Swaps the array of 64-bit integer value.
* @param value [in] 64-bit value
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt64* values, size_t n )
{
Swap8Bytes( values, n );
}
/*===========================================================================*/
/**
* @brief Swaps the array of 32-bit floating-point value.
* @param value [in] 32-bit value
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Real32* values, size_t n )
{
Swap4Bytes( values, n );
}
/*===========================================================================*/
/**
* @brief Swaps the array of 64-bit floating-point value.
* @param value [in] 64-bit value
* @param n [in] number of elements
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Real64* values, size_t n )
{
Swap8Bytes( values, n );
}
#if KVS_ENABLE_DEPRECATED
/*===========================================================================*/
/**
* @brief Checks endianness.
* @return endian type (Unknown, Little, Big)
*/
/*===========================================================================*/
inline Endian::ByteOrder Endian::Check()
{
ByteOrder ret = Unknown;
int i = 1;
if ( *( (char*)&i ) ) { ret = Little; }
else if ( *( (char*)&i + ( sizeof( int ) - 1 ) ) ) { ret = Big; }
return ret;
}
/*===========================================================================*/
/**
* @brief Swaps 8-bit integer value. (inaction)
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int8& )
{
}
/*===========================================================================*/
/**
* @brief Swaps 8-bit unsigned integer value. (inaction)
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt8& )
{
}
/*===========================================================================*/
/**
* @brief Swaps 16-bit integer value.
* @param value [in] 16-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int16& value )
{
Swap2Bytes( &value );
}
/*===========================================================================*/
/**
* @brief Swaps 16-bit integer value.
* @param value [in] 16-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt16& value )
{
Swap2Bytes( &value );
}
/*===========================================================================*/
/**
* @brief Swaps 32-bit integer value.
* @param value [in] 32-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int32& value )
{
Swap4Bytes( &value );
}
/*===========================================================================*/
/**
* @brief Swaps 32-bit integer value.
* @param value [in] 32-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt32& value )
{
Swap4Bytes( &value );
}
/*===========================================================================*/
/**
* @brief Swaps 64-bit integer value.
* @param value [in] 64-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Int64& value )
{
Swap8Bytes( &value );
}
/*===========================================================================*/
/**
* @brief Swaps 64-bit integer value.
* @param value [in] 64-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::UInt64& value )
{
Swap8Bytes( &value );
}
/*===========================================================================*/
/**
* @brief Swaps 32-bit floating-point value.
* @param value [in] 32-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Real32& value )
{
Swap4Bytes( &value );
}
/*===========================================================================*/
/**
* @brief Swaps 64-bit floating-point value.
* @param value [in] 64-bit value
*/
/*===========================================================================*/
inline void Endian::Swap( kvs::Real64& value )
{
Swap8Bytes( &value );
}
/*===========================================================================*/
/**
* @brief Swaps string value. (inaction)
*/
/*===========================================================================*/
inline void Endian::Swap( std::string& )
{
}
/*===========================================================================*/
/**
* @brief Swaps the array of string value. (inaction)
*/
/*===========================================================================*/
inline void Endian::Swap( std::string*, size_t )
{
}
#endif
} // end of namespace kvs
#if 0
#define KVS_STATIC_ASSERT( expr, mes ) { char dummy[ ( expr ) ? 1 : -1 ]; (void)dummy; }
//#define KVS_STATIC_ASSERT( expr, mes ) static_assert( ( expr ), ( mes ) )
namespace kvs
{
namespace detail
{
template <typename T, T Value>
struct integral_constant
{
static const T value = Value;
typedef T value_type;
};
typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
} // detail
} // kvs
namespace kvs
{
class Endian
{
public:
/*===========================================================================*/
/**
* @brief Returns true if the endian type is little endian.
* @return true, if little endian
*/
/*===========================================================================*/
static bool IsLittle()
{
const int i = 1;
return *( (char*)&i ) != 0;
}
/*===========================================================================*/
/**
* @brief Returns true if the endian type is big endian.
* @return true, if big endian
*/
/*===========================================================================*/
static bool IsBig()
{
return !IsLittle();
}
/*===========================================================================*/
/**
* @brief Swaps a value of type Type.
* @param value [in] pointer to the value of type Type
*/
/*===========================================================================*/
template <typename T>
static void Swap( T* value )
{
KVS_STATIC_ASSERT( is_supported<T>::value, "not supported" );
SwapBytes<sizeof( T )>( value );
}
/*===========================================================================*/
/**
* @brief Swaps an array of value of type Type.
* @param values [in] pointer to the array
* @param n [in] number of the elements
*/
/*===========================================================================*/
template <typename T>
static void Swap( T* values, size_t n )
{
KVS_STATIC_ASSERT( is_supported<T>::value, "not supported" );
SwapBytes<sizeof( T )>( values, n );
}
private:
/*===========================================================================*/
/**
* @brief Swaps the endianess of the NBytes bytes value which \p value points.
* @param value [in] pointer to the value
*/
/*===========================================================================*/
template <size_t NBytes>
static void SwapBytes( void* )
{
KVS_STATIC_ASSERT( false, "unexpected byte size" );
}
template <>
static void SwapBytes<1>( void* )
{
}
template <>
static void SwapBytes<2>( void* value )
{
unsigned char* v = static_cast<unsigned char*>( value );
std::swap( v[0], v[1] );
}
template <>
static void SwapBytes<4>( void* value )
{
unsigned char* v = static_cast<unsigned char*>( value );
std::swap( v[0], v[3] );
std::swap( v[1], v[2] );
}
template <>
static void SwapBytes<8>( void* value )
{
unsigned char* v = static_cast<unsigned char*>( value );
std::swap( v[0], v[7] );
std::swap( v[1], v[6] );
std::swap( v[2], v[5] );
std::swap( v[3], v[4] );
}
/*===========================================================================*/
/**
* @brief Swaps an array of value of which size is NByte bytes.
* @param values [in] pointer to the array head
* @param n [in] number of the elements
*/
/*===========================================================================*/
template <size_t NBytes>
static void SwapBytes( void* values, size_t n )
{
unsigned char* v = static_cast<unsigned char*>( values );
unsigned char* vend = v + n * NBytes;
while ( v != vend )
{
SwapBytes<NBytes>( v );
v += NBytes;
}
}
template <typename T>
struct is_supported : detail::false_type {};
template <> struct is_supported<char> : detail::true_type {};
template <> struct is_supported<signed char> : detail::true_type {};
template <> struct is_supported<short> : detail::true_type {};
template <> struct is_supported<int> : detail::true_type {};
template <> struct is_supported<long> : detail::true_type {};
template <> struct is_supported<long long> : detail::true_type {};
template <> struct is_supported<unsigned char> : detail::true_type {};
template <> struct is_supported<unsigned short> : detail::true_type {};
template <> struct is_supported<unsigned int> : detail::true_type {};
template <> struct is_supported<unsigned long> : detail::true_type {};
template <> struct is_supported<unsigned long long> : detail::true_type {};
template <> struct is_supported<float> : detail::true_type {};
template <> struct is_supported<double> : detail::true_type {};
private:
Endian();
};
} // end of namespace kvs
#endif
#endif // KVS__ENDIAN_H_INCLUDE
| [
"naohisa.sakamoto@gmail.com"
] | naohisa.sakamoto@gmail.com |
52dce4880ab267814c9c79c9b80e70c4a78f0571 | cc1a73a927cf1affaa74713220ff4b50999466f3 | /0407/list/main.cpp | 2e7ac1051333daf692d59cb9e7a89cc168c8071c | [] | no_license | wwyf/homework | 6ce2c40f07ad3ac404e825be75d1d25d2d9e2a22 | da3d2bb3f69151f85690253dc1d897ceeb726a95 | refs/heads/master | 2021-06-19T07:36:51.811882 | 2017-06-25T08:08:14 | 2017-06-25T08:08:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 944 | cpp | #include <iostream>
#include <string>
#include "SimpleList.hpp"
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main() {
list li;
int n;
cin >> n;
for (int i = 0, data, pos; i < n; i++) {
cin >> pos >> data;
li.insert(pos, data);
}
cout << li.toString() << " size: " << li.size() << endl;
// list li2(li);
// cout << li2.toString() << endl;
// list li3;
// li = li3 = li2 = li;
// cout << li.toString() << " size: " << li.size() << endl;
// cout << li2.toString() << " size: " << li2.size() << endl;
// cout << li3.toString() << " size: " << li3.size() << endl;
// int m;
// cin >> m;
// for (int i = 0, pos; i < m; i++) {
// cin >> pos;
// li.erase(pos);
// }
// cout << li.toString() << endl;
// cout << li.sort().toString() << endl;
// cout << li2.sort().toString() << endl;
// cout << li3.sort().toString() << endl;
return 0;
}
| [
"walkeryf@yeah.net"
] | walkeryf@yeah.net |
9187f731457bfa28daabbb8ffbeea4ed877b087d | 54f352a242a8ad6ff5516703e91da61e08d9a9e6 | /Source Codes/AtCoder/agc032/A/4672170.cpp | f438642c3c82d3c460a7221da8116e1adec5ae26 | [] | no_license | Kawser-nerd/CLCDSA | 5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb | aee32551795763b54acb26856ab239370cac4e75 | refs/heads/master | 2022-02-09T11:08:56.588303 | 2022-01-26T18:53:40 | 2022-01-26T18:53:40 | 211,783,197 | 23 | 9 | null | null | null | null | UTF-8 | C++ | false | false | 1,076 | cpp | #include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<functional>
#include <random>
using namespace std;
int N;
int b[100], b_c[100];
int ans[100];
int ok;
int main(void) {
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%d", &b[i]);
b_c[i] = b[i];
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < N - i; j++) {
if (b[j]-1 >= j) {
ans[N-1-i] = j;
}
}
for (int j = ans[N-1-i]; j < N - i - 1; j++) {
b[j] = b[j + 1];
}
for (int j = 0; j < N - i - 1; j++) {
}
}
for (int i = 0; i < N; i++) {
/*i????ans[i] + 1?ans[i]?????????
b[i-1] = b[i];
b[ans[i]+1] = b[ans[i]]
b[ans[i]] = ans[i]+1*/
for (int j = i - 1; j >= ans[i] + 1;j--) {
b[j] = b[j-1];
}
b[ans[i]] = ans[i] + 1;
}
ok = 1;
for (int i = 0; i < N; i++) {
if (b[i] != b_c[i]) {
ok = 0;
}
}
if (ok == 0) {
printf("-1\n");
}
else {
for (int i = 0; i < N; i++) {
printf("%d\n", ans[i] + 1);
}
}
} | [
"kwnafi@yahoo.com"
] | kwnafi@yahoo.com |
dd4e90c6c434c4d7a917f1ea8d18dcae0b91b815 | dbb6f94779349431286af4060ffa7627485b9bea | /Arduino code/Blink_analog_3/Blink_analog_3.ino | 5e003c5e4f1d60661f17e59f40bcb886f04329dd | [] | no_license | chupacabracito/Thermostat_Github_Repository | 12f89e3a5ae986b73a040fe9f13a6c5dbf7a5a7b | c6daad6d28beb0e1b7dc9f2a0bdc387d52f0e6fb | refs/heads/master | 2021-01-01T19:56:40.341056 | 2013-12-21T03:53:08 | 2013-12-21T03:53:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 708 | ino | /*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = A3;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}
| [
"faludi@berkeley.edu"
] | faludi@berkeley.edu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.