blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 2
247
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
57
| license_type
stringclasses 2
values | repo_name
stringlengths 4
111
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
58
| visit_date
timestamp[ns]date 2015-07-25 18:16:41
2023-09-06 10:45:08
| revision_date
timestamp[ns]date 1970-01-14 14:03:36
2023-09-06 06:22:19
| committer_date
timestamp[ns]date 1970-01-14 14:03:36
2023-09-06 06:22:19
| github_id
int64 3.89k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 25
values | gha_event_created_at
timestamp[ns]date 2012-06-07 00:51:45
2023-09-14 21:58:52
⌀ | gha_created_at
timestamp[ns]date 2008-03-27 23:40:48
2023-08-24 19:49:39
⌀ | gha_language
stringclasses 159
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
10.5M
| extension
stringclasses 111
values | filename
stringlengths 1
195
| text
stringlengths 7
10.5M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
06da535ddb5f689bfc81afd16dd37e96556f5df4
|
63dfe36bac2dcb470130750d9eba52f0732ae454
|
/数据结构与算法题目集(中文)/7-26 Windows消息队列.cpp
|
e4ce748ac9c2210aec90fa6ed4680512863ce4d3
|
[] |
no_license
|
laity-slf/PTA
|
de8295ee61e929bf1ba204e92978b90c55b6d6fc
|
f10f09a30d6cd6f4f5a70e5513d8363429182024
|
refs/heads/master
| 2022-06-25T18:52:22.832846
| 2019-09-07T08:17:42
| 2019-09-07T08:17:42
| null | 0
| 0
| null | null | null | null |
WINDOWS-1252
|
C++
| false
| false
| 814
|
cpp
|
7-26 Windows消息队列.cpp
|
#include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
struct Message {
char name[10];
int ranked;
friend bool operator < (Message m1, Message m2) {
return m1.ranked > m2.ranked;
}
};
priority_queue<Message> q;
int main()
{
int n;
char str[10];
Message temp;
scanf("%d", &n);
for(int i = 0; i < n; i++) {
scanf("%s", str);
if(strcmp(str, "PUT") == 0) { // strcmp±È½Ïchar[]µÄ×ÖµäÐò
scanf("%s%d", temp.name, &temp.ranked);
q.push(temp);
} else if(strcmp(str, "GET") == 0) {
if(!q.empty()) {
printf("%s\n", q.top().name);
q.pop();
} else {
printf("EMPTY QUEUE!\n");
}
}
}
return 0;
}
|
006416dbee1e04b5e75412971a8b09d46cac79a0
|
19368726358c264f79cbd81907aba6cd2c8c2692
|
/tests/state_machine_test.hpp
|
d1b0c1e30a477e63f4f97925ba45076d4dc25659
|
[] |
no_license
|
AlexZus/state_machine
|
55a73d01bc29cfb9ae9d90c04e72e5746261db78
|
e0aa4334c06bef0432c32243a127721b17a11272
|
refs/heads/master
| 2021-09-28T00:23:02.649616
| 2021-09-24T06:50:19
| 2021-09-24T06:50:19
| 154,158,250
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,394
|
hpp
|
state_machine_test.hpp
|
//
// Created by alex on 28.06.18.
//
#ifndef PAIDAGOGOS_STATE_MACHINE_TEST_H
#define PAIDAGOGOS_STATE_MACHINE_TEST_H
#include "state_machine.hpp"
#include "data_container.hpp"
namespace StateMachineTest
{
struct DC_Set : public DataContainer
{
static constexpr const char* clsName = stringify(DC_Set);
int A;
DC_Set(int A = 0) : DataContainer(clsName), A(A) {};
};
struct StateMachineTestInterface
{
StateMachineTestInterface()
{
setData = [](std::shared_ptr<DC_Set> pData)
{};
flush = []()
{ return false; };
}
std::function<void(std::shared_ptr<DC_Set> pData)> setData;
std::function<bool()> flush;
};
struct DC_Start : public DataContainer
{
static constexpr const char* clsName = stringify(DC_Start);
StateMachineTestInterface *testInterface;
DC_Start(StateMachineTestInterface *testInterface = nullptr)
: DataContainer(clsName)
, testInterface(testInterface){};
};
struct DC_Stop : public DataContainer
{
static constexpr const char* clsName = stringify(DC_Stop);
DC_Stop() : DataContainer(clsName) {};
};
struct DC_Send : public DataContainer
{
static constexpr const char* clsName = stringify(DC_Send);
DC_Send() : DataContainer(clsName) {};
};
struct DC_Crash : public DataContainer
{
static constexpr const char* clsName = stringify(DC_Crash);
DC_Crash() : DataContainer(clsName) {};
};
struct DC_Common1 : public DataContainer
{
static constexpr const char* clsName = stringify(DC_Common1);
DC_Common1() : DataContainer(clsName) {};
};
struct DC_Common2 : public DataContainer
{
static constexpr const char* clsName = stringify(DC_Common2);
DC_Common2() : DataContainer(clsName) {};
};
class StateMachineTester : public StateMachine
{
using thisCls = StateMachineTester;
private:
enum eStates : tState
{
ST_NULL = 0,
ST_STARTED,
ST_CRASHED,
ST_MAX_VAL,
};
public:
StateMachineTester() : StateMachine(ST_NULL)
{
StateMapCreator smc(ST_MAX_VAL);
smc.useAction(DCID0(DC_Start));
smc.add(ST_NULL, ST_STARTED, SMA(act_start));
smc.add(ST_STARTED);
smc.add(ST_CRASHED, ST_NULL, SMA(act_clearAndRestart));
smc.useAction(DCID0(DC_Stop));
smc.add(ST_NULL);
smc.add(ST_STARTED, ST_NULL, SMA(act_stop));
smc.add(ST_CRASHED, ST_NULL, SMA(act_clear));
smc.useAction(DCID0(DC_Set));
smc.add(ST_NULL);
smc.add(ST_STARTED, ST_STARTED, SMA(act_set));
smc.add(ST_CRASHED);
smc.useAction(DCID0(DC_Send));
smc.add(ST_NULL);
smc.add(ST_STARTED, ST_STARTED, SMA(act_send));
smc.add(ST_CRASHED);
smc.useAction(DCID0(DC_Crash));
smc.add(ST_NULL);
smc.add(ST_STARTED, ST_STARTED, SMA(act_crash));
smc.add(ST_CRASHED);
smc.useAction({DCID0(DC_Common1), DCID0(DC_Common2)});
smc.add(ST_NULL);
smc.add(ST_STARTED, ST_STARTED, SMA(act_common));
smc.add(ST_CRASHED);
initStateMap(smc);
thisInterface.setData = [this](std::shared_ptr<DC_Set> pData)
{ this->doAction(pData); };
};
~StateMachineTester()
{
delete data;
}
StateMachineTestInterface *getInterface()
{
return &thisInterface;
}
int getData()
{
if (data == nullptr)
return -1;
return *data;
}
void doSet(int A)
{
doAction(std::make_shared<DC_Set>(A));
}
const tState getState()
{
return currentState;
}
private:
void freeData()
{
delete data;
data = nullptr;
}
void act_start(std::shared_ptr<DC_Start> pData)
{
if (pData != nullptr)
outInterface = pData->testInterface;
data = new int();
*data = 10;
}
void act_clear(DCP)
{
freeData();
}
void act_clearAndRestart(DCP)
{
freeData();
internalAction(ActionCore{SMA(act_start), ST_STARTED});
}
void act_stop(DCP)
{
freeData();
}
void act_set(std::shared_ptr<DC_Set> pData)
{
*data = pData->A;
}
void act_send(DCP)
{
outInterface->setData(std::make_shared<DC_Set>(*data));
}
void act_crash(DCP)
{
internalAction(ActionCore{SMA(act_crash_process), ST_CRASHED});
}
void act_crash_process(DCP)
{
*data = 100;
}
void act_common(tPDC pDC)
{
if (pDC->getType() == DCID(DC_Common1))
*data = 301;
if (pDC->getType() == DCID(DC_Common2))
*data = 302;
}
StateMachineTestInterface thisInterface;
StateMachineTestInterface *outInterface;
int *data = nullptr;
};
}
#endif //PAIDAGOGOS_STATE_MACHINE_TEST_H
|
b7628a7f1fc98429a4212eb2e817dbb4b16b95e3
|
ee878f2dfb322a7bae5aaa78c7a249b30caffe4c
|
/src/console/console.cpp
|
fdea22466f4ba6a44c560dd05048b62ea74cbda2
|
[
"MIT"
] |
permissive
|
TulioAbreu/game-project
|
d8f015181604341c0ce62942a2601b4c70ea8f1b
|
24367a8abe982a022354b0586f95d78f3d851c8d
|
refs/heads/master
| 2021-01-09T14:58:41.345024
| 2020-10-18T12:15:11
| 2020-10-18T12:15:11
| 242,346,406
| 0
| 0
|
MIT
| 2020-12-01T14:03:38
| 2020-02-22T13:29:24
|
C++
|
UTF-8
|
C++
| false
| false
| 730
|
cpp
|
console.cpp
|
#include "console.hpp"
void Console::Console::updateLog() {
if (mCommandLog.size() >= CONSOLE_MAX_LOG_SIZE) {
mCommandLog.erase(mCommandLog.begin());
}
}
void Console::Console::cleanCommandBuffer() {
mCommandBuffer[0] = '\0';
}
void Console::Console::clean() {
mCommandLog.clear();
mCommandLogBuffer = "";
}
void Console::Console::log(std::string message) {
mCommandLog.push_back(message);
mCommandLogBuffer += message + "\n";
updateLog();
}
const std::string Console::Console::getLogBuffer() const {
return mCommandLogBuffer;
}
char* Console::Console::getBufferPtr() {
return mCommandBuffer;
}
int Console::Console::getBufferSize() const {
return CONSOLE_BUFFER_SIZE;
}
|
7ee03e74c534f6b33d1a876d553177571b068c06
|
36357bbe859f79d48f9313442ccb39e78f25b347
|
/modules/drivers/radar/uhnder_radar/driver/system-radar-software/engine/scp-src/eng-api/uhdp-control.h
|
d629bf25774c60b80e9199fd496dd6189cd53fb2
|
[
"Apache-2.0"
] |
permissive
|
MaxLin86/apollo
|
75c8a94d90daa14759c0bb0eae3085638bb9b6b5
|
fae1adf277c8d2b75e42119c5d52cbd1c6fb95c7
|
refs/heads/main
| 2023-03-28T18:22:36.161004
| 2021-03-08T07:53:25
| 2021-03-08T07:53:25
| 345,560,672
| 1
| 2
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,383
|
h
|
uhdp-control.h
|
#ifndef SRS_HDR_UHDP_CONTROL_H
#define SRS_HDR_UHDP_CONTROL_H 1
// START_SOFTWARE_LICENSE_NOTICE
// -------------------------------------------------------------------------------------------------------------------
// Copyright (C) 2016-2019 Uhnder, Inc. All rights reserved.
// This Software is the property of Uhnder, Inc. (Uhnder) and is Proprietary and Confidential. It has been provided
// under license for solely use in evaluating and/or developing code for Uhnder products. Any use of the Software to
// develop code for a product not manufactured by or for Uhnder is prohibited. Unauthorized use of this Software is
// strictly prohibited.
// Restricted Rights Legend: Use, Duplication, or Disclosure by the Government is Subject to Restrictions as Set
// Forth in Paragraph (c)(1)(ii) of the Rights in Technical Data and Computer Software Clause at DFARS 252.227-7013.
// THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE UHNDER END-USER LICENSE AGREEMENT (EULA). THE PROGRAM MAY ONLY
// BE USED IN A MANNER EXPLICITLY SPECIFIED IN THE EULA, WHICH INCLUDES LIMITATIONS ON COPYING, MODIFYING,
// REDISTRIBUTION AND WARRANTIES. PROVIDING AFFIRMATIVE CLICK-THROUGH CONSENT TO THE EULA IS A REQUIRED PRECONDITION
// TO YOUR USE OF THE PROGRAM. YOU MAY OBTAIN A COPY OF THE EULA FROM WWW.UHNDER.COM. UNAUTHORIZED USE OF THIS
// PROGRAM IS STRICTLY PROHIBITED.
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES ARE GIVEN, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING
// WARRANTIES OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE. RECIPIENT SHALL HAVE
// THE SOLE RESPONSIBILITY FOR THE ADEQUATE PROTECTION AND BACK-UP OF ITS DATA USED IN CONNECTION WITH THIS SOFTWARE.
// IN NO EVENT WILL UHNDER BE LIABLE FOR ANY CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING LOSS OF DATA OR USE, LOST
// PROFITS OR ANY INCIDENTAL OR SPECIAL DAMAGES, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
// SOFTWARE, WHETHER IN ACTION OF CONTRACT OR TORT, INCLUDING NEGLIGENCE. UHNDER FURTHER DISCLAIMS ANY LIABILITY
// WHATSOEVER FOR INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY.
// -------------------------------------------------------------------------------------------------------------------
// END_SOFTWARE_LICENSE_NOTICE
#include "modules/drivers/radar/uhnder_radar/driver/system-radar-software/env-uhnder/coredefs/uhnder-common.h"
#include "modules/drivers/radar/uhnder_radar/driver/system-radar-software/env-uhnder/coredefs/control-message-def.h"
SRS_DECLARE_NAMESPACE()
#if WITH_UHDP
class UhdpControlMessageHandler
{
public:
/*! Will be called by the UhDP protocol agent when an environment control
* messages of the registered UhdpControlMessageType is received by the
* UhDP protocol agent. The message buffer is owned by the protocol agent
* will be reused immediately after this function returns. The caller must
* copy any message data it wishes to keep */
virtual void control_message_received(const CHAR* msg, uint32_t msg_length) = 0;
/*! Will be called by the UhDP protocol agent when a data logger connects to
* the radar's UhDP port. */
virtual void connection_established() = 0;
/*! Will be called by the UhDP protocol agent when a data logger disconnects
* from the radar */
virtual void connection_closed() = 0;
};
//! Interface by which environment code can trasmit or receive control messages
// over the UhDP network protocol.
class UhdpControl
{
public:
static UhdpControl& instance();
UhdpControl() {}
virtual ~UhdpControl() {}
/*! Returns true if a data logger application is connected to the radar */
virtual bool is_connected() const { return false; }
/*! Returns the UHDP version which was negotiated for this connection (only
* applicable when is_connected() returns true) */
virtual uint32_t get_uhdp_version() const { return 0; }
/*! Returns the maximum length, in bytes, of any message written into an
* environment datagram buffer */
virtual uint32_t get_env_datagram_buffer_max_length() const { return 0; }
/*! Returns a pointer to a network buffer. Caller must write a control
* message into the buffer and then call send_env_datagram_buffer(). This
* function may return NULL if there are no network buffers available (which
* should be a temporary situation) */
virtual void* get_env_datagram_buffer() { return NULL; }
/*! Completes the process of sending an environment datagram buffer
* (enqueues the message for transmission). The message type enumerations
* are defined in the environment header coredefs/control-message-def.h.
* msg_length must be the number of bytes written into the buffer */
virtual bool send_env_datagram_buffer(UhdpControlMessageType t, uint32_t msg_length) { return false; }
/*! Registers a callback function which will be called when environment
* control messages of the specified type are received by the UhDP protocol
* agent. ctrl.connection_established() will be called if a data logger is
* already connected to the radar */
virtual void register_control_message_handler(UhdpControlMessageType t, UhdpControlMessageHandler& ctrl) {}
};
#endif
SRS_CLOSE_NAMESPACE()
#endif // SRS_HDR_UHDP_CONTROL_H
|
60601bd1d2f6d9780567b74cf06b3111f3207699
|
fe50fca386dc79ff7ad75185903209f07bcdab30
|
/Practice/stairLift.cpp
|
c181b0525622b8043d10f020cf922ecc029a1fdb
|
[] |
no_license
|
sainiak009/cpp_practice_codes
|
a5163e146b2851d8d7342fb440b508ea315410ce
|
5c4fb23678f1f664abccfc490e6484368023d60d
|
refs/heads/master
| 2020-03-20T18:20:39.397907
| 2018-06-16T13:49:49
| 2018-06-16T13:49:49
| 137,583,722
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 566
|
cpp
|
stairLift.cpp
|
// Ankit Saini - sainiak009@gmail.com
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
double A,B;
long k;
cin >> k >> A >> B;
double rad = (double)k/(double)2;
if(abs(A-B) == rad){
cout << 0 << endl;
}else{
if( A <= rad) A += rad;
else A -= rad;
if( B <= rad) B += rad;
else B -= rad;
long a,b;
if(A > B){
a = ceil(A);
b = floor(B);
}
else{
b = ceil(B);
a = floor(A);
}
long ans = abs(a-b) - 1 ;
cout << ans << endl;
}
}
return 0;
}
|
5cc4e3c12ecf47019e6aca1bc040827150ce0495
|
7f16d42e71a7550d1848fa6d31d8133486760768
|
/Datafile.h
|
d2d132a9d5f338ea84dd8c0c6046e06fb9f099c2
|
[] |
no_license
|
TERMMK2/TER-2A
|
03215c6c966bf2a17c70b470399d41c4a07041a6
|
144e151dc74498737dd8a8c72aa3f85abb471bde
|
refs/heads/master
| 2021-09-14T09:58:48.754342
| 2018-05-11T14:32:37
| 2018-05-11T14:32:37
| 117,685,449
| 1
| 1
| null | 2018-01-16T13:18:55
| 2018-01-16T13:12:40
| null |
UTF-8
|
C++
| false
| false
| 4,367
|
h
|
Datafile.h
|
#ifndef FILE_DATA_FILE_H // Pas a jour du tout
#include <string>
#include <iostream>
#include <Eigen>
class DataFile
{
private:
//Nom du fichier de donnée d'entrée
const std::string _file_name;
// Variables à utiliser // Ajouter un truc pour le systeme d'adaptation du maillage
std::string _CL_droite;
std::string _CL_haut;
std::string _CL_bas;
std::string _CL_gauche;
double _Val_CL_droite;
double _Val_CL_haut;
double _Val_CL_bas;
double _Val_CL_gauche;
double _CI; // Voir si besoin de changer ça ou pas (CI temperature constante)
std::string _eq;
int _N_x;
int _N_y;
double _x_min;
double _x_max;
double _y_min;
double _y_max;
double _deltaT;
double _T_final;
double _lambda;
double _lambdav;
double _lambdap;
double _rho;
double _rhov;
double _rhop;
double _Cp;
double _Cpp;
double _Cpv;
double _Aexp;
double _Ta;
std::string _Solveur;
std::string _Schema; // A voir si vraiment utile !
std::string _save_all_file; // Nom du fichier qui contiendra la solution pour tout points
std::string _save_points_file; // Nom du ou des fichiers qui contiendra l'évolution de T en fonction du temps pour 1 unique point ( si plusieurs points selectionnés les fichiers s'apellerons tous comme _save_points_file + le numéro du point
int _number_saved_points;
std::vector<std::vector<double>> _saved_points;
std::string _restart_file;
// Pour savoir si l'utilisateur a donner les paramètres
// ou si il faut utiliser les paramètres par défaut.
bool _if_CL_droite;
bool _if_CL_gauche;
bool _if_CL_haut;
bool _if_CL_bas;
bool _if_Val_CL_droite;
bool _if_Val_CL_gauche;
bool _if_Val_CL_haut;
bool _if_Val_CL_bas;
bool _if_CI;
bool _if_eq;
bool _if_N_x;
bool _if_N_y;
bool _if_x_min;
bool _if_x_max;
bool _if_y_min;
bool _if_y_max;
bool _if_deltaT;
bool _if_T_final;
bool _if_lambda;
bool _if_lambdap;
bool _if_lambdav;
bool _if_rho;
bool _if_rhop;
bool _if_rhov;
bool _if_Cp;
bool _if_Cpp;
bool _if_Cpv;
bool _if_Aexp;
bool _if_Ta;
bool _if_Solveur;
bool _if_Schema; // a voir si utile ou pas pas fait ça et la suite
bool _if_save_all_file;
bool _if_save_points_file;
bool _if_number_saved_points;
bool _if_saved_points;
bool _if_restart_file;
public:
// Constructeur
DataFile(std::string file_name);
// Lecture du fichier de donnée // Pas fait encore ça !
void ReadDataFile();
inline std::string Get_CL_droite() {return _CL_droite;}
inline std::string Get_CL_gauche() {return _CL_gauche;}
inline std::string Get_CL_haut() {return _CL_haut;}
inline std::string Get_CL_bas() {return _CL_bas;}
inline double Get_Val_CL_droite() {return _Val_CL_droite;}
inline double Get_Val_CL_gauche() {return _Val_CL_gauche;}
inline double Get_Val_CL_haut() {return _Val_CL_haut;}
inline double Get_Val_CL_bas() {return _Val_CL_bas;}
inline double Get_CI() {return _CI;}
inline std::string Get_eq() {return _eq;}
inline int Get_N_x() {return _N_x;}
inline int Get_N_y() {return _N_y;}
inline double Get_x_min() {return _x_min;}
inline double Get_x_max() {return _x_max;}
inline double Get_y_min() {return _y_min;}
inline double Get_y_max() {return _y_max;}
inline double Get_deltaT() {return _deltaT;}
inline double Get_T_final() {return _T_final;}
inline double Get_lambda() {return _lambda;}
inline double Get_lambdap() {return _lambdap;}
inline double Get_lambdav() {return _lambdav;}
inline double Get_rho() {return _rho;}
inline double Get_rhop() {return _rhop;}
inline double Get_rhov() {return _rhov;}
inline double Get_Cp() {return _Cp;}
inline double Get_Cpp() {return _Cpp;}
inline double Get_Cpv() {return _Cpv;}
inline double Get_Aexp() {return _Aexp;}
inline double Get_Ta() {return _Ta;}
inline std::string Get_Solveur() {return _Solveur;}
inline std::string Get_Schema() {return _Schema;}
inline std::string Get_save_all_file() {return _save_all_file;}
inline std::string Get_save_points_file() {return _save_points_file;}
inline int Get_number_saved_points() {return _number_saved_points;}
inline std::vector<std::vector<double>> Get_saved_points() {return _saved_points;}
inline std::string Get_restart_file() {return _restart_file;}
};
#define FILE_DATA_FILE_H
#endif
|
867b5d8e8c0c964fb86432fb97e3398e4c38f166
|
6e94fd167d0ec5a55a387244dd0d5c25b4ab6ed1
|
/HuboCma/huboikviewer.cpp
|
139b7dd93b7e52c9e66985e14488b162c7642e2a
|
[] |
no_license
|
hpgit/hubocma
|
3fb90738df2bf82c1f717dfe21b03ad4f4e0303b
|
497622f8e852e6ac01dae7d222211ec0f3363899
|
refs/heads/master
| 2021-05-28T16:55:55.289398
| 2015-01-20T08:02:48
| 2015-01-20T08:02:48
| 23,695,139
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,299
|
cpp
|
huboikviewer.cpp
|
#include "huboikviewer.h"
//#include <UniformBspline.h>
#include <HpMotionMath.h>
#include <IKSolver.h>
#include "huboikmanage.h"
HuboIkViewer::HuboIkViewer(QWidget *parent)
{
HuboIkManage *man = new HuboIkManage;
man->init(this);
man->move(200+width()+20, 200);
man->show();
}
void HuboIkViewer::setReferMotion(HuboMotionData *_refer)
{
refer = _refer;
}
void HuboIkViewer::rFoot()
{
HuboMotionData *data = hubo->getHuboMotion();
IKSolver *ik = new IKSolver(data);
Eigen::Vector3d p = refer->jointMap["RAR"]->getGlobalBoundingBoxPosition(data->getCurrentFrame()) + Vector3d(0,0.1,0);
ik->maxIter = 400;
ik->ikEps = 0.00001;
ik->weightAng = 10;
ik->weightPos = 1;
ik->stepSize = 0.01;
Quaterniond q;
q = Eigen::AngleAxisd(-M_PI / 2, Eigen::Vector3d::UnitY());
ik->run_r("RAR", p, q);
//ik->run_gradient_descent("RAR", p, q);
delete ik;
glWidget->updateGL();
}
void HuboIkViewer::solve(std::string name, Eigen::Vector3d &dpos, bool parallel,
int maxIter, double ikEps, double weightPos, double weightAng, double stepSize)
{
HuboMotionData *data = hubo->getHuboMotion();
IKSolver *ik = new IKSolver(data);
Eigen::Vector3d p = refer->jointMap[name]->getGlobalBoundingBoxPosition(data->getCurrentFrame()) + dpos;
Quaterniond q(1,0,0,0);
ik->maxIter = maxIter;
ik->ikEps = ikEps;
ik->weightAng = weightAng;
ik->weightPos = weightPos;
ik->stepSize = stepSize;
std::cout << "solve IK!" << std::endl;
Quaterniond qqq= data->jointMap[name]->getGlobalOrientation(data->getCurrentFrame());
std::cout << qqq.w() << " " << qqq.vec().transpose() << std::endl;
if (parallel)
{
//TODO:
Quaterniond qq = refer->jointMap[name]->getGlobalOrientation(data->getCurrentFrame());
Quaterniond qv(0, 0,0,1);
Vector3d vv = (qq*qv*qq.inverse()).vec();
std::cout << vv.transpose() << std::endl;
Vector3d yy(0,1,0);
q = Quaterniond(Eigen::AngleAxisd(atan2(vv.x(), vv.z()), yy));
std::cout << q.w() << " " << q.vec().transpose() << std::endl;
}
else
{
q = refer->jointMap[name]->getGlobalOrientation(data->getCurrentFrame());
}
ik->run_r(name, p, q);
qqq= data->jointMap[name]->getGlobalOrientation(data->getCurrentFrame());
std::cout << qqq.w() << " " << qqq.vec().transpose() << std::endl;
delete ik;
glWidget->updateGL();
}
|
4eb8e2f4bffa1e42bc09f091ae11656218ea7b69
|
3fd3387adf63c1f0918fe85e25151dd93dd5229e
|
/cpp/Part03/Chapter07/072/1.cpp
|
b7e6a822e340d9f07549a47ead2b795f7eaab0b6
|
[] |
no_license
|
AhnWoojin-sys/Cstudy
|
d803dea90af5053827ce96f4f5c54ab735bc59f6
|
c0bf51d0b4c082a919d02ff63759e549876c39f6
|
refs/heads/main
| 2023-01-31T17:43:35.906167
| 2020-11-17T10:32:11
| 2020-11-17T10:32:11
| 308,801,773
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 465
|
cpp
|
1.cpp
|
#include <iostream>
using namespace std;
class Rectangle{
private:
int x;
int y;
public:
Rectangle(int x, int y): x(x), y(y){
//empty
}
void ShowAreaInfo(){
cout<<x * y<<endl;
};
};
class Square : public Rectangle{
private:
public:
Square(int x): Rectangle(x, x){
//empty
}
};
int main(void){
Rectangle rec(4, 3);
Square rec2(7);
rec.ShowAreaInfo();
rec2.ShowAreaInfo();
return 0;
}
|
ad1ba2a6a2d48027e2e3283c945340e520e27c0e
|
6b2a8dd202fdce77c971c412717e305e1caaac51
|
/solutions_2749486_0/C++/praveendhinwa/B.cpp
|
a39cfe8fa1a1987af23f405b9c1232f501a17198
|
[] |
no_license
|
alexandraback/datacollection
|
0bc67a9ace00abbc843f4912562f3a064992e0e9
|
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
|
refs/heads/master
| 2021-01-24T18:27:24.417992
| 2017-05-23T09:23:38
| 2017-05-23T09:23:38
| 84,313,442
| 2
| 4
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 705
|
cpp
|
B.cpp
|
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long LL;
const int N = 100005;
int caseNo = 1;
int x , y;
void input()
{
cin >> x >> y;
}
void solve()
{
string ans = "";
if (x > 0)
{
for (int i = 0; i < x; i ++)
ans += "WE";
}
else
{
for (int i = 0; i < -x; i ++)
ans += "EW";
}
if (y > 0)
{
for(int i = 0; i < y ; i++)
ans += "SN";
}
else
{
for(int i = 0; i < -y; i++)
ans += "NS";
}
printf("Case #%d: %s\n", caseNo ++, ans.c_str());
}
int main()
{
int T;
cin >> T;
while (T--)
{
input();
solve();
}
return 0;
}
|
cdb5495ad1278b034526af0548383b9d112d2fa0
|
08434e62eb499a5e6b0e5a9c0fbac2dcbe36b6f1
|
/Scripts/Reflection/BaseComponent.h
|
576bea52c0a7d3e4cf9116bc52378b5e9da89ed3
|
[] |
no_license
|
nitvic793/Essentia
|
41b30886fd9195b04a5fb24dc31744c8ba16bde0
|
5df447184bddb26c02df9209fb5c76e893208636
|
refs/heads/master
| 2023-05-25T14:09:51.339180
| 2022-11-22T18:54:20
| 2022-11-22T18:54:20
| 197,072,397
| 11
| 0
| null | 2023-05-23T01:18:13
| 2019-07-15T21:05:56
|
C++
|
UTF-8
|
C++
| false
| false
| 411
|
h
|
BaseComponent.h
|
#include "component.h"
class TestSystem: public ISystem
{
};
/*
* Testing component
*/
struct SpeedComponent : public IComponent
{
float Speed;
float Acceleration;
M_INT(Test)
MSystemType(SystemType::Core)
};
//@Skip()
struct SkipComponent : public IComponent
{
float Speed;
float Acceleration;
};
struct NonSkipComponent : public IComponent
{
unsigned int TestField;
};
|
caba665914a74dd3691fef49e67a406a39464bc8
|
089d03a94a74a288c2ec53038b7dbe0ef3c99bd2
|
/exercicesC++/polymorphisme/fille.cpp
|
f1f71aff74672551ad73efcaeabcdd9568a3dcab
|
[] |
no_license
|
GaryVanwynsberghe/Formation-AJC
|
b01b00a9696382b752a7efab3d6fc4e79ff6edde
|
2c43f25bb2eca5c29e6d8351816da9d76e31b351
|
refs/heads/master
| 2020-04-05T22:00:42.163595
| 2018-12-27T16:44:18
| 2018-12-27T16:44:18
| 157,241,713
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 204
|
cpp
|
fille.cpp
|
#include "fille.h"
#include "mere.h"
#include <iostream>
Fille::Fille()
{
}
int Fille::fonctionMemeSignature(int x, int y)
{
std::cout<<"Je suis la fonction fille"<<std::endl;
return x * y;
}
|
e4c391a6a8c219b876e006afa26122b6f366b54d
|
c8229cb26675657b35a25f54b200adc5997a3e7f
|
/src/left_arm_controller.h
|
ee293cb3cf3f7aa068da8b6ae19fc9b0b86e61db
|
[
"MIT"
] |
permissive
|
tedere93/jenny5-gui-controller
|
e12173500a290b337bb1e4a8096f3e9e7299aa97
|
7d0a77def7187663fb197fff7e3441fdf91ca551
|
refs/heads/master
| 2021-01-20T07:04:47.339363
| 2017-04-04T20:11:47
| 2017-04-04T20:11:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,027
|
h
|
left_arm_controller.h
|
#pragma once
#pragma once
#include <opencv2\objdetect\objdetect.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include "jenny5_arduino_controller.h"
#define LEFT_ARM_BODY_MOTOR 0
#define LEFT_ARM_SHOULDER_UP_DOWN_MOTOR 1
#define LEFT_ARM_SHOULDER_LEFT_RIGHT_MOTOR 2
#define LEFT_ARM_ELBOW_MOTOR 3
#define LEFT_ARM_FOREARM_MOTOR 4
#define LEFT_ARM_GRIPPER_MOTOR 5
#define LEFT_ARM_BODY_POTENTIOMETER_INDEX 0
#define LEFT_ARM_SHOULDER_UP_DOWN_POTENTIOMETER_INDEX 1
#define LEFT_ARM_SHOULDER_LEFT_RIGHT_POTENTIOMETER_INDEX 2
#define LEFT_ARM_ELBOW_POTENTIOMETER_INDEX 3
#define LEFT_ARM_FOREARM_POTENTIOMETER_INDEX 4
#define LEFT_ARM_GRIPPER_BUTTON_INDEX 0
#define LEFT_ARM_GRIPPER_INFRARED_INDEX 0
#define LEFT_ARM_GRIPPER_BUTTON_PIN 15
// left arm
#define _potentiometer_min_LEFT_ARM_BODY_MOTOR 380
#define _potentiometer_max_LEFT_ARM_BODY_MOTOR 800
#define _potentiometer_home_LEFT_ARM_BODY_MOTOR 640
#define _potentiometer_min_LEFT_ARM_SHOULDER_UP_DOWN_MOTOR 170
#define _potentiometer_max_LEFT_ARM_SHOULDER_UP_DOWN_MOTOR 600
#define _potentiometer_home_LEFT_ARM_SHOULDER_UP_DOWN_MOTOR 500
#define _potentiometer_min_LEFT_ARM_SHOULDER_LEFT_RIGHT_MOTOR 230
#define _potentiometer_max_LEFT_ARM_SHOULDER_LEFT_RIGHT_MOTOR 750
#define _potentiometer_home_LEFT_ARM_SHOULDER_LEFT_RIGHT_MOTOR 740
#define _potentiometer_min_LEFT_ARM_ELBOW_MOTOR 480
#define _potentiometer_max_LEFT_ARM_ELBOW_MOTOR 940
#define _potentiometer_home_LEFT_ARM_ELBOW_MOTOR 630
#define _potentiometer_min_LEFT_ARM_FOREARM_MOTOR 230
#define _potentiometer_max_LEFT_ARM_FOREARM_MOTOR 720
#define _potentiometer_home_LEFT_ARM_FOREARM_MOTOR 440
#define LEFT_ARM_CAMERA_INDEX 0
#define CANNOT_CONNECT_TO_JENNY5_LEFT_ARM_STR "CANNOT CONNECT TO JENNY5 LEFT ARM\n"
#define CANNOT_CONNECT_TO_JENNY5_LEFT_ARM_ERROR 1
#define LEFT_ARM_does_not_respond_STR "LEFT_ARM does not respond! Game over!\n"
#define LEFT_ARM_does_not_respond_ERROR 2
#define Connected_to_LEFT_ARM_STR "Connected to LEFT_ARM\n"
#define ARM_DEFAULT_MOTOR_SPEED 400
#define ARM_DEFAULT_MOTOR_ACCELERATION 200
class t_left_arm_controller {
public:
cv::VideoCapture left_arm_cam;
t_jenny5_arduino_controller arduino_controller;
cv::CascadeClassifier face_classifier;
t_left_arm_controller(void);
int connect(int LEF_ARM_COM_PORT);
bool is_connected(void);
void disconnect(void);
bool setup(char* error_string);
void send_get_arduino_firmware_version(void);
void send_get_sensors_value(void);
void send_LEFT_ARM_BODY_MOTOR_home(void);
void send_LEFT_ARM_SHOULDER_UP_DOWN_MOTOR_home(void);
void send_LEFT_ARM_SHOULDER_LEFT_RIGHT_MOTOR_home(void);
void send_LEFT_ARM_ELBOW_MOTOR_home(void);
void send_LEFT_ARM_FOREARM_MOTOR_home(void);
void send_LEFT_ARM_GRIPPER_MOTOR_home(void);
void send_LEFT_ARM_BODY_MOTOR_to_sensor_position(int new_position);
void send_LEFT_ARM_SHOULDER_UP_DOWN_MOTOR_to_sensor_position(int new_position);
void send_LEFT_ARM_SHOULDER_LEFT_RIGHT_MOTOR_to_sensor_position(int new_position);
void send_LEFT_ARM_ELBOW_MOTOR_to_sensor_position(int new_position);
void send_LEFT_ARM_FOREARM_MOTOR_to_sensor_position(int new_position);
void send_LEFT_ARM_GRIPPER_MOTOR_start_open(void);
void send_LEFT_ARM_GRIPPER_MOTOR_stop_open(void);
void send_LEFT_ARM_BODY_MOTOR_move(int num_steps, int speed, int accelleration);
void send_LEFT_ARM_SHOULDER_UP_DOWN_MOTOR_move(int num_steps, int speed, int accelleration);
void send_LEFT_ARM_SHOULDER_LEFT_RIGHT_MOTOR_move(int num_steps, int speed, int accelleration);
void send_LEFT_ARM_ELBOW_MOTOR_move(int num_steps, int speed, int accelleration);
void send_LEFT_ARM_FOREARM_MOTOR_move(int num_steps, int speed, int accelleration);
void send_LEFT_ARM_GRIPPER_MOTOR_move(int num_steps, int speed, int accelleration);
void send_stop_motor(int motor_index);
bool home_all_motors(char* error_string);
void send_disable_motors(void);
void send_stop_motors(void);
char *error_to_string(int error);
};
extern t_left_arm_controller left_arm_controller;
|
d5a7a1dcf7330d4340fa1643f4c0ce95bb3a3083
|
f77ccfcaafdaf9d2d2496aea7a60bda2e8cda3f9
|
/SimpleGame/libs/cocos2dx/platform/airplay/CCSAXParser_airplay.cpp
|
380b40b53c746f6a7f25287ea90caed829ddb79e
|
[
"MIT"
] |
permissive
|
peteo/GeniusPeteo
|
17b23c4e82480188864249271933246ce62507aa
|
4c2d68dbd8516a80b808ccf27c7bf1499286fe88
|
refs/heads/master
| 2016-08-05T04:12:19.434374
| 2011-09-27T09:41:28
| 2011-09-27T09:41:28
| 2,196,052
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,366
|
cpp
|
CCSAXParser_airplay.cpp
|
/****************************************************************************
Copyright (c) 2011 cocos2d-x.org http://cocos2d-x.org
Copyright (c) 2011 Максим Аксенов
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 "CCSAXParser.h"
#include "expat.h"
#include "CCMutableDictionary.h"
#include "IwUtil.h"
NS_CC_BEGIN;
static XML_Parser s_pParser = NULL;
CCSAXParser::CCSAXParser()
{
s_pParser = NULL;
m_pDelegator = NULL;
}
CCSAXParser::~CCSAXParser(void)
{
if(s_pParser)
{
XML_ParserFree(s_pParser);
s_pParser = NULL;
}
}
bool CCSAXParser::init(const char *pszEncoding)
{
s_pParser = XML_ParserCreate(reinterpret_cast<const XML_Char*>(pszEncoding));
XML_SetUserData(s_pParser, this);
XML_SetElementHandler(s_pParser, startElement, endElement);
XML_SetCharacterDataHandler(s_pParser, textHandler);
return true;
}
bool CCSAXParser::parse(const char *pszFile)
{
bool bRet = false;
char* buf = NULL;
s3eFile* file = NULL;
do
{
file = s3eFileOpen(pszFile, "r");
if (!file)
{
IwAssertMsg(GAME, file, ("Open file %s Failed. s3eFileError Code : %i", pszFile, s3eFileGetError()));
break;
}
s3eFileSeek(file, 0, S3E_FILESEEK_END);
int size = s3eFileTell(file);
s3eFileSeek(file, 0, S3E_FILESEEK_SET);
buf = new char[size];
int done =0;
int len = (int)s3eFileRead(buf, 1, size, file);
if (XML_Parse(s_pParser, buf, len, 1) == XML_STATUS_ERROR)
{
CCLog("GAME: cocos2d: plist err: %s at line %d", XML_ErrorString(XML_GetErrorCode(s_pParser)), XML_GetCurrentLineNumber(s_pParser));
break;
}
bRet = true;
} while(0);
// cleanup
if (file)
{
s3eFileClose(file);
}
if (buf)
{
delete []buf;
}
return bRet;
}
void CCSAXParser::startElement(void *ctx, const char *name, const char **atts)
{
((CCSAXParser*)(ctx))->m_pDelegator->startElement(ctx, (const char*)name, (const char**)atts);
}
void CCSAXParser::endElement(void *ctx, const char *name)
{
((CCSAXParser*)(ctx))->m_pDelegator->endElement(ctx, (const char*)name);
}
void CCSAXParser::textHandler(void *ctx, const char *name, int len)
{
((CCSAXParser*)(ctx))->m_pDelegator->textHandler(ctx, (const char*)name, len);
}
void CCSAXParser::setDelegator(CCSAXDelegator* pDelegator)
{
m_pDelegator = pDelegator;
}
NS_CC_END;
|
401108028dc4378eaba3c92a6dc18a534442c4a5
|
e90d25f120d8c1452a2774c1e6c827ca8c634318
|
/extendedconfig.h
|
39d0d8448e27ad57de35599472cfcc00e797a559
|
[] |
no_license
|
PatriciaChung64/FlyingStickman
|
c9d614f2e22bce15f505a1103fec39ae94b8583d
|
4cc2fd9229e7688f238c6432283e04f97a2f3c71
|
refs/heads/master
| 2022-12-04T10:48:26.761753
| 2020-08-27T16:25:55
| 2020-08-27T16:25:55
| 290,823,071
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 511
|
h
|
extendedconfig.h
|
#pragma once
#include <vector>
#include "config.h"
#include "configuration.h"
class ExtendedConfig : public Configuration {
public:
ExtendedConfig(Config& config);
~ExtendedConfig() override;
virtual unsigned int getWorldWidth() override;
virtual unsigned int getWorldHeight() override;
virtual std::vector<ObstacleConfig*> getObstacleData() override;
protected:
virtual void setupConfig() override;
private:
Config& config;
std::vector<ObstacleConfig*> obstacle_data;
};
|
4e55e8c51b03b0b2d3dbdf270efe328704349823
|
fed9c8e3c04c2510abea66b92fb1990bfd42c8f7
|
/CodeForces/Round 392 - Div. 2/758E - Broken Tree.cpp
|
eeeabdd1cc01a8fde58be55fd82f76be4a22d4cb
|
[] |
no_license
|
vdae2304/Contest-archive
|
cfcd7cefb4ebb0d8da3d6bc897ca2e6df1ec8508
|
8cea78c2c2b4d084155524b8fd2a54f2f5b6aedc
|
refs/heads/master
| 2023-05-13T23:37:52.616695
| 2021-06-04T16:41:52
| 2021-06-04T16:41:52
| 112,109,781
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,426
|
cpp
|
758E - Broken Tree.cpp
|
#include <bits/stdc++.h>
using namespace std;
#define MAXN 200001
struct edge {
int X, Y;
long long W, P;
} v[MAXN];
int N;
long long weight[MAXN];
vector<edge> tree[MAXN];
void Minimize(int node) {
for (edge nxt : tree[node]) {
Minimize(nxt.Y);
if (weight[nxt.Y] > nxt.P) {
cout << "-1\n";
exit(0);
}
long long rem = min(v[nxt.X].W - 1, v[nxt.X].P - weight[nxt.Y]);
v[nxt.X].W -= rem;
v[nxt.X].P -= rem;
weight[node] += weight[nxt.Y] + v[nxt.X].W;
}
}
void Maximize(int node, long long max_weight) {
for (edge nxt : tree[node]) {
long long new_weight = min(nxt.W, v[nxt.X].W + max_weight - weight[node]);
weight[node] -= weight[nxt.Y] + v[nxt.X].W;
v[nxt.X].P += new_weight - v[nxt.X].W;
v[nxt.X].W = new_weight;
Maximize(nxt.Y, min(v[nxt.X].P, max_weight - weight[node] - v[nxt.X].W));
weight[node] += weight[nxt.Y] + new_weight;
}
}
main() {
ios_base::sync_with_stdio(0); cin.tie();
cin >> N;
for (int i = 0; i < N - 1; i++) {
cin >> v[i].X >> v[i].Y >> v[i].W >> v[i].P;
tree[v[i].X].push_back(v[i]);
tree[v[i].X].back().X = i;
}
Minimize(1);
Maximize(1, LLONG_MAX);
cout << N << "\n";
for (int i = 0; i < N - 1; i++)
cout << v[i].X << " " << v[i].Y << " " << v[i].W << " " << v[i].P << "\n";
}
|
97823f68875047a689b7c7af300a7f5cd75dbf2e
|
6bccb0ee83880ab9b7c669c9bb6244b423cd2173
|
/VisualStudio/ShakeTheBox/ShakeTheBox/inc/DataIO/GDF.h
|
2ed7296ab0d4a5c75fca58b4c1340fdf51b3235c
|
[] |
no_license
|
JHU-NI-LAB/OpenLPT_Shake-The-Box
|
e2223f3deac828e9a6bf267e697e329c11bc511e
|
e916093a46b9da15484f6607087331cee71c9e2c
|
refs/heads/master
| 2023-04-07T00:10:02.684329
| 2023-01-26T21:24:44
| 2023-01-26T21:24:44
| 196,363,623
| 30
| 15
| null | 2021-07-19T03:56:13
| 2019-07-11T09:30:14
|
C++
|
UTF-8
|
C++
| false
| false
| 1,138
|
h
|
GDF.h
|
/*
* GDF.h
*
*/
#ifndef GDF_H
#define GDF_H
#include <string>
#include <deque>
#include <stdexcept>
#include <Frame.h>
class GDF{
public:
// constructor: process the given pixel array
GDF(std::string filename, int start) throw(std::out_of_range);
// destructor
~GDF();
// read GDF files
int readGDF2D(int frame);
// write GDF files
void writeGDF3D(float pX, float pY, float pZ, int framenumber);
// fix header information
void fixHeader(int nr, int cols);
// make a Frame object with the particle positions.
Frame CreateFrame();
// return the number of particles found
int NumParticles() const;;
private:
std::string outname;
std::ifstream infile;
std::ofstream outfile;
double filePos[3];
int magic,tmpi, cols, rows;
float xi, yi, fi;
int prevFrameNum;
int currentFrameNum;
int nextFrameNum;
int missedFrame;
int waiting_to_be_written;
// store vectors of the x and y coordinates of the particles
std::deque<double> x;
std::deque<double> y;
};
inline int GDF::NumParticles() const
{
return x.size();
}
inline GDF::~GDF()
{
infile.close();
outfile.close();
}
#endif // GDF_H
|
0be207386ec2ae1b3f758cae93d1ce01ab0a8159
|
dcba341a45add70486c88f781e59aebd2fc7cb2a
|
/Headers/descriptionEXT/Faction Headers/Aegis Marines Unit Table.hpp
|
ceb8271cfbe820652ffa72177ee674abf3d51046
|
[] |
no_license
|
PhatHippo/Arma-3-Survival
|
7c00a0bdcfa2b4cb880269a388508c802974e1c8
|
fdfd5b5260129669e7af4e1f174b9d381928e57d
|
refs/heads/master
| 2023-07-11T15:09:57.416453
| 2021-08-28T16:46:35
| 2021-08-28T16:46:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,382
|
hpp
|
Aegis Marines Unit Table.hpp
|
class AEGIS_MARINE_desert_faction : NATO_faction
{
displayName = "Aegis Marines - Desert";
attackHelicopters[] = {
"O_Heli_Attack_02_dynamicLoadout_black_F"
};
transportHelicopters[] = {
"I_Heli_light_03_unarmed_F"
};
infantry[] = {
"Marine_B_USMC_Soldier_A_F",
"Marine_B_USMC_Soldier_AR_F",
"Marine_B_USMC_medic_F",
"Marine_B_USMC_engineer_F",
"Marine_B_USMC_Soldier_GL_F",
"Marine_B_USMC_soldier_M_F",
"Marine_B_USMC_soldier_AA_F",
"Marine_B_USMC_soldier_AT_F",
"Marine_B_USMC_RadioOperator_F",
"Marine_B_USMC_Soldier_F",
"Marine_B_USMC_Soldier_LAT_F",
"Marine_B_USMC_Soldier_SL_F",
"Marine_B_USMC_Soldier_TL_F"
};
};
class AEGIS_MARINE_woodland_faction : NATO_pacific_faction
{
displayName = "Aegis Marines - Woodland";
attackHelicopters[] = {
"O_Heli_Attack_02_dynamicLoadout_black_F"
};
transportHelicopters[] = {
"I_Heli_light_03_unarmed_F"
};
infantry[] = {
"Marine_B_USMC_Soldier_A_wdl_F",
"Marine_B_USMC_Soldier_AR_wdl_F",
"Marine_B_USMC_medic_wdl_F",
"Marine_B_USMC_engineer_wdl_F",
"Marine_B_USMC_Soldier_GL_wdl_F",
"Marine_B_USMC_soldier_M_wdl_F",
"Marine_B_USMC_soldier_AA_wdl_F",
"Marine_B_USMC_soldier_AT_wdl_F",
"Marine_B_USMC_RadioOperator_wdl_F",
"Marine_B_USMC_Soldier_wdl_F",
"Marine_B_USMC_Soldier_LAT_wdl_F",
"Marine_B_USMC_Soldier_SL_wdl_F",
"Marine_B_USMC_Soldier_TL_wdl_F"
};
};
|
cf99945d78463b3c6af54af5ba07d0a058683c9a
|
fb2cb3c4ba36186e8beb85e7f748b1542b166508
|
/rwlib/src/txdread.common.hxx
|
10dfec2b1897877b8cd601151de66e009adaa989
|
[] |
no_license
|
bnk996/magic-txd
|
09e5e5d7ca35132171c6be9bbdfd08a4614b3aaf
|
4ea83f4f9a074513d344875c7f24cbf347361565
|
refs/heads/master
| 2020-03-23T18:02:58.243746
| 2016-12-23T20:34:29
| 2016-12-23T20:34:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 13,858
|
hxx
|
txdread.common.hxx
|
#ifndef _RENDERWARE_COMMON_UTILITIES_PRIVATE_
#define _RENDERWARE_COMMON_UTILITIES_PRIVATE_
#include "rwserialize.hxx"
namespace rw
{
struct texDictionaryStreamPlugin : public serializationProvider
{
inline void Initialize( EngineInterface *engineInterface )
{
txdTypeInfo = engineInterface->typeSystem.RegisterStructType <TexDictionary> ( "texture_dictionary", engineInterface->rwobjTypeInfo );
if ( txdTypeInfo )
{
// Register ourselves.
RegisterSerialization( engineInterface, CHUNK_TEXDICTIONARY, txdTypeInfo, this, RWSERIALIZE_ISOF );
}
}
inline void Shutdown( EngineInterface *engineInterface )
{
if ( RwTypeSystem::typeInfoBase *txdTypeInfo = this->txdTypeInfo )
{
// Unregister us again.
UnregisterSerialization( engineInterface, CHUNK_TEXDICTIONARY, txdTypeInfo, this );
engineInterface->typeSystem.DeleteType( txdTypeInfo );
}
}
// Creation functions.
TexDictionary* CreateTexDictionary( EngineInterface *engineInterface ) const;
TexDictionary* ToTexDictionary( EngineInterface *engineInterface, RwObject *rwObj );
const TexDictionary* ToConstTexDictionary( EngineInterface *engineInterface, const RwObject *rwObj );
// Serialization functions.
void Serialize( Interface *engineInterface, BlockProvider& outputProvider, RwObject *objectToSerialize ) const;
void Deserialize( Interface *engineInterface, BlockProvider& inputProvider, RwObject *objectToDeserialize ) const;
RwTypeSystem::typeInfoBase *txdTypeInfo;
};
inline void fixFilteringMode(TextureBase& inTex, uint32 mipmapCount)
{
eRasterStageFilterMode currentFilterMode = inTex.GetFilterMode();
eRasterStageFilterMode newFilterMode = currentFilterMode;
if ( mipmapCount > 1 )
{
if ( currentFilterMode == RWFILTER_POINT )
{
newFilterMode = RWFILTER_POINT_POINT;
}
else if ( currentFilterMode == RWFILTER_LINEAR )
{
newFilterMode = RWFILTER_LINEAR_LINEAR;
}
}
else
{
if ( currentFilterMode == RWFILTER_POINT_POINT ||
currentFilterMode == RWFILTER_POINT_LINEAR )
{
newFilterMode = RWFILTER_POINT;
}
else if ( currentFilterMode == RWFILTER_LINEAR_POINT ||
currentFilterMode == RWFILTER_LINEAR_LINEAR )
{
newFilterMode = RWFILTER_LINEAR;
}
}
// If the texture requires a different filter mode, set it.
if ( currentFilterMode != newFilterMode )
{
Interface *engineInterface = inTex.engineInterface;
bool ignoreSecureWarnings = engineInterface->GetIgnoreSecureWarnings();
int warningLevel = engineInterface->GetWarningLevel();
if ( ignoreSecureWarnings == false )
{
// Since this is a really annoying message, put it on warning level 4.
if ( warningLevel >= 4 )
{
engineInterface->PushWarning( "texture " + inTex.GetName() + " has an invalid filtering mode (fixed)" );
}
}
// Fix it.
inTex.SetFilterMode( newFilterMode );
}
}
// Processor of mipmap levels.
struct mipGenLevelGenerator
{
private:
uint32 mipWidth, mipHeight;
bool generateToMinimum;
bool hasIncrementedWidth;
bool hasIncrementedHeight;
public:
inline mipGenLevelGenerator( uint32 baseWidth, uint32 baseHeight )
{
this->mipWidth = baseWidth;
this->mipHeight = baseHeight;
this->generateToMinimum = true;//false;
this->hasIncrementedWidth = false;
this->hasIncrementedHeight = false;
}
inline void setGenerateToMinimum( bool doGenMin )
{
this->generateToMinimum = doGenMin;
}
inline uint32 getLevelWidth( void ) const
{
return this->mipWidth;
}
inline uint32 getLevelHeight( void ) const
{
return this->mipHeight;
}
inline bool canIncrementDimm( uint32 dimm )
{
return ( dimm != 1 );
}
inline bool incrementLevel( void )
{
bool couldIncrementLevel = false;
uint32 curMipWidth = this->mipWidth;
uint32 curMipHeight = this->mipHeight;
bool doGenMin = this->generateToMinimum;
if ( doGenMin )
{
if ( canIncrementDimm( curMipWidth ) || canIncrementDimm( curMipHeight ) )
{
couldIncrementLevel = true;
}
}
else
{
if ( canIncrementDimm( curMipWidth ) && canIncrementDimm( curMipHeight ) )
{
couldIncrementLevel = true;
}
}
if ( couldIncrementLevel )
{
bool hasIncrementedWidth = false;
bool hasIncrementedHeight = false;
if ( canIncrementDimm( curMipWidth ) )
{
this->mipWidth = curMipWidth / 2;
hasIncrementedWidth = true;
}
if ( canIncrementDimm( curMipHeight ) )
{
this->mipHeight = curMipHeight / 2;
hasIncrementedHeight = true;
}
// Update feedback parameters.
this->hasIncrementedWidth = hasIncrementedWidth;
this->hasIncrementedHeight = hasIncrementedHeight;
}
return couldIncrementLevel;
}
inline bool isValidLevel( void ) const
{
return ( this->mipWidth != 0 && this->mipHeight != 0 );
}
inline bool didIncrementWidth( void ) const
{
return this->hasIncrementedWidth;
}
inline bool didIncrementHeight( void ) const
{
return this->hasIncrementedHeight;
}
};
inline eRasterFormat getVirtualRasterFormat( bool hasAlpha, eCompressionType rwCompressionType )
{
eRasterFormat rasterFormat = RASTER_DEFAULT;
if ( rwCompressionType == RWCOMPRESS_DXT1 )
{
if (hasAlpha)
{
rasterFormat = RASTER_1555;
}
else
{
rasterFormat = RASTER_565;
}
}
else if ( rwCompressionType == RWCOMPRESS_DXT2 ||
rwCompressionType == RWCOMPRESS_DXT3 )
{
rasterFormat = RASTER_4444;
}
else if ( rwCompressionType == RWCOMPRESS_DXT4 )
{
rasterFormat = RASTER_4444;
}
else if ( rwCompressionType == RWCOMPRESS_DXT5 )
{
rasterFormat = RASTER_4444;
}
return rasterFormat;
}
// Utilities used for reading native texture contents.
// Those are all sample types from RenderWare version 3.
enum rwSerializedRasterFormat_3
{
RWFORMAT3_UNKNOWN,
RWFORMAT3_1555,
RWFORMAT3_565,
RWFORMAT3_4444,
RWFORMAT3_LUM8,
RWFORMAT3_8888,
RWFORMAT3_888,
RWFORMAT3_16,
RWFORMAT3_24,
RWFORMAT3_32,
RWFORMAT3_555
};
enum rwSerializedPaletteType
{
RWSER_PALETTE_NONE,
RWSER_PALETTE_PAL8,
RWSER_PALETTE_PAL4
};
inline rwSerializedPaletteType genericFindPaletteTypeForFramework( ePaletteType palType )
{
if ( palType == PALETTE_4BIT )
{
return RWSER_PALETTE_PAL4;
}
else if ( palType == PALETTE_8BIT )
{
return RWSER_PALETTE_PAL8;
}
return RWSER_PALETTE_NONE;
}
inline ePaletteType genericFindPaletteTypeForSerialized( rwSerializedPaletteType palType )
{
if ( palType == RWSER_PALETTE_PAL8 )
{
return PALETTE_8BIT;
}
else if ( palType == RWSER_PALETTE_PAL4 )
{
return PALETTE_4BIT;
}
return PALETTE_NONE;
}
inline rwSerializedRasterFormat_3 genericFindRasterFormatForFramework( eRasterFormat rasterFormat )
{
rwSerializedRasterFormat_3 serFormat = RWFORMAT3_UNKNOWN;
if ( rasterFormat != RASTER_DEFAULT )
{
if ( rasterFormat == RASTER_1555 )
{
serFormat = RWFORMAT3_1555;
}
else if ( rasterFormat == RASTER_565 )
{
serFormat = RWFORMAT3_565;
}
else if ( rasterFormat == RASTER_4444 )
{
serFormat = RWFORMAT3_4444;
}
else if ( rasterFormat == RASTER_LUM )
{
serFormat = RWFORMAT3_LUM8;
}
else if ( rasterFormat == RASTER_8888 )
{
serFormat = RWFORMAT3_8888;
}
else if ( rasterFormat == RASTER_888 )
{
serFormat = RWFORMAT3_888;
}
else if ( rasterFormat == RASTER_16 )
{
serFormat = RWFORMAT3_16;
}
else if ( rasterFormat == RASTER_24 )
{
serFormat = RWFORMAT3_24;
}
else if ( rasterFormat == RASTER_32 )
{
serFormat = RWFORMAT3_32;
}
else if ( rasterFormat == RASTER_555 )
{
serFormat = RWFORMAT3_555;
}
// otherwise, well we failed.
// snap, we dont have a format!
// hopefully the implementation knows what it is doing!
}
return serFormat;
}
inline eRasterFormat genericFindRasterFormatForSerialized( rwSerializedRasterFormat_3 serFormat )
{
// Map the serialized format to our raster format.
// We should be backwards compatible to every RenderWare3 format.
eRasterFormat formatOut = RASTER_DEFAULT;
if ( serFormat == RWFORMAT3_1555 )
{
formatOut = RASTER_1555;
}
else if ( serFormat == RWFORMAT3_565 )
{
formatOut = RASTER_565;
}
else if ( serFormat == RWFORMAT3_4444 )
{
formatOut = RASTER_4444;
}
else if ( serFormat == RWFORMAT3_LUM8 )
{
formatOut = RASTER_LUM;
}
else if ( serFormat == RWFORMAT3_8888 )
{
formatOut = RASTER_8888;
}
else if ( serFormat == RWFORMAT3_888 )
{
formatOut = RASTER_888;
}
else if ( serFormat == RWFORMAT3_16 )
{
formatOut = RASTER_16;
}
else if ( serFormat == RWFORMAT3_24 )
{
formatOut = RASTER_24;
}
else if ( serFormat == RWFORMAT3_32 )
{
formatOut = RASTER_32;
}
else if ( serFormat == RWFORMAT3_555 )
{
formatOut = RASTER_555;
}
// anything else will be an unknown raster mapping.
return formatOut;
}
struct rwGenericRasterFormatFlags
{
union
{
struct
{
uint32 rasterType : 4;
uint32 privateFlags : 4;
uint32 formatNum : 4;
uint32 autoMipmaps : 1;
uint32 palType : 2;
uint32 hasMipmaps : 1;
uint32 pad : 16;
} data;
uint32 value;
};
};
static_assert( sizeof( rwGenericRasterFormatFlags ) == sizeof( uint32 ), "rwGenericRasterFormatFlags wrong size!" );
// Useful routine to generate generic raster format flags.
inline uint32 generateRasterFormatFlags( eRasterFormat rasterFormat, ePaletteType paletteType, bool hasMipmaps, bool autoMipmaps )
{
rwGenericRasterFormatFlags rf_data;
rf_data.value = 0;
// bits 0..3 can be (alternatively) used for the raster type
// bits 4..7 are stored in the raster private flags.
// Map the raster format for RenderWare3.
rf_data.data.formatNum = genericFindRasterFormatForFramework( rasterFormat );
// Decide if we have a palette.
rf_data.data.palType = genericFindPaletteTypeForFramework( paletteType );
rf_data.data.hasMipmaps = hasMipmaps;
rf_data.data.autoMipmaps = autoMipmaps;
return rf_data.value;
}
// Useful routine to read generic raster format flags.
inline void readRasterFormatFlags( uint32 rasterFormatFlags, eRasterFormat& rasterFormat, ePaletteType& paletteType, bool& hasMipmaps, bool& autoMipmaps )
{
rwGenericRasterFormatFlags rf_data;
rf_data.value = rasterFormatFlags;
// Read the format region of the raster format flags.
rwSerializedRasterFormat_3 serFormat = (rwSerializedRasterFormat_3)rf_data.data.formatNum;
rasterFormat = genericFindRasterFormatForSerialized( serFormat );
// Process palette.
rwSerializedPaletteType serPalType = (rwSerializedPaletteType)rf_data.data.palType;
paletteType = genericFindPaletteTypeForSerialized( serPalType );
hasMipmaps = rf_data.data.hasMipmaps;
autoMipmaps = rf_data.data.autoMipmaps;
}
struct texFormatInfo
{
private:
uint32 filterMode : 8;
uint32 uAddressing : 4;
uint32 vAddressing : 4;
uint32 pad1 : 16;
public:
void parse(TextureBase& theTexture, bool isLikelyToFail = false) const;
void set(const TextureBase& inTex);
void writeToBlock(BlockProvider& outputProvider) const;
void readFromBlock(BlockProvider& inputProvider);
};
template <typename userType = endian::little_endian <uint32>>
struct texFormatInfo_serialized
{
userType info;
inline operator texFormatInfo ( void ) const
{
texFormatInfo formatOut;
*(uint32*)&formatOut = info;
return formatOut;
}
inline void operator = ( const texFormatInfo& right )
{
info = *(uint32*)&right;
}
};
struct wardrumFormatInfo
{
private:
endian::little_endian <uint32> filterMode;
endian::little_endian <uint32> uAddressing;
endian::little_endian <uint32> vAddressing;
public:
void parse(TextureBase& theTexture) const;
void set(const TextureBase& inTex );
};
};
#endif //_RENDERWARE_COMMON_UTILITIES_PRIVATE_
|
76637bb67e48e4b0bcc53362c12a3796e5c7da07
|
17601c03f36271fc5a7796eb86ae75ef8994ba8b
|
/lab3/string_test.cc
|
60ec15f8fa87a2648ff9acfd9385767ca6e719e6
|
[] |
no_license
|
marcusmalmberg/eda031
|
eeb6a01a0596de66921313b6c78455209d680dbc
|
27dc6e1190b44f49c400215e41f9859ff8fcf64a
|
refs/heads/master
| 2018-12-29T00:34:05.651002
| 2012-04-02T19:04:20
| 2012-04-02T19:04:20
| 3,443,378
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,813
|
cc
|
string_test.cc
|
#include <cassert>
#include <iostream>
using namespace std;
void replace_all(string& s, const string& from, const string& to) {
string::size_type pos = 0;
while(true) {
// Find next occurance of the needle
pos = s.find(from, pos);
// If the needle wasn't found exit the loop
if(pos == string::npos) {
break;
}
// Replace the needle with the new content
s.replace(pos, from.size(), to);
// Set the search position after the new content
pos += to.size();
}
}
string primes(int ceiling) {
// Init string with P and mark 0 and 1 as not primes
string primeString = string(ceiling, 'P');
primeString[0] = 'C';
primeString[1] = 'C';
// Replace every mulitple with C
for(size_t i = 2; i < primeString.size(); ++i) {
size_t j = 2;
while(i*j < primeString.size()) {
primeString[i*j] = 'C';
++j;
}
}
// Return resulting string
return primeString;
}
int print_largest_prime(int ceiling) {
// Get string with primes and return the position of the last occurance of 'P'
string pri = primes(ceiling);
return pri.rfind('P');
}
int main() {
cout << "Testing replace_all." << endl;
string text = "A man, a plan, a canal, Panama!";
replace_all(text, "an", "XXX");
assert(text == "A mXXX, a plXXX, a cXXXal, PXXXama!");
text = "ananan";
replace_all(text, "an", "XXX");
assert(text == "XXXXXXXXX");
text = "ananan";
replace_all(text, "an", "anan");
assert(text == "anananananan");
cout << "Success: All assertions return true." << endl << endl;
int nPrimesToPrint = 200;
cout << "Printing primes from 0 to " << nPrimesToPrint << endl;
cout << primes(nPrimesToPrint) << endl << endl;
int largestPrimeCeiling = 100000;
cout << "Printing largest prime less than " << largestPrimeCeiling << endl;
cout << print_largest_prime(largestPrimeCeiling) << endl;
}
|
903f202af5dcc895265c184e27d0a6cd71410ecb
|
5931555e2b42aa3872e11fbb6fd0637725a6fc84
|
/wsu/csci/Bank_Simulation/Bank.h
|
87e647e53b4952d6538060a93833d7b86a8b1c9a
|
[] |
no_license
|
Mishkuh/wsu
|
9badffeff991e4edeac0d8e934c6971fe48fd350
|
87c099289f26d3eb8069e9a723e1d0bdbc935388
|
refs/heads/master
| 2021-01-10T16:26:03.033619
| 2016-01-08T00:48:39
| 2016-01-08T00:48:39
| 49,175,159
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 481
|
h
|
Bank.h
|
#ifndef BANK_H
#define BANK_H
#include <iostream>
#include <cstring>
#include <string>
#include "Account.h"
using std::cin;
using std::cout;
using std::endl;
using std::string;
class Bank
{
public:
Bank();
~Bank();
void setBank(Account *newBank);
Account * getBank() const;
bool insertAccount();
//void editAccount();
void deleteAccount();
void viewAccount();
Account * findAccount(int acNumber);
private:
Account * makeAccount();
Account * bankHead;
};
#endif
|
db7c6bdbbf9dfcc1fc1f326aef43c0c67387e8fa
|
2b5b3cd32028b1c6e159e087b0398bce778cd0fd
|
/src/x.cc
|
4d44a3f74871cc0a775e26b170d2ab4706de615e
|
[] |
no_license
|
aakarsh/x
|
ad523754761d24d5dca1a6e91161afa7067e3307
|
06e776bbd75eba81cde941251a3f118f1e208a7d
|
refs/heads/master
| 2020-05-31T08:28:22.353520
| 2018-02-05T17:28:19
| 2018-02-05T17:28:19
| 94,022,725
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 23,240
|
cc
|
x.cc
|
#include <ncurses.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <map>
#include <functional>
#include <memory>
#include <thread>
#include <mutex>
using namespace std;
class app;
enum log_level { LOG_LEVEL_INFO, LOG_LEVEL_DEBUG};
class logger {
private:
// static instance of logger.
static logger* debug_logger;
public:
log_level level;
ofstream debug_stream;
static bool debug_mode;
logger();
~logger() {
// if(logger::debug_mode)
// this->debug_stream.close();
}
ostream& out();
logger& log(const string& str);
};
class app {
friend class logger;
public:
static bool debug_mode;
static string debug_log_file;
static logger* debug_logger;
static logger& get_logger();
app() {
if(!debug_logger) {
this->debug_logger = new logger();
}
debug_logger->log("x:started");
}
~app() {
debug_logger->log("x:ended");
delete &(app::get_logger()); // close log file
}
};
#ifdef DEBUG
bool app::debug_mode = true;
#else
bool app::debug_mode = true;
#endif
string app::debug_log_file = "x-debug.log";
const char* log_file ="x.log";
logger::logger() : level(LOG_LEVEL_INFO) {
this->debug_stream.open(app::debug_log_file,
std::ofstream::out);
if(app::debug_mode) {
this->level = LOG_LEVEL_DEBUG;
}
this->debug_stream<<"*start*:x logger"<<endl;
}
ostream& logger::out(){
return this->debug_stream;
}
logger& logger::log(const string& str) {
ostream &log = out();
if(app::debug_mode) {
log<<str<<endl;
}
log.flush();
return *this;
}
logger* app::debug_logger;
logger& app::get_logger() {
if(!app::debug_logger) {
app::debug_logger = new logger();
}
return *debug_logger;
}
// reference: http://scienceblogs.com/goodmath/2009/02/18/gap-buffer
class gap_line {
private:
const static int default_gap_size = 2; // 1024
int size = 0;
int gap_start = 0; //exclude gap_start
int gap_end = 0; //exclude gap_end
char* buf;
int gap_size = default_gap_size;
public:
gap_line(int gap_size = default_gap_size): gap_size(default_gap_size) {
buf = new char[gap_size];
gap_start = 0;
gap_end = 0;
size = gap_size;
}
gap_line(const string& data,int gap_size = default_gap_size): gap_line() {
for(auto it = data.begin() ; it != data.end() ; it++) {
insert_char('a');
}
}
void insert_char(char c) {
if(gap_start + gap_end == size) {
expand();
}
//buf[gap_start] = c;
gap_start = gap_start + 1;
}
string gap_info() {
stringstream ss;
ss<<std::setw(10)<<"[gap_start: "<<gap_start<<" gap_end: " <<gap_end<<" size: "<<size<<"]";
if(buf != nullptr) {
ss<<" data:["<<string(buf,gap_start)<<"]"<<endl;
}
return ss.str();
}
/**
* Double the size of the buffer, everytime our gaps meet
*/
void expand() {
int new_size = (size == 0) ? 1: 2 * size;
char* new_buffer = new char[new_size];
/**
* Fill till we hit gap_start.
*/
int i = 0;
while(i < gap_start) {
new_buffer[i] = buf[i];
i++;
}
/**
* From the end of the new array keep filling in you have
* reached gap_end
*/
int j = 0;
while(j < gap_end) {
new_buffer[new_size -1 + j] = buf[size - 1 + j];
j++;
}
// Update gap_end to reflect one character past the gap
this->gap_end = (new_size - 1) - gap_end; // old gap end
//delete buf; // free previous
this->buf = new_buffer; // assign new buffer
this->size = new_size; // why is size not getting updated ?
}
~gap_line() {
delete buf;
}
};
class x_line {
public:
// Position relative to the file.
long line_number;
streampos file_position;
long line_pos;
// x_line data
string data;
gap_line gap_data;
x_line(int line_no,
streampos fpos,
int lpos) :
line_number(line_no)
,file_position(fpos)
,line_pos(lpos) {}
x_line(int line_no,
streampos fpos,
int lpos,
const string& data):
line_number(line_no)
,file_position(fpos)
,line_pos(lpos)
,data(data)
,gap_data(data)
{}
x_line(): x_line(0,0,0) {}
int size(){
return this->data.size();
}
};
class buf {
private:
mutex buf_w_lock;
mutex buf_r_lock;
// List of buffer errors
enum buffer_error { buffer_noerror,
buffer_file_errory,
buffer_no_file } ;
// file backing this buffer
const string file_path;
// buffer name
const string buffer_name;
// file stream backing the buffer.
fstream buffer_stream;
buffer_error error_code = buffer_noerror;
// size of buffer.
off_t size = 0;
off_t fsize = 0;
bool modified = false;
// current line
int current_lineIndex = 0 ;
// list of lines of the buffer.
vector<x_line*> lines;
typedef pair<pair<int,int>,pair<int,int>> border;
// left-top , right-bottom
border display_border;
// index in buffer of current point
int displayLine = 0;
public:
class buf_write_cmd {
virtual void write_buf(buf* buf) {
//lock()
}
};
void set_display_border(border b) {
this->display_border = b;
}
vector<x_line*>& get_lines() {
return this->lines;
}
x_line* get_line(size_t idx) {
if(idx >= this->lines.size()) {
return nullptr;
}
return this->lines[idx];
}
bool is_modified() {
return this->modified;
}
string get_buffer_name() {
return this->buffer_name;
}
// Avoid defaults
buf() = delete;
buf(const buf& buffer) = delete;
buf(string name, string path):
file_path(path)
, buffer_name(name)
, buffer_stream(path, ios_base::in) {
if(buffer_stream.rdstate() && std::ifstream::failbit != 0) {
error_code = buffer_noerror;
return;
}
this->fill(buffer_stream);
}
~buf() {
// close open file
buffer_stream.close();
// free all lines.
this->clear();
}
bool is_error_state() {
return error_code != buffer_noerror;
}
/**
* Drop all saved lines.
*/
void clear() {
for(auto it = lines.begin() ; it != lines.end() ; it++) {
delete *it;
}
lines.clear();
}
/**
* Fill buffer with lines from the input stream.
*/
void fill(istream& in) {
string line;
int line_number = 0;
this->clear();
while(getline(in,line)) {// the whole file is read into mem
x_line* cur = new x_line(line_number, in.tellg(), 0, line);
app::get_logger().log(line);
lines.push_back(cur);
}
}
};
class buf_list {
private:
vector<buf*> buffers;
buf* current_buffer = NULL;
public:
buf_list() = default;
buf_list(buf* first):
current_buffer(first) {
this->buffers.push_back(first);
}
buf_list& append(buf* buffer) {
return this->append(*buffer);
}
buf_list& append(buf& buffer) {
this->buffers.push_back(&buffer);
this->current_buffer = &buffer;
return *this;
}
int num_buffers() {
return this->buffers.size();
}
buf* get_current_buffer() {
return this->current_buffer;
}
};
class display_window {
private:
int num_lines;
int numColumns;
int beginY;
int beginX;
WINDOW* window;
public:
// using managed resource window
display_window () = delete;
display_window& operator=(const display_window& ) = delete;
display_window(int nl, int nc,int by, int bx):
num_lines(nl)
,numColumns(nc)
,beginY(by)
,beginX(bx) {
window = newwin(num_lines, numColumns,
beginY, beginX);
// start with cursor at beginning
this->move_cursor(beginY,beginX);
}
int get_height() {
return num_lines;
};
int get_width() {
return numColumns;
};
void rewind() {
move_cursor(beginY,beginX);
}
display_window& refresh() {
wrefresh(window);
return *this;
}
display_window& move_cursor(int y, int x){
wmove(window,y,x);
wrefresh(window);
return *this;
}
display_window& display_line(int y, int x, const string& line) {
wmove(window,y,x);
wprintw(window,line.c_str());
wrefresh(window);
return *this;
}
display_window& display_line(string line) {
wprintw(window,line.c_str());
wrefresh(window);
return *this;
}
display_window& clear() {
wclear(window);
wmove(window,0,0);
wrefresh(window);
return *this;
}
string read_input(const string &prompt ) {
clear();
display_line(0,0,prompt);
char input[256];
echo();
wgetnstr(window, input, 256);
clear();
noecho();
return string(input);
}
~display_window() {
delwin(window);
}
};
class editor;
class editor_command;
class mode;
class Next_line;
enum editor_mode { command_mode = 0,
insert_mode = 1,
search_mode = 2 };
typedef map<string,editor_command*> keymap;
class x_mode {
private:
string mode_name;
keymap mode_map;
public:
x_mode(const string& name, const keymap &cmds) :
mode_name(name), mode_map(cmds){}
editor_command* lookup(const string& cmd) {
return mode_map[cmd];
}
string& get_name() { return mode_name; }
};
class editor_command {
friend class editor;
vector<string> keys;
public:
editor_command() {};
editor_command(vector<string> & ks):keys(ks) {};
vector<string> & getKeys() {
return this->keys;
}
static void keymap_add( keymap& map, editor_command* ec);
virtual editor_mode operator() (editor &display, const string& cmd ) = 0;
~editor_command() {}
};
void editor_command::keymap_add(keymap& map, editor_command* ec)
{
for(auto &key : ec->getKeys()) {
map.insert({key,ec});
}
}
// TODO: auto-gen
class move_pg : public editor_command {
public:
move_pg(): editor_command() {};
move_pg(vector<string> & ks): editor_command(ks) {};
editor_mode operator()(editor& d, const string &cmd );
};
class search_fwd : public editor_command {
public:
search_fwd(): editor_command() {};
search_fwd(vector<string> & ks): editor_command(ks) {};
editor_mode operator()(editor& d, const string &cmd );
};
class open_file : public editor_command {
public:
open_file(): editor_command() {};
open_file(vector<string> & ks): editor_command(ks) {};
editor_mode operator() (editor& d, const string &cmd );
};
class mv_point : public editor_command {
public:
mv_point(): editor_command() {};
mv_point(vector<string> & ks): editor_command(ks) {};
editor_mode operator()(editor& d, const string &cmd);
};
class toggle : public editor_command {
public:
toggle(): editor_command() {};
toggle(vector<string> & ks): editor_command(ks) {};
editor_mode operator()(editor& d, const string &cmd);
};
class editor {
private:
vector<x_mode*> modes;
int screen_height = 0;
int screen_width = 0;
int mode_padding = 1;
editor_mode mode = command_mode;
display_window *mode_window = NULL;
display_window *buffer_window = NULL;
buf_list *buffers;
bool redisplay = false; // trigger a buffer-redisplay of buffer
bool quit = false; // quit will cause the display loop to exit.
typedef pair<int,int> point;
point cursor;
int start_line = 0;
public:
bool line_number_show = false;
enum move_dir { move_y = 0 , move_x };
enum anchor_type { no_anchor = 0 ,
file_begin,
file_end,
line_begin,
line_end,
page_begin,
page_end};
editor() : buffers(new buf_list()) { }
/**
* Start ncurses
*/
void init() {
// determine the screen
initscr();
// initialized the screen_height and screen_width
getmaxyx(stdscr, this->screen_height, this->screen_width);
this->mode_window =
new display_window(screen_height-1,
screen_width,
screen_height-mode_padding, // beginY
0);
this->buffer_window =
new display_window(screen_height- mode_padding, // num lines
screen_width, // num cols
0, // beginY
0); // beginX
keymap cmd_map;
keymap search_map;
vector<string> mv_point_keys {"j","^n","k",
"^p" ,"^","0",
"$","l","h","G",
"^b","^f",
"^a","^e"};
editor_command::keymap_add(cmd_map,new mv_point(mv_point_keys));
vector<string> move_pg_keys {">","<"," ","^v", "^V"};
editor_command::keymap_add(cmd_map,new move_pg(move_pg_keys));
vector<string> toggle_keys {"."};
editor_command::keymap_add(cmd_map,new toggle(toggle_keys));
vector<string> buffer_keys {"o"};
editor_command::keymap_add(cmd_map,new open_file(buffer_keys));
vector<string> search_fwd_keys {"^s","/"};
editor_command::keymap_add(cmd_map,new search_fwd(search_fwd_keys));
this->modes.push_back(new x_mode("CMD", cmd_map));
// this->modes.push_back(new x_mode("INSERT", ins_map));
this->modes.push_back(new x_mode("SEARCH", search_map));
this->mode = command_mode;
raw();
refresh();
}
int get_currrent_line_idx() {
return
this->start_line + this->cursor.first;
}
x_line* get_current_line() {
int idx = this->get_currrent_line_idx();
return this->get_current_buffer()->get_line(idx);
}
x_mode* get_current_mode() {
return this->modes[mode];
}
void change_mode(editor_mode newMode) {
if(newMode!= mode){
mode = newMode;
}
}
void run_cmd(const string& cmd) {
if(cmd == "q") { // treat quit special for nwo
this->quit = true;
}else { // Need to look up command in the mode
// don't do redisplay unless requested
this->redisplay = false;
x_mode* mode = this->get_current_mode();
if (!mode)
return;
editor_command* editor_command = mode->lookup(cmd);
if(!editor_command)
return;
editor_mode nextMode = (*editor_command)(*this,cmd);
this->change_mode(nextMode);
}
}
void display_mode_line() {
buf* current_buffer =
this->buffers->get_current_buffer();
string modified =
current_buffer->is_modified() ? "*" : "-";
stringstream mode_line;
mode_line<<"["<<modified<<"] "<< current_buffer->get_buffer_name()
<<" ------ " << "["<< this->get_current_mode()->get_name() <<"]";
// rpait mode at 0 0
this->mode_window->display_line(0, 0, mode_line.str());
}
string mode_read_input(const string & prompt) {
string input = this->mode_window->read_input(prompt);
this->mode_window->display_line(0,0,input);
return input;
}
buf* get_current_buffer() {
return this->buffers->get_current_buffer();
}
void display_buffer() {
//app::get_logger().log("display_buffer");
this->buffer_window->clear();
this->buffer_window->rewind();
buf* buffer =
this->buffers->get_current_buffer();
vector<x_line*> & lines = buffer->get_lines();
int line_count;
for(auto line_ptr : lines) {
if((line_count - start_line) >=
this->buffer_window->get_height()) {
break;
}
if(line_count < start_line) {
line_count++;
continue;
}
// iterate through the lines going to cursor poistion
if(line_number_show){
char ls[256];
sprintf(ls,"%5d: ",line_count);
this->buffer_window->display_line(string(ls));
this->buffer_window->display_line(line_ptr->gap_data.gap_info());
}
this->buffer_window->display_line(line_ptr->data);
this->buffer_window->display_line("\n");
line_count++;
}
// rewind to beginning -
this->buffer_window->rewind();
}
/**
* box value withing limits with included
* padding.
*/
int box(int value,
pair<int,int> limits,
pair<int,int> padding) {
int min = limits.first - padding.first;
int max = limits.second - padding.second;
if(value >= max)
return max;
else if(value <= min) {
return min;
} else {
return value;
}
}
point make_point(int y, int x){
return make_pair(y,x);
}
point bol() {
return make_pair(cursor.first,0);
}
point bof() {
return make_pair(0,0);
}
point eof() {
return make_pair(this->get_current_buffer()->get_lines().size(),0);
}
point eol() {
return make_pair(cursor.first, get_line_size());
}
int get_line_size(size_t idx) {
if(idx >= 0 &&
idx < this->get_current_buffer()->get_lines().size()) {
x_line* cur = (this->get_current_buffer()->get_lines())[idx];
if(cur) {
return cur->size() - 1;
}
}
return 0;
}
int get_line_size() {
x_line* cur = this->get_current_line();
if(cur) {
return cur->size() - 1;
}
return 0;
}
point inc_point(point p, int inc, move_dir dir)
{
if(dir == move_y) {
return make_point(box(p.first+inc,
{0, this->buffer_window->get_height()},
{0, this->mode_padding})
,min(this->get_line_size(p.first+inc)+1 ,p.second));
} else if(dir == move_x) { // need to compute size of incremented line
return make_point(p.first,
box(p.second + inc,
{0, min(this->get_line_size(p.first)+1,
this->buffer_window->get_width())},
{0, this->mode_padding}));
} else{
return cursor;
}
}
void move_point(int inc, move_dir dir, anchor_type anchor ) {
// compute increment relative to anchor
if(anchor == no_anchor) {
this->cursor = inc_point(cursor,inc,dir);
} else if (anchor == line_begin) {
this->cursor = inc_point(bol(),inc, editor::move_x);
} else if (anchor == line_end) {
this->cursor = inc_point(eol(),inc, editor::move_x);
} else if (anchor == file_begin) {
this->cursor = inc_point(bof(),inc,editor::move_y);
} else if (anchor == file_end) {
this->cursor = inc_point(eof(),inc,editor::move_y);
}
else {
return;
}
}
void move_page(int pg_inc) {
int max_lines =
this->get_current_buffer()->get_lines().size();
int pg_size =
this->buffer_window->get_height();
int new_start_line =
this->start_line + (pg_inc * screen_height);
if(new_start_line <= 0 ) {
this->start_line = 0;
} else if(new_start_line >= max_lines){
this->start_line = max_lines - pg_size;
} else {
this->start_line = new_start_line;
}
mark_redisplay();
}
void mark_redisplay() {
this->redisplay = true;
}
const string parse_cmd() {
char cur = getch();
string c(1,cur);
vector<char> alphabet;
char start = 'a';
while(start < 'z')
alphabet.push_back(start++);
start = 'A';
while(start < 'Z')
alphabet.push_back(start++);
for(auto & k : alphabet) {
if(cur == (k & 037)) { //character has been CTRL modified
return (string("^") + string(1,k));
} // ALT,SHIFT,...
}
return c;
}
void start() {
this->init();
this->quit = false;
while(!this->quit) { // quit
noecho();
// mode line
this->display_mode_line();
// main buffer
this->display_buffer();
// move visible cursor
this->display_cursor();
// trigger command
this->run_cmd(this->parse_cmd());
// run the next command till redisplay becomes necessary
while(!this->redisplay
&& !this->quit) {
// get-input
this->run_cmd(this->parse_cmd());
// move the window to current place
this->display_cursor();
//app::get_logger().log("cursor_line");
}
// need to reset to do a redisplay
this->redisplay = false;
}
return;
}
void display_cursor(){
move(this->cursor.first, this->cursor.second);
refresh(); // refresh to see cursor.
}
/**
* editor will handle the life cycle of th
* buffer once it has been added to display's
* buffer list.
*/
void append_buffer(buf* buffer) {
this->buffers->append(buffer);
}
~editor(){
endwin();
// display manages buffers and its windows.
delete buffers;
delete mode_window;
delete buffer_window;
}
};
/**
* point motion commands: make the bindings less explicit.
*/
editor_mode mv_point::operator()(editor& d, const string &cmd) {
if(cmd == "j"|| cmd == "^n") { // move the cursor but dont do a redisplay
d.move_point(1,editor::move_y, editor::no_anchor);
} else if(cmd =="k" || cmd =="^p") {
d.move_point(-1,editor::move_y, editor::no_anchor);
} else if(cmd == "l"|| cmd == "^f"){
d.move_point(1,editor::move_x, editor::no_anchor); // move the cursor but dont do a redisplay
} else if(cmd =="h" || cmd =="^b") {
d.move_point(-1,editor::move_x, editor::no_anchor);
} else if(cmd == "^" || cmd =="0" || cmd =="^a") {
d.move_point(0,editor::move_x, editor::line_begin);
} else if (cmd == "$" || cmd == "^e") {
d.move_point(0,editor::move_x, editor::line_end);
} else if (cmd == "G") {
d.move_point(0,editor::move_y, editor::file_end);
}
return command_mode;
}
editor_mode move_pg::operator()(editor& d, const string &cmd) {
if(cmd == " "|| cmd == ">" || cmd == "^v"){
d.move_page(+1); // move the cursor but dont do a redisplay
} else if (cmd == "<" || cmd == "^V") {
d.move_page(-1);
}
return command_mode;
}
editor_mode toggle::operator()(editor & d, const string& cmd) {
if( cmd == "." ) {
if(d.line_number_show)
d.line_number_show = false;
else
d.line_number_show = true;
}
d.mark_redisplay();
return command_mode;
}
editor_mode search_fwd::operator()(editor & d, const string& cmd) {
if( cmd == "/" ) {
string search_string = d.mode_read_input(string("Search Forward :"));
d.mark_redisplay();
} else if (cmd == "n") {
}
return search_mode;
}
editor_mode open_file::operator()(editor & d, const string& cmd) {
if( cmd == "o" ) {
string file_path = d.mode_read_input(string("File:"));
buf* new_buf = new buf(file_path,file_path);
d.append_buffer(new_buf);
d.mark_redisplay();
}
return command_mode;
}
int
main(int argc,char* argv[])
{
app a;
//app::get_logger().log("x:started");
editor editor;
string buffer_name("x.cc");
string file_path("/home/aakarsh/src/c/x/x.cc");
if(argc > 1) { // add buffer to editor
buffer_name = argv[1];
file_path = argv[1];
}else {
cout<<"Usage: x <filename>"<<endl;
goto end;
}
editor.append_buffer(new buf(buffer_name, file_path));
editor.start();
end:
return 0;
}
|
56e19305a23821ac0984315b4bdd5844e7ca6105
|
70572481e57934f8f3e345e7ca31b126bf69046e
|
/Celeste/Tests/Source/Input/TestInputUtils.cpp
|
5e7b426ca490432ade6a67a5a1cc9c874de2b8df
|
[] |
no_license
|
AlanWills/Celeste
|
9ff00468d753fd320f44022b64eb8efa0a20eb27
|
b78bf2d3ebc2a68db9b0f2cc41da730d3a23b2f9
|
refs/heads/master
| 2021-05-24T04:03:18.927078
| 2020-07-21T21:30:28
| 2020-07-21T21:30:28
| 59,947,731
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 11,903
|
cpp
|
TestInputUtils.cpp
|
#include "TestUtils/UtilityHeaders/UnitTestHeaders.h"
#include "Input/InputManager.h"
#include "Input/InputUtils.h"
#include "Game/Game.h"
using namespace Celeste;
using namespace Celeste::Input;
namespace TestCeleste
{
CELESTE_TEST_CLASS(TestInputUtils)
//------------------------------------------------------------------------------------------------
void testInitialize()
{
getInputManager().getKeyboard().flush();
getInputManager().getMouse().flush();
}
#pragma region Get Input Manager Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_GetInputManager_ShouldReturnGameInputManager)
{
Assert::IsTrue(Game::current().getSystem<Input::InputManager>() == &getInputManager());
}
#pragma endregion
#pragma region Get Keyboard Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_GetKeyboard_ShouldReturnInputManagerKeyboard)
{
Assert::IsTrue(&Game::current().getSystem<Input::InputManager>()->getKeyboard() == &getKeyboard());
}
#pragma endregion
#pragma region Get Mouse Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_GetMouse_ShouldReturnInputManagerMouse)
{
Assert::IsTrue(&Game::current().getSystem<Input::InputManager>()->getMouse() == &getMouse());
}
#pragma endregion
#pragma region Is Key Pressed Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyPressed_ShouldReturnTrue)
{
getInputManager().getKeyboard().setKeyPressed(GLFW_KEY_A);
getInputManager().getKeyboard().update();
Assert::IsTrue(isKeyPressed(GLFW_KEY_A));
getInputManager().getKeyboard().setKeyReleased(GLFW_KEY_A);
// Haven't handled input with keyboard yet so this should still return true
Assert::IsTrue(isKeyPressed(GLFW_KEY_A));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyPressed_ShouldReturnFalse)
{
Assert::IsFalse(isKeyPressed(GLFW_KEY_A));
getInputManager().getKeyboard().setKeyPressed(GLFW_KEY_A);
// Haven't handled input yet
Assert::IsFalse(isKeyPressed(GLFW_KEY_A));
getInputManager().getKeyboard().setKeyReleased(GLFW_KEY_A);
getInputManager().getKeyboard().update();
// Haven't handled input yet
Assert::IsFalse(isKeyPressed(GLFW_KEY_A));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyPressed_WithInvalidKey_ReturnsFalse)
{
Assert::IsFalse(isKeyPressed(KEYBOARD_KEY_COUNT + 2));
}
#pragma endregion
#pragma region Is Key Released Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyReleased_ShouldReturnTrue)
{
Keyboard& keyboard = getKeyboard();
Assert::IsTrue(GLFW_KEY_A >= 0);
Assert::IsTrue(GLFW_KEY_SPACE < KEYBOARD_KEY_COUNT);
Assert::IsTrue(GLFW_KEY_A >= 0);
Assert::IsTrue(GLFW_KEY_SPACE < KEYBOARD_KEY_COUNT);
// Process key down events
keyboard.setKeyReleased(GLFW_KEY_A);
keyboard.setKeyReleased(GLFW_KEY_SPACE);
keyboard.update();
Assert::IsTrue(isKeyReleased(GLFW_KEY_A));
Assert::IsTrue(isKeyReleased(GLFW_KEY_SPACE));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyReleased_ShouldReturnFalse)
{
Keyboard& keyboard = getKeyboard();
Assert::IsTrue(GLFW_KEY_A >= 0);
Assert::IsTrue(GLFW_KEY_SPACE < KEYBOARD_KEY_COUNT);
Assert::IsTrue(GLFW_KEY_A >= 0);
Assert::IsTrue(GLFW_KEY_SPACE < KEYBOARD_KEY_COUNT);
keyboard.setKeyPressed(GLFW_KEY_A);
keyboard.setKeyPressed(GLFW_KEY_SPACE);
keyboard.update();
Assert::IsFalse(isKeyReleased(GLFW_KEY_A));
Assert::IsFalse(isKeyReleased(GLFW_KEY_SPACE));
Assert::IsTrue(isKeyReleased(GLFW_KEY_B));
Assert::IsTrue(isKeyReleased(GLFW_KEY_C));
keyboard.setKeyReleased(GLFW_KEY_A);
keyboard.setKeyReleased(GLFW_KEY_SPACE);
// Haven't called handleInput() so release calls won't be processed
Assert::IsFalse(isKeyReleased(GLFW_KEY_A));
Assert::IsFalse(isKeyReleased(GLFW_KEY_SPACE));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyReleased_WithInvalidKey_ReturnsFalse)
{
// Check this does not throw
Assert::IsFalse(isKeyReleased(-1));
Assert::IsFalse(isKeyReleased(KEYBOARD_KEY_COUNT + 2));
}
#pragma endregion
#pragma region Is Key Tapped Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyTapped_ShouldReturnTrue)
{
getInputManager().getKeyboard().setKeyReleased(GLFW_KEY_A);
getInputManager().getKeyboard().update();
getInputManager().getKeyboard().setKeyPressed(GLFW_KEY_A);
// Haven't handled input yet
Assert::IsFalse(isKeyTapped(GLFW_KEY_A));
getInputManager().getKeyboard().update();
Assert::IsTrue(isKeyTapped(GLFW_KEY_A));
getInputManager().getKeyboard().setKeyPressed(GLFW_KEY_A);
Assert::IsTrue(isKeyTapped(GLFW_KEY_A));
getInputManager().getKeyboard().setKeyReleased(GLFW_KEY_A);
// Haven't handled input yet
Assert::IsTrue(isKeyTapped(GLFW_KEY_A));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyTapped_ShouldReturnFalse)
{
Assert::IsFalse(isKeyTapped(GLFW_KEY_A));
getInputManager().getKeyboard().setKeyReleased(GLFW_KEY_A);
Assert::IsFalse(isKeyTapped(GLFW_KEY_A));
getInputManager().getKeyboard().update();
Assert::IsFalse(isKeyTapped(GLFW_KEY_A));
getInputManager().getKeyboard().setKeyPressed(GLFW_KEY_A);
// Haven't handled input yet
Assert::IsFalse(isKeyTapped(GLFW_KEY_A));
getInputManager().getKeyboard().update();
getInputManager().getKeyboard().update();
Assert::IsFalse(isKeyTapped(GLFW_KEY_A));
getInputManager().getKeyboard().setKeyReleased(GLFW_KEY_A);
getInputManager().getKeyboard().update();
Assert::IsFalse(isKeyTapped(GLFW_KEY_A));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsKeyTapped_WithInvalidKey_ReturnsFalse)
{
Assert::IsFalse(isKeyTapped(KEYBOARD_KEY_COUNT + 2));
}
#pragma endregion
#pragma region Is Button Pressed Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonPressed_ShouldReturnTrue)
{
Mouse& mouse = getMouse();
mouse.setButtonPressed(MouseButton::kLeft);
mouse.setButtonPressed(MouseButton::kRight);
// Process latest mouse messages
mouse.update();
Assert::IsTrue(isButtonPressed(MouseButton::kLeft));
Assert::IsTrue(isButtonPressed(MouseButton::kRight));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonPressed_ShouldReturnFalse)
{
Mouse& mouse = getMouse();
Assert::IsFalse(isButtonPressed(MouseButton::kLeft));
Assert::IsFalse(isButtonPressed(MouseButton::kMiddle));
Assert::IsFalse(isButtonPressed(MouseButton::kRight));
mouse.setButtonPressed(MouseButton::kLeft);
mouse.setButtonPressed(MouseButton::kRight);
// Latest mouse state has not been processed yet
Assert::IsFalse(isButtonPressed(MouseButton::kLeft));
Assert::IsFalse(isButtonPressed(MouseButton::kMiddle));
Assert::IsFalse(isButtonPressed(MouseButton::kRight));
mouse.update();
Assert::IsFalse(isButtonPressed(MouseButton::kMiddle));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonPressed_WithInvalidInput_ReturnsFalse)
{
Assert::IsFalse(isButtonPressed(MouseButton::kNumButtons));
}
#pragma endregion
#pragma region Is Button Released Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonReleased_ShouldReturnTrue)
{
Mouse& mouse = getMouse();
mouse.setButtonReleased(MouseButton::kLeft);
mouse.setButtonReleased(MouseButton::kRight);
// Process latest mouse messages
mouse.update();
Assert::IsTrue(isButtonReleased(MouseButton::kLeft));
Assert::IsTrue(isButtonReleased(MouseButton::kRight));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonReleased_ShouldReturnFalse)
{
Mouse& mouse = getMouse();
mouse.setButtonPressed(MouseButton::kLeft);
mouse.setButtonPressed(MouseButton::kMiddle);
mouse.setButtonPressed(MouseButton::kRight);
mouse.update();
Assert::IsFalse(isButtonReleased(MouseButton::kLeft));
Assert::IsFalse(isButtonReleased(MouseButton::kMiddle));
Assert::IsFalse(isButtonReleased(MouseButton::kRight));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonReleased_WithInvalidInput_ReturnsFalse)
{
Assert::IsFalse(isButtonReleased(MouseButton::kNumButtons));
}
#pragma endregion
#pragma region Is Button Clicked Tests
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonClicked_ShouldReturnTrue)
{
Mouse& mouse = getMouse();
// Process down message
mouse.setButtonReleased(MouseButton::kLeft);
mouse.setButtonReleased(MouseButton::kRight);
mouse.update();
// Process up message
mouse.setButtonPressed(MouseButton::kLeft);
mouse.setButtonPressed(MouseButton::kRight);
mouse.update();
Assert::IsTrue(isButtonClicked(MouseButton::kLeft));
Assert::IsTrue(isButtonClicked(MouseButton::kRight));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonClicked_ShouldReturnFalse)
{
Mouse& mouse = getMouse();
Assert::IsFalse(isButtonClicked(MouseButton::kLeft));
Assert::IsFalse(isButtonClicked(MouseButton::kRight));
Assert::IsFalse(isButtonClicked(MouseButton::kMiddle));
// Process down message
mouse.setButtonReleased(MouseButton::kLeft);
mouse.setButtonReleased(MouseButton::kRight);
mouse.update();
Assert::IsFalse(isButtonClicked(MouseButton::kLeft));
Assert::IsFalse(isButtonClicked(MouseButton::kRight));
Assert::IsFalse(isButtonClicked(MouseButton::kMiddle));
// Process up message
mouse.setButtonPressed(MouseButton::kLeft);
mouse.setButtonPressed(MouseButton::kRight);
mouse.update();
Assert::IsFalse(isButtonClicked(MouseButton::kMiddle));
}
//------------------------------------------------------------------------------------------------
TEST_METHOD(InputUtils_IsButtonClicked_WithInvalidInput_ReturnsFalse)
{
Assert::IsFalse(isButtonClicked(MouseButton::kNumButtons));
}
#pragma endregion
};
}
|
73a06f2d7a199af9c2877491a2ee412ebc54790d
|
1be61f7f571d3b299e7120f526919b2f53b25906
|
/ocher/fmt/Layout.h
|
a1f743dc52bf6ba33fc0e5a7d80306595da925d5
|
[] |
no_license
|
ikarus9999/OcherBook
|
781e56e89691ff08ecd7fefa0d834dd0e52830e0
|
cec17ebc3a2d0b2ad3dde3ebad1b4ae802960647
|
refs/heads/master
| 2021-01-25T00:28:50.532929
| 2012-08-28T19:07:38
| 2012-08-28T19:07:38
| 4,875,864
| 1
| 0
| null | 2012-08-28T19:07:40
| 2012-07-03T18:35:54
|
C++
|
UTF-8
|
C++
| false
| false
| 2,820
|
h
|
Layout.h
|
#ifndef OCHER_LAYOUT_H
#define OCHER_LAYOUT_H
/** @file Rough layout of a book.
*/
#include "clc/data/Buffer.h"
/**
* Contains the rough layout of the book's chapters in a file format independent and output device
* independent format. Once the book is laid out in this format, the original file can be
* discarded because this is usually more memory efficient.
*
* Derive subclasses per file format; create an "append" function to append the book's chapters
* (or spine elements, or whatever) and populate m_data.
*
* The layout class is expected to do much more work than the Render class (for one reason, so that
* the pages can be rendered quickly). The layout is canonicalized: whitespace is canonicalized,
* attributes are properly nested, etc. The Renderer just blindly follows the output bytecode with
* little additional validation.
*
* The bytecode generated by this class must match that expected by the Renderer class.
*/
class Layout
{
public:
enum Op {
OpPushTextAttr = 0,
OpPushLineAttr = 1,
OpCmd = 2,
OpSpacing = 3,
OpImage = 4,
};
enum TextAttr {
AttrBold = 0, ///< arg: future:
AttrUnderline = 1, ///< arg: future: double, strikethrough, etc
AttrItalics = 2, ///< arg: future: slant
AttrSizeRel = 3, ///< arg: -127 - +128 pts
AttrSizeAbs = 4, ///< arg: -127 - +128 pts
AttrFont = 5,
AttrPre = 6,
};
enum LineAttr {
LineJustifyLeft = 0,
LineJustifyCenter = 1,
LineJustifyFull = 2,
LineJustifyRight = 4,
};
enum Cmd {
CmdPopAttr, ///< arg: # attrs to pop (0==1)
CmdOutputStr, ///< followed by ptr to Buffer
CmdForcePage, ///< optionally set new title
};
enum Spacing {
Vert,
Horiz,
};
enum Image {
// href
// inline vs anchored
// hr
};
Layout();
~Layout();
//virtual void append(...) = 0;
clc::Buffer unlock();
protected:
void push(unsigned int opType, unsigned int op, unsigned int arg);
void pushPtr(void *ptr);
void pushTextAttr(TextAttr attr, uint8_t arg);
void popTextAttr(unsigned int n=1);
void pushLineAttr(LineAttr attr, uint8_t arg);
void popLineAttr(unsigned int n=1);
void _outputChar(char c);
void outputChar(char c);
void outputNl();
void outputBr();
void flushText();
/** Ensure m_data can hold n additional bytes */
char *checkAlloc(unsigned int n);
clc::Buffer m_data;
unsigned int m_dataLen;
int nl;
int ws;
int pre;
clc::Buffer *m_text;
unsigned int m_textLen;
static const unsigned int chunk = 1024;
};
#endif
|
f88f4c050d788d0d00eddfb64e3674db4efd649c
|
1f9ae86f8176058a751afb7c9af666aa6c61785e
|
/Strategy-I/src/Behaviors/ShortJumpCls.cpp
|
be32e3c397cdd06d5b8d4b36c3886d668dde1a30
|
[] |
no_license
|
RamazanDemirci/DesignPatternExamples
|
e13dfdcbf7937c6adbf7175f1e42d64fa565af4c
|
3be595f2028f0315d2f28b8cc51cbcd26d1f1c96
|
refs/heads/master
| 2020-03-23T05:35:30.449884
| 2018-08-13T21:18:11
| 2018-08-13T21:18:11
| 141,153,982
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 335
|
cpp
|
ShortJumpCls.cpp
|
/*
* ShortJumpCls.cpp
*
* Created on: 15 Tem 2018
* Author: tr1d5042
*/
#include <stdio.h>
#include "ShortJumpCls.h"
ShortJumpCls::ShortJumpCls() {
// TODO Auto-generated constructor stub
}
ShortJumpCls::~ShortJumpCls() {
// TODO Auto-generated destructor stub
}
void ShortJumpCls::jump(){
printf("\nShort Jump");
}
|
f9c425284fcdd1e07758fd81ba9933ad24feac96
|
1a307d4d512751c548e21acf8924162910be1bb9
|
/quadbase/radioclient.cpp
|
e2aca7b938234c4e366a3716c839370e711e87fb
|
[] |
no_license
|
krchan/uvicquad
|
4d2c944b36e7cf2aee446c019d509656785ea455
|
1bdeed79d4f9903a1c5a6b59aa775f0dd1743e76
|
refs/heads/master
| 2021-01-10T08:34:44.208309
| 2011-02-10T03:20:07
| 2011-02-10T03:20:07
| 51,811,432
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,174
|
cpp
|
radioclient.cpp
|
/*
* Radio client API
*/
#include "radio.h"
#include "packet.h"
#include "Wprogram.h"
static uint8_t RemoteStationAddr[RADIO_ADDRESS_LENGTH] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x88 };
static uint8_t BaseStationAddr[RADIO_ADDRESS_LENGTH] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x77 };
static radiopacket_t packet;
void radioInitSetup() {
/*
* Initialize the SPI connection, configure the I/O pins,
* and set the register defaults
*/
Radio_Init();
/*
* Configure pipe 0 as a receiver. Pipe 0 has to be enabled
* for the radio's link layer protocol to work. This line
* shouldn't be necessary since pipe 0 is enabled by default,
* but it's nice to be explicit.
*/
Radio_Configure_Rx(RADIO_PIPE_0,BaseStationAddr , ENABLE);
Radio_Configure(RADIO_2MBPS, RADIO_HIGHEST_POWER);
Radio_Set_Tx_Addr(RemoteStationAddr);
}
void radioSend(uint8_t command) {
packet.type = COMMAND;
packet.payload.hovercraftData.command = command;
Radio_Transmit(&packet, RADIO_WAIT_FOR_TX);
}
void radio_rxhandler(uint8_t pipenumber)
{
Radio_Receive(&packet);
Serial.print((char *) packet.payload.message.messagecontent);
}
|
e63d80d37d4f587340c80b67bd0e5fad1d8a56ae
|
7595f12a2a540868b5cb9cb955494d2060d18904
|
/cf/2/724C.cpp
|
281dfcef9995add87e19ae7a6b8aa148850dcb48
|
[] |
no_license
|
george24601/cp
|
eca845494b8e6155059d0d6615ea48b746055cbd
|
9a3568355824a1ce8fdac625f05e921ec245762b
|
refs/heads/master
| 2021-01-16T23:58:14.301165
| 2020-07-14T01:24:28
| 2020-07-14T01:24:28
| 58,160,892
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,604
|
cpp
|
724C.cpp
|
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;
typedef unsigned long long UL;
typedef long long LL;
#define LP(i, a, b) for (int i = int(a); i < int(b); i++)
#define LPE(i, a, b) for (int i = int(a); i <= int(b); i++)
typedef pair<int, int> PII;
typedef vector<vector<PII> > WAL;
typedef vector<vector<int> > SAL;
#define Ep 1e-7
//#define INF 2000000000
#define INF 1e18
/*
*/
int n, m, k;
int const MaxSize = 100010;
PII p[MaxSize];
LL ans[MaxSize];
map<PII, LL> reachT;
bool isEnd(PII p) {
return (n == p.first || 0 == p.first) && (p.second == 0 || p.second == m);
}
PII calcP1(PII p, bool right) {
int x = p.first;
int y = p.second;
if (right) {
int dist = min(n - x, m - y);
return PII(x + dist, y + dist);
} else {
int dist = min(x, y);
return PII(x - dist, y - dist);
}
}
PII calcN1(PII p, bool right) {
int x = p.first;
int y = p.second;
if (right) {
int dist = min(n - x, y);
return PII(x + dist, y - dist);
} else {
int dist = min(x, m - y);
return PII(x - dist, y + dist);
}
}
LL travelTime(PII from, PII to) {
return (abs(from.first - to.first) + abs(from.second - to.second)) / 2;
}
void updateTime(PII p, LL t) {
reachT[p] = t;
}
LL getT(PII p) {
if (reachT.count(p))
return reachT[p];
else
return INF;
}
int main() {
ios_base::sync_with_stdio(false);
//freopen("/Users/george/A_1.in", "r", stdin);
cin >> n >> m >> k;
memset(ans, -1, sizeof(ans));
LP(i, 0, k)
{
int px, py;
cin >> px >> py;
p[i] = PII(px, py);
}
PII curP = PII(0, 0);
LL curTime = 0;
bool p1 = true;
do {
updateTime(curP, curTime);
PII nextP;
if (p1) {
nextP = calcP1(curP, curP.first == 0 || curP.second == 0);
} else {
nextP = calcN1(curP, curP.first == 0 || curP.second == m);
}
curTime += travelTime(curP, nextP);
curP = nextP;
p1 = !p1;
} while (!isEnd(curP));
LP(i, 0, k)
{
PII s = p[i];
PII fromP;
LL minTime = INF;
vector<PII> from;
from.push_back(calcP1(s, true));
from.push_back(calcP1(s, false));
from.push_back(calcN1(s, true));
from.push_back(calcN1(s, false));
LP(j, 0, 4)
{
LL fromT = getT(from[j]);
if (fromT < minTime) {
fromP = from[j];
minTime = fromT;
}
}
if (minTime < INF) {
ans[i] = minTime + travelTime(fromP, s);
}
}
LP(i, 0, k)
cout << ans[i] << endl;
return 0;
}
|
010bd6102c72841bf4258aa72f42c75c2cbec3c4
|
283c42eec16d5042061e940b64665ac7aeb33e02
|
/src/Render.cpp
|
9adfbe9ec702743e08b63fbea7cc1d199e9930d3
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
pilif0/open-sea
|
4782271ae07058cb4d593d7847971309a4cedb5a
|
b5d28c82d43547894f10f02b206a607f541ce864
|
refs/heads/master
| 2021-05-11T06:19:37.121064
| 2020-08-25T19:30:41
| 2020-08-25T19:30:41
| 117,984,703
| 5
| 0
|
MIT
| 2020-08-19T23:26:52
| 2018-01-18T13:12:33
|
C++
|
UTF-8
|
C++
| false
| false
| 4,487
|
cpp
|
Render.cpp
|
/** \file Render.cpp
* Renderer implementations
*
* \author Filip Smola
*/
#include <open-sea/Render.h>
#include <open-sea/Model.h>
#include <open-sea/ImGui.h>
#include <open-sea/Profiler.h>
#include <open-sea/GL.h>
#include <open-sea/Components.h>
#include <vector>
namespace open_sea::render {
//--- start UntexturedRenderer implementation
/**
* \brief Construct a renderer
*
* Construct a renderer assigning it pointers to relevant component managers and initialising the shader.
*
* \param m Model component manager
* \param t Transformation component manager
*/
UntexturedRenderer::UntexturedRenderer(std::shared_ptr<ecs::ModelTable> m,
std::shared_ptr<ecs::TransformationTable> t)
: model_mgr(std::move(m)), transform_mgr(std::move(t)) {
// Initialise the shader
shader = std::make_unique<gl::ShaderProgram>();
shader->attach_vertex_file("data/shaders/Test.vshader");
shader->attach_fragment_file("data/shaders/Test.fshader");
shader->link();
shader->validate();
p_mat_location = shader->get_uniform_location("projectionMatrix");
w_mat_location = shader->get_uniform_location("worldMatrix");
}
/**
* \brief Render entities through camera
*
* Render a set of entities through a camera.
*
* \param camera Camera
* \param e Entities
* \param count Number of entities
*/
void UntexturedRenderer::render(std::shared_ptr<gl::Camera> camera, ecs::Entity *e, unsigned count) {
profiler::push("Setup");
// Use the shader and set the projection view matrix
shader->use();
glUniformMatrix4fv(p_mat_location, 1, GL_FALSE, &camera->get_proj_view_matrix()[0][0]);
// Prepare info and index destination
std::vector<RenderInfo> infos(count);
std::vector<int> indices(count);
profiler::pop();
// Get world matrix pointers
profiler::push("World Matrices");
std::vector<ecs::TransformationTable::Data::Ptr> refs_tr(count);
transform_mgr->table->get_reference(e, refs_tr.data(), count);
auto i = refs_tr.begin();
RenderInfo *r = infos.data();
for (unsigned j = 0; j < count; j++, i++, r++) {
if (i->matrix != nullptr) {
r->matrix = &(*i->matrix)[0][0];
}
}
profiler::pop();
// Get the model information
profiler::push("Models");
std::vector<ecs::ModelTable::Data::Ptr> refs_mo(count);
model_mgr->table->get_reference(e, refs_mo.data(), count);
auto ref = refs_mo.data();
r = infos.data();
for (unsigned j = 0; j < count; j++, ref++, r++) {
// Skip invalid indices
if (ref->model != nullptr) {
std::shared_ptr<model::Model> model = model_mgr->get_model(*(ref->model));
r->vao = model->get_vertex_array();
r->vertex_count = model->get_vertex_count();
}
}
profiler::pop();
// Render the information
profiler::push("Render");
r = infos.data();
for (unsigned j = 0; j < count; j++, r++) {
// Skip invalid entities
if (r->matrix != nullptr) {
glUniformMatrix4fv(w_mat_location, 1, GL_FALSE, r->matrix);
glBindVertexArray(r->vao);
glDrawElements(GL_TRIANGLES, r->vertex_count, GL_UNSIGNED_INT, nullptr);
}
}
profiler::pop();
// Reset state
profiler::push("Reset");
glBindVertexArray(0);
shader->unset();
profiler::pop();
}
/**
* \brief Show ImGui debug information
*/
// Note: ImGui ID stack interaction needed to separate the query modals of each component manager
void UntexturedRenderer::show_debug() {
if (ImGui::CollapsingHeader("Shader Program")) {
shader->show_debug();
}
if (ImGui::CollapsingHeader("Transformation Component Manager")) {
ImGui::PushID("transform_mgr");
transform_mgr->show_debug();
ImGui::PopID();
}
if (ImGui::CollapsingHeader("Model Component Manager")) {
ImGui::PushID("model_mgr");
model_mgr->show_debug();
ImGui::PopID();
}
}
//--- end UntexturedRenderer implementation
}
|
436fd1dee8fb5bbb5c7d5e7464a9afaf4fd9600b
|
5b4d44875317312bc1d1b9b4d74372602f4bb772
|
/Desktop/Tower-Defence/monsterway.h
|
1f5403e472eff85b720cf6f3d1a2f9f9e502c44e
|
[] |
no_license
|
HAO-Jiaxin/Tower-Defence
|
fd17e762574cf4793d60fa73f5a93353164cc45b
|
a1f525b328d61a531cdad5f4ec5b068afe37085d
|
refs/heads/master
| 2022-09-06T07:45:09.311148
| 2020-05-31T07:26:44
| 2020-05-31T07:26:44
| 268,205,257
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 116
|
h
|
monsterway.h
|
#ifndef MONSTERWAY_H
#define MONSTERWAY_H
class MonsterWay
{
public:
MonsterWay();
};
#endif // MONSTERWAY_H
|
25b106acdf2ba70d86d98493f4c8746a7fb4b226
|
cfd4de6f6dfc5b142eede59c46bfc2f1c51265c7
|
/src/ukf.cpp
|
e9c0e29e598329bb19b4b897a823afb288e03fe2
|
[] |
no_license
|
bfMendonca/SFND_Unscented_Kalman_Filter
|
5a8f51ddc6234382c11f0088fb5ee010018707ef
|
a6690d148b56f9d17d8f2182217bfb835ed6930d
|
refs/heads/master
| 2022-04-25T00:23:40.928212
| 2020-04-20T00:49:33
| 2020-04-20T00:49:33
| 256,903,312
| 0
| 0
| null | 2020-04-19T03:14:11
| 2020-04-19T03:14:11
| null |
UTF-8
|
C++
| false
| false
| 11,618
|
cpp
|
ukf.cpp
|
#include "ukf.h"
#include "Eigen/Dense"
using Eigen::MatrixXd;
using Eigen::VectorXd;
/**
* Initializes Unscented Kalman filter
*/
UKF::UKF() {
// if this is false, laser measurements will be ignored (except during init)
use_laser_ = true;
// if this is false, radar measurements will be ignored (except during init)
use_radar_ = true;
// initial state vector
x_ = VectorXd(5);
// initial covariance matrix
P_ = MatrixXd(5, 5);
// Process noise standard deviation longitudinal acceleration in m/s^2
std_a_ = 1.5*3;
// Process noise standard deviation yaw acceleration in rad/s^2
std_yawdd_ = M_PI;
/**
* DO NOT MODIFY measurement noise values below.
* These are provided by the sensor manufacturer.
*/
// Laser measurement noise standard deviation position1 in m
std_laspx_ = 0.15;
// Laser measurement noise standard deviation position2 in m
std_laspy_ = 0.15;
// Radar measurement noise standard deviation radius in m
std_radr_ = 0.3;
// Radar measurement noise standard deviation angle in rad
std_radphi_ = 0.03;
// Radar measurement noise standard deviation radius change in m/s
std_radrd_ = 0.3;
/**
* End DO NOT MODIFY section for measurement noise values
*/
/**
* TODO: Complete the initialization. See ukf.h for other member properties.
* Hint: one or more values initialized above might be wildly off...
*/
n_x_ = 5;
n_aug_ = n_x_ + 2;
//This will hold the size for augmented state size
lambda_ = 3 - n_aug_;
sigma_points_ = MatrixXd( n_aug_, 2*n_aug_ + 1);
Xsig_pred_ = MatrixXd( n_x_, 2*n_aug_ + 1);
//Initializing the matrix for storing the sigma points, and the predicted sigma points
//The weights for prediction the covariances and mean can be initialized here. They should not change
weights_ = VectorXd( 2*n_aug_+1 );
weights_(0) = lambda_/( lambda_ + n_aug_ );
for( size_t i = 1; i < 2*n_aug_+1; ++i ) {
weights_(i) = 0.5/( lambda_ + n_aug_ );
}
//Below we will initialize the covariance matrices for both sensors. As the are constant,
//We will initialize then there
R_radar_ = MatrixXd( 3, 3 );
R_radar_.fill(0.0);
R_radar_(0,0) = std_radr_*std_radr_;
R_radar_(1,1) = std_radphi_*std_radphi_;
R_radar_(2,2) = std_radrd_*std_radrd_;
R_lidar_ = MatrixXd( 2,2 );
R_lidar_.fill(0.0);
R_lidar_( 0,0 ) = std_laspx_*std_laspx_;
R_lidar_( 1,1 ) = std_laspy_*std_laspy_;
}
UKF::~UKF() {}
void UKF::ProcessMeasurement(MeasurementPackage meas_package) {
if( is_initialized_ ) {
bool laser = false, radar = false;
if( ( meas_package.sensor_type_ == MeasurementPackage::LASER ) && use_laser_ ) {
laser = true;
}else if( ( meas_package.sensor_type_ == MeasurementPackage::RADAR ) && use_radar_ ) {
radar = true;
}else {
return;
//Do nothing and return, invalid sensor_type_
}
//If we reached this point, so a valid sensor type was found, we are able to predict them update
double dt = (meas_package.timestamp_ - time_us_)/1e6;
Prediction( dt );
//Ready for update
if( laser ) {
UpdateLidar( meas_package );
}else {
UpdateRadar( meas_package );
}
time_us_ = meas_package.timestamp_;
//std::cout << "x: " << x_ << std::endl;
}else {
//First,
if( ( meas_package.sensor_type_ == MeasurementPackage::LASER ) ) {
//All parameters ready, let's mark as initialized;
is_initialized_ = true;
time_us_ = meas_package.timestamp_;
double px = meas_package.raw_measurements_(0);
double py = meas_package.raw_measurements_(1);
x_(0) = px;
x_(1) = py;
x_(2) = 0.0;
x_(3) = 0.0;
x_(4) = 0.0;
P_.setIdentity();
P_ *= 1.0;
//Melhor setup
P_(0,0) = std_laspx_*std_laspx_;
P_(1,1) = std_laspy_*std_laspy_;
P_(2,2) = 4.0; //Expectning 2m/s of difference.
P_(3,3) = 0.01; //Expecting 6 deg, abs, from the expected state
P_(4,4) = 1e-4;
// P_(0.0) = std_laspx_*std_laspx_*100;
// P_(1.1) = std_laspy_*std_laspy_*100;
// P_(2.2) = 1;
// P_(3.3) = 0.5;
// P_(4.4) = 1e-6;
}
}
}
void UKF::Prediction(double delta_t) {
//First, we need to generate the correct number of sigma points
GenerateSigmaPoints();
//Updating the sigma points. As we wrote a function for updating the state, let's use it
for( size_t i = 0; i < 2*n_aug_ + 1; ++i ) {
const Eigen::VectorXd sig_temp( sigma_points_.col(i) );
//Just an const ref for alias. It will make easier to read without affecting the performance
Xsig_pred_.col(i) = UpdateState( sig_temp.head( n_x_ ), sig_temp.tail( n_aug_ - n_x_ ), delta_t );
//the first 5 elements are the state, while the last two are the "nu", or the accelerations for the CTRV
}
//Now we will predict the mean and covariance
// predict state mean
x_.fill(0);
for( size_t i = 0; i < 2 * n_aug_ + 1; ++i ) {
x_ = x_ + weights_(i) * Xsig_pred_.col(i);
}
// predict state covariance matrix
P_.fill(0);
for( size_t i = 0; i < 2 * n_aug_ + 1; ++i ) {
VectorXd x_diff = ( Xsig_pred_.col(i) - x_ );
// angle normalization
while (x_diff(3) > M_PI) x_diff(3)-=2.*M_PI;
while (x_diff(3)<-M_PI) x_diff(3)+=2.*M_PI;
P_ = P_ + weights_(i) * x_diff * x_diff.transpose();
}
//Now we reached the end of the state. x_ and P_ have the updated values using the unscented transformation
}
void UKF::UpdateLidar(MeasurementPackage meas_package) {
const size_t n_z = meas_package.raw_measurements_.size();
// create matrix for sigma points in measurement space
MatrixXd Zsig = MatrixXd( n_z, 2 * n_aug_ + 1);
// mean predicted measurement
VectorXd z_pred = VectorXd( n_z );
// measurement covariance matrix S
MatrixXd S = MatrixXd( n_z, n_z );
// transform sigma points into measurement space
double px, py;
for( size_t i = 0; i < 2*n_aug_+1; ++i ) {
px = Xsig_pred_.col(i)(0);
py = Xsig_pred_.col(i)(1);
Zsig(0,i) = px;
Zsig(1,i) = py;
}
// calculate mean predicted measurement
z_pred.fill(0.0);
for( size_t i = 0; i < 2*n_aug_+1; ++i ) {
z_pred = z_pred + weights_(i)*Zsig.col(i);
}
// calculate innovation covariance matrix S
S.fill(0.0);
for( size_t i = 0; i < 2*n_aug_+1; ++i ) {
VectorXd diff = ( Zsig.col(i) - z_pred );
S = S + weights_(i)*diff*diff.transpose();
}
S = S+R_lidar_;
//Now the firnal part of the update
// calculate cross correlation matrix
MatrixXd Tc = MatrixXd( n_x_, n_z );
Tc.fill(0.0);
for( size_t i = 0; i < 2 * n_aug_ + 1; ++i ) {
// residual
VectorXd z_diff = Zsig.col(i) - z_pred;
// angle normalization
while (z_diff(1)> M_PI) z_diff(1)-=2.*M_PI;
while (z_diff(1)<-M_PI) z_diff(1)+=2.*M_PI;
// state difference
VectorXd x_diff = Xsig_pred_.col(i) - x_;
// angle normalization
while (x_diff(3)> M_PI) x_diff(3)-=2.*M_PI;
while (x_diff(3)<-M_PI) x_diff(3)+=2.*M_PI;
Tc = Tc + weights_(i) * x_diff * z_diff.transpose();
}
// calculate Kalman gain K;
MatrixXd K( n_x_, n_z );
K = Tc*S.inverse();
// update state mean and covariance matrix
x_ = x_ + K * ( meas_package.raw_measurements_ - z_pred );
P_ = P_ - K*S*K.transpose();
}
void UKF::UpdateRadar(MeasurementPackage meas_package) {
const size_t n_z = meas_package.raw_measurements_.size();
// create matrix for sigma points in measurement space
MatrixXd Zsig = MatrixXd( n_z, 2 * n_aug_ + 1);
// mean predicted measurement
VectorXd z_pred = VectorXd( n_z );
// measurement covariance matrix S
MatrixXd S = MatrixXd( n_z, n_z );
// transform sigma points into measurement space
double px, py, v, yaw, yawRate, rad, bearing, radVel;
for( size_t i = 0; i < 2*n_aug_+1; ++i ) {
px = Xsig_pred_.col(i)(0);
py = Xsig_pred_.col(i)(1);
v = Xsig_pred_.col(i)(2);
yaw = Xsig_pred_.col(i)(3);
yawRate = Xsig_pred_.col(i)(4);
rad = sqrt( pow( px,2 ) + pow( py,2 ) );
bearing = atan2( py, px );
radVel = ( px*cos( yaw )*v + py*sin( yaw )*v )/rad;
Zsig(0,i) = rad;
Zsig(1,i) = bearing;
Zsig(2,i) = radVel;
}
// calculate mean predicted measurement
z_pred.fill(0.0);
for( size_t i = 0; i < 2*n_aug_+1; ++i ) {
z_pred = z_pred + weights_(i)*Zsig.col(i);
}
// calculate innovation covariance matrix S
S.fill(0.0);
for( size_t i = 0; i < 2*n_aug_+1; ++i ) {
VectorXd z_diff = ( Zsig.col(i) - z_pred );
// angle normalization
while (z_diff(1)> M_PI) z_diff(1)-=2.*M_PI;
while (z_diff(1)<-M_PI) z_diff(1)+=2.*M_PI;
S = S + weights_(i)*z_diff*z_diff.transpose();
}
S = S+R_radar_;
//Now the firnal part of the update
// calculate cross correlation matrix
MatrixXd Tc = MatrixXd( n_x_, n_z );
Tc.fill(0.0);
for( size_t i = 0; i < 2 * n_aug_ + 1; ++i ) {
// residual
VectorXd z_diff = Zsig.col(i) - z_pred;
// angle normalization
while (z_diff(1)> M_PI) z_diff(1)-=2.*M_PI;
while (z_diff(1)<-M_PI) z_diff(1)+=2.*M_PI;
// state difference
VectorXd x_diff = Xsig_pred_.col(i) - x_;
// angle normalization
while (x_diff(3)> M_PI) x_diff(3)-=2.*M_PI;
while (x_diff(3)<-M_PI) x_diff(3)+=2.*M_PI;
Tc = Tc + weights_(i) * x_diff * z_diff.transpose();
}
// calculate Kalman gain K;
MatrixXd K = Tc * S.inverse();
// residual
VectorXd z_diff = meas_package.raw_measurements_ - z_pred;
// angle normalization
while (z_diff(1)> M_PI) z_diff(1)-=2.*M_PI;
while (z_diff(1)<-M_PI) z_diff(1)+=2.*M_PI;
// update state mean and covariance matrix
x_ = x_ + K * z_diff;
P_ = P_ - K*S*K.transpose();
}
Eigen::VectorXd UKF::UpdateState( const Eigen::VectorXd &x, const Eigen::VectorXd & nu, double dt ) const {
Eigen::VectorXd xOut(5);
xOut.fill(0);
if( fabs( x(4) ) > 0.001 ) {
xOut(0) = x(0) + (x(2)/x(4))*( sin( x(3)+x(4)*dt) - sin(x(3) ) );
xOut(1) = x(1) + (x(2)/x(4))*( -cos( x(3)+x(4)*dt) + cos(x(3) ) );
}else {
xOut(0) = x(0) + x(2)*cos( x(3) )*dt;
xOut(1) = x(1) + x(2)*sin( x(3) )*dt;
}
xOut(2) = x(2);
xOut(3) = x(3)+ x(4)*dt;
xOut(4) = x(4);
VectorXd nuPart(5);
nuPart(0) = 0.5*(dt*dt)*cos( x(3) )*nu(0);
nuPart(1) = 0.5*(dt*dt)*sin( x(3) )*nu(0);
nuPart(2) = dt*nu(0);
nuPart(3) = 0.5*(dt*dt)*nu(1);
nuPart(4) = dt*nu(1);
xOut += nuPart;
return xOut;
}
void UKF::GenerateSigmaPoints( ) {
//Gerating the sigma points
//Creating the augmented state from the current filter state
Eigen::VectorXd x_aug( n_aug_ );
x_aug.fill(0.0);
//Filling the x_aug with zeros as the augmented state additional state represents the mean for the noises
x_aug.head( n_x_ ) = x_;
//Creating the augmented covariance matrix
MatrixXd P_aug = MatrixXd( n_aug_, n_aug_ );
P_aug.fill(0.0);
P_aug.block< 5, 5 >( 0, 0 ) = P_;
P_aug(5,5) = std_a_*std_a_;
P_aug(6,6) = std_yawdd_*std_yawdd_;
// create square root matrix
MatrixXd A = P_aug.llt().matrixL();
//Now effectivelly calculating the sigma points
sigma_points_.col(0) = x_aug;
//The first col. is the current mean, extracted by the filter state
// set remaining sigma points
for ( size_t i = 0; i < n_aug_; ++i) {
sigma_points_.col(i+1) = x_aug + sqrt( lambda_+ n_aug_ ) * A.col(i);
sigma_points_.col(i+1+n_aug_) = x_aug - sqrt( lambda_+ n_aug_ ) * A.col(i);
}
}
|
8085a778d3c9234e18e600bd7575266c98f44f8d
|
afd7e97e3e30df7eb7ae34e3accf44e225e7ad67
|
/src/lib/src/SigprocAdapter.cpp
|
49068bab3600c4038cb3e2f9d88ba26c95ba362c
|
[
"AFL-3.0"
] |
permissive
|
mserylak/pelican-katburst
|
71d93d640b2865363e4d4115a14507404132f82f
|
608852f92e9118fe8553c18c46fe94e70b2e9bc5
|
refs/heads/master
| 2021-01-21T04:54:01.883248
| 2016-07-22T11:59:43
| 2016-07-22T11:59:43
| 46,549,196
| 1
| 1
| null | 2016-03-03T12:10:04
| 2015-11-20T08:24:10
|
C++
|
UTF-8
|
C++
| false
| false
| 3,061
|
cpp
|
SigprocAdapter.cpp
|
#include "SigprocAdapter.h"
#include "LofarTypes.h"
#include <QtCore/QFile>
namespace pelican {
namespace ampp {
/// Constructs a new SigprocAdapter.
SigprocAdapter::SigprocAdapter(const ConfigNode& config)
: AbstractStreamAdapter(config)
{
_nBits = config.getOption("sampleSize", "bits", "0").toUInt();
_nSamples= config.getOption("samplesPerRead", "number", "1024").toUInt();
_nChannels = config.getOption("channels", "number", "1").toUInt();
_iteration = 0;
}
/**
* @details
* Method to deserialise a sigproc file chunk.
*
* @param[in] in QIODevice poiting to an open file
*/
void SigprocAdapter::deserialise(QIODevice* in)
{
// Check that data is fine
_checkData();
// If first time, read file header
if (_iteration == 0) {
_fp = fopen( ((QFile *) in) -> fileName().toUtf8().data(), "rb");
_header = read_header(_fp);
_tSamp = _header->tsamp;
_tStart = _header->tstart;
}
float *dataTemp = (float *) malloc(_nSamples * _nChannels * _nBits / 8 * sizeof(float));
unsigned amountRead = read_block(_fp, _nBits, dataTemp, _nSamples * _nChannels);
// If chunk size is 0, return empty blob (end of file)
if (amountRead == 0) {
// Reached end of file
_stokesData -> resize(0, 0, 0, 0);
throw QString("End of file!");
return;
}
else if (amountRead < _nSamples * _nChannels) {
// Last chunk in file - ignore
_stokesData -> resize(0, 0, 0, 0);
throw QString("Last chunk in file - ignoring!");
return;
}
// Set timing
double jdStart = _tStart + 2400000.5;
double unixTimeStart = (jdStart - 2440587.5) * 86400;
_stokesData -> setLofarTimestamp(unixTimeStart + (_tSamp * _iteration * _nSamples));
_stokesData -> setBlockRate(_tSamp);
// Put all the samples in one time block, converting them to complex
unsigned dataPtr = 0;
for(unsigned s = 0; s < _nSamples; s++) {
for(unsigned c = 0; c < _nChannels; c++) {
float* data = _stokesData -> spectrumData(s, c, 0);
data[0] = dataTemp[dataPtr];
dataPtr++;
}
}
++_iteration;
free(dataTemp);
}
/// Updates and checks the size of the time stream data.
void SigprocAdapter::_checkData()
{
// Check for supported sample bits.
if (_nBits != 4 && _nBits != 8 && _nBits != 16 && _nBits != 32) {
throw QString("SigprocAdapter: Specified number of "
"sample bits (%1) not supported.").arg(_nBits);
}
// Check the data blob passed to the adapter is allocated.
if (!_data) {
throw QString("SigprocAdapter: Cannot deserialise into an "
"unallocated blob!.");
}
// Resize the time stream data blob being read into to match the adapter
// dimensions.
_stokesData = static_cast<SpectrumDataSetStokes*>(_data);
_stokesData->resize(_nSamples, _nChannels, 1, 1); // 1 Channel per subband in this case (and only total power)
}
} // namespace ampp
} // namespace pelican
|
b4ba34f1127f2409445209d3ac4d063bd2a48970
|
daf4d928af2ee0fa207739a76fdd7578360ff73f
|
/OGS5/Qt/VtkVis/VtkCompositeColormapToImageFilter.cpp
|
a9fa07b747d4bcbf3a931ff519a94f40d6156b13
|
[] |
no_license
|
UFZ-MJ/OGS_mHM
|
e735b411ccfdb5ff13b2f2c0e7e515191f722aed
|
91b972560b8566738dbacc61c2f05e9fc6e7932e
|
refs/heads/master
| 2021-01-19T17:31:13.764641
| 2018-02-08T10:27:59
| 2018-02-08T10:27:59
| 101,064,731
| 4
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,542
|
cpp
|
VtkCompositeColormapToImageFilter.cpp
|
/**
* \file VtkCompositeColormapToImageFilter.cpp
* 21/10/2010 LB Initial implementation
*
* Implementation of VtkCompositeColormapToImageFilter class
*/
// ** INCLUDES **
#include "VtkCompositeColormapToImageFilter.h"
#include <vtkLookupTable.h>
#include <vtkImageMapToColors.h>
#include <vtkSmartPointer.h>
VtkCompositeColormapToImageFilter::VtkCompositeColormapToImageFilter( vtkAlgorithm* inputAlgorithm )
: VtkCompositeFilter(inputAlgorithm)
{
this->init();
}
VtkCompositeColormapToImageFilter::~VtkCompositeColormapToImageFilter()
{
}
void VtkCompositeColormapToImageFilter::init()
{
this->_inputDataObjectType = VTK_IMAGE_DATA;
this->_outputDataObjectType = VTK_IMAGE_DATA;
vtkSmartPointer<vtkLookupTable> colormap = vtkSmartPointer<vtkLookupTable>::New();
colormap->SetTableRange(0, 100);
colormap->SetHueRange(0.0, 0.666);
colormap->SetNumberOfTableValues(256);
QList<QVariant> tableRangeList;
tableRangeList.push_back(0);
tableRangeList.push_back(100);
QList<QVariant> hueRangeList;
hueRangeList.push_back(0.0);
hueRangeList.push_back(0.666);
(*_algorithmUserVectorProperties)["TableRange"] = tableRangeList;
(*_algorithmUserVectorProperties)["HueRange"] = hueRangeList;
vtkImageMapToColors* map = vtkImageMapToColors::New();
map->SetInputConnection(0, _inputAlgorithm->GetOutputPort());
map->SetLookupTable(colormap);
map->SetPassAlphaToOutput(1);
(*_algorithmUserProperties)["PassAlphaToOutput"] = true;
(*_algorithmUserProperties)["NumberOfColors"] = 256;
_outputAlgorithm = map;
}
void VtkCompositeColormapToImageFilter::SetUserProperty( QString name, QVariant value )
{
VtkAlgorithmProperties::SetUserProperty(name, value);
vtkImageMapToColors* map = static_cast<vtkImageMapToColors*>(_outputAlgorithm);
if (name.compare("PassAlphaToOutput") == 0)
map->SetPassAlphaToOutput(value.toBool());
else if (name.compare("NumberOfColors") == 0)
static_cast<vtkLookupTable*>(map->GetLookupTable())->SetNumberOfTableValues(value.toInt());
}
void VtkCompositeColormapToImageFilter::SetUserVectorProperty( QString name, QList<QVariant> values )
{
VtkAlgorithmProperties::SetUserVectorProperty(name, values);
vtkImageMapToColors* map = static_cast<vtkImageMapToColors*>(_outputAlgorithm);
if (name.compare("TableRange") == 0)
static_cast<vtkLookupTable*>(map->GetLookupTable())->SetTableRange(values[0].toInt(), values[1].toInt());
else if (name.compare("HueRange") == 0)
static_cast<vtkLookupTable*>(map->GetLookupTable())->SetHueRange(values[0].toDouble(), values[1].toDouble());
}
|
5f63dae569e9a06c26889c96468fcff5ab67b7d9
|
823b998aaf300b8a110273dc7d40142813d392e0
|
/loops/main.cpp
|
754eed5c94b76afd85f5b299fe2aa640c8c71d8b
|
[] |
no_license
|
QQBoxy/2015vc
|
8ed30e2907810d1bac82ccde5a11df1c25a24f3e
|
ff948099174555e5f033ed4a5a56f6ebd08b2bf0
|
refs/heads/master
| 2021-01-10T16:07:27.299753
| 2015-12-08T06:51:39
| 2015-12-08T06:51:39
| 36,721,697
| 0
| 0
| null | null | null | null |
BIG5
|
C++
| false
| false
| 831
|
cpp
|
main.cpp
|
//Chapter 3 - advanced loop
#include <iostream>
using namespace std;
int main(void)
{
int i = 0;
int n[10] = {10,20,30,40,50,60,70,80,90,100};
//驗票才給上車
cout << "while:" << endl;
i = 0;
while(i<10) { //改成i<0會發生什麼事?
cout << i << endl;
i++;
}
//先上車後補票
cout << "\ndo while:" << endl;
i = 0;
do {
cout << i << endl;
i++;
} while(i<10); //改成i<0會發生什麼事?
cout << "\n[com] for:" << endl;
//給電腦看的時候常這樣用
for(i=0;i<10;i++) {
cout << i+1 << ". " << n[i] << endl;
}
cout << "\n[human] for:" << endl;
//給人看的時候常這樣用
for(i=1;i<=10;i++) {
cout << i << ". " << n[i-1] << endl;
}
system("pause");
return 0;
}
|
8752b0ea90660409fb69f7ad6e713843d30a2e97
|
64cdf450d20178a455347696ac477bc5c1ee5b22
|
/headers/framecontroller.h
|
023a9b64d24bb7a4ef4061d948b69b423fe915c6
|
[] |
no_license
|
syncopika/cute_animator
|
48937865a2bb38fced86001ecb76077e8e0307c0
|
b23edfa9a94e4607280635f82c04c661cddb48be
|
refs/heads/master
| 2020-04-30T12:02:11.302232
| 2019-09-18T23:56:34
| 2019-09-18T23:56:34
| 176,816,738
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,331
|
h
|
framecontroller.h
|
#ifndef FRAMECONTROLLER_H
#define FRAMECONTROLLER_H
#include <QWidget>
#include <QLabel>
#include <QTabletEvent>
#include <QPushButton>
class FrameController : public QWidget
{
Q_OBJECT
public:
FrameController(QWidget *parent = nullptr);
int getNumFrames();
int getCurrFrame();
void setNumFrames(int num);
void setCurrFrame(int curr);
// https://stackoverflow.com/questions/9261175/how-to-emit-a-signal-from-a-qpushbutton-when-the-mouse-hovers-over-it
bool eventFilter(QObject* obj, QEvent* event) override;
private:
bool tabletActive;
int numFrames;
int currFrame;
QLabel* currFrameLabel;
QLabel* totalFramesLabel;
QPushButton* nextBtn;
QPushButton* prevBtn;
QPushButton* addBtn;
QPushButton* removeBtn;
QPushButton* clearBtn;
protected:
void tabletEvent(QTabletEvent *event) override;
public slots:
void setTabletActive(bool active);
signals:
void addFrame();
void removeFrame();
void nextFrame();
void prevFrame();
void clearFrame(); //sent when only one frame and remove requested or when clear button is pressed
public slots:
void prevButtonClicked();
void nextButtonClicked();
void addButtonClicked();
void removeButtonClicked();
void clearButtonClicked();
};
#endif // FRAMECONTROLLER_H
|
e3c785588f7dbd818ce0a68031241d256847123e
|
937c0e74f3d4ea9c6ef480f7d4e39cd167b4add3
|
/swapp/swapp.cpp
|
7bcf8a32d607064d067127a2e48ca8eb070d4621
|
[] |
no_license
|
jpolitron/kattis-problems
|
c109ced1e061ea7c29589cae3cc1730be5ed34b9
|
abe39e50d9ad097ecdfbcf1c15f862ee37af4a57
|
refs/heads/master
| 2023-08-01T13:39:00.412869
| 2021-09-07T22:18:57
| 2021-09-07T22:18:57
| 278,780,466
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 277
|
cpp
|
swapp.cpp
|
#include <iostream>
using namespace std;
int i = 20;
int j = 7;
void trade(int& i, int& j){
cout << "i is: " << i << endl;
cout << "j is: " << j << endl;
swap(i,j);
}
int main(){
trade(i,j);
cout << "i is now: " << i << endl;
cout << "j is now: " << j << endl;
return 0;
}
|
d7875e52a8295fb6a3d01bb622e0cfe2f973d1f7
|
acc55ea7338403b57f3e980f9f5938cd866f7e0c
|
/modulo7/eclipse/Banco/main.cpp
|
e9bc963960fb17f91033634bbbbc9b5ba5083556
|
[] |
no_license
|
Antecarlo/CursoC
|
4c523ab5b9c359c41013b0e9fa92f80b5d6177c6
|
60efb931d964d82a9763bcaf6ec2d527095428de
|
refs/heads/master
| 2020-08-28T15:18:55.735624
| 2019-10-26T16:24:21
| 2019-10-26T16:24:21
| 217,732,005
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 198
|
cpp
|
main.cpp
|
/*
* main.cpp
*
* Created on: 11 oct. 2019
* Author: antonio
*/
#include "Cajero.h"
int main(){
Banco banco("BANCO X");
Cajero cajero;
cajero.identificacion(banco,1221, 4584);
}
|
500aa74c620aba8d864c710523d92fd358e046e7
|
ddc44be1c39a063bb5271e38689f22bb6897212a
|
/gukovaim.cpp
|
8ea543f368eda06d26ec22f0428d0dcb49d3ace5
|
[] |
no_license
|
mrsu-ru/2021-203
|
dd9bbcc071befe41a720e1a1d2ba08bbf3564efb
|
60537b9328c419954e6c2dba67a329b2cfd75a41
|
refs/heads/master
| 2023-05-26T12:14:20.764842
| 2021-06-10T15:46:57
| 2021-06-10T15:46:57
| 333,670,249
| 0
| 36
| null | 2021-06-10T15:46:58
| 2021-01-28T06:43:32
|
C++
|
UTF-8
|
C++
| false
| false
| 8,942
|
cpp
|
gukovaim.cpp
|
#include "guskovaim.h"
/**
* Введение в дисциплину
*/
void guskovaim::lab1()
{
cout << "Hello world!!!";
}
/**
* Метод Гаусса с выбором главного элемента
*/
void guskovaim::lab2()
{
for (int i = 0; i < N; i++) {
int max = 0;
for (int j = 0; j < N; j++){
if (abs(A[max][i])<abs(A[j][i])) max = j;
}
swap(A[i], A[max]);
swap(b[i], b[max]);
for (int j = i + 1; j < N; j++) {
double c = A[j][i] / A[i][i];
for (int k = i + 1; k < N; k++){
A[j][k] -= c * A[i][k];
}
b[j] -= c * b[i];
A[j][i] = 0;
}
}
for(int i = 0; i < N; i++){
double d = A[i][i];
for(int j = 0; j < N; j++){
A[i][j]/= d;
}
b[i]/=d;
}
for (int i = N - 1; i >= 0; i--) {
x[i] = b[i];
for (int j = i + 1; j < N; j++) x[i] -= A[i][j] * x[j];
}
}
/**
* Метод прогонки
*/
void guskovaim::lab3()
{
double *alpha = new double[N];
double *beta = new double[N];
double y = A[0][0];
alpha[0] = -A[0][1] / y;
beta[0] = b[0] / y;
for (int i = 1; i < N - 1; i++) {
y = A[i][i] + A[i][i - 1] * alpha[i - 1];
alpha[i] = -A[i][i + 1] / y;
beta[i] = (b[i] - A[i][i - 1] * beta[i - 1]) / y;
}
y = A[N - 1][N - 1] + A[N - 1][N - 2] * alpha[N - 2];
beta[N - 1] = (b[N - 1] - A[N - 1][N - 2] * beta[N - 2]) / y;
x[N - 1] = beta[N - 1];
for (int i = N - 2; i >= 0; i--) {
x[i] = alpha[i] * x[i + 1] + beta[i];
}
}
/**
* Метод Холецкого
*/
void guskovaim::lab4()
{
int i, j, k;
double **S = new double *[N];
double *D = new double[N];
for (i = 0; i < N; i++) {
S[i] = new double[N];
}
for (i = 0; i < N; i++) {
for (k = 0; k < i; k++) {
A[i][i] = A[i][i] - S[k][i] * D[k] * S[k][i];
}
if (A[i][i] >= 0) {
D[i] = 1;
} else D[i] = -1;
S[i][i] = sqrt(D[i] * A[i][i]);
for (j = i + 1; j < N; j++) {
for (k = 0; k < j; k++) {
A[i][j] = A[i][j] - S[k][i] * D[k] * S[k][j];
}
S[i][j] = A[i][j] / (S[i][i] * D[i]);
}
}
for (i = 0; i < N; i++) {
for (j = 0; j < i; j++) {
b[i] = b[i] - S[j][i] * D[j] * b[j];
}
b[i] = b[i] / (S[i][i] * D[i]);
}
for (i = N - 1; i > -1; i--) {
for (int j = i + 1; j < N; j++) {
b[i] = b[i] - S[i][j] * x[j];
}
x[i] = b[i] / S[i][i];
}
for (i = 0; i < N; i++) {
delete[] S[i];
}
delete[] S;
delete[] D;
}
/**
* Метод Якоби или Зейделя
*/
void guskovaim::lab5() //метод Зейделя
{
int i, j;
for (i = 0; i < N; i++) {
x[i] = 1;
}
double *x2 = new double[N];
bool flag = true;
while (flag) {
flag = false;
for (i = 0; i < N; i++) {
x2[i] = b[i];
for (j = 0; j < N; j++) {
if (i == j) continue;
x2[i] = x2[i] + x[j] * (-A[i][j]);
}
x2[i] = x2[i] / A[i][i];
if (fabs(x2[i] - x[i]) > 1e-9) {
flag = true;
}
x[i] = x2[i];
}
}
delete[] x2;
}
/**
* Метод минимальных невязок
*/
void guskovaim::lab6()
{
double *r = new double[N];
double *Ar = new double[N];
bool flag = false;
for (int i = 0; i < N; i++) {
x[i] = 0;
}
while(!flag){
flag = true;
for(int i = 0; i < N; i++){
r[i] = b[i];
for(int j = 0; j < N; j++){
r[i] -= A[i][j] * x[j];
}
}
for(int i = 0; i < N; i++){
Ar[i] = 0;
for(int j = 0; j < N; j++){
Ar[i] += A[i][j] * r[j];
}
}
double rr = 0;
for(int i = 0; i < N; i++){
rr += r[i] * r[i];
}
double Arr = 0;
for(int i = 0; i < N; i++){
Arr += Ar[i] * r[i];
}
double tau = rr / Arr;
for(int i = 0; i < N; i++) {
double tmpx = x[i];
x[i] += tau * r[i];
if(abs(tmpx - x[i]) > 1e-9){
flag = false;
}
}
}
}
/**
* Метод сопряженных градиентов
*/
void guskovaim::lab7()
{
double *re = new double[N];
double *Ark = new double[N];
double *xk = new double[N];
double x_prev = 0, t = 0, tk = 0, alpha = 1, Sr = 0, SArk = 0, SArk_prev = 0;
bool flag = false;
bool first = true;
for (int i = 0; i < N; i++) {
x[i] = 0;
re[i] = 0;
Ark[i] = 0;
xk[i] = 0;
}
while (!flag) {
flag = true;
for (int i = 0; i < N; i++) {
re[i] = b[i];
for (int j = 0; j < N; j++) {
re[i] -= A[i][j] * x[j];
}
}
for (int i = 0; i < N; i++) {
Ark[i] = 0;
for (int j = 0; j < N; j++) Ark[i] += A[i][j] * re[j];
}
if (first) {
first = false;
flag = false;
for (int i = 0; i < N; i++) {
Sr += re[i] * re[i];
SArk += Ark[i] * re[i];
}
t = Sr / SArk;
for (int i = 0; i < N; i++) {
x[i] = t * b[i];
}
}
tk = t, SArk_prev = SArk;
Sr = 0;
SArk = 0;
for (int i = 0; i < N; i++) {
Sr += re[i] * re[i];
SArk += Ark[i] * re[i];
}
t = Sr / SArk;
alpha = 1.0 / (1 - (t * Sr) / (alpha * tk * SArk_prev));
for (int i = 0; i < N; i++) {
x_prev = x[i];
x[i] = t * alpha * re[i] + alpha * x[i] + (1 - alpha) * xk[i];
xk[i] = x_prev;
if (fabs(x[i] - x_prev) > 1E-9) flag = false;
}
}
delete[] re;
delete[] Ark;
delete[] xk;
}
/**
* Метод вращения для нахождения собственных значений матрицы
*/
void guskovaim::lab8()
{
double t = 2;
int maxi, maxj;
double **B = new double *[N];
for (int i = 0; i < N; i++) B[i] = new double[N];
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++)
if(A[i][j] != A[j][i]) return;
}
while (t > 1) {
maxi = 0, maxj = 1;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (i == j) continue;
if (fabs(A[i][j]) > fabs(A[maxi][maxj])) {
maxi = i;
maxj = j;
}
}
}
double phi = atan(2 * A[maxi][maxj] / (-A[maxi][maxi] + A[maxj][maxj])) / 2;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) B[i][j] = A[i][j];
}
for (int r = 0; r < N; r++) {
B[r][maxi] = A[r][maxi] * cos(phi) - A[r][maxj] * sin(phi);
B[r][maxj] = A[r][maxi] * sin(phi) + A[r][maxj] * cos(phi);
}
for (int c = 0; c < N; c++) {
A[maxi][c] = B[maxi][c] * cos(phi) - B[maxj][c] * sin(phi);
A[maxj][c] = B[maxi][c] * sin(phi) + B[maxj][c] * cos(phi);
}
A[maxi][maxj] = 0;
t = 0;
for (int i = 0; i < N; i++) {
for (int j = i + 1; j < N; j++)
t += A[i][j] * A[i][j] + A[j][i] * A[j][i];
}
}
for (int i = 0; i < N; i++) x[i] = A[i][i];
for (int i = 0; i < N; i++) delete[] B[i];
delete[] B;
}
/**
* Нахождение наибольшего по модулю собственного значения матрицы
*/
void guskovaim::lab9()
{
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++)
if (A[i][j] != A[j][i])
return;
}
double l, maxl = 0;
bool flag = true;
double *y = new double[N];
double *y_prev = new double[N];
for (int i = 0; i < N; i++)
y_prev[i] = 1;
while (flag) {
flag = false;
for (int i = 0; i < N; i++) {
y[i] = 0;
for (int j = 0; j < N; j++) {
y[i] += A[i][j] * y_prev[j];
}
}
l = 0;
for (int i = 0; i < N; i++) {
if (fabs(y[i]) > 1E-3 && fabs(y_prev[i]) > 1E-3) {
l = y[i] / y_prev[i];
break;
}
}
if (fabs(l - maxl) > 1E-3)
flag = true;
maxl = l;
for (int i = 0; i < N; i++)
y_prev[i] = y[i];
}
cout << "lambda: " << maxl << endl;
delete[] y;
delete[] y_prev;
}
std::string guskovaim::get_name()
{
return "Guskova I.M.";
}
|
a4d4420c2797745d28ac0d3ea079511861eac332
|
eb4098b0a240130ce7d2d039bc13d91d4da0fe31
|
/Modules/motion_planning/min_snap_trajectory/uav_simulator/Utils/quadrotor_msgs/src/encode_msgs.cpp
|
d0cccf2a06fdaa97d7c323faebaa244280d33471
|
[
"Apache-2.0"
] |
permissive
|
amov-lab/Prometheus
|
f1d97ebebb58c14527bfe148275037b8dbd71154
|
017c50ee6a0a388caca193fd5a06ba237150bd05
|
refs/heads/main
| 2023-09-01T12:59:19.777116
| 2023-07-07T07:28:57
| 2023-07-07T07:28:57
| 225,547,305
| 2,129
| 396
|
Apache-2.0
| 2022-08-04T03:04:23
| 2019-12-03T06:28:07
|
C++
|
UTF-8
|
C++
| false
| false
| 2,542
|
cpp
|
encode_msgs.cpp
|
#include "quadrotor_msgs/encode_msgs.h"
#include <quadrotor_msgs/comm_types.h>
namespace quadrotor_msgs
{
void encodeSO3Command(const quadrotor_msgs::SO3Command &so3_command,
std::vector<uint8_t> &output)
{
struct SO3_CMD_INPUT so3_cmd_input;
so3_cmd_input.force[0] = so3_command.force.x*500;
so3_cmd_input.force[1] = so3_command.force.y*500;
so3_cmd_input.force[2] = so3_command.force.z*500;
so3_cmd_input.des_qx = so3_command.orientation.x*125;
so3_cmd_input.des_qy = so3_command.orientation.y*125;
so3_cmd_input.des_qz = so3_command.orientation.z*125;
so3_cmd_input.des_qw = so3_command.orientation.w*125;
so3_cmd_input.kR[0] = so3_command.kR[0]*50;
so3_cmd_input.kR[1] = so3_command.kR[1]*50;
so3_cmd_input.kR[2] = so3_command.kR[2]*50;
so3_cmd_input.kOm[0] = so3_command.kOm[0]*100;
so3_cmd_input.kOm[1] = so3_command.kOm[1]*100;
so3_cmd_input.kOm[2] = so3_command.kOm[2]*100;
so3_cmd_input.cur_yaw = so3_command.aux.current_yaw*1e4;
so3_cmd_input.kf_correction = so3_command.aux.kf_correction*1e11;
so3_cmd_input.angle_corrections[0] = so3_command.aux.angle_corrections[0]*2500;
so3_cmd_input.angle_corrections[1] = so3_command.aux.angle_corrections[1]*2500;
so3_cmd_input.enable_motors = so3_command.aux.enable_motors;
so3_cmd_input.use_external_yaw = so3_command.aux.use_external_yaw;
so3_cmd_input.seq = so3_command.header.seq % 255;
output.resize(sizeof(so3_cmd_input));
memcpy(&output[0], &so3_cmd_input, sizeof(so3_cmd_input));
}
void encodeTRPYCommand(const quadrotor_msgs::TRPYCommand &trpy_command,
std::vector<uint8_t> &output)
{
struct TRPY_CMD trpy_cmd_input;
trpy_cmd_input.thrust = trpy_command.thrust*1e4;
trpy_cmd_input.roll = trpy_command.roll*1e4;
trpy_cmd_input.pitch = trpy_command.pitch*1e4;
trpy_cmd_input.yaw = trpy_command.yaw*1e4;
trpy_cmd_input.current_yaw = trpy_command.aux.current_yaw*1e4;
trpy_cmd_input.enable_motors = trpy_command.aux.enable_motors;
trpy_cmd_input.use_external_yaw = trpy_command.aux.use_external_yaw;
output.resize(sizeof(trpy_cmd_input));
memcpy(&output[0], &trpy_cmd_input, sizeof(trpy_cmd_input));
}
void encodePPRGains(const quadrotor_msgs::Gains &gains,
std::vector<uint8_t> &output)
{
struct PPR_GAINS ppr_gains;
ppr_gains.Kp = gains.Kp;
ppr_gains.Kd = gains.Kd;
ppr_gains.Kp_yaw = gains.Kp_yaw;
ppr_gains.Kd_yaw = gains.Kd_yaw;
output.resize(sizeof(ppr_gains));
memcpy(&output[0], &ppr_gains, sizeof(ppr_gains));
}
}
|
548e4b031bbf8c608a8ac50e787e2a74c3fbd85b
|
801e9a21fbe0f68c18857334f9b86694938f5055
|
/Desktop-Windows/ui_GUIDesktop.h
|
f994bc1d09e6f77cc656fef43baebb6e97dfb067
|
[] |
no_license
|
vialrogo/pbx-viewer
|
d324cbec618fdbaee78f79a8466ebf64c54ffa34
|
b814668c46a2d0f85bffcfed0d06dd8e96a082b8
|
refs/heads/master
| 2016-09-05T11:57:26.787183
| 2010-09-16T16:34:49
| 2010-09-16T16:34:49
| 32,185,339
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 14,582
|
h
|
ui_GUIDesktop.h
|
/********************************************************************************
** Form generated from reading UI file 'GUIDesktop.ui'
**
** Created: Fri 27. Aug 00:00:28 2010
** by: Qt User Interface Compiler version 4.6.3
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_GUIDESKTOP_H
#define UI_GUIDESKTOP_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QComboBox>
#include <QtGui/QFrame>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QPlainTextEdit>
#include <QtGui/QPushButton>
#include <QtGui/QScrollArea>
#include <QtGui/QStatusBar>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_GUIDesktop
{
public:
QAction *menuSalir;
QAction *menuNuevoPerfil;
QAction *menuModificarPerfil;
QAction *menuEliminarPerfil;
QAction *menuAcercade;
QAction *menuAcercadeQt;
QAction *actionEspanol;
QAction *actionIngles;
QAction *actionPortugues;
QAction *actionAyuda;
QAction *menuIniciar;
QAction *menuParar;
QWidget *centralwidget;
QLabel *label_Socket;
QLabel *label_PBX;
QFrame *linea_arriba;
QLabel *label_puerto;
QLineEdit *lineEdit_puerto;
QLabel *label_tipoPBX;
QComboBox *comboB_pbxs;
QPushButton *boton_iniciar;
QPushButton *boton_parar;
QPushButton *boton_salir;
QFrame *linea_abajo;
QPushButton *boton_nuevo;
QPushButton *boton_editar;
QPushButton *boton_eliminar;
QScrollArea *scrollArea;
QWidget *scrollAreaWidgetContents;
QPlainTextEdit *texarea;
QMenuBar *menubar;
QMenu *menuArchivo;
QMenu *menuEdici_n;
QMenu *menuIdioma_2;
QMenu *menuPBX;
QMenu *menuAyuda;
QStatusBar *statusbar;
void setupUi(QMainWindow *GUIDesktop)
{
if (GUIDesktop->objectName().isEmpty())
GUIDesktop->setObjectName(QString::fromUtf8("GUIDesktop"));
GUIDesktop->resize(370, 550);
GUIDesktop->setMinimumSize(QSize(370, 550));
GUIDesktop->setMaximumSize(QSize(370, 550));
QFont font;
font.setPointSize(11);
GUIDesktop->setFont(font);
GUIDesktop->setAcceptDrops(false);
GUIDesktop->setWindowTitle(QString::fromUtf8("PBX-Viewer: Desktop"));
menuSalir = new QAction(GUIDesktop);
menuSalir->setObjectName(QString::fromUtf8("menuSalir"));
menuNuevoPerfil = new QAction(GUIDesktop);
menuNuevoPerfil->setObjectName(QString::fromUtf8("menuNuevoPerfil"));
menuModificarPerfil = new QAction(GUIDesktop);
menuModificarPerfil->setObjectName(QString::fromUtf8("menuModificarPerfil"));
menuModificarPerfil->setEnabled(false);
menuEliminarPerfil = new QAction(GUIDesktop);
menuEliminarPerfil->setObjectName(QString::fromUtf8("menuEliminarPerfil"));
menuEliminarPerfil->setCheckable(false);
menuEliminarPerfil->setEnabled(false);
QFont font1;
menuEliminarPerfil->setFont(font1);
menuAcercade = new QAction(GUIDesktop);
menuAcercade->setObjectName(QString::fromUtf8("menuAcercade"));
menuAcercadeQt = new QAction(GUIDesktop);
menuAcercadeQt->setObjectName(QString::fromUtf8("menuAcercadeQt"));
actionEspanol = new QAction(GUIDesktop);
actionEspanol->setObjectName(QString::fromUtf8("actionEspanol"));
actionEspanol->setCheckable(true);
actionEspanol->setChecked(true);
actionIngles = new QAction(GUIDesktop);
actionIngles->setObjectName(QString::fromUtf8("actionIngles"));
actionIngles->setCheckable(true);
actionPortugues = new QAction(GUIDesktop);
actionPortugues->setObjectName(QString::fromUtf8("actionPortugues"));
actionPortugues->setCheckable(true);
actionAyuda = new QAction(GUIDesktop);
actionAyuda->setObjectName(QString::fromUtf8("actionAyuda"));
menuIniciar = new QAction(GUIDesktop);
menuIniciar->setObjectName(QString::fromUtf8("menuIniciar"));
menuParar = new QAction(GUIDesktop);
menuParar->setObjectName(QString::fromUtf8("menuParar"));
menuParar->setEnabled(false);
centralwidget = new QWidget(GUIDesktop);
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
label_Socket = new QLabel(centralwidget);
label_Socket->setObjectName(QString::fromUtf8("label_Socket"));
label_Socket->setGeometry(QRect(120, 20, 121, 21));
QFont font2;
font2.setPointSize(15);
label_Socket->setFont(font2);
label_Socket->setAlignment(Qt::AlignCenter);
label_PBX = new QLabel(centralwidget);
label_PBX->setObjectName(QString::fromUtf8("label_PBX"));
label_PBX->setGeometry(QRect(140, 120, 81, 31));
label_PBX->setFont(font2);
label_PBX->setAlignment(Qt::AlignCenter);
linea_arriba = new QFrame(centralwidget);
linea_arriba->setObjectName(QString::fromUtf8("linea_arriba"));
linea_arriba->setGeometry(QRect(10, 100, 351, 20));
linea_arriba->setFrameShape(QFrame::HLine);
linea_arriba->setFrameShadow(QFrame::Sunken);
label_puerto = new QLabel(centralwidget);
label_puerto->setObjectName(QString::fromUtf8("label_puerto"));
label_puerto->setGeometry(QRect(90, 58, 91, 31));
label_puerto->setAlignment(Qt::AlignCenter);
lineEdit_puerto = new QLineEdit(centralwidget);
lineEdit_puerto->setObjectName(QString::fromUtf8("lineEdit_puerto"));
lineEdit_puerto->setGeometry(QRect(190, 60, 113, 29));
label_tipoPBX = new QLabel(centralwidget);
label_tipoPBX->setObjectName(QString::fromUtf8("label_tipoPBX"));
label_tipoPBX->setGeometry(QRect(40, 160, 121, 31));
label_tipoPBX->setAlignment(Qt::AlignCenter);
comboB_pbxs = new QComboBox(centralwidget);
comboB_pbxs->setObjectName(QString::fromUtf8("comboB_pbxs"));
comboB_pbxs->setGeometry(QRect(170, 160, 161, 29));
boton_iniciar = new QPushButton(centralwidget);
boton_iniciar->setObjectName(QString::fromUtf8("boton_iniciar"));
boton_iniciar->setGeometry(QRect(13, 450, 113, 31));
QFont font3;
font3.setPointSize(13);
boton_iniciar->setFont(font3);
boton_parar = new QPushButton(centralwidget);
boton_parar->setObjectName(QString::fromUtf8("boton_parar"));
boton_parar->setEnabled(false);
boton_parar->setGeometry(QRect(133, 450, 113, 31));
boton_parar->setFont(font3);
boton_salir = new QPushButton(centralwidget);
boton_salir->setObjectName(QString::fromUtf8("boton_salir"));
boton_salir->setGeometry(QRect(253, 450, 113, 31));
boton_salir->setFont(font3);
linea_abajo = new QFrame(centralwidget);
linea_abajo->setObjectName(QString::fromUtf8("linea_abajo"));
linea_abajo->setGeometry(QRect(20, 430, 341, 20));
linea_abajo->setFrameShape(QFrame::HLine);
linea_abajo->setFrameShadow(QFrame::Sunken);
boton_nuevo = new QPushButton(centralwidget);
boton_nuevo->setObjectName(QString::fromUtf8("boton_nuevo"));
boton_nuevo->setGeometry(QRect(80, 210, 61, 29));
QFont font4;
font4.setPointSize(10);
boton_nuevo->setFont(font4);
boton_editar = new QPushButton(centralwidget);
boton_editar->setObjectName(QString::fromUtf8("boton_editar"));
boton_editar->setEnabled(false);
boton_editar->setGeometry(QRect(150, 210, 61, 29));
boton_editar->setFont(font4);
boton_eliminar = new QPushButton(centralwidget);
boton_eliminar->setObjectName(QString::fromUtf8("boton_eliminar"));
boton_eliminar->setEnabled(false);
boton_eliminar->setGeometry(QRect(220, 210, 81, 29));
boton_eliminar->setFont(font4);
scrollArea = new QScrollArea(centralwidget);
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
scrollArea->setGeometry(QRect(10, 250, 351, 171));
scrollArea->setWidgetResizable(true);
scrollAreaWidgetContents = new QWidget();
scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 349, 169));
texarea = new QPlainTextEdit(scrollAreaWidgetContents);
texarea->setObjectName(QString::fromUtf8("texarea"));
texarea->setEnabled(true);
texarea->setGeometry(QRect(0, 0, 351, 171));
QFont font5;
font5.setPointSize(9);
texarea->setFont(font5);
texarea->setReadOnly(true);
scrollArea->setWidget(scrollAreaWidgetContents);
GUIDesktop->setCentralWidget(centralwidget);
menubar = new QMenuBar(GUIDesktop);
menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 370, 27));
menuArchivo = new QMenu(menubar);
menuArchivo->setObjectName(QString::fromUtf8("menuArchivo"));
menuEdici_n = new QMenu(menubar);
menuEdici_n->setObjectName(QString::fromUtf8("menuEdici_n"));
menuIdioma_2 = new QMenu(menuEdici_n);
menuIdioma_2->setObjectName(QString::fromUtf8("menuIdioma_2"));
menuPBX = new QMenu(menubar);
menuPBX->setObjectName(QString::fromUtf8("menuPBX"));
menuAyuda = new QMenu(menubar);
menuAyuda->setObjectName(QString::fromUtf8("menuAyuda"));
GUIDesktop->setMenuBar(menubar);
statusbar = new QStatusBar(GUIDesktop);
statusbar->setObjectName(QString::fromUtf8("statusbar"));
GUIDesktop->setStatusBar(statusbar);
menubar->addAction(menuArchivo->menuAction());
menubar->addAction(menuEdici_n->menuAction());
menubar->addAction(menuPBX->menuAction());
menubar->addAction(menuAyuda->menuAction());
menuArchivo->addAction(menuIniciar);
menuArchivo->addAction(menuParar);
menuArchivo->addAction(menuSalir);
menuEdici_n->addAction(menuIdioma_2->menuAction());
menuIdioma_2->addAction(actionEspanol);
menuIdioma_2->addAction(actionIngles);
menuIdioma_2->addAction(actionPortugues);
menuPBX->addAction(menuNuevoPerfil);
menuPBX->addAction(menuModificarPerfil);
menuPBX->addAction(menuEliminarPerfil);
menuAyuda->addAction(actionAyuda);
menuAyuda->addAction(menuAcercade);
menuAyuda->addAction(menuAcercadeQt);
retranslateUi(GUIDesktop);
QObject::connect(boton_salir, SIGNAL(clicked()), GUIDesktop, SLOT(close()));
QObject::connect(menuSalir, SIGNAL(activated()), GUIDesktop, SLOT(close()));
QMetaObject::connectSlotsByName(GUIDesktop);
} // setupUi
void retranslateUi(QMainWindow *GUIDesktop)
{
menuSalir->setText(QApplication::translate("GUIDesktop", "Salir", 0, QApplication::UnicodeUTF8));
menuNuevoPerfil->setText(QApplication::translate("GUIDesktop", "Nuevo Perfil", 0, QApplication::UnicodeUTF8));
menuModificarPerfil->setText(QApplication::translate("GUIDesktop", "Modificar Perfil", 0, QApplication::UnicodeUTF8));
menuEliminarPerfil->setText(QApplication::translate("GUIDesktop", "Eliminar Perfil", 0, QApplication::UnicodeUTF8));
menuAcercade->setText(QApplication::translate("GUIDesktop", "Acerca de", 0, QApplication::UnicodeUTF8));
menuAcercadeQt->setText(QApplication::translate("GUIDesktop", "Acerca de Qt", 0, QApplication::UnicodeUTF8));
actionEspanol->setText(QApplication::translate("GUIDesktop", "Espa\303\261ol", 0, QApplication::UnicodeUTF8));
actionIngles->setText(QApplication::translate("GUIDesktop", "Ingl\303\251s", 0, QApplication::UnicodeUTF8));
actionPortugues->setText(QApplication::translate("GUIDesktop", "Portugu\303\251s", 0, QApplication::UnicodeUTF8));
actionAyuda->setText(QApplication::translate("GUIDesktop", "Ayuda", 0, QApplication::UnicodeUTF8));
menuIniciar->setText(QApplication::translate("GUIDesktop", "Iniciar", 0, QApplication::UnicodeUTF8));
menuParar->setText(QApplication::translate("GUIDesktop", "Parar", 0, QApplication::UnicodeUTF8));
label_Socket->setText(QApplication::translate("GUIDesktop", "SOCKET", 0, QApplication::UnicodeUTF8));
label_PBX->setText(QApplication::translate("GUIDesktop", "PBX", 0, QApplication::UnicodeUTF8));
label_puerto->setText(QApplication::translate("GUIDesktop", "Puerto: ", 0, QApplication::UnicodeUTF8));
label_tipoPBX->setText(QApplication::translate("GUIDesktop", "Tipo PBX: ", 0, QApplication::UnicodeUTF8));
boton_iniciar->setText(QApplication::translate("GUIDesktop", "Iniciar", 0, QApplication::UnicodeUTF8));
boton_parar->setText(QApplication::translate("GUIDesktop", "Parar", 0, QApplication::UnicodeUTF8));
boton_salir->setText(QApplication::translate("GUIDesktop", "Salir", 0, QApplication::UnicodeUTF8));
boton_nuevo->setText(QApplication::translate("GUIDesktop", "Nuevo", 0, QApplication::UnicodeUTF8));
boton_editar->setText(QApplication::translate("GUIDesktop", "Editar", 0, QApplication::UnicodeUTF8));
boton_eliminar->setText(QApplication::translate("GUIDesktop", "Eliminar", 0, QApplication::UnicodeUTF8));
menuArchivo->setTitle(QApplication::translate("GUIDesktop", "Archivo", 0, QApplication::UnicodeUTF8));
menuEdici_n->setTitle(QApplication::translate("GUIDesktop", "Edici\303\263n", 0, QApplication::UnicodeUTF8));
menuIdioma_2->setTitle(QApplication::translate("GUIDesktop", "Idioma", 0, QApplication::UnicodeUTF8));
menuPBX->setTitle(QApplication::translate("GUIDesktop", "PBX", 0, QApplication::UnicodeUTF8));
menuAyuda->setTitle(QApplication::translate("GUIDesktop", "Ayuda", 0, QApplication::UnicodeUTF8));
Q_UNUSED(GUIDesktop);
} // retranslateUi
};
namespace Ui {
class GUIDesktop: public Ui_GUIDesktop {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_GUIDESKTOP_H
|
5c59ebd9b336a5de59c1566cc06185f896f3dd77
|
ff982cddb5fb766b7097ce57c2a12f7f4e85ba7d
|
/Array dan Struct/tempCodeRunnerFile.cpp
|
e7783499ad26633963d3ce667a8118eb9da9b549
|
[] |
no_license
|
novandikp/PemrogramanLanjutUPN
|
fd3656d8c243d9f7648d8835cf319e41e668127e
|
4cea888faca35e4fbce05f414bdfeee11fa3e985
|
refs/heads/master
| 2023-08-24T12:49:34.375817
| 2021-09-23T23:57:34
| 2021-09-23T23:57:34
| 404,186,125
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 323
|
cpp
|
tempCodeRunnerFile.cpp
|
case 1:
tampilDataBerdasarkanPencarian();
break;
case 2:
tambahData();
break;
case 3:
ubahData();
break;
case 4:
hapusData();
break;
default:
cout << "Menu tidak ditemukan";
system("pause");
menuUtama();
break;
|
2c0d488b92b8941de621d60ae1717c06637bd8c2
|
90e43be1f53f78285cb5e0d8c5e2cc2c3f0b441c
|
/C++ Program/PS56.CPP
|
ff51a35fc3d4e5cf71cc889de290078254e646cf
|
[] |
no_license
|
anuragmauryamca/C-programing-oop
|
8e117229ed683779104b0e49e5b40525a28a1b3a
|
74b3df9781841625f05201c96ef5c2599dfb19c2
|
refs/heads/master
| 2020-04-25T00:22:08.842467
| 2019-02-24T18:57:45
| 2019-02-24T18:57:45
| 172,376,277
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 671
|
cpp
|
PS56.CPP
|
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<stdio.h>
void main()
{
int i,gd=DETECT,gm;
int j,k;
char a[5];
initgraph(&gd,&gm,"c:\\tc\\bgi");
//settextjustify(CENTER_TEXT,CENTER_TEXT);
setcolor(RED) ;
outtextxy(40,150,"press any key to start the time");
getch();
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
for(k=1;k<=4;k++)
{
for(j=1;j<=4;j++)
{
for(i=1;i<=4;i++)
{
sprintf(a,"%d",i);
outtextxy(90,240,a);
delay(1000);
if(i==0)
break;
//cleardevice();
sprintf(a,"%d",j);
outtextxy(65,240,a);
delay(1000);
if(j==0)
break;
sprintf(a,"%d",k);
outtextxy(40,240,a);
delay(1000);
if(k==0)
break;
}
}
}
getch();
getch();
closegraph();
}
|
2371939bf4bdcde94437476aec1fc5e59b726710
|
3333edce8305b199431da4ed1e2bbe9bf5aef175
|
/BOJ/2000~/2607/src.cpp
|
c83925500547112347585068fd4d2a45b39c1210
|
[] |
no_license
|
suhyunch/shalstd
|
d208ba10ab16c3f904de9148e4fa11f243148c03
|
85ede530ebe01d1fffc3b5e2df5eee1fa88feaf0
|
refs/heads/master
| 2021-06-07T10:45:58.181997
| 2019-08-11T13:14:48
| 2019-08-11T13:14:48
| 110,432,069
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,957
|
cpp
|
src.cpp
|
//https://www.acmicpc.net/problem/2607
#include <iostream>
#include <cstring>
using namespace std;
int origin_letter[26];
int cmp_letter[26];
int N;
void init(){
for(int i=0; i<26; i++)
cmp_letter[i]=0;
}
bool chk_cmp(int origin_l, int cmp_l){
int chk1=0;
int chk2=0;
int cnt0=0;
int cnt1=0;
int cnt2=0;
if(origin_l==cmp_l){
for(int i=0; i<26; i++){
if(origin_letter[i]!=cmp_letter[i]){
if(cnt0==0) {
cnt0++;
chk1=origin_letter[i]>cmp_letter[i] ? origin_letter[i]-cmp_letter[i]: cmp_letter[i]-origin_letter[i] ;
}
if(cnt0==1){
cnt0++;
chk2=origin_letter[i]>cmp_letter[i] ? origin_letter[i]-cmp_letter[i]: cmp_letter[i]-origin_letter[i] ;
}
if(cnt0>1){
return false;
}
}
else cnt1++;
}
if((chk1==1 &&chk2==1) ||cnt1==26) return true;
else return false;
}
else{
cnt1=0;
for(int i=0; i<26; i++){
cmp_letter[i]-=origin_letter[i];
if(cmp_letter[i]>0) cnt1+=cmp_letter[i];
if(cmp_letter[i]<0) cnt2-=cmp_letter[i];
}
if((cnt1==1&&cnt2==0)||(cnt1==0&&cnt2==1)) return true;
else return false;
}
return true;
}
int main(){
cin >> N;
string origin;
cin >> origin;
int cnt=0;
for(int i=0; i<origin.size(); i++ ){
origin_letter[(int)origin[i]-'A']++;
}
for(int i=1; i<N; i++){
init();
string cmp;
cin >> cmp;
for(int j=0; j<cmp.size(); j++){
cmp_letter[(int)cmp[j]-'A']++;
}
if(chk_cmp(origin.size(),cmp.size())) {cnt++;}
}
cout << cnt;
}
|
1a833fcf122320426d0b570f23aeeb138d296aa8
|
4352b5c9e6719d762e6a80e7a7799630d819bca3
|
/tutorials/oldd/Basic-Dynamic-Mesh-Tutorial-OpenFoam/TUT16/1.78/phi
|
2cf608fd9ee860f5075b4b2d5db2d514ef6f156b
|
[] |
no_license
|
dashqua/epicProject
|
d6214b57c545110d08ad053e68bc095f1d4dc725
|
54afca50a61c20c541ef43e3d96408ef72f0bcbc
|
refs/heads/master
| 2022-02-28T17:20:20.291864
| 2019-10-28T13:33:16
| 2019-10-28T13:33:16
| 184,294,390
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 86,744
|
phi
|
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "1.78";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
8193
(
0.160681
-0.336402
-0.155835
0.160065
-0.346228
0.157149
-0.352796
0.153238
-0.357614
0.148659
-0.361494
0.143392
-0.36422
0.137402
-0.365691
0.130725
-0.366123
0.123506
-0.365824
0.115881
-0.365121
0.107828
-0.364146
0.0993006
-0.362735
0.0902495
-0.360772
0.0807533
-0.35856
0.0708148
-0.356995
0.0602626
-0.357468
0.0485575
-0.359717
0.0352063
-0.357411
0.0196906
-0.339712
0.00277239
-0.299477
-0.0163532
-0.282754
-0.0357592
-0.320679
-0.0515919
-0.358816
-0.0629095
-0.374613
-0.0722577
-0.376317
-0.0806931
-0.373515
-0.0889897
-0.371458
-0.0972564
-0.371089
-0.105415
-0.371896
-0.113243
-0.372868
-0.120759
-0.373501
-0.127914
-0.373851
-0.134645
-0.373864
-0.140822
-0.373352
-0.14637
-0.372058
-0.151311
-0.369745
-0.155708
-0.366361
-0.159539
-0.362092
-0.162386
-0.357077
-0.162865
-0.350315
-0.340031
-0.157903
0.177673
-0.335006
-0.179069
0.173739
-0.342295
0.169621
-0.348677
0.165056
-0.35305
0.159605
-0.356043
0.1532
-0.357816
0.145999
-0.358489
0.138209
-0.358334
0.130043
-0.357659
0.121592
-0.35667
0.112793
-0.355347
0.103581
-0.353524
0.0939561
-0.351147
0.083965
-0.348569
0.0735722
-0.346602
0.0626543
-0.34655
0.0504889
-0.347551
0.036931
-0.343853
0.0213919
-0.324173
0.00526922
-0.283355
-0.0136685
-0.263816
-0.0340701
-0.300277
-0.0515832
-0.341303
-0.064193
-0.362004
-0.0742846
-0.366226
-0.0831184
-0.364681
-0.0917906
-0.362786
-0.100535
-0.362345
-0.109319
-0.363112
-0.117948
-0.364239
-0.126327
-0.365122
-0.134485
-0.365693
-0.142373
-0.365976
-0.14983
-0.365896
-0.156662
-0.365226
-0.162714
-0.363693
-0.167908
-0.361167
-0.172341
-0.357659
-0.176393
-0.353024
-0.180198
-0.34651
-0.339022
-0.181207
0.185286
-0.333623
-0.18667
0.182162
-0.33917
0.17765
-0.344165
0.172069
-0.347469
0.165415
-0.349389
0.157901
-0.350302
0.149821
-0.35041
0.141406
-0.349918
0.132775
-0.349027
0.123933
-0.347828
0.114818
-0.346233
0.10539
-0.344096
0.0955701
-0.341327
0.0854694
-0.338469
0.0750512
-0.336184
0.0641226
-0.335621
0.0520025
-0.335431
0.0382276
-0.330078
0.0228156
-0.308761
0.00695548
-0.267494
-0.0118167
-0.245044
-0.0325221
-0.279572
-0.0508244
-0.323001
-0.0645814
-0.348247
-0.0749607
-0.355846
-0.0839905
-0.355652
-0.0926898
-0.354087
-0.101475
-0.35356
-0.110435
-0.354151
-0.119324
-0.35535
-0.128071
-0.356376
-0.136682
-0.357083
-0.145158
-0.3575
-0.153416
-0.357638
-0.161292
-0.357349
-0.168557
-0.356428
-0.174971
-0.354753
-0.18039
-0.35224
-0.184845
-0.348569
-0.187977
-0.343379
-0.337711
-0.189288
0.197692
-0.330036
-0.201279
0.19283
-0.334308
0.186687
-0.338023
0.179428
-0.340209
0.171373
-0.341334
0.162809
-0.341737
0.153962
-0.341563
0.144975
-0.340932
0.135901
-0.339953
0.126704
-0.338631
0.117327
-0.336856
0.107641
-0.33441
0.0976452
-0.331331
0.0874645
-0.328288
0.0770941
-0.325813
0.0662012
-0.324728
0.0541169
-0.323347
0.040139
-0.3161
0.0248034
-0.293426
0.00912582
-0.251817
-0.00955459
-0.226363
-0.0308054
-0.258321
-0.0500266
-0.30378
-0.06505
-0.333223
-0.0760396
-0.344857
-0.0852647
-0.346426
-0.0939471
-0.345404
-0.102738
-0.344769
-0.111803
-0.345085
-0.120934
-0.346219
-0.129981
-0.347329
-0.138993
-0.348071
-0.147984
-0.348509
-0.156933
-0.348689
-0.165724
-0.348558
-0.174176
-0.347976
-0.182081
-0.346848
-0.189214
-0.345107
-0.19532
-0.342463
-0.200233
-0.338466
-0.334071
-0.203872
0.208195
-0.325023
-0.213208
0.201498
-0.327611
0.193556
-0.33008
0.184885
-0.331538
0.175791
-0.33224
0.166488
-0.332435
0.157125
-0.332199
0.147775
-0.331582
0.138435
-0.330613
0.129054
-0.32925
0.119497
-0.327299
0.109689
-0.324602
0.0996699
-0.321312
0.0895546
-0.318173
0.0793837
-0.315642
0.0686249
-0.313969
0.0565723
-0.311294
0.0425589
-0.302087
0.0271883
-0.278055
0.0115319
-0.23616
-0.00708357
-0.207748
-0.028857
-0.236548
-0.049015
-0.283622
-0.0651784
-0.31706
-0.0770966
-0.332938
-0.0865467
-0.336976
-0.0951531
-0.336798
-0.103828
-0.336095
-0.112826
-0.336086
-0.122025
-0.33702
-0.131242
-0.338112
-0.140442
-0.338871
-0.149724
-0.339226
-0.159094
-0.339319
-0.168503
-0.339149
-0.17782
-0.338658
-0.186883
-0.337786
-0.19551
-0.33648
-0.203458
-0.334515
-0.210251
-0.331672
-0.328852
-0.21547
0.216861
-0.317229
-0.224655
0.208069
-0.318819
0.198663
-0.320675
0.188986
-0.321861
0.179229
-0.322483
0.169496
-0.322702
0.159854
-0.322557
0.150322
-0.32205
0.140866
-0.321156
0.131379
-0.319763
0.12174
-0.31766
0.111924
-0.314787
0.102013
-0.3114
0.0920676
-0.308227
0.0821758
-0.305751
0.0716046
-0.303398
0.0595836
-0.299273
0.0454939
-0.287997
0.0299539
-0.262515
0.0141687
-0.220375
-0.00439178
-0.189188
-0.0266903
-0.214249
-0.0478793
-0.262433
-0.0651887
-0.29975
-0.0781865
-0.319941
-0.0880798
-0.327083
-0.0966754
-0.328202
-0.105173
-0.327597
-0.113996
-0.327264
-0.123125
-0.327891
-0.132388
-0.328849
-0.141686
-0.329574
-0.151057
-0.329855
-0.160611
-0.329766
-0.170333
-0.329427
-0.180159
-0.328832
-0.18999
-0.327955
-0.199724
-0.326746
-0.209192
-0.325046
-0.21809
-0.322774
-0.32084
-0.226103
0.222405
-0.307631
-0.232004
0.212442
-0.308856
0.202229
-0.310462
0.19205
-0.311681
0.182003
-0.312436
0.17211
-0.312809
0.162385
-0.312832
0.152819
-0.312484
0.143351
-0.311688
0.133848
-0.31026
0.12423
-0.308043
0.114528
-0.305084
0.104864
-0.301736
0.0952383
-0.298602
0.0855701
-0.296082
0.0752496
-0.293078
0.0631919
-0.287215
0.0489329
-0.273738
0.0331035
-0.246686
0.017032
-0.204304
-0.00150415
-0.170651
-0.0242901
-0.191463
-0.0465494
-0.240173
-0.0651737
-0.281126
-0.079351
-0.305763
-0.089913
-0.316521
-0.0986071
-0.319508
-0.106958
-0.319246
-0.115514
-0.318708
-0.124453
-0.318952
-0.133649
-0.319653
-0.142946
-0.320276
-0.15233
-0.320471
-0.161877
-0.320218
-0.171672
-0.319633
-0.181681
-0.318824
-0.191865
-0.317771
-0.20219
-0.31642
-0.212553
-0.314684
-0.222647
-0.31268
-0.310997
-0.232489
0.2263
-0.296814
-0.237117
0.21569
-0.298246
0.205149
-0.29992
0.194797
-0.30133
0.184671
-0.30231
0.174771
-0.302909
0.165088
-0.303149
0.155594
-0.30299
0.146173
-0.302267
0.136728
-0.300815
0.127227
-0.298542
0.117756
-0.295613
0.108449
-0.292429
0.0992691
-0.289422
0.0898376
-0.286651
0.0796316
-0.282872
0.0674587
-0.275043
0.0528918
-0.259171
0.0366331
-0.230427
0.0201122
-0.187783
0.00153614
-0.152075
-0.0216747
-0.168252
-0.0449774
-0.216871
-0.0650338
-0.26107
-0.0805616
-0.290236
-0.0919954
-0.305087
-0.101072
-0.310432
-0.109343
-0.310975
-0.117601
-0.31045
-0.126268
-0.310284
-0.135307
-0.310614
-0.144539
-0.311045
-0.153883
-0.311127
-0.163369
-0.310732
-0.173093
-0.309908
-0.183103
-0.308813
-0.193383
-0.307491
-0.203907
-0.305896
-0.21461
-0.303981
-0.22543
-0.301861
-0.299939
-0.236487
0.229469
-0.285547
-0.240735
0.218652
-0.287429
0.208089
-0.289357
0.197738
-0.290979
0.187644
-0.292216
0.177828
-0.293093
0.168265
-0.293587
0.158878
-0.293603
0.149554
-0.292943
0.140237
-0.291498
0.130952
-0.289257
0.121834
-0.286495
0.112985
-0.28358
0.104286
-0.280722
0.0951787
-0.277544
0.0848122
-0.272505
0.0724296
-0.26266
0.0573628
-0.244104
0.0405155
-0.21358
0.0233851
-0.170652
0.00465301
-0.133343
-0.0188798
-0.14472
-0.0431502
-0.1926
-0.0646669
-0.239553
-0.081713
-0.27319
-0.0942986
-0.292502
-0.104059
-0.300671
-0.112366
-0.302668
-0.12038
-0.302436
-0.128732
-0.301933
-0.137539
-0.301806
-0.146651
-0.301934
-0.155939
-0.301838
-0.165361
-0.30131
-0.174995
-0.300274
-0.18492
-0.298889
-0.195171
-0.29724
-0.205718
-0.295349
-0.216505
-0.293194
-0.227563
-0.290803
-0.288441
-0.239061
0.233035
-0.274158
-0.244425
0.222135
-0.276529
0.211541
-0.278763
0.20122
-0.280658
0.191213
-0.282209
0.181529
-0.283409
0.172111
-0.284168
0.162851
-0.284343
0.153664
-0.283756
0.144551
-0.282386
0.135595
-0.2803
0.126958
-0.277858
0.118651
-0.275272
0.110399
-0.27247
0.101528
-0.268674
0.0910301
-0.262007
0.0780153
-0.249645
0.0623211
-0.22841
0.0446979
-0.195957
0.0268029
-0.152757
0.00777004
-0.11431
-0.0159638
-0.120986
-0.0410719
-0.167492
-0.0640422
-0.216583
-0.0826561
-0.254576
-0.0968422
-0.278315
-0.107437
-0.290076
-0.115992
-0.294113
-0.123894
-0.294534
-0.131933
-0.293895
-0.140453
-0.293286
-0.149381
-0.293005
-0.158596
-0.292624
-0.167971
-0.291934
-0.177542
-0.290704
-0.187393
-0.289037
-0.197588
-0.287045
-0.208127
-0.28481
-0.218982
-0.282339
-0.230167
-0.279619
-0.276793
-0.241815
0.237216
-0.262762
-0.248611
0.226258
-0.265571
0.215638
-0.268143
0.205381
-0.270401
0.195511
-0.272339
0.185985
-0.273883
0.176707
-0.27489
0.167593
-0.27523
0.158595
-0.274757
0.149796
-0.273586
0.141305
-0.27181
0.133276
-0.269829
0.125552
-0.267548
0.117693
-0.264612
0.108868
-0.259849
0.0980185
-0.251157
0.0843128
-0.235939
0.0676512
-0.211748
0.0490744
-0.17738
0.030286
-0.133969
0.0108166
-0.0948409
-0.0130202
-0.097149
-0.0387971
-0.141715
-0.0630272
-0.192353
-0.0835114
-0.234091
-0.0993263
-0.2625
-0.111044
-0.278358
-0.120152
-0.285005
-0.128119
-0.286567
-0.135892
-0.286121
-0.144091
-0.285087
-0.152758
-0.284339
-0.16185
-0.283531
-0.171183
-0.282602
-0.18072
-0.281167
-0.190516
-0.279241
-0.20066
-0.276901
-0.211188
-0.274281
-0.222112
-0.271415
-0.233412
-0.26832
-0.265053
-0.245152
0.241891
-0.251403
-0.253251
0.230923
-0.254603
0.220349
-0.25757
0.210234
-0.260286
0.200531
-0.262635
0.191162
-0.264515
0.182031
-0.265759
0.173102
-0.2663
0.164386
-0.266042
0.156053
-0.265253
0.148182
-0.263939
0.140867
-0.262514
0.133701
-0.260382
0.126115
-0.257026
0.117124
-0.250857
0.105654
-0.239688
0.0909736
-0.221259
0.0731834
-0.193958
0.0535047
-0.157701
0.0337083
-0.114173
0.0136942
-0.0748269
-0.0101441
-0.0733107
-0.0363763
-0.115483
-0.0618187
-0.16691
-0.0839679
-0.211942
-0.101599
-0.244869
-0.114777
-0.265181
-0.124703
-0.275079
-0.132967
-0.278303
-0.140568
-0.27852
-0.148447
-0.277208
-0.156769
-0.276017
-0.165654
-0.274646
-0.174907
-0.273348
-0.184425
-0.271649
-0.194187
-0.269479
-0.204282
-0.266807
-0.214783
-0.26378
-0.22572
-0.260478
-0.237074
-0.256965
-0.253255
-0.248873
0.246878
-0.240081
-0.2582
0.235967
-0.243691
0.225573
-0.247176
0.215655
-0.250368
0.206131
-0.253112
0.196931
-0.255314
0.187979
-0.256807
0.17933
-0.257652
0.171047
-0.257759
0.163375
-0.25758
0.156262
-0.256827
0.149719
-0.255971
0.142992
-0.253655
0.135478
-0.249512
0.126011
-0.24139
0.113598
-0.227275
0.0976887
-0.205349
0.0785919
-0.174862
0.0577217
-0.136831
0.036867
-0.0933179
0.0162692
-0.0542291
-0.00747868
-0.0495628
-0.0339181
-0.0890436
-0.0602977
-0.140531
-0.0840224
-0.188218
-0.10355
-0.225342
-0.118447
-0.250284
-0.129444
-0.264081
-0.138289
-0.269458
-0.145861
-0.270948
-0.15348
-0.269589
-0.161397
-0.2681
-0.169966
-0.266078
-0.179044
-0.26427
-0.188515
-0.262178
-0.198249
-0.259744
-0.208292
-0.256763
-0.218725
-0.253348
-0.229612
-0.249591
-0.240958
-0.245619
-0.241479
-0.252734
0.252043
-0.228835
-0.263289
0.241366
-0.233014
0.231174
-0.236984
0.221461
-0.240655
0.212094
-0.243745
0.203101
-0.246321
0.194416
-0.248123
0.186232
-0.249467
0.178589
-0.250117
0.171789
-0.250779
0.165496
-0.250534
0.15969
-0.250164
0.153134
-0.2471
0.145411
-0.241789
0.135012
-0.230991
0.121303
-0.213565
0.103919
-0.187966
0.0834391
-0.154382
0.0614213
-0.114813
0.0395091
-0.0714057
0.01834
-0.03306
-0.00513356
-0.0260892
-0.0315182
-0.0626589
-0.0585387
-0.11351
-0.0836009
-0.163155
-0.104939
-0.204005
-0.121829
-0.233393
-0.134107
-0.251804
-0.143894
-0.259671
-0.15164
-0.263201
-0.159134
-0.262095
-0.166632
-0.260602
-0.174778
-0.257932
-0.183525
-0.255524
-0.192847
-0.252856
-0.202517
-0.250074
-0.21251
-0.246771
-0.222856
-0.243002
-0.233684
-0.238763
-0.244941
-0.234362
-0.229744
-0.256676
0.256955
-0.21777
-0.268019
0.246604
-0.222663
0.2366
-0.226981
0.227234
-0.231288
0.218122
-0.234633
0.209513
-0.237712
0.201212
-0.239822
0.193788
-0.242043
0.186966
-0.243294
0.181243
-0.245056
0.175631
-0.244922
0.170458
-0.244991
0.163488
-0.24013
0.155337
-0.233638
0.143272
-0.218926
0.128143
-0.198436
0.108954
-0.168777
0.0872591
-0.132687
0.0642713
-0.0918252
0.0413978
-0.0485322
0.0195427
-0.0112049
-0.00343737
-0.0031091
-0.0293252
-0.0367711
-0.0565081
-0.0863274
-0.0827348
-0.136929
-0.105426
-0.181313
-0.124781
-0.214038
-0.138313
-0.238272
-0.149582
-0.248402
-0.157683
-0.255101
-0.16532
-0.254459
-0.172385
-0.253536
-0.180065
-0.250252
-0.188282
-0.247306
-0.197308
-0.24383
-0.206799
-0.240583
-0.216776
-0.236795
-0.226961
-0.232816
-0.237624
-0.2281
-0.248706
-0.22328
-0.218058
-0.260391
0.261399
-0.206912
-0.272257
0.251465
-0.212729
0.241577
-0.217093
0.232632
-0.222343
0.223604
-0.225605
0.21569
-0.229799
0.208106
-0.232237
0.201814
-0.235751
0.195864
-0.237344
0.191413
-0.240606
0.185942
-0.239451
0.181436
-0.240485
0.172967
-0.231661
0.164527
-0.225198
0.149624
-0.204023
0.133706
-0.182519
0.112082
-0.147153
0.0899477
-0.110552
0.0659423
-0.0678198
0.0422465
-0.0248364
0.0197714
0.0112703
-0.00313984
0.0198021
-0.0275794
-0.0123315
-0.054191
-0.0597157
-0.0819669
-0.109153
-0.104772
-0.158508
-0.127412
-0.191399
-0.141566
-0.224118
-0.155146
-0.234822
-0.16342
-0.246827
-0.171743
-0.246136
-0.178266
-0.247014
-0.185674
-0.242844
-0.193159
-0.239821
-0.20184
-0.235149
-0.210845
-0.231578
-0.220696
-0.226944
-0.230548
-0.222964
-0.241231
-0.217416
-0.251994
-0.212517
-0.206447
-0.263605
0.265086
-0.276306
0.255935
0.245861
0.237723
0.228713
0.221865
0.214755
0.209912
0.204651
0.201146
0.195431
0.19097
0.180932
0.171497
0.153409
0.137025
0.113564
0.0919758
0.0666725
0.0416119
0.0215897
-0.00298438
-0.0267919
-0.0526256
-0.0818925
-0.103933
-0.129059
-0.14397
-0.159812
-0.168369
-0.177394
-0.183745
-0.191024
-0.197964
-0.206069
-0.214332
-0.224192
-0.233599
-0.244468
-0.254657
-0.266469
0.176122
-0.248649
0.159332
-0.246816
0.143537
-0.244596
0.12868
-0.241819
0.114673
-0.238727
0.101279
-0.235479
0.088348
-0.232221
0.0756717
-0.229139
0.0630683
-0.226457
0.0508476
-0.224267
0.03973
-0.221372
0.0309747
-0.217348
0.0243915
-0.208887
0.0202599
-0.199741
0.0141495
-0.183178
0.0106733
-0.177731
-0.14723
0.169601
-0.232953
0.154103
-0.231317
0.139242
-0.229736
0.125073
-0.22765
0.111593
-0.225246
0.0987278
-0.222614
0.0863845
-0.219877
0.0744287
-0.217183
0.0626017
-0.21463
0.0507663
-0.212431
0.0393688
-0.209974
0.0292983
-0.207277
0.0219026
-0.201492
0.0168701
-0.194708
0.0130837
-0.179392
0.00703349
-0.171681
-0.140196
0.1634
-0.217499
0.148688
-0.216605
0.13453
-0.215579
0.120997
-0.214117
0.108054
-0.212304
0.095683
-0.210243
0.0838156
-0.20801
0.0724172
-0.205784
0.0613115
-0.203525
0.0502995
-0.201419
0.039556
-0.199231
0.0294129
-0.197134
0.0211849
-0.193264
0.0150713
-0.188595
0.011466
-0.175786
0.00589282
-0.166108
-0.134303
0.156135
-0.203902
0.14273
-0.203201
0.129493
-0.202341
0.116692
-0.201316
0.104355
-0.199966
0.0925031
-0.198391
0.0811636
-0.19667
0.0702849
-0.194906
0.0597589
-0.192999
0.0494003
-0.19106
0.0392302
-0.189061
0.0293767
-0.187281
0.0207134
-0.1846
0.0138251
-0.181706
0.00979005
-0.171751
0.00469463
-0.161012
-0.129609
0.149257
-0.19061
0.13657
-0.190513
0.124138
-0.18991
0.112069
-0.189247
0.100386
-0.188284
0.0891199
-0.187124
0.0783092
-0.18586
0.067919
-0.184516
0.0579201
-0.183
0.0481925
-0.181333
0.0386888
-0.179557
0.0293654
-0.177957
0.0206673
-0.175902
0.0131083
-0.174147
0.00835553
-0.166998
0.00370737
-0.156364
-0.125901
0.141384
-0.179001
0.129802
-0.178931
0.118442
-0.17855
0.10715
-0.177955
0.0961731
-0.177307
0.0855564
-0.176508
0.0753146
-0.175618
0.065405
-0.174606
0.0558655
-0.17346
0.0466587
-0.172126
0.0377464
-0.170645
0.0290129
-0.169224
0.0207272
-0.167616
0.0128942
-0.166314
0.00726842
-0.161373
0.00270614
-0.151802
-0.123195
0.133867
-0.167699
0.122976
-0.16804
0.112355
-0.167929
0.101926
-0.167526
0.0916848
-0.167065
0.0817483
-0.166571
0.0721012
-0.165971
0.06274
-0.165245
0.0536692
-0.16439
0.0449379
-0.163395
0.0365317
-0.162238
0.0283446
-0.161037
0.0205166
-0.159788
0.0128758
-0.158673
0.00671724
-0.155214
0.00207544
-0.14716
-0.12112
0.125447
-0.157929
0.115594
-0.158187
0.105885
-0.15822
0.0963442
-0.157985
0.0869295
-0.15765
0.077702
-0.157344
0.0687043
-0.156973
0.0599229
-0.156463
0.0513525
-0.155819
0.0430818
-0.155124
0.0351308
-0.154287
0.0274566
-0.153362
0.0200598
-0.152392
0.012838
-0.151452
0.00660354
-0.14898
0.00175151
-0.142308
-0.119368
0.117416
-0.148502
0.108229
-0.149
0.0991944
-0.149185
0.0903992
-0.14919
0.081829
-0.14908
0.0733934
-0.148908
0.0650589
-0.148638
0.0569095
-0.148314
0.0489429
-0.147852
0.0411587
-0.14734
0.0336388
-0.146768
0.0264357
-0.146159
0.0194749
-0.145431
0.0127418
-0.144719
0.00669593
-0.142934
0.00174326
-0.137355
-0.117625
0.108554
-0.140513
0.100396
-0.140842
0.0922672
-0.141056
0.0842388
-0.141162
0.07639
-0.141231
0.0687048
-0.141223
0.0611551
-0.141089
0.0536516
-0.140811
0.0463134
-0.140514
0.0391555
-0.140182
0.0321294
-0.139741
0.0253415
-0.139371
0.0187953
-0.138885
0.0125354
-0.138459
0.00676141
-0.13716
0.00186379
-0.132458
-0.115761
0.100099
-0.132943
0.0926499
-0.133393
0.085254
-0.13366
0.077974
-0.133882
0.0708109
-0.134068
0.0637484
-0.13416
0.056828
-0.134168
0.0500936
-0.134076
0.0434705
-0.133891
0.036917
-0.133629
0.0305296
-0.133354
0.0242896
-0.133131
0.0181567
-0.132752
0.012293
-0.132595
0.00678599
-0.131653
0.00208914
-0.127761
-0.113672
0.0907789
-0.126679
0.0843606
-0.126975
0.0779281
-0.127228
0.0715002
-0.127454
0.0650892
-0.127657
0.0587275
-0.127799
0.0524328
-0.127873
0.0462365
-0.12788
0.0401883
-0.127843
0.0343448
-0.127785
0.0286164
-0.127626
0.0229796
-0.127494
0.0174389
-0.127211
0.0120622
-0.127218
0.00686684
-0.126457
0.00242184
-0.123316
-0.11125
0.0818872
-0.120851
0.0761685
-0.121256
0.0704897
-0.121549
0.0648374
-0.121802
0.0591916
-0.122011
0.0535581
-0.122165
0.0479531
-0.122269
0.0424146
-0.122341
0.0369461
-0.122374
0.0315702
-0.122409
0.0263071
-0.122363
0.0212433
-0.122431
0.0163213
-0.122289
0.0115072
-0.122404
0.00674612
-0.121696
0.00258553
-0.119155
-0.108665
0.0722111
-0.116242
0.0674658
-0.116511
0.0626832
-0.116766
0.0578523
-0.116971
0.0529873
-0.117147
0.0481154
-0.117293
0.0432617
-0.117415
0.0384414
-0.117521
0.0336674
-0.1176
0.0289457
-0.117688
0.0242857
-0.117703
0.0196863
-0.117831
0.0151566
-0.117759
0.0107507
-0.117998
0.00653915
-0.117485
0.00270919
-0.115325
-0.105956
0.062946
-0.112087
0.0588708
-0.112435
0.0547827
-0.112678
0.0506738
-0.112862
0.0465447
-0.113017
0.0424091
-0.113158
0.0382713
-0.113277
0.0341369
-0.113387
0.0300174
-0.113481
0.0259201
-0.11359
0.0218571
-0.11364
0.0178411
-0.113815
0.0138488
-0.113767
0.00993802
-0.114087
0.00612528
-0.113672
0.0026349
-0.111835
-0.103321
0.0530357
-0.109041
0.0498425
-0.109242
0.046563
-0.109399
0.0432124
-0.109511
0.0398133
-0.109618
0.0363814
-0.109726
0.0329361
-0.109832
0.0294812
-0.109932
0.0260228
-0.110022
0.0225557
-0.110123
0.0191067
-0.110191
0.0156576
-0.110366
0.0122484
-0.110358
0.00886227
-0.110701
0.00545913
-0.110269
0.00241168
-0.108788
-0.100909
0.0435364
-0.106438
0.0409652
-0.106671
0.0383383
-0.106772
0.0356743
-0.106847
0.0329741
-0.106918
0.0302388
-0.10699
0.0274664
-0.107059
0.0246672
-0.107133
0.021857
-0.107212
0.0190317
-0.107298
0.0162068
-0.107366
0.0133461
-0.107505
0.0105091
-0.107521
0.00762778
-0.10782
0.00472592
-0.107367
0.0021024
-0.106164
-0.0988066
0.0335239
-0.104849
0.0317566
-0.104904
0.0298897
-0.104905
0.027964
-0.104921
0.0259847
-0.104939
0.0239577
-0.104963
0.0218868
-0.104988
0.0197713
-0.105017
0.0176087
-0.10505
0.0154
-0.105089
0.0131721
-0.105138
0.0109106
-0.105244
0.00866444
-0.105275
0.00632822
-0.105484
0.00405193
-0.105091
0.00182516
-0.103937
-0.0969815
0.0239085
-0.103644
0.0227161
-0.103711
0.0214844
-0.103673
0.0202149
-0.103652
0.0188991
-0.103623
0.0175362
-0.1036
0.0161259
-0.103578
0.0146681
-0.103559
0.0131641
-0.103545
0.0116124
-0.103538
0.0100144
-0.10354
0.00833979
-0.103569
0.00664675
-0.103582
0.00484908
-0.103686
0.00311984
-0.103361
0.00133094
-0.102148
-0.0956505
0.0138994
-0.103435
0.0134433
-0.103255
0.0129045
-0.103134
0.0122947
-0.103042
0.0116231
-0.102952
0.010891
-0.102868
0.0101029
-0.10279
0.00926113
-0.102718
0.0083663
-0.102651
0.00741964
-0.102591
0.0064223
-0.102543
0.00536804
-0.102515
0.00428973
-0.102503
0.00309019
-0.102487
0.00196695
-0.102238
0.000699178
-0.100881
-0.0949513
0.00440446
-0.103507
0.00454684
-0.103398
0.00466889
-0.103256
0.00472523
-0.103098
0.00471845
-0.102945
0.0046439
-0.102794
0.00450315
-0.102649
0.00429434
-0.102509
0.00401737
-0.102374
0.00367283
-0.102246
0.00325935
-0.102129
0.00277475
-0.10203
0.00223668
-0.101965
0.00158258
-0.101832
0.000977134
-0.101633
0.000218497
-0.100122
-0.0947328
-0.00525186
-0.104734
-0.00434985
-0.1043
-0.0035593
-0.104047
-0.00285605
-0.103802
-0.00222277
-0.103578
-0.00166645
-0.10335
-0.00118668
-0.103129
-0.000784525
-0.102911
-0.000459188
-0.102699
-0.000210656
-0.102495
-4.01068e-05
-0.1023
5.50089e-05
-0.102125
7.71166e-05
-0.101987
7.95686e-06
-0.101763
-5.24608e-05
-0.101572
-0.00028535
-0.0998891
-0.0950182
-0.0147546
-0.106038
-0.0132964
-0.105758
-0.0118609
-0.105483
-0.0105219
-0.105141
-0.00927335
-0.104827
-0.00811008
-0.104513
-0.00702824
-0.104211
-0.00602687
-0.103912
-0.00510506
-0.103621
-0.00426263
-0.103337
-0.00350032
-0.103062
-0.00281332
-0.102812
-0.00220658
-0.102594
-0.00168608
-0.102284
-0.00116916
-0.102089
-0.000849008
-0.100209
-0.0958672
-0.0241356
-0.108608
-0.021998
-0.107895
-0.0199923
-0.107488
-0.0180705
-0.107062
-0.0162302
-0.106667
-0.0144763
-0.106267
-0.0128084
-0.105879
-0.0112252
-0.105496
-0.00972444
-0.105122
-0.00830537
-0.104756
-0.00696637
-0.104401
-0.00570231
-0.104077
-0.00452243
-0.103774
-0.00341161
-0.103395
-0.002327
-0.103174
-0.0014101
-0.101126
-0.0972773
-0.033368
-0.111075
-0.0306683
-0.110595
-0.028025
-0.110131
-0.0254957
-0.109592
-0.0230706
-0.109092
-0.0207423
-0.108596
-0.0185065
-0.108115
-0.0163599
-0.107642
-0.0142997
-0.107182
-0.0123248
-0.106731
-0.0104314
-0.106294
-0.00861529
-0.105893
-0.00688395
-0.105505
-0.00520524
-0.105073
-0.00356116
-0.104818
-0.001993
-0.102694
-0.0992703
-0.0423663
-0.114919
-0.0390378
-0.113924
-0.0358548
-0.113314
-0.0327703
-0.112676
-0.0297852
-0.112077
-0.0268999
-0.111481
-0.0241117
-0.110903
-0.0214169
-0.110337
-0.0188121
-0.109786
-0.0162949
-0.109248
-0.013861
-0.108728
-0.0115057
-0.108248
-0.00922804
-0.107783
-0.00699121
-0.10731
-0.00481505
-0.106994
-0.00249499
-0.105014
-0.101765
-0.0512315
-0.118515
-0.0473495
-0.117806
-0.0435616
-0.117102
-0.0399054
-0.116333
-0.0363702
-0.115612
-0.0329445
-0.114907
-0.0296218
-0.114225
-0.0263967
-0.113562
-0.0232645
-0.112919
-0.0202167
-0.112296
-0.0172402
-0.111705
-0.0143311
-0.111157
-0.0114944
-0.11062
-0.00863389
-0.110171
-0.00590194
-0.109726
-0.00298697
-0.107929
-0.104752
-0.0598227
-0.123569
-0.0553575
-0.122271
-0.0510614
-0.121398
-0.0468819
-0.120512
-0.0428201
-0.119674
-0.038872
-0.118855
-0.035032
-0.118065
-0.0312917
-0.117302
-0.0276393
-0.116571
-0.0240631
-0.115872
-0.0205384
-0.115229
-0.0170727
-0.114623
-0.0136499
-0.114043
-0.0102534
-0.113567
-0.00695968
-0.11302
-0.00349487
-0.111394
-0.108247
-0.0682843
-0.128247
-0.0632887
-0.127266
-0.0584222
-0.126265
-0.0537068
-0.125227
-0.0491285
-0.124252
-0.044671
-0.123312
-0.0403233
-0.122413
-0.036074
-0.121552
-0.0318985
-0.120747
-0.0277824
-0.119989
-0.0237337
-0.119278
-0.0197463
-0.11861
-0.0158028
-0.117986
-0.0118885
-0.117481
-0.00802555
-0.116883
-0.00401753
-0.115402
-0.112265
-0.076457
-0.134431
-0.0709225
-0.132801
-0.065582
-0.131606
-0.0603731
-0.130436
-0.0552947
-0.129331
-0.050337
-0.12827
-0.0454885
-0.127262
-0.0407292
-0.126311
-0.0360448
-0.125431
-0.0314296
-0.124604
-0.026875
-0.123833
-0.0223744
-0.123111
-0.0179113
-0.122449
-0.013479
-0.121914
-0.00909864
-0.121263
-0.00455759
-0.119943
-0.116822
-0.0845177
-0.140147
-0.0784803
-0.138838
-0.0726024
-0.137483
-0.0668936
-0.136145
-0.0613268
-0.134897
-0.0558811
-0.133716
-0.0505405
-0.132602
-0.0452933
-0.131558
-0.040121
-0.130603
-0.0350145
-0.12971
-0.0299641
-0.128883
-0.0249612
-0.128114
-0.0199936
-0.127417
-0.0150625
-0.126845
-0.0101605
-0.126165
-0.00509907
-0.125005
-0.121921
-0.0922607
-0.14736
-0.085759
-0.14534
-0.0794474
-0.143795
-0.0732764
-0.142316
-0.0672397
-0.140934
-0.0613211
-0.139634
-0.0555034
-0.13842
-0.049775
-0.137287
-0.0441294
-0.136249
-0.0385424
-0.135297
-0.0330066
-0.134419
-0.0275106
-0.13361
-0.0220442
-0.132883
-0.0166122
-0.132277
-0.0111879
-0.131589
-0.00562528
-0.130567
-0.127547
-0.0999659
-0.154044
-0.09297
-0.152336
-0.086163
-0.150602
-0.0795332
-0.148946
-0.0730444
-0.147423
-0.0666706
-0.146008
-0.0603926
-0.144698
-0.0541931
-0.143486
-0.0480745
-0.142367
-0.0420156
-0.141356
-0.0359994
-0.140435
-0.030018
-0.139591
-0.0240617
-0.13884
-0.018133
-0.138206
-0.0121988
-0.137524
-0.00615404
-0.136612
-0.133701
-0.107306
-0.162176
-0.0999209
-0.159721
-0.0927234
-0.157799
-0.0856689
-0.156001
-0.0787459
-0.154346
-0.0719329
-0.152821
-0.06521
-0.151421
-0.0585601
-0.150136
-0.0519687
-0.148959
-0.0454432
-0.147882
-0.0389561
-0.146922
-0.0324937
-0.146053
-0.0260521
-0.145281
-0.0196351
-0.144623
-0.0132093
-0.143949
-0.00668654
-0.143135
-0.140387
-0.11465
-0.169735
-0.106796
-0.167575
-0.0991487
-0.165447
-0.0916755
-0.163474
-0.0843335
-0.161688
-0.0770949
-0.16006
-0.0699395
-0.158576
-0.0628502
-0.157225
-0.055813
-0.155996
-0.048815
-0.15488
-0.0418685
-0.153869
-0.0349399
-0.152982
-0.0280248
-0.152196
-0.0211253
-0.151522
-0.0142114
-0.150863
-0.00721713
-0.150129
-0.147604
-0.121588
-0.178669
-0.113416
-0.175747
-0.105415
-0.173447
-0.0975471
-0.171342
-0.0897979
-0.169437
-0.082144
-0.167714
-0.0745661
-0.166154
-0.0670471
-0.164744
-0.0595728
-0.16347
-0.0521306
-0.162322
-0.0447097
-0.16129
-0.0373244
-0.160367
-0.0299486
-0.159572
-0.0225881
-0.158883
-0.0152085
-0.158243
-0.00775015
-0.157588
-0.155354
-0.128571
-0.186996
-0.119959
-0.184359
-0.111553
-0.181853
-0.1033
-0.179595
-0.095159
-0.177578
-0.0871032
-0.175769
-0.0791148
-0.174143
-0.0711774
-0.172682
-0.0632772
-0.17137
-0.0554019
-0.170197
-0.0475405
-0.169151
-0.0396841
-0.168224
-0.0318459
-0.16741
-0.0240201
-0.166708
-0.0161787
-0.166084
-0.0082689
-0.165497
-0.163623
-0.13515
-0.196573
-0.126293
-0.193216
-0.117578
-0.190568
-0.108969
-0.188204
-0.100456
-0.186091
-0.0920181
-0.184207
-0.0836371
-0.182524
-0.0752969
-0.181022
-0.0669837
-0.179684
-0.0586863
-0.178495
-0.0503954
-0.177442
-0.0421035
-0.176516
-0.0338061
-0.175708
-0.0254986
-0.175016
-0.0171648
-0.174418
-0.00879726
-0.173865
-0.172421
-0.141772
-0.205514
-0.132523
-0.202465
-0.123452
-0.199639
-0.114498
-0.197158
-0.105628
-0.194961
-0.096822
-0.193014
-0.0880619
-0.191284
-0.0793322
-0.189752
-0.0706192
-0.188397
-0.0619118
-0.187202
-0.0532009
-0.186153
-0.0444794
-0.185237
-0.0357434
-0.184444
-0.0269918
-0.183767
-0.0182053
-0.183204
-0.00934565
-0.182725
-0.181766
-0.147884
-0.215637
-0.138422
-0.211927
-0.129038
-0.209023
-0.119717
-0.206479
-0.110465
-0.204212
-0.101268
-0.202211
-0.0921099
-0.200442
-0.0829789
-0.198883
-0.0738637
-0.197512
-0.0647562
-0.196309
-0.0556489
-0.19526
-0.0465317
-0.194354
-0.0373919
-0.193583
-0.0282192
-0.19294
-0.0190063
-0.192417
-0.0097253
-0.192006
-0.191492
-0.201467
-0.173107
0.215565
-0.188518
-0.178405
-0.175435
-0.183583
-0.163303
-0.18848
-0.151145
-0.193192
-0.139733
-0.197681
-0.128335
-0.201959
-0.11754
-0.205957
-0.106832
-0.209716
-0.0965959
-0.213199
-0.0864816
-0.216415
-0.0767224
-0.219349
-0.0671002
-0.221994
-0.0577307
-0.224349
-0.0484959
-0.2264
-0.0394232
-0.228151
-0.0304672
-0.229587
-0.0215941
-0.230714
-0.0128067
-0.231519
-0.00403465
-0.232007
0.00469636
-0.232172
0.0134661
-0.232018
0.022255
-0.23154
0.0311211
-0.230746
0.0400796
-0.229631
0.0491405
-0.228208
0.0583778
-0.226469
0.0677299
-0.224433
0.0773536
-0.222092
0.0870887
-0.219463
0.097202
-0.216546
0.107406
-0.213348
0.118108
-0.209884
0.128859
-0.206142
0.14024
-0.202162
0.151591
-0.197904
0.163736
-0.193454
0.175812
-0.188768
0.188881
-0.183902
0.201677
-0.178681
-0.173415
-0.198453
-0.186299
0.211645
-0.185612
-0.191246
-0.173169
-0.196026
-0.161105
-0.200545
-0.149388
-0.204908
-0.13802
-0.209049
-0.126986
-0.212993
-0.116263
-0.21668
-0.105827
-0.220152
-0.0956664
-0.223359
-0.0857487
-0.226332
-0.0760656
-0.229032
-0.0665812
-0.231478
-0.0572862
-0.233644
-0.0481456
-0.23554
-0.0391456
-0.237151
-0.0302543
-0.238479
-0.0214526
-0.239515
-0.0127125
-0.240259
-0.00401094
-0.240709
0.0046782
-0.240861
0.0133788
-0.240718
0.0221179
-0.240279
0.0309167
-0.239545
0.0398056
-0.23852
0.0488005
-0.237203
0.0579364
-0.235605
0.0672237
-0.23372
0.0767004
-0.231569
0.0863723
-0.229135
0.096278
-0.226451
0.106423
-0.223492
0.116841
-0.220302
0.127544
-0.216845
0.138556
-0.213175
0.149898
-0.209246
0.161572
-0.205129
0.173604
-0.200799
0.185989
-0.196288
0.198793
-0.191485
-0.186549
-0.195771
-0.199188
0.20866
-0.183243
-0.203774
-0.171083
-0.208186
-0.159259
-0.212369
-0.147775
-0.216392
-0.136606
-0.220218
-0.12576
-0.22384
-0.115194
-0.227246
-0.104911
-0.230436
-0.0948739
-0.233396
-0.0850794
-0.236127
-0.0754943
-0.238617
-0.066108
-0.240865
-0.0568912
-0.242861
-0.0478285
-0.244603
-0.0388932
-0.246086
-0.0300649
-0.247307
-0.0213193
-0.248261
-0.0126332
-0.248945
-0.00398358
-0.249358
0.00465441
-0.249499
0.0133035
-0.249367
0.021988
-0.248963
0.0307317
-0.248289
0.0395566
-0.247345
0.0484882
-0.246134
0.0575454
-0.244662
0.0667563
-0.242931
0.0761344
-0.240947
0.0857106
-0.238711
0.0954933
-0.236234
0.105517
-0.233516
0.115784
-0.230569
0.126332
-0.227393
0.137158
-0.224001
0.148304
-0.220392
0.159757
-0.216582
0.171548
-0.212589
0.183655
-0.208394
0.196154
-0.203985
-0.199418
-0.193414
-0.211844
0.20607
-0.181131
-0.216057
-0.169215
-0.220101
-0.157604
-0.22398
-0.146314
-0.227683
-0.135329
-0.231202
-0.124638
-0.234531
-0.114221
-0.237663
-0.104064
-0.240592
-0.094148
-0.243312
-0.0844559
-0.245819
-0.0749674
-0.248106
-0.065664
-0.250168
-0.0565248
-0.252
-0.0475299
-0.253598
-0.0386578
-0.254958
-0.0298868
-0.256078
-0.021195
-0.256953
-0.0125598
-0.25758
-0.00395911
-0.257959
0.00463016
-0.258088
0.0132302
-0.257967
0.021864
-0.257597
0.0305538
-0.256978
0.0393218
-0.256113
0.0481901
-0.255003
0.0571801
-0.253652
0.0663136
-0.252064
0.0756098
-0.250243
0.0850899
-0.248192
0.0947718
-0.245916
0.104676
-0.243421
0.114819
-0.240712
0.125221
-0.237794
0.135894
-0.234674
0.146858
-0.231356
0.158122
-0.227846
0.169686
-0.224153
0.181585
-0.220293
0.193852
-0.216252
-0.212045
-0.19135
-0.224269
0.203775
-0.179271
-0.228136
-0.167547
-0.231825
-0.156131
-0.235397
-0.145009
-0.238805
-0.134178
-0.242033
-0.123625
-0.245084
-0.113335
-0.247953
-0.103293
-0.250635
-0.0934804
-0.253125
-0.083882
-0.255417
-0.0744788
-0.257509
-0.0652524
-0.259395
-0.056183
-0.261069
-0.0472516
-0.262529
-0.0384377
-0.263772
-0.0297207
-0.264795
-0.0210792
-0.265594
-0.0124922
-0.266167
-0.00393805
-0.266513
0.004605
-0.266631
0.0131585
-0.266521
0.0217442
-0.266183
0.0303836
-0.265618
0.0390978
-0.264827
0.047908
-0.263813
0.0568348
-0.262579
0.0658987
-0.261128
0.0751186
-0.259463
0.084514
-0.257587
0.0941033
-0.255505
0.103905
-0.253222
0.113935
-0.250743
0.124211
-0.248071
0.134749
-0.245211
0.145562
-0.242169
0.156654
-0.238939
0.168038
-0.235537
0.179748
-0.232004
0.19181
-0.228315
-0.224447
-0.189524
-0.236502
0.201758
-0.177632
-0.240028
-0.16606
-0.243398
-0.154799
-0.246657
-0.143833
-0.249772
-0.133134
-0.252731
-0.122702
-0.255516
-0.112523
-0.258132
-0.102582
-0.260576
-0.092863
-0.262844
-0.0833491
-0.264931
-0.0740233
-0.266835
-0.0648673
-0.268551
-0.0558625
-0.270074
-0.0469901
-0.271402
-0.0382309
-0.272531
-0.0295647
-0.273461
-0.0209712
-0.274188
-0.0124301
-0.274709
-0.00392052
-0.275023
0.00457828
-0.27513
0.0130872
-0.27503
0.021627
-0.274723
0.0302183
-0.274209
0.0388817
-0.27349
0.0476373
-0.272568
0.0565052
-0.271447
0.0655049
-0.270128
0.0746546
-0.268613
0.0839731
-0.266905
0.0934786
-0.265011
0.103188
-0.262932
0.113119
-0.260673
0.123285
-0.258237
0.133703
-0.255629
0.144373
-0.252839
0.155322
-0.249888
0.166565
-0.246779
0.178117
-0.243556
0.189995
-0.240192
-0.236663
-0.187924
-0.248566
0.199987
-0.176175
-0.251777
-0.164737
-0.254836
-0.153603
-0.257791
-0.142755
-0.260619
-0.132183
-0.263304
-0.121859
-0.26584
-0.111777
-0.268214
-0.101926
-0.270427
-0.0922895
-0.27248
-0.082852
-0.274369
-0.0735964
-0.27609
-0.0645054
-0.277642
-0.0555603
-0.279019
-0.0467433
-0.280219
-0.0380355
-0.281239
-0.0294177
-0.282079
-0.0208702
-0.282735
-0.0123732
-0.283206
-0.00390669
-0.283489
0.0045494
-0.283586
0.0130152
-0.283496
0.0215108
-0.283219
0.0300562
-0.282755
0.0386711
-0.282105
0.0473752
-0.281272
0.0561879
-0.280259
0.0651279
-0.279068
0.0742129
-0.277698
0.0834614
-0.276154
0.092891
-0.27444
0.102518
-0.272559
0.11236
-0.270514
0.122428
-0.268306
0.132729
-0.265929
0.143288
-0.263399
0.154121
-0.260721
0.165241
-0.2579
0.176661
-0.254975
0.188391
-0.251922
-0.248714
-0.186508
-0.260502
0.198443
-0.17488
-0.263404
-0.163556
-0.26616
-0.152529
-0.268819
-0.141782
-0.271366
-0.131304
-0.273782
-0.121081
-0.276063
-0.111088
-0.278208
-0.101316
-0.280199
-0.0917542
-0.282042
-0.0823857
-0.283737
-0.0731944
-0.285282
-0.0641631
-0.286673
-0.0552739
-0.287909
-0.046509
-0.288983
-0.0378502
-0.289898
-0.0292788
-0.29065
-0.0207755
-0.291239
-0.0123213
-0.29166
-0.00389668
-0.291914
0.00451779
-0.292001
0.0129417
-0.29192
0.0213944
-0.291671
0.0298954
-0.291256
0.0384639
-0.290674
0.047119
-0.289928
0.0558795
-0.28902
0.0647638
-0.287952
0.073789
-0.286723
0.0829735
-0.285338
0.0923342
-0.283801
0.101888
-0.282113
0.111648
-0.280274
0.121621
-0.278279
0.131832
-0.276141
0.142298
-0.273864
0.153031
-0.271454
0.164047
-0.268915
0.175353
-0.266281
0.186964
-0.263533
-0.260633
-0.185262
-0.272338
0.197099
-0.173732
-0.274935
-0.162501
-0.27739
-0.151563
-0.279757
-0.140901
-0.282028
-0.130503
-0.284179
-0.120357
-0.286209
-0.110447
-0.288118
-0.100747
-0.289899
-0.0912518
-0.291537
-0.081946
-0.293043
-0.0728134
-0.294414
-0.0638377
-0.295649
-0.0550008
-0.296745
-0.0462854
-0.297699
-0.0376735
-0.29851
-0.0291467
-0.299177
-0.0206865
-0.299699
-0.0122741
-0.300072
-0.00389062
-0.300297
0.00448296
-0.300374
0.0128657
-0.300302
0.0212766
-0.300082
0.0297344
-0.299713
0.038258
-0.299197
0.0468661
-0.298536
0.0555772
-0.297731
0.064409
-0.296784
0.0733786
-0.295692
0.0825044
-0.294464
0.0918028
-0.293099
0.101289
-0.291599
0.11097
-0.289955
0.120869
-0.288179
0.131004
-0.286275
0.14139
-0.28425
0.15204
-0.282104
0.162967
-0.279842
0.17418
-0.277494
0.185693
-0.275046
-0.272453
-0.184169
-0.284101
0.195932
-0.172716
-0.286388
-0.161561
-0.288545
-0.150694
-0.290624
-0.140101
-0.292621
-0.129771
-0.294509
-0.11969
-0.29629
-0.109843
-0.297965
-0.100214
-0.299528
-0.0907778
-0.300974
-0.0815291
-0.302292
-0.0724506
-0.303493
-0.0635267
-0.304573
-0.0547391
-0.305533
-0.0460707
-0.306367
-0.0375039
-0.307077
-0.0290206
-0.307661
-0.0206026
-0.308117
-0.0122314
-0.308443
-0.00388862
-0.30864
0.00444445
-0.308707
0.0127865
-0.308644
0.021156
-0.308452
0.0295716
-0.308129
0.0380517
-0.307677
0.0466146
-0.307099
0.0552785
-0.306395
0.0640608
-0.305566
0.0729785
-0.30461
0.0820499
-0.303536
0.0912918
-0.302341
0.10071
-0.301017
0.11033
-0.299575
0.120167
-0.298015
0.130237
-0.296345
0.140556
-0.294569
0.151137
-0.292685
0.16199
-0.290696
0.173128
-0.288633
0.184565
-0.286482
-0.284197
-0.183216
-0.295813
0.194927
-0.17182
-0.297784
-0.160723
-0.299642
-0.149912
-0.301435
-0.139376
-0.303157
-0.129101
-0.304784
-0.119075
-0.306316
-0.109282
-0.307757
-0.0997061
-0.309104
-0.0903297
-0.31035
-0.0811325
-0.311489
-0.0721037
-0.312521
-0.0632278
-0.313448
-0.0544865
-0.314274
-0.045863
-0.314991
-0.0373398
-0.3156
-0.0288992
-0.316101
-0.0205229
-0.316493
-0.0121928
-0.316773
-0.0038907
-0.316942
0.00440181
-0.317
0.0127031
-0.316946
0.0210316
-0.31678
0.0294053
-0.316503
0.0378428
-0.316115
0.0463621
-0.315618
0.0549812
-0.315014
0.0637169
-0.314302
0.0725862
-0.313479
0.081608
-0.312557
0.0907915
-0.311525
0.100158
-0.310384
0.109724
-0.309141
0.119507
-0.307798
0.129522
-0.306361
0.139786
-0.304833
0.150311
-0.30321
0.161108
-0.301492
0.172188
-0.299713
0.183567
-0.297861
-0.295891
-0.18239
-0.307495
0.194073
-0.171035
-0.309139
-0.159978
-0.310699
-0.14921
-0.312204
-0.138718
-0.313649
-0.128487
-0.315014
-0.118506
-0.316298
-0.108759
-0.317504
-0.099229
-0.318634
-0.0899007
-0.319678
-0.080753
-0.320637
-0.0717697
-0.321505
-0.0629378
-0.32228
-0.0542402
-0.322972
-0.04566
-0.323571
-0.0371797
-0.32408
-0.0287812
-0.3245
-0.0204467
-0.324828
-0.0121579
-0.325062
-0.00389689
-0.325203
0.00435464
-0.325251
0.0126149
-0.325206
0.020902
-0.325067
0.029234
-0.324835
0.0376293
-0.32451
0.046106
-0.324095
0.0546821
-0.32359
0.0633745
-0.322995
0.072199
-0.322304
0.0811724
-0.321531
0.0903076
-0.32066
0.0996285
-0.319705
0.109149
-0.318662
0.118887
-0.317535
0.128858
-0.316332
0.139077
-0.315052
0.149557
-0.31369
0.160313
-0.312248
0.171353
-0.310753
0.18269
-0.309198
-0.307555
-0.181684
-0.319168
0.193357
-0.170355
-0.320468
-0.159323
-0.321731
-0.148583
-0.322943
-0.138124
-0.324108
-0.127927
-0.325211
-0.11798
-0.326245
-0.108269
-0.327215
-0.098777
-0.328126
-0.0894871
-0.328968
-0.0803838
-0.32974
-0.0714441
-0.330444
-0.0626526
-0.331072
-0.0539977
-0.331627
-0.0454601
-0.332108
-0.0370223
-0.332518
-0.028666
-0.332856
-0.0203734
-0.33312
-0.0121265
-0.333309
-0.00390716
-0.333423
0.00430265
-0.333461
0.0125212
-0.333424
0.0207665
-0.333313
0.0290566
-0.333125
0.0374097
-0.332863
0.0458439
-0.332529
0.0543773
-0.332123
0.0630293
-0.331647
0.0718097
-0.331084
0.0807393
-0.33046
0.0898353
-0.329756
0.0991176
-0.328987
0.1086
-0.328144
0.118302
-0.327237
0.12824
-0.32627
0.138426
-0.325239
0.148874
-0.324138
0.159601
-0.322975
0.170617
-0.321768
0.181928
-0.32051
-0.31921
-0.181087
-0.33085
0.19277
-0.169768
-0.331788
-0.158747
-0.332752
-0.148022
-0.333668
-0.137583
-0.334548
-0.12741
-0.335384
-0.117487
-0.336168
-0.107806
-0.336897
-0.0983453
-0.337586
-0.0890887
-0.338225
-0.0800204
-0.338808
-0.07112
-0.339345
-0.0623713
-0.33982
-0.0537588
-0.340239
-0.0452631
-0.340604
-0.036867
-0.340914
-0.0285526
-0.34117
-0.0203023
-0.341371
-0.0120981
-0.341513
-0.00392147
-0.341599
0.00424563
-0.341628
0.0124215
-0.3416
0.0206245
-0.341515
0.0288726
-0.341373
0.037184
-0.341174
0.0455763
-0.340921
0.0540667
-0.340614
0.0626741
-0.340254
0.0714148
-0.339825
0.0803089
-0.339355
0.0893699
-0.338817
0.0986197
-0.338237
0.108071
-0.337596
0.117746
-0.336912
0.12766
-0.336184
0.137822
-0.335401
0.148251
-0.334566
0.158964
-0.333689
0.169971
-0.332775
0.181274
-0.331813
-0.330877
-0.180594
-0.342558
0.192302
-0.16926
-0.343121
-0.158241
-0.343771
-0.147523
-0.344386
-0.137095
-0.344976
-0.12694
-0.345538
-0.117034
-0.346074
-0.107373
-0.346558
-0.0979361
-0.347023
-0.0887077
-0.347453
-0.0796692
-0.347847
-0.0708054
-0.348209
-0.0620958
-0.34853
-0.0535231
-0.348812
-0.0450674
-0.34906
-0.0367119
-0.34927
-0.0284395
-0.349443
-0.0202325
-0.349578
-0.0120721
-0.349674
-0.00393964
-0.349732
0.00418331
-0.349751
0.0123151
-0.349732
0.0204745
-0.349675
0.0286803
-0.349579
0.0369506
-0.349445
0.0453024
-0.349273
0.0537525
-0.349064
0.0623171
-0.348819
0.0710245
-0.348532
0.0798829
-0.348213
0.0889158
-0.34785
0.0981384
-0.347459
0.107569
-0.347026
0.117224
-0.346566
0.127122
-0.346082
0.137268
-0.345547
0.147686
-0.344985
0.158394
-0.344397
0.169403
-0.343783
0.180722
-0.343132
-0.342572
-0.180203
-0.354298
0.191943
-0.168841
-0.354484
-0.157819
-0.354793
-0.147099
-0.355107
-0.136669
-0.355405
-0.126519
-0.355688
-0.116629
-0.355964
-0.106974
-0.356213
-0.0975529
-0.356444
-0.0883465
-0.35666
-0.0793311
-0.356862
-0.0705
-0.35704
-0.0618206
-0.35721
-0.0532838
-0.357349
-0.044867
-0.357477
-0.0365523
-0.357584
-0.0283235
-0.357671
-0.0201618
-0.357739
-0.0120474
-0.357788
-0.00396136
-0.357818
0.00411498
-0.357827
0.0122005
-0.357818
0.020314
-0.357788
0.0284753
-0.35774
0.0367034
-0.357673
0.0450149
-0.357584
0.0534282
-0.357477
0.061959
-0.357349
0.0706378
-0.357211
0.0794644
-0.357039
0.0884783
-0.356864
0.0976784
-0.356659
0.107099
-0.356447
0.116748
-0.356215
0.126632
-0.355966
0.136776
-0.355691
0.147198
-0.355407
0.157911
-0.35511
0.168925
-0.354797
0.180277
-0.354484
-0.354301
-0.179911
0.191466
-0.168541
-0.15748
-0.146733
-0.136284
-0.126119
-0.116229
-0.106589
-0.0971789
-0.0879849
-0.0789935
-0.0701795
-0.0615353
-0.0530306
-0.0446536
-0.0363844
-0.0282021
-0.0200877
-0.0120222
-0.00398623
0.00403993
0.0120759
0.0201413
0.0282547
0.0364357
0.0447049
0.0530813
0.0615856
0.0702281
0.0790423
0.0880319
0.0972263
0.106633
0.116271
0.126159
0.136322
0.146768
0.157512
0.168569
0.179939
-0.0106691
-0.145165
-0.0140291
-0.175709
-0.0200578
-0.180641
-0.0237223
-0.197615
-0.02964
-0.20729
-0.0376041
-0.216691
-0.0480072
-0.221601
-0.0596585
-0.225466
-0.0718914
-0.228503
-0.0844094
-0.231906
-0.0974086
-0.235612
-0.111023
-0.239637
-0.125475
-0.243748
-0.14106
-0.247704
-0.157917
-0.251162
-0.176221
-0.253953
-0.256434
-0.00701996
-0.138146
-0.0129704
-0.169758
-0.0164727
-0.177139
-0.0208616
-0.193226
-0.0275432
-0.200609
-0.0369207
-0.207313
-0.0477624
-0.210759
-0.0592503
-0.213978
-0.0709095
-0.216843
-0.0828618
-0.219954
-0.0953371
-0.223137
-0.108465
-0.226509
-0.122404
-0.229809
-0.137222
-0.232886
-0.152934
-0.23545
-0.169427
-0.237459
-0.238917
-0.00580768
-0.132338
-0.011181
-0.164385
-0.0143208
-0.173999
-0.0198227
-0.187724
-0.0274002
-0.193031
-0.0370421
-0.197671
-0.0474456
-0.200356
-0.0582669
-0.203156
-0.0693119
-0.205798
-0.0807721
-0.208494
-0.0927815
-0.211127
-0.105484
-0.213807
-0.118925
-0.216369
-0.13314
-0.21867
-0.148065
-0.220525
-0.163208
-0.222316
-0.223766
-0.00452915
-0.127809
-0.0093699
-0.159544
-0.0128486
-0.17052
-0.0191686
-0.181404
-0.0273001
-0.1849
-0.0368139
-0.188157
-0.0467651
-0.190405
-0.0570326
-0.192889
-0.0675858
-0.195245
-0.0785953
-0.197485
-0.0901279
-0.199595
-0.102297
-0.201638
-0.115108
-0.203558
-0.128591
-0.205186
-0.142684
-0.206433
-0.157403
-0.207597
-0.207983
-0.00347687
-0.124332
-0.00781483
-0.155206
-0.0119954
-0.16634
-0.0190415
-0.174357
-0.0273684
-0.176573
-0.0364689
-0.179057
-0.0458508
-0.181023
-0.0555619
-0.183178
-0.0656521
-0.185155
-0.0762006
-0.186936
-0.0872336
-0.188562
-0.0988061
-0.190066
-0.11091
-0.191453
-0.123499
-0.192597
-0.13627
-0.193662
-0.14966
-0.194206
-0.193987
-0.00241108
-0.121921
-0.00657875
-0.151039
-0.0116415
-0.161277
-0.0190954
-0.166904
-0.0271872
-0.168481
-0.0357889
-0.170455
-0.0446463
-0.172165
-0.0538968
-0.173927
-0.0635643
-0.175487
-0.0736295
-0.176871
-0.0841179
-0.178073
-0.095053
-0.17913
-0.106463
-0.180044
-0.118138
-0.180922
-0.130093
-0.181707
-0.14225
-0.18205
-0.181928
-0.0017442
-0.120177
-0.00595384
-0.146829
-0.0116871
-0.155544
-0.0191021
-0.159489
-0.0267628
-0.16082
-0.0348672
-0.162351
-0.0432663
-0.163766
-0.0520868
-0.165107
-0.0613076
-0.166267
-0.0708547
-0.167324
-0.0807318
-0.168196
-0.0909699
-0.168892
-0.101525
-0.169489
-0.112373
-0.170074
-0.123647
-0.170433
-0.135226
-0.170471
-0.169847
-0.00135756
-0.118819
-0.00579878
-0.142388
-0.0117399
-0.149603
-0.0188195
-0.152409
-0.0261123
-0.153527
-0.0337665
-0.154697
-0.0417789
-0.155754
-0.0501816
-0.156704
-0.0588654
-0.157583
-0.0678274
-0.158362
-0.0770578
-0.158966
-0.0864973
-0.159453
-0.096135
-0.159851
-0.106068
-0.160141
-0.116299
-0.160202
-0.126837
-0.159934
-0.159255
-0.00133161
-0.117487
-0.00593572
-0.137784
-0.0117873
-0.143751
-0.0184373
-0.145759
-0.0253697
-0.146595
-0.0326341
-0.147432
-0.0402568
-0.148131
-0.0480992
-0.148862
-0.0561931
-0.149489
-0.0645468
-0.150008
-0.0730077
-0.150505
-0.0816486
-0.150812
-0.0905572
-0.150942
-0.0997255
-0.150972
-0.10903
-0.150897
-0.118355
-0.150609
-0.150127
-0.00147663
-0.116011
-0.00615104
-0.133109
-0.0118146
-0.138087
-0.018061
-0.139513
-0.0246611
-0.139995
-0.0314948
-0.140599
-0.0385367
-0.141089
-0.0458012
-0.141597
-0.0532444
-0.142046
-0.0608014
-0.142451
-0.0686061
-0.1427
-0.0766401
-0.142778
-0.084865
-0.142717
-0.0933155
-0.142522
-0.101916
-0.142297
-0.110524
-0.142
-0.141368
-0.00179424
-0.114216
-0.00636932
-0.128534
-0.0118627
-0.132594
-0.0177519
-0.133623
-0.0238627
-0.133884
-0.0301158
-0.134346
-0.0365371
-0.134668
-0.0430802
-0.135054
-0.0498542
-0.135272
-0.0568827
-0.135423
-0.0640822
-0.135501
-0.0713953
-0.135465
-0.0788139
-0.135299
-0.0863036
-0.135032
-0.093873
-0.134728
-0.10151
-0.134364
-0.133845
-0.00226547
-0.111951
-0.00665915
-0.124141
-0.0118325
-0.127421
-0.0171871
-0.128269
-0.0226643
-0.128407
-0.0282728
-0.128737
-0.0341262
-0.128814
-0.0402197
-0.12896
-0.0464891
-0.129002
-0.0528832
-0.129029
-0.0593858
-0.128998
-0.0659387
-0.128912
-0.0725039
-0.128734
-0.0790643
-0.128472
-0.0856032
-0.128189
-0.0921217
-0.127845
-0.127425
-0.00248238
-0.109469
-0.00658363
-0.120039
-0.0112549
-0.122749
-0.0161174
-0.123406
-0.021198
-0.123326
-0.0264675
-0.123468
-0.0318791
-0.123403
-0.0373907
-0.123449
-0.0429909
-0.123402
-0.0486677
-0.123352
-0.0544109
-0.123255
-0.0601944
-0.123128
-0.0659933
-0.122935
-0.0718125
-0.122653
-0.0776419
-0.122359
-0.0834143
-0.122073
-0.12156
-0.00272463
-0.106744
-0.00655496
-0.116209
-0.010876
-0.118428
-0.0153147
-0.118968
-0.0199298
-0.118711
-0.0246206
-0.118777
-0.0293915
-0.118632
-0.0342257
-0.118615
-0.0391169
-0.118511
-0.0440522
-0.118416
-0.049019
-0.118288
-0.0540028
-0.118145
-0.0589757
-0.117962
-0.0639058
-0.117723
-0.0688276
-0.117438
-0.0738261
-0.117074
-0.116674
-0.00262212
-0.104122
-0.00613673
-0.112694
-0.010008
-0.114557
-0.0139934
-0.114982
-0.0180786
-0.114626
-0.0221926
-0.114663
-0.0263494
-0.114475
-0.03055
-0.114414
-0.0347736
-0.114287
-0.039015
-0.114175
-0.0432604
-0.114042
-0.0475013
-0.113904
-0.051713
-0.11375
-0.0558618
-0.113574
-0.0599253
-0.113374
-0.0639048
-0.113095
-0.112772
-0.00245045
-0.101671
-0.00554983
-0.109595
-0.00902372
-0.111083
-0.0125083
-0.111497
-0.0160042
-0.11113
-0.0195362
-0.111131
-0.0230741
-0.110937
-0.0266347
-0.110853
-0.0301909
-0.110731
-0.0337449
-0.110621
-0.0372857
-0.110502
-0.0408118
-0.110378
-0.0443182
-0.110244
-0.047795
-0.110097
-0.0512263
-0.109943
-0.0545607
-0.10976
-0.109431
-0.00215777
-0.0995137
-0.00485255
-0.1069
-0.0078511
-0.108085
-0.0108225
-0.108526
-0.0137496
-0.108203
-0.0167026
-0.108178
-0.0196183
-0.108021
-0.0225276
-0.107944
-0.0254111
-0.107848
-0.0282736
-0.107759
-0.0311075
-0.107668
-0.0339098
-0.107575
-0.0366729
-0.107481
-0.0393841
-0.107386
-0.0420465
-0.10728
-0.044664
-0.107143
-0.106902
-0.00190785
-0.0976058
-0.00422514
-0.104583
-0.0066002
-0.10571
-0.00902822
-0.106098
-0.0113604
-0.105871
-0.0137078
-0.105831
-0.0160118
-0.105717
-0.0182966
-0.105659
-0.0205412
-0.105603
-0.0227424
-0.105557
-0.0248909
-0.105519
-0.0269797
-0.105486
-0.0290054
-0.105455
-0.0309606
-0.105431
-0.0328343
-0.105407
-0.0345954
-0.105382
-0.105285
-0.00142351
-0.0961823
-0.00330955
-0.102697
-0.00513785
-0.103881
-0.00703536
-0.104201
-0.00882381
-0.104083
-0.0105868
-0.104068
-0.0122773
-0.104027
-0.0139141
-0.104022
-0.0154909
-0.104026
-0.0170128
-0.104036
-0.0184826
-0.104049
-0.0199019
-0.104067
-0.0212709
-0.104086
-0.0225897
-0.104112
-0.0238593
-0.104137
-0.0250524
-0.104189
-0.104165
-0.00079666
-0.0953856
-0.0021671
-0.101326
-0.00339163
-0.102657
-0.00469018
-0.102902
-0.00585476
-0.102918
-0.00699236
-0.10293
-0.00806008
-0.102959
-0.00907274
-0.10301
-0.0100263
-0.103073
-0.0109187
-0.103143
-0.0117493
-0.103219
-0.0125176
-0.103299
-0.0132227
-0.103381
-0.013869
-0.103466
-0.0144636
-0.103542
-0.0150283
-0.103624
-0.103651
-0.00031262
-0.095073
-0.00117107
-0.100468
-0.00186703
-0.101961
-0.00260774
-0.102161
-0.00322846
-0.102297
-0.00379075
-0.102368
-0.00427522
-0.102475
-0.00468518
-0.1026
-0.00502266
-0.102735
-0.00528698
-0.102879
-0.00547775
-0.103028
-0.00559335
-0.103183
-0.0056244
-0.10335
-0.00556352
-0.103527
-0.00539217
-0.103714
-0.00512255
-0.103894
-0.104133
0.00019748
-0.0952705
-0.000153049
-0.100117
-0.000292257
-0.101822
-0.000435315
-0.102018
-0.000479766
-0.102253
-0.000447174
-0.1024
-0.000335036
-0.102587
-0.000140032
-0.102795
0.000136604
-0.103012
0.00049423
-0.103236
0.000931543
-0.103465
0.00144434
-0.103696
0.00202663
-0.103932
0.00265772
-0.104158
0.00334772
-0.104404
0.00413171
-0.104678
-0.10512
0.000770848
-0.0960414
0.000990887
-0.100337
0.00143625
-0.102267
0.00188684
-0.102469
0.00242755
-0.102794
0.00305222
-0.103025
0.0037556
-0.10329
0.00454314
-0.103582
0.00541474
-0.103884
0.00637192
-0.104194
0.0074186
-0.104512
0.00855948
-0.104837
0.00979701
-0.10517
0.0111325
-0.105493
0.0125664
-0.105838
0.0139959
-0.106107
-0.106382
0.00132994
-0.0973713
0.0021787
-0.101186
0.0031926
-0.103281
0.00423783
-0.103514
0.00535482
-0.10391
0.0065599
-0.10423
0.00784307
-0.104573
0.00920964
-0.104949
0.0106606
-0.105335
0.012196
-0.105729
0.013817
-0.106133
0.0155243
-0.106544
0.0173246
-0.10697
0.0192409
-0.107409
0.0213017
-0.107898
0.0235219
-0.108327
-0.108911
0.00191877
-0.0992901
0.00342556
-0.102693
0.00500555
-0.104861
0.00662544
-0.105134
0.0082999
-0.105585
0.0100621
-0.105992
0.011904
-0.106415
0.0138304
-0.106875
0.0158454
-0.10735
0.0179511
-0.107835
0.0201499
-0.108332
0.0224419
-0.108836
0.0248236
-0.109351
0.027279
-0.109865
0.029785
-0.110404
0.0324015
-0.110944
-0.111853
0.00242767
-0.101718
0.00469514
-0.10496
0.00681531
-0.106981
0.00899812
-0.107317
0.0112225
-0.107809
0.013527
-0.108297
0.0159119
-0.1088
0.0183816
-0.109345
0.0209409
-0.109909
0.0235928
-0.110487
0.0263422
-0.111081
0.0291979
-0.111692
0.03217
-0.112324
0.0352633
-0.112958
0.0384745
-0.113616
0.0417275
-0.114197
-0.114787
0.00292785
-0.104646
0.00579798
-0.107831
0.00848142
-0.109664
0.0112904
-0.110126
0.0140779
-0.110597
0.0169359
-0.111155
0.0198636
-0.111728
0.0228666
-0.112348
0.0259574
-0.113
0.0291419
-0.113671
0.0324237
-0.114363
0.035807
-0.115075
0.0392966
-0.115813
0.042914
-0.116576
0.0467106
-0.117412
0.0507284
-0.118215
-0.119107
0.00344285
-0.108088
0.00687111
-0.111259
0.0101187
-0.112912
0.013474
-0.113481
0.0168503
-0.113973
0.020269
-0.114573
0.0237432
-0.115202
0.0272739
-0.115879
0.0308837
-0.116609
0.0345863
-0.117374
0.0383918
-0.118169
0.042307
-0.11899
0.0463348
-0.119841
0.0504702
-0.120711
0.0546767
-0.121619
0.0589896
-0.122527
-0.123972
0.00397758
-0.112066
0.00795875
-0.11524
0.0117804
-0.116734
0.0156548
-0.117355
0.0195574
-0.117876
0.0235034
-0.118519
0.0275121
-0.119211
0.0315801
-0.119947
0.0357028
-0.120732
0.039913
-0.121584
0.0442228
-0.122478
0.0486456
-0.123413
0.0531979
-0.124393
0.0578961
-0.125409
0.0627434
-0.126466
0.0677051
-0.127489
-0.128468
0.00453544
-0.116601
0.00905234
-0.119757
0.0133984
-0.12108
0.0177945
-0.121751
0.0222207
-0.122302
0.026682
-0.122981
0.0311955
-0.123724
0.0357685
-0.12452
0.0404116
-0.125375
0.0451231
-0.126296
0.0499314
-0.127287
0.0548478
-0.128329
0.0598826
-0.129428
0.0650539
-0.130581
0.070424
-0.131836
0.0760599
-0.133125
-0.134397
0.00507982
-0.121681
0.0101268
-0.124804
0.0150061
-0.125959
0.0199056
-0.126651
0.0248407
-0.127237
0.0298087
-0.127949
0.0348212
-0.128737
0.0398876
-0.129586
0.045017
-0.130504
0.050223
-0.131502
0.0555206
-0.132584
0.0609259
-0.133735
0.0664522
-0.134954
0.0721087
-0.136237
0.0778672
-0.137595
0.0837239
-0.138982
-0.14107
0.00561457
-0.127296
0.0111641
-0.130353
0.0165758
-0.131371
0.021986
-0.132061
0.0274253
-0.132676
0.0328899
-0.133413
0.0383908
-0.134238
0.04394
-0.135136
0.0495453
-0.13611
0.0552333
-0.13719
0.0610042
-0.138355
0.0668764
-0.139607
0.072872
-0.14095
0.0790202
-0.142385
0.0853358
-0.14391
0.0918309
-0.145477
-0.146996
0.00615999
-0.133456
0.0122006
-0.136394
0.0181249
-0.137295
0.0240367
-0.137973
0.0299704
-0.13861
0.0359239
-0.139367
0.0419078
-0.140221
0.0479289
-0.141157
0.0540163
-0.142197
0.0601693
-0.143343
0.0663995
-0.144586
0.0727237
-0.145931
0.0791604
-0.147387
0.0857296
-0.148954
0.0924985
-0.150679
0.0995699
-0.152548
-0.154315
0.00669905
-0.140155
0.013225
-0.14292
0.0196491
-0.143719
0.0260569
-0.144381
0.0324817
-0.145035
0.0389212
-0.145806
0.0453784
-0.146679
0.0518761
-0.147654
0.0584265
-0.148747
0.0650311
-0.149947
0.0717058
-0.15126
0.0784691
-0.152694
0.0853416
-0.154259
0.0923422
-0.155955
0.0994649
-0.157802
0.10666
-0.159743
-0.162576
0.00723665
-0.147392
0.0142437
-0.149927
0.021163
-0.150638
0.0280602
-0.151278
0.0349645
-0.151939
0.041874
-0.152716
0.0487986
-0.153603
0.0557626
-0.154618
0.0627603
-0.155745
0.069805
-0.156992
0.0769115
-0.158367
0.0840981
-0.159881
0.0913874
-0.161548
0.0988135
-0.163381
0.106404
-0.165393
0.114202
-0.167541
-0.169744
0.00778602
-0.155178
0.0152618
-0.157403
0.0226518
-0.158028
0.0300158
-0.158642
0.0373863
-0.15931
0.0447579
-0.160088
0.0521556
-0.161001
0.0595664
-0.162029
0.0670024
-0.163181
0.0744771
-0.164466
0.0820059
-0.165896
0.0896066
-0.167482
0.0972983
-0.16924
0.105101
-0.171184
0.113077
-0.173368
0.121366
-0.17583
-0.178194
0.00831047
-0.163488
0.0162465
-0.165339
0.024105
-0.165887
0.0319403
-0.166477
0.0397782
-0.167147
0.0476254
-0.167935
0.0554669
-0.168842
0.0633137
-0.169876
0.0711773
-0.171045
0.079071
-0.17236
0.0870095
-0.173834
0.0950119
-0.175484
0.103097
-0.177325
0.111287
-0.179374
0.11958
-0.181662
0.127884
-0.184133
-0.187737
0.00883968
-0.172328
0.0172426
-0.173742
0.0255976
-0.174242
0.0339173
-0.174797
0.0422189
-0.175449
0.050506
-0.176222
0.058782
-0.177119
0.0670549
-0.178149
0.0753344
-0.179324
0.0836325
-0.180658
0.0919637
-0.182165
0.100346
-0.183867
0.108799
-0.185778
0.117361
-0.187935
0.126042
-0.190343
0.134918
-0.193009
-0.195874
0.009384
-0.181712
0.0182793
-0.182637
0.027088
-0.183051
0.0358578
-0.183567
0.0446042
-0.184195
0.0533269
-0.184944
0.062029
-0.185821
0.0707173
-0.186837
0.0794011
-0.188008
0.0880918
-0.189349
0.0968039
-0.190878
0.105554
-0.192617
0.114363
-0.194586
0.123251
-0.196824
0.132251
-0.199343
0.141569
-0.202327
-0.205135
0.00975459
0.0190603
0.0283114
0.0375143
0.0466756
0.0558039
0.0649107
0.0740053
0.0830958
0.0921903
0.1013
0.110441
0.11963
0.128876
0.138193
0.147511
0.21344
-0.396929
-0.22063
0.206563
-0.419931
0.2013
-0.440383
0.198742
-0.460025
0.196569
-0.473443
0.189051
-0.466235
0.166959
-0.411749
0.12936
-0.297891
0.0820925
-0.134202
0.0341996
0.0461722
-0.0157811
0.129644
-0.0697091
-0.0188941
-0.119742
-0.226655
-0.154724
-0.385423
-0.171878
-0.461419
-0.181011
-0.473807
-0.188084
-0.459707
-0.196376
-0.438355
-0.205413
-0.416681
-0.393087
-0.214123
0.216297
-0.390212
-0.223013
0.210221
-0.413856
0.206532
-0.436694
0.205418
-0.45891
0.202621
-0.470647
0.191803
-0.455416
0.16501
-0.384956
0.123388
-0.256269
0.076
-0.0868138
0.0308996
0.0912726
-0.0137975
0.174341
-0.0641901
0.0314985
-0.115195
-0.17565
-0.154793
-0.345825
-0.175359
-0.440853
-0.185526
-0.463639
-0.191866
-0.453367
-0.199234
-0.430987
-0.207766
-0.408149
-0.384649
-0.216205
0.218739
-0.383892
-0.22506
0.213592
-0.408709
0.21127
-0.434372
0.210371
-0.458012
0.205119
-0.465394
0.187808
-0.438105
0.15441
-0.351559
0.110784
-0.212642
0.0651265
-0.0411565
0.0246692
0.13173
-0.0126469
0.211657
-0.0578182
0.0766698
-0.108522
-0.124946
-0.152152
-0.302195
-0.177243
-0.415763
-0.188754
-0.452128
-0.195342
-0.44678
-0.201898
-0.424431
-0.209848
-0.400199
-0.376457
-0.218039
0.220936
-0.377947
-0.226881
0.216793
-0.404565
0.215284
-0.432863
0.212429
-0.455157
0.203165
-0.456129
0.177522
-0.412462
0.136559
-0.310595
0.0917102
-0.167794
0.0503701
0.000183697
0.0167581
0.165342
-0.0121107
0.240526
-0.04969
0.114249
-0.0976268
-0.0770091
-0.144869
-0.254953
-0.176761
-0.383871
-0.190895
-0.437994
-0.198563
-0.439111
-0.204496
-0.418499
-0.211812
-0.392882
-0.368489
-0.21978
0.2228
-0.372398
-0.228349
0.219496
-0.401262
0.217611
-0.430978
0.211104
-0.44865
0.194146
-0.439171
0.158184
-0.3765
0.112869
-0.26528
0.0695726
-0.124498
0.0341163
0.0356399
0.00805868
0.1914
-0.0119791
0.260564
-0.0411755
0.143446
-0.0840005
-0.0341841
-0.132257
-0.206696
-0.171509
-0.344619
-0.191085
-0.418418
-0.200972
-0.429224
-0.206831
-0.41264
-0.213567
-0.386146
-0.360743
-0.221313
0.224304
-0.367262
-0.22944
0.221314
-0.398272
0.216698
-0.426361
0.205153
-0.437105
0.177583
-0.411602
0.132582
-0.331498
0.0855441
-0.218243
0.0462787
-0.0852326
0.0176425
0.0642762
-0.000771518
0.209814
-0.0119231
0.271716
-0.0321755
0.163698
-0.0681558
0.00179621
-0.115698
-0.159154
-0.161613
-0.298703
-0.188731
-0.3913
-0.201546
-0.416409
-0.208746
-0.40544
-0.215113
-0.37978
-0.353253
-0.222603
0.225315
-0.36245
-0.230126
0.221551
-0.394509
0.212802
-0.417612
0.193479
-0.417781
0.153096
-0.371219
0.103003
-0.281405
0.0582438
-0.173483
0.02437
-0.0513589
0.00183975
0.0868064
-0.009078
0.220731
-0.0118922
0.27453
-0.0235838
0.175389
-0.0516015
0.0298139
-0.0954244
-0.115332
-0.145506
-0.248622
-0.182932
-0.353874
-0.200341
-0.399
-0.209996
-0.395785
-0.216408
-0.373368
-0.34605
-0.223611
0.225597
-0.357622
-0.230425
0.218966
-0.387877
0.204817
-0.403464
0.173374
-0.386337
0.123039
-0.320884
0.0732377
-0.231605
0.0335647
-0.13381
0.00496496
-0.0227591
-0.0124807
0.104252
-0.0163197
0.22457
-0.0116674
0.269878
-0.0158406
0.179563
-0.0360949
0.0500682
-0.0737222
-0.0777043
-0.124082
-0.198263
-0.171376
-0.30658
-0.196908
-0.373468
-0.209825
-0.382867
-0.217347
-0.365846
-0.339051
-0.224346
0.224522
-0.35181
-0.230334
0.21392
-0.377275
0.190745
-0.38029
0.145103
-0.340695
0.091463
-0.267244
0.046445
-0.186587
0.0123862
-0.0997517
-0.0119786
0.0016057
-0.0249215
0.117195
-0.0225439
0.222193
-0.011209
0.258543
-0.00918995
0.177544
-0.0226212
0.0634994
-0.0528369
-0.0474885
-0.0993039
-0.151796
-0.152545
-0.253338
-0.189979
-0.336034
-0.207612
-0.365234
-0.217749
-0.355709
-0.33194
-0.22486
0.221442
-0.34348
-0.229772
0.204263
-0.360096
0.166982
-0.343008
0.11239
-0.286103
0.062212
-0.217066
0.0235776
-0.147952
-0.00601505
-0.070159
-0.0269277
0.0225183
-0.0355185
0.125786
-0.0276837
0.214358
-0.0109265
0.241785
-0.00372682
0.170344
-0.0115689
0.0713415
-0.0346737
-0.0243838
-0.0741234
-0.112346
-0.127474
-0.199987
-0.177183
-0.286326
-0.203606
-0.338811
-0.217007
-0.342308
-0.323775
-0.225172
0.215485
-0.330905
-0.22806
0.18663
-0.331241
0.13531
-0.291688
0.0805403
-0.231334
0.0369798
-0.173505
0.00359705
-0.114569
-0.0226406
-0.0439214
-0.0400558
0.0399336
-0.0441682
0.129898
-0.0314583
0.201648
-0.0108022
0.221129
0.000651151
0.158891
-0.00269914
0.0746918
-0.0198093
-0.00727359
-0.0510138
-0.0811415
-0.0988955
-0.152106
-0.155297
-0.229925
-0.195536
-0.298571
-0.214593
-0.323251
-0.313185
-0.225183
0.20294
-0.308601
-0.225244
0.157994
-0.286295
0.101197
-0.234891
0.0520907
-0.182227
0.0150576
-0.136472
-0.0147258
-0.084786
-0.0378675
-0.0207796
-0.051292
0.053358
-0.0506479
0.129254
-0.0338759
0.184876
-0.0103079
0.197561
0.00427767
0.144305
0.00456129
0.0744082
-0.00787424
0.00516193
-0.0319973
-0.0570184
-0.0707186
-0.113384
-0.125795
-0.174849
-0.179751
-0.244614
-0.210142
-0.292861
-0.299028
-0.224299
0.178681
-0.271547
-0.215735
0.12349
-0.231104
0.068848
-0.180249
0.0273769
-0.140756
-0.00506408
-0.104031
-0.0319685
-0.0578816
-0.0515433
-0.00120476
-0.0603683
0.062183
-0.0545657
0.123451
-0.0347051
0.165015
-0.0087679
0.171624
0.00781867
0.127719
0.0110435
0.0711834
0.00228001
0.0139254
-0.0164479
-0.0382905
-0.0462186
-0.0836135
-0.0923929
-0.128674
-0.151547
-0.18546
-0.199028
-0.24538
-0.275636
-0.22242
0.145796
-0.219257
-0.198086
0.0868063
-0.172114
0.039874
-0.133317
0.00520405
-0.106086
-0.0239738
-0.0748533
-0.0476433
-0.0342121
-0.0630493
0.0142013
-0.066629
0.0657628
-0.0558355
0.112658
-0.033425
0.142605
-0.00592752
0.144127
0.011895
0.109896
0.0174703
0.065608
0.0116579
0.0197377
-0.0032421
-0.0233905
-0.0263896
-0.060466
-0.061932
-0.0931319
-0.115101
-0.132291
-0.17454
-0.185941
-0.234696
-0.21548
0.103565
-0.158482
-0.16434
0.0518194
-0.120368
0.0151246
-0.0966223
-0.0149018
-0.0760601
-0.0410655
-0.0486895
-0.0608623
-0.0144153
-0.0711865
0.0245254
-0.0692966
0.0638729
-0.0543793
0.0977405
-0.0296574
0.117883
-0.00184228
0.116311
0.0167871
0.0912667
0.0242917
0.0581034
0.021193
0.0228364
0.00920572
-0.0114032
-0.00966574
-0.0415945
-0.0360546
-0.066743
-0.0772559
-0.0910901
-0.135937
-0.12726
-0.175579
-0.195054
0.0624077
-0.102433
-0.118457
0.0236272
-0.0815874
-0.00607411
-0.0669209
-0.0328778
-0.0492564
-0.055152
-0.0264154
-0.070032
0.000464637
-0.074738
0.0292315
-0.0677961
0.056931
-0.0496815
0.0796259
-0.0235904
0.0917919
0.0034882
0.0892328
0.0224642
0.0722907
0.0315612
0.0490065
0.0310524
0.0233452
0.0216454
-0.00199619
0.00567723
-0.0256264
-0.0153534
-0.0457124
-0.0441554
-0.0622881
-0.0898716
-0.0815442
-0.113359
-0.152091
0.0291104
-0.0613775
-0.0701657
-4.33112e-05
-0.0524337
-0.0256471
-0.0413171
-0.0481069
-0.0267966
-0.0649934
-0.00952888
-0.0737624
0.00923362
-0.0728553
0.0283243
-0.061874
0.0459497
-0.0417111
0.059463
-0.0158684
0.0659492
0.00965414
0.0637103
0.0285239
0.0534208
0.0389218
0.0386086
0.0407117
0.0215553
0.034454
0.00426154
0.021494
-0.0126664
0.00376146
-0.0279799
-0.0178325
-0.0406941
-0.0477485
-0.0516281
-0.0649768
-0.0961309
0.000491544
-0.0324059
-0.0294631
-0.0234589
-0.0284832
-0.0438201
-0.020956
-0.0596826
-0.010934
-0.0693535
0.000142048
-0.0717255
0.0116055
-0.0660459
0.0226448
-0.0522634
0.0321672
-0.0316752
0.0388749
-0.00749977
0.0417737
0.015862
0.0403486
0.0342584
0.0350245
0.0458766
0.0269903
0.0501915
0.0172405
0.0477085
0.00674455
0.0386602
-0.00361815
0.0244416
-0.0137613
0.00656523
-0.0228178
-0.0152761
-0.0297868
-0.0345594
-0.0456935
-0.0269912
-0.0133677
0.00795297
-0.0440949
-0.0113795
-0.0578667
-0.0071842
-0.0667312
-0.00206949
-0.069684
0.00309485
-0.0662809
0.00820245
-0.0568333
0.0131972
-0.0415337
0.0168676
-0.0216919
0.0190332
0.000322638
0.0197592
0.0215186
0.0191526
0.0392014
0.0173417
0.0518559
0.0143358
0.0589064
0.01019
0.0602986
0.00535238
0.056104
0.000576438
0.0463611
-0.00401847
0.0323647
-0.00882129
0.0155421
-0.0129642
-0.0137244
-0.00529285
-0.0520488
0.0386812
-0.0634284
-0.0706126
-0.0726821
-0.0695872
-0.0613848
-0.0481876
-0.03132
-0.0122869
0.0074723
0.0266249
0.0439666
0.0583024
0.0684924
0.0738448
0.0744212
0.0704027
0.0615815
0.0486173
0.0348928
0.0182233
0.0166696
0.0233667
-0.0104363
0.0414055
-0.0637323
0.0825736
-0.137299
0.12817
-0.197688
0.16179
-0.228673
0.183179
-0.236868
0.199742
-0.238983
0.214964
-0.23952
0.229417
-0.239636
0.243833
-0.239588
0.258353
-0.23938
0.272929
-0.238922
0.287463
-0.238145
0.301906
-0.237046
0.316267
-0.235674
0.330598
-0.234111
0.344974
-0.232415
0.359478
-0.230709
-0.228811
0.0051716
0.011498
0.0148196
-0.0200843
0.0472301
-0.0961428
0.0918736
-0.181942
0.128925
-0.23474
0.151101
-0.25085
0.167612
-0.253379
0.182577
-0.253949
0.196849
-0.253792
0.210777
-0.253564
0.224537
-0.253348
0.238135
-0.252978
0.251533
-0.25232
0.264736
-0.251347
0.277806
-0.250116
0.290835
-0.248703
0.303909
-0.247186
0.317093
-0.245598
0.330427
-0.244044
-0.242307
1.2113e-05
0.0114859
0.0152787
-0.035351
0.0543571
-0.135221
0.0956735
-0.223259
0.122134
-0.261201
0.138653
-0.267368
0.153358
-0.268084
0.16662
-0.267211
0.179326
-0.266498
0.191859
-0.266097
0.204235
-0.265724
0.216389
-0.265132
0.228316
-0.264247
0.240084
-0.263115
0.251782
-0.261815
0.26349
-0.260412
0.275267
-0.258963
0.287148
-0.257479
0.299162
-0.256059
-0.254467
-0.00105563
0.0125415
0.0196787
-0.0560853
0.0598195
-0.175362
0.0940554
-0.257495
0.112699
-0.279844
0.12684
-0.28151
0.138933
-0.280177
0.150347
-0.278625
0.161584
-0.277735
0.172669
-0.277182
0.18349
-0.276545
0.194022
-0.275664
0.204336
-0.274561
0.214532
-0.273311
0.224696
-0.271978
0.234888
-0.270604
0.245152
-0.269227
0.255518
-0.267845
0.266011
-0.266552
-0.265092
-0.000139498
0.012681
0.0248749
-0.0810997
0.0628397
-0.213327
0.0887362
-0.283391
0.102786
-0.293893
0.114405
-0.293129
0.124486
-0.290257
0.134246
-0.288385
0.143875
-0.287364
0.153223
-0.286529
0.162229
-0.285552
0.170964
-0.284399
0.179536
-0.283133
0.188034
-0.281809
0.196521
-0.280466
0.205048
-0.279131
0.213649
-0.277827
0.222355
-0.276551
0.231186
-0.275382
-0.274036
0.00136828
0.0113127
0.0291828
-0.108914
0.0632782
-0.247422
0.0820023
-0.302115
0.0932637
-0.305154
0.102051
-0.301916
0.110234
-0.298441
0.118258
-0.296409
0.126026
-0.295133
0.133429
-0.293932
0.140509
-0.292631
0.147372
-0.291262
0.154111
-0.289873
0.160794
-0.288492
0.167472
-0.287144
0.174189
-0.285848
0.180974
-0.284612
0.187868
-0.283446
0.194868
-0.282382
-0.28113
0.00332785
0.00798486
0.0330166
-0.138603
0.0621793
-0.276585
0.0749984
-0.314934
0.0834469
-0.313603
0.0899164
-0.308385
0.0961773
-0.304702
0.10228
-0.302511
0.108025
-0.300878
0.113391
-0.299299
0.118483
-0.297723
0.123399
-0.296178
0.128208
-0.294681
0.132964
-0.293248
0.137714
-0.291894
0.142493
-0.290627
0.147327
-0.289446
0.152261
-0.28838
0.157245
-0.287366
-0.286193
0.00613163
0.00185323
0.0361863
-0.168658
0.05954
-0.299938
0.0679143
-0.323309
0.0736614
-0.31935
0.0780182
-0.312742
0.0822875
-0.308971
0.0863097
-0.306534
0.0899374
-0.304505
0.0932225
-0.302584
0.0962784
-0.300779
0.0991805
-0.29908
0.101982
-0.297483
0.10473
-0.295995
0.10746
-0.294624
0.110198
-0.293365
0.112974
-0.292222
0.115816
-0.291223
0.118637
-0.290186
-0.289102
0.00876876
-0.00691552
0.0386606
-0.19855
0.0559125
-0.31719
0.0611579
-0.328554
0.0640643
-0.322257
0.0663505
-0.315028
0.0685471
-0.311168
0.0703888
-0.308375
0.0718564
-0.305973
0.0730373
-0.303765
0.0740223
-0.301764
0.0748667
-0.299925
0.0756143
-0.298231
0.0763013
-0.296682
0.0769525
-0.295275
0.0775855
-0.293998
0.0782307
-0.292867
0.0788761
-0.291868
0.0794579
-0.290768
-0.289827
0.0115922
-0.0185078
0.0403684
-0.227326
0.0520468
-0.328869
0.0545089
-0.331016
0.0547351
-0.322483
0.054921
-0.315214
0.0549496
-0.311196
0.0545745
-0.308
0.0538761
-0.305275
0.0529445
-0.302833
0.0518422
-0.300662
0.0506121
-0.298695
0.0492894
-0.296908
0.0478992
-0.295292
0.0464564
-0.293832
0.0449767
-0.292519
0.0434707
-0.291361
0.0418775
-0.290275
0.0402038
-0.289094
-0.288303
0.0151831
-0.0336908
0.0416
-0.253743
0.0481742
-0.335443
0.0477784
-0.33062
0.0456603
-0.320365
0.0437087
-0.313263
0.0415099
-0.308997
0.0389327
-0.305423
0.0360846
-0.302426
0.0330484
-0.299797
0.0298656
-0.297479
0.0265715
-0.2954
0.0231908
-0.293528
0.0197389
-0.29184
0.0162255
-0.290319
0.0126642
-0.288957
0.00904329
-0.28774
0.00533324
-0.286565
0.00163697
-0.285398
-0.284524
0.0198251
-0.0535159
0.0426255
-0.276543
0.0443478
-0.337165
0.0411375
-0.32741
0.0368352
-0.316062
0.0327164
-0.309144
0.0282743
-0.304555
0.0235295
-0.300678
0.0185617
-0.297459
0.0134477
-0.294683
0.00821515
-0.292246
0.00289139
-0.290077
-0.00250867
-0.288128
-0.00797739
-0.286371
-0.0135078
-0.284788
-0.0190982
-0.283367
-0.0247721
-0.282066
-0.0305296
-0.280807
-0.0363033
-0.279624
-0.278621
0.0255668
-0.0790827
0.043339
-0.294315
0.040712
-0.334538
0.0346912
-0.321389
0.0282709
-0.309642
0.0219515
-0.302824
0.0152859
-0.29789
0.00841896
-0.293811
0.00137936
-0.290419
-0.00576684
-0.287537
-0.0129986
-0.285015
-0.020297
-0.282778
-0.0276543
-0.28077
-0.0350683
-0.278957
-0.0425371
-0.27732
-0.0500685
-0.275836
-0.0576801
-0.274454
-0.0653565
-0.273131
-0.0730791
-0.271902
-0.270742
0.0311259
-0.110209
0.0431574
-0.306347
0.0371937
-0.328575
0.0284482
-0.312644
0.0199097
-0.301104
0.0114023
-0.294317
0.00257883
-0.289066
-0.00635283
-0.28488
-0.0154014
-0.28137
-0.0245153
-0.278423
-0.0336764
-0.275854
-0.0428745
-0.27358
-0.0521073
-0.271537
-0.0613768
-0.269688
-0.0706872
-0.268009
-0.0800489
-0.266474
-0.0894704
-0.265033
-0.0989379
-0.263663
-0.108459
-0.262381
-0.261086
0.0357968
-0.146005
0.0421117
-0.312662
0.0333044
-0.319767
0.0223203
-0.30166
0.0116903
-0.290474
0.0010728
-0.2837
-0.00981638
-0.278177
-0.0207446
-0.273951
-0.0317217
-0.270393
-0.0427207
-0.267424
-0.0537278
-0.264846
-0.0647379
-0.26257
-0.0757527
-0.260523
-0.0867776
-0.258663
-0.0978213
-0.256966
-0.108894
-0.255401
-0.119997
-0.25393
-0.131121
-0.252539
-0.142287
-0.251215
-0.249841
0.0400266
-0.186032
0.0408209
-0.313456
0.0292277
-0.308174
0.0163733
-0.288805
0.00363903
-0.277739
-0.00901856
-0.271042
-0.0218763
-0.265319
-0.0347148
-0.261113
-0.0475321
-0.257576
-0.0603211
-0.254635
-0.0730776
-0.25209
-0.0858018
-0.249846
-0.0984983
-0.247826
-0.111175
-0.245986
-0.123842
-0.244298
-0.13651
-0.242733
-0.149175
-0.241265
-0.161833
-0.239881
-0.174496
-0.238552
-0.237159
0.0453911
-0.231423
0.03949
-0.307555
0.0253071
-0.293991
0.0107023
-0.274201
-0.00416898
-0.262868
-0.0189085
-0.256302
-0.0336139
-0.250614
-0.0482513
-0.246475
-0.0627977
-0.24303
-0.0772671
-0.240166
-0.0916644
-0.237693
-0.105998
-0.235512
-0.120272
-0.233552
-0.134496
-0.231762
-0.148684
-0.230111
-0.162834
-0.228583
-0.176951
-0.227147
-0.191035
-0.225798
-0.205094
-0.224493
-0.223134
0.0493766
-0.2808
0.0389212
-0.297099
0.0216155
-0.276686
0.00487916
-0.257464
-0.0122625
-0.245726
-0.0288688
-0.239696
-0.0453485
-0.234134
-0.0616298
-0.230194
-0.0777474
-0.226912
-0.0937379
-0.224175
-0.109628
-0.221803
-0.12542
-0.21972
-0.141122
-0.217851
-0.156741
-0.216143
-0.17229
-0.214562
-0.187802
-0.213071
-0.203271
-0.211678
-0.218694
-0.210375
-0.23406
-0.209127
-0.207844
0.0535417
-0.334342
0.0405129
-0.28407
0.0164934
-0.252666
-0.00197416
-0.238997
-0.0207161
-0.226984
-0.0390625
-0.22135
-0.0569131
-0.216284
-0.0746067
-0.2125
-0.0921191
-0.2094
-0.109479
-0.206815
-0.126686
-0.204596
-0.143792
-0.202614
-0.160811
-0.200832
-0.177751
-0.199203
-0.194618
-0.197694
-0.211404
-0.196285
-0.228119
-0.194964
-0.244766
-0.193727
-0.261354
-0.192539
-0.191346
0.0658121
-0.400154
0.0405518
-0.25881
0.0128942
-0.225008
-0.00932504
-0.216777
-0.0290984
-0.207211
-0.0488524
-0.201596
-0.0679774
-0.197159
-0.0868094
-0.193668
-0.105449
-0.19076
-0.12398
-0.188285
-0.142428
-0.186148
-0.160792
-0.18425
-0.179073
-0.18255
-0.197267
-0.181009
-0.215371
-0.17959
-0.233384
-0.178272
-0.251308
-0.177039
-0.269153
-0.175882
-0.286916
-0.174776
-0.173679
-0.291429
-0.0823802
0.373809
-0.23664
-0.0547888
-0.193317
-0.0433234
-0.157564
-0.0357531
-0.125787
-0.0317766
-0.0964977
-0.0292894
-0.0696271
-0.0268706
-0.0443547
-0.0252724
-0.0202261
-0.0241286
0.00290381
-0.0231299
0.0261735
-0.0232696
0.0505755
-0.0244021
0.0762923
-0.0257168
0.103831
-0.0275385
0.133853
-0.0300225
0.166683
-0.0328301
0.203928
-0.0372444
0.249781
-0.0458532
0.309182
-0.0594015
-0.0909713
-0.244709
-0.0974579
0.259787
-0.217441
-0.0820573
-0.189555
-0.0712088
-0.160986
-0.0643224
-0.132669
-0.0600936
-0.105003
-0.0569554
-0.0778662
-0.0540073
-0.0510523
-0.0520863
-0.0243488
-0.050832
0.00253113
-0.0500099
0.0294155
-0.050154
0.056213
-0.0511996
0.0831804
-0.0526842
0.110525
-0.0548833
0.13866
-0.0581573
0.167235
-0.0614049
0.196083
-0.0660927
0.224098
-0.0738679
0.250069
-0.0853723
-0.0997126
-0.215754
-0.10264
0.220937
-0.200135
-0.0976759
-0.179132
-0.0922125
-0.155189
-0.0882655
-0.129873
-0.0854093
-0.104412
-0.0824169
-0.0782642
-0.0801547
-0.0517567
-0.0785938
-0.0249993
-0.0775895
0.00204559
-0.0770547
0.0290861
-0.0771945
0.0558765
-0.07799
0.0824539
-0.0792617
0.10869
-0.0811191
0.134251
-0.0837187
0.159643
-0.0867969
0.18356
-0.0900097
0.204035
-0.0943428
0.219071
-0.100409
-0.10565
-0.202667
-0.115188
0.215215
-0.187572
-0.112771
-0.168829
-0.110955
-0.147612
-0.109483
-0.12501
-0.108011
-0.101101
-0.106325
-0.0762123
-0.105044
-0.0506602
-0.104146
-0.0246629
-0.103587
0.0016239
-0.103342
0.0279044
-0.103475
0.0538965
-0.103982
0.07944
-0.104805
0.104295
-0.105974
0.128107
-0.107531
0.150778
-0.109469
0.171796
-0.111027
0.190216
-0.112763
0.204869
-0.115062
-0.117558
-0.194155
-0.127452
0.206419
-0.178983
-0.127943
-0.16117
-0.128768
-0.141298
-0.129355
-0.120092
-0.129217
-0.0974195
-0.128998
-0.0736513
-0.128812
-0.0491046
-0.128693
-0.0240451
-0.128646
0.00128967
-0.128676
0.0266167
-0.128802
0.0516562
-0.129022
0.0761681
-0.129317
0.0998799
-0.129686
0.122468
-0.130118
0.143577
-0.130578
0.163326
-0.130776
0.180921
-0.130358
0.19556
-0.1297
-0.129209
-0.187815
-0.140019
0.200382
-0.172634
-0.143123
-0.155331
-0.146072
-0.136464
-0.148222
-0.115996
-0.149686
-0.0941722
-0.150821
-0.0712847
-0.151699
-0.0476121
-0.152365
-0.0234199
-0.152838
0.00103493
-0.153131
0.0254812
-0.153248
0.0496481
-0.153188
0.0732769
-0.152946
0.0960975
-0.152506
0.117824
-0.151845
0.138155
-0.15091
0.156986
-0.149606
0.174115
-0.147487
0.189091
-0.144677
-0.141714
-0.183121
-0.153146
0.196247
-0.167942
-0.158302
-0.151002
-0.163012
-0.132572
-0.166651
-0.112644
-0.169615
-0.0914557
-0.172009
-0.069259
-0.173896
-0.0463086
-0.175316
-0.0228572
-0.17629
0.000842855
-0.176831
0.0245343
-0.17694
0.0479601
-0.176614
0.0708669
-0.175853
0.0930004
-0.17464
0.114106
-0.17295
0.133932
-0.170736
0.152255
-0.16793
0.169149
-0.164381
0.1842
-0.159727
-0.154672
-0.179532
-0.166522
0.192909
-0.164327
-0.173507
-0.147654
-0.179685
-0.12947
-0.184835
-0.109924
-0.189161
-0.0892168
-0.192717
-0.0675674
-0.195546
-0.0452066
-0.197676
-0.0223712
-0.199125
0.000698772
-0.199901
0.0237606
-0.200002
0.0465718
-0.199425
0.068892
-0.198173
0.0904844
-0.196232
0.111118
-0.193584
0.130578
-0.190195
0.148667
-0.186019
0.165285
-0.181
0.180392
-0.174834
-0.167949
-0.176605
-0.180036
0.190118
-0.161481
-0.188631
-0.144913
-0.196253
-0.12693
-0.202817
-0.107687
-0.208404
-0.0873625
-0.213041
-0.0661557
-0.216752
-0.0442793
-0.219553
-0.0219547
-0.22145
0.000591078
-0.222447
0.0231294
-0.22254
0.0454315
-0.221727
0.0672709
-0.220012
0.0884267
-0.217388
0.108687
-0.213845
0.127856
-0.209364
0.145755
-0.203918
0.162234
-0.197479
0.177334
-0.189935
-0.181374
-0.174166
-0.193618
0.187748
-0.159108
-0.203689
-0.142623
-0.212738
-0.124812
-0.220629
-0.105818
-0.227397
-0.0858085
-0.23305
-0.0649676
-0.237593
-0.0434942
-0.241026
-0.0215964
-0.243348
0.000511059
-0.244555
0.0226116
-0.244641
0.0444887
-0.243605
0.0659283
-0.241452
0.086723
-0.238183
0.106675
-0.233797
0.125603
-0.228291
0.143343
-0.221658
0.159755
-0.213891
0.174764
-0.204943
-0.194895
-0.172097
-0.207197
0.185676
-0.157066
-0.21872
-0.140666
-0.229137
-0.123008
-0.238287
-0.104229
-0.246176
-0.0844872
-0.252793
-0.0639556
-0.258125
-0.0428223
-0.262159
-0.021285
-0.264885
0.00045222
-0.266292
0.022183
-0.266371
0.043701
-0.265123
0.0648029
-0.262554
0.0852921
-0.258672
0.104982
-0.253487
0.123701
-0.24701
0.141294
-0.239251
0.157626
-0.230223
0.172591
-0.219909
-0.208451
-0.170273
-0.220764
0.183839
-0.155275
-0.233718
-0.138963
-0.245449
-0.121447
-0.255803
-0.102858
-0.264765
-0.0833475
-0.272303
-0.063082
-0.27839
-0.0422403
-0.283001
-0.0210112
-0.286114
0.000409693
-0.287713
0.0218244
-0.287786
0.0430352
-0.286333
0.0638473
-0.283366
0.0840729
-0.278897
0.103534
-0.272949
0.122068
-0.265544
0.139524
-0.256708
0.155774
-0.246473
0.170708
-0.234842
-0.221994
-0.168631
-0.234321
0.182188
-0.153679
-0.248671
-0.137457
-0.261671
-0.120073
-0.273187
-0.101656
-0.283182
-0.082351
-0.291608
-0.0623182
-0.298423
-0.0417297
-0.30359
-0.0207676
-0.307076
0.000379776
-0.30886
0.0215211
-0.308927
0.0424656
-0.307278
0.0630254
-0.303926
0.0830197
-0.298892
0.102278
-0.292207
0.120642
-0.283908
0.13797
-0.274035
0.154135
-0.262638
0.169031
-0.249739
-0.235513
-0.16714
-0.24786
0.180679
-0.152241
-0.26357
-0.136108
-0.277803
-0.118849
-0.290446
-0.100589
-0.301443
-0.0814686
-0.310729
-0.0616422
-0.31825
-0.0412767
-0.323955
-0.0205484
-0.327804
0.000359596
-0.329768
0.0212617
-0.329829
0.0419724
-0.327989
0.0623097
-0.324263
0.0820983
-0.31868
0.101173
-0.311282
0.119382
-0.302117
0.136586
-0.291239
0.152663
-0.278714
0.167509
-0.264585
-0.249014
-0.16577
-0.261379
0.179289
-0.150928
-0.278412
-0.134885
-0.293846
-0.117746
-0.307585
-0.0996318
-0.319557
-0.0806786
-0.329682
-0.0610374
-0.337891
-0.0408705
-0.344122
-0.0203495
-0.348325
0.00034689
-0.350464
0.0210373
-0.35052
0.0415407
-0.348492
0.0616794
-0.344401
0.0812827
-0.338284
0.10019
-0.330189
0.118253
-0.32018
0.135338
-0.308324
0.151326
-0.294702
0.166114
-0.279373
-0.26249
-0.1645
-0.27487
0.177991
-0.14972
-0.293192
-0.133767
-0.309799
-0.116742
-0.324609
-0.0987641
-0.337535
-0.0799648
-0.348481
-0.0604915
-0.357364
-0.0405031
-0.364111
-0.0201676
-0.368661
0.000339841
-0.370972
0.0208412
-0.371021
0.0411588
-0.36881
0.0611185
-0.364361
0.0805533
-0.357718
0.0993063
-0.348942
0.117233
-0.338106
0.134202
-0.325293
0.150099
-0.310599
0.164825
-0.2941
-0.275936
-0.163314
-0.288332
0.176777
-0.148599
-0.307907
-0.132737
-0.325661
-0.115823
-0.341524
-0.0979721
-0.355386
-0.0793148
-0.367139
-0.059995
-0.376684
-0.0401683
-0.383937
-0.0200002
-0.388829
0.00033696
-0.391309
0.0206679
-0.391352
0.0408177
-0.388959
0.0606148
-0.384158
0.0798952
-0.376999
0.0985053
-0.367552
0.116303
-0.355904
0.133161
-0.342151
0.148966
-0.326404
0.163626
-0.30876
-0.28935
-0.162203
-0.301764
0.175634
-0.147555
-0.322555
-0.131782
-0.341433
-0.114974
-0.358332
-0.0972437
-0.373116
-0.0787184
-0.385664
-0.0595398
-0.395862
-0.0398611
-0.403616
-0.0198454
-0.408845
0.000336962
-0.411491
0.0205129
-0.411528
0.0405097
-0.408956
0.0601579
-0.403806
0.0792962
-0.396137
0.0977729
-0.386029
0.115449
-0.37358
0.132199
-0.358901
0.147914
-0.342119
0.162507
-0.323352
-0.302725
-0.161145
-0.315151
0.174532
-0.146567
-0.337133
-0.130885
-0.357115
-0.114182
-0.375035
-0.096567
-0.390731
-0.0781659
-0.404065
-0.0591186
-0.41491
-0.0395767
-0.423158
-0.0197014
-0.42872
0.000338749
-0.431531
0.0203722
-0.431562
0.0402281
-0.428812
0.0597386
-0.423317
0.0787443
-0.415143
0.0970955
-0.40438
0.114654
-0.391139
0.131297
-0.375545
0.14692
-0.357742
0.161441
-0.337873
-0.31606
-0.160116
0.173437
-0.145613
-0.130031
-0.113435
-0.0959326
-0.0776498
-0.0587262
-0.039312
-0.019567
0.000341407
0.020243
0.0399679
0.0593498
0.0782307
0.0964623
0.113907
0.130439
0.145959
0.1604
-0.546736
-0.24094
-0.526702
-0.243047
-0.506884
-0.244878
-0.487137
-0.246627
-0.467355
-0.248132
-0.447482
-0.249313
-0.427539
-0.250069
-0.407628
-0.250336
-0.38785
-0.250112
-0.368155
-0.249467
-0.347738
-0.248477
-0.325934
-0.247048
-0.296854
-0.244815
-0.255222
-0.239719
-0.194067
-0.225495
-0.123992
-0.188532
-0.0658316
-0.128326
-0.0394296
-0.0558651
-0.0298173
-0.00165933
0.0088639
-0.47601
-0.258872
-0.458405
-0.260652
-0.441107
-0.262177
-0.424019
-0.263715
-0.407007
-0.265143
-0.389903
-0.266418
-0.372521
-0.267451
-0.354705
-0.268152
-0.336387
-0.268431
-0.31762
-0.268233
-0.298519
-0.267578
-0.278984
-0.266582
-0.258385
-0.265415
-0.234257
-0.263846
-0.198642
-0.261109
-0.142789
-0.244385
-0.0745442
-0.196571
-0.0193779
-0.111031
0.00182535
-0.0228626
0.0106893
-0.396966
-0.273554
-0.38255
-0.275069
-0.368373
-0.276354
-0.354415
-0.277674
-0.340605
-0.278952
-0.326854
-0.280169
-0.313028
-0.281277
-0.298957
-0.282222
-0.284459
-0.28293
-0.269378
-0.283314
-0.253629
-0.283328
-0.237149
-0.283062
-0.219748
-0.282816
-0.200725
-0.28287
-0.179392
-0.282442
-0.145575
-0.278203
-0.0895014
-0.252645
-0.0287554
-0.171777
0.00224657
-0.0538646
0.0129358
-0.311869
-0.284248
-0.301437
-0.285501
-0.291181
-0.286609
-0.281109
-0.287746
-0.27116
-0.288901
-0.261265
-0.290064
-0.251338
-0.291204
-0.241265
-0.292295
-0.2309
-0.293295
-0.220073
-0.294141
-0.208636
-0.294765
-0.196524
-0.295174
-0.183757
-0.295583
-0.170124
-0.296503
-0.154311
-0.298255
-0.133921
-0.298592
-0.0968132
-0.289753
-0.0414801
-0.227111
-0.00175193
-0.0935927
0.0111839
-0.221664
-0.290215
-0.215909
-0.291256
-0.210242
-0.292276
-0.204689
-0.2933
-0.199213
-0.294377
-0.19376
-0.295516
-0.188266
-0.296699
-0.182647
-0.297914
-0.176798
-0.299144
-0.170574
-0.300364
-0.163802
-0.301537
-0.156341
-0.302635
-0.148199
-0.303725
-0.139569
-0.305133
-0.130119
-0.307705
-0.117429
-0.311282
-0.0961096
-0.311072
-0.0514191
-0.271801
-0.00712807
-0.137884
0.00405582
-0.128582
-0.291023
-0.127948
-0.291889
-0.127298
-0.292926
-0.126646
-0.293952
-0.125992
-0.295031
-0.125303
-0.296205
-0.124536
-0.297466
-0.12364
-0.29881
-0.122544
-0.30024
-0.121157
-0.301751
-0.119351
-0.303343
-0.116964
-0.305022
-0.113865
-0.306823
-0.11014
-0.308857
-0.105985
-0.311861
-0.100084
-0.317183
-0.0899819
-0.321174
-0.0586652
-0.303118
-0.0139318
-0.182617
-0.00987595
-0.0353675
-0.286517
-0.0398954
-0.287362
-0.0443536
-0.288467
-0.0487001
-0.289606
-0.0529585
-0.290773
-0.0571287
-0.292035
-0.0611867
-0.293408
-0.0651013
-0.294896
-0.0688287
-0.296513
-0.0723083
-0.298272
-0.075461
-0.300191
-0.078182
-0.302301
-0.0803411
-0.304664
-0.0818111
-0.307387
-0.0827779
-0.310894
-0.0833264
-0.316635
-0.081066
-0.323434
-0.0629475
-0.321236
-0.0212948
-0.22427
-0.0311707
0.0552588
-0.276947
0.0459221
-0.278025
0.0366592
-0.279204
0.0275111
-0.280457
0.0184913
-0.281753
0.00958724
-0.283131
0.000802524
-0.284623
-0.00784562
-0.286247
-0.0163324
-0.288026
-0.024619
-0.289985
-0.032654
-0.292156
-0.0403634
-0.294592
-0.0476563
-0.297371
-0.0543625
-0.300681
-0.0604737
-0.304783
-0.0667812
-0.310327
-0.0709349
-0.319281
-0.0652485
-0.326923
-0.0304493
-0.259069
-0.06162
0.141674
-0.262952
0.127909
-0.26426
0.114242
-0.265537
0.100665
-0.266881
0.0871983
-0.268286
0.0738333
-0.269766
0.060563
-0.271353
0.0473928
-0.273077
0.0343338
-0.274967
0.0214081
-0.277059
0.00865208
-0.2794
-0.00387511
-0.282065
-0.0160972
-0.285149
-0.0278856
-0.288893
-0.0390776
-0.293591
-0.050362
-0.299043
-0.0604641
-0.309178
-0.0661755
-0.321211
-0.0419156
-0.283329
-0.103536
0.222585
-0.245198
0.204934
-0.246609
0.187349
-0.247952
0.169801
-0.249332
0.152295
-0.25078
0.134832
-0.252303
0.117409
-0.25393
0.100022
-0.25569
0.0826705
-0.257616
0.065362
-0.259751
0.0481194
-0.262157
0.0309812
-0.264926
0.0140116
-0.26818
-0.00266812
-0.272213
-0.0189588
-0.2773
-0.0350395
-0.282962
-0.0499735
-0.294244
-0.0638593
-0.307325
-0.0517714
-0.295417
-0.155307
0.297582
-0.224181
0.276543
-0.22557
0.255484
-0.226893
0.23439
-0.228238
0.213254
-0.229644
0.192088
-0.231137
0.170883
-0.232725
0.149631
-0.234437
0.128325
-0.236311
0.106972
-0.238398
0.0855701
-0.240755
0.064125
-0.243481
0.0426644
-0.246719
0.0212671
-0.250816
2.9563e-05
-0.256063
-0.0206493
-0.262283
-0.0401774
-0.274716
-0.0603017
-0.287201
-0.0581658
-0.297553
-0.213473
0.366635
-0.200242
0.342564
-0.201499
0.318394
-0.202723
0.294137
-0.203981
0.26981
-0.205317
0.245405
-0.206733
0.220924
-0.208243
0.196347
-0.20986
0.171654
-0.211618
0.1468
-0.213543
0.121753
-0.215709
0.0964859
-0.218214
0.0710003
-0.221233
0.0453133
-0.225129
0.0191603
-0.22991
-0.00668503
-0.236438
-0.0313269
-0.250074
-0.0615757
-0.256952
-0.0686485
-0.29048
-0.282121
0.429602
0.402635
0.375546
0.348342
0.321016
0.293572
0.266008
0.238336
0.210558
0.18269
0.15473
0.126634
0.0983091
0.069428
0.0399002
0.00988099
-0.0249789
-0.0609947
-0.0916878
)
;
boundaryField
{
inlet
{
type calculated;
value nonuniform List<scalar>
41
(
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
-0.365854
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
41
(
0.331556
0.346844
0.355712
0.361525
0.366073
0.369487
0.371681
0.3728
0.373043
0.372746
0.3722
0.371262
0.369824
0.368057
0.366933
0.36802
0.371422
0.370762
0.355228
0.316395
0.301879
0.340085
0.374649
0.385931
0.385666
0.381951
0.379755
0.379356
0.380055
0.380696
0.381017
0.381006
0.380596
0.379529
0.377606
0.374685
0.370757
0.365923
0.359924
0.350794
0.33507
)
;
}
dymWall
{
type calculated;
value uniform 0;
}
AMI1
{
type cyclicAMI;
value nonuniform List<scalar>
73
(
0.404119
0.426808
0.445646
0.462583
0.475616
0.473753
0.43384
0.33549
0.18147
0.00172074
-0.0796635
0.0728221
0.276688
0.420405
0.478572
0.48294
0.46678
0.446647
0.425719
0.401797
0.374166
0.343923
0.311322
0.276636
0.24013
0.201962
0.162308
0.121546
0.080183
0.0386795
-0.00214199
-0.0422068
-0.0809577
-0.118115
-0.153532
-0.187177
-0.21912
-0.249349
-0.277853
-0.304583
-0.328472
-0.351636
-0.372697
-0.39163
-0.408234
-0.422348
-0.433833
-0.442572
-0.448465
-0.45144
-0.451463
-0.448537
-0.442699
-0.434024
-0.422612
-0.408583
-0.392077
-0.373262
-0.352314
-0.329339
0.567047
0.493941
0.411649
0.322562
0.227631
0.12939
0.0308618
-0.0648293
-0.155669
-0.240339
-0.318599
-0.390574
-0.456407
)
;
}
AMI2
{
type cyclicAMI;
value nonuniform List<scalar>
162
(
-0.195692
-0.203577
-0.207019
-0.214206
-0.216595
-0.22295
-0.225127
-0.230908
-0.232083
-0.237102
-0.233736
-0.236024
-0.221623
-0.215763
-0.185935
-0.166135
-0.123692
-0.0889639
-0.0425165
0.000224205
0.0312925
0.0443762
0.011476
-0.033882
-0.0798859
-0.136468
-0.166272
-0.209206
-0.21898
-0.238269
-0.23711
-0.240663
-0.235565
-0.232881
-0.227044
-0.223315
-0.217085
-0.213556
-0.206547
-0.202329
-0.194635
-0.193941
-0.185298
-0.178853
-0.169732
-0.16255
-0.152993
-0.14517
-0.135216
-0.126843
-0.116543
-0.107669
-0.0970431
-0.0877146
-0.0768202
-0.0671005
-0.0560825
-0.0461393
-0.0351122
-0.0251139
-0.0141085
-0.00433275
0.00647902
0.0160588
0.0267057
0.0358355
0.0462101
0.054827
0.0648769
0.0729626
0.0826406
0.0902344
0.0994734
0.10665
0.115438
0.122209
0.130522
0.136898
0.144727
0.150712
0.158008
0.159009
0.165455
0.1705
0.176349
0.181033
0.18627
0.190561
0.195162
0.199008
0.202963
0.2063
0.20959
0.212372
0.214979
0.217165
0.219078
0.220631
0.221841
0.222732
0.223235
0.223441
0.223248
0.222751
0.22188
0.220672
0.219147
0.217231
0.215081
0.212468
0.209728
0.206432
0.203144
0.199182
0.195391
0.190782
0.186553
0.181309
0.176692
0.170833
0.165886
0.159455
-0.196094
-0.186944
-0.178359
-0.173186
-0.163657
-0.154309
-0.147306
-0.137429
-0.127482
-0.119284
-0.109033
-0.0985414
-0.089279
-0.0787123
-0.0678067
-0.0579014
-0.0471937
-0.0362122
-0.0261727
-0.0155419
-0.00464021
0.00511828
0.0152578
0.0260508
0.0353435
0.0446616
0.0550489
0.0638546
0.0722008
0.0819887
0.0903973
0.0977569
0.106888
0.114921
0.121369
0.129816
0.137427
0.143055
0.15083
0.157941
)
;
}
walls
{
type calculated;
value uniform 0;
}
front
{
type empty;
value nonuniform 0();
}
back
{
type empty;
value nonuniform 0();
}
}
// ************************************************************************* //
|
|
09cae03a912648af37db771cc82b064f12a0dd0d
|
9514f00fecd925fe5b49711967368ac9756c7205
|
/Exceptions.cpp
|
9019929307cfe617791d89f19d5f102c929ae9ff
|
[] |
no_license
|
dragon5hoarder/ucd-csci2312-pa5
|
d791573354f37f7e40ee062287652efe0ca8b1c1
|
d0d82afcbe8d70d8ba0d72e576abed9e35e0ab8b
|
refs/heads/master
| 2021-01-18T08:25:52.508018
| 2015-12-16T22:58:56
| 2015-12-16T22:58:56
| 47,789,809
| 0
| 0
| null | 2015-12-10T21:57:31
| 2015-12-10T21:57:31
| null |
UTF-8
|
C++
| false
| false
| 1,864
|
cpp
|
Exceptions.cpp
|
//
// Created by dragon5hoarder on 12/14/2015.
//
#include "Exceptions.h"
namespace Gaming{
void GamingException::setName(std::string name){
__name = name;
}
std::ostream &operator<<(std::ostream &os, const GamingException &ex){
ex.__print_args(os);
return os;
}
DimensionEx::DimensionEx(unsigned expWidth, unsigned expHeight, unsigned width, unsigned height){
__name = "DimensionEx";
__exp_width = expWidth;
__exp_height = expHeight;
__width = width;
__height = height;
}
unsigned DimensionEx::getExpWidth() const{
return __exp_width;
}
unsigned DimensionEx::getExpHeight() const{
return __exp_height;
}
unsigned DimensionEx::getWidth() const{
return __width;
}
unsigned DimensionEx::getHeight() const{
return __height;
}
void InsufficientDimensionsEx::__print_args(std::ostream &os) const{
os << getName() << ": " << "dimensions must be greater than " << getExpWidth() << "x" << getExpHeight()
<< ", user set to " << getWidth() << "x" << getHeight() << std::endl;
}
InsufficientDimensionsEx::InsufficientDimensionsEx(unsigned minWidth, unsigned minHeight, unsigned width, unsigned height)
: DimensionEx(minWidth, minHeight, width, height){
setName("InsufficientDimensionsEx");
}
void OutOfBoundsEx::__print_args(std::ostream &os) const{
os << getName() << ": " << "Position " << getHeight() << ", " << getWidth() << " is outside of the "
<< getExpWidth() << "x" << getExpHeight() << " game grid" << std::endl;
}
OutOfBoundsEx::OutOfBoundsEx(unsigned maxWidth, unsigned maxHeight, unsigned width, unsigned height)
: DimensionEx(maxWidth, maxHeight, width, height){
setName("OutOfBoundsEx");
}
}
|
225d27bec559baadf11e4a82ce02f21fbb70d086
|
71dcceede9280bb29d21f24377594a0fd47bb9cc
|
/sigenobu/socket.cpp
|
6c33aed4e1ba70063b872465369cf8630e97bbe7
|
[] |
no_license
|
deathmarch2017-teamC/deathreversi
|
b52569d276f38799a2b481cb29baf39bdeed5043
|
8924ac17cd9b7806fa08121ba349be3baa847c78
|
refs/heads/master
| 2021-01-21T19:09:21.563440
| 2017-06-02T00:02:53
| 2017-06-02T00:02:53
| 92,123,174
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 923
|
cpp
|
socket.cpp
|
#include"socket.h"
bool set_socket(char* ip_addr, int port){
struct sockaddr_in server;
//ソケットの生成
serverSock = socket(AF_INET, SOCK_STREAM, 0);
//接続先構造体の準備
server.sin_family = AF_INET;
server.sin_port = htons(port);
//jokerのIPアドレス
inet_pton(AF_INET, ip_addr, &server.sin_addr.s_addr);
//サーバに接続
if(connect(serverSock, (struct sockaddr *) &server, sizeof(server))<-1){
//perror("connect error\n");
return false;
}
return true;
}
//送信する関数
bool send_func(char* buf){
//送信
if(send(sock,buf, strlen(buf),0)<0){
//perror("send error\n");
return false;
}
return true;
}
//受信する関数
bool recv_func(char* buf){
//サーバからデータを受信
//memset(buf, 0, sizeof(buf));
if(recv(sock, buf, strlen(buf),0)<0){
//perror("recv error\n");
return false;
}
return true;
}
|
cb4089eccabbd9fad7cb9ee6c3e14835d1aa2b36
|
bcf4b953bb92d462b8db140adc6da7e03a7592d6
|
/BeatifulTriplets.cpp
|
23304a006c3232c705fe1651c44f268da0bd755d
|
[] |
no_license
|
brucekevinadams/CPP-Programs
|
0a9d4a073d2483bd80d471616002723d8c9aae96
|
cc6e5b4c36f1fada28e23084e2c69e46d61b852f
|
refs/heads/master
| 2018-12-23T02:16:38.018708
| 2018-10-18T13:18:34
| 2018-10-18T13:18:34
| 117,719,141
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 851
|
cpp
|
BeatifulTriplets.cpp
|
/* Author: Bruce Adams
# www.austingamestudios.com
# Hackerrank problem
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
int main()
{
int n; std::cin >> n; //the length of the sequence
int d; std::cin >> d; //the beautiful difference
std::vector<int> vec;
vec.reserve(n);
std::copy_n(std::istream_iterator<int>(std::cin),
n, back_inserter(vec));
int count = 0;
for (int index = 0; index<=n-3; ++index)
for (int j = index+1; j<=n-2; ++j)
if(vec[j]-vec[index] == d)
for (int h = j+1; h<n; ++h)
if(vec[h]-vec[j] == d)
++count;
//std::cout << vec[index] <<" "<< vec[j]<<" "<< vec[h] <<std::endl;
std::cout << count << std::endl;
return 0;
}
|
3ace7b6ba5971f5dc0416ab10ea21776800af205
|
92eb8f72b167b398811eecd6461bf6a2d081b81e
|
/Hopfield - Codice/Exec1.cc
|
faa798564ad27ec052febfa39e95f32ce182eb30
|
[] |
no_license
|
Sawndip/Hopfield-model-efficiency
|
0e46346e69779be4e9726f0008af6ef3601321f0
|
6296c52f5008868b0c3f5fdc957c07bde6b37c17
|
refs/heads/master
| 2022-01-05T16:21:49.027756
| 2019-07-27T09:21:22
| 2019-07-27T09:21:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,647
|
cc
|
Exec1.cc
|
#include "Exec1.h"
#include "Neuron.h"
#include "Network.h"
#include <fstream>
#include <string>
#include <iostream>
using namespace std;
Exec1::Exec1(){
}
Exec1::~Exec1(){
}
void Exec1::run(int nnum, int pnum,int times, int lenght){
int count = 0;
char c;
double temp;
double impulse;
double del;
for(int i=0; i<times; i++){
string file ;
cout << "\nNome file:";
cin >>file;
cout << "\nRate cancellazione sinapsi: ";
cin >> del;
Network* net = new Network(nnum, pnum, file, del);
cout << "\n\nm(0) con il primo pattern: ";
cin >> impulse;
net->ExternalSignal(impulse);
net->Overlap(false);
int t = 0;
cout << "\n";
do{
net->setTemp();
while(t < lenght){
net->updateB(t+1, lenght ,count);
t++;
}
cout << "\nContinuare? ('q' per uscire) ";
cin >> c;
t = 0;
count++;
}while(c != 'q');
ofstream comando;
comando.open("comando.txt");
comando << "set yrange[-1.4:1.4] \n set xrange[1:"<< lenght*count <<"]\n set xlabel 'Cicli'\n set ylabel 'Overlap'\nset terminal jpeg \n set output '"<<file<<".jpg' \n";
for(int i=1; i<= pnum; i++){
if(i==1){comando << "plot '" << file <<"' u 1:"<<i+1<<" w line title 'Target "<< i <<"' ,\\\n " ;}
else if(i==(pnum)){comando << "'" << file <<"' u 1:"<<i+1<< " w line notitle ";}
else{comando << "'" << file <<"' u 1:"<<i+1<<" w line notitle ,\\\n " ;}
}
delete net;
comando.close();
system("gnuplot comando.txt");
}
}
|
fe944a7a2f2e643fe2360d6507e55b120898a6d1
|
c8958958e5802f3e04ce88bd4064eacb98ce2f97
|
/判断子序列.cpp
|
b12bb6e756ed3467236713cbc5469158f05ec3e5
|
[] |
no_license
|
Kiids/OJ_Practice
|
08e5ea99066421bfaf5b71e59eea24e282e39a24
|
e7d36ddb1664635d27db3c37bec952970b77dcb0
|
refs/heads/master
| 2023-09-01T11:38:28.834187
| 2023-06-30T17:12:18
| 2023-06-30T17:12:18
| 217,068,695
| 0
| 0
| null | null | null | null |
GB18030
|
C++
| false
| false
| 1,190
|
cpp
|
判断子序列.cpp
|
/*
给定字符串 s 和 t ,判断 s 是否为 t 的子序列。
字符串的一个子序列是原始字符串删除一些(也可以不删除)字符而不改变剩余字符相对位置形成的新字符串。(例如,"ace"是"abcde"的一个子序列,而"aec"不是)。
进阶:
如果有大量输入的 S,称作 S1, S2, ... , Sk 其中 k >= 10亿,你需要依次检查它们是否为 T 的子序列。在这种情况下,你会怎样改变代码?
示例 1:
输入:s = "abc", t = "ahbgdc"
输出:true
示例 2:
输入:s = "axc", t = "ahbgdc"
输出:false
提示:
0 <= s.length <= 100
0 <= t.length <= 10^4
两个字符串都只由小写字符组成。
*/
class Solution {
public:
bool isSubsequence(string s, string t) {
int n = 0, index = 0;
for (int i = 0; i < s.size(); i++)
{
for (int j = index; j < t.size(); j++)
{
if (s[i] == t[j])
{
n++;
index = j + 1;
break;
}
}
}
if (n == s.size())
return true;
else
return false;
}
};
|
ec7d89a55f6ec8159b11f85630957ad0418a9837
|
fc51482fe287b9e584ed07f6ecedc4a9452396bb
|
/Project 2/FYS4150_project2/jacobi_rotation.cpp
|
9cd41baf321ae399764621ef76bd6d752168ac02
|
[] |
no_license
|
ingridavh/compphys1
|
f14a93f05ac037f14489fcf2a3e7c3eb3b3b173e
|
2d9b0a073c690a752ea2d8718bfae46c1470473a
|
refs/heads/master
| 2020-07-23T21:08:17.722025
| 2016-12-09T17:57:18
| 2016-12-09T17:57:18
| 66,631,204
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,482
|
cpp
|
jacobi_rotation.cpp
|
#include "jacobi_rotation.h"
#include <iostream>
#include <armadillo>
using namespace std;
using namespace arma;
int eps_test(mat A, double eps) //default eps-value is set to 1e-8 in header file
{
//If the off-diagonal elements are small enough,
//eps_test returns 1, otherwise it returns 0
vec max = find_max(A);
int no;
if (abs(max(0)) >= eps)
{
no = 0;
}
else
{
no = 1;
}
return no;
}
//Find the max off-diagonal value of A
vec find_max(mat A)
{
int N = A.n_cols;
//Declare output vector
//max = (matrix element, l, k)
vec max = zeros<vec>(3);
for(int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
{
if(i != j)
{
if (abs(A(i,j)) > abs(max(0)))
{
max(0) = A(i,j), max(1) = i, max(2) = j;
}
}
}
}
return max;
}
//Find the trigonometric parameters for the rotation
vec find_trig(mat A, int k, int l)
{
//trig = (cosine, sine)
vec trig = zeros<vec>(2);
double tau, t;
//Calculate trigonometric parameters
if (A(k,l) != 0.0)
{
tau = (A(l,l)- A(k,k))/(float)(2*A(k,l));
if (tau >= 0)
{
t = 1.0/(tau + sqrt(1.0 + tau*tau));
}
else
{
t = -1.0/(-tau + sqrt(1.0 + tau*tau));
}
trig(0) = 1/sqrt(1 + t*t);
trig(1) = t*trig(0);
}
else
{
trig(0) = 1.0;
trig(1) = 0.0;
}
return trig;
}
//Rotate the matrix A
void rotate(mat &A, mat &R, int k, int l)
{
int N = A.n_cols;
vec trig = find_trig(A, k, l);
double c = trig(0);
double s = trig(1);
//old elements
double a_kk = A(k,k); double a_ll = A(l,l);
//Compute new elements
A(k,k) = a_kk*c*c - 2.0*A(k,l)*c*s + a_ll*s*s;
A(l,l) = a_kk*s*s + 2.0*A(k,l)*c*s + a_ll*c*c;
//Hard-code new non-diagonal l and k
A(k,l) = 0;
A(l,k) = 0;
//Compute new elements
for ( int i = 0; i < N; i++)
{
if (i != k && i != l)
{
double a_ik = A(i,k);
double a_il = A(i,l);
A(i,k) = a_ik*c - a_il*s;
A(k,i) = A(i,k);
A(i,l) = a_il*c + a_ik*s;
A(l,i) = A(i,l);
}
double r_ik = R(i,k);
double r_il = R(i,l);
R(i,k) = c*r_ik - s*r_il;
R(i,l) = c*r_il + s*r_ik;
}
}
|
18eca9efa3ec96612b27802e8526881262f346b3
|
3fa9ec7b225b17072c6d9f61927cd73c8151cd65
|
/dataStructs/queue/Array.h
|
fa463ef304cc14c99d99026a8abb68949e0a38f4
|
[
"MIT"
] |
permissive
|
YaLongWei/coding-121
|
4d8a750323f3c7a8c281f98ec93f5780bce539ae
|
583913dc5e2d9bf181de93f6f0f1dbebaae36d98
|
refs/heads/master
| 2020-04-09T02:20:58.217134
| 2019-07-26T14:11:39
| 2019-07-26T14:11:39
| 159,937,444
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 578
|
h
|
Array.h
|
#pragma once
#include <string>
template <class T>
class Array
{
public:
Array();
Array(int);
~Array();
int getSize();
int getCapacity();
bool isEmpty();
void add(int index, T t);
void addLast(T t);
void addFirst(T t);
T get(int index);
void set(int index, T t);
bool contains(T t);
int find(T t);
T remove(int index);
T removeFirst();
T removeLast();
void removeElement(T t);
T getLast();
T getFirst();
std::string toString(std::string(*func)(T));
private:
void resize(int);
private:
T * arr;
int size;
int capacity;
};
//#include "Array.cpp"
|
6a1272e5835522e709546512639910a63c995811
|
2a9c1533acfe7e870039179de361ecb04664187d
|
/src/firstTimeUtilities.hpp
|
ec76da604970b70912d64cfba9d6d501188412d2
|
[
"MIT"
] |
permissive
|
xilwen/servant-base-lib
|
3c7c91f7a243b7d51b29b38e0be1f2eef59e5111
|
432c67cb90774b67b350cf1f9e642665ef8c4f4d
|
refs/heads/master
| 2021-01-11T16:38:56.258011
| 2017-06-15T08:34:16
| 2017-06-15T08:34:16
| 80,132,122
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 307
|
hpp
|
firstTimeUtilities.hpp
|
#ifndef TESTEXE_FIRSTTIMEUTILITIES_H
#define TESTEXE_FIRSTTIMEUTILITIES_H
class FirstTimeUtilities
{
public:
FirstTimeUtilities();
~FirstTimeUtilities();
static void runProcessorTest();
static void runMemoryTest();
static void runDiskTest();
};
#endif //TESTEXE_FIRSTTIMEUTILITIES_H
|
393a50b74eb54c052fa480a39e3bf554b027fdec
|
04c906bf0438b59c5450c8daec634f931ca24600
|
/version.cpp
|
6b4878aaf54af15ed1f0c83bf79961cdfce77999
|
[] |
no_license
|
Phoenix264/lesson1
|
0736dc08d21d2a4ed1584a301e88f96e6bb9dfb6
|
d984efd52553fd805038db0caabacc932ca33336
|
refs/heads/master
| 2022-12-06T20:37:53.924052
| 2020-09-02T06:04:51
| 2020-09-02T06:04:51
| 292,039,756
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 132
|
cpp
|
version.cpp
|
#include "version.h"
int GetVersion()
{
#ifdef PROJECT_VERSION_PATCH
return PROJECT_VERSION_PATCH;
#else
return 0;
#endif
}
|
32aeb8dcc0806486d7b08c50900501fc2bc0f236
|
b927e16060d76f650e479927b5456ff9f71e09ff
|
/parser.h
|
e44514d2dd996a10f8605fa18b32b5b6af26712a
|
[
"MIT"
] |
permissive
|
RKJokela/HackAssembler
|
b4537344a05e6be29f8ab5ebcd17216b3c51398a
|
8219252bc389567b3ece5ba05d7e1b4cc8a1573b
|
refs/heads/master
| 2020-12-25T19:26:15.331611
| 2014-07-07T23:11:56
| 2014-07-07T23:11:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 945
|
h
|
parser.h
|
#ifndef PARSER_H_INCLUDED
#define PARSER_H_INCLUDED
#include <iostream>
#include <fstream>
// this class doesn't know whether it's operating on files, stdio, etc.
// just uses stream objects - caller decides what they point to
class Parser {
public:
Parser();
Parser(std::istream* in, std::ostream* out, bool interactive = false);
~Parser();
void SetInput(std::istream* instream);
void SetOutput(std::ostream* outstream);
void SetInteractive(bool interactive);
// returns true if there are lines left in the stream, or always if interactive
bool HasLines() const;
// returns true only if the line generated any code
bool ParseLine();
// first pass - build symbol table
void BuildSymbolTable();
void DumpSymbols();
private:
std::istream* input;
std::ostream* output;
std::ofstream my_ostream;
bool hasLines;
bool interactive;
unsigned int lineCount;
unsigned int srcLines;
int currentVar;
};
#endif // PARSER_H_INCLUDED
|
ffc28c3d096147e2a38296a36c7e1e7eacb37afc
|
d08e86916dcfd142f910b038700a2951f2ca2238
|
/AC_SUBMISSIONS/131A-cAPSlOCK.cpp
|
d2a597787eed46ef511540ad89493e49b2b69851
|
[] |
no_license
|
varunnayal15112/Codeforces-AC-Submissions
|
495d7d9ee162f2eb36e38d7ef36684be5b50a548
|
8948a8c533d67be3af835d67511c7851c614c1ba
|
refs/heads/master
| 2021-04-27T10:24:00.488722
| 2018-02-22T22:16:53
| 2018-02-22T22:16:53
| 122,529,341
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 624
|
cpp
|
131A-cAPSlOCK.cpp
|
/*
SubmissionId : 15976092
ContestId : 131
Index : A
ProblemName : cAPS lOCK
ProblemTags : ['implementation', 'strings']
ProgrammingLanguage : GNU C++
Verdict : OK
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin>>a;
long long int l,i,j,k=0,n;
l=a.size();
for(i=0;i<l;i++)
{
if(isupper(a[i]))
k+=1;
}
if(k==l)
{
for(i=0;i<l;i++)
cout<<(char)tolower(a[i]);
}
else if(islower(a[0])&&k==(l-1))
{
cout<<(char)toupper(a[0]);
for(i=1;i<l;i++)
cout<<(char)tolower(a[i]);
}
else
{
for(i=0;i<l;i++)
cout<<(a[i]);
}
return 0;
}
|
16e37fbbd91383522cfcbcb165b9c6cbf84a6f31
|
0476541c06d6a95e8e7c5d20777b3f5ed00b15d2
|
/src/config/XmlEntities.cxx
|
d773044d73a2267d028d76bc9a4c6144012701ef
|
[
"LicenseRef-scancode-warranty-disclaimer"
] |
no_license
|
HarkerYX/rticonnextdds-gateway-opcua
|
3010aadd3f2c8c0ad250917718f9a22998cc3cef
|
c45de71a24ac81e25dc12df749bf01dacf3ba134
|
refs/heads/master
| 2023-07-28T14:57:12.583147
| 2021-09-06T16:36:34
| 2021-09-06T16:36:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 20,061
|
cxx
|
XmlEntities.cxx
|
/*
* (c) 2017-2020 Copyright, Real-Time Innovations, Inc. (RTI)
* All rights reserved.
*
* RTI grants Licensee a license to use, modify, compile, and create derivative
* works of the Software solely in combination with RTI Connext DDS. Licensee
* may redistribute copies of the Software provided that all such copies are
* subject to this License. The Software is provided "as is", with no warranty
* of any type, including any warranty for fitness for any purpose. RTI is
* under no obligation to maintain or support the Software. RTI shall not be
* liable for any incidental or consequential damages arising out of the use or
* inability to use the Software. For purposes of clarity, nothing in this
* License prevents Licensee from using alternate versions of DDS, provided
* that Licensee may not combine or link such alternate versions of DDS with
* the Software.
*/
#include <reda/reda_string.h>
#include <rti/ddsopcua/DdsOpcUaGatewayException.hpp>
#include "opcUaSdk/OpcUaSdkDataTypes.hpp"
#include "log/LogMsg.hpp"
#include "RtiXmlUtilsDecl.hpp"
#include "XmlEntities.hpp"
#include "XmlSupport.hpp"
inline void xml_object_check_lookup(
struct RTIXMLUTILSObject* object,
struct RTIXMLUTILSObject* parent_object)
{
if (object == nullptr) {
RTI_THROW_GATEWAY_EXCEPTION(
&DDSOPCUA_LOG_XML_LOOKUP_PARENT_s,
RTIXMLUTILSObject_getFullyQualifiedName(parent_object));
}
}
inline void xml_object_check_lookup_attribute(
const char* attribute,
const char* attribute_name,
struct RTIXMLUTILSObject* object)
{
if (attribute == nullptr) {
RTI_THROW_GATEWAY_EXCEPTION(
&DDSOPCUA_LOG_XML_LOOKUP_ATTRIBUTE_ss,
attribute_name,
RTIXMLUTILSObject_getFullyQualifiedName(object));
}
}
inline void check_type_conversion(
bool type_conversion_result,
struct RTIXMLUTILSObject* object)
{
if (!type_conversion_result) {
RTI_THROW_GATEWAY_EXCEPTION(
&DDSOPCUA_LOG_XML_CONVERT_OBJECT_s,
RTIXMLUTILSObject_getFullyQualifiedName(object));
}
}
inline void check_text(const char* text, struct RTIXMLUTILSObject* object)
{
if (text == nullptr) {
RTI_THROW_GATEWAY_EXCEPTION(
&DDSOPCUA_LOG_XML_CONVERT_OBJECT_s,
RTIXMLUTILSObject_getFullyQualifiedName(object));
}
}
namespace rti { namespace ddsopcua { namespace config {
const std::string DDS_TOPIC_FIELD_NAME_ATTRIBUTE = "dds_topic_field_name";
const std::string OPCUA_SUBSCRIPTION_TAG_NAME = "opcua_input";
const std::string OPCUA_SUBSCRIPTION_PROTOCOL_TAG_NAME =
"subscription_protocol";
const std::string OPCUA_MONITORED_ITEMS_TAG_NAME = "monitored_items";
const std::string OPCUA_ATTRIBUTE_ID_TAG_NAME = "attribute_id";
const std::string OPCUA_NODE_ID_TAG_NAME = "node_id";
const std::string OPCUA_NAMESPACE_INDEX_TAG_NAME = "namespace_index";
void XmlDdsEndpoint::get_sample_selectors(
std::map<std::string, std::string>& sample_selectors,
struct RTIXMLUTILSObject* xml_root,
const std::string& dds_input_xml_fqn)
{
struct RTIXMLUTILSObject* dds_input_xml_object =
RTIXMLUTILSObject_lookUp(xml_root, dds_input_xml_fqn.c_str());
xml_object_check_lookup(dds_input_xml_object, xml_root);
// Always pre-register sample selector "*" with an empty filter
sample_selectors["*"] = "";
RTIXMLUTILSObject* sample_selectors_xml_object =
RTIXMLUTILSObject_getFirstChildWithTag(
dds_input_xml_object,
"sample_selectors");
if (sample_selectors_xml_object == nullptr) {
return;
}
RTIXMLUTILSObject* selector_xml_object =
RTIXMLUTILSObject_getFirstChild(sample_selectors_xml_object);
while (selector_xml_object != nullptr) {
const char* selector_name =
RTIXMLUTILSObject_getAttribute(selector_xml_object, "name");
xml_object_check_lookup_attribute(
selector_name,
"name",
selector_xml_object);
RTIXMLUTILSObject* filter_xml_object =
RTIXMLUTILSObject_getFirstChildWithTag(
selector_xml_object,
"filter");
const char* filter = RTIXMLUTILSObject_getText(filter_xml_object);
check_text(filter, filter_xml_object);
sample_selectors[selector_name] = filter;
selector_xml_object =
RTIXMLUTILSObject_getNextSibling(selector_xml_object);
}
}
void XmlOpcUaClient::get_client_property(
opcua::sdk::client::ClientProperty& client_properties,
struct RTIXMLUTILSObject* xml_root,
const std::string& opcua_server_fqn)
{
struct RTIXMLUTILSObject* opcua_server_xml_object =
RTIXMLUTILSObject_lookUp(xml_root, opcua_server_fqn.c_str());
xml_object_check_lookup(opcua_server_xml_object, xml_root);
// Set timeout if specified
struct RTIXMLUTILSObject* timeout_xml_object =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_server_xml_object,
"timeout");
if (timeout_xml_object != nullptr) {
uint32_t timeout;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedLong(
RTIXMLUTILSObject_getText(timeout_xml_object),
&timeout)),
timeout_xml_object);
client_properties.timeout = timeout;
}
// Set secure_channel_lifetime if specified
struct RTIXMLUTILSObject* lifetime_xml_object =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_server_xml_object,
"secure_channel_lifetime");
if (lifetime_xml_object != nullptr) {
uint32_t secure_channel_lifetime;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedLong(
RTIXMLUTILSObject_getText(lifetime_xml_object),
&secure_channel_lifetime)),
lifetime_xml_object);
client_properties.secure_channel_lifetime = secure_channel_lifetime;
}
// Set timeout if specified
struct RTIXMLUTILSObject* run_async_timeout =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_server_xml_object,
"run_asynchronous_timeout");
if (run_async_timeout != nullptr) {
uint16_t timeout;
check_type_conversion(
static_cast<uint16_t>(REDAString_strToUnsignedShort(
RTIXMLUTILSObject_getText(run_async_timeout),
&timeout)),
run_async_timeout);
client_properties.run_async_timeout = timeout;
}
}
void XmlOpcUaSubscription::get_subscription_property(
opcua::sdk::client::SubscriptionProperty& subscription_properties,
RTIXMLUTILSObject* xml_root,
const std::string& opcua_subscription_fqn)
{
RTIXMLUTILSObject* opcua_subscription_xml =
RTIXMLUTILSObject_lookUp(xml_root, opcua_subscription_fqn.c_str());
xml_object_check_lookup(opcua_subscription_xml, xml_root);
RTIXMLUTILSObject* opcua_subscription_protocol_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_subscription_xml,
OPCUA_SUBSCRIPTION_PROTOCOL_TAG_NAME.c_str());
xml_object_check_lookup(
opcua_subscription_protocol_xml,
opcua_subscription_xml);
// RequestedPublishingInterval
struct RTIXMLUTILSObject* requested_publishing_interval_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_subscription_protocol_xml,
"requested_publishing_interval");
if (requested_publishing_interval_xml != nullptr) {
double requested_publishing_interval = strtod(
RTIXMLUTILSObject_getText(requested_publishing_interval_xml),
nullptr);
subscription_properties.requested_publishing_interval(
requested_publishing_interval);
}
// RequestedLifetimeCount
struct RTIXMLUTILSObject* requested_lifetime_count_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_subscription_protocol_xml,
"requested_lifetime_count");
if (requested_lifetime_count_xml != nullptr) {
uint32_t requested_lifetime_count;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedLong(
RTIXMLUTILSObject_getText(requested_lifetime_count_xml),
&requested_lifetime_count)),
requested_lifetime_count_xml);
subscription_properties.requested_lifetime_count(
requested_lifetime_count);
}
// RequestedMaxAliveCount
struct RTIXMLUTILSObject* requested_max_keep_alive_count_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_subscription_protocol_xml,
"requested_max_keep_alive_count");
if (requested_max_keep_alive_count_xml != nullptr) {
uint32_t requested_max_keep_alive_count;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedLong(
RTIXMLUTILSObject_getText(
requested_max_keep_alive_count_xml),
&requested_max_keep_alive_count)),
requested_max_keep_alive_count_xml);
subscription_properties.requested_max_keep_alive_count(
requested_max_keep_alive_count);
}
// MaxNotificationsPerPublish
struct RTIXMLUTILSObject* max_notifications_per_publish_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_subscription_protocol_xml,
"max_notifications_per_publish");
if (max_notifications_per_publish_xml != nullptr) {
uint32_t max_notifications_per_publish;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedLong(
RTIXMLUTILSObject_getText(
max_notifications_per_publish_xml),
&max_notifications_per_publish)),
max_notifications_per_publish_xml);
subscription_properties.max_notifications_per_publish(
max_notifications_per_publish);
}
// PublishingEnabled
struct RTIXMLUTILSObject* publishing_enabled_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_subscription_protocol_xml,
"publishing_enabled");
if (publishing_enabled_xml != nullptr) {
RTIBool publishing_enabled;
check_type_conversion(
static_cast<bool>(REDAString_strToBoolean(
RTIXMLUTILSObject_getText(publishing_enabled_xml),
&publishing_enabled)),
publishing_enabled_xml);
subscription_properties.publishing_enabled(publishing_enabled);
}
// Priority
struct RTIXMLUTILSObject* priority_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_subscription_protocol_xml,
"priority");
if (priority_xml != nullptr) {
uint16_t priority;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedShort(
RTIXMLUTILSObject_getText(priority_xml),
&priority)),
priority_xml);
subscription_properties.priority(static_cast<uint8_t>(priority));
}
}
void XmlOpcUaEndpoint::get_subscription_node_attribute_property(
std::vector<opcua::sdk::client::MonitoredNodeAttribute>& properties,
RTIXMLUTILSObject* xml_root,
const std::string& opcua_endpoint_fqn)
{
RTIXMLUTILSObject* opcua_endpoint_xml =
RTIXMLUTILSObject_lookUp(xml_root, opcua_endpoint_fqn.c_str());
xml_object_check_lookup(opcua_endpoint_xml, xml_root);
RTIXMLUTILSObject* opcua_node_list_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
opcua_endpoint_xml,
OPCUA_MONITORED_ITEMS_TAG_NAME.c_str());
xml_object_check_lookup(opcua_node_list_xml, opcua_endpoint_xml);
// Create monitored item properties vector
RTIXMLUTILSObject* node_xml =
RTIXMLUTILSObject_getFirstChild(opcua_node_list_xml);
while (node_xml != nullptr) {
opcua::sdk::client::MonitoredNodeAttribute node_attribute;
// Common properties
get_node_attribute_property(node_attribute, node_xml);
// Monitoring properties
opcua::sdk::client::MonitoringProperty monitoring_property;
// sampling_interval
struct RTIXMLUTILSObject* sampling_interval_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
node_xml,
"sampling_interval");
if (sampling_interval_xml != nullptr) {
// TODO: Add support for double sample intervals
RTI_INT32 sampling_interval;
check_type_conversion(
static_cast<bool>(REDAString_strToLong(
RTIXMLUTILSObject_getText(sampling_interval_xml),
&sampling_interval)),
sampling_interval_xml);
double interval = static_cast<double>(sampling_interval);
monitoring_property.sampling_interval(interval);
}
// queue size
struct RTIXMLUTILSObject* queue_size_xml =
RTIXMLUTILSObject_getFirstChildWithTag(node_xml, "queue_size");
if (queue_size_xml != nullptr) {
// TODO: Add support for double sample intervals
uint32_t queue_size;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedLong(
RTIXMLUTILSObject_getText(queue_size_xml),
&queue_size)),
queue_size_xml);
monitoring_property.queue_size(queue_size);
}
// discard_oldest
struct RTIXMLUTILSObject* discard_oldest_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
node_xml,
"discard_oldest");
if (discard_oldest_xml != nullptr) {
// TODO: Add support for double sample intervals
int discard_oldest;
check_type_conversion(
static_cast<bool>(REDAString_strToBoolean(
RTIXMLUTILSObject_getText(discard_oldest_xml),
&discard_oldest)),
discard_oldest_xml);
monitoring_property.discard_oldest(discard_oldest);
}
node_attribute.monitoring_properties(monitoring_property);
// Push back new monitored item and continue parsing
properties.push_back(node_attribute);
node_xml = RTIXMLUTILSObject_getNextSibling(node_xml);
}
}
void XmlOpcUaEndpoint::get_publication_node_attribute_property(
std::vector<opcua::sdk::client::PublicationNodeAttribute>& properties,
RTIXMLUTILSObject* xml_root,
const std::string& opcua_endpoint_fqn)
{
RTIXMLUTILSObject* opcua_endpoint_xml =
RTIXMLUTILSObject_lookUp(xml_root, opcua_endpoint_fqn.c_str());
xml_object_check_lookup(opcua_endpoint_xml, xml_root);
RTIXMLUTILSObject* opcua_node_list_xml = opcua_endpoint_xml;
// Create monitored item properties vector
RTIXMLUTILSObject* node_xml =
RTIXMLUTILSObject_getFirstChild(opcua_node_list_xml);
while (node_xml != nullptr) {
opcua::sdk::client::PublicationNodeAttribute node_attribute;
// Set common properties
get_node_attribute_property(node_attribute, node_xml);
// Publication properties
opcua::sdk::client::PublicationProperty publication_properties;
// Field name
const char* field_name = RTIXMLUTILSObject_getAttribute(
node_xml,
DDS_TOPIC_FIELD_NAME_ATTRIBUTE.c_str());
xml_object_check_lookup_attribute(
field_name,
DDS_TOPIC_FIELD_NAME_ATTRIBUTE.c_str(),
node_xml);
publication_properties.field_name(field_name);
const char* sample_selector = RTIXMLUTILSObject_getAttribute(
node_xml,
"dds_sample_selector_ref");
if (sample_selector != nullptr) {
publication_properties.sample_selector_name(sample_selector);
}
node_attribute.publication_properties(publication_properties);
// Push back new monitored item and continue parsing
properties.push_back(node_attribute);
node_xml = RTIXMLUTILSObject_getNextSibling(node_xml);
}
}
void XmlOpcUaEndpoint::get_node_attribute_property(
opcua::sdk::client::NodeAttribute& node_attribute,
RTIXMLUTILSObject* node_attribute_xml)
{
// MonitoredItem name
const char* name = RTIXMLUTILSObject_getAttribute(
node_attribute_xml,
DDS_TOPIC_FIELD_NAME_ATTRIBUTE.c_str());
xml_object_check_lookup_attribute(
name,
DDS_TOPIC_FIELD_NAME_ATTRIBUTE.c_str(),
node_attribute_xml);
node_attribute.name(name);
// MonitoredItem AttributeId
struct RTIXMLUTILSObject* attribute_id_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
node_attribute_xml,
OPCUA_ATTRIBUTE_ID_TAG_NAME.c_str());
xml_object_check_lookup(attribute_id_xml, node_attribute_xml);
const char* attribute_id = RTIXMLUTILSObject_getText(attribute_id_xml);
check_text(attribute_id, attribute_id_xml);
node_attribute.attribute_id(attribute_id);
// MonitoredItem NodeId
RTIXMLUTILSObject* node_id_xml = RTIXMLUTILSObject_getFirstChildWithTag(
node_attribute_xml,
OPCUA_NODE_ID_TAG_NAME.c_str());
xml_object_check_lookup(node_id_xml, node_attribute_xml);
// MonitoredItem NamespaceIndex
RTIXMLUTILSObject* namespace_index_xml =
RTIXMLUTILSObject_getFirstChildWithTag(
node_id_xml,
OPCUA_NAMESPACE_INDEX_TAG_NAME.c_str());
xml_object_check_lookup(namespace_index_xml, node_id_xml);
uint16_t namespace_index;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedShort(
RTIXMLUTILSObject_getText(namespace_index_xml),
&namespace_index)),
namespace_index_xml);
// MonitoredItem NodeId Identifier
struct RTIXMLUTILSObject* node_identifier_xml = nullptr;
if ((node_identifier_xml = RTIXMLUTILSObject_getFirstChildWithTag(
node_id_xml,
"numeric_identifier"))
!= nullptr) {
uint32_t numeric_identifier;
check_type_conversion(
static_cast<bool>(REDAString_strToUnsignedLong(
RTIXMLUTILSObject_getText(node_identifier_xml),
&numeric_identifier)),
node_identifier_xml);
node_attribute.node_id(
opcua::sdk::types::NodeId(namespace_index, numeric_identifier));
} else if (
(node_identifier_xml = RTIXMLUTILSObject_getFirstChildWithTag(
node_id_xml,
"string_identifier"))
!= nullptr) {
const char* str_id = RTIXMLUTILSObject_getText(node_identifier_xml);
node_attribute.node_id(
opcua::sdk::types::NodeId(namespace_index, (char*) str_id));
} else {
RTI_THROW_GATEWAY_EXCEPTION(
&DDSOPCUA_LOG_XML_UNSUPPORTED_NODE_IDENTIFIER_s,
RTIXMLUTILSObject_getFullyQualifiedName(namespace_index_xml));
}
}
}}} // namespace rti::ddsopcua::config
|
cc6d160a51a74f5f4ecc16f149e8d25c1327e5e8
|
4abd5ec68d2224c2ac1a8631a7827b69d0965216
|
/_2_Array_de_8_LEDs/_2_Array_de_8_LEDs.ino
|
dcea9e4817390b66ffa195d4e197e0ba467cc37c
|
[] |
no_license
|
cpines/Sortides-i-entrades-digitals
|
2e6bbb2a35adfbf61bb09325c95bfcf615d31e16
|
7507174a82f1237649ea00a789d0887962ce1092
|
refs/heads/master
| 2020-05-24T18:52:58.923981
| 2017-03-13T20:23:31
| 2017-03-13T20:23:31
| 84,870,996
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,767
|
ino
|
_2_Array_de_8_LEDs.ino
|
/**********************************************************************************
** **
** Cristofer Pines **
** **
** **
**********************************************************************************/
//********** Includes *************************************************************
//********** Variables ************************************************************
const int led0 = 5; // nom al pin 5 de l’Arduino
const int led1 = 6; // nom al pin 6 de l’Arduino
const int led2 = 7; // nom al pin 7 de l’Arduino
const int led3 = 8; // nom al pin 8 de l’Arduino
const int led4 = 9; // nom al pin 9 de l’Arduino
const int led5 = 10; // nom al pin 10 de l’Arduino
const int led6 = 11; // nom al pin 11 de l’Arduino
const int led7 = 12; // nom al pin 12 de l’Arduino
int pausa = 500; // t=ms
//********** Setup ****************************************************************
void setup()
{
pinMode(led0, OUTPUT); // pin 5 (sortida)
pinMode(led1, OUTPUT); // pin 6 (sortida)
pinMode(led2, OUTPUT); // pin 7 (sortida)
pinMode(led3, OUTPUT); // pin 8 (sortida)
pinMode(led4, OUTPUT); // pin 9 (sortida)
pinMode(led5, OUTPUT); // pin 10 (sortida)
pinMode(led6, OUTPUT); // pin 11 (sortida)
pinMode(led7, OUTPUT); // pin 12 (sortida)
}
//********** Loop *****************************************************************
void loop()
{
digitalWrite(led0, HIGH); // 5V el pin 5
digitalWrite(led1, LOW); // 0V el pin 6
digitalWrite(led2, HIGH); // 5V el pin 7
digitalWrite(led3, LOW); // 0V el pin 8
digitalWrite(led4, HIGH); // 5V el pin 9
digitalWrite(led5, LOW); // 0V el pin 10
digitalWrite(led6, HIGH); // 5V el pin 11
digitalWrite(led7, LOW); // 0V el pin 12
delay(pausa); // leds pausa=ms
digitalWrite(led0, LOW); // posar 0V el pin 5
digitalWrite(led1, HIGH); // posar 5V el pin 6
digitalWrite(led2, LOW); // posar 0V el pin 7
digitalWrite(led3, HIGH); // posar 5V el pin 8
digitalWrite(led4, LOW); // posar 0V el pin 9
digitalWrite(led5, HIGH); // posar 5V el pin 10
digitalWrite(led6, LOW); // posar 0V el pin 11
digitalWrite(led7, HIGH); // posar 5V el pin 12
delay(pausa); // leds pausa=ms
}
//********** Funcions *************************************************************
|
9e747ae271b806d4fd7389f8171fb2163c2aa0b1
|
247ced798886528c1f9c9db3e5c28571eb61044a
|
/GUI_pro/myprogress.h
|
164f38535b517fe3c7e09972b87163cef063e0b5
|
[] |
no_license
|
garyking-dev/learngit
|
495dbf1b56d92f315a75a6c94fcc7ccaacef7bab
|
9d7fd4f67a6453e229b5a83c7e2a5171b6b8b62b
|
refs/heads/master
| 2020-07-13T15:35:52.216028
| 2019-08-31T02:52:14
| 2019-08-31T02:52:14
| 205,107,420
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,953
|
h
|
myprogress.h
|
/*===============================================================
* Copyright (C) 2019 All rights reserved.
*
* 文件名称:myprogress.h
* 创 建 者:燕灵诀
* 创建日期:2019年08月30日
* 描 述:
*
* 更新日志:
*
================================================================*/
#ifndef _MYP_
#define _MYP_
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <stdio.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <time.h>
#include <sys/time.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "myobject.h"
#include <iostream>
using namespace std;
class MWindows;
class MProgress:public MObject{
public:
MProgress(MWindow *parent,int x=0, int y=0, int w=5, int h=5, int ec=0, int bc=0,int pr=50)
:MObject(parent, x, y, w, h, ec, bc),pro(pr)
{
}
void show(void){
unsigned int *addr = getparent()->getaddr();
int rwidth = getparent()->getrwidth();
int vwidth = getparent()->getvwidth();
int vheight = getparent()->getvheight();
addr += (gety()*rwidth+getx());
int row = 0;
int col = 0;
for(;row<getheight(); row++)
{
for(col=0; col<set(getwidth()); col++)
{
*addr++ = getbcolor();
}
addr += (rwidth-set(getwidth()));
}
addr = getparent()->getaddr() + (gety()*rwidth+getx());
for(col=0; col<getwidth(); col++)
*addr++ = getecolor();
addr = getparent()->getaddr() + ((gety()+getheight())*rwidth+getx());
for(col=0; col<getwidth(); col++)
*addr++ = getecolor();
addr = getparent()->getaddr() + (gety()*rwidth+getx());
for(row=0; row<getheight(); row++)
{
*addr = getecolor();
addr += rwidth;
}
addr = getparent()->getaddr() + (gety()*rwidth+getx()+getwidth());
for(row=0; row<getheight(); row++)
{
*addr = getecolor();
addr += rwidth;
}
}
int set(int width){
return width =width*pro/100;
}
private:
int pro;
};
#endif
|
f5f42f9ea675892a354a520e86636bc89a4c56b3
|
120937eae1ff66060f7c7ed967793f70e80683d3
|
/main/InputHandler.h
|
f63245768fd8d56085f16204b4971be3cecc571c
|
[] |
no_license
|
rrodrig6/BoardGame
|
31b6b933cbf0f8c3bf1efd310e97ca8fe3f28ef7
|
9687e0e888e798dbd3f8e6807fae38ce33a3e821
|
refs/heads/master
| 2021-01-10T04:30:09.171848
| 2015-11-21T22:52:41
| 2015-11-21T22:52:41
| 43,973,984
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,011
|
h
|
InputHandler.h
|
#ifndef __InputHandler
#define __InputHandler
#ifdef _WIN32
#include <SDL.h>
#elif __linux
#include <SDL2/SDL.h>
#endif
#include <vector>
#include "Vector2D.h"
enum mouse_buttons
{
LEFT = 0,
MIDDLE = 1,
RIGHT = 2
};
class InputHandler
{
public:
static InputHandler* Instance();
void update();
void clean();
void reset();
bool getMouseButtonState( int buttonNumber )
{
return m_mouseButtonStates[buttonNumber];
};
Vector2D* getMousePosition()
{
return m_mousePosition;
};
bool isKeyDown( SDL_Scancode key );
private:
InputHandler();
~InputHandler() {};
InputHandler( InputHandler const& ) {};
InputHandler& operator=( InputHandler const& ) {};
//Keyboard
void onKeyDown();
void onKeyUp();
//Mouse
void onMouseMove( SDL_Event& event );
void onMouseButtonDown( SDL_Event& event );
void onMouseButtonUp( SDL_Event& event );
static InputHandler* s_pInstance;
std::vector<bool> m_mouseButtonStates;
Vector2D* m_mousePosition;
const Uint8* m_keystates;
};
#endif
|
46a5dcb46780377102b25d6caad0e33ff0e0a01d
|
80573555a6aa4f6f0ece51bd8a4e28cf3bb91acc
|
/src/unistdx/base/command_line_test.cc
|
9cfa42a7e6b97e64bb1bddf8df3605855e0e53ea
|
[
"Unlicense"
] |
permissive
|
igankevich/unistdx
|
895e9bbfa30e748f20dca45684e1881273980f1a
|
d6b7d7aec29dfb855c61b6e5acf5b7ec657c1fad
|
refs/heads/master
| 2021-11-18T06:03:43.460700
| 2021-10-23T12:55:28
| 2021-10-23T12:55:28
| 111,085,286
| 4
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,520
|
cc
|
command_line_test.cc
|
/*
UNISTDX — C++ library for Linux system calls.
© 2017, 2018, 2020 Ivan Gankevich
This file is part of UNISTDX.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
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 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.
For more information, please refer to <http://unlicense.org/>
*/
#include <unistdx/base/command_line>
#include <unistdx/test/language>
using namespace sys::test::lang;
void test_commandline_parse() {
const char* argv[] = {
"progname",
"arg1=123",
"arg2=hello"
};
int arg1 = 0;
std::string arg2;
sys::input_operator_type options[] = {
sys::ignore_first_argument(),
sys::make_key_value("arg1", arg1),
sys::make_key_value("arg2", arg2),
nullptr
};
sys::parse_arguments(3, argv, options);
expect(value(123) == value(arg1));
expect(value("hello") == value(arg2));
}
void test_commandline_invalid_argument() {
const char* argv[] = {
"progname",
"arg3=123"
};
int arg1 = 0;
std::string arg2;
sys::input_operator_type options[] = {
sys::ignore_first_argument(),
sys::make_key_value("arg1", arg1),
sys::make_key_value("arg2", arg2),
nullptr
};
try {
sys::parse_arguments(2, argv, options);
expect(false);
} catch (const sys::bad_argument& err) {
expect(value(err.what()) != value(nullptr));
}
expect(value(0) == value(arg1));
expect(arg2.empty());
}
|
7f1833d70be4df78049a7d73b35e1a007a237158
|
637c7685d6c116ecdc1d53bfe999f9769d4549b5
|
/src/COGLImplement.cpp
|
ec0ca4f6462ef440e88497223eb7bf5181aebef3
|
[] |
no_license
|
vuhoang8x/OpenGL_SpinMoving
|
1131dacbcf807147d0c5e177c5060d7ad0680a1b
|
62a0ba0aa86006883fc26140f2bd944c80a8716d
|
refs/heads/master
| 2020-05-31T02:27:17.713677
| 2013-03-28T09:47:18
| 2013-03-28T09:47:18
| 9,073,625
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,367
|
cpp
|
COGLImplement.cpp
|
#include "COGLImplement.h"
COGLImplement::COGLImplement()
{
//ctor
//display = &COGLImplement::Display;
pixel = new COGLDrawPixel();
texture = new CGLTextureBasicLoad();
sprite = new CGLTextureSprite();
}
COGLImplement::~COGLImplement()
{
//dtor
}
void COGLImplement::Display()
{
//pixel->Draw(0.1, 0);
texture->Draw(0.1, 0.1);
//sprite->Draw();
}
void COGLImplement::GLCreateWindow(int argc, char** argv)
{
glutInit(&argc, argv); // Initialize GLUT
glutInitWindowSize(640, 480); // Set the window's initial width & height - non-square
glutInitWindowPosition(50, 50); // Position the window's initial top-left corner
glutCreateWindow("SPIN-SPINDLE"); // Create window with the given title
glutDisplayFunc(COGLImplement::Display); // Register callback handler for window re-paint event
//glutReshapeFunc(COGLDrawPixel::Resize); // Our own OpenGL initialization
glutReshapeFunc(CGLTextureBasicLoad::Resize);
//glutReshapeFunc(CGLTextureSprite::Resize);
glutKeyboardFunc(CGLTextureBasicLoad::key);
glutIdleFunc(CGLTextureBasicLoad::Idle);
//pixel->GLInit();
texture->GLInit();
texture->LoadTexture();
//sprite->GLInit();
//sprite->LoadTexture();
glutMainLoop(); // Enter the infinite event-processing loop
}
|
9ebef73f5d06cd572e7895c4ef1d90e559b1fad0
|
5888c735ac5c17601969ebe215fd8f95d0437080
|
/Hackerrank Solution/hacker_rank(april)c.cpp
|
f94e3fd03ad5ca01905d4c597218ab8c6939c48e
|
[] |
no_license
|
asad14053/My-Online-Judge-Solution
|
8854dc2140ba7196b48eed23e48f0dcdb8aec83f
|
20a72ea99fc8237ae90f3cad7624224be8ed4c6c
|
refs/heads/master
| 2021-06-16T10:41:34.247149
| 2019-07-30T14:44:09
| 2019-07-30T14:44:09
| 40,115,430
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,239
|
cpp
|
hacker_rank(april)c.cpp
|
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<long long>
#define input() freopen("in0.txt","r",stdin)
#define output() freopen("out0.txt","w",stdout)
vector<string> split_string(string);
// Complete the maximumSuperiorCharacters function below.
long maxsup(vll charsCount)
{
ll length = accumulate(charsCount.cbegin(), charsCount.cend(), 0);
ll optMaxSup = (length - 1) / 2;
ll charsUpToLimitLevelCount = 0;
ll limitLevel = 0;
for (; charsUpToLimitLevelCount <= length - optMaxSup && limitLevel < (int)charsCount.size(); ++limitLevel) {
charsUpToLimitLevelCount += charsCount[limitLevel];
}
ll supAtLimitLevel = optMaxSup + charsUpToLimitLevelCount - length;
charsUpToLimitLevelCount -= charsCount[--limitLevel];
ll matchedSupCount = min(supAtLimitLevel, max(charsUpToLimitLevelCount - 1, 0));
return optMaxSup - (supAtLimitLevel - matchedSupCount);
}
int main()
{
input();
output();
int T;
cin >> T;
vll freqs(27);
for (int t = 0; t < T; ++t)
{
for (int i = 0; i < 26; ++i)
cin >> freqs[i];
cout << maxsup(freqs) << '\n';
}
return 0;
}
|
14d1217b18b3b576f995e613ecc9decfb690119d
|
9991e3184176dd29695f0db5e8bf371494980707
|
/appMeteo.ino
|
6a4ce2cfa0de1fb7df8e8bd865b86cd691836bae
|
[] |
no_license
|
Alarevoyure/TTGO-T-WATCH-2020-Example
|
4c00be7de6db48f08f32df4c8b6abfc3313a3e38
|
125d3daf1fed64c34c6e250c2973654462026738
|
refs/heads/master
| 2023-05-30T17:11:33.091349
| 2021-06-07T10:20:40
| 2021-06-07T10:20:40
| 296,340,341
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,816
|
ino
|
appMeteo.ino
|
#include "config.h"
//#include "ImagesMeteo.c"
LV_IMG_DECLARE(IMG_01D);
LV_IMG_DECLARE(IMG_02D);
LV_IMG_DECLARE(IMG_03D);
LV_IMG_DECLARE(IMG_04D);
LV_IMG_DECLARE(IMG_09D);
LV_IMG_DECLARE(IMG_10D);
LV_IMG_DECLARE(IMG_11D);
LV_IMG_DECLARE(IMG_13D);
LV_IMG_DECLARE(IMG_50D);
LV_IMG_DECLARE(FOND);
static void meteo_event_handler(lv_obj_t * gauge1, lv_event_t event)
{
if(event == LV_EVENT_PRESSED) {
// mSelect = lv_btnmatrix_get_active_btn(obj);
KeyPressed = true;
}
}
void appMeteo() {
static char txt_log[513];
int testWifi=3;
lv_obj_t * label;
TimeToWait = millis() + 10000; // 10 seconde maxi dans le menu, sinon, on quitte.
KeyPressed = false;
if (!WifiConnected) WiFi.begin(ssid, passwifi);
while (WiFi.status() != WL_CONNECTED && testWifi) {
delay(500);
testWifi -= 1;
}
if (!FreshOpenWeather) GetMeteoInfo(); // Mettre à jour les infos Météo
txt_log[0] = '\0';
lv_obj_clean(lv_scr_act()); // Clear Screen
lv_obj_t * fond = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(fond, &FOND);
lv_obj_align(fond, NULL, LV_ALIGN_IN_TOP_LEFT, 0,0);
lv_obj_t * img1 = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(img1, &IMG_03D);
if (!strncmp(OpenWeatherIconID,"02",2)) lv_img_set_src(img1, &IMG_02D);
if (!strncmp(OpenWeatherIconID,"01",2)) lv_img_set_src(img1, &IMG_01D);
if (!strncmp(OpenWeatherIconID,"04",2)) lv_img_set_src(img1, &IMG_04D);
if (!strncmp(OpenWeatherIconID,"09",2)) lv_img_set_src(img1, &IMG_09D);
if (!strncmp(OpenWeatherIconID,"11",2)) lv_img_set_src(img1, &IMG_11D);
if (!strncmp(OpenWeatherIconID,"13",2)) lv_img_set_src(img1, &IMG_13D);
if (!strncmp(OpenWeatherIconID,"50",2)) lv_img_set_src(img1, &IMG_50D);
lv_obj_align(img1, NULL, LV_ALIGN_IN_TOP_LEFT, 0,0);
// lv_obj_set_event_cb(img1, meteo_event_handler);
lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL);
lv_label_set_long_mode(label1, LV_LABEL_LONG_BREAK); /*Break the long lines*/
lv_label_set_recolor(label1, true); /*Enable re-coloring by commands in the text*/
lv_label_set_align(label1, LV_LABEL_ALIGN_CENTER); /*Center aligned lines*/
lv_label_set_text(label1, "#ffff00 Condition Meteo");
lv_obj_set_width(label1, 200);
lv_obj_align(label1, NULL, LV_ALIGN_IN_TOP_LEFT, 20, 0);
static lv_style_t onestyle;
lv_style_init(&onestyle);
//lv_style_set_text_color(&onestyle, LV_STATE_DEFAULT, LV_COLOR_BLACK);
lv_style_set_text_font(&onestyle, LV_STATE_DEFAULT, &lv_font_montserrat_22);
lv_obj_t * txt = lv_label_create(lv_scr_act(), NULL);
lv_obj_add_style(txt, LV_OBJ_PART_MAIN, &onestyle);
lv_label_set_text(txt, txt_log);
lv_label_set_recolor(txt, true);
strcat(txt_log,"\n#ffffff Temperature : "); strcat(txt_log,OpenWeatherTemp);
strcat(txt_log,"\n#ffffff Humidite : "); strcat(txt_log,OpenWeatherHumidity);
strcat(txt_log,"\n#ffffff Pression : "); strcat(txt_log,OpenWeatherPressure);
strcat(txt_log,"\n#0000ff ID : "); strcat(txt_log,OpenWeatherID);
strcat(txt_log,"#");
lv_label_set_text(txt, txt_log);
lv_obj_align(txt, NULL, LV_ALIGN_IN_TOP_LEFT, 10, 40);
lv_obj_t * btn1 = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(btn1, meteo_event_handler);
lv_obj_align(btn1, txt, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
label = lv_label_create(btn1, NULL);
lv_label_set_text(label, "Quitter");
while (!KeyPressed) {
lv_task_handler();
delay(20);
if (TimeToWait < millis())KeyPressed = true;
}
ttgo->tft->fillScreen(TFT_BLACK);
}
|
c4d6a6e09fb051674ddb4274759a1af7849ca687
|
2fec624d5cb1d2ef68de2fa7a7a987c5b4460189
|
/src/wrongbranch.cpp
|
3811ef8b2bda41658b193419ab659a0eca52787d
|
[
"MIT"
] |
permissive
|
wrongbranch/wrongbranch
|
16a08162c5428e81732afd8b83eedd40d50aa3f1
|
2b8f45eda551dd6bfc68f1e469f199a96be0a8f2
|
refs/heads/master
| 2021-05-04T05:10:47.222518
| 2016-11-04T02:30:24
| 2016-11-04T02:30:24
| 70,974,926
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 876
|
cpp
|
wrongbranch.cpp
|
/*
wrongbranch.cpp
> mingw32-make -f makefile.tdmgpp32
*/
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
#define BUFSIZE 8
static char *src = "abcd\nefg\nhijklmn\nop";
int test_sscanf()
{
char fmt[BUFSIZE], buf[6];
sprintf(fmt, "%%%d[^\n]", sizeof(buf) - 1);
int readnum = sscanf(src, fmt, buf);
fprintf(stderr, "len(fmt): %d\n", strlen(fmt));
fprintf(stderr, "readnum: %d\n", readnum);
fprintf(stderr, "len(buf): %d\n", strlen(buf));
fprintf(stderr, "buf: [%s]\n", buf);
return 0;
}
int main(int ac, char **av)
{
int i;
cout << "sizeof(size_t): " << hex << setw(8) << setfill('0') << right
<< sizeof(size_t) << endl;
for(i = 0; i < ac; ++i)
cout << i << " " << av[i] << endl;
test_sscanf();
return 0;
}
|
318772218267a854b04e7d4bb76c38b844adf374
|
683368f51482729f1cdd6ee9a7c3024230772933
|
/Homeworks/09. semester/MlaskalCompiler/public-rw/SWI098/du5/du5sem.cpp
|
ac4dad6a12144a638c83b3b3f4b9034541e40978
|
[] |
no_license
|
vajanko/Algorithms
|
679f150b49c493c045c44c6f69aafc65ea192eb7
|
cfbbaece13df5935ac91e467682df053fa058436
|
refs/heads/master
| 2020-12-24T21:00:28.953028
| 2016-04-25T14:14:26
| 2016-04-25T14:14:26
| 57,046,795
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 26,964
|
cpp
|
du5sem.cpp
|
/*
DU5SEM.CPP
*/
#include "du5sem.h"
#include "dubaseerr.h"
#include "duerr.h"
#include "du5tok.h"
namespace mlc {
/**
* Gets type of type-identifier and prints an error when there is no such type
*/
type_pointer get_type_pointer(MlaskalCtx *ctx, int line, mlc::ls_id_type::const_pointer id)
{
auto sp = ctx->tab->find_symbol(id);
type_pointer tp = sp->access_typed()->type();
if (sp->kind() != SKIND_TYPE)
{ // type does not exit
error(DUERR_NOTTYPE, line, *id);
}
return tp;
}
/**
* Gets type of an identifier (variable, function, constant)
*/
/*type_pointer get_symbol_type(MlaskalCtx *ctx, mlc::ls_id_type::const_pointer id)
{
auto sp = ctx->tab->find_symbol(id);
return sp->access_typed()->type();
}*/
void procedure_declare(MlaskalCtx *ctx, MlaskalLval &out, int proc_line, MlaskalLval &proc, MlaskalLval ¶ms)
{
ctx->tab->add_proc(proc_line, proc.id_ci_, params.param_list_);
ctx->tab->enter(proc_line, proc.id_ci_);
out.id_ci_ = proc.id_ci_;
}
void function_declare(MlaskalCtx *ctx, MlaskalLval &out, int fnc_line, MlaskalLval &fnc, MlaskalLval ¶ms, int type_line, MlaskalLval &type)
{
/* --> scalar type identifier */
auto sp = ctx->tab->find_symbol(type.id_ci_);
type_pointer tp = sp->access_typed()->type();
if (sp->kind() != SKIND_TYPE)
{ // return type does not exit
error(DUERR_NOTTYPE, type_line, *type.id_ci_);
}
else if (tp->cat() == type_category::TCAT_ARRAY || tp->cat() == type_category::TCAT_UNDEF
|| tp->cat() == type_category::TCAT_RANGE || tp->cat() == type_category::TCAT_RECORD)
{ // return type is not an scalar type
error(DUERR_NOTSCALAR, type_line, *type.id_ci_);
}
ctx->tab->add_fnc(fnc_line, fnc.id_ci_, tp, params.param_list_);
ctx->tab->enter(fnc_line, fnc.id_ci_);
out.id_ci_ = fnc.id_ci_;
}
void block_leave(MlaskalCtx *ctx, int line)
{ // do not leave at the end of a program
if (ctx->tab->nested())
ctx->tab->leave(line);
}
void var_declare(MlaskalCtx *ctx, MlaskalLval &ids, int type_line, MlaskalLval &type)
{
for (auto &id : ids.identifiers_)
ctx->tab->add_var(type_line, id, type.type_);
}
void type_assign(MlaskalCtx *ctx, int name_line, MlaskalLval &name, MlaskalLval &type)
{
ctx->tab->add_type(name_line, name.id_ci_, type.type_);
}
void type_declare(MlaskalCtx *ctx, MlaskalLval &out, int type_line, MlaskalLval &type)
{
type_pointer tp = get_type_pointer(ctx, type_line, type.id_ci_);
out.type_ = tp;
}
void type_declare_ordinal(MlaskalCtx *ctx, MlaskalLval &out, int type_line, MlaskalLval &type)
{
type_declare(ctx, out, type_line, type);
if (out.type_->cat() != type_category::TCAT_RANGE)
{
error(DUERR_NOTORDINAL, type_line);
}
}
void range_declare(MlaskalCtx *ctx, MlaskalLval &out, MlaskalLval &low, int high_line, MlaskalLval &high)
{
if (*low.int_ci_ > *high.int_ci_)
{ // bad range
error(DUERR_BADRANGE, high_line);
}
auto l = ctx->tab->ls_int().add(*low.int_ci_);
auto h = ctx->tab->ls_int().add(*high.int_ci_);
out.type_ = ctx->tab->create_range_type(l, h);
}
void range_add(MlaskalLval &out, MlaskalLval &in)
{
out.ranges_.push_back(in.type_);
}
void array_declare(MlaskalCtx *ctx, MlaskalLval &out, MlaskalLval &range, MlaskalLval &type)
{
// (TODO: type can be either identifier or anonym structural type)
type_pointer tp = type.type_;
for (auto rt = range.ranges_.rbegin(); rt != range.ranges_.rend(); ++rt)
tp = ctx->tab->create_array_type(*rt, tp);
out.type_ = tp;
}
void parameter_add(MlaskalCtx *ctx, MlaskalLval &out, MlaskalLval &ids, int type_line, MlaskalLval &type, param_type pt)
{
out.param_list_ = mlc::create_parameter_list();
/* --> type identifier */
type_pointer tp = get_type_pointer(ctx, type_line, type.id_ci_);
if (pt == param_type::value)
{
for (auto id : ids.identifiers_)
out.param_list_->append_parameter_by_value(id, tp);
}
else
{
for (auto id : ids.identifiers_)
out.param_list_->append_parameter_by_reference(id, tp);
}
}
void identifier_add(MlaskalLval &out, MlaskalLval &in)
{
out.identifiers_.push_back(in.id_ci_);
}
void const_declare(MlaskalCtx *ctx, int line, MlaskalLval &name, MlaskalLval &value)
{
switch (value.const_type_)
{
case mlc::boolean:
ctx->tab->add_const_bool(line, name.id_ci_, value.bool_val_);
break;
case mlc::integer:
ctx->tab->add_const_int(line, name.id_ci_, value.int_ci_);
break;
case mlc::real:
ctx->tab->add_const_real(line, name.id_ci_, value.real_ci_);
break;
case mlc::string:
ctx->tab->add_const_str(line, name.id_ci_, value.str_ci_);
break;
default:
break;
}
}
void const_calculate(MlaskalCtx *ctx, MlaskalLval &out, MlaskalLval &sig, MlaskalLval &value, const_type type)
{
symbol_pointer sp;
switch (type)
{
case mlc::integer:
if (sig.dtge_ == DUTOKGE_MINUS)
out.int_ci_ = ctx->tab->ls_int().add(-(*value.int_ci_));
else
out.int_ci_ = value.int_ci_;
break;
case mlc::real:
if (sig.dtge_ == DUTOKGE_MINUS)
out.real_ci_ = ctx->tab->ls_real().add(-(*value.real_ci_));
else
out.real_ci_ = value.real_ci_;
break;
default:
break;
}
out.const_type_ = type;
}
void const_load(MlaskalCtx *ctx, MlaskalLval &out, int line, MlaskalLval &id)
{
auto sp = ctx->tab->find_symbol(id.id_ci_);
if (sp->kind() != SKIND_CONST)
{
error(DUERR_NOTCONST, line, *id.id_ci_);
}
switch (sp->access_typed()->type()->cat())
{
case mlc::TCAT_BOOL:
out.bool_val_ = sp->access_const()->access_bool_const()->bool_value();
out.const_type_ = const_type::boolean;
break;
case mlc::TCAT_INT:
out.int_ci_ = sp->access_const()->access_int_const()->int_value();
out.const_type_ = const_type::integer;
break;
case mlc::TCAT_REAL:
out.real_ci_ = sp->access_const()->access_real_const()->real_value();
out.const_type_ = const_type::real;
break;
case mlc::TCAT_STR:
out.str_ci_ = sp->access_const()->access_str_const()->str_value();
out.const_type_ = const_type::string;
break;
default:
out.const_type_ = const_type::none;
break;
}
}
void const_load_and_calculate(MlaskalCtx *ctx, MlaskalLval &out, MlaskalLval &sig, int id_line, MlaskalLval &id)
{
const_load(ctx, id, id_line, id);
const_calculate(ctx, out, sig, id, id.const_type_);
}
void test(MlaskalCtx *ctx, MlaskalLval &lval)
{
}
/**
* Append INIT instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_init_ins(mlc::icblock_pointer block, mlc::type_pointer tp)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::INITB());
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::INITI());
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::INITR());
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::INITS());
break;
}
}
/**
* Append DTOR instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_dtor_ins(mlc::icblock_pointer block, mlc::type_pointer tp)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::DTORB());
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::DTORI());
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::DTORR());
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::DTORS());
break;
}
}
/**
* Append GLD instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_gld_ins(mlc::icblock_pointer block, mlc::type_pointer tp, mlc::stack_address adr)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::GLDB(adr));
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::GLDI(adr));
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::GLDR(adr));
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::GLDS(adr));
break;
}
}
/**
* Append LLD instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_lld_ins(mlc::icblock_pointer block, mlc::type_pointer tp, mlc::stack_address adr)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::LLDB(adr));
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::LLDI(adr));
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::LLDR(adr));
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::LLDS(adr));
break;
}
}
/**
* Append LDLIT instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_ldlit_ins(mlc::icblock_pointer block, mlc::type_pointer tp, mlc::const_symbol_reference con)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::LDLITB(con->access_bool_const()->bool_value()));
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::LDLITI(con->access_int_const()->int_value()));
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::LDLITR(con->access_real_const()->real_value()));
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::LDLITS(con->access_str_const()->str_value()));
break;
}
}
/**
* Append GST instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_gst_ins(mlc::icblock_pointer block, mlc::type_pointer tp, mlc::stack_address adr)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::GSTB(adr));
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::GSTI(adr));
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::GSTR(adr));
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::GSTS(adr));
break;
}
}
/**
* Append LST instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_lst_ins(mlc::icblock_pointer block, mlc::type_pointer tp, mlc::stack_address adr)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::LSTB(adr));
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::LSTI(adr));
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::LSTR(adr));
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::LSTS(adr));
break;
}
}
/**
* Append XLD instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_xld_ins(mlc::icblock_pointer block, mlc::type_pointer tp)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::XLDB());
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::XLDI());
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::XLDR());
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::XLDS());
break;
}
}
/**
* Append XST instruction for particular type at the end of given block. This function is valid
* only for BOOLEAN, INTEGER, REAL and STRING.
*/
void append_xst_ins(mlc::icblock_pointer block, mlc::type_pointer tp)
{
switch (tp->cat())
{
case type_category::TCAT_BOOL:
block->append_instruction(new ai::XSTB());
break;
case type_category::TCAT_INT:
block->append_instruction(new ai::XSTI());
break;
case type_category::TCAT_REAL:
block->append_instruction(new ai::XSTR());
break;
case type_category::TCAT_STR:
block->append_instruction(new ai::XSTS());
break;
}
}
/**
* Create new icblock in the provided MlaskalLval instance of does not exit yet.
*/
void create_block_if_empty(MlaskalLval &lval)
{
if (lval.code_ == NULL)
lval.code_ = icblock_create();
}
/**
* Associate program or subprogram (function or procedure) with its code. The association is made
* with the identifier - program, funtion or procedure name. The code_ field of MlaskalLval instance
* is cleared.
*/
void set_block_code(MlaskalCtx *ctx, MlaskalLval &id, MlaskalLval &code, mlc::block_type type)
{
switch (type)
{
case mlc::program:
ctx->tab->set_main_code(id.id_ci_, code.code_);
break;
case mlc::subprogram:
ctx->tab->set_subprogram_code(id.id_ci_, code.code_);
break;
}
// variable is reused and otherwise this is uninitialized
code.code_ = NULL;
}
void append_code_block(MlaskalLval &out, MlaskalLval &in)
{
if (out.code_ == NULL)
{
create_block_if_empty(in);
out.code_ = in.code_;
}
else if (in.code_ != NULL)
{
if (out.code_ != in.code_ && !in.code_->empty())
icblock_append_delete(out.code_, in.code_);
in.code_ = NULL;
}
}
/**
* Append instruction(s) which load value of an identifier. This can be global/local variable identifier,
* constant identifier or function without parameters identifier. type_ field is assigned with the type
* value represented by the identifier.
*/
void load_identifier(MlaskalCtx *ctx, MlaskalLval &out, int val_line, MlaskalLval &val)
{
create_block_if_empty(out);
auto sp = ctx->tab->find_symbol(val.id_ci_);
out.type_ = sp->access_typed()->type();
switch (sp->kind())
{
case symbol_kind::SKIND_GLOBAL_VARIABLE:
append_gld_ins(out.code_, out.type_, sp->access_typed()->access_global_variable()->address());
break;
case symbol_kind::SKIND_LOCAL_VARIABLE:
append_lld_ins(out.code_, out.type_, sp->access_typed()->access_local_variable()->address());
break;
case symbol_kind::SKIND_CONST:
append_ldlit_ins(out.code_, out.type_, sp->access_typed()->access_const());
break;
case symbol_kind::SKIND_FUNCTION:
// function without parameters
subprogram_call(ctx, out, val_line, val, val);
break;
default:
error(DUERR_NOTVAR, val_line, *val.id_ci_);
break;
}
}
/**
* Append LDLIT instruction which loads value of a constant used in the program. !!! This does not include
* the case of constant identifer or function !!!. type_ field is assigned with the type of constant.
*/
void load_const_value(MlaskalCtx *ctx, MlaskalLval &out, MlaskalLval &val, const_type type)
{
create_block_if_empty(out);
switch (type)
{
case mlc::boolean:
// this is probably unnecessary because boolean value can be only specified by an identifier
out.code_->append_instruction(new ai::LDLITB(val.bool_val_));
out.type_ = ctx->tab->logical_bool();
break;
case mlc::integer:
out.code_->append_instruction(new ai::LDLITI(val.int_ci_));
out.type_ = ctx->tab->logical_integer();
break;
case mlc::real:
out.code_->append_instruction(new ai::LDLITR(val.real_ci_));
out.type_ = ctx->tab->logical_real();
break;
case mlc::string:
out.code_->append_instruction(new ai::LDLITS(val.str_ci_));
out.type_ = ctx->tab->logical_string();
break;
}
}
void load_element(MlaskalCtx *ctx, MlaskalLval &out, int val_line, MlaskalLval &val)
{
// caluclate address of the element
append_code_block(out, val);
// and load the value at this address
append_xld_ins(out.code_, val.type_);
}
void unary_op(MlaskalCtx *ctx, MlaskalLval &out, int op_line, MlaskalLval &op, MlaskalLval &val)
{
out.code_ = val.code_;
out.type_ = val.type_;
switch (op.dtge_)
{
case DUTOKGE_PLUS:
// just ignore it, but check whether operand is either real or integer
if (!identical_type(val.type_, ctx->tab->logical_integer()) &&
!identical_type(val.type_, ctx->tab->logical_real()))
{
error(DUERR_SYNTAX, op_line, "'+' operator before non-integral expression");
}
break;
case DUTOKGE_MINUS:
if (identical_type(val.type_, ctx->tab->logical_integer()))
{
out.code_->append_instruction(new ai::MINUSI());
}
else if (identical_type(val.type_, ctx->tab->logical_real()))
{
out.code_->append_instruction(new ai::MINUSR());
}
else
{
error(DUERR_SYNTAX, op_line, "'-' operator before non-integral expression");
}
break;
default:
error(DUERR_SYNTAX, op_line, "unknown unary operator");
break;
}
}
void unary_not(MlaskalCtx *ctx, MlaskalLval &out, int op_line, MlaskalLval &op, MlaskalLval &val)
{
out.code_ = val.code_;
out.type_ = val.type_;
if (identical_type(val.type_, ctx->tab->logical_bool()))
{
out.code_->append_instruction(new ai::NOT());
}
else
{
error(DUERR_SYNTAX, op_line, "'not' operator before non-boolean expression");
}
}
void binary_op(MlaskalCtx *ctx, MlaskalLval &out, MlaskalLval &left, int op_line, MlaskalLval &op, MlaskalLval &right)
{
auto real_type = ctx->tab->logical_real();
auto int_type = ctx->tab->logical_integer();
auto str_type = ctx->tab->logical_string();
auto l_type = left.type_;
auto r_type = right.type_;
// TODO: boolean x boolean -> boolean
if (identical_type(l_type, str_type) && identical_type(r_type, str_type))
{ // string x string -> string
append_code_block(left, right);
out.code_ = left.code_;
switch (op.dtge_)
{
case DUTOKGE_PLUS:
out.code_->append_instruction(new ai::ADDS());
break;
default:
error(DUERR_SYNTAX, op_line, "unknown binary operator for 'string' type");
break;
}
out.type_ = str_type;
}
else if (identical_type(l_type, int_type) && identical_type(r_type, int_type) &&
op.dtge_ != DUTOKGE_SOLIDUS)
{ // integer x integer -> integer
append_code_block(left, right);
out.code_ = left.code_;
switch (op.dtge_)
{
case DUTOKGE_ASTERISK:
out.code_->append_instruction(new ai::MULI());
break;
case DUTOKGE_DIV:
out.code_->append_instruction(new ai::DIVI());
break;
case DUTOKGE_MOD:
out.code_->append_instruction(new ai::MODI());
break;
case DUTOKGE_PLUS:
out.code_->append_instruction(new ai::ADDI());
break;
case DUTOKGE_MINUS:
out.code_->append_instruction(new ai::SUBI());
break;
default:
// operator is undefined for given operands - SOLIDUS
error(DUERR_SYNTAX, op_line, "unknown binary operator for 'integer' type");
break;
}
out.type_ = int_type;
}
else if ((identical_type(l_type, real_type) || identical_type(l_type, int_type)) &&
(identical_type(r_type, real_type) || identical_type(r_type, int_type)))
{
// real/integer x real/integer -> real
// convert all integers to reals
if (identical_type(r_type, int_type))
{ // real x integer
right.code_->append_instruction(new ai::CVRTIR());
}
if (identical_type(l_type, int_type))
{ // integer x real
left.code_->append_instruction(new ai::CVRTIR());
}
append_code_block(left, right);
out.code_ = left.code_;
switch (op.dtge_)
{
case DUTOKGE_ASTERISK:
out.code_->append_instruction(new ai::MULR());
break;
case DUTOKGE_SOLIDUS:
out.code_->append_instruction(new ai::DIVR());
break;
case DUTOKGE_PLUS:
out.code_->append_instruction(new ai::ADDR());
break;
case DUTOKGE_MINUS:
out.code_->append_instruction(new ai::SUBR());
break;
default:
// operator is undefined for given operands - DIV, MOD
error(DUERR_CANNOTCONVERT, op_line);
break;
}
out.type_ = real_type;
}
else
{
error(DUERR_SYNTAX, op_line, "unknown binary operator");
}
}
void store_conversion(mlc::icblock_pointer code, int line, mlc::type_pointer lt, mlc::type_pointer rt)
{
if (lt->cat() == type_category::TCAT_INT && rt->cat() == type_category::TCAT_REAL)
{ // conversion from REAL to INTEGER
code->append_instruction(new ai::CVRTRI());
error(DUERR_CONVERSION, line);
}
else if (lt->cat() == type_category::TCAT_REAL && rt->cat() == type_category::TCAT_INT)
{ // conversion from INTEGER to REAL - no warnning !!!
code->append_instruction(new ai::CVRTIR());
// error(DUERR_CONVERSION, line);
}
else if (!identical_type(lt, rt))
{ // conversion is not allowed
error(DUERR_CANNOTCONVERT, line);
}
}
void store_identifier(MlaskalCtx *ctx, MlaskalLval &out, int id_line, MlaskalLval &id, MlaskalLval &expr)
{
//icblock_pointer block = expr.code_;
out.code_ = expr.code_;
/* --> variable, function identifier */
// find assigned symbol
auto sp = ctx->tab->find_symbol(id.id_ci_);
// find out type of the assigned symbol
id.type_ = sp->access_typed()->type();
// possible conversion in the assignment
// it is also checked whether assignment is possible
store_conversion(out.code_, id_line, id.type_, expr.type_);
switch (sp->kind())
{
case symbol_kind::SKIND_GLOBAL_VARIABLE:
append_gst_ins(out.code_, id.type_, sp->access_typed()->access_global_variable()->address());
break;
case symbol_kind::SKIND_LOCAL_VARIABLE:
append_lst_ins(out.code_, id.type_, sp->access_typed()->access_local_variable()->address());
break;
case symbol_kind::SKIND_FUNCTION:
if (ctx->tab->nested() && ctx->tab->my_function_name() == id.id_ci_)
{
append_lst_ins(out.code_, id.type_, ctx->tab->my_return_address());
break;
}
// else go to default branch
default:
error(DUERR_NOTVAR, id_line, *id.id_ci_);
break;
}
}
void store_element(MlaskalCtx *ctx, MlaskalLval &out, int arr_line, MlaskalLval &arr, MlaskalLval &expr)
{
out.code_ = icblock_create();
// first of all we calculate the value to be stored in the array
append_code_block(out, expr);
// then we convert calculate value to the array element type
// it is also checked whether assignment is possible
store_conversion(out.code_, arr_line, arr.type_, expr.type_);
// then calculate the address of the array element
append_code_block(out, arr);
// and store the value at this address
append_xst_ins(out.code_, arr.type_);
}
/**
* Create code for accessing particualr array element such as arr[1,2][one]
*/
void array_element(MlaskalCtx *ctx, MlaskalLval &out, int id_line, MlaskalLval &id, MlaskalLval &idxs)
{
create_block_if_empty(out);
auto sp = ctx->tab->find_symbol(id.id_ci_);
auto tp = sp->access_typed()->type();
if (tp->cat() != type_category::TCAT_ARRAY)
{ // indexing a non-array variable
error(DUERR_NOTARRAY, id_line, *id.id_ci_);
return;
}
// get all ranges types
while (tp->cat() == type_category::TCAT_ARRAY)
{
out.ranges_.push_back(tp);
tp = tp->access_array()->element_type();
}
out.ranges_.push_back(tp); // array single element type
for (auto expr : *idxs.exprs_)
{
if (out.code_->empty())
{
// access array beginning address
switch (sp->kind())
{
case symbol_kind::SKIND_GLOBAL_VARIABLE:
out.code_->append_instruction(new ai::GREF(sp->access_typed()->access_global_variable()->address()));
break;
case symbol_kind::SKIND_LOCAL_VARIABLE:
out.code_->append_instruction(new ai::LREF(sp->access_typed()->access_local_variable()->address()));
break;
default:
error(DUERR_NOTVAR, id_line, *id.id_ci_);
return;
}
// calculate index expression
icblock_append_delete(out.code_, expr);
// substract lower bound
tp = out.ranges_.front();
auto rt = tp->access_array()->index_type();
auto lb = rt->access_range()->lowerBound();
out.code_->append_instruction(new ai::LDLITI(lb));
out.code_->append_instruction(new ai::SUBI());
}
else
{
tp = out.ranges_.front();
auto rt = tp->access_array()->index_type();
// multiply previous value by range size
auto lb = rt->access_range()->lowerBound();
auto ub = rt->access_range()->upperBound();
// (ub - lb + 1)
out.code_->append_instruction(new ai::LDLITI(ub));
out.code_->append_instruction(new ai::LDLITI(lb));
out.code_->append_instruction(new ai::SUBI());
out.code_->append_instruction(new ai::LDLITI(ctx->tab->ls_int().add(1)));
out.code_->append_instruction(new ai::ADDI());
out.code_->append_instruction(new ai::MULI());
// calculate next index expression
icblock_append_delete(out.code_, expr);
out.code_->append_instruction(new ai::LDLITI(lb));
out.code_->append_instruction(new ai::SUBI());
// and add to the previous result
out.code_->append_instruction(new ai::ADDI());
// remove type at the beginning
//out.ranges_.erase(out.ranges_.begin());
}
// remove type at the beginning
out.ranges_.erase(out.ranges_.begin());
}
out.type_ = out.ranges_.front();
delete idxs.exprs_;
idxs.exprs_ = NULL;
// add index to the array begin pointer
out.code_->append_instruction(new ai::ADDP());
}
/**
* Store code for array indexer which will be then used to access particular array element.
*/
void array_index(MlaskalCtx *ctx, MlaskalLval &out, int expr_line, MlaskalLval &expr)
{
if (identical_type(expr.type_, ctx->tab->logical_integer()))
{
if (out.exprs_ == NULL)
out.exprs_ = new icblock_list();
out.exprs_->push_back(expr.code_);
}
else
{ // indexing with non-integral type
error(DUERR_CANNOTCONVERT, expr_line);
}
}
void subprogram_call(MlaskalCtx *ctx, MlaskalLval &out, int id_line, MlaskalLval &id, MlaskalLval &real_params)
{
create_block_if_empty(out);
auto sp = ctx->tab->find_symbol(id.id_ci_);
if (sp->kind() == symbol_kind::SKIND_PROCEDURE || sp->kind() == symbol_kind::SKIND_FUNCTION)
{
if (sp->kind() == symbol_kind::SKIND_FUNCTION)
{
out.type_ = sp->access_typed()->type();
// allocate space for return type
append_init_ins(out.code_, out.type_);
}
// evaluate subprogram arguments if any
if (real_params.code_ != NULL)
append_code_block(out, real_params);
// call subprogram
out.code_->append_instruction(new ai::CALL(sp->access_subprogram()->code()));
// dispose variables used by the subprogram in reverse order
auto params = sp->access_subprogram()->parameters();
std::vector<mlc::parameter_entry> params_wrap(params->begin(), params->end());
for (auto param = params_wrap.rbegin(); param != params_wrap.rend(); ++param)
{
if (param->partype == parameter_mode::PMODE_BY_VALUE)
{
append_dtor_ins(out.code_, param->ltype);
}
else if (param->partype == parameter_mode::PMODE_BY_REFERENCE)
{
// TODO: du6
}
}
}
else
{
// trying to call variable, constant or other identifier
error(DUERR_NOTPROC, id_line, *id.id_ci_);
}
}
};
/*****************************************/
|
0b286fc6ee62910599cbbc8631dae516a8d26fb9
|
85bf26a841d315dc3bb4eb679be3b49b888e9bb2
|
/example.cpp
|
e6db3f1e50720427ea5d4fbae976f3d866815372
|
[
"MIT"
] |
permissive
|
i-use-arch-linux-btw/binance-cxx-api
|
9ac397334fca15a6636e9064bf5026ee1bbddcc9
|
f525db14ab2a976b1c733249aab4f2288eceb4a7
|
refs/heads/master
| 2023-07-27T01:08:59.525096
| 2021-09-11T22:38:13
| 2021-09-11T22:38:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,896
|
cpp
|
example.cpp
|
#include <iostream>
#include <json/json.h>
#include <map>
#include <string>
#include <vector>
#include <fstream>
#include "binance.h"
#include "binance_logger.h"
#include "binance_websocket.h"
using namespace binance;
using namespace std;
map<long, map<string, double> > klinesCache;
static void print_klinesCache()
{
cout << "==================================" << endl;
for (map<long, map<string, double> >::iterator it_i = klinesCache.begin();
it_i != klinesCache.end(); it_i++)
{
long start_of_candle = (*it_i).first;
map <string,double> candle_obj = (*it_i).second;
cout << "s:" << start_of_candle << ",";
cout << "o:" << candle_obj["o"] << ",";
cout << "h:" << candle_obj["h"] << ",";
cout << "l:" << candle_obj["l"] << ",";
cout << "c:" << candle_obj["c"] << ",";
cout << "v:" << candle_obj["v"] ;
cout << " " << endl;
}
}
static int ws_klines_onData(Json::Value& json_result)
{
long start_of_candle = json_result["k"]["t"].asInt64();
klinesCache[start_of_candle]["o"] = atof(json_result["k"]["o"].asString().c_str());
klinesCache[start_of_candle]["h"] = atof(json_result["k"]["h"].asString().c_str());
klinesCache[start_of_candle]["l"] = atof(json_result["k"]["l"].asString().c_str());
klinesCache[start_of_candle]["c"] = atof(json_result["k"]["c"].asString().c_str());
klinesCache[start_of_candle]["v"] = atof(json_result["k"]["v"].asString().c_str());
print_klinesCache();
return 0;
}
int main()
{
Logger::set_debug_level(1);
Logger::set_debug_logfp(stderr);
Json::Value result;
double fundingRate;
double serverTime;
Server server;
Market market(server);
BINANCE_ERR_CHECK(market.getLastFundingRate(result, "BTCUSDT", fundingRate));
cout<<fundingRate<<endl; // = cout<<stod(result["lastFundingRate"].asString())<<endl;
BINANCE_ERR_CHECK(market.getServerTime(result, serverTime));
cout<<serverTime<<endl;
return 0;
}
|
d39194b7012da297063b1f2622921cb98c36bc07
|
f40bef40a82602ca0e5e852468e3bac888861714
|
/src/shared/state/Decor.cpp
|
e97513193bd7cf748b1ca5e9c819ca880b810be3
|
[] |
no_license
|
pomb95/buguetnoel
|
88cb4545836f5ab6f71e12b8d2e20d9262b1acca
|
127c7be6617e54c94c2177e85339646f10d56f7f
|
refs/heads/master
| 2021-09-04T19:28:59.507211
| 2018-01-21T18:49:23
| 2018-01-21T18:49:23
| 104,056,653
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 304
|
cpp
|
Decor.cpp
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
#include <iostream>
#include "Decor.h"
namespace state {
Decor::Decor() {
}
Decor::~Decor() {}
}
|
af7950539401f2dafd263b5541f19ee91e7ca71b
|
535f32f5ff33933bb8b0304365fa03db54d89d78
|
/rir/src/compiler/analysis/verifier.cpp
|
8ead6e01999c1cd1c126e4b939b1a091c90f9c62
|
[] |
no_license
|
o-/rir
|
1d1fd65e4d19b04134730bd583a11367765ec720
|
3d0305bff5061f13bcabe80d635c7598142fcaba
|
refs/heads/master
| 2021-07-03T02:53:03.065236
| 2018-05-24T14:53:27
| 2018-05-24T14:53:27
| 77,072,209
| 0
| 2
| null | 2018-08-28T14:59:18
| 2016-12-21T17:24:35
|
C++
|
UTF-8
|
C++
| false
| false
| 6,140
|
cpp
|
verifier.cpp
|
#include "verifier.h"
#include "../pir/pir_impl.h"
#include "../util/cfg.h"
#include "../util/visitor.h"
namespace {
using namespace rir::pir;
class TheVerifier {
public:
Closure* f;
CFG cfg;
TheVerifier(Closure* f) : f(f), cfg(f->entry) {}
bool ok = true;
void operator()() {
DominanceGraph dom(f->entry);
Visitor::run(f->entry, [&](BB* bb) { return verify(bb, dom); });
if (!ok) {
std::cerr << "Verification of function " << *f << " failed\n";
f->print(std::cerr);
assert(false);
return;
}
for (auto p : f->promises) {
if (p)
verify(p);
if (!ok) {
std::cerr << "Verification of promise failed\n";
p->print(std::cerr);
return;
}
}
for (auto p : f->defaultArgs) {
if (p)
verify(p);
if (!ok) {
std::cerr << "Verification of argument failed\n";
p->print(std::cerr);
return;
}
}
}
void verify(BB* bb, const DominanceGraph& dom) {
for (auto i : *bb)
verify(i, bb, dom);
if (bb->isEmpty()) {
if (!bb->next0 && !bb->next1) {
std::cerr << "bb" << bb->id << " has no successor\n";
ok = false;
}
/* This check verifies that our graph is in edge-split format.
Currently we do not rely on this property, however we should
make it a conscious decision if we want to violate it.
This basically rules out graphs of the following form:
A B
\ / \
C D
or
_
| / \
A __/
|
The nice property about edge-split graphs is, that merge-points
are always dominated by *both* inputs, therefore local code
motion can push instructions to both input blocks.
In the above example, we can't push an instruction from C to A
and B, without worrying about D.
*/
if (cfg.predecessors[bb->id].size() > 1) {
for (auto in : cfg.predecessors[bb->id]) {
if (in->next1) {
std::cerr << "BB " << in->id << " merges into "
<< bb->id << " and branches into "
<< in->next1->id << " at the same time.\n";
ok = false;
}
}
}
} else {
Instruction* last = bb->last();
if ((Branch::Cast(last))) {
if (!bb->next0 || !bb->next1) {
std::cerr << "split bb" << bb->id
<< " must end in branch\n";
ok = false;
}
} else if ((Deopt::Cast(last)) || (Return::Cast(last))) {
if (bb->next0 || bb->next1) {
std::cerr << "exit bb" << bb->id << " must end in return\n";
ok = false;
}
} else {
if (!bb->next0 || bb->next1) {
std::cerr << "bb" << bb->id << " has next1 but no next0\n";
ok = false;
}
}
}
}
void verify(Promise* p) {
DominanceGraph dom(p->entry);
Visitor::run(p->entry, [&](BB* bb) { verify(bb, dom); });
}
void verify(Instruction* i, BB* bb, const DominanceGraph& dom) {
if (i->bb() != bb) {
std::cerr << "Error: instruction '";
i->print(std::cerr);
std::cerr << "' is supposed to point to BB " << bb
<< " but points to " << i->bb() << "\n";
ok = false;
}
Phi* phi = Phi::Cast(i);
i->eachArg([&](const InstrArg& a) -> void {
auto v = a.val();
auto t = a.type();
Instruction* iv = Instruction::Cast(v);
if (iv) {
if (phi) {
if (!cfg.transitivePredecessors[i->bb()->id].count(
iv->bb())) {
std::cerr << "Error at instruction '";
i->print(std::cerr);
std::cerr << "': input '";
iv->printRef(std::cerr);
std::cerr << "' does not come from a predecessor.\n";
ok = false;
}
} else if ((iv->bb() == i->bb() &&
bb->indexOf(iv) > bb->indexOf(i)) ||
(iv->bb() != i->bb() &&
!dom.dominates(iv->bb(), bb))) {
std::cerr << "Error at instruction '";
i->print(std::cerr);
std::cerr << "': input '";
iv->printRef(std::cerr);
std::cerr << "' used before definition.\n";
ok = false;
}
if (iv->bb()->owner != i->bb()->owner) {
std::cerr << "Error at instruction '";
i->print(std::cerr);
std::cerr << "': input '";
iv->printRef(std::cerr);
std::cerr << "' from a different function.\n";
ok = false;
}
}
if (!t.isSuper(v->type)) {
std::cerr << "Error at instruction '";
i->print(std::cerr);
std::cerr << "': Value ";
v->printRef(std::cerr);
std::cerr << " has type " << v->type
<< " which is not a subtype of " << t << "\n";
ok = false;
}
});
}
};
}
namespace rir {
namespace pir {
bool Verify::apply(Closure* f) {
TheVerifier v(f);
v();
return v.ok;
}
}
}
|
6c952808675453f6f46f3480f3af1aae77c03a10
|
7633802e35480e1b44d3a557f5f62a9e5801976f
|
/DSA/ARRAY.cpp
|
e4c4e4eddcd3e822d3101ece718bc49d8fbff810
|
[] |
no_license
|
vaibhavagarwal47/Competetive-Coding-With-C-
|
80740d9c3a7bd24fb2bc232e0921e33397f073a3
|
a2983b106b8e13d6934a67c5619ca0cdb87ee8c3
|
refs/heads/main
| 2023-03-20T11:50:53.427504
| 2021-03-10T13:25:16
| 2021-03-10T13:25:16
| 329,033,317
| 0
| 0
| null | 2021-01-12T15:42:16
| 2021-01-12T15:42:15
| null |
UTF-8
|
C++
| false
| false
| 524
|
cpp
|
ARRAY.cpp
|
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
const int max = 6;
int employee[max];
int count=0;
ofstream outfile;
outfile.open("data.dat");
while(count!=max)
{
cin>>employee[count];
outfile<<employee[count];
count++;
}
outfile.close();
ifstream datafile;
datafile.open("data.dat");
if(!datafile)
{
cout<<"error"<<endl;
}
while(count>=0 && datafile>>employee[count])
{
count--;
}
datafile.close();
for(int i=0;i<max;i++)
{
cout<<employee[i]<<endl;
}
return 0;
}
|
7778b6da9f73c10009607c3dbb08e0e914eb5a73
|
6494946d8db9db58f57c68253a8d0b658998c8ef
|
/Engine/Source/Renderer/Components/Attachments/Internal/InternalAttachment.h
|
c31dd4c216342cc4efac064d6a1780fde39be356
|
[] |
no_license
|
DhirajWishal/DynamikEngine-Prototype
|
bc7dbad1d8c13d2489bcfdc7d6f22e55932f5b7b
|
0a95277c394b69e66f79342f028834458694af93
|
refs/heads/master
| 2022-11-10T00:02:30.496607
| 2020-06-27T04:46:03
| 2020-06-27T04:46:03
| 198,091,316
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 408
|
h
|
InternalAttachment.h
|
#pragma once
#ifndef _DYNAMIK_RENDERER_INTERNAL_ATTACHMENT_H
#define _DYNAMIK_RENDERER_INTERNAL_ATTACHMENT_H
#include "../RenderAttachment.h"
namespace Dynamik {
namespace Renderer {
class InternalAttachment : public RenderAttachment {
public:
InternalAttachment() {}
virtual ~InternalAttachment() {}
POINTER<TextureData> image;
};
}
}
#endif // !_DYNAMIK_RENDERER_INTERNAL_ATTACHMENT_H
|
ca7b3b7880e67fb0da46e87ba61d964fa3881452
|
2d0bada349646b801a69c542407279cc7bc25013
|
/src/vai_runtime/vart/util/test/device_scheduler_imp.hpp
|
6df2039bc7a75ffdb0d9054617a93c5489ca1e6c
|
[
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"BSD-3-Clause-Open-MPI",
"LicenseRef-scancode-free-unknown",
"Libtool-exception",
"GCC-exception-3.1",
"LicenseRef-scancode-mit-old-style",
"OFL-1.1",
"JSON",
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"ICU",
"LicenseRef-scancode-other-permissive",
"GPL-2.0-or-later",
"GPL-3.0-only",
"LicenseRef-scancode-issl-2018",
"MIT",
"LGPL-2.1-or-later",
"LicenseRef-scancode-unicode",
"LGPL-3.0-only",
"LicenseRef-scancode-warranty-disclaimer",
"GPL-3.0-or-later",
"Zlib",
"BSD-Source-Code",
"ClArtistic",
"LicenseRef-scancode-unknown-license-reference",
"ISC",
"NCSA",
"LicenseRef-scancode-proprietary-license",
"GPL-2.0-only",
"CC-BY-4.0",
"FSFULLR",
"Minpack",
"Unlicense",
"BSL-1.0",
"NAIST-2003",
"LicenseRef-scancode-protobuf",
"LicenseRef-scancode-public-domain",
"Libpng",
"Spencer-94",
"BSD-2-Clause",
"Intel",
"GPL-1.0-or-later",
"MPL-2.0"
] |
permissive
|
Xilinx/Vitis-AI
|
31e664f7adff0958bb7d149883ab9c231efb3541
|
f74ddc6ed086ba949b791626638717e21505dba2
|
refs/heads/master
| 2023-08-31T02:44:51.029166
| 2023-07-27T06:50:28
| 2023-07-27T06:50:28
| 215,649,623
| 1,283
| 683
|
Apache-2.0
| 2023-08-17T09:24:55
| 2019-10-16T21:41:54
|
Python
|
UTF-8
|
C++
| false
| false
| 1,321
|
hpp
|
device_scheduler_imp.hpp
|
/*
* Copyright 2022-2023 Advanced Micro Devices Inc.
*
* 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 <glog/logging.h>
#include <map>
#include <mutex>
#include "./device_scheduler.hpp"
namespace {
class DeviceSchedulerImp : public vart::dpu::DeviceScheduler {
public:
explicit DeviceSchedulerImp(int count);
explicit DeviceSchedulerImp(const char* log, int count);
virtual ~DeviceSchedulerImp() = default;
DeviceSchedulerImp(const DeviceSchedulerImp&) = delete;
DeviceSchedulerImp& operator=(const DeviceSchedulerImp& other) = delete;
private:
virtual void initialize() override;
private:
virtual int next() override;
virtual void mark_busy_time(int device_id, int time) override;
private:
std::vector<int> busy_time_;
std::mutex mtx_;
int c = 0;
};
} // namespace
|
59536b065c9bf2eaa6a76d062a4b4814f08e5424
|
0c98fcba3b6c05159b9224e6153836a9e785f0e1
|
/Src/EB/AMReX_EBLevel.cpp
|
cca1de1da92e5e29536d91d81c55e80ac540ff58
|
[
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
Adellbengbeng/amrex
|
8dccb8b39ffa9a2aa956c20c5151f1e5ebf01a06
|
819b1a5789c78314317531d4e663debbb6b91126
|
refs/heads/master
| 2021-07-10T20:37:37.305823
| 2017-10-02T15:29:44
| 2017-10-02T15:29:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 11,049
|
cpp
|
AMReX_EBLevel.cpp
|
#include <AMReX_EBLevel.H>
#include <AMReX_EBFabFactory.H>
#include <AMReX_MultiFab.H>
#include <type_traits>
#include <algorithm>
#ifdef _OPENMP
#include <omp.h>
#endif
namespace amrex
{
static const IntVect eblev_debiv(D_DECL(0,0,0));
Box
getLevelDomain (const MultiFab& mf)
{
const auto& eblevel = amrex::getEBLevel(mf);
return eblevel.getDomain();
}
const EBLevel&
getEBLevel (const MultiFab& mf)
{
const EBFArrayBoxFactory* factory = dynamic_cast<EBFArrayBoxFactory const*>(&(mf.Factory()));
BL_ASSERT(factory);
return factory->getEBLevel();
}
const FabArray<EBCellFlagFab>&
getMultiEBCellFlagFab (const MultiFab& mf)
{
const auto& eblevel = amrex::getEBLevel(mf);
return eblevel.getMultiEBCellFlagFab();
}
// const FabArray<EBFaceFlagFab>&
// getMultiEBFaceFlagFab (const MultiFab& mf)
// {
// const auto& eblevel = amrex::getEBLevel(mf);
// return eblevel.getMultiEBFaceFlagFab();
// }
EBLevel::EBLevel ()
{
}
EBLevel::~EBLevel ()
{
}
EBLevel::EBLevel (const BoxArray& ba, const DistributionMapping& dm, const Box& domain, const int ng)
: EBLevelGrid(ba,dm,domain,ng),
m_cellflags(std::make_shared<FabArray<EBCellFlagFab> >(ba, dm, 1, ng)),
// m_faceflags(std::make_shared<FabArray<EBFaceFlagFab> >(ba, dm, AMREX_SPACEDIM, ng)),
m_ebisl(std::make_shared<EBISLayout>(EBLevelGrid::getEBISL()))
{
defineDoit(ba, dm, domain, ng);
}
void
EBLevel::define (const BoxArray& ba, const DistributionMapping& dm, const Box& domain, const int ng)
{
static_assert(sizeof(EBCellFlag) == 4, "sizeof EBCellFlag != 4");
static_assert(std::is_standard_layout<EBCellFlag>::value == true, "EBCellFlag is not pod");
static_assert(sizeof(EBFaceFlag) == 4, "sizeof EBFaceFlag != 4");
static_assert(std::is_standard_layout<EBFaceFlag>::value == true, "EBFaceFlag is not pod");
EBLevelGrid::define(ba, dm, domain, ng);
m_cellflags = std::make_shared<FabArray<EBCellFlagFab> >(ba, dm, 1, ng);
// m_faceflags = std::make_shared<FabArray<EBFaceFlagFab> >(ba, dm, AMREX_SPACEDIM, ng);
m_ebisl = std::make_shared<EBISLayout>(EBLevelGrid::getEBISL());
defineDoit(ba, dm, domain, ng);
}
void
EBLevel::setIrregularVolFab (EBCellFlagFab & fab, const EBISBox& ebis, const Box& bx)
{
BL_PROFILE("EBLevel::setIrregularVoFab()");
int nregular=0, nsingle=0, nmulti=0, ncovered=0;
int ncells = bx.numPts();
Box domain = ebis.getDomain();
for (BoxIterator bi(bx); bi.ok(); ++bi)
{
const IntVect& iv = bi();
auto& cellflag = fab(iv);
if (ebis.isRegular(iv))
{
cellflag.setRegular();
++nregular;
}
else if (ebis.isCovered(iv))
{
cellflag.setCovered();
++ncovered;
}
else if (ebis.isMultiValued(iv))
{
cellflag.setMultiValued(ebis.numVoFs(iv));
++nmulti;
amrex::Abort("EBLevel: multi-value cell not supported yet");
}
else
{
cellflag.setSingleValued();
++nsingle;
}
}
if (nregular == ncells) {
fab.setType(FabType::regular);
} else if (ncovered == ncells) {
fab.setType(FabType::covered);
} else if (nmulti > 0) {
fab.setType(FabType::multivalued);
} else {
fab.setType(FabType::singlevalued);
}
const Box& ibx = amrex::grow(fab.box(),-1) & domain;
for (BoxIterator bi(ibx); bi.ok(); ++bi)
{
const IntVect& iv = bi();
auto& cellflag = fab(iv);
cellflag.setDisconnected();
cellflag.setConnected(IntVect::TheZeroVector());
const auto& vofs = ebis.getVoFs(iv);
for (const auto& vi : vofs)
{
std::array<int,AMREX_SPACEDIM> dirs = {AMREX_D_DECL(0,1,2)};
do
{
IntVect offset_0 = IntVect::TheZeroVector();
for (SideIterator sit_0; sit_0.ok(); ++sit_0)
{
offset_0[dirs[0]] = amrex::sign(sit_0());
const auto& vofs_0 = ebis.getVoFs(vi, dirs[0], sit_0(), 1);
for (const auto& vi_0 : vofs_0)
{
cellflag.setConnected(offset_0);
#if (AMREX_SPACEDIM >= 2)
IntVect offset_1 = offset_0;
for (SideIterator sit_1; sit_1.ok(); ++sit_1)
{
offset_1[dirs[1]] = amrex::sign(sit_1());
const auto& vofs_1 = ebis.getVoFs(vi_0, dirs[1], sit_1(), 1);
for (const auto& vi_1 : vofs_1)
{
cellflag.setConnected(offset_1);
#if (AMREX_SPACEDIM == 3)
IntVect offset_2 = offset_1;
for (SideIterator sit_2; sit_2.ok(); ++sit_2)
{
offset_2[dirs[2]] = amrex::sign(sit_2());
const auto& vofs_2 = ebis.getVoFs(vi_1, dirs[2], sit_2(), 1);
for (const auto& vi_2 : vofs_2)
{
cellflag.setConnected(offset_2);
}
}
#endif
}
}
#endif
}
}
} while (std::next_permutation(dirs.begin(), dirs.end()));
}
}
}
///
void
EBLevel::setIrregularFaceFab (EBFaceFlagFab & fabs, const EBISBox& ebis, const Box& ccbx)
{
BL_PROFILE("EBLevel::setIrregularFaceFab()");
for (BoxIterator bi(ccbx); bi.ok(); ++bi)
{
const IntVect& iv = bi();
for (int dir = 0; dir < AMREX_SPACEDIM; ++dir)
{
{
const auto& lo_faces = ebis.getAllFaces(iv, dir, Side::Lo);
auto& flag = fabs(dir,iv);
flag.setDisconnected();
flag.setConnected(dir, IntVect::TheZeroVector());
if (lo_faces.size() == 0) {
flag.setCovered();
} else if (lo_faces.size() == 1) {
if (ebis.areaFrac(lo_faces[0]) == 1.0) {
flag.setRegular();
} else {
flag.setSingleValued();
}
setFaceConnection(flag, lo_faces[0], ebis);
} else {
flag.setMultiValued(lo_faces.size());
amrex::Abort("EBLevel: multi-value face not supported yet");
}
}
if (iv[dir] == ccbx.bigEnd(dir))
{
const IntVect& ivhi = iv + IntVect::TheDimensionVector(dir);
const auto& hi_faces = ebis.getAllFaces(iv, dir, Side::Hi);
auto& flag = fabs(dir,ivhi);
flag.setDisconnected();
flag.setConnected(dir, IntVect::TheZeroVector());
if (hi_faces.size() == 0) {
flag.setCovered();
} else if (hi_faces.size() == 1) {
if (ebis.areaFrac(hi_faces[0]) == 1.0) {
flag.setRegular();
} else {
flag.setSingleValued();
}
setFaceConnection(flag, hi_faces[0], ebis);
} else {
flag.setMultiValued(hi_faces.size());
amrex::Abort("EBLevel: multi-value face not supported yet");
}
}
}
}
}
///
void
EBLevel::defineDoit (const BoxArray& ba, const DistributionMapping& dm, const Box& domain, const int ng)
{
BL_PROFILE("EBLevel::defineDoit()");
#ifdef _OPENMP
#pragma omp parallel
#endif
{
for (MFIter mfi(*m_cellflags); mfi.isValid(); ++mfi)
{
auto& fab = (*m_cellflags)[mfi];
const EBISBox& ebis = (*m_ebisl)[mfi];
const Box& bx = fab.box() & domain;
//change this to if 0 if you want this to work the old way
#if 1
fab.copy(ebis.getEBGraph().getEBCellFlagFab());
fab.setType(ebis.getEBGraph().getEBCellFlagFab().getType());
#else
if(ebis.isRegular(bx))
{
EBCellFlag flag;
flag.setRegular();
fab.setVal(flag);
fab.setType(FabType::regular);
}
else if(ebis.isCovered(bx))
{
EBCellFlag flag;
flag.setCovered();
fab.setVal(flag);
fab.setType(FabType::covered);
}
else
{
setIrregularVolFab(fab, ebis, bx);
}
#endif
}
if (m_faceflags)
{
for (MFIter mfi(*m_faceflags); mfi.isValid(); ++mfi)
{
const EBISBox& ebis = (*m_ebisl)[mfi];
auto& fabs = (*m_faceflags)[mfi];
const Box& ccbx = amrex::grow(fabs.box(),-1) & domain;
if(ebis.isRegular(ccbx))
{
EBFaceFlag flag;
flag.setRegular();
for(int idir = 0; idir < SpaceDim; idir++)
{
BaseFab<EBFaceFlag>& fab = fabs.getFaceFlagFab(idir);
fab.setVal(flag);
}
}
else if(ebis.isCovered(ccbx))
{
EBFaceFlag flag;
flag.setCovered();
for(int idir = 0; idir < SpaceDim; idir++)
{
BaseFab<EBFaceFlag>& fab = fabs.getFaceFlagFab(idir);
fab.setVal(flag);
}
}
else
{
setIrregularFaceFab(fabs, ebis, ccbx);
}
}
}
}
}
void
EBLevel::setFaceConnection (EBFaceFlag& flag, const FaceIndex& face, const EBISBox& ebis)
{
const auto& vof_lo = face.getVoF(Side::Lo);
const auto& vof_hi = face.getVoF(Side::Hi);
// at domain boundary
if (vof_lo.cellIndex() < 0 || vof_hi.cellIndex() < 0) return;
const int dir = face.direction();
Array<int> tdirs; // transverse directions
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
if (idim != dir) {
tdirs.push_back(idim);
}
}
do
{
IntVect offset_0 = IntVect::TheZeroVector();
for (SideIterator sit_0; sit_0.ok(); ++sit_0)
{
offset_0[tdirs[0]] = amrex::sign(sit_0());
const auto& vofs_0_lo = ebis.getVoFs(vof_lo, tdirs[0], sit_0(), 1);
const auto& vofs_0_hi = ebis.getVoFs(vof_hi, tdirs[0], sit_0(), 1);
if (vofs_0_lo.size() == vofs_0_hi.size() && vofs_0_lo.size() == 1)
{
if (ebis.isConnected(vofs_0_lo[0], vofs_0_hi[0])) {
// wz. This is known to break in some cases.
flag.setConnected(dir, offset_0);
#if (AMREX_SPACEDIM == 3)
IntVect offset_1 = offset_0;
for (SideIterator sit_1; sit_1.ok(); ++sit_1)
{
offset_1[tdirs[1]] = amrex::sign(sit_1());
const auto& vofs_1_lo = ebis.getVoFs(vofs_0_lo[0], tdirs[1], sit_1(), 1);
const auto& vofs_1_hi = ebis.getVoFs(vofs_0_hi[0], tdirs[1], sit_1(), 1);
if (vofs_1_lo.size() == vofs_1_hi.size() && vofs_1_lo.size() == 1)
{
if (ebis.isConnected(vofs_1_lo[0], vofs_1_hi[0])) {
// wz. This is known to break in some cases.
flag.setConnected(dir, offset_1);
}
}
}
#endif
}
}
}
} while (std::next_permutation(tdirs.begin(), tdirs.end()));
}
}
|
b48425b40762e98042d078f4bdf3b05be4592eb0
|
ae31542273a142210a1ff30fb76ed9d45d38eba9
|
/src/backend/gporca/libnaucrates/include/naucrates/dxl/parser/CParseHandlerExtStatsNDistinct.h
|
775be18bf00e737570b9632daf05f1a4015c005c
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"PostgreSQL",
"OpenSSL",
"LicenseRef-scancode-stream-benchmark",
"ISC",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-ssleay-windows",
"BSD-2-Clause",
"Python-2.0"
] |
permissive
|
greenplum-db/gpdb
|
8334837bceb2d5d51a684500793d11b190117c6a
|
2c0f8f0fb24a2d7a7da114dc80f5f5a2712fca50
|
refs/heads/main
| 2023-08-22T02:03:03.806269
| 2023-08-21T22:59:53
| 2023-08-22T01:17:10
| 44,781,140
| 6,417
| 2,082
|
Apache-2.0
| 2023-09-14T20:33:42
| 2015-10-23T00:25:17
|
C
|
UTF-8
|
C++
| false
| false
| 1,945
|
h
|
CParseHandlerExtStatsNDistinct.h
|
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2023 VMware Inc.
//
// @filename:
// CParseHandlerExtStatsNDistinct.h
//
// @doc:
// SAX parse handler class for parsing extended stats ndistinct object
//---------------------------------------------------------------------------
#ifndef GPDXL_CParseHandlerExtStatsNDistinct_H
#define GPDXL_CParseHandlerExtStatsNDistinct_H
#include "gpos/base.h"
#include "naucrates/dxl/parser/CParseHandlerMetadataObject.h"
#include "naucrates/md/CMDNDistinct.h"
namespace gpdxl
{
using namespace gpos;
using namespace gpmd;
using namespace gpnaucrates;
XERCES_CPP_NAMESPACE_USE
class CParseHandlerExtStatsNDistinct : public CParseHandlerBase
{
private:
// ndistinct
CDouble m_ndistinct;
// attnos values
CBitSet *m_attnos;
// ndistinct object
CMDNDistinct *m_ndistinct_md;
// process the start of an element
void StartElement(
const XMLCh *const element_uri, // URI of element's namespace
const XMLCh *const element_local_name, // local part of element's name
const XMLCh *const element_qname, // element's qname
const Attributes &attr // element's attributes
) override;
// process the end of an element
void EndElement(
const XMLCh *const element_uri, // URI of element's namespace
const XMLCh *const element_local_name, // local part of element's name
const XMLCh *const element_qname // element's qname
) override;
public:
CParseHandlerExtStatsNDistinct(const CParseHandlerExtStatsNDistinct &) =
delete;
// ctor
CParseHandlerExtStatsNDistinct(CMemoryPool *mp,
CParseHandlerManager *parse_handler_mgr,
CParseHandlerBase *parse_handler_base);
// dtor
~CParseHandlerExtStatsNDistinct() override;
// returns the constructed ndistinct
CMDNDistinct *GetNDistinctAt() const;
};
} // namespace gpdxl
#endif // !GPDXL_CParseHandlerExtStatsNDistinct_H
// EOF
|
ef292183d365597c6c65e048c72ce281eb1a96aa
|
1dc8e321d3d01042a2f82abfccfdf7d1bc24edcb
|
/Sequence.h
|
03ac56eced342292f439e2e0824d95e3124f9f0c
|
[] |
no_license
|
Gagernaus/Sem3Lab1
|
ad057a5343a1c1b9cd2632159f52b7c65aae956c
|
3b93bd498f7ec065bb57663e38c7385ef6d40921
|
refs/heads/main
| 2022-12-28T22:53:20.647769
| 2020-10-18T14:14:07
| 2020-10-18T14:14:07
| 305,110,679
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,101
|
h
|
Sequence.h
|
#ifndef SEM2LAB2_SEQUENCE_H
#define SEM2LAB2_SEQUENCE_H
template<class T>
class Sequence {
public:
virtual int getLength() const = 0;
virtual T getFirst() const = 0;
virtual T getLast() const = 0;
virtual T get(const int i) const = 0;
virtual Sequence<T> *getSubsequence(const int start, const int end) const = 0;
public:
virtual void out() const = 0;
virtual void outTo(unsigned int num) const = 0;
virtual void setElem(int index, T value) = 0;
virtual void append(T value) = 0;
virtual void prepend(T value) = 0;
virtual void insertAt(const int index, T value) = 0;
virtual void removeAt(const int index) = 0;
virtual void remove(T value) = 0; // Удаляет первое вхождение value
//virtual void RemoveAll(T value) = 0;
virtual Sequence<T> *concat(Sequence<T> *other) = 0;
virtual Sequence<T> *copy() = 0;
// virtual Sequence<T> *CopyTo(Sequence<T> *target, int startIndex) = 0;
public:
virtual ~Sequence() {}
};
#endif //SEM2LAB2_SEQUENCE_H
|
409dbfd8ffb154daf6e3e8e396b0087c3d10c4aa
|
3dd88f8b4228edd54dc0e4729e3b8caec8bac8b5
|
/基础C语言作业/计算不同正负的分数求和.cpp
|
adde6a18dceadc6747b1404273f6f7988324637b
|
[] |
no_license
|
InightI/learn-C
|
235b51ad8fb8b851b2c5bfbf9f64c281a116b43b
|
75a7976951b59fbca4139da07f860e03ee29aa48
|
refs/heads/master
| 2020-04-04T15:52:27.645953
| 2018-12-06T12:57:48
| 2018-12-06T12:57:48
| 156,055,383
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 274
|
cpp
|
计算不同正负的分数求和.cpp
|
#include<stdio.h>
#include<math.h>
int main()
{
int i;
double sum = 0.0;
double sq = 0.0;
for (i = 1; i <= 100; i++)
{
sq = pow(-1, i + 1);
sum = sum + sq * 1 / i;
}
printf("sum is %lf\n", sum);
system("pause");
return 0;
}
|
38f3063bb538ca924418ee6b26839836584f883e
|
7600781971551ed7b9122edd2a7d31701234445a
|
/Argparse.cpp
|
64cc444f0edf57e85583ac661328b63ca09807f4
|
[] |
no_license
|
tplinderoth/simAssociation
|
c3903d3a23356615410809bdb7a2ca2964098a9a
|
6e9da176be1ec555d9ee231788d670eb1543e5fe
|
refs/heads/master
| 2021-01-21T13:04:55.995915
| 2016-06-02T01:52:22
| 2016-06-02T01:52:22
| 54,700,869
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,852
|
cpp
|
Argparse.cpp
|
/*
* Argparse.cpp
*/
#include "Argparse.h"
#include "generalUtils.h"
#include <sstream>
#include <iostream>
#include <cstring>
#include <iomanip>
#include <math.h>
Argparse::Argparse ()
: freq (82.0),
minfreq(0.02),
maxfreq(0.98),
assoclevel(1.0),
avgcov(5.0),
error(0.001),
maxq(41.0),
qoffset(33.0),
nsites(1),
seqname("chr1"),
npops(1),
fst(0.0),
_fail(0)
{}
int Argparse::parseInput (const int c, char** v, const char* version)
{
int argPos = 1;
int increment = 0;
int i;
if (c < 2)
{
maininfo(version);
return 1;
}
while (argPos < c)
{
if (strcmp(v[argPos],"-help") == 0)
{
maininfo(version);
return 1;
}
else if (strcmp(v[argPos], "-outfile") == 0)
{
outfile = v[argPos+1];
}
else if (strcmp(v[argPos], "-npools") == 0)
{
npools.reserve(2);
i=1;
while (argPos+i < c && isdigit(v[argPos+i][0]))
{
if (atoi(v[argPos+i]) < 1)
{
fprintf(stderr,"Treatment %i has no samples\n",i);
return -1;
}
npools.push_back(atoi(v[argPos+i]));
++i;
}
increment=i-2;
}
else if (strcmp(v[argPos], "-nind") == 0)
{
nind.reserve(2);
i=1;
while (argPos+i < c && isdigit(v[argPos+i][0]))
{
if (atoi(v[argPos+i]) < 1)
{
fprintf(stderr,"Treatment %i has pool size of zero\n",i);
return -1;
}
nind.push_back(atoi(v[argPos+i]));
++i;
}
increment=i-2;
}
else if (strcmp(v[argPos], "-avgcov") == 0)
{
avgcov = atof(v[argPos+1]);
if (avgcov <= 0.0)
{
fprintf(stderr, "average coverage must be > 0.0\n");
return -1;
}
}
else if (strcmp(v[argPos], "-error")==0)
{
error=atof(v[argPos+1]);
if (error < 0.0 || error > 1.0)
{
fprintf(stderr,"Sequencing error rate must be in [0,1]\n");
return -1;
}
}
else if (strcmp(v[argPos], "-freq") == 0)
{
if (strcmp(v[argPos+1], "R") == 0 || strcmp(v[argPos+1], "r") == 0 )
{
freq = 82.0; // R ascii decimal value
}
else
{
freq = atof(v[argPos+1]);
if (freq < 0.0 || freq > 1.0)
{
fprintf(stderr,"Invalid allele frequency %f\n",freq);
return -1;
}
}
}
else if (strcmp(v[argPos], "-minfreq") == 0)
{
minfreq=atof(v[argPos+1]);
}
else if (strcmp(v[argPos],"-maxfreq")==0)
{
maxfreq=atof(v[argPos+1]);
}
else if (strcmp(v[argPos], "-assoclevel") == 0)
{
assoclevel=atof(v[argPos+1]);
if (assoclevel < 0.0 )
{
fprintf(stderr, "-assoclevel argument must be >= 0\n");
return -1;
}
}
else if (strcmp(v[argPos], "-maxq") == 0)
{
maxq=atof(v[argPos+1]);
if (maxq < 0.0 )
{
fprintf(stderr,"-maxq argument must be >= 0.0\n");
return -1;
}
}
else if (strcmp(v[argPos], "-qoffset") == 0)
{
qoffset=atof(v[argPos+1]);
}
else if (strcmp(v[argPos], "-nsites") == 0)
{
std::stringstream strvalue;
strvalue << v[argPos+1];
strvalue >> nsites;
if (nsites < 0)
{
fprintf(stderr,"Invalid number of sites to simulate: %u",nsites);
return -1;
}
}
else if (strcmp(v[argPos], "-seqname") == 0)
{
seqname = v[argPos+1];
if (seqname.empty())
{
fprintf(stderr,"No sequence name supplied\n");
return -1;
}
}
else if (strcmp(v[argPos],"-fst")==0)
{
fst = atof(v[argPos+1]);
if (fst < 0.0 || fst > 1.0)
{
fprintf(stderr,"Invalid Fst value %f",fst);
return -1;
}
}
else if (strcmp(v[argPos],"-npops")==0)
{
npops = atoi(v[argPos+1]);
if (npops < 1)
{
fprintf(stderr,"number of populations to sample must be at least 1\n");
return -1;
}
}
else
{
fprintf(stderr, "Unknown option: %s\n", v[argPos]);
return -1;
}
argPos += 2 + increment;
increment = 0;
}
if (-10*log10(error) > maxq)
{
fprintf(stderr, "Phred-scaled error rate %f exceeds max base quality %f",error,maxq);
return -1;
}
if (qoffset < 0.0 || qoffset >= maxq)
{
fprintf(stderr,"Invalid quality score offset _qoffset %f",qoffset);
return -1;
}
if (minfreq < 0.0 || maxfreq > 1.0 || maxfreq < minfreq)
{
fprintf(stderr,"Invalid bounds on causative allele frequency [%f %f]\n",minfreq,maxfreq);
return-1;
}
return 0;
}
int Argparse::fail()
{
return _fail;
}
void Argparse::maininfo (const char* v)
{
int w = 12;
std::cerr << "\nsimAssociation version " << v << "\n\nUsage: simAssociation [options]\n"
<< "\nInput:\n"
<< "\n" << std::setw(w) << std::left << "-outfile" << std::setw(w) << "FILE" << "File to output results to"
<< "\n" << std::setw(w) << std::left << "-freq" << std::setw(w) << "FLOAT|R" << "Frequency of causative allele; 'R' specifies random frequency bounded by -minfreq and -maxfreq [" << static_cast<char>(freq) << "]"
<< "\n" << std::setw(w) << std::left << "-minfreq" << std::setw(w) << "FLOAT" << "Minimum causative allele frequency [" << minfreq << "]"
<< "\n" << std::setw(w) << std::left << "-maxfreq" << std::setw(w) << "FLOAT" << "Maximum causative allele frequency [" << maxfreq << "]"
<< "\n" << std::setw(w) << std::left << "-assoclevel" << std::setw(w) << "FLOAT" << "How many more times frequent the causative allele is in the case population [" << assoclevel << "]"
<< "\n" << std::setw(w) << std::left << "-npops" << std::setw(w) << "INT" << "Sample an equal number of individuals from among INT populations [" << npops << "]"
<< "\n" << std::setw(w) << std::left << "-npools" << std::setw(w) << "INT" << "An array of the number of pools for treatment1, treatment2,...,treatmentn"
<< "\n" << std::setw(w) << std::left << "-nind" << std::setw(w) << "INT" << "An array of the diploid pools size for treatment1, treatment2,...,treatmentn"
<< "\n" << std::setw(w) << std::left << "-avgcov" << std::setw(w) << "FLOAT" << "Average sequencing depth per pool [" << avgcov << "]"
<< "\n" << std::setw(w) << std::left << "-error" << std::setw(w) << "FLOAT" << "Average sequencing error rate [" << error << "]"
<< "\n" << std::setw(w) << std::left << "-maxq" << std::setw(w) << "FLOAT" << "Maximum Phred-scaled quality score [" << maxq << "]"
<< "\n" << std::setw(w) << std::left << "-qoffset" << std::setw(w) << "FLOAT" << "Minimum possible ASCII decimal value used to encode quality scores [" << qoffset << "]"
<< "\n" << std::setw(w) << std::left << "-nsites" << std::setw(w) << "INT" << "Number of sites to simulate [" << nsites << "]"
<< "\n" << std::setw(w) << std::left << "-seqname" << std::setw(w) << "FLOAT" << "Name of sequenced chromosome, scaffold, contig, etc. [" << seqname << "]"
<< "\n" << std::setw(w) << std::left << "-fst" << std::setw(w) << "FLOAT" << "Fst between sampled populations [" << fst << "]"
<< "\n\nOutput parameter file format:"
<< "\n(1) chromosome name"
<< "\n(2) site number"
<< "\n(3) Fst"
<< "\n(4) sample-wide minor allele frequency"
<< "\n(5+) treatment-specific minor allele frequency"
<< "\n\n";
}
|
c4ee08a7bbb1930d0069fe41f8b8c68ed40618b5
|
58d32b4a40f2f319fe4ef2629319d8d65b6be712
|
/MobiCoreDriverLib/ClientLib/mc.pb.cpp
|
a36a52721ee5e710aa686b8534276a5f0fe861cf
|
[
"BSD-2-Clause"
] |
permissive
|
TrustonicNwd/tee-mobicore-driver.daemon
|
dc6b95fe8fdcacdc5262045ba86e1d8d490a664f
|
4cb5c5628db8c07e06757928dab5731a2ec820e6
|
refs/heads/MC12
| 2021-07-06T09:23:26.675892
| 2016-10-04T15:15:45
| 2016-10-04T15:15:45
| 32,801,823
| 2
| 4
| null | 2016-10-04T15:15:46
| 2015-03-24T13:54:05
|
C++
|
UTF-8
|
C++
| false
| false
| 175,399
|
cpp
|
mc.pb.cpp
|
/*
* Copyright (c) 2013-2015 TRUSTONIC LIMITED
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the TRUSTONIC LIMITED 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.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mc.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "mc.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
namespace com {
namespace trustonic {
namespace tee_proxy {
void protobuf_ShutdownFile_mc_2eproto() {
delete OpenSessionRequest::default_instance_;
delete OpenSessionResponse::default_instance_;
delete OpenTrustletRequest::default_instance_;
delete OpenTrustletResponse::default_instance_;
delete CloseSessionRequest::default_instance_;
delete CloseSessionResponse::default_instance_;
delete NotifyRequest::default_instance_;
delete NotifyRequest_Buffers::default_instance_;
delete NotifyResponse::default_instance_;
delete WaitNotificationRequest::default_instance_;
delete WaitNotificationResponse::default_instance_;
delete WaitNotificationResponse_Buffers::default_instance_;
delete MapRequest::default_instance_;
delete MapRequest_Buffers::default_instance_;
delete MapResponse::default_instance_;
delete MapResponse_Buffers::default_instance_;
delete UnmapRequest::default_instance_;
delete UnmapRequest_Buffers::default_instance_;
delete UnmapResponse::default_instance_;
delete GetErrorRequest::default_instance_;
delete GetErrorResponse::default_instance_;
delete GetVersionRequest::default_instance_;
delete GetVersionResponse::default_instance_;
delete GpRequestCancellationRequest::default_instance_;
delete GpRequestCancellationResponse::default_instance_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
void protobuf_AddDesc_mc_2eproto_impl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
#else
void protobuf_AddDesc_mc_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
#endif
OpenSessionRequest::default_instance_ = new OpenSessionRequest();
OpenSessionResponse::default_instance_ = new OpenSessionResponse();
OpenTrustletRequest::default_instance_ = new OpenTrustletRequest();
OpenTrustletResponse::default_instance_ = new OpenTrustletResponse();
CloseSessionRequest::default_instance_ = new CloseSessionRequest();
CloseSessionResponse::default_instance_ = new CloseSessionResponse();
NotifyRequest::default_instance_ = new NotifyRequest();
NotifyRequest_Buffers::default_instance_ = new NotifyRequest_Buffers();
NotifyResponse::default_instance_ = new NotifyResponse();
WaitNotificationRequest::default_instance_ = new WaitNotificationRequest();
WaitNotificationResponse::default_instance_ = new WaitNotificationResponse();
WaitNotificationResponse_Buffers::default_instance_ = new WaitNotificationResponse_Buffers();
MapRequest::default_instance_ = new MapRequest();
MapRequest_Buffers::default_instance_ = new MapRequest_Buffers();
MapResponse::default_instance_ = new MapResponse();
MapResponse_Buffers::default_instance_ = new MapResponse_Buffers();
UnmapRequest::default_instance_ = new UnmapRequest();
UnmapRequest_Buffers::default_instance_ = new UnmapRequest_Buffers();
UnmapResponse::default_instance_ = new UnmapResponse();
GetErrorRequest::default_instance_ = new GetErrorRequest();
GetErrorResponse::default_instance_ = new GetErrorResponse();
GetVersionRequest::default_instance_ = new GetVersionRequest();
GetVersionResponse::default_instance_ = new GetVersionResponse();
GpRequestCancellationRequest::default_instance_ = new GpRequestCancellationRequest();
GpRequestCancellationResponse::default_instance_ = new GpRequestCancellationResponse();
OpenSessionRequest::default_instance_->InitAsDefaultInstance();
OpenSessionResponse::default_instance_->InitAsDefaultInstance();
OpenTrustletRequest::default_instance_->InitAsDefaultInstance();
OpenTrustletResponse::default_instance_->InitAsDefaultInstance();
CloseSessionRequest::default_instance_->InitAsDefaultInstance();
CloseSessionResponse::default_instance_->InitAsDefaultInstance();
NotifyRequest::default_instance_->InitAsDefaultInstance();
NotifyRequest_Buffers::default_instance_->InitAsDefaultInstance();
NotifyResponse::default_instance_->InitAsDefaultInstance();
WaitNotificationRequest::default_instance_->InitAsDefaultInstance();
WaitNotificationResponse::default_instance_->InitAsDefaultInstance();
WaitNotificationResponse_Buffers::default_instance_->InitAsDefaultInstance();
MapRequest::default_instance_->InitAsDefaultInstance();
MapRequest_Buffers::default_instance_->InitAsDefaultInstance();
MapResponse::default_instance_->InitAsDefaultInstance();
MapResponse_Buffers::default_instance_->InitAsDefaultInstance();
UnmapRequest::default_instance_->InitAsDefaultInstance();
UnmapRequest_Buffers::default_instance_->InitAsDefaultInstance();
UnmapResponse::default_instance_->InitAsDefaultInstance();
GetErrorRequest::default_instance_->InitAsDefaultInstance();
GetErrorResponse::default_instance_->InitAsDefaultInstance();
GetVersionRequest::default_instance_->InitAsDefaultInstance();
GetVersionResponse::default_instance_->InitAsDefaultInstance();
GpRequestCancellationRequest::default_instance_->InitAsDefaultInstance();
GpRequestCancellationResponse::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_mc_2eproto);
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_mc_2eproto_once_);
void protobuf_AddDesc_mc_2eproto() {
::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_mc_2eproto_once_,
&protobuf_AddDesc_mc_2eproto_impl);
}
#else
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_mc_2eproto {
StaticDescriptorInitializer_mc_2eproto() {
protobuf_AddDesc_mc_2eproto();
}
} static_descriptor_initializer_mc_2eproto_;
#endif
bool LoginType_IsValid(int value) {
switch(value) {
case 0:
case 1:
case 2:
case 4:
case 5:
case 6:
return true;
default:
return false;
}
}
// ===================================================================
#ifndef _MSC_VER
const int OpenSessionRequest::kUuidFieldNumber;
const int OpenSessionRequest::kIsGpUuidFieldNumber;
const int OpenSessionRequest::kTciFieldNumber;
const int OpenSessionRequest::kLoginTypeFieldNumber;
const int OpenSessionRequest::kLoginDataFieldNumber;
#endif // !_MSC_VER
OpenSessionRequest::OpenSessionRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.OpenSessionRequest)
}
void OpenSessionRequest::InitAsDefaultInstance() {
}
OpenSessionRequest::OpenSessionRequest(const OpenSessionRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.OpenSessionRequest)
}
void OpenSessionRequest::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
uuid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
is_gp_uuid_ = false;
tci_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
login_type_ = 0;
login_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
OpenSessionRequest::~OpenSessionRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.OpenSessionRequest)
SharedDtor();
}
void OpenSessionRequest::SharedDtor() {
if (uuid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete uuid_;
}
if (tci_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete tci_;
}
if (login_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete login_data_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void OpenSessionRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const OpenSessionRequest& OpenSessionRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
OpenSessionRequest* OpenSessionRequest::default_instance_ = NULL;
OpenSessionRequest* OpenSessionRequest::New() const {
return new OpenSessionRequest;
}
void OpenSessionRequest::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<OpenSessionRequest*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
if (_has_bits_[0 / 32] & 31) {
ZR_(is_gp_uuid_, login_type_);
if (has_uuid()) {
if (uuid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
uuid_->clear();
}
}
if (has_tci()) {
if (tci_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
tci_->clear();
}
}
if (has_login_data()) {
if (login_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
login_data_->clear();
}
}
}
#undef OFFSET_OF_FIELD_
#undef ZR_
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool OpenSessionRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.OpenSessionRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required bytes uuid = 1;
case 1: {
if (tag == 10) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_uuid()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(16)) goto parse_is_gp_uuid;
break;
}
// required bool is_gp_uuid = 2;
case 2: {
if (tag == 16) {
parse_is_gp_uuid:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &is_gp_uuid_)));
set_has_is_gp_uuid();
} else {
goto handle_unusual;
}
if (input->ExpectTag(26)) goto parse_tci;
break;
}
// optional bytes tci = 3;
case 3: {
if (tag == 26) {
parse_tci:
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_tci()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(32)) goto parse_login_type;
break;
}
// required .com.trustonic.tee_proxy.LoginType login_type = 4;
case 4: {
if (tag == 32) {
parse_login_type:
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::com::trustonic::tee_proxy::LoginType_IsValid(value)) {
set_login_type(static_cast< ::com::trustonic::tee_proxy::LoginType >(value));
} else {
unknown_fields_stream.WriteVarint32(tag);
unknown_fields_stream.WriteVarint32(value);
}
} else {
goto handle_unusual;
}
if (input->ExpectTag(42)) goto parse_login_data;
break;
}
// required bytes login_data = 5;
case 5: {
if (tag == 42) {
parse_login_data:
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_login_data()));
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.OpenSessionRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.OpenSessionRequest)
return false;
#undef DO_
}
void OpenSessionRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.OpenSessionRequest)
// required bytes uuid = 1;
if (has_uuid()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
1, this->uuid(), output);
}
// required bool is_gp_uuid = 2;
if (has_is_gp_uuid()) {
::google::protobuf::internal::WireFormatLite::WriteBool(2, this->is_gp_uuid(), output);
}
// optional bytes tci = 3;
if (has_tci()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
3, this->tci(), output);
}
// required .com.trustonic.tee_proxy.LoginType login_type = 4;
if (has_login_type()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
4, this->login_type(), output);
}
// required bytes login_data = 5;
if (has_login_data()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
5, this->login_data(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.OpenSessionRequest)
}
int OpenSessionRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required bytes uuid = 1;
if (has_uuid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->uuid());
}
// required bool is_gp_uuid = 2;
if (has_is_gp_uuid()) {
total_size += 1 + 1;
}
// optional bytes tci = 3;
if (has_tci()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->tci());
}
// required .com.trustonic.tee_proxy.LoginType login_type = 4;
if (has_login_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->login_type());
}
// required bytes login_data = 5;
if (has_login_data()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->login_data());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void OpenSessionRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const OpenSessionRequest*>(&from));
}
void OpenSessionRequest::MergeFrom(const OpenSessionRequest& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_uuid()) {
set_uuid(from.uuid());
}
if (from.has_is_gp_uuid()) {
set_is_gp_uuid(from.is_gp_uuid());
}
if (from.has_tci()) {
set_tci(from.tci());
}
if (from.has_login_type()) {
set_login_type(from.login_type());
}
if (from.has_login_data()) {
set_login_data(from.login_data());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void OpenSessionRequest::CopyFrom(const OpenSessionRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool OpenSessionRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x0000001b) != 0x0000001b) return false;
return true;
}
void OpenSessionRequest::Swap(OpenSessionRequest* other) {
if (other != this) {
std::swap(uuid_, other->uuid_);
std::swap(is_gp_uuid_, other->is_gp_uuid_);
std::swap(tci_, other->tci_);
std::swap(login_type_, other->login_type_);
std::swap(login_data_, other->login_data_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string OpenSessionRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.OpenSessionRequest";
}
// ===================================================================
#ifndef _MSC_VER
const int OpenSessionResponse::kIdFieldNumber;
#endif // !_MSC_VER
OpenSessionResponse::OpenSessionResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.OpenSessionResponse)
}
void OpenSessionResponse::InitAsDefaultInstance() {
}
OpenSessionResponse::OpenSessionResponse(const OpenSessionResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.OpenSessionResponse)
}
void OpenSessionResponse::SharedCtor() {
_cached_size_ = 0;
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
OpenSessionResponse::~OpenSessionResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.OpenSessionResponse)
SharedDtor();
}
void OpenSessionResponse::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void OpenSessionResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const OpenSessionResponse& OpenSessionResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
OpenSessionResponse* OpenSessionResponse::default_instance_ = NULL;
OpenSessionResponse* OpenSessionResponse::New() const {
return new OpenSessionResponse;
}
void OpenSessionResponse::Clear() {
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool OpenSessionResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.OpenSessionResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 id = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.OpenSessionResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.OpenSessionResponse)
return false;
#undef DO_
}
void OpenSessionResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.OpenSessionResponse)
// required uint32 id = 1;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->id(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.OpenSessionResponse)
}
int OpenSessionResponse::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 id = 1;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void OpenSessionResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const OpenSessionResponse*>(&from));
}
void OpenSessionResponse::MergeFrom(const OpenSessionResponse& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_id()) {
set_id(from.id());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void OpenSessionResponse::CopyFrom(const OpenSessionResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool OpenSessionResponse::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void OpenSessionResponse::Swap(OpenSessionResponse* other) {
if (other != this) {
std::swap(id_, other->id_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string OpenSessionResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.OpenSessionResponse";
}
// ===================================================================
#ifndef _MSC_VER
const int OpenTrustletRequest::kSpidFieldNumber;
const int OpenTrustletRequest::kTrustappFieldNumber;
const int OpenTrustletRequest::kTciFieldNumber;
#endif // !_MSC_VER
OpenTrustletRequest::OpenTrustletRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.OpenTrustletRequest)
}
void OpenTrustletRequest::InitAsDefaultInstance() {
}
OpenTrustletRequest::OpenTrustletRequest(const OpenTrustletRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.OpenTrustletRequest)
}
void OpenTrustletRequest::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
spid_ = 0u;
trustapp_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
tci_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
OpenTrustletRequest::~OpenTrustletRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.OpenTrustletRequest)
SharedDtor();
}
void OpenTrustletRequest::SharedDtor() {
if (trustapp_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete trustapp_;
}
if (tci_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete tci_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void OpenTrustletRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const OpenTrustletRequest& OpenTrustletRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
OpenTrustletRequest* OpenTrustletRequest::default_instance_ = NULL;
OpenTrustletRequest* OpenTrustletRequest::New() const {
return new OpenTrustletRequest;
}
void OpenTrustletRequest::Clear() {
if (_has_bits_[0 / 32] & 7) {
spid_ = 0u;
if (has_trustapp()) {
if (trustapp_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
trustapp_->clear();
}
}
if (has_tci()) {
if (tci_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
tci_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool OpenTrustletRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.OpenTrustletRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 spid = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &spid_)));
set_has_spid();
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_trustapp;
break;
}
// required bytes trustapp = 2;
case 2: {
if (tag == 18) {
parse_trustapp:
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_trustapp()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(26)) goto parse_tci;
break;
}
// optional bytes tci = 3;
case 3: {
if (tag == 26) {
parse_tci:
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_tci()));
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.OpenTrustletRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.OpenTrustletRequest)
return false;
#undef DO_
}
void OpenTrustletRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.OpenTrustletRequest)
// required uint32 spid = 1;
if (has_spid()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->spid(), output);
}
// required bytes trustapp = 2;
if (has_trustapp()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
2, this->trustapp(), output);
}
// optional bytes tci = 3;
if (has_tci()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
3, this->tci(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.OpenTrustletRequest)
}
int OpenTrustletRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 spid = 1;
if (has_spid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->spid());
}
// required bytes trustapp = 2;
if (has_trustapp()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->trustapp());
}
// optional bytes tci = 3;
if (has_tci()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->tci());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void OpenTrustletRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const OpenTrustletRequest*>(&from));
}
void OpenTrustletRequest::MergeFrom(const OpenTrustletRequest& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_spid()) {
set_spid(from.spid());
}
if (from.has_trustapp()) {
set_trustapp(from.trustapp());
}
if (from.has_tci()) {
set_tci(from.tci());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void OpenTrustletRequest::CopyFrom(const OpenTrustletRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool OpenTrustletRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void OpenTrustletRequest::Swap(OpenTrustletRequest* other) {
if (other != this) {
std::swap(spid_, other->spid_);
std::swap(trustapp_, other->trustapp_);
std::swap(tci_, other->tci_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string OpenTrustletRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.OpenTrustletRequest";
}
// ===================================================================
#ifndef _MSC_VER
const int OpenTrustletResponse::kIdFieldNumber;
#endif // !_MSC_VER
OpenTrustletResponse::OpenTrustletResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.OpenTrustletResponse)
}
void OpenTrustletResponse::InitAsDefaultInstance() {
}
OpenTrustletResponse::OpenTrustletResponse(const OpenTrustletResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.OpenTrustletResponse)
}
void OpenTrustletResponse::SharedCtor() {
_cached_size_ = 0;
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
OpenTrustletResponse::~OpenTrustletResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.OpenTrustletResponse)
SharedDtor();
}
void OpenTrustletResponse::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void OpenTrustletResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const OpenTrustletResponse& OpenTrustletResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
OpenTrustletResponse* OpenTrustletResponse::default_instance_ = NULL;
OpenTrustletResponse* OpenTrustletResponse::New() const {
return new OpenTrustletResponse;
}
void OpenTrustletResponse::Clear() {
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool OpenTrustletResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.OpenTrustletResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 id = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.OpenTrustletResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.OpenTrustletResponse)
return false;
#undef DO_
}
void OpenTrustletResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.OpenTrustletResponse)
// required uint32 id = 1;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->id(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.OpenTrustletResponse)
}
int OpenTrustletResponse::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 id = 1;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void OpenTrustletResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const OpenTrustletResponse*>(&from));
}
void OpenTrustletResponse::MergeFrom(const OpenTrustletResponse& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_id()) {
set_id(from.id());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void OpenTrustletResponse::CopyFrom(const OpenTrustletResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool OpenTrustletResponse::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void OpenTrustletResponse::Swap(OpenTrustletResponse* other) {
if (other != this) {
std::swap(id_, other->id_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string OpenTrustletResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.OpenTrustletResponse";
}
// ===================================================================
#ifndef _MSC_VER
const int CloseSessionRequest::kIdFieldNumber;
#endif // !_MSC_VER
CloseSessionRequest::CloseSessionRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.CloseSessionRequest)
}
void CloseSessionRequest::InitAsDefaultInstance() {
}
CloseSessionRequest::CloseSessionRequest(const CloseSessionRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.CloseSessionRequest)
}
void CloseSessionRequest::SharedCtor() {
_cached_size_ = 0;
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CloseSessionRequest::~CloseSessionRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.CloseSessionRequest)
SharedDtor();
}
void CloseSessionRequest::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void CloseSessionRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const CloseSessionRequest& CloseSessionRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
CloseSessionRequest* CloseSessionRequest::default_instance_ = NULL;
CloseSessionRequest* CloseSessionRequest::New() const {
return new CloseSessionRequest;
}
void CloseSessionRequest::Clear() {
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool CloseSessionRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.CloseSessionRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 id = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.CloseSessionRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.CloseSessionRequest)
return false;
#undef DO_
}
void CloseSessionRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.CloseSessionRequest)
// required uint32 id = 1;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->id(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.CloseSessionRequest)
}
int CloseSessionRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 id = 1;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CloseSessionRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const CloseSessionRequest*>(&from));
}
void CloseSessionRequest::MergeFrom(const CloseSessionRequest& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_id()) {
set_id(from.id());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void CloseSessionRequest::CopyFrom(const CloseSessionRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CloseSessionRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CloseSessionRequest::Swap(CloseSessionRequest* other) {
if (other != this) {
std::swap(id_, other->id_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string CloseSessionRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.CloseSessionRequest";
}
// ===================================================================
#ifndef _MSC_VER
#endif // !_MSC_VER
CloseSessionResponse::CloseSessionResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.CloseSessionResponse)
}
void CloseSessionResponse::InitAsDefaultInstance() {
}
CloseSessionResponse::CloseSessionResponse(const CloseSessionResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.CloseSessionResponse)
}
void CloseSessionResponse::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CloseSessionResponse::~CloseSessionResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.CloseSessionResponse)
SharedDtor();
}
void CloseSessionResponse::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void CloseSessionResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const CloseSessionResponse& CloseSessionResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
CloseSessionResponse* CloseSessionResponse::default_instance_ = NULL;
CloseSessionResponse* CloseSessionResponse::New() const {
return new CloseSessionResponse;
}
void CloseSessionResponse::Clear() {
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool CloseSessionResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.CloseSessionResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.CloseSessionResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.CloseSessionResponse)
return false;
#undef DO_
}
void CloseSessionResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.CloseSessionResponse)
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.CloseSessionResponse)
}
int CloseSessionResponse::ByteSize() const {
int total_size = 0;
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CloseSessionResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const CloseSessionResponse*>(&from));
}
void CloseSessionResponse::MergeFrom(const CloseSessionResponse& from) {
GOOGLE_CHECK_NE(&from, this);
mutable_unknown_fields()->append(from.unknown_fields());
}
void CloseSessionResponse::CopyFrom(const CloseSessionResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CloseSessionResponse::IsInitialized() const {
return true;
}
void CloseSessionResponse::Swap(CloseSessionResponse* other) {
if (other != this) {
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string CloseSessionResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.CloseSessionResponse";
}
// ===================================================================
#ifndef _MSC_VER
const int NotifyRequest_Buffers::kSvaFieldNumber;
const int NotifyRequest_Buffers::kDataFieldNumber;
#endif // !_MSC_VER
NotifyRequest_Buffers::NotifyRequest_Buffers()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.NotifyRequest.Buffers)
}
void NotifyRequest_Buffers::InitAsDefaultInstance() {
}
NotifyRequest_Buffers::NotifyRequest_Buffers(const NotifyRequest_Buffers& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.NotifyRequest.Buffers)
}
void NotifyRequest_Buffers::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
sva_ = GOOGLE_ULONGLONG(0);
data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
NotifyRequest_Buffers::~NotifyRequest_Buffers() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.NotifyRequest.Buffers)
SharedDtor();
}
void NotifyRequest_Buffers::SharedDtor() {
if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete data_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void NotifyRequest_Buffers::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const NotifyRequest_Buffers& NotifyRequest_Buffers::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
NotifyRequest_Buffers* NotifyRequest_Buffers::default_instance_ = NULL;
NotifyRequest_Buffers* NotifyRequest_Buffers::New() const {
return new NotifyRequest_Buffers;
}
void NotifyRequest_Buffers::Clear() {
if (_has_bits_[0 / 32] & 3) {
sva_ = GOOGLE_ULONGLONG(0);
if (has_data()) {
if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
data_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool NotifyRequest_Buffers::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.NotifyRequest.Buffers)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint64 sva = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &sva_)));
set_has_sva();
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_data;
break;
}
// required bytes data = 2;
case 2: {
if (tag == 18) {
parse_data:
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_data()));
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.NotifyRequest.Buffers)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.NotifyRequest.Buffers)
return false;
#undef DO_
}
void NotifyRequest_Buffers::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.NotifyRequest.Buffers)
// required uint64 sva = 1;
if (has_sva()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->sva(), output);
}
// required bytes data = 2;
if (has_data()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
2, this->data(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.NotifyRequest.Buffers)
}
int NotifyRequest_Buffers::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint64 sva = 1;
if (has_sva()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->sva());
}
// required bytes data = 2;
if (has_data()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->data());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void NotifyRequest_Buffers::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const NotifyRequest_Buffers*>(&from));
}
void NotifyRequest_Buffers::MergeFrom(const NotifyRequest_Buffers& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sva()) {
set_sva(from.sva());
}
if (from.has_data()) {
set_data(from.data());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void NotifyRequest_Buffers::CopyFrom(const NotifyRequest_Buffers& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool NotifyRequest_Buffers::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void NotifyRequest_Buffers::Swap(NotifyRequest_Buffers* other) {
if (other != this) {
std::swap(sva_, other->sva_);
std::swap(data_, other->data_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string NotifyRequest_Buffers::GetTypeName() const {
return "com.trustonic.tee_proxy.NotifyRequest.Buffers";
}
// -------------------------------------------------------------------
#ifndef _MSC_VER
const int NotifyRequest::kSidFieldNumber;
const int NotifyRequest::kTciFieldNumber;
const int NotifyRequest::kBuffersFieldNumber;
#endif // !_MSC_VER
NotifyRequest::NotifyRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.NotifyRequest)
}
void NotifyRequest::InitAsDefaultInstance() {
}
NotifyRequest::NotifyRequest(const NotifyRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.NotifyRequest)
}
void NotifyRequest::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
sid_ = 0u;
tci_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
NotifyRequest::~NotifyRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.NotifyRequest)
SharedDtor();
}
void NotifyRequest::SharedDtor() {
if (tci_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete tci_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void NotifyRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const NotifyRequest& NotifyRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
NotifyRequest* NotifyRequest::default_instance_ = NULL;
NotifyRequest* NotifyRequest::New() const {
return new NotifyRequest;
}
void NotifyRequest::Clear() {
if (_has_bits_[0 / 32] & 3) {
sid_ = 0u;
if (has_tci()) {
if (tci_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
tci_->clear();
}
}
}
buffers_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool NotifyRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.NotifyRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 sid = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &sid_)));
set_has_sid();
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_tci;
break;
}
// optional bytes tci = 2;
case 2: {
if (tag == 18) {
parse_tci:
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_tci()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(26)) goto parse_buffers;
break;
}
// repeated .com.trustonic.tee_proxy.NotifyRequest.Buffers buffers = 3;
case 3: {
if (tag == 26) {
parse_buffers:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_buffers()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(26)) goto parse_buffers;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.NotifyRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.NotifyRequest)
return false;
#undef DO_
}
void NotifyRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.NotifyRequest)
// required uint32 sid = 1;
if (has_sid()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sid(), output);
}
// optional bytes tci = 2;
if (has_tci()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
2, this->tci(), output);
}
// repeated .com.trustonic.tee_proxy.NotifyRequest.Buffers buffers = 3;
for (int i = 0; i < this->buffers_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessage(
3, this->buffers(i), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.NotifyRequest)
}
int NotifyRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 sid = 1;
if (has_sid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->sid());
}
// optional bytes tci = 2;
if (has_tci()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->tci());
}
}
// repeated .com.trustonic.tee_proxy.NotifyRequest.Buffers buffers = 3;
total_size += 1 * this->buffers_size();
for (int i = 0; i < this->buffers_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->buffers(i));
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void NotifyRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const NotifyRequest*>(&from));
}
void NotifyRequest::MergeFrom(const NotifyRequest& from) {
GOOGLE_CHECK_NE(&from, this);
buffers_.MergeFrom(from.buffers_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sid()) {
set_sid(from.sid());
}
if (from.has_tci()) {
set_tci(from.tci());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void NotifyRequest::CopyFrom(const NotifyRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool NotifyRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
if (!::google::protobuf::internal::AllAreInitialized(this->buffers())) return false;
return true;
}
void NotifyRequest::Swap(NotifyRequest* other) {
if (other != this) {
std::swap(sid_, other->sid_);
std::swap(tci_, other->tci_);
buffers_.Swap(&other->buffers_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string NotifyRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.NotifyRequest";
}
// ===================================================================
#ifndef _MSC_VER
#endif // !_MSC_VER
NotifyResponse::NotifyResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.NotifyResponse)
}
void NotifyResponse::InitAsDefaultInstance() {
}
NotifyResponse::NotifyResponse(const NotifyResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.NotifyResponse)
}
void NotifyResponse::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
NotifyResponse::~NotifyResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.NotifyResponse)
SharedDtor();
}
void NotifyResponse::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void NotifyResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const NotifyResponse& NotifyResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
NotifyResponse* NotifyResponse::default_instance_ = NULL;
NotifyResponse* NotifyResponse::New() const {
return new NotifyResponse;
}
void NotifyResponse::Clear() {
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool NotifyResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.NotifyResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.NotifyResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.NotifyResponse)
return false;
#undef DO_
}
void NotifyResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.NotifyResponse)
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.NotifyResponse)
}
int NotifyResponse::ByteSize() const {
int total_size = 0;
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void NotifyResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const NotifyResponse*>(&from));
}
void NotifyResponse::MergeFrom(const NotifyResponse& from) {
GOOGLE_CHECK_NE(&from, this);
mutable_unknown_fields()->append(from.unknown_fields());
}
void NotifyResponse::CopyFrom(const NotifyResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool NotifyResponse::IsInitialized() const {
return true;
}
void NotifyResponse::Swap(NotifyResponse* other) {
if (other != this) {
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string NotifyResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.NotifyResponse";
}
// ===================================================================
#ifndef _MSC_VER
const int WaitNotificationRequest::kSidFieldNumber;
const int WaitNotificationRequest::kTimeoutFieldNumber;
const int WaitNotificationRequest::kPartialFieldNumber;
#endif // !_MSC_VER
WaitNotificationRequest::WaitNotificationRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.WaitNotificationRequest)
}
void WaitNotificationRequest::InitAsDefaultInstance() {
}
WaitNotificationRequest::WaitNotificationRequest(const WaitNotificationRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.WaitNotificationRequest)
}
void WaitNotificationRequest::SharedCtor() {
_cached_size_ = 0;
sid_ = 0u;
timeout_ = 0;
partial_ = false;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
WaitNotificationRequest::~WaitNotificationRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.WaitNotificationRequest)
SharedDtor();
}
void WaitNotificationRequest::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void WaitNotificationRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const WaitNotificationRequest& WaitNotificationRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
WaitNotificationRequest* WaitNotificationRequest::default_instance_ = NULL;
WaitNotificationRequest* WaitNotificationRequest::New() const {
return new WaitNotificationRequest;
}
void WaitNotificationRequest::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<WaitNotificationRequest*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
ZR_(sid_, partial_);
#undef OFFSET_OF_FIELD_
#undef ZR_
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool WaitNotificationRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.WaitNotificationRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 sid = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &sid_)));
set_has_sid();
} else {
goto handle_unusual;
}
if (input->ExpectTag(16)) goto parse_timeout;
break;
}
// required sint32 timeout = 2;
case 2: {
if (tag == 16) {
parse_timeout:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
input, &timeout_)));
set_has_timeout();
} else {
goto handle_unusual;
}
if (input->ExpectTag(24)) goto parse_partial;
break;
}
// required bool partial = 3;
case 3: {
if (tag == 24) {
parse_partial:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &partial_)));
set_has_partial();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.WaitNotificationRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.WaitNotificationRequest)
return false;
#undef DO_
}
void WaitNotificationRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.WaitNotificationRequest)
// required uint32 sid = 1;
if (has_sid()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sid(), output);
}
// required sint32 timeout = 2;
if (has_timeout()) {
::google::protobuf::internal::WireFormatLite::WriteSInt32(2, this->timeout(), output);
}
// required bool partial = 3;
if (has_partial()) {
::google::protobuf::internal::WireFormatLite::WriteBool(3, this->partial(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.WaitNotificationRequest)
}
int WaitNotificationRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 sid = 1;
if (has_sid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->sid());
}
// required sint32 timeout = 2;
if (has_timeout()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::SInt32Size(
this->timeout());
}
// required bool partial = 3;
if (has_partial()) {
total_size += 1 + 1;
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void WaitNotificationRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const WaitNotificationRequest*>(&from));
}
void WaitNotificationRequest::MergeFrom(const WaitNotificationRequest& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sid()) {
set_sid(from.sid());
}
if (from.has_timeout()) {
set_timeout(from.timeout());
}
if (from.has_partial()) {
set_partial(from.partial());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void WaitNotificationRequest::CopyFrom(const WaitNotificationRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool WaitNotificationRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
return true;
}
void WaitNotificationRequest::Swap(WaitNotificationRequest* other) {
if (other != this) {
std::swap(sid_, other->sid_);
std::swap(timeout_, other->timeout_);
std::swap(partial_, other->partial_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string WaitNotificationRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.WaitNotificationRequest";
}
// ===================================================================
#ifndef _MSC_VER
const int WaitNotificationResponse_Buffers::kSvaFieldNumber;
const int WaitNotificationResponse_Buffers::kDataFieldNumber;
#endif // !_MSC_VER
WaitNotificationResponse_Buffers::WaitNotificationResponse_Buffers()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.WaitNotificationResponse.Buffers)
}
void WaitNotificationResponse_Buffers::InitAsDefaultInstance() {
}
WaitNotificationResponse_Buffers::WaitNotificationResponse_Buffers(const WaitNotificationResponse_Buffers& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.WaitNotificationResponse.Buffers)
}
void WaitNotificationResponse_Buffers::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
sva_ = GOOGLE_ULONGLONG(0);
data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
WaitNotificationResponse_Buffers::~WaitNotificationResponse_Buffers() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.WaitNotificationResponse.Buffers)
SharedDtor();
}
void WaitNotificationResponse_Buffers::SharedDtor() {
if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete data_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void WaitNotificationResponse_Buffers::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const WaitNotificationResponse_Buffers& WaitNotificationResponse_Buffers::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
WaitNotificationResponse_Buffers* WaitNotificationResponse_Buffers::default_instance_ = NULL;
WaitNotificationResponse_Buffers* WaitNotificationResponse_Buffers::New() const {
return new WaitNotificationResponse_Buffers;
}
void WaitNotificationResponse_Buffers::Clear() {
if (_has_bits_[0 / 32] & 3) {
sva_ = GOOGLE_ULONGLONG(0);
if (has_data()) {
if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
data_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool WaitNotificationResponse_Buffers::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.WaitNotificationResponse.Buffers)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint64 sva = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &sva_)));
set_has_sva();
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_data;
break;
}
// required bytes data = 2;
case 2: {
if (tag == 18) {
parse_data:
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_data()));
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.WaitNotificationResponse.Buffers)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.WaitNotificationResponse.Buffers)
return false;
#undef DO_
}
void WaitNotificationResponse_Buffers::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.WaitNotificationResponse.Buffers)
// required uint64 sva = 1;
if (has_sva()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->sva(), output);
}
// required bytes data = 2;
if (has_data()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
2, this->data(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.WaitNotificationResponse.Buffers)
}
int WaitNotificationResponse_Buffers::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint64 sva = 1;
if (has_sva()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->sva());
}
// required bytes data = 2;
if (has_data()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->data());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void WaitNotificationResponse_Buffers::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const WaitNotificationResponse_Buffers*>(&from));
}
void WaitNotificationResponse_Buffers::MergeFrom(const WaitNotificationResponse_Buffers& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sva()) {
set_sva(from.sva());
}
if (from.has_data()) {
set_data(from.data());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void WaitNotificationResponse_Buffers::CopyFrom(const WaitNotificationResponse_Buffers& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool WaitNotificationResponse_Buffers::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void WaitNotificationResponse_Buffers::Swap(WaitNotificationResponse_Buffers* other) {
if (other != this) {
std::swap(sva_, other->sva_);
std::swap(data_, other->data_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string WaitNotificationResponse_Buffers::GetTypeName() const {
return "com.trustonic.tee_proxy.WaitNotificationResponse.Buffers";
}
// -------------------------------------------------------------------
#ifndef _MSC_VER
const int WaitNotificationResponse::kTciFieldNumber;
const int WaitNotificationResponse::kBuffersFieldNumber;
#endif // !_MSC_VER
WaitNotificationResponse::WaitNotificationResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.WaitNotificationResponse)
}
void WaitNotificationResponse::InitAsDefaultInstance() {
}
WaitNotificationResponse::WaitNotificationResponse(const WaitNotificationResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.WaitNotificationResponse)
}
void WaitNotificationResponse::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
tci_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
WaitNotificationResponse::~WaitNotificationResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.WaitNotificationResponse)
SharedDtor();
}
void WaitNotificationResponse::SharedDtor() {
if (tci_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete tci_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void WaitNotificationResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const WaitNotificationResponse& WaitNotificationResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
WaitNotificationResponse* WaitNotificationResponse::default_instance_ = NULL;
WaitNotificationResponse* WaitNotificationResponse::New() const {
return new WaitNotificationResponse;
}
void WaitNotificationResponse::Clear() {
if (has_tci()) {
if (tci_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
tci_->clear();
}
}
buffers_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool WaitNotificationResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.WaitNotificationResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional bytes tci = 1;
case 1: {
if (tag == 10) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_tci()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_buffers;
break;
}
// repeated .com.trustonic.tee_proxy.WaitNotificationResponse.Buffers buffers = 2;
case 2: {
if (tag == 18) {
parse_buffers:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_buffers()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_buffers;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.WaitNotificationResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.WaitNotificationResponse)
return false;
#undef DO_
}
void WaitNotificationResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.WaitNotificationResponse)
// optional bytes tci = 1;
if (has_tci()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
1, this->tci(), output);
}
// repeated .com.trustonic.tee_proxy.WaitNotificationResponse.Buffers buffers = 2;
for (int i = 0; i < this->buffers_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessage(
2, this->buffers(i), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.WaitNotificationResponse)
}
int WaitNotificationResponse::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// optional bytes tci = 1;
if (has_tci()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->tci());
}
}
// repeated .com.trustonic.tee_proxy.WaitNotificationResponse.Buffers buffers = 2;
total_size += 1 * this->buffers_size();
for (int i = 0; i < this->buffers_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->buffers(i));
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void WaitNotificationResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const WaitNotificationResponse*>(&from));
}
void WaitNotificationResponse::MergeFrom(const WaitNotificationResponse& from) {
GOOGLE_CHECK_NE(&from, this);
buffers_.MergeFrom(from.buffers_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_tci()) {
set_tci(from.tci());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void WaitNotificationResponse::CopyFrom(const WaitNotificationResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool WaitNotificationResponse::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(this->buffers())) return false;
return true;
}
void WaitNotificationResponse::Swap(WaitNotificationResponse* other) {
if (other != this) {
std::swap(tci_, other->tci_);
buffers_.Swap(&other->buffers_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string WaitNotificationResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.WaitNotificationResponse";
}
// ===================================================================
#ifndef _MSC_VER
const int MapRequest_Buffers::kLenFieldNumber;
const int MapRequest_Buffers::kFlagsFieldNumber;
#endif // !_MSC_VER
MapRequest_Buffers::MapRequest_Buffers()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.MapRequest.Buffers)
}
void MapRequest_Buffers::InitAsDefaultInstance() {
}
MapRequest_Buffers::MapRequest_Buffers(const MapRequest_Buffers& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.MapRequest.Buffers)
}
void MapRequest_Buffers::SharedCtor() {
_cached_size_ = 0;
len_ = 0u;
flags_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
MapRequest_Buffers::~MapRequest_Buffers() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.MapRequest.Buffers)
SharedDtor();
}
void MapRequest_Buffers::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void MapRequest_Buffers::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const MapRequest_Buffers& MapRequest_Buffers::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
MapRequest_Buffers* MapRequest_Buffers::default_instance_ = NULL;
MapRequest_Buffers* MapRequest_Buffers::New() const {
return new MapRequest_Buffers;
}
void MapRequest_Buffers::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<MapRequest_Buffers*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
ZR_(len_, flags_);
#undef OFFSET_OF_FIELD_
#undef ZR_
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool MapRequest_Buffers::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.MapRequest.Buffers)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 len = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &len_)));
set_has_len();
} else {
goto handle_unusual;
}
if (input->ExpectTag(16)) goto parse_flags;
break;
}
// required uint32 flags = 2;
case 2: {
if (tag == 16) {
parse_flags:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &flags_)));
set_has_flags();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.MapRequest.Buffers)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.MapRequest.Buffers)
return false;
#undef DO_
}
void MapRequest_Buffers::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.MapRequest.Buffers)
// required uint32 len = 1;
if (has_len()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->len(), output);
}
// required uint32 flags = 2;
if (has_flags()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->flags(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.MapRequest.Buffers)
}
int MapRequest_Buffers::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 len = 1;
if (has_len()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->len());
}
// required uint32 flags = 2;
if (has_flags()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->flags());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void MapRequest_Buffers::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const MapRequest_Buffers*>(&from));
}
void MapRequest_Buffers::MergeFrom(const MapRequest_Buffers& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_len()) {
set_len(from.len());
}
if (from.has_flags()) {
set_flags(from.flags());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void MapRequest_Buffers::CopyFrom(const MapRequest_Buffers& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MapRequest_Buffers::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void MapRequest_Buffers::Swap(MapRequest_Buffers* other) {
if (other != this) {
std::swap(len_, other->len_);
std::swap(flags_, other->flags_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string MapRequest_Buffers::GetTypeName() const {
return "com.trustonic.tee_proxy.MapRequest.Buffers";
}
// -------------------------------------------------------------------
#ifndef _MSC_VER
const int MapRequest::kSidFieldNumber;
const int MapRequest::kBuffersFieldNumber;
#endif // !_MSC_VER
MapRequest::MapRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.MapRequest)
}
void MapRequest::InitAsDefaultInstance() {
}
MapRequest::MapRequest(const MapRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.MapRequest)
}
void MapRequest::SharedCtor() {
_cached_size_ = 0;
sid_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
MapRequest::~MapRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.MapRequest)
SharedDtor();
}
void MapRequest::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void MapRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const MapRequest& MapRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
MapRequest* MapRequest::default_instance_ = NULL;
MapRequest* MapRequest::New() const {
return new MapRequest;
}
void MapRequest::Clear() {
sid_ = 0u;
buffers_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool MapRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.MapRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 sid = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &sid_)));
set_has_sid();
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_buffers;
break;
}
// repeated .com.trustonic.tee_proxy.MapRequest.Buffers buffers = 2;
case 2: {
if (tag == 18) {
parse_buffers:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_buffers()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_buffers;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.MapRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.MapRequest)
return false;
#undef DO_
}
void MapRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.MapRequest)
// required uint32 sid = 1;
if (has_sid()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sid(), output);
}
// repeated .com.trustonic.tee_proxy.MapRequest.Buffers buffers = 2;
for (int i = 0; i < this->buffers_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessage(
2, this->buffers(i), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.MapRequest)
}
int MapRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 sid = 1;
if (has_sid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->sid());
}
}
// repeated .com.trustonic.tee_proxy.MapRequest.Buffers buffers = 2;
total_size += 1 * this->buffers_size();
for (int i = 0; i < this->buffers_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->buffers(i));
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void MapRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const MapRequest*>(&from));
}
void MapRequest::MergeFrom(const MapRequest& from) {
GOOGLE_CHECK_NE(&from, this);
buffers_.MergeFrom(from.buffers_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sid()) {
set_sid(from.sid());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void MapRequest::CopyFrom(const MapRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MapRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
if (!::google::protobuf::internal::AllAreInitialized(this->buffers())) return false;
return true;
}
void MapRequest::Swap(MapRequest* other) {
if (other != this) {
std::swap(sid_, other->sid_);
buffers_.Swap(&other->buffers_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string MapRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.MapRequest";
}
// ===================================================================
#ifndef _MSC_VER
const int MapResponse_Buffers::kSvaFieldNumber;
#endif // !_MSC_VER
MapResponse_Buffers::MapResponse_Buffers()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.MapResponse.Buffers)
}
void MapResponse_Buffers::InitAsDefaultInstance() {
}
MapResponse_Buffers::MapResponse_Buffers(const MapResponse_Buffers& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.MapResponse.Buffers)
}
void MapResponse_Buffers::SharedCtor() {
_cached_size_ = 0;
sva_ = GOOGLE_ULONGLONG(0);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
MapResponse_Buffers::~MapResponse_Buffers() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.MapResponse.Buffers)
SharedDtor();
}
void MapResponse_Buffers::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void MapResponse_Buffers::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const MapResponse_Buffers& MapResponse_Buffers::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
MapResponse_Buffers* MapResponse_Buffers::default_instance_ = NULL;
MapResponse_Buffers* MapResponse_Buffers::New() const {
return new MapResponse_Buffers;
}
void MapResponse_Buffers::Clear() {
sva_ = GOOGLE_ULONGLONG(0);
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool MapResponse_Buffers::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.MapResponse.Buffers)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint64 sva = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &sva_)));
set_has_sva();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.MapResponse.Buffers)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.MapResponse.Buffers)
return false;
#undef DO_
}
void MapResponse_Buffers::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.MapResponse.Buffers)
// required uint64 sva = 1;
if (has_sva()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->sva(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.MapResponse.Buffers)
}
int MapResponse_Buffers::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint64 sva = 1;
if (has_sva()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->sva());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void MapResponse_Buffers::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const MapResponse_Buffers*>(&from));
}
void MapResponse_Buffers::MergeFrom(const MapResponse_Buffers& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sva()) {
set_sva(from.sva());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void MapResponse_Buffers::CopyFrom(const MapResponse_Buffers& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MapResponse_Buffers::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void MapResponse_Buffers::Swap(MapResponse_Buffers* other) {
if (other != this) {
std::swap(sva_, other->sva_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string MapResponse_Buffers::GetTypeName() const {
return "com.trustonic.tee_proxy.MapResponse.Buffers";
}
// -------------------------------------------------------------------
#ifndef _MSC_VER
const int MapResponse::kBuffersFieldNumber;
#endif // !_MSC_VER
MapResponse::MapResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.MapResponse)
}
void MapResponse::InitAsDefaultInstance() {
}
MapResponse::MapResponse(const MapResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.MapResponse)
}
void MapResponse::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
MapResponse::~MapResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.MapResponse)
SharedDtor();
}
void MapResponse::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void MapResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const MapResponse& MapResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
MapResponse* MapResponse::default_instance_ = NULL;
MapResponse* MapResponse::New() const {
return new MapResponse;
}
void MapResponse::Clear() {
buffers_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool MapResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.MapResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// repeated .com.trustonic.tee_proxy.MapResponse.Buffers buffers = 1;
case 1: {
if (tag == 10) {
parse_buffers:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_buffers()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(10)) goto parse_buffers;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.MapResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.MapResponse)
return false;
#undef DO_
}
void MapResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.MapResponse)
// repeated .com.trustonic.tee_proxy.MapResponse.Buffers buffers = 1;
for (int i = 0; i < this->buffers_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessage(
1, this->buffers(i), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.MapResponse)
}
int MapResponse::ByteSize() const {
int total_size = 0;
// repeated .com.trustonic.tee_proxy.MapResponse.Buffers buffers = 1;
total_size += 1 * this->buffers_size();
for (int i = 0; i < this->buffers_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->buffers(i));
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void MapResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const MapResponse*>(&from));
}
void MapResponse::MergeFrom(const MapResponse& from) {
GOOGLE_CHECK_NE(&from, this);
buffers_.MergeFrom(from.buffers_);
mutable_unknown_fields()->append(from.unknown_fields());
}
void MapResponse::CopyFrom(const MapResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MapResponse::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(this->buffers())) return false;
return true;
}
void MapResponse::Swap(MapResponse* other) {
if (other != this) {
buffers_.Swap(&other->buffers_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string MapResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.MapResponse";
}
// ===================================================================
#ifndef _MSC_VER
const int UnmapRequest_Buffers::kSvaFieldNumber;
#endif // !_MSC_VER
UnmapRequest_Buffers::UnmapRequest_Buffers()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.UnmapRequest.Buffers)
}
void UnmapRequest_Buffers::InitAsDefaultInstance() {
}
UnmapRequest_Buffers::UnmapRequest_Buffers(const UnmapRequest_Buffers& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.UnmapRequest.Buffers)
}
void UnmapRequest_Buffers::SharedCtor() {
_cached_size_ = 0;
sva_ = GOOGLE_ULONGLONG(0);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
UnmapRequest_Buffers::~UnmapRequest_Buffers() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.UnmapRequest.Buffers)
SharedDtor();
}
void UnmapRequest_Buffers::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void UnmapRequest_Buffers::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const UnmapRequest_Buffers& UnmapRequest_Buffers::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
UnmapRequest_Buffers* UnmapRequest_Buffers::default_instance_ = NULL;
UnmapRequest_Buffers* UnmapRequest_Buffers::New() const {
return new UnmapRequest_Buffers;
}
void UnmapRequest_Buffers::Clear() {
sva_ = GOOGLE_ULONGLONG(0);
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool UnmapRequest_Buffers::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.UnmapRequest.Buffers)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint64 sva = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &sva_)));
set_has_sva();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.UnmapRequest.Buffers)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.UnmapRequest.Buffers)
return false;
#undef DO_
}
void UnmapRequest_Buffers::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.UnmapRequest.Buffers)
// required uint64 sva = 1;
if (has_sva()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->sva(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.UnmapRequest.Buffers)
}
int UnmapRequest_Buffers::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint64 sva = 1;
if (has_sva()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->sva());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void UnmapRequest_Buffers::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const UnmapRequest_Buffers*>(&from));
}
void UnmapRequest_Buffers::MergeFrom(const UnmapRequest_Buffers& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sva()) {
set_sva(from.sva());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void UnmapRequest_Buffers::CopyFrom(const UnmapRequest_Buffers& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool UnmapRequest_Buffers::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void UnmapRequest_Buffers::Swap(UnmapRequest_Buffers* other) {
if (other != this) {
std::swap(sva_, other->sva_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string UnmapRequest_Buffers::GetTypeName() const {
return "com.trustonic.tee_proxy.UnmapRequest.Buffers";
}
// -------------------------------------------------------------------
#ifndef _MSC_VER
const int UnmapRequest::kSidFieldNumber;
const int UnmapRequest::kBuffersFieldNumber;
#endif // !_MSC_VER
UnmapRequest::UnmapRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.UnmapRequest)
}
void UnmapRequest::InitAsDefaultInstance() {
}
UnmapRequest::UnmapRequest(const UnmapRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.UnmapRequest)
}
void UnmapRequest::SharedCtor() {
_cached_size_ = 0;
sid_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
UnmapRequest::~UnmapRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.UnmapRequest)
SharedDtor();
}
void UnmapRequest::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void UnmapRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const UnmapRequest& UnmapRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
UnmapRequest* UnmapRequest::default_instance_ = NULL;
UnmapRequest* UnmapRequest::New() const {
return new UnmapRequest;
}
void UnmapRequest::Clear() {
sid_ = 0u;
buffers_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool UnmapRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.UnmapRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 sid = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &sid_)));
set_has_sid();
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_buffers;
break;
}
// repeated .com.trustonic.tee_proxy.UnmapRequest.Buffers buffers = 2;
case 2: {
if (tag == 18) {
parse_buffers:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_buffers()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_buffers;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.UnmapRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.UnmapRequest)
return false;
#undef DO_
}
void UnmapRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.UnmapRequest)
// required uint32 sid = 1;
if (has_sid()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sid(), output);
}
// repeated .com.trustonic.tee_proxy.UnmapRequest.Buffers buffers = 2;
for (int i = 0; i < this->buffers_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessage(
2, this->buffers(i), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.UnmapRequest)
}
int UnmapRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 sid = 1;
if (has_sid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->sid());
}
}
// repeated .com.trustonic.tee_proxy.UnmapRequest.Buffers buffers = 2;
total_size += 1 * this->buffers_size();
for (int i = 0; i < this->buffers_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->buffers(i));
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void UnmapRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const UnmapRequest*>(&from));
}
void UnmapRequest::MergeFrom(const UnmapRequest& from) {
GOOGLE_CHECK_NE(&from, this);
buffers_.MergeFrom(from.buffers_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sid()) {
set_sid(from.sid());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void UnmapRequest::CopyFrom(const UnmapRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool UnmapRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
if (!::google::protobuf::internal::AllAreInitialized(this->buffers())) return false;
return true;
}
void UnmapRequest::Swap(UnmapRequest* other) {
if (other != this) {
std::swap(sid_, other->sid_);
buffers_.Swap(&other->buffers_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string UnmapRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.UnmapRequest";
}
// ===================================================================
#ifndef _MSC_VER
#endif // !_MSC_VER
UnmapResponse::UnmapResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.UnmapResponse)
}
void UnmapResponse::InitAsDefaultInstance() {
}
UnmapResponse::UnmapResponse(const UnmapResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.UnmapResponse)
}
void UnmapResponse::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
UnmapResponse::~UnmapResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.UnmapResponse)
SharedDtor();
}
void UnmapResponse::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void UnmapResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const UnmapResponse& UnmapResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
UnmapResponse* UnmapResponse::default_instance_ = NULL;
UnmapResponse* UnmapResponse::New() const {
return new UnmapResponse;
}
void UnmapResponse::Clear() {
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool UnmapResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.UnmapResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.UnmapResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.UnmapResponse)
return false;
#undef DO_
}
void UnmapResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.UnmapResponse)
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.UnmapResponse)
}
int UnmapResponse::ByteSize() const {
int total_size = 0;
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void UnmapResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const UnmapResponse*>(&from));
}
void UnmapResponse::MergeFrom(const UnmapResponse& from) {
GOOGLE_CHECK_NE(&from, this);
mutable_unknown_fields()->append(from.unknown_fields());
}
void UnmapResponse::CopyFrom(const UnmapResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool UnmapResponse::IsInitialized() const {
return true;
}
void UnmapResponse::Swap(UnmapResponse* other) {
if (other != this) {
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string UnmapResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.UnmapResponse";
}
// ===================================================================
#ifndef _MSC_VER
const int GetErrorRequest::kSidFieldNumber;
#endif // !_MSC_VER
GetErrorRequest::GetErrorRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.GetErrorRequest)
}
void GetErrorRequest::InitAsDefaultInstance() {
}
GetErrorRequest::GetErrorRequest(const GetErrorRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.GetErrorRequest)
}
void GetErrorRequest::SharedCtor() {
_cached_size_ = 0;
sid_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
GetErrorRequest::~GetErrorRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.GetErrorRequest)
SharedDtor();
}
void GetErrorRequest::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void GetErrorRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const GetErrorRequest& GetErrorRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
GetErrorRequest* GetErrorRequest::default_instance_ = NULL;
GetErrorRequest* GetErrorRequest::New() const {
return new GetErrorRequest;
}
void GetErrorRequest::Clear() {
sid_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool GetErrorRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.GetErrorRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 sid = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &sid_)));
set_has_sid();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.GetErrorRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.GetErrorRequest)
return false;
#undef DO_
}
void GetErrorRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.GetErrorRequest)
// required uint32 sid = 1;
if (has_sid()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sid(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.GetErrorRequest)
}
int GetErrorRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 sid = 1;
if (has_sid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->sid());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void GetErrorRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const GetErrorRequest*>(&from));
}
void GetErrorRequest::MergeFrom(const GetErrorRequest& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sid()) {
set_sid(from.sid());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void GetErrorRequest::CopyFrom(const GetErrorRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool GetErrorRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void GetErrorRequest::Swap(GetErrorRequest* other) {
if (other != this) {
std::swap(sid_, other->sid_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string GetErrorRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.GetErrorRequest";
}
// ===================================================================
#ifndef _MSC_VER
const int GetErrorResponse::kExitCodeFieldNumber;
#endif // !_MSC_VER
GetErrorResponse::GetErrorResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.GetErrorResponse)
}
void GetErrorResponse::InitAsDefaultInstance() {
}
GetErrorResponse::GetErrorResponse(const GetErrorResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.GetErrorResponse)
}
void GetErrorResponse::SharedCtor() {
_cached_size_ = 0;
exit_code_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
GetErrorResponse::~GetErrorResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.GetErrorResponse)
SharedDtor();
}
void GetErrorResponse::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void GetErrorResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const GetErrorResponse& GetErrorResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
GetErrorResponse* GetErrorResponse::default_instance_ = NULL;
GetErrorResponse* GetErrorResponse::New() const {
return new GetErrorResponse;
}
void GetErrorResponse::Clear() {
exit_code_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool GetErrorResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.GetErrorResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required sint32 exit_code = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
input, &exit_code_)));
set_has_exit_code();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.GetErrorResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.GetErrorResponse)
return false;
#undef DO_
}
void GetErrorResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.GetErrorResponse)
// required sint32 exit_code = 1;
if (has_exit_code()) {
::google::protobuf::internal::WireFormatLite::WriteSInt32(1, this->exit_code(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.GetErrorResponse)
}
int GetErrorResponse::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required sint32 exit_code = 1;
if (has_exit_code()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::SInt32Size(
this->exit_code());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void GetErrorResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const GetErrorResponse*>(&from));
}
void GetErrorResponse::MergeFrom(const GetErrorResponse& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_exit_code()) {
set_exit_code(from.exit_code());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void GetErrorResponse::CopyFrom(const GetErrorResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool GetErrorResponse::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void GetErrorResponse::Swap(GetErrorResponse* other) {
if (other != this) {
std::swap(exit_code_, other->exit_code_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string GetErrorResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.GetErrorResponse";
}
// ===================================================================
#ifndef _MSC_VER
#endif // !_MSC_VER
GetVersionRequest::GetVersionRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.GetVersionRequest)
}
void GetVersionRequest::InitAsDefaultInstance() {
}
GetVersionRequest::GetVersionRequest(const GetVersionRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.GetVersionRequest)
}
void GetVersionRequest::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
GetVersionRequest::~GetVersionRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.GetVersionRequest)
SharedDtor();
}
void GetVersionRequest::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void GetVersionRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const GetVersionRequest& GetVersionRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
GetVersionRequest* GetVersionRequest::default_instance_ = NULL;
GetVersionRequest* GetVersionRequest::New() const {
return new GetVersionRequest;
}
void GetVersionRequest::Clear() {
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool GetVersionRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.GetVersionRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.GetVersionRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.GetVersionRequest)
return false;
#undef DO_
}
void GetVersionRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.GetVersionRequest)
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.GetVersionRequest)
}
int GetVersionRequest::ByteSize() const {
int total_size = 0;
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void GetVersionRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const GetVersionRequest*>(&from));
}
void GetVersionRequest::MergeFrom(const GetVersionRequest& from) {
GOOGLE_CHECK_NE(&from, this);
mutable_unknown_fields()->append(from.unknown_fields());
}
void GetVersionRequest::CopyFrom(const GetVersionRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool GetVersionRequest::IsInitialized() const {
return true;
}
void GetVersionRequest::Swap(GetVersionRequest* other) {
if (other != this) {
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string GetVersionRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.GetVersionRequest";
}
// ===================================================================
#ifndef _MSC_VER
const int GetVersionResponse::kProductIdFieldNumber;
const int GetVersionResponse::kMciFieldNumber;
const int GetVersionResponse::kSoFieldNumber;
const int GetVersionResponse::kMclfFieldNumber;
const int GetVersionResponse::kContainerFieldNumber;
const int GetVersionResponse::kMcConfigFieldNumber;
const int GetVersionResponse::kTlApiFieldNumber;
const int GetVersionResponse::kDrApiFieldNumber;
const int GetVersionResponse::kNwdFieldNumber;
#endif // !_MSC_VER
GetVersionResponse::GetVersionResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.GetVersionResponse)
}
void GetVersionResponse::InitAsDefaultInstance() {
}
GetVersionResponse::GetVersionResponse(const GetVersionResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.GetVersionResponse)
}
void GetVersionResponse::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
product_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
mci_ = 0u;
so_ = 0u;
mclf_ = 0u;
container_ = 0u;
mc_config_ = 0u;
tl_api_ = 0u;
dr_api_ = 0u;
nwd_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
GetVersionResponse::~GetVersionResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.GetVersionResponse)
SharedDtor();
}
void GetVersionResponse::SharedDtor() {
if (product_id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete product_id_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void GetVersionResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const GetVersionResponse& GetVersionResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
GetVersionResponse* GetVersionResponse::default_instance_ = NULL;
GetVersionResponse* GetVersionResponse::New() const {
return new GetVersionResponse;
}
void GetVersionResponse::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<GetVersionResponse*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
if (_has_bits_[0 / 32] & 255) {
ZR_(mci_, dr_api_);
if (has_product_id()) {
if (product_id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
product_id_->clear();
}
}
}
nwd_ = 0u;
#undef OFFSET_OF_FIELD_
#undef ZR_
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool GetVersionResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.GetVersionResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required string product_id = 1;
case 1: {
if (tag == 10) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_product_id()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(16)) goto parse_mci;
break;
}
// required uint32 mci = 2;
case 2: {
if (tag == 16) {
parse_mci:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &mci_)));
set_has_mci();
} else {
goto handle_unusual;
}
if (input->ExpectTag(24)) goto parse_so;
break;
}
// required uint32 so = 3;
case 3: {
if (tag == 24) {
parse_so:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &so_)));
set_has_so();
} else {
goto handle_unusual;
}
if (input->ExpectTag(32)) goto parse_mclf;
break;
}
// required uint32 mclf = 4;
case 4: {
if (tag == 32) {
parse_mclf:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &mclf_)));
set_has_mclf();
} else {
goto handle_unusual;
}
if (input->ExpectTag(40)) goto parse_container;
break;
}
// required uint32 container = 5;
case 5: {
if (tag == 40) {
parse_container:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &container_)));
set_has_container();
} else {
goto handle_unusual;
}
if (input->ExpectTag(48)) goto parse_mc_config;
break;
}
// required uint32 mc_config = 6;
case 6: {
if (tag == 48) {
parse_mc_config:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &mc_config_)));
set_has_mc_config();
} else {
goto handle_unusual;
}
if (input->ExpectTag(56)) goto parse_tl_api;
break;
}
// required uint32 tl_api = 7;
case 7: {
if (tag == 56) {
parse_tl_api:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &tl_api_)));
set_has_tl_api();
} else {
goto handle_unusual;
}
if (input->ExpectTag(64)) goto parse_dr_api;
break;
}
// required uint32 dr_api = 8;
case 8: {
if (tag == 64) {
parse_dr_api:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &dr_api_)));
set_has_dr_api();
} else {
goto handle_unusual;
}
if (input->ExpectTag(72)) goto parse_nwd;
break;
}
// required uint32 nwd = 9;
case 9: {
if (tag == 72) {
parse_nwd:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &nwd_)));
set_has_nwd();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.GetVersionResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.GetVersionResponse)
return false;
#undef DO_
}
void GetVersionResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.GetVersionResponse)
// required string product_id = 1;
if (has_product_id()) {
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->product_id(), output);
}
// required uint32 mci = 2;
if (has_mci()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->mci(), output);
}
// required uint32 so = 3;
if (has_so()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->so(), output);
}
// required uint32 mclf = 4;
if (has_mclf()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->mclf(), output);
}
// required uint32 container = 5;
if (has_container()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->container(), output);
}
// required uint32 mc_config = 6;
if (has_mc_config()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->mc_config(), output);
}
// required uint32 tl_api = 7;
if (has_tl_api()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->tl_api(), output);
}
// required uint32 dr_api = 8;
if (has_dr_api()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->dr_api(), output);
}
// required uint32 nwd = 9;
if (has_nwd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->nwd(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.GetVersionResponse)
}
int GetVersionResponse::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required string product_id = 1;
if (has_product_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->product_id());
}
// required uint32 mci = 2;
if (has_mci()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->mci());
}
// required uint32 so = 3;
if (has_so()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->so());
}
// required uint32 mclf = 4;
if (has_mclf()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->mclf());
}
// required uint32 container = 5;
if (has_container()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->container());
}
// required uint32 mc_config = 6;
if (has_mc_config()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->mc_config());
}
// required uint32 tl_api = 7;
if (has_tl_api()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->tl_api());
}
// required uint32 dr_api = 8;
if (has_dr_api()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->dr_api());
}
}
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
// required uint32 nwd = 9;
if (has_nwd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->nwd());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void GetVersionResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const GetVersionResponse*>(&from));
}
void GetVersionResponse::MergeFrom(const GetVersionResponse& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_product_id()) {
set_product_id(from.product_id());
}
if (from.has_mci()) {
set_mci(from.mci());
}
if (from.has_so()) {
set_so(from.so());
}
if (from.has_mclf()) {
set_mclf(from.mclf());
}
if (from.has_container()) {
set_container(from.container());
}
if (from.has_mc_config()) {
set_mc_config(from.mc_config());
}
if (from.has_tl_api()) {
set_tl_api(from.tl_api());
}
if (from.has_dr_api()) {
set_dr_api(from.dr_api());
}
}
if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
if (from.has_nwd()) {
set_nwd(from.nwd());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void GetVersionResponse::CopyFrom(const GetVersionResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool GetVersionResponse::IsInitialized() const {
if ((_has_bits_[0] & 0x000001ff) != 0x000001ff) return false;
return true;
}
void GetVersionResponse::Swap(GetVersionResponse* other) {
if (other != this) {
std::swap(product_id_, other->product_id_);
std::swap(mci_, other->mci_);
std::swap(so_, other->so_);
std::swap(mclf_, other->mclf_);
std::swap(container_, other->container_);
std::swap(mc_config_, other->mc_config_);
std::swap(tl_api_, other->tl_api_);
std::swap(dr_api_, other->dr_api_);
std::swap(nwd_, other->nwd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string GetVersionResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.GetVersionResponse";
}
// ===================================================================
#ifndef _MSC_VER
const int GpRequestCancellationRequest::kSidFieldNumber;
#endif // !_MSC_VER
GpRequestCancellationRequest::GpRequestCancellationRequest()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.GpRequestCancellationRequest)
}
void GpRequestCancellationRequest::InitAsDefaultInstance() {
}
GpRequestCancellationRequest::GpRequestCancellationRequest(const GpRequestCancellationRequest& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.GpRequestCancellationRequest)
}
void GpRequestCancellationRequest::SharedCtor() {
_cached_size_ = 0;
sid_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
GpRequestCancellationRequest::~GpRequestCancellationRequest() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.GpRequestCancellationRequest)
SharedDtor();
}
void GpRequestCancellationRequest::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void GpRequestCancellationRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const GpRequestCancellationRequest& GpRequestCancellationRequest::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
GpRequestCancellationRequest* GpRequestCancellationRequest::default_instance_ = NULL;
GpRequestCancellationRequest* GpRequestCancellationRequest::New() const {
return new GpRequestCancellationRequest;
}
void GpRequestCancellationRequest::Clear() {
sid_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool GpRequestCancellationRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.GpRequestCancellationRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 sid = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &sid_)));
set_has_sid();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.GpRequestCancellationRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.GpRequestCancellationRequest)
return false;
#undef DO_
}
void GpRequestCancellationRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.GpRequestCancellationRequest)
// required uint32 sid = 1;
if (has_sid()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sid(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.GpRequestCancellationRequest)
}
int GpRequestCancellationRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 sid = 1;
if (has_sid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->sid());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void GpRequestCancellationRequest::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const GpRequestCancellationRequest*>(&from));
}
void GpRequestCancellationRequest::MergeFrom(const GpRequestCancellationRequest& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sid()) {
set_sid(from.sid());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void GpRequestCancellationRequest::CopyFrom(const GpRequestCancellationRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool GpRequestCancellationRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void GpRequestCancellationRequest::Swap(GpRequestCancellationRequest* other) {
if (other != this) {
std::swap(sid_, other->sid_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string GpRequestCancellationRequest::GetTypeName() const {
return "com.trustonic.tee_proxy.GpRequestCancellationRequest";
}
// ===================================================================
#ifndef _MSC_VER
#endif // !_MSC_VER
GpRequestCancellationResponse::GpRequestCancellationResponse()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:com.trustonic.tee_proxy.GpRequestCancellationResponse)
}
void GpRequestCancellationResponse::InitAsDefaultInstance() {
}
GpRequestCancellationResponse::GpRequestCancellationResponse(const GpRequestCancellationResponse& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:com.trustonic.tee_proxy.GpRequestCancellationResponse)
}
void GpRequestCancellationResponse::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
GpRequestCancellationResponse::~GpRequestCancellationResponse() {
// @@protoc_insertion_point(destructor:com.trustonic.tee_proxy.GpRequestCancellationResponse)
SharedDtor();
}
void GpRequestCancellationResponse::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void GpRequestCancellationResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const GpRequestCancellationResponse& GpRequestCancellationResponse::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_mc_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_mc_2eproto();
#endif
return *default_instance_;
}
GpRequestCancellationResponse* GpRequestCancellationResponse::default_instance_ = NULL;
GpRequestCancellationResponse* GpRequestCancellationResponse::New() const {
return new GpRequestCancellationResponse;
}
void GpRequestCancellationResponse::Clear() {
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool GpRequestCancellationResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:com.trustonic.tee_proxy.GpRequestCancellationResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
input, tag, &unknown_fields_stream));
}
success:
// @@protoc_insertion_point(parse_success:com.trustonic.tee_proxy.GpRequestCancellationResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:com.trustonic.tee_proxy.GpRequestCancellationResponse)
return false;
#undef DO_
}
void GpRequestCancellationResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:com.trustonic.tee_proxy.GpRequestCancellationResponse)
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:com.trustonic.tee_proxy.GpRequestCancellationResponse)
}
int GpRequestCancellationResponse::ByteSize() const {
int total_size = 0;
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void GpRequestCancellationResponse::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const GpRequestCancellationResponse*>(&from));
}
void GpRequestCancellationResponse::MergeFrom(const GpRequestCancellationResponse& from) {
GOOGLE_CHECK_NE(&from, this);
mutable_unknown_fields()->append(from.unknown_fields());
}
void GpRequestCancellationResponse::CopyFrom(const GpRequestCancellationResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool GpRequestCancellationResponse::IsInitialized() const {
return true;
}
void GpRequestCancellationResponse::Swap(GpRequestCancellationResponse* other) {
if (other != this) {
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string GpRequestCancellationResponse::GetTypeName() const {
return "com.trustonic.tee_proxy.GpRequestCancellationResponse";
}
// @@protoc_insertion_point(namespace_scope)
} // namespace tee_proxy
} // namespace trustonic
} // namespace com
// @@protoc_insertion_point(global_scope)
|
5ffefc13229cf2cc81da474a73558997379afa74
|
9542f1e34910ced36d7422944ace8fc126a1b645
|
/Datamodel/note.cpp
|
b3ad89e69366967ef91c6bc217dc8cfb02801018
|
[] |
no_license
|
johndpope/Counterpoint-project
|
eee0bad93057cd6a500c2c7377be9b58c09a8866
|
6b0e46b6830d38f03e5f84236bb8a350db90cfc3
|
refs/heads/master
| 2021-04-29T05:22:28.516769
| 2015-12-07T18:21:21
| 2015-12-07T18:21:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,798
|
cpp
|
note.cpp
|
#include "note.h"
int Note::Cpitch = 0;
int Note::rest = -32767;
int Note::getPitch() const
{
return pitch;
}
void Note::setPitch(int value)
{
pitch = value;
}
int Note::getDuration() const
{
return duration;
}
void Note::setDuration(unsigned value)
{
if(value == 1 || (value % 2 == 0 && value != 0 && value <= 8)){
duration = value;
}else{
duration = 4;
}
}
bool Note::isRest() const
{
if(pitch == rest){
return true;
}else{
return false;
}
}
void Note::operator++(int)
{
this->pitch++;
}
void Note::operator--(int)
{
this->pitch--;
}
bool Note::oneDurationUp()
{
if(duration == 8){
return false;
}else{
duration = duration * 2;
return true;
}
}
bool Note::oneDurationDown()
{
if(duration == 1){
return false;
}else{
duration = duration / 2;
return true;
}
}
int Note::operator -(const Note &other) const
{
return other.getPitch()-this->pitch;
}
bool Note::operator ==(const Note &other) const
{
return operator -(other) == 0;
}
bool Note::operator <(const Note &other) const
{
if(pitch < other.getPitch()){
return true;
}else{
return false;
}
}
bool Note::operator >(const Note &other) const
{
if(pitch > other.getPitch()){
return true;
}else{
return false;
}
}
Note &Note::operator =(const Note &obj)
{
if(this != &obj){
pitch = obj.pitch;
duration = obj.duration;
}
return *this;
}
Note::Note(int pi, int dur)
{
pitch = pi;
if(dur == 1 || (dur % 2 == 0 && dur != 0 && dur <= 8)){
duration = dur;
}else{
duration = 4;
}
}
Note::Note(const Note &obj)
{
pitch = obj.pitch;
duration = obj.duration;
}
|
9a7d91e27b5086d829d7b537170a85ffbebf19d5
|
cf450832dd79748ca18a42e3495185ec334e24e0
|
/src/CalDigi/CalSignalTool.cxx
|
cf1110aa799ed2e946f22cda6454caa63508a1df
|
[
"BSD-3-Clause"
] |
permissive
|
fermi-lat/CalXtalResponse
|
2d3e83e4d1ae9f5f826dd17686c99b27ff2ce657
|
3bd209402fa2d1ba3bb13e6a6228ea16881a3dc8
|
refs/heads/master
| 2022-02-17T03:12:05.147230
| 2019-08-27T17:27:11
| 2019-08-27T17:27:11
| 103,186,845
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 15,237
|
cxx
|
CalSignalTool.cxx
|
// $Header $
/** @file
@author Z.Fewtrell
*/
// LOCAL
#include "CalSignalTool.h"
#include "IXtalSignalTool.h"
#include "../CalCalib/IPrecalcCalibTool.h"
#include "CalXtalResponse/ICalCalibSvc.h"
// GLAST
#include "Event/TopLevel/EventModel.h"
#include "Event/MonteCarlo/McIntegratingHit.h"
#include "GlastSvc/GlastDetSvc/IGlastDetSvc.h"
#include "CalUtil/CalDefs.h"
#include "CalUtil/CalVec.h"
#include "CalUtil/CalGeom.h"
// EXTLIB
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/ToolFactory.h"
#include "GaudiKernel/IDataProviderSvc.h"
#include "GaudiKernel/Incident.h"
#include "GaudiKernel/IIncidentSvc.h"
#include "CLHEP/Random/RandGauss.h"
// STD
#include <algorithm>
#include <utility>
#include <map>
#include <string>
//static ToolFactory< CalSignalTool > a_factory;
//const IToolFactory& CalSignalToolFactory = a_factory;
DECLARE_TOOL_FACTORY(CalSignalTool);
CalSignalTool::CalSignalTool(const std::string& type,
const std::string& name,
const IInterface* parent)
: AlgTool(type,name,parent),
m_isValid(false),
m_evtSvc(0),
m_eTowerCAL(0),
m_eLATTowers(0),
m_eMeasureX(0),
m_eXtal(0),
m_xtalSignalTool(0),
m_precalcCalib(0),
m_calCalibSvc(0),
m_detSvc(0)
{
declareInterface<ICalSignalTool>(this);
declareProperty("CalCalibSvc", m_calCalibSvcName = "CalCalibSvc");
declareProperty("XtalSignalToolName", m_xtalSignalToolName = "XtalSignalTool");
declareProperty("enableNoise", m_enableNoise = true);
declareProperty("electronicNoiseGain", m_electronicNoiseGain = 1.0);
declareProperty("enableXtalNoise", m_enableXtalNoise = true);
declareProperty("enableElecNoise", m_enableElecNoise = true);
declareProperty("PrecalcCalibTool", m_precalcCalibName = "PrecalcCalibTool");
}
StatusCode CalSignalTool::initialize() {
MsgStream msglog(msgSvc(), name());
msglog << MSG::INFO << "initializing" << endreq;
//-- jobOptions --//
StatusCode sc;
if ((sc = setProperties()).isFailure()) {
msglog << MSG::ERROR << "Failed to set properties" << endreq;
return sc;
}
//-- Retreive EventDataSvc
sc = serviceLocator()->service( "EventDataSvc", m_evtSvc, true );
if(sc.isFailure()){
msglog << MSG::ERROR << "Could not find EventDataSvc" << endreq;
return sc;
}
// now try to find the GlastDetSvc service
sc = service("GlastDetSvc", m_detSvc);
if (sc.isFailure() ) {
MsgStream msglog(msgSvc(), name());
msglog << MSG::ERROR << " Unable to get GlastDetSvc " << endreq;
return sc;
}
//-- Retrieve constants from GlastDetSVc
sc = retrieveConstants();
if (sc.isFailure())
return sc;
//-- find out which tems are installed.
m_twrList = CalUtil::findActiveTowers(*m_detSvc);
//-- Retrieve xtalSignalTool
sc = toolSvc()->retrieveTool("XtalSignalTool",
m_xtalSignalToolName,
m_xtalSignalTool,
this );
if (sc.isFailure() ) {
msglog << MSG::ERROR << " Unable to create " << m_xtalSignalToolName << endreq;
return sc;
}
// Get ready to listen for BeginEvent
IIncidentSvc* incSvc;
sc = service("IncidentSvc", incSvc, true);
if (sc.isSuccess() ) {
incSvc->addListener(this, "BeginEvent"); // priority not important
} else {
msglog << MSG::ERROR << "can't find IncidentSvc" << endreq;
return sc;
}
// this tool may also be shared by CalTrigTool, global ownership
sc = toolSvc()->retrieveTool("PrecalcCalibTool",
m_precalcCalibName,
m_precalcCalib,
0); // shared by other code
if (sc.isFailure() ) {
msglog << MSG::ERROR << " Unable to create " << m_precalcCalibName << endreq;
return sc;
}
// obtain CalCalibSvc
sc = service(m_calCalibSvcName.value(), m_calCalibSvc);
if (sc.isFailure()) {
msglog << MSG::ERROR << "can't get " << m_calCalibSvcName << endreq;
return sc;
}
return StatusCode::SUCCESS;
}
StatusCode CalSignalTool::retrieveConstants() {
double value;
typedef map<int*,string> PARAMAP;
PARAMAP param;
param[&m_eTowerCAL] = string("eTowerCAL");
param[&m_eLATTowers] = string("eLATTowers");
param[&m_eXtal] = string("eXtal");
param[&m_eMeasureX] = string("eMeasureX");
param[m_ePerMeV+1] = string("cal.ePerMeVSmall");
param[m_ePerMeV] = string("cal.ePerMevLarge");
for(PARAMAP::iterator it=param.begin(); it!=param.end();it++){
if(!m_detSvc->getNumericConstByName((*it).second, &value)) {
MsgStream msglog(msgSvc(), name());
msglog << MSG::ERROR << " constant " <<(*it).second
<<" not defined" << endreq;
return StatusCode::FAILURE;
} else *((*it).first)=(int)value;
}
return StatusCode::SUCCESS;
}
/// zero all internal tables, set m_isValid -> false
void CalSignalTool::newEvent() {
fill(m_calSignalMap.begin(),
m_calSignalMap.end(),
0);
fill(m_calTrigSignalMap.begin(),
m_calTrigSignalMap.end(),
0);
fill(m_calSourceMap.begin(),
m_calSourceMap.end(),
0);
m_calRelMap.clear();
m_isValid = false;
}
const ICalSignalTool::CalRelationMap *CalSignalTool::getCalRelationMap() {
/// check that all internal data is up2date
StatusCode sc = syncData();
if (sc.isFailure())
return 0;
return &m_calRelMap;
}
/// apply McIntegratingHits to diode signal levels and simulate noise
/// (only calculate once per event)
StatusCode CalSignalTool::syncData() {
/// return early if we've already calcuated everything for this
/// event
if (m_isValid)
return StatusCode::SUCCESS;
/// sum individual mc hits
StatusCode sc = loadSignalMaps();
if (sc.isFailure())
return sc;
/// calc electronic noise (independent of hits)
if (m_enableNoise) {
sc = calcNoise();
if (sc.isFailure())
return sc;
}
/// indicate that event data is up-to-date for now
m_isValid = true;
return StatusCode::SUCCESS;
}
/// apply All Cal McIntegratingHits to crystal diode signal levels.
StatusCode CalSignalTool::loadSignalMaps() {
// get McIntegratingHit collection. Abort if empty.
SmartDataPtr<Event::McIntegratingHitVector>
McCalHits(m_evtSvc, EventModel::MC::McIntegratingHitCol );
if (McCalHits == 0) {
// create msglog only when needed for speed.
MsgStream msglog(msgSvc(), name());
msglog << MSG::DEBUG;
if (msglog.isActive()){
msglog.stream() << "no cal hits found" ;}
msglog << endreq;
return StatusCode::SUCCESS;
}
// loop over hits - pick out CAL hits
for (Event::McIntegratingHitVector::const_iterator it = McCalHits->begin();
it != McCalHits->end();
it++)
{
// get volumeId from hit
const idents::VolumeIdentifier volId =
((idents::VolumeIdentifier)(*it)->volumeID());
// extracting parameters from volume Id identifying as in CAL
if ((int)volId[CalUtil::fLATObjects] == m_eLATTowers &&
(int)volId[CalUtil::fTowerObjects] == m_eTowerCAL)
{
// apply hit signal to relavant diodes
StatusCode sc = sumHit(**it);
if (sc.isFailure())
return sc;
// Skip if purely an overlay event
if ((*it)->getPackedFlags() != Event::McIntegratingHit::overlayHit)
{
// Now sum hit contribution for trigger
if ((sc = sumHit4Trig(**it)).isFailure())
return sc;
}
// store MCHit <> xtal relation
sc = registerHitRel(**it);
if (sc.isFailure())
return sc;
}
}
return StatusCode::SUCCESS;
}
/// apply single crystal hit to signal level
StatusCode CalSignalTool::sumHit(const Event::McIntegratingHit &hit) {
// retrieve crystal id from hit
using namespace idents;
using namespace CalUtil;
const XtalIdx xtalIdx(CalXtalId(hit.volumeID()));
// destination for signal data from this hit
CalUtil::CalVec<CalUtil::XtalDiode, float> hitSignal;
// convert the hit into signal level
StatusCode sc = m_xtalSignalTool->calculate(hit,
hitSignal);
if (sc.isFailure())
return sc;
// sum xtal signals into full arry
for (XtalDiode xtalDiode;
xtalDiode.isValid();
xtalDiode++) {
const DiodeIdx diodeIdx(xtalIdx, xtalDiode);
m_calSignalMap[diodeIdx] += hitSignal[xtalDiode];
}
// Update the source map
if (hit.getPackedFlags() & Event::McIntegratingHit::simulation) m_calSourceMap[xtalIdx] |= simulation;
if (hit.getPackedFlags() & Event::McIntegratingHit::overlayHit) m_calSourceMap[xtalIdx] |= overlay;
return StatusCode::SUCCESS;
}
/// apply single crystal hit to signal level
StatusCode CalSignalTool::sumHit4Trig(const Event::McIntegratingHit &hit)
{
// retrieve crystal id from hit
using namespace idents;
using namespace CalUtil;
const XtalIdx xtalIdx(CalXtalId(hit.volumeID()));
// destination for signal data from this hit
CalUtil::CalVec<CalUtil::XtalDiode, float> hitSignal;
// convert the hit into signal level
StatusCode sc = m_xtalSignalTool->calculate(hit,
hitSignal);
if (sc.isFailure())
return sc;
// sum xtal signals into full arry
for (XtalDiode xtalDiode; xtalDiode.isValid(); xtalDiode++)
{
const DiodeIdx diodeIdx(xtalIdx, xtalDiode);
float signalVal = hitSignal[xtalDiode];
m_calTrigSignalMap[diodeIdx] += hitSignal[xtalDiode];
}
return StatusCode::SUCCESS;
}
/// store crystal <> McHit relation
StatusCode CalSignalTool::registerHitRel(Event::McIntegratingHit &hit) {
/// retrieve crystal id from hit
const CalUtil::XtalIdx xtalIdx(idents::CalXtalId(hit.volumeID()));
m_calRelMap.insert(CalRelation(xtalIdx, &hit));
return StatusCode::SUCCESS;
}
/// apply electronic noise calcuation to entire cal
StatusCode CalSignalTool::calcNoise() {
using namespace CalUtil;
/// Loop through (installed) towers and crystals;
for (unsigned twrSeq = 0; twrSeq < m_twrList.size(); twrSeq++) {
// get bay id of nth live tower
const TwrNum twr(m_twrList[twrSeq]);
for (LyrNum lyr; lyr.isValid(); lyr++)
for (ColNum col; col.isValid(); col++) {
// assemble current calXtalId
const XtalIdx xtalIdx(twr,
lyr,
col);
// Should not apply noise/pedestal corrections to a crystal with
// "pure" overlay data (since its data)
unsigned short sourceWord = m_calSourceMap[xtalIdx];
if (m_calSourceMap[xtalIdx] == overlay) continue;
// Apply poissonic noise to energy in the crystals
if (m_enableXtalNoise)
{
// Apply poissonic noise to the energy in the crystals
StatusCode sc = calcPoissonicNoiseXtal(xtalIdx, m_calSignalMap);
if (sc.isFailure())
return sc;
// Apply poissonic noise to the energy in the crystals - that for the trigger
sc = calcPoissonicNoiseXtal(xtalIdx, m_calTrigSignalMap);
if (sc.isFailure())
return sc;
}
// Don't apply pedestal fluctuations if overlay data contribution
if (m_calSourceMap[xtalIdx] & overlay) continue;
// Apply random electronics noise
if (m_enableElecNoise)
{
StatusCode sc = calcElectronicNoiseXtal(xtalIdx);
if (sc.isFailure())
return sc;
}
} // xtal loop
} // twr loop
return StatusCode::SUCCESS;
}
/// apply electronic noise calculation to single crystal
StatusCode CalSignalTool::calcElectronicNoiseXtal(const CalUtil::XtalIdx xtalIdx) {
using namespace CalUtil;
for (XtalDiode xtalDiode;
xtalDiode.isValid();
xtalDiode++) {
const XtalRng xRng(xtalDiode.getFace(),
xtalDiode.getDiode().getX8Rng());
const RngIdx rngIdx(xtalIdx, xRng);
// get pedestal sigma
float pedSig;
StatusCode sc = m_precalcCalib->getPedSigCIDAC(rngIdx, pedSig);
if (sc.isFailure()) return sc;
// use same rand for both ranges
// since the X1 & X8 noise
const float rnd = CLHEP::RandGauss::shoot();
m_calSignalMap[DiodeIdx(xtalIdx,xtalDiode)] += pedSig*rnd*m_electronicNoiseGain;
m_calTrigSignalMap[DiodeIdx(xtalIdx,xtalDiode)] += pedSig*rnd*m_electronicNoiseGain;
} // for (XtalDiode)
return StatusCode::SUCCESS;
}
/// apply poinssonic noise calculation to single cal crystal
StatusCode CalSignalTool::calcPoissonicNoiseXtal(const CalUtil::XtalIdx xtalIdx, CalSignalMap& calSignalMap)
{
using namespace CalUtil;
// retrieve mevPerDAC calibration object
CalibData::CalMevPerDac const * const calibMPD = m_calCalibSvc->getMPD(xtalIdx);
if (!calibMPD) return StatusCode::FAILURE;
// store actual mevPerDAC values in usable array.
CalVec<DiodeNum, float> mpd;
mpd[CalUtil::LRG_DIODE] = calibMPD->getBig()->getVal();
mpd[CalUtil::SM_DIODE] = calibMPD->getSmall()->getVal();
for (XtalDiode xDiode; xDiode.isValid(); xDiode++)
{
const DiodeNum diode = xDiode.getDiode();
const DiodeIdx diodeIdx(xtalIdx, xDiode);
// convert cidac in diode to MeV in xtal
float meVXtal = calSignalMap[diodeIdx]*mpd[diode];
// MeV in xtal -> electrons in diode
float eDiode = meVXtal * m_ePerMeV[diode.val()];
// apply poissonic fluctuation to # of electrons.
float noise = CLHEP::RandGauss::shoot();
noise *= sqrt(eDiode);
// add noise
eDiode += noise;
// convert back to cidac in diode
meVXtal = eDiode/m_ePerMeV[diode.val()];
calSignalMap[diodeIdx] = meVXtal/mpd[diode];
}
return StatusCode::SUCCESS;
}
StatusCode CalSignalTool::getDiodeSignal(const CalUtil::DiodeIdx diodeIdx, float &signal)
{
/// check that all internal data is up2date
if (syncData().isFailure())
return StatusCode::FAILURE;
signal = m_calSignalMap[diodeIdx];
return StatusCode::SUCCESS;
}
StatusCode CalSignalTool::getTrigDiodeSignal(const CalUtil::DiodeIdx diodeIdx, float &signal)
{
/// check that all internal data is up2date
if (syncData().isFailure())
return StatusCode::FAILURE;
signal = m_calTrigSignalMap[diodeIdx];
return StatusCode::SUCCESS;
}
/// Inform that a new incident has occured
void CalSignalTool::handle ( const Incident& inc ) {
if ((inc.type() == "BeginEvent"))
newEvent();
return;
}
|
2382e3686cafac26c8b20e45df9be9b1cfd2374c
|
630ef30dc5cc82d378ae66e746f5c501da16a5c5
|
/Project2/MyForm.cpp
|
e8d4c35aea67fb2fcb1977f2ea4d18c1b5c717bb
|
[] |
no_license
|
Sidoruk/TechProg1
|
0d8e6245316c2e80add1a21eee0b03d3207b9eeb
|
0603be0832bf92de60a7ea2dde7ffa0236f90aa9
|
refs/heads/master
| 2020-09-30T12:21:42.707067
| 2020-05-28T19:10:08
| 2020-05-28T19:10:08
| 227,286,780
| 1
| 0
| null | null | null | null |
WINDOWS-1251
|
C++
| false
| false
| 4,169
|
cpp
|
MyForm.cpp
|
#include "MyForm.h"
#include <Windows.h>
#include "ClassField.h"
using namespace kursgraf1; // Название проекта
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
[STAThreadAttribute]
void main(array <String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
kursgraf1::MyForm form; //which form starts first
Application::Run(% form);
}
System::Void kursgraf1::MyForm::button1_Click(System::Object^ sender, System::EventArgs^ e)
{
Application::Exit();
}
System::Void kursgraf1::MyForm::radioButtonServer_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
{
opponent_is_server = true;
}
System::Void kursgraf1::MyForm::radioButtonPeople_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
{
opponent_is_server = false;
}
System::Void kursgraf1::MyForm::buttonSave_Click(System::Object^ sender, System::EventArgs^ e)
{
int N;
try {
N = System::Convert::ToInt32(textBoxSize->Text);
if (N <= 0)
throw 1;
else {
size_of_field = N;
game_field.change_size_of_field(N);
MyForm::radioButtonPeople->Enabled = false;
MyForm::radioButtonServer->Enabled = false;
MyForm::buttonSave->Enabled = false;
MyForm::textBoxSize->Enabled = false;
MyForm::pictureBox1->Enabled = true;
cell_height = int(MyForm::pictureBox1->Height / N);
cell_width = int(MyForm::pictureBox1->Width / N);
Graphics^ ris = MyForm::pictureBox1->CreateGraphics();
for(int i=0; i<size_of_field; i++)
for (int j = 0; j < size_of_field; j++) {
ris->FillRectangle(Brushes::Black, i * cell_width, j * cell_height, cell_width, cell_height);
ris->FillRectangle(Brushes::White, i * cell_width + 1, j * cell_height + 1, cell_width - 2, cell_height - 2);
}
}
}
catch (...) {
MessageBox::Show("Can't get size", "Error", MessageBoxButtons::OK);
}
}
System::Void kursgraf1::MyForm::pictureBox1_Click(System::Object^ sender, System::EventArgs^ e)
{
int Curs_X = Cursor->Position.X - MyForm::pictureBox1->Location.X - MyForm::Location.X - 8;
int Curs_Y = Cursor->Position.Y - MyForm::pictureBox1->Location.Y - MyForm::Location.Y - 30;
bool cuccessful_set = false;
int x, y;
Graphics^ ris = MyForm::pictureBox1->CreateGraphics();
try {
for (x = 0; x < size_of_field; x++) {
for (y = 0; y < size_of_field; y++) {
if ((Curs_X > (x * cell_width)) && (Curs_X < ((x + 1) * cell_width)) && (Curs_Y > (y * cell_height)) && (Curs_Y < ((y + 1) * cell_height))) {
cuccessful_set = MyForm::game_field.set_cell_value(x, y, 1);
if (!cuccessful_set)
throw 1;
if (player_turn == 1) {
ris->FillRectangle(Brushes::Red, x * cell_width + (cell_width/2 - 5), y * cell_height + 5, 10, cell_height - 10);
ris->FillRectangle(Brushes::White, x * cell_width + (cell_width / 2 - 3), y * cell_height + 8, 6, cell_height - 16);
}
if (player_turn == 2) {
ris->FillEllipse(Brushes::Green, x * cell_width + 5, y * cell_height + 5, cell_width - 10, cell_height - 10);
ris->FillEllipse(Brushes::White, x * cell_width + 8, y * cell_height + 8, cell_width - 16, cell_height - 16);
}
if (player_turn == 1 && !opponent_is_server)
player_turn = 2;
else if (player_turn == 2 && !opponent_is_server)
player_turn = 1;
}
}
}
if (game_field.is_filled() == false && opponent_is_server)
{
game_field.move_of_server(&x, &y);
ris->FillEllipse(Brushes::Blue, x * cell_width + 5, y * cell_height + 5, cell_width - 10, cell_height - 10);
ris->FillEllipse(Brushes::White, x * cell_width + 8, y * cell_height + 8, cell_width - 16, cell_height - 16);
}
}
catch (...) {
MessageBox::Show("Can't write there", "Error", MessageBoxButtons::OK);
}
if (game_field.is_filled()) {
int winner = game_field.count_even_summs();
if(winner == 1)
MessageBox::Show("Winner is player 1!!!", "RESULTS", MessageBoxButtons::OK);
else if(winner == 2)
MessageBox::Show("Winner is player 2!!!", "RESULTS", MessageBoxButtons::OK);
else
MessageBox::Show("DRAW!!!", "RESULTS", MessageBoxButtons::OK);
Application::Exit();
}
}
|
e7ac628e59308af884122fed7e714bb4f798c4ee
|
7be4f595d555614a28f708c1ba7edda321f0cf30
|
/practice/mathematics/fundamentals/possible_path/possible_path.cpp
|
f26fde90eb32a9d7a7804d95e45fcb09da428d62
|
[] |
no_license
|
orel1108/hackerrank
|
de31a2d31aaf8aeb58477d1f2738744bfe492555
|
55da1f3a94e8c28ed0f0dea3103e51774f0047de
|
refs/heads/master
| 2021-04-09T17:38:25.112356
| 2017-01-22T11:21:19
| 2017-01-22T11:21:19
| 50,198,159
| 3
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 716
|
cpp
|
possible_path.cpp
|
#include <iostream>
#include <algorithm>
using namespace std;
unsigned long long gcd(unsigned long long i_a, unsigned long long i_b)
{
if(i_a < i_b)
{
swap(i_a, i_b);
}
while(i_b > 0)
{
unsigned long long c = i_a % i_b;
i_a = i_b;
i_b = c;
}
return i_a;
}
int main()
{
int t;
unsigned long long a, b, x, y;
cin >> t;
while (t--)
{
cin >> a >> b >> x >> y;
unsigned long long t = gcd(a, b);
unsigned long long s = gcd(x, y);
if (s == t)
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
}
return 0;
}
|
fa66e689b5f5af4cbb0a5b482610770e2063a228
|
f5b35e78b4e6c7192c0cd05b5715679c5049f06a
|
/rai/LGP/bounds.cpp
|
f1660fef828ace10312822939ab892ba1af1a239
|
[
"MIT"
] |
permissive
|
HM-Van/rai
|
03621090d1a3b030904d40084c4b57f82f1e9f97
|
245d44305641045bd7392d40ef6ad2699c3e5bd8
|
refs/heads/master
| 2020-07-02T05:34:42.035837
| 2019-04-25T14:22:49
| 2019-04-25T14:22:49
| 201,429,393
| 0
| 0
|
MIT
| 2019-08-09T08:49:52
| 2019-08-09T08:49:51
| null |
UTF-8
|
C++
| false
| false
| 4,898
|
cpp
|
bounds.cpp
|
#include "bounds.h"
//#include <Kin/switch.h>
#include <Kin/TM_transition.h>
template<> const char* rai::Enum<BoundType>::names []= {
"symbolic", "pose", "seq", "path", "seqPath", NULL
};
void skeleton2Bound(KOMO& komo, BoundType boundType, const Skeleton& S,
const rai::KinematicWorld& startKinematics,
const rai::KinematicWorld& effKinematics,
bool collisions, const arrA& waypoints){
double maxPhase=0;
for(const SkeletonEntry& s:S) if(s.phase1>maxPhase) maxPhase=s.phase1;
komo.clearObjectives();
//-- prepare the komo problem
switch(boundType) {
case BD_pose: {
//-- grep only the latest entries in the skeleton
Skeleton finalS;
for(const SkeletonEntry& s:S) if(s.phase0>=maxPhase){
finalS.append(s);
finalS.last().phase0 -= maxPhase-1.;
finalS.last().phase1 -= maxPhase-1.;
}
komo.setModel(effKinematics, collisions);
komo.setTiming(1., 1, 10., 1);
komo.setHoming(0., -1., 1e-2);
komo.setSquaredQVelocities(1., -1., 1e-1); //IMPORTANT: do not penalize transitions of from prefix to x_{0} -> x_{0} is 'loose'
komo.setSquaredQuaternionNorms();
komo.setSkeleton(finalS, false);
//-- deactivate all velocity objectives except for transition
for(Objective *o:komo.objectives){
if(!std::dynamic_pointer_cast<TM_Transition>(o->map) && o->map->order>0){
o->vars.clear();
}
}
if(collisions) komo.add_collision(false);
komo.reset();
// komo.setPairedTimes();
} break;
case BD_seq: {
komo.setModel(startKinematics, collisions);
komo.setTiming(maxPhase+1., 1, 5., 1);
komo.setHoming(0., -1., 1e-2);
komo.setSquaredQVelocities(0., -1., 1e-2);
// komo.setFixEffectiveJoints(0., -1., 1e2);
// komo.setFixSwitchedObjects(0., -1., 1e2);
komo.setSquaredQuaternionNorms();
komo.setSkeleton(S);
if(collisions) komo.add_collision(true, 0., 1e1);
komo.reset();
// komo.setPairedTimes();
// cout <<komo.getPath_times() <<endl;
} break;
case BD_path: {
komo.setModel(startKinematics, collisions);
uint stepsPerPhase = rai::getParameter<uint>("LGP/stepsPerPhase", 10);
uint pathOrder = rai::getParameter<uint>("LGP/pathOrder", 2);
komo.setTiming(maxPhase+.5, stepsPerPhase, 10., pathOrder);
komo.setHoming(0., -1., 1e-2);
if(pathOrder==1) komo.setSquaredQVelocities();
else komo.setSquaredQAccelerations();
komo.setSquaredQuaternionNorms();
komo.setSkeleton(S);
if(collisions) komo.add_collision(true, 0, 1e1);
komo.reset();
// cout <<komo.getPath_times() <<endl;
} break;
case BD_seqPath: {
komo.setModel(startKinematics, collisions);
uint stepsPerPhase = rai::getParameter<uint>("LGP/stepsPerPhase", 10);
uint pathOrder = rai::getParameter<uint>("LGP/pathOrder", 2);
komo.setTiming(maxPhase+.5, stepsPerPhase, 10., pathOrder);
komo.setHoming(0., -1., 1e-2);
if(pathOrder==1) komo.setSquaredQVelocities();
else komo.setSquaredQAccelerations();
komo.setSquaredQuaternionNorms();
CHECK_EQ(waypoints.N-1, floor(maxPhase+.5), "");
for(uint i=0;i<waypoints.N-1;i++){
komo.addObjective(ARR(double(i+1)), OT_sos, FS_qItself, {}, {1e-1}, waypoints(i));
}
komo.setSkeleton(S);
//delete all added objectives! -> only keep switches
// uint O = komo.objectives.N;
// for(uint i=O; i<komo.objectives.N; i++) delete komo.objectives(i);
// komo.objectives.resizeCopy(O);
if(collisions) komo.add_collision(true, 0, 1e1);
komo.reset();
komo.initWithWaypoints(waypoints);
// cout <<komo.getPath_times() <<endl;
} break;
case BD_seqVelPath: {
komo.setModel(startKinematics, collisions);
uint stepsPerPhase = rai::getParameter<uint>("LGP/stepsPerPhase", 10);
komo.setTiming(maxPhase+.5, stepsPerPhase, 10., 1);
komo.setHoming(0., -1., 1e-2);
komo.setSquaredQVelocities();
komo.setSquaredQuaternionNorms();
CHECK_EQ(waypoints.N-1, floor(maxPhase+.5), "");
for(uint i=0;i<waypoints.N-1;i++){
komo.addObjective(ARR(double(i+1)), OT_sos, FS_qItself, {}, {1e-1}, waypoints(i));
// komo.addObjective(ARR(double(i+1)), OT_eq, FS_qItself, {}, {1e0}, waypoints(i));
}
// uint O = komo.objectives.N;
komo.setSkeleton(S);
//delete all added objectives! -> only keep switches
// for(uint i=O; i<komo.objectives.N; i++) delete komo.objectives(i);
// komo.objectives.resizeCopy(O);
if(collisions) komo.add_collision(true, 0, 1e1);
komo.reset();
komo.initWithWaypoints(waypoints, false);
// cout <<komo.getPath_times() <<endl;
} break;
default: NIY;
}
}
|
fb89d7816f5c6d10d45b8593b9b168374d82a6c5
|
b1ec31f5854ee53f371332129ab053a845857aa5
|
/C++/Solved/138_CopyListWithRandomPointer.h
|
aac6dbea3523c1fd755eebdd26f17278f6407f73
|
[] |
no_license
|
bubbercn/LeetCode
|
e9c1ec2e6f9260b69f64e63fbd2bf97cf65e3ad7
|
42c19adba8d360059e8159564d7384d662c24e8d
|
refs/heads/master
| 2023-08-31T10:40:06.288845
| 2023-08-26T13:55:55
| 2023-08-26T13:55:55
| 56,971,005
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,339
|
h
|
138_CopyListWithRandomPointer.h
|
#pragma once
#include "Common.h"
// Definition for a Node.
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next = NULL;
random = NULL;
}
};
class Solution
{
public:
Node* copyRandomList(Node* head)
{
Node* input = head;
unordered_map<Node*, size_t> inputLookup;
unordered_map<size_t, Node*> outputLookup;
Node* output = nullptr, * result = nullptr;
size_t index = 0;
while (input != nullptr)
{
Node* temp = new Node(input->val);
if (index == 0)
{
result = temp;
}
else
{
output->next = temp;
}
inputLookup.emplace(input, index);
outputLookup.emplace(index, temp);
output = temp;
input = input->next;
index++;
}
input = head;
output = result;
while (input != nullptr)
{
output->random = input->random == nullptr ? nullptr : outputLookup[inputLookup[input->random]];
input = input->next;
output = output->next;
}
return result;
}
};
void Test()
{
}
|
528c5027d4d1d8923842d660330dc0ede47d56ae
|
7e3e04175f6450c0da5c136257e37116f6c1d5e2
|
/include/scl/concepts/Invocable.h
|
dd409deb54ee9d81d8890db77d7df322d105c7b1
|
[
"MIT"
] |
permissive
|
Voltra/SupportClassLibrary
|
c3fa2006c21891e345be23d448aaec4ad07d9ff0
|
46f7164049f6d4ed8ba932fc8c1c463fa9dce31a
|
refs/heads/master
| 2022-09-01T23:25:56.250912
| 2021-03-01T18:38:55
| 2021-03-01T18:38:55
| 155,055,476
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 622
|
h
|
Invocable.h
|
#pragma once
//#ifdef SCL_CPP17
#include <scl/tools/meta/type_check.h>
namespace scl{
namespace concepts{
/**
* Invocable concept, a type F is invocable with Args if meta::is_invocable<F, Args...>() is true
* @tparam F being the type to check against
* @tparam Args being the arguments' types to check against
*/
template <class F, class... Args>
struct Invocable{
constexpr operator bool() const{
using namespace scl::tools;
static_assert(meta::is_invocable<F, Args...>(), "Invocable<F, Args...>: Cannot invoke F w/ Args...");
return true;
}
};
}
}
//#endif
|
66dd0a337f279bfc8a8b33f38a0653980f517f73
|
c95937d631510bf5a18ad1c88ac59f2b68767e02
|
/tests/gtests/graph/api/test_cpp_api_op.cpp
|
24feed8c1f89546005195d68adce33eccf230110
|
[
"BSD-3-Clause",
"MIT",
"Intel",
"BSL-1.0",
"Apache-2.0",
"BSD-2-Clause"
] |
permissive
|
oneapi-src/oneDNN
|
5cdaa8d5b82fc23058ffbf650eb2f050b16a9d08
|
aef984b66360661b3116d9d1c1c9ca0cad66bf7f
|
refs/heads/master
| 2023-09-05T22:08:47.214983
| 2023-08-09T07:55:23
| 2023-09-05T13:13:34
| 58,414,589
| 1,544
| 480
|
Apache-2.0
| 2023-09-14T07:09:12
| 2016-05-09T23:26:42
|
C++
|
UTF-8
|
C++
| false
| false
| 7,362
|
cpp
|
test_cpp_api_op.cpp
|
/*******************************************************************************
* Copyright 2020-2023 Intel Corporation
*
* 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 "oneapi/dnnl/dnnl_graph.hpp"
#include "oneapi/dnnl/dnnl_graph_types.h"
#include <gtest/gtest.h>
#include <vector>
TEST(APIOp, CreateAllOps) {
using namespace dnnl::graph;
dnnl_graph_op_kind_t first_op = dnnl_graph_op_abs;
dnnl_graph_op_kind_t last_op = dnnl_graph_op_last_symbol;
// This list should be the same as the definition of `op::kind` in
// dnnl_graph.hpp.
// clang-format off
std::vector<op::kind> all_kind_enums {
op::kind::Abs,
op::kind::AbsBackward,
op::kind::Add,
op::kind::AvgPool,
op::kind::AvgPoolBackward,
op::kind::BatchNormTrainingBackward,
op::kind::BatchNormForwardTraining,
op::kind::BatchNormInference,
op::kind::BiasAdd,
op::kind::BiasAddBackward,
op::kind::Clamp,
op::kind::ClampBackward,
op::kind::Concat,
op::kind::Convolution,
op::kind::ConvolutionBackwardData,
op::kind::ConvolutionBackwardWeights,
op::kind::ConvTranspose,
op::kind::ConvTransposeBackwardData,
op::kind::ConvTransposeBackwardWeights,
op::kind::Dequantize,
op::kind::Divide,
op::kind::DynamicDequantize,
op::kind::DynamicQuantize,
op::kind::Elu,
op::kind::EluBackward,
op::kind::End,
op::kind::Exp,
op::kind::GELU,
op::kind::GELUBackward,
op::kind::HardSwish,
op::kind::HardSwishBackward,
op::kind::Interpolate,
op::kind::InterpolateBackward,
op::kind::LayerNorm,
op::kind::LayerNormBackward,
op::kind::LeakyReLU,
op::kind::Log,
op::kind::LogSoftmax,
op::kind::LogSoftmaxBackward,
op::kind::MatMul,
op::kind::Maximum,
op::kind::MaxPool,
op::kind::MaxPoolBackward,
op::kind::Minimum,
op::kind::Mish,
op::kind::MishBackward,
op::kind::Multiply,
op::kind::PReLU,
op::kind::PReLUBackward,
op::kind::Quantize,
op::kind::Reciprocal,
op::kind::ReduceL1,
op::kind::ReduceL2,
op::kind::ReduceMax,
op::kind::ReduceMean,
op::kind::ReduceMin,
op::kind::ReduceProd,
op::kind::ReduceSum,
op::kind::ReLU,
op::kind::ReLUBackward,
op::kind::Reorder,
op::kind::Round,
op::kind::Sigmoid,
op::kind::SigmoidBackward,
op::kind::SoftMax,
op::kind::SoftMaxBackward,
op::kind::SoftPlus,
op::kind::SoftPlusBackward,
op::kind::Sqrt,
op::kind::SqrtBackward,
op::kind::Square,
op::kind::SquaredDifference,
op::kind::StaticReshape,
op::kind::StaticTranspose,
op::kind::Subtract,
op::kind::Tanh,
op::kind::TanhBackward,
op::kind::TypeCast,
op::kind::Wildcard,
op::kind::HardSigmoid,
op::kind::HardSigmoidBackward,
op::kind::Select,
op::kind::Pow,
};
// clang-format on
const auto num_ops = all_kind_enums.size();
for (size_t i = static_cast<size_t>(first_op);
i < static_cast<size_t>(last_op); ++i) {
ASSERT_LT(i, num_ops);
op::kind kind = all_kind_enums[i];
ASSERT_EQ(i, static_cast<size_t>(kind));
op aop {0, kind, "test op"};
}
}
TEST(APIOp, CreateWithInputList) {
using namespace dnnl::graph;
using data_type = logical_tensor::data_type;
using layout_type = logical_tensor::layout_type;
logical_tensor lt1 {0, data_type::f32, layout_type::strided};
logical_tensor lt2 {1, data_type::f32, layout_type::strided};
logical_tensor lt3 {2, data_type::f32, layout_type::strided};
op conv {0, op::kind::Convolution, {lt1, lt2}, {lt3}, "Convolution_1"};
}
TEST(APIOp, CreateWithDefaultName) {
using namespace dnnl::graph;
using data_type = logical_tensor::data_type;
using layout_type = logical_tensor::layout_type;
logical_tensor lt1 {0, data_type::f32, layout_type::strided};
logical_tensor lt2 {1, data_type::f32, layout_type::strided};
logical_tensor lt3 {2, data_type::f32, layout_type::strided};
op conv {0, op::kind::Convolution};
conv.add_inputs({lt1, lt2});
conv.add_outputs({lt3});
}
TEST(APIOp, SetInput) {
using namespace dnnl::graph;
using data_type = logical_tensor::data_type;
using layout_type = logical_tensor::layout_type;
const size_t id = 123;
op conv {id, op::kind::Convolution, "convolution"};
logical_tensor data {0, data_type::f32, layout_type::strided};
logical_tensor weight {1, data_type::f32, layout_type::strided};
conv.add_input(data);
conv.add_input(weight);
}
TEST(APIOp, SetOutput) {
using namespace dnnl::graph;
using data_type = logical_tensor::data_type;
using layout_type = logical_tensor::layout_type;
const size_t id = 123;
op conv {id, op::kind::Convolution, "convolution"};
logical_tensor output {2, data_type::f32, layout_type::strided};
conv.add_output(output);
}
TEST(APIOp, SetAttr) {
using namespace dnnl::graph;
const size_t id = 123;
op conv {id, op::kind::Convolution, "convolution"};
conv.set_attr<std::vector<int64_t>>(op::attr::strides, {1, 1});
conv.set_attr<int64_t>(op::attr::groups, 1);
conv.set_attr<std::string>(op::attr::auto_pad, "VALID");
// conv.set_attr<std::vector<float>>("float_vec", {1., 1.});
// conv.set_attr<float>("float_val", 1.);
}
TEST(APIOp, ShallowCopy) {
using namespace dnnl::graph;
const size_t id = 123;
op conv {id, op::kind::Convolution, "convolution"};
op conv_1(conv); // NOLINT
ASSERT_EQ(conv.get(), conv_1.get());
}
TEST(APIOp, SoftPlusAttr) {
using namespace dnnl::graph;
const size_t id = 123;
op softplus {id, op::kind::SoftPlus, "softplus"};
softplus.set_attr<float>(op::attr::beta, 2.f);
logical_tensor in {0, logical_tensor::data_type::f32,
logical_tensor::layout_type::strided};
logical_tensor out {1, logical_tensor::data_type::f32,
logical_tensor::layout_type::strided};
softplus.add_input({in});
softplus.add_output({out});
graph g(engine::kind::cpu);
g.add_op(softplus);
g.finalize();
}
|
8d3390a102e5b58e490f2bedd432ef83d7cdd432
|
58458e1e30a8dc7b90cbe54325cd96c9fe5874b5
|
/srs_client.cc
|
7f9b39a73bf12b567fa7f9741549e4f0b5a13f72
|
[] |
no_license
|
sPHENIX-Collaboration/CAEN_VME
|
a178694fb7c686f6093c2ecc7642936ade82f9f2
|
57f6eb9eeb1689aaf62498a9a847835041b6c7db
|
refs/heads/master
| 2020-07-04T08:39:44.942634
| 2016-11-15T23:46:02
| 2016-11-15T23:46:02
| 73,865,654
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,295
|
cc
|
srs_client.cc
|
#include <iostream>
#include <sstream>
#include <tspm_udp_communication.h>
#include <parseargument.h>
using namespace std;
#define MY_IP "10.0.0.2"
void exithelp( const int ret =1)
{
cout << std::endl;
cout << " tspm_client usage " << std::endl;
cout << " tspm_client 0 read register 0" << std::endl;
cout << " tspm_client 0 4 write 4 into register 0" << std::endl;
cout << " tspm_client set-asic-disable-mask value " << std::endl;
cout << " tspm_client disable-all-asics " << std::endl;
cout << " tspm_client set-all-dacs lowvalue (0-0xfff) highvalue (0-0xfff) " << std::endl;
cout << " tspm_client udpheader1 [value] read or write the header 1 value (reg 9)" << std::endl;
cout << " tspm_client udpheader2 [value] read or write the header 2 value (reg 10)" << std::endl;
cout << " tspm_client reset-spi <towerboard> reset the SPI data for a given tower" << std::endl;
cout << " tspm_client reset full board reset" << std::endl;
cout << " " << std::endl;
exit(ret);
}
main(int argc, char *argv[])
{
if ( argc==1)
{
cout << "usage: " << argv[0] << " register [value], or:" << endl;
exit(1);
}
tspm_udp_communication *tspm = new tspm_udp_communication (MY_IP);
tspm->init();
unsigned short reg;
unsigned int val = 0;
unsigned int val2 = 0;
int i;
if ( argc > 2 )
{
if ( strcmp( argv[1], "udpheader1") == 0)
{
val = get_uvalue( argv[2]);
i = tspm->set_value( 9, val);
}
else if ( strcmp( argv[1], "udpheader2") == 0)
{
val = get_uvalue( argv[2]);
i = tspm->set_value( 10, val);
}
else if ( strcmp( argv[1], "reset-spi") == 0)
{
reg = get_uvalue( argv[2]) & 0x7 ;
i = tspm->reset_spi( val);
}
else if ( strcmp( argv[1], "set-asic-disable-mask") == 0)
{
val = get_uvalue( argv[2]);
i = tspm->set_value( 1, val);
}
else if ( strcmp( argv[1], "set-all-dacs") == 0)
{
if ( argc < 4) exithelp();
val = get_uvalue( argv[2]) & 0xffff;
val2 = get_uvalue( argv[3]) & 0xffff;
unsigned int x = val;
x <<= 16;
x+= val2;
i = tspm->set_multiplevalues( 24, 11, x);
}
else
{
reg = get_uvalue( argv[1]);
val = get_uvalue( argv[2]);
i = tspm->set_value( reg, val);
cout << " set of register " << reg << " to " << val << " 0x" << hex << val << dec << " status = " << i << endl;
}
}
else
{
if ( strcmp( argv[1], "reset") == 0)
{
i = tspm->set_value( 0, 1);
}
else if ( strcmp( argv[1], "help") == 0)
{
exithelp(0);
}
else if ( strcmp( argv[1], "udpheader1") == 0)
{
i = tspm->get_value( 9, &val);
cout << " udpheader1 status = " << i << " value " << val << " 0x" << hex << val << endl;
}
else if ( strcmp( argv[1], "udpheader2") == 0)
{
i = tspm->get_value( 10, &val);
cout << " udpheader2 status = " << i << " value " << val << " 0x" << hex << val << endl;
}
else if ( strcmp( argv[1], "disable-all-asics") == 0)
{
i = tspm->set_value( 1, 0xffffff);
}
else
{
reg = atoi (argv[1]);
i = tspm->get_value( reg, &val);
cout << " register " << reg << " status = " << i << " value " << val << " 0x" << hex << val << endl;
}
}
return 0;
}
|
ffe5420a6aabeecbe54c533764f45ab43161757f
|
8d05a1049e95d7ea3ce2b9b9a41ab62217f6cfe9
|
/hello_googletest03/tests/test_target.cpp
|
59df4159543a3f43057241c4988b7220785711b4
|
[] |
no_license
|
tacchang001/example_c
|
04741403a7c6cba11cfcf3d7bc542b3d0103eb76
|
3031f83d3ef7eba133e832a8322525355ff6630e
|
refs/heads/master
| 2020-05-19T07:26:48.562433
| 2018-12-28T14:35:05
| 2018-12-28T14:35:05
| 29,384,495
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,641
|
cpp
|
test_target.cpp
|
// https://stackoverflow.com/questions/31989040/can-gmock-be-used-for-stubbing-c-functions
#include "IBar.h"
#include <memory>
#include "gtest/gtest.h"
#include "gmock/gmock.h"
using namespace ::testing;
using ::testing::Return;
class BCM2835_MOCK {
public:
virtual ~BCM2835_MOCK() {}
// mock methods
MOCK_METHOD0(bcm2835_init, int());
MOCK_METHOD2(bcm2835_gpio_fsel, void(uint8_t, uint8_t));
};
class TestFixture : public ::testing::Test {
public:
TestFixture() {
_bcm2835Mock.reset(new ::testing::NiceMock<BCM2835_MOCK>());
}
~TestFixture() {
_bcm2835Mock.reset();
}
virtual void SetUp() {}
virtual void TearDown() {}
// pointer for accessing mocked library
static std::unique_ptr<BCM2835_MOCK> _bcm2835Mock;
};
// fake lib functions
int bcm2835_init() {
return TestFixture::_bcm2835Mock->bcm2835_init();
}
void bcm2835_gpio_fsel(uint8_t pin, uint8_t mode) {
TestFixture::_bcm2835Mock->bcm2835_gpio_fsel(pin, mode);
}
// create unit testing class for BCM2835 from TestFixture
class BCM2835LibUnitTest : public TestFixture {
public:
BCM2835LibUnitTest() {
// here you can put some initializations
}
};
TEST_F(BCM2835LibUnitTest, inits) {
EXPECT_CALL(*_bcm2835Mock, bcm2835_init()).Times(1).WillOnce(Return(1));
EXPECT_EQ(1, inits()) << "init must return 1";
}
TEST_F(BCM2835LibUnitTest, pinModeTest) {
EXPECT_CALL(*_bcm2835Mock, bcm2835_gpio_fsel((uint8_t) RPI_V2_GPIO_P1_18, (uint8_t) BCM2835_GPIO_FSEL_OUTP
)
)
.Times(1);
pinMode((uint8_t) RPI_V2_GPIO_P1_18, (uint8_t) BCM2835_GPIO_FSEL_OUTP);
}
|
95de238615e16bb4b8535777c64925a72ace5221
|
c5b3c310f77a94f895f4cb194f2909bf15f2e99a
|
/libgramtools/include/build/kmer_index/dump.hpp
|
8d7aa447a7fea05a21358e4c3747ce1d808b39e8
|
[
"MIT"
] |
permissive
|
iqbal-lab-org/gramtools
|
f80f827cd9269963fefe577f7008bfcbf7ada77a
|
2d3a89da3a91a253341e6623a00d00fc19c2d587
|
refs/heads/main
| 2022-11-22T20:22:46.809913
| 2022-03-16T14:10:21
| 2022-03-16T14:10:21
| 33,718,573
| 72
| 9
|
MIT
| 2022-11-17T15:44:00
| 2015-04-10T08:52:54
|
C++
|
UTF-8
|
C++
| false
| false
| 3,317
|
hpp
|
dump.hpp
|
/**
* @file
* Set of routines to dump the contents of the `gram::KmerIndex` to disk.
* The procedures dump to disk the minimal amount of information necessary in
* order to fully recover the `KmerIndex` for `quasimap`. The procedure works as
* follows:
* * Serialise all the indexed kmers in a file `kmers` as: kmer1,kmer2,kmer3...
* * Serialise the kmer statistics in a file `kmer_stats` as:
* Length_SearchStates_kmer1,Length_VariantSitePath1_kmer1,Length_VariantSitePath2_kmer1,...,Length_SearchStates_kmer2,...
* * Serialise the kmer `gram::SearchStates` in a file `sa_intervals` as:
* SA_left1_kmer1,SA_right1_kmer1,SA_left2_kmer1,SA_right2_kmer1,...SA_left1_kmer2,...
* * Serialise all their `gram::variant_site_path`s in a file `paths` as:
* SearchState1_Marker1_kmer1,SearchState1_Allele1_kmer1,SearchState1_Marker2_kmer1,SearchState1_Allele2_kmer1,SearchState2_Marker1_Allele1_kmer1,....
* The `kmer_stats` file holds the information required to associate each
* deserialised kmer in `kmers` with its `gram::SearchStates` taken out of
* `search_states` and populated, one by one, with `gram::variant_site_path`s
* from `paths`.
*/
#include "build.hpp"
#ifndef GRAMTOOLS_KMER_INDEX_DUMP_HPP
#define GRAMTOOLS_KMER_INDEX_DUMP_HPP
namespace gram {
/**
* Calculates summary statistics of the indexed kmers.
* @ret gram::KmerIndexStats
*/
KmerIndexStats calculate_stats(const KmerIndex &kmer_index);
/**
* Builds a binary file of integers ranging 0-3 representing each base of each
* indexed kmer.
*/
sdsl::int_vector<3> dump_kmers(const KmerIndex &kmer_index,
const BuildParams ¶meters);
/**
* Builds a binary file containing statistics for each indexed kmers.
* These are:
* * The number of disjoint `gram::SA_Interval`s for that kmer (ie size of
* `gram::SearchStates`)
* * The length of each `gram::variant_site_path` for each `gram::SearchState`
* of the indexed kmer.
* @note extracting each kmer, and each kmer's `gram::SearchStates` from @param
* all_kmers ensures a 1-1 mapping between the dumped kmers and the dumped kmer
* statistics.
*/
void dump_kmers_stats(const KmerIndexStats &stats,
const sdsl::int_vector<3> &all_kmers,
const KmerIndex &kmer_index,
const BuildParams ¶meters);
/**
* Builds a binary file containing the start and end SA index of each
* `gram::SA_Interval` for all indexed kmers.
*/
void dump_sa_intervals(const KmerIndexStats &stats,
const sdsl::int_vector<3> &all_kmers,
const KmerIndex &kmer_index,
const BuildParams ¶meters);
/**
* Builds a binary file containing the variant site marker(s) and variant site
* allele(s) traversed for each `gram::SA_interval`.
*/
void dump_paths(const KmerIndexStats &stats,
const sdsl::int_vector<3> &all_kmers,
const KmerIndex &kmer_index, const BuildParams ¶meters);
namespace kmer_index {
/**
* Dumps to disk the indexed kmers, their `gram::SearchStates`, their
* `gram::VariantSitePath`s and kmer statistics.
*/
void dump(const KmerIndex &kmer_index, const BuildParams ¶meters);
} // namespace kmer_index
} // namespace gram
#endif // GRAMTOOLS_KMER_INDEX_DUMP_HPP
|
08878a9f8c9ecea9ca5bd82797bf41f4b4339ef7
|
9f49936225ecea72115dbd10954c514eb5293cb8
|
/chap02/2-1.cpp
|
264604ad0d5f601dc8ea05ac3bea16f890e20e5d
|
[] |
no_license
|
i2585/C-
|
0b82fc5938020843bda3275fdf79fa04a8684e02
|
c043cc15047b6e384040e9dd8ca2cf3bc6a31678
|
refs/heads/master
| 2021-07-06T06:37:23.611572
| 2021-01-20T07:54:03
| 2021-01-20T07:54:03
| 223,906,893
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 170
|
cpp
|
2-1.cpp
|
#include <iostream>
using namespace std;
int main(){
int i;
for(int i=1; i<=100; i++){
cout << i << " ";
if(i%10==0)
cout << "\n";
}
return 0;
}
|
2d6aaea81a2909c0e68fe5e8a6a61d58a42d88ab
|
db63b6abeaed2647f8f9577127bcbbf79d71b39c
|
/fem2d_navier_stokes_cavity/cavity.cpp
|
63f1d4671d2caa31c22cc135d3c91accc870a8b9
|
[] |
no_license
|
zichaotong/Computation_using_CPP
|
58bf8aca534326b4fe635955e920d33af9235bbf
|
ed2d963a9b1ab51bc8e2c38570e843b517c36450
|
refs/heads/master
| 2022-05-25T04:12:55.202002
| 2015-06-27T02:41:50
| 2015-06-27T02:41:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,686
|
cpp
|
cavity.cpp
|
# include <cstdlib>
# include <cmath>
using namespace std;
void dirichlet_condition ( int n, double xy[], double u_bc[], double v_bc[],
double p_bc[] );
void rhs ( int n, double xy[], double u_rhs[], double v_rhs[], double p_rhs[] );
//******************************************************************************
void dirichlet_condition ( int n, double xy[], double u_bc[], double v_bc[],
double p_bc[] )
//******************************************************************************
//
// Purpose:
//
// DIRICHLET_CONDITION sets the value of a Dirichlet boundary condition.
//
// Discussion:
//
//
// U = 1 V = 0
//
// 1 +---------------+
// | |
// | |
// | |
// U = V = 0 | | U = V = 0
// | |
// | |
// | |
// 0 +---------------+
//
// 0 1
//
// U = V = 0
//
// Modified:
//
// 08 September 2006
//
// Author:
//
// John Burkardt
//
// Parameters:
//
// Input, int N, the number of points.
//
// Input, double XY[2*N], the coordinates of the points.
//
// Output, double U_BC[N], V_BC[N], P_BC[N], the values of the
// Dirichlet boundary conditions on horizontal velocity, vertical velocity,
// and pressure.
//
{
int node;
double tol = 0.0001;
double x;
double y;
for ( node = 0; node < n; node++ )
{
x = xy[0+node*2];
y = xy[1+node*2];
if ( fabs ( y - 1.0 ) <= tol )
{
u_bc[node] = 1.0;
}
else
{
u_bc[node] = 0.0;
}
v_bc[node] = 0.0;
p_bc[node] = 0.0;
}
return;
}
//******************************************************************************
void rhs ( int n, double xy[], double u_rhs[], double v_rhs[], double p_rhs[] )
//******************************************************************************
//
// Purpose:
//
// RHS gives the right-hand side of the differential equation.
//
// Modified:
//
// 08 September 2006
//
// Author:
//
// John Burkardt
//
// Parameters:
//
// Input, int N, the number of points.
//
// Input, double XY[2*N], the coordinates of the points.
//
// Output, double U_RHS[N], V_RHS[N], P_RHS[N], the right
// hand sides of the differential equations at the points.
//
{
int node;
for ( node = 0; node < n; node++ )
{
p_rhs[node] = 0.0;
u_rhs[node] = 0.0;
v_rhs[node] = 0.0;
}
return;
}
|
01362cfd5493c14894210638b6bdcb66b29cbaa3
|
b4f1041764fc859e0083bd409bfe8f866d35d05e
|
/src/video/VideoModule.hpp
|
bf267724b17b64fdf1ff0b5758deb032d2e7df90
|
[] |
no_license
|
karmalis/Romuva
|
384d4a069f3e63455c7aa53f92e21a620b80c277
|
03b65cb79e21ae1e1828e1bd10c0bf7619dd130e
|
refs/heads/master
| 2021-10-20T12:38:22.918597
| 2021-10-13T13:58:48
| 2021-10-13T13:58:48
| 242,136,220
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,186
|
hpp
|
VideoModule.hpp
|
//
// Created by voltairepunk on 2019-12-30.
//
#ifndef ROMUVA_VIDEOMODULE_HPP
#define ROMUVA_VIDEOMODULE_HPP
#include "../Module.hpp"
#include "OpenGLDefinitions.hpp"
namespace Romuva {
namespace Video {
class VideoModule : public Core::Module {
public:
VideoModule();
~VideoModule() override;
bool init() override;
void postInit()override;
void update(double delta) override;
void shutdown() override;
static void errorCallback(int error, const char * description);
protected:
GLFWwindow* _window;
bool _keepRendering;
static void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
static void characterCallback(GLFWwindow* window, unsigned int codepoint);
static void cursorPositionCallback(GLFWwindow* window, double xpos, double ypos);
static void onCursorEnterCallback(GLFWwindow* window, int entered);
static void mouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
};
}
}
#endif //ROMUVA_VIDEOMODULE_HPP
|
c519f51718fb6765f951886275766e7ca49f01f4
|
9b5bdb445216ed17ca9eac10f5faf029cdc96655
|
/test/RangeUpdateRangeSum.test.cpp
|
68d45c3033a2ff22b91c5f6c1d1247cb4e706dd9
|
[
"Apache-2.0"
] |
permissive
|
yuruhi/library
|
9aff0a72ce1259bfc5698cfbf3e50fc2a8688690
|
fecbd92ec6c6997d50bf954c472ac4bfeff74de5
|
refs/heads/master
| 2023-09-04T16:42:52.119525
| 2021-10-15T06:48:18
| 2021-10-15T06:48:18
| 257,237,518
| 0
| 0
| null | 2021-05-13T12:57:35
| 2020-04-20T09:49:17
|
C++
|
UTF-8
|
C++
| false
| false
| 572
|
cpp
|
RangeUpdateRangeSum.test.cpp
|
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_2_I"
#include "./../DataStructure/LazySegmentTree.cpp"
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n, q;
cin >> n >> q;
RangeUpdateRangeSum<ll, ll> seg(vector(n, S_sum<ll>(0)));
while (q--) {
int com, l, r;
cin >> com >> l >> r;
if (com == 0) {
ll x;
cin >> x;
seg.apply(l, r + 1, x);
} else if (com == 1) {
cout << seg.prod(l, r + 1).value << '\n';
}
}
}
|
bfb85815ff2bd79a30e09fb2615e46099ee61b1c
|
057e61b56f7caeebf00421933db21be12a7cb5ff
|
/baekjoon/5582.cpp
|
f873699cc488097f4630c7b3065803e02642d12a
|
[] |
no_license
|
skdudn321/algorithm
|
e8c5e0bc1afc12ed27708ccf37532ed5d2177e53
|
cd7a6d0c95eb34aac3a73e2bc7d7ff7767d87a8e
|
refs/heads/master
| 2020-04-06T06:51:21.411572
| 2017-12-12T12:13:17
| 2017-12-12T12:13:17
| 62,157,943
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 562
|
cpp
|
5582.cpp
|
#include<stdio.h>
#include<string.h>
int dp_table[5000][5000];
char str1[5000], str2[5000];
int main(void) {
int length1, length2;
int i, j;
int answer = 0;
scanf("%s\n", str1 + 1);
scanf("%s", str2 + 1);
length1 = strlen(str1 + 1);
length2 = strlen(str2 + 1);
for (i = 1; i <= length1; i++) {
for (j = 1; j <= length2; j++) {
if (str1[i] == str2[j]) {
dp_table[i][j] = dp_table[i - 1][j - 1] + 1;
if (dp_table[i][j] > answer) {
answer = dp_table[i][j];
}
}
}
}
printf("%d\n", answer);
}
|
53d8f5026f2ac296f170a1896295788a37784515
|
6f9e1eac8566eb300e17640bd601f0cda01a143a
|
/C Projects/Q.No.12.cpp
|
348f69a68209c1bb4a6eb1c070af0a8f2f01838f
|
[] |
no_license
|
samip9780/my_repository
|
f609187c6e8c7c28b0d1a49b766b1611fd8bf951
|
08e2304f2627b2eca22e5b3c7d828e9b9df7f023
|
refs/heads/master
| 2021-03-07T23:19:12.160049
| 2020-03-10T13:20:38
| 2020-03-10T13:20:38
| 246,303,218
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 249
|
cpp
|
Q.No.12.cpp
|
#include<stdio.h>
int main()
{
int a,b,c,product=1;
printf("Enter any number : ");
scanf("%d",&a);
c=a;
while(a!=0)
{
b=a%10;
a/=10;
product*=b;
}
printf("The product of the digits of %d = %d ",c,product);
return 0;
}
|
a94d66a8aa87f722316d567848ea06be4686f823
|
6d4b5957dccbd94ebeac2a75fe2e47a38adc0db2
|
/libs/libtorc-baseui/uiperformance.h
|
9ba53bbfcb7c12584640f26109bb518da758d2a8
|
[] |
no_license
|
gwsu/torc
|
b681d1cd86fb7be4d0b0574e71c3f492f736f533
|
1c56be71abffb770033084dd44aa2d3031671a5f
|
refs/heads/master
| 2021-01-18T19:32:11.908377
| 2014-02-25T12:41:27
| 2014-02-25T12:41:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,011
|
h
|
uiperformance.h
|
#ifndef UIPERFORMANCE_H
#define UIPERFORMANCE_H
// Qt
#include <QtGlobal>
#include <QVector>
#include <QString>
class QFile;
class UIPerformance
{
public:
UIPerformance();
virtual ~UIPerformance();
void SetFrameCount (int Count);
quint64 StartFrame (void);
void FinishDrawing (void);
private:
void RecordStartTime (quint64 Time);
void RecordEndTime (quint64 Time);
QString GetCPUStat (void);
private:
int m_currentCount;
int m_totalCount;
quint64 m_starttime;
bool m_starttimeValid;
QVector<uint> m_totalTimes;
QVector<uint> m_renderTimes;
qreal m_lastFPS;
qreal m_lastTotalSD;
qreal m_lastRenderSD;
QFile *m_CPUStat;
unsigned long long *m_lastStats;
QString m_lastCPUStats;
};
#endif // UIPERFORMANCE_H
|
0ec73a90a55ea20f0b5a21a38c78beaeabab2346
|
368114cd5aafd297c7550082e084dcc4b314ab0d
|
/Binary representation.cpp
|
29cb567d7a69e505b6a1d50f311e743ab94da008
|
[] |
no_license
|
Deepakku28/GeeksForGeeks
|
92edd0377dbd60239aa533c4db3253cc6b09efd4
|
9ec26ffe5482cf651eb07148c10178f812eccb8d
|
refs/heads/main
| 2023-02-23T22:14:09.533044
| 2021-01-24T08:20:41
| 2021-01-24T08:20:41
| 332,229,593
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 263
|
cpp
|
Binary representation.cpp
|
//https://practice.geeksforgeeks.org/problems/binary-representation5003/1#
class Solution{
public:
string getBinaryRep(int N){
string ans="";
for(int i=29;i>=0;i--){
ans+=to_string((N>>i)&1);
}
return ans;
}
};
|
975129b66b2bcac21340e0dc271b356774e6a325
|
bb8f8accc040f7e0880ac194fc823f96933345fd
|
/MARTIAN.cpp
|
de2e2a52d680e7a6049d2e4ceb805e148deb0de7
|
[] |
no_license
|
draconware/spoj
|
16f5501d9a721d93729db524896963bd2606746c
|
c8df41eceb00b87a6015465d30e21003bb681731
|
refs/heads/master
| 2021-01-01T06:00:56.568003
| 2018-02-28T16:57:15
| 2018-02-28T16:57:15
| 97,326,359
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 819
|
cpp
|
MARTIAN.cpp
|
#include<bits/stdc++.h>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("input.in","r",stdin);
freopen("output.out","w",stdout);
#endif
while(1){
int n,m;
cin>>n>>m;
if(n==0 && m==0){return 0;}
int arr1[n+1][m+1];
memset(arr1,0,sizeof(arr1));
for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>arr1[i][j];}}
int arr2[n+1][m+1];
memset(arr2,0,sizeof(arr2));
for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>arr2[i][j];}}
for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){arr1[i][j]+=arr1[i][j-1];}}
for(int i=1;i<=m;i++){for(int j=1;j<=n;j++){arr2[j][i]+=arr2[j-1][i];}}
int dp[n+1][m+1];
memset(dp,0,sizeof(dp));
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
dp[i][j] = max(arr2[i][j]+dp[i][j-1],arr1[i][j]+dp[i-1][j]);
}
}
cout<<dp[n][m]<<endl;
}
return 0;
}
|
cb72bb52315c51789ea9c69161baaa2c89e66cb9
|
add31c196e9f7fa02f0ab898b6eb8176d8ce061e
|
/main/button_handler.h
|
96d9be5faafdb79a58b05ed701ccd556bc6e5700
|
[
"Apache-2.0"
] |
permissive
|
chrta/sip_call
|
c9eb3c9497d36fdc8c5b4f11d4a15af37c590d33
|
1c62609dcaac744d626cacddcd6e072bec955d64
|
refs/heads/main
| 2022-12-15T10:18:17.431958
| 2022-12-03T16:00:27
| 2022-12-03T16:00:27
| 115,796,852
| 224
| 62
|
Apache-2.0
| 2022-12-03T14:19:50
| 2017-12-30T12:55:29
|
C++
|
UTF-8
|
C++
| false
| false
| 3,916
|
h
|
button_handler.h
|
/*
Copyright 2017 Christian Taedcke <hacking@taedcke.com>
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.
*/
#pragma once
#include "freertos/FreeRTOS.h"
#include <freertos/queue.h>
#include <boost/sml.hpp>
#include "driver/gpio.h"
namespace sml = boost::sml;
struct e_btn
{
};
struct e_call_end
{
};
struct e_timeout
{
};
template <class SipClientT>
struct dependencies
{
auto operator()() const noexcept
{
using namespace sml;
const auto action_call = [](SipClientT& d, const auto& event) {
d.request_ring(CONFIG_CALL_TARGET_USER, CONFIG_CALLER_DISPLAY_MESSAGE);
};
const auto action_cancel = [](SipClientT& d, const auto& event) {
d.request_cancel();
};
return make_transition_table(
*"idle"_s + event<e_btn> / action_call = "sRinging"_s, "sRinging"_s + event<e_timeout> / action_cancel = "idle"_s, "sRinging"_s + event<e_call_end> = "idle"_s);
}
};
enum class Event
{
BUTTON_PRESS,
CALL_END
};
template <class SipClientT, gpio_num_t GPIO_PIN, int RING_DURATION_TIMEOUT_MSEC>
class ButtonInputHandler
{
public:
explicit ButtonInputHandler(SipClientT& client)
: m_client { client }
, m_sm { client }
{
m_queue = xQueueCreate(10, sizeof(Event));
gpio_config_t gpioConfig;
gpioConfig.pin_bit_mask = (1ULL << GPIO_PIN);
gpioConfig.mode = GPIO_MODE_INPUT;
gpioConfig.pull_up_en = GPIO_PULLUP_ENABLE;
gpioConfig.pull_down_en = GPIO_PULLDOWN_DISABLE;
gpioConfig.intr_type = GPIO_INTR_POSEDGE;
gpio_config(&gpioConfig);
}
void run()
{
using namespace sml;
// This must not be in the contructor, since the constructor may be executed
// before initializing the internal gpio isr initialization function.
// In this case the following call would fail and crash afterwards.
ESP_ERROR_CHECK(gpio_install_isr_service(0));
ESP_ERROR_CHECK(gpio_isr_handler_add(GPIO_PIN, &ButtonInputHandler::int_handler, (void*)this));
for (;;)
{
Event event;
TickType_t timeout = m_sm.is("idle"_s) ? portMAX_DELAY : RING_DURATION_TICKS;
if (xQueueReceive(m_queue, &event, timeout))
{
if (event == Event::BUTTON_PRESS)
{
m_sm.process_event(e_btn {});
}
else if (event == Event::CALL_END)
{
m_sm.process_event(e_call_end {});
}
}
else
{
m_sm.process_event(e_timeout {});
}
}
}
void call_end()
{
Event event = Event::CALL_END;
// don't wait if the queue is full
xQueueSend(m_queue, &event, (TickType_t)0);
}
private:
SipClientT& m_client;
QueueHandle_t m_queue;
using ButtonInputHandlerT = ButtonInputHandler<SipClientT, GPIO_PIN, RING_DURATION_TIMEOUT_MSEC>;
static void int_handler(void* args)
{
ButtonInputHandlerT* obj = static_cast<ButtonInputHandlerT*>(args);
Event event = Event::BUTTON_PRESS;
xQueueSendToBackFromISR(obj->m_queue, &event, NULL);
}
sml::sm<dependencies<SipClientT>> m_sm;
static constexpr uint32_t RING_DURATION_TICKS = RING_DURATION_TIMEOUT_MSEC / portTICK_PERIOD_MS;
};
|
29ccd2985b868fa76380f7f100783381c5c0a031
|
6322afe42dd32f0cc72cfe637c109f042ec4af39
|
/ext/slam6d/include/slam6d/point_type.h
|
f0206226616919c9c825870a62b060479a680daa
|
[] |
permissive
|
uos/lvr2
|
3c94d640f3e315e23fd194d85c2bd8e6877cd674
|
9bb03a30441b027c39db967318877e03725112d5
|
refs/heads/develop
| 2023-06-22T11:49:52.100143
| 2021-10-08T15:58:07
| 2021-10-08T15:58:07
| 173,213,176
| 66
| 16
|
BSD-3-Clause
| 2023-05-28T19:10:14
| 2019-03-01T01:18:58
|
C++
|
UTF-8
|
C++
| false
| false
| 5,256
|
h
|
point_type.h
|
/**
* @file
* @brief Representation of a 3D point type
* @author Jan Elsberg. Automation Group, Jacobs University Bremen gGmbH, Germany.
*/
#ifndef __POINT_TYPE_H__
#define __POINT_TYPE_H__
#include "point.h"
#include "data_types.h"
#include <string>
using std::string;
#include <iostream>
using std::cout;
using std::cerr;
using std::endl;
#include <iostream>
#include <fstream>
#include <string.h>
class PointType {
public:
static const unsigned int USE_NONE;
static const unsigned int USE_REFLECTANCE;
static const unsigned int USE_AMPLITUDE;
static const unsigned int USE_DEVIATION;
static const unsigned int USE_HEIGHT;
static const unsigned int USE_TYPE;
static const unsigned int USE_COLOR;
static const unsigned int USE_TIME;
static const unsigned int USE_INDEX;
PointType();
PointType(unsigned int _types);
bool hasReflectance();
bool hasAmplitude();
bool hasDeviation();
bool hasType();
bool hasColor();
bool hasTime();
bool hasIndex();
unsigned int getReflectance();
unsigned int getAmplitude();
unsigned int getDeviation();
unsigned int getTime();
unsigned int getIndex();
unsigned int getType();
unsigned int getType(unsigned int type);
unsigned int getPointDim();
static PointType deserialize(std::ifstream &f);
void serialize(std::ofstream &f);
unsigned int toFlags() const;
template <class T>
T *createPoint(const Point &P, unsigned int index=0);
template <class T>
Point createPoint(T *p);
// //! Aquire DataPointer objects from \a scan, determined by its types
// void useScan(Scan* scan);
//
// //! Release the DataPointer objects
// void clearScan();
//
//! Create a point with attributes via the DataPointers from the scan
template<typename T>
T* createPoint(unsigned int i, unsigned int index = 0);
// //! Create an array with coordinate+attribute array per point with transfer of ownership
// template<typename T>
// T** createPointArray(Scan* scan);
private:
/**
* collection of flags
*/
unsigned int types;
/**
* Derived from types: 3 spatial dimensions + 1 for each flag set
**/
unsigned int pointdim;
/**
* Stores the size of each point in bytes
**/
unsigned int pointbytes;
/**
* Derived from types, to map type to the array index for each point
**/
int dimensionmap[8];
bool hasType(unsigned int type);
// unsigned int getScanSize(Scan* scan);
DataXYZ* m_xyz;
DataRGB* m_rgb;
DataReflectance* m_reflectance;
DataAmplitude* m_amplitude;
DataType* m_type;
DataDeviation* m_deviation;
};
template <class T>
T *PointType::createPoint(const Point &P, unsigned int index ) {
unsigned int counter = 0;
T *p = new T[pointdim];
p[counter++] = P.x;
p[counter++] = P.y;
p[counter++] = P.z;
if (types & USE_REFLECTANCE) {
p[counter++] = P.reflectance;
}
if (types & USE_AMPLITUDE) {
p[counter++] = P.amplitude;
}
if (types & USE_DEVIATION) {
p[counter++] = P.deviation;
}
if (types & USE_TYPE) {
p[counter++] = P.type;
}
if (types & USE_COLOR) {
memcpy(&p[counter], P.rgb, 3);
counter++;
}
if (types & USE_TIME) {
// p[counter++] = P.timestamp;
}
if (types & USE_INDEX) {
p[counter++] = index;
}
return p;
}
template <class T>
Point PointType::createPoint(T *p) {
Point P;
unsigned int counter = 0;
P.x = p[counter++];
P.y = p[counter++];
P.z = p[counter++];
if (types & USE_REFLECTANCE) {
P.reflectance = p[counter++];
}
if (types & USE_AMPLITUDE) {
P.amplitude = p[counter++];
}
if (types & USE_DEVIATION) {
P.deviation = p[counter++];
}
if (types & USE_TYPE) {
P.type = p[counter++];
}
if (types & USE_COLOR) {
memcpy(P.rgb, &p[counter], 3);
counter++;
}
if (types & USE_TIME) {
// P.timestamp = p[counter++];
}
return P;
}
template <class T>
T *PointType::createPoint(unsigned int i, unsigned int index) {
unsigned int counter = 0;
T* p = new T[pointdim];
for(unsigned int j = 0; j < 3; ++j)
p[counter++] = (*m_xyz)[i][j];
// if a type is requested try to write the value if the scan provided one
if (types & USE_REFLECTANCE) {
p[counter++] = (m_reflectance? (*m_reflectance)[i]: 0);
}
if (types & USE_AMPLITUDE) {
p[counter++] = (m_amplitude? (*m_amplitude)[i]: 0);
}
if (types & USE_DEVIATION) {
p[counter++] = (m_deviation? (*m_deviation)[i]: 0);
}
if (types & USE_TYPE) {
p[counter++] = (m_type? (*m_type)[i]: 0);
}
if (types & USE_COLOR) {
if(m_rgb)
memcpy(&p[counter], (*m_rgb)[i], 3);
else
p[counter] = 0;
counter++;
}
if (types & USE_TIME) {
}
if (types & USE_INDEX) {
p[counter++] = index;
}
return p;
}
//template<typename T>
//T** PointType::createPointArray(Scan* scan)
//{
// // access data with prefetching
// useScan(scan);
//
// // create a float array with requested attributes by pointtype via createPoint
// unsigned int nrpts = getScanSize(scan);
// T** pts = new T*[nrpts];
// for(unsigned int i = 0; i < nrpts; i++) {
// pts[i] = createPoint<T>(i);
// }
//
// // unlock access to data, remove unneccessary data fields
// clearScan();
//
// return pts;
//}
#endif
|
43f30502394793b2a93c4b17da155afdaea40426
|
20667b51d22f9bba9ba7bccb229de7c2d779357f
|
/test/test-screenprinter.cpp
|
56e123e97573a682eb561d7c6c7f512e4caa0f9f
|
[] |
no_license
|
eli6/GameOfLife
|
d81af03c531e0617aecce0d7b2bfc2207001e1b5
|
485bdbcfcb632d7a8177fe4510bd6b44118f516b
|
refs/heads/master
| 2021-10-13T06:27:43.265416
| 2021-10-10T14:16:30
| 2021-10-10T14:16:30
| 167,355,938
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 72
|
cpp
|
test-screenprinter.cpp
|
#include "catch2.hpp"
SCENARIO("Testing the class ScreenPrinter"){
};
|
f9a5b6b09a5e8254e4e05f2bbd3089e7019ee017
|
2860c2c27c1e4d6c661afe387fb27d67b0970a86
|
/include/apiWrapper/ctp/MyCtpSpi.h
|
71b995de0c83aed77f4a6412dce1872b45c97845
|
[] |
no_license
|
zhaoyaogit/CMFS
|
62db45d35ede4ba94953d8ea98ca8d0c77b2ca18
|
eae985f3a37f0b6699492d0bd80bedb5f8e222fb
|
refs/heads/main
| 2023-04-30T09:57:32.457306
| 2021-05-28T05:34:30
| 2021-05-28T05:34:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,896
|
h
|
MyCtpSpi.h
|
#ifndef _MY_CTP_SPI_H_
#define _MY_CTP_SPI_H_
#pragma once
#include "api/ctp/ThostFtdcTraderApi.h"
#include "apiWrapper/ctp/MyCtpApi.h"
#include <iostream>
#include <fstream>
class MyCtpApi;
class MyCtpSpi: public CThostFtdcTraderSpi {
public:
MyCtpSpi(MyCtpApi * api);
~MyCtpSpi();
std::string ConvertOrderStatus(char orderStatus);
void OnFrontConnected() override;
void OnFrontDisconnected(int nReason) override;
void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
///����¼��������Ӧ
void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///��������������Ӧ
virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///Ͷ���߽�����ȷ����Ӧ
void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///�����ѯ������Ӧ
void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///�����ѯ�ɽ���Ӧ
void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///�����ѯͶ���ֲ߳���Ӧ
virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///�����ѯ�ʽ��˻���Ӧ
virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///�����ѯ��Լ��Ӧ
void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///�����ѯͶ���߽�������Ӧ
void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///�����ѯͶ���ֲ߳���ϸ��Ӧ
void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///�����ѯ������Ϣȷ����Ӧ
void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
///����֪ͨ
void OnRtnOrder(CThostFtdcOrderField *pOrder) override;
///�ɽ�֪ͨ
void OnRtnTrade(CThostFtdcTradeField *pTrade) override;
///����¼�����ر�
void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) override;
///������������ر�
virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {};
///��Լ����״̬֪ͨ
virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {};
void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) override;
private:
MyCtpApi* m_api_;
std::ofstream ofs;
};
#endif
|
11331cb1ffe768e07ef7678d9e226d7e90cec6df
|
41f3c18ce759df5eb0d5a80fa4e8cf2883ecf98c
|
/codechef codered 2020/CORE2004.cpp
|
85e66d7a7108fcc1d1cba291c2efeda51941fbd6
|
[] |
no_license
|
tanvirtareq/programming
|
6d9abafb844b1e80b7691157b0581a3b25b9cd59
|
040f636773df2d89fb7c169fe077f527f68140a4
|
refs/heads/master
| 2021-06-27T12:07:07.585682
| 2021-03-28T12:39:49
| 2021-03-28T12:39:49
| 217,275,688
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,202
|
cpp
|
CORE2004.cpp
|
#include <bits/stdc++.h>
using namespace std;
#define int long long
long long val[200005];
struct node
{
int dis,num;
bool operator < (const node &a)const{
if(dis==a.dis)return num<a.num;
return dis<a.dis;
}
bool operator==(const node & a)const{
return dis==a.dis && num==a.num;
}
};
node inf;
set<node> st[200005];
struct query{
int typ;
long long x, y;
}que[200005];
int depth[200005];
vector<int> e[200005];
void dfs(int i, int par) {
if(par != -1) depth[i] = depth[par] + 1;
for(int j : e[i]) if(j -par) dfs(j, i);
}
node tree[1000050];
inline node min(node a,node b)
{
if(a<b)return a;return b;
}
void init(int nd, int i,int j)
{
if(i==j){
tree[nd]=(*st[i].begin());
return ;
}
int mid=(i+j)>>1;
init(nd*2,i,mid);
init(nd*2+1,mid+1,j);
tree[nd]=min(tree[nd*2],tree[nd*2+1]);
}
void update(int nd, int i,int j,int P,node val){
if(j<P || i>P)return;
if(i==j && j==P){
tree[nd]=val;
return;
}
int mid=(i+j)>>1;
update(nd*2,i,mid,P,val);
update(nd*2+1,mid+1,j,P,val);
tree[nd]=min(tree[nd*2],tree[nd*2+1]);
}
node query(int nd, int i,int j,int l,int r){
if(j<l || i>r)return inf;
if(l<=i && j<=r)return tree[nd];
int mid=(i+j)>>1;
return min(query(nd*2,i,mid,l,r),query(nd*2+1,mid+1,j,l,r));
}
int32_t main() {
long long n, t, x, y, q;
inf={100000000,0};
for(int i=0;i<200005;i++)st[i].insert(inf);
// cin >> n;
scanf("%lld",&n);
vector<long long> v;
for(int i=1; i<=n; i++) scanf("%lld",&val[i]), v.push_back(val[i]);
for(int i=1; i<n; i++) {
int u,v;
scanf("%lld %lld",&u,&v);
e[u].push_back(v);
e[v].push_back(u);
}
dfs(1,-1);
// cin>>q;
scanf("%lld",&q);
for(int i=1; i<=q; i++) {
// cin >> t;
scanf("%lld",&t);
if(t == 1)
scanf("%lld %lld",&x,&y);
// cin >> x >> y;
else scanf("%lld",&y), x = -1;
que[i] = {(int)t, x, y};
v.push_back(y);
}
sort(v.begin(), v.end());
v.resize(distance(v.begin(), unique(v.begin(), v.end())));
int ma=0;
for(int i=1; i<=n; i++){
val[i] = lower_bound(v.begin(), v.end(), val[i]) - v.begin() + 1;
st[val[i]].insert({depth[i],i});
ma=max(ma,val[i]);
assert(ma<200002);
}
init(1,1,200002);
for(int i=1; i<=q; i++) {
que[i].y = lower_bound(v.begin(), v.end(), que[i].y) - v.begin() + 1;
ma=max(ma,que[i].y);
assert(ma<200002);
if(que[i].typ==1)
{
int age=val[que[i].x];
int setval=que[i].y;
// cout << "###" << endl;
// for(auto i : st[age]) cout << i.num << ' ' << i.dis << endl;
// cout << depth[que[i].x] << ' ' << que[i].x << endl;
if(st[age].find({depth[que[i].x],(int)que[i].x}) != st[age].end())
st[age].erase(st[age].find({depth[que[i].x],(int)que[i].x}));
// st[age].erase({depth[que[i].x],(int)que[i].x});
// cout << endl;
// for(auto i : st[age]) cout << i.num << ' ' << i.dis << endl;
// cout << "###" << endl;
update(1,1,200002,age,*st[age].begin());
st[setval].insert({depth[que[i].x],(int)que[i].x});
update(1,1,200002,setval,*st[setval].begin());
// node tmp=query(1,1,200002,age,age);
// cout<<"#$ "<<tmp.dis<<' '<<tmp.num<<endl0
}
else{
node an=query(1,1,200002,que[i].y+1,200002);
if(an==inf)printf("-1\n");
else
printf("%lld\n", an.num);
}
assert(ma<200002);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.