blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M โ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6db9ae4385362f5137841b23179a3acedd40e536 | 77fbfe539db0427369b83ca9fcd101112102a344 | /SD/Types.h | f83fee8fb8ddc1ec2ff5d97e89ebd71c333c0de7 | [] | no_license | SpencerCDixon/SpenceBoy | de8567603e4a63e4d4fee16517bfc539a5552f5c | 1b63812764abe78a1e12270f0afb95bd534203eb | refs/heads/master | 2023-01-28T18:15:25.017974 | 2020-12-10T18:26:46 | 2020-12-10T18:26:46 | 260,921,798 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,229 | h | //
// Created by Spencer Dixon on 5/3/20.
//
#pragma once
#include <stdint.h>
#include <stddef.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
static_assert(sizeof(u8) == 1, "incorrect u8 size");
static_assert(sizeof(u16) == 2, "incorrect u16 size");
static_assert(sizeof(u32) == 4, "incorrect u32 size");
static_assert(sizeof(u64) == 8, "incorrect u64 size");
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
static_assert(sizeof(s8) == 1, "incorrect s8 size");
static_assert(sizeof(s16) == 2, "incorrect s16 size");
static_assert(sizeof(s32) == 4, "incorrect s32 size");
static_assert(sizeof(s64) == 8, "incorrect s64 size");
typedef float f32;
typedef double f64;
constexpr unsigned KB = 1024;
constexpr unsigned MB = KB * KB;
constexpr unsigned GB = KB * KB * KB;
// Due to C/C++ being silly and allowing one word to mean three things
// we've created these aliases to allow for more expressive code
// and more importantly searchable. By using these macros we can
// now quickly search for truly 'global' variables that we need
// to be careful with for thread safety.
#define global static
#define internal static
#define local_persist static | [
"spencercdixon@gmail.com"
] | spencercdixon@gmail.com |
8fe1d5e21beb89ab25821ddd095bc8a2ac8b5f4f | 50b99e446b360ae2104f53f39b0e7940172a573f | /week 2/week2_Q2.cpp | 20cd176ed5554e1c7510a7d5ac56f5a4463a5c48 | [] | no_license | adityasaini703/DAA-Labs | 3fbbe9c722dc695a0e0972a6d0fbafa9741b5c12 | 0901273c97dbcd8c9d6c5cbbae0eea27a10fee04 | refs/heads/main | 2023-08-11T20:06:49.066102 | 2021-09-25T15:08:18 | 2021-09-25T15:08:18 | 386,675,526 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 793 | cpp | #include <iostream>
using namespace std;
void Question2(int array[],int l,int r,int array_size)
{
int flag=0;
for(int k=1;k<=array_size;k++)
{
l = 1,r = array_size;
while(l<r)
{
int sum = array[l]+array[r];
if(sum == array[k])
{
cout<<l<<","<<r<<","<<k<<endl;
return;
}
else if(sum < array[k])
{
l++;
}
else
{
r--;
}
}
}
cout<<"Sequence not found"<<endl;
}
int main()
{
int array_size,i,test_case;
cout<<"Input Number of test cases"<<endl;
cin>> test_case;
while(test_case--)
{
cin>> array_size;
int array[array_size];
for(i=0 ; i < array_size; i++)
{
cin>> array[i];
}
Question2(array,1,array_size,array_size);
}
return 0;
} | [
"noreply@github.com"
] | noreply@github.com |
e06caec88917fb89a891077c11a44b325732e9c3 | 08b8cf38e1936e8cec27f84af0d3727321cec9c4 | /data/crawl/wget/old_hunk_3553.cpp | 14eca9ed690e13781c270e5379dad5954876efff | [] | no_license | ccdxc/logSurvey | eaf28e9c2d6307140b17986d5c05106d1fd8e943 | 6b80226e1667c1e0760ab39160893ee19b0e9fb1 | refs/heads/master | 2022-01-07T21:31:55.446839 | 2018-04-21T14:12:43 | 2018-04-21T14:12:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 213 | cpp | if (res == -2)
{
logprintf (LOG_NOTQUIET, _("%s: %s, closing control connection.\n"),
u->local, strerror (errno));
CLOSE (csock);
rbuf_uninitialize (&con->rbuf);
return FWRITEERR;
| [
"993273596@qq.com"
] | 993273596@qq.com |
94cf0ca696810dfe464ada98c57900ba4d32ae8c | 9bfba8ae9544ebd4a198791b4ee95cd7dca6b284 | /praktikum8/test/patientTest/PatientTest.h | f9a391374351c0f3314a2247c9bfc64567892d5b | [] | no_license | atonmbiak/projects | e64dd0d7eef74fce062bf5c444c5705fab44031a | 36ed3bf5933688d0a67081b422b9ba3a5fe3ccc0 | refs/heads/master | 2021-01-19T23:01:22.502798 | 2017-04-24T12:31:04 | 2017-04-24T12:31:04 | 88,911,251 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,105 | h | #ifndef PATIENT_TEST_H
#define PATIENT_TEST_H
#include <qttest>
#include <qstring>
#include "Patient.h"
class PatientTest : public QObject
{
Q_OBJECT
private slots:
void constructorTest() {
Patient p;
QCOMPARE( p.id(), 0 );
QVERIFY( p.forename() == NULL );
QVERIFY( p.familyName() == NULL );
}
void idTest() {
Patient p;
p.setId( 10 );
QCOMPARE( p.id(), 10 );
p.setId( 1000 );
QCOMPARE( p.id(), 1000 );
}
void forenameTest(){
Patient p;
const QString s1 = "Zimmermann";
const QString s2 = "Bauer";
p.setForename (s1);
QCOMPARE (p.forename(), s1);
p.setForename(s2);
QVERIFY (p.forename() != s1);
QCOMPARE (p.forename(), s2);
}
void familyNameText(){
Patient p;
const QString s1 = "Anna";
const QString s2 = "Lisa";
p.setFamilyName (s1);
QCOMPARE (p.familyName(),s1);
p.setFamilyName (s2);
QCOMPARE (p.familyName(), s2);
}
};
#endif // PATIENT_TEST_H
| [
"armel tonmbiak"
] | armel tonmbiak |
48de2764b761c182e3f6008fa766f018c9a5b598 | d5b4258968b047038fb77c2921775b728d200322 | /src/test/script_P2SH_tests.cpp | 706e5f4757ebc3ca628906d8698b119cfb499df0 | [
"MIT"
] | permissive | nitropay/nitro | 1c0c04bd42d119345adda64e67ec04f12909f519 | 20ce3d9f0751768d582add68c8e34e9fa3953482 | refs/heads/master | 2020-03-11T19:11:51.572710 | 2018-04-21T06:59:49 | 2018-04-21T06:59:49 | 130,200,022 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 14,177 | cpp | // Copyright (c) 2012-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "key.h"
#include "keystore.h"
#include "validation.h"
#include "policy/policy.h"
#include "script/script.h"
#include "script/script_error.h"
#include "script/sign.h"
#include "test/test_nitropay.h"
#ifdef ENABLE_WALLET
#include "wallet/wallet_ismine.h"
#endif
#include <vector>
#include <boost/test/unit_test.hpp>
using namespace std;
// Helpers:
static std::vector<unsigned char>
Serialize(const CScript& s)
{
std::vector<unsigned char> sSerialized(s.begin(), s.end());
return sSerialized;
}
static bool
Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict, ScriptError& err)
{
// Create dummy to/from transactions:
CMutableTransaction txFrom;
txFrom.vout.resize(1);
txFrom.vout[0].scriptPubKey = scriptPubKey;
CMutableTransaction txTo;
txTo.vin.resize(1);
txTo.vout.resize(1);
txTo.vin[0].prevout.n = 0;
txTo.vin[0].prevout.hash = txFrom.GetHash();
txTo.vin[0].scriptSig = scriptSig;
txTo.vout[0].nValue = 1;
return VerifyScript(scriptSig, scriptPubKey, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, MutableTransactionSignatureChecker(&txTo, 0), &err);
}
BOOST_FIXTURE_TEST_SUITE(script_P2SH_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(sign)
{
LOCK(cs_main);
// Pay-to-script-hash looks like this:
// scriptSig: <sig> <sig...> <serialized_script>
// scriptPubKey: HASH160 <hash> EQUAL
// Test SignSignature() (and therefore the version of Solver() that signs transactions)
CBasicKeyStore keystore;
CKey key[4];
for (int i = 0; i < 4; i++)
{
key[i].MakeNewKey(true);
keystore.AddKey(key[i]);
}
// 8 Scripts: checking all combinations of
// different keys, straight/P2SH, pubkey/pubkeyhash
CScript standardScripts[4];
standardScripts[0] << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG;
standardScripts[1] = GetScriptForDestination(key[1].GetPubKey().GetID());
standardScripts[2] << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG;
standardScripts[3] = GetScriptForDestination(key[2].GetPubKey().GetID());
CScript evalScripts[4];
for (int i = 0; i < 4; i++)
{
keystore.AddCScript(standardScripts[i]);
evalScripts[i] = GetScriptForDestination(CScriptID(standardScripts[i]));
}
CMutableTransaction txFrom; // Funding transaction:
string reason;
txFrom.vout.resize(8);
for (int i = 0; i < 4; i++)
{
txFrom.vout[i].scriptPubKey = evalScripts[i];
txFrom.vout[i].nValue = COIN;
txFrom.vout[i+4].scriptPubKey = standardScripts[i];
txFrom.vout[i+4].nValue = COIN;
}
BOOST_CHECK(IsStandardTx(txFrom, reason));
CMutableTransaction txTo[8]; // Spending transactions
for (int i = 0; i < 8; i++)
{
txTo[i].vin.resize(1);
txTo[i].vout.resize(1);
txTo[i].vin[0].prevout.n = i;
txTo[i].vin[0].prevout.hash = txFrom.GetHash();
txTo[i].vout[0].nValue = 1;
#ifdef ENABLE_WALLET
BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i));
#endif
}
for (int i = 0; i < 8; i++)
{
BOOST_CHECK_MESSAGE(SignSignature(keystore, txFrom, txTo[i], 0), strprintf("SignSignature %d", i));
}
// All of the above should be OK, and the txTos have valid signatures
// Check to make sure signature verification fails if we use the wrong ScriptSig:
for (int i = 0; i < 8; i++)
for (int j = 0; j < 8; j++)
{
CScript sigSave = txTo[i].vin[0].scriptSig;
txTo[i].vin[0].scriptSig = txTo[j].vin[0].scriptSig;
const CTxOut& output = txFrom.vout[txTo[i].vin[0].prevout.n];
bool sigOK = CScriptCheck(output.scriptPubKey, output.nValue, txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, false)();
if (i == j)
BOOST_CHECK_MESSAGE(sigOK, strprintf("VerifySignature %d %d", i, j));
else
BOOST_CHECK_MESSAGE(!sigOK, strprintf("VerifySignature %d %d", i, j));
txTo[i].vin[0].scriptSig = sigSave;
}
}
BOOST_AUTO_TEST_CASE(norecurse)
{
ScriptError err;
// Make sure only the outer pay-to-script-hash does the
// extra-validation thing:
CScript invalidAsScript;
invalidAsScript << OP_INVALIDOPCODE << OP_INVALIDOPCODE;
CScript p2sh = GetScriptForDestination(CScriptID(invalidAsScript));
CScript scriptSig;
scriptSig << Serialize(invalidAsScript);
// Should not verify, because it will try to execute OP_INVALIDOPCODE
BOOST_CHECK(!Verify(scriptSig, p2sh, true, err));
BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_BAD_OPCODE, ScriptErrorString(err));
// Try to recur, and verification should succeed because
// the inner HASH160 <> EQUAL should only check the hash:
CScript p2sh2 = GetScriptForDestination(CScriptID(p2sh));
CScript scriptSig2;
scriptSig2 << Serialize(invalidAsScript) << Serialize(p2sh);
BOOST_CHECK(Verify(scriptSig2, p2sh2, true, err));
BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));
}
BOOST_AUTO_TEST_CASE(set)
{
LOCK(cs_main);
// Test the CScript::Set* methods
CBasicKeyStore keystore;
CKey key[4];
std::vector<CPubKey> keys;
for (int i = 0; i < 4; i++)
{
key[i].MakeNewKey(true);
keystore.AddKey(key[i]);
keys.push_back(key[i].GetPubKey());
}
CScript inner[4];
inner[0] = GetScriptForDestination(key[0].GetPubKey().GetID());
inner[1] = GetScriptForMultisig(2, std::vector<CPubKey>(keys.begin(), keys.begin()+2));
inner[2] = GetScriptForMultisig(1, std::vector<CPubKey>(keys.begin(), keys.begin()+2));
inner[3] = GetScriptForMultisig(2, std::vector<CPubKey>(keys.begin(), keys.begin()+3));
CScript outer[4];
for (int i = 0; i < 4; i++)
{
outer[i] = GetScriptForDestination(CScriptID(inner[i]));
keystore.AddCScript(inner[i]);
}
CMutableTransaction txFrom; // Funding transaction:
string reason;
txFrom.vout.resize(4);
for (int i = 0; i < 4; i++)
{
txFrom.vout[i].scriptPubKey = outer[i];
txFrom.vout[i].nValue = CENT;
}
BOOST_CHECK(IsStandardTx(txFrom, reason));
CMutableTransaction txTo[4]; // Spending transactions
for (int i = 0; i < 4; i++)
{
txTo[i].vin.resize(1);
txTo[i].vout.resize(1);
txTo[i].vin[0].prevout.n = i;
txTo[i].vin[0].prevout.hash = txFrom.GetHash();
txTo[i].vout[0].nValue = 1*CENT;
txTo[i].vout[0].scriptPubKey = inner[i];
#ifdef ENABLE_WALLET
BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i));
#endif
}
for (int i = 0; i < 4; i++)
{
BOOST_CHECK_MESSAGE(SignSignature(keystore, txFrom, txTo[i], 0), strprintf("SignSignature %d", i));
BOOST_CHECK_MESSAGE(IsStandardTx(txTo[i], reason), strprintf("txTo[%d].IsStandard", i));
}
}
BOOST_AUTO_TEST_CASE(is)
{
// Test CScript::IsPayToScriptHash()
uint160 dummy;
CScript p2sh;
p2sh << OP_HASH160 << ToByteVector(dummy) << OP_EQUAL;
BOOST_CHECK(p2sh.IsPayToScriptHash());
// Not considered pay-to-script-hash if using one of the OP_PUSHDATA opcodes:
static const unsigned char direct[] = { OP_HASH160, 20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, OP_EQUAL };
BOOST_CHECK(CScript(direct, direct+sizeof(direct)).IsPayToScriptHash());
static const unsigned char pushdata1[] = { OP_HASH160, OP_PUSHDATA1, 20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, OP_EQUAL };
BOOST_CHECK(!CScript(pushdata1, pushdata1+sizeof(pushdata1)).IsPayToScriptHash());
static const unsigned char pushdata2[] = { OP_HASH160, OP_PUSHDATA2, 20,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, OP_EQUAL };
BOOST_CHECK(!CScript(pushdata2, pushdata2+sizeof(pushdata2)).IsPayToScriptHash());
static const unsigned char pushdata4[] = { OP_HASH160, OP_PUSHDATA4, 20,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, OP_EQUAL };
BOOST_CHECK(!CScript(pushdata4, pushdata4+sizeof(pushdata4)).IsPayToScriptHash());
CScript not_p2sh;
BOOST_CHECK(!not_p2sh.IsPayToScriptHash());
not_p2sh.clear(); not_p2sh << OP_HASH160 << ToByteVector(dummy) << ToByteVector(dummy) << OP_EQUAL;
BOOST_CHECK(!not_p2sh.IsPayToScriptHash());
not_p2sh.clear(); not_p2sh << OP_NOP << ToByteVector(dummy) << OP_EQUAL;
BOOST_CHECK(!not_p2sh.IsPayToScriptHash());
not_p2sh.clear(); not_p2sh << OP_HASH160 << ToByteVector(dummy) << OP_CHECKSIG;
BOOST_CHECK(!not_p2sh.IsPayToScriptHash());
}
BOOST_AUTO_TEST_CASE(switchover)
{
// Test switch over code
CScript notValid;
ScriptError err;
notValid << OP_11 << OP_12 << OP_EQUALVERIFY;
CScript scriptSig;
scriptSig << Serialize(notValid);
CScript fund = GetScriptForDestination(CScriptID(notValid));
// Validation should succeed under old rules (hash is correct):
BOOST_CHECK(Verify(scriptSig, fund, false, err));
BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));
// Fail under new:
BOOST_CHECK(!Verify(scriptSig, fund, true, err));
BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EQUALVERIFY, ScriptErrorString(err));
}
BOOST_AUTO_TEST_CASE(AreInputsStandard)
{
LOCK(cs_main);
CCoinsView coinsDummy;
CCoinsViewCache coins(&coinsDummy);
CBasicKeyStore keystore;
CKey key[6];
vector<CPubKey> keys;
for (int i = 0; i < 6; i++)
{
key[i].MakeNewKey(true);
keystore.AddKey(key[i]);
}
for (int i = 0; i < 3; i++)
keys.push_back(key[i].GetPubKey());
CMutableTransaction txFrom;
txFrom.vout.resize(7);
// First three are standard:
CScript pay1 = GetScriptForDestination(key[0].GetPubKey().GetID());
keystore.AddCScript(pay1);
CScript pay1of3 = GetScriptForMultisig(1, keys);
txFrom.vout[0].scriptPubKey = GetScriptForDestination(CScriptID(pay1)); // P2SH (OP_CHECKSIG)
txFrom.vout[0].nValue = 1000;
txFrom.vout[1].scriptPubKey = pay1; // ordinary OP_CHECKSIG
txFrom.vout[1].nValue = 2000;
txFrom.vout[2].scriptPubKey = pay1of3; // ordinary OP_CHECKMULTISIG
txFrom.vout[2].nValue = 3000;
// vout[3] is complicated 1-of-3 AND 2-of-3
// ... that is OK if wrapped in P2SH:
CScript oneAndTwo;
oneAndTwo << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey());
oneAndTwo << OP_3 << OP_CHECKMULTISIGVERIFY;
oneAndTwo << OP_2 << ToByteVector(key[3].GetPubKey()) << ToByteVector(key[4].GetPubKey()) << ToByteVector(key[5].GetPubKey());
oneAndTwo << OP_3 << OP_CHECKMULTISIG;
keystore.AddCScript(oneAndTwo);
txFrom.vout[3].scriptPubKey = GetScriptForDestination(CScriptID(oneAndTwo));
txFrom.vout[3].nValue = 4000;
// vout[4] is max sigops:
CScript fifteenSigops; fifteenSigops << OP_1;
for (unsigned i = 0; i < MAX_P2SH_SIGOPS; i++)
fifteenSigops << ToByteVector(key[i%3].GetPubKey());
fifteenSigops << OP_15 << OP_CHECKMULTISIG;
keystore.AddCScript(fifteenSigops);
txFrom.vout[4].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops));
txFrom.vout[4].nValue = 5000;
// vout[5/6] are non-standard because they exceed MAX_P2SH_SIGOPS
CScript sixteenSigops; sixteenSigops << OP_16 << OP_CHECKMULTISIG;
keystore.AddCScript(sixteenSigops);
txFrom.vout[5].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops));
txFrom.vout[5].nValue = 5000;
CScript twentySigops; twentySigops << OP_CHECKMULTISIG;
keystore.AddCScript(twentySigops);
txFrom.vout[6].scriptPubKey = GetScriptForDestination(CScriptID(twentySigops));
txFrom.vout[6].nValue = 6000;
AddCoins(coins, txFrom, 0);
CMutableTransaction txTo;
txTo.vout.resize(1);
txTo.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID());
txTo.vin.resize(5);
for (int i = 0; i < 5; i++)
{
txTo.vin[i].prevout.n = i;
txTo.vin[i].prevout.hash = txFrom.GetHash();
}
BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 0));
BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 1));
BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 2));
// SignSignature doesn't know how to sign these. We're
// not testing validating signatures, so just create
// dummy signatures that DO include the correct P2SH scripts:
txTo.vin[3].scriptSig << OP_11 << OP_11 << vector<unsigned char>(oneAndTwo.begin(), oneAndTwo.end());
txTo.vin[4].scriptSig << vector<unsigned char>(fifteenSigops.begin(), fifteenSigops.end());
BOOST_CHECK(::AreInputsStandard(txTo, coins));
// 22 P2SH sigops for all inputs (1 for vin[0], 6 for vin[3], 15 for vin[4]
BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txTo, coins), 22U);
CMutableTransaction txToNonStd1;
txToNonStd1.vout.resize(1);
txToNonStd1.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID());
txToNonStd1.vout[0].nValue = 1000;
txToNonStd1.vin.resize(1);
txToNonStd1.vin[0].prevout.n = 5;
txToNonStd1.vin[0].prevout.hash = txFrom.GetHash();
txToNonStd1.vin[0].scriptSig << vector<unsigned char>(sixteenSigops.begin(), sixteenSigops.end());
BOOST_CHECK(!::AreInputsStandard(txToNonStd1, coins));
BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txToNonStd1, coins), 16U);
CMutableTransaction txToNonStd2;
txToNonStd2.vout.resize(1);
txToNonStd2.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID());
txToNonStd2.vout[0].nValue = 1000;
txToNonStd2.vin.resize(1);
txToNonStd2.vin[0].prevout.n = 6;
txToNonStd2.vin[0].prevout.hash = txFrom.GetHash();
txToNonStd2.vin[0].scriptSig << vector<unsigned char>(twentySigops.begin(), twentySigops.end());
BOOST_CHECK(!::AreInputsStandard(txToNonStd2, coins));
BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txToNonStd2, coins), 20U);
}
BOOST_AUTO_TEST_SUITE_END()
| [
"nitropaycore@gmail.com"
] | nitropaycore@gmail.com |
a78c69bc1c75aedbf0cda4d99a453271280c48a9 | 948d555823c2d123601ff6c149869be377521282 | /SDK/SoT_BP_CompanyOnboardingStarter_parameters.hpp | 6db21aa9de5fa6bb35b5606d75a58352b58ae788 | [] | no_license | besimbicer89/SoT-SDK | 2acf79303c65edab01107ab4511e9b9af8ab9743 | 3a4c6f3b77c1045b7ef0cddd064350056ef7d252 | refs/heads/master | 2022-04-24T01:03:37.163407 | 2020-04-27T12:45:47 | 2020-04-27T12:45:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 675 | hpp | #pragma once
// SeaOfThieves (1.6.4) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "../SDK.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
// Function BP_CompanyOnboardingStarter.BP_CompanyOnboardingStarter_C.HasPrerequisites
struct UBP_CompanyOnboardingStarter_C_HasPrerequisites_Params
{
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"getpeyton@gmail.com"
] | getpeyton@gmail.com |
b86be4f286ac34efb5f397c5df8fd986822153c9 | 63bb7e2cf8a210ed24ad28ea7147087308728674 | /introduction/program/src/main.cpp | 12fec69b8c6a08e9e338ba9331985694ee0a3525 | [] | no_license | bartekxcx/Warsztaty_POBI | 14e79793dbeb6b7ea586b1f017fb1f3deb26f284 | f8ccdef6335fb2eb257ec4b848c5c2d3b3243076 | refs/heads/master | 2022-09-30T20:08:43.209352 | 2020-06-06T10:39:43 | 2020-06-06T10:39:43 | 267,572,421 | 0 | 1 | null | 2020-06-06T12:18:21 | 2020-05-28T11:32:21 | Makefile | UTF-8 | C++ | false | false | 133 | cpp | #include <iostream>
#include "math_helpers.h"
int main()
{
std::cout<<"\nHello World\n";
std::cout<<factorial(5);
return 0;
}
| [
"bartek2707@gmail.com"
] | bartek2707@gmail.com |
48a37048b04ad4258723a3ea21852e4d5476451a | bebf72281eab1cbbed007a13cb69b4859b675729 | /remove_duplicates.cpp | 0308f9c0c10d38bd8d084f794bb0af3e99f6ab38 | [] | no_license | xAdvitya/Everything-is-DSA | 9b87b966a2c931255f7d32bfd0bcc04ecd65f34c | 3c08e1d72ddf57c0ef2ad5c4a7046c0a9ac459f6 | refs/heads/master | 2022-10-09T22:18:20.081011 | 2020-03-15T16:59:26 | 2020-03-15T16:59:26 | 236,767,612 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 682 | cpp | #include <bits/stdc++.h>
using namespace std;
void set_bst(string str);
void hashing(string str);
int main() {
string str="hello";
set_bst(str);
cout<<"\n";
hashing(str);
}
void set_bst(string str){
set<char> s;
int i=0;
while(str[i]){
s.insert(str[i]);
i++;
}
for(auto itr : s){
cout<<itr;
}
}
/////////////under development///////////////
void hashing(string str){
unordered_map<char,int>ma;
string str1;
for(int i=0;i<str.length();i++){
int index=0;
if(ma[str[i]]==0){
str1[index++] = str[i];
cout<<str1[index]<<" "<<str[i]<<endl;
ma[str[i]]++;
//index++;
}
}
str1[1]='p';
cout<<str1;
} | [
"advityasharma21@gmail.com"
] | advityasharma21@gmail.com |
bfa811008855205b6173bec2455e0a1bfb10873e | 6906eabfc757dac732ade7116cebaaa5f4befc46 | /onnxruntime/contrib_ops/cuda/bert/longformer_attention.cc | 4aea30d065227091da803b9dec1bd6f97cbb9fa4 | [
"MIT"
] | permissive | wschin/onnxruntime | 07d20e4a12eb51f4b4705ccc1f4f4ff7dde52844 | 06686002551d1b7242ae10386a05b2fc1833127e | refs/heads/master | 2022-11-08T17:19:14.213826 | 2022-10-10T05:32:33 | 2022-10-10T05:32:33 | 196,658,713 | 0 | 0 | MIT | 2019-07-12T23:50:18 | 2019-07-12T23:50:18 | null | UTF-8 | C++ | false | false | 14,113 | cc | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "core/providers/cuda/shared_inc/fpgeneric.h"
#include "core/platform/env_var_utils.h"
#include "contrib_ops/cuda/bert/longformer_global_impl.h"
#include "contrib_ops/cuda/bert/longformer_attention_impl.h"
#include "contrib_ops/cuda/bert/transformer_cuda_common.h"
#include "contrib_ops/cuda/bert/longformer_attention.h"
using namespace onnxruntime::cuda;
using namespace ::onnxruntime::common;
using namespace ONNX_NAMESPACE;
namespace onnxruntime {
namespace contrib {
namespace cuda {
#define REGISTER_KERNEL_TYPED(T) \
ONNX_OPERATOR_TYPED_KERNEL_EX( \
LongformerAttention, \
kMSDomain, \
1, \
T, \
kCudaExecutionProvider, \
(*KernelDefBuilder::Create()) \
.TypeConstraint("T", DataTypeImpl::GetTensorType<T>()), \
LongformerAttention<T>);
REGISTER_KERNEL_TYPED(float)
REGISTER_KERNEL_TYPED(MLFloat16)
template <typename T>
LongformerAttention<T>::LongformerAttention(const OpKernelInfo& info)
: CudaKernel(info), LongformerAttentionBase(info) {
use_compact_memory_ = ParseEnvironmentVariableWithDefault<bool>(longformer::kUseCompactMemory, true);
use_half4_ = ParseEnvironmentVariableWithDefault<bool>(longformer::kUseHalf4, true);
}
template <typename T>
Status LongformerAttention<T>::ComputeInternal(OpKernelContext* context) const {
const Tensor* input = context->Input<Tensor>(0);
const Tensor* weights = context->Input<Tensor>(1);
const Tensor* bias = context->Input<Tensor>(2);
const Tensor* attention_mask = context->Input<Tensor>(3);
const Tensor* global_weights = context->Input<Tensor>(4);
const Tensor* global_bias = context->Input<Tensor>(5);
const Tensor* global_attention_mask = context->Input<Tensor>(6);
ORT_RETURN_IF_ERROR(CheckInputs(input->Shape(), weights->Shape(), bias->Shape(), attention_mask->Shape(),
global_weights->Shape(), global_bias->Shape(), global_attention_mask->Shape()));
// Input shapes:
// input : (batch_size, sequence_length, hidden_size)
// weights : (hidden_size, 3 * hidden_size) -- format 1
// (3, hidden_size, hidden_size) -- format 0
// bias : (3 * hidden_size) -- format 1 (bias for Q, K, V)
// (5 * hidden_size) -- format 0 (bias for Q, K, V, Global_K, Global_V)
// attention_mask : (batch_size, sequence_length)
// global_weights : (hidden_size, 3 * hidden_size) -- format 1
// (3, hidden_size, hidden_size) -- format 0
// global_bias : (3 * hidden_size) -- format 1 (bias for Global_Q, Global_K, Global_V)
// (1 * hidden_size) -- format 0 (bias for Global_Q)
// global_attention_mask : (batch_size, sequence_length)
// Output shapes:
// output : (batch_size, sequence_length, hidden_size)
const auto& shape = input->Shape();
int batch_size = static_cast<int>(shape[0]);
int sequence_length = static_cast<int>(shape[1]);
int hidden_size = static_cast<int>(shape[2]);
int head_size = hidden_size / num_heads_;
Tensor* output = context->Output(0, shape);
cublasHandle_t cublas = CublasHandle();
cudaStream_t stream = Stream();
CUBLAS_RETURN_IF_ERROR(cublasSetStream(cublas, stream));
constexpr size_t element_size = sizeof(T);
// TODO(tianleiwu): only calculate global index once per model instead of once per LongformerAttention node.
// Build Global Index
auto global_index_buffer = GetScratchBuffer<int>(static_cast<size_t>(batch_size) * sequence_length);
auto batch_global_num_buffer = GetScratchBuffer<int>(batch_size);
size_t global_scratch_bytes = GetGlobalScratchSize(sequence_length);
auto global_scratch_buffer = GetScratchBuffer<void>(global_scratch_bytes);
auto& device_prop = GetDeviceProp();
ORT_RETURN_IF_ERROR(BuildGlobalIndex(
device_prop,
stream,
global_attention_mask->Data<int>(),
batch_size,
sequence_length,
global_index_buffer.get(),
batch_global_num_buffer.get(),
global_scratch_buffer.get(),
global_scratch_bytes));
// Copy batch_global_num to CPU
size_t pinned_buffer_bytes = GetPinnedBufferSize(batch_size);
auto pinned_buffer = AllocateBufferOnCPUPinned<void>(pinned_buffer_bytes);
int* batch_global_num_pinned = reinterpret_cast<int*>(pinned_buffer.get());
CUDA_RETURN_IF_ERROR(cudaMemcpyAsync(batch_global_num_pinned,
batch_global_num_buffer.get(),
batch_size * sizeof(int),
cudaMemcpyDeviceToHost,
stream));
// Create an event to make sure the async copy is finished before reading the data.
AutoDestoryCudaEvent new_event;
cudaEvent_t& is_copy_done = new_event.Get();
CUDA_RETURN_IF_ERROR(cudaEventCreateWithFlags(&is_copy_done, cudaEventDisableTiming));
CUDA_RETURN_IF_ERROR(cudaEventRecord(is_copy_done, stream));
size_t qkv_size = batch_size * sequence_length * 3 * hidden_size * element_size;
// Buffer for GEMM outputs of q, k, v, global_q, global_k and global_v
// TODO(tianleiwu): compact global_q only need batch_size * window * hidden_size * element_size buffer size.
auto gemm_buffer = GetScratchBuffer<void>(qkv_size + qkv_size);
bool use_merged_qkv_weights = (weights->Shape().NumDimensions() == 2);
int m = batch_size * sequence_length;
int n = use_merged_qkv_weights ? 3 * hidden_size : hidden_size;
int k = hidden_size;
typedef typename ToCudaType<T>::MappedType CudaT;
const CudaT* input_data = reinterpret_cast<const CudaT*>(input->Data<T>());
const CudaT* weights_data = reinterpret_cast<const CudaT*>(weights->Data<T>());
const CudaT* global_weights_data = reinterpret_cast<const CudaT*>(global_weights->Data<T>());
float one = 1.0f;
float zero = 0.0f;
if (use_merged_qkv_weights) {
// Gemm, note that CUDA assumes col-major, so result(N, M) = 1 * weights x input + 0 x B.
CUBLAS_RETURN_IF_ERROR(cublasGemmHelper(
cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &one,
weights_data, n,
input_data, k,
&zero, reinterpret_cast<CudaT*>(gemm_buffer.get()), n, device_prop));
} else {
// q
const CudaT* q_weight = weights_data;
CudaT* q_data = reinterpret_cast<CudaT*>(gemm_buffer.get());
CUBLAS_RETURN_IF_ERROR(cublasGemmHelper(
cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &one,
q_weight, n,
input_data, k,
&zero, q_data, n, device_prop));
// k
const CudaT* k_weight = q_weight + hidden_size * hidden_size;
CudaT* k_data = q_data + batch_size * sequence_length * hidden_size;
CUBLAS_RETURN_IF_ERROR(cublasGemmHelper(
cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &one,
k_weight, n,
input_data, k,
&zero, k_data, n, device_prop));
// v
const CudaT* v_weight = k_weight + hidden_size * hidden_size;
CudaT* v_data = k_data + batch_size * sequence_length * hidden_size;
CUBLAS_RETURN_IF_ERROR(cublasGemmHelper(
cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &one,
v_weight, n,
input_data, k,
&zero, v_data, n, device_prop));
}
// Wait for async copy of batch_global_num
CUDA_RETURN_IF_ERROR(cudaEventSynchronize(is_copy_done));
// Find the maximum number of global tokens in all batches
int max_num_global = 0;
for (int i = 0; i < batch_size; ++i) {
if (max_num_global < batch_global_num_pinned[i]) {
max_num_global = batch_global_num_pinned[i];
}
}
// Do not use compact memory kernel in the following situations:
// (1) global tokens > windows size, compact memory kernel cannot be used due to its assumptions.
// (2) sequence_length == 2 * attention_window, compact memory kernel has parity issue.
// (3) user sets environment variable ORT_LONGFORMER_COMPACT_MEMORY=0
bool disable_compact_memory = (max_num_global > window_ || sequence_length == 2 * window_ || !use_compact_memory_);
// Fully connection for global projection.
// Note that Q only need handle global query tokens if we split GEMM to global Q/K/V separately.
// When there is no global token, need not run global GEMM.
CudaT* global_gemm_buffer = nullptr;
if (max_num_global > 0) {
global_gemm_buffer = reinterpret_cast<CudaT*>(reinterpret_cast<char*>(gemm_buffer.get()) + qkv_size);
if (use_merged_qkv_weights) {
CUBLAS_RETURN_IF_ERROR(cublasGemmHelper(
cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &one,
reinterpret_cast<const CudaT*>(global_weights->Data<T>()), n,
input_data, k,
&zero, global_gemm_buffer, n, device_prop));
} else {
// global q
const CudaT* global_q_weight = global_weights_data;
CudaT* global_q = global_gemm_buffer + 2 * batch_size * sequence_length * hidden_size;
if (disable_compact_memory) {
CUBLAS_RETURN_IF_ERROR(cublasGemmHelper(
cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &one,
global_q_weight, n,
input_data, k,
&zero, global_q, n, device_prop));
} else {
CUBLAS_RETURN_IF_ERROR(cublasGemmStridedBatchedHelper(cublas,
CUBLAS_OP_N,
CUBLAS_OP_N,
hidden_size, // m
max_num_global, // n
hidden_size, // k
&one, // alpha
global_q_weight, // A
hidden_size, // lda
0, // strideA
input_data, // B
hidden_size, // ldb
sequence_length * hidden_size, // strideB
&zero, // beta
global_q, // C
hidden_size, // ldc
max_num_global * hidden_size, // strideC
batch_size, // batch count
device_prop));
}
// global k
const CudaT* global_k_weight = global_weights_data + hidden_size * hidden_size;
CudaT* global_k = global_gemm_buffer;
CUBLAS_RETURN_IF_ERROR(cublasGemmHelper(
cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &one,
global_k_weight, n,
input_data, k,
&zero, global_k, n, device_prop));
// global v
const CudaT* global_v_weight = global_k_weight + hidden_size * hidden_size;
CudaT* global_v = global_gemm_buffer + batch_size * sequence_length * hidden_size;
CUBLAS_RETURN_IF_ERROR(cublasGemmHelper(
cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &one,
global_v_weight, n,
input_data, k,
&zero, global_v, n, device_prop));
}
}
size_t workSpaceSize = GetLongformerAttentionWorkspaceSize(element_size,
batch_size,
num_heads_,
head_size,
sequence_length,
max_num_global,
window_,
disable_compact_memory);
auto workspace_buffer = GetScratchBuffer<void>(workSpaceSize);
ORT_RETURN_IF_ERROR(LaunchLongformerAttentionKernel(
device_prop,
cublas,
stream,
reinterpret_cast<const CudaT*>(gemm_buffer.get()),
reinterpret_cast<const CudaT*>(bias->Data<T>()),
reinterpret_cast<const CudaT*>(attention_mask->Data<T>()),
reinterpret_cast<const CudaT*>(global_gemm_buffer),
reinterpret_cast<const CudaT*>(global_bias->Data<T>()),
global_attention_mask->Data<int>(),
global_index_buffer.get(),
batch_global_num_buffer.get(),
pinned_buffer.get(),
workspace_buffer.get(),
output->MutableData<T>(),
batch_size,
sequence_length,
num_heads_,
head_size,
window_,
max_num_global,
element_size,
disable_compact_memory,
use_merged_qkv_weights,
use_half4_));
// Defer release of pinned memory since cudaStreamSynchronize is not used here and kernel need access the buffer.
this->AddDeferredReleaseCPUPtr(pinned_buffer.release());
return Status::OK();
}
} // namespace cuda
} // namespace contrib
} // namespace onnxruntime
| [
"noreply@github.com"
] | noreply@github.com |
3b74ecc10813474c435501aa312987ed0270b8cd | 2ec289dc0e3151708e9f50a41a13ca0e1c363998 | /Vjudge/MIST Individual Long Contest 6 (Geo)/E.cpp | fde548900cbe0775f7cbc01d64632482c491704a | [] | no_license | sayedgkm/ProgrammingContest | eb71cae6850dd7fac12f49895bfabd58f2f4c70e | 8f3c07e9ebee3b8a662cb5ce0a7c3d53d6f8c72a | refs/heads/master | 2021-04-30T08:54:26.830730 | 2020-07-05T17:03:57 | 2020-07-05T17:03:57 | 121,387,092 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,531 | cpp | /// Bismillahir-Rahmanir-Rahim
#include <bits/stdc++.h>
#define ll long long int
#define FOR(x,y,z) for(int x=y;x<z;x++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a) memset(a,-1,sizeof(a))
#define N 200010
#define M 1000000007
#define pi acos(-1.0)
#define ff first
#define ss second
#define pb push_back
#define inf (1e9)+1000
#define eps 1e-9
#define ALL(x) x.begin(),x.end()
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
template <typename T> string NumberToString ( T Number ) { ostringstream ss; ss << Number; return ss.str(); }
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef sayed
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1){
cerr << name << " is " << arg1 << std::endl;
}
template < typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names+1, ',');
cerr.write(names, comma - names) << " is " << arg1 <<" | ";
__f(comma+1, args...);
}
#else
#define debug(...)
#endif
///******************************************START******************************************
int ar[N];
vector<pii> v;
int main(){
#ifdef sayed
//freopen("out.txt","w",stdout);
// freopen("in.txt","r",stdin);
#endif
//ios_base::sync_with_stdio(false);
//cin.tie(0);
int test = nxt(); int cs = 1;
while(test--) {
int n= nxt();
for(int i = 0;i<n;i++) {
int a= nxt();
int b= nxt();
v.pb(make_pair(a,b));
}
int ans = 0;
for(int i = 0;i<v.size();i++) {
map<pii,int> mp;
map<pii,int> ::iterator it;
for(int j = i+1;j<v.size();j++) {
pii tmp;
tmp.ff = v[j].ss-v[i].ss;
tmp.ss = v[j].ff-v[i].ff;
int gc = gcd(abs(tmp.ff),abs(tmp.ss));
if(gc) {
tmp.ff/=gc;
tmp.ss/=gc;
}
if(tmp.ff<0) tmp.ff = -tmp.ff,tmp.ss = -tmp.ss;
mp[tmp]++;
}
for(it = mp.begin();it!=mp.end();it++) {
ans = max(ans,it->ss);
}
}
printf("Case %d: %d\n",cs++,ans+1);
v.clear();
}
return 0;
}
| [
"sayedgkm@gmail.com"
] | sayedgkm@gmail.com |
878296eb16795a7434aed33668b47b53883d6478 | 948f4e13af6b3014582909cc6d762606f2a43365 | /testcases/juliet_test_suite/testcases/CWE121_Stack_Based_Buffer_Overflow/s05/CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_ncpy_81_goodG2B.cpp | c33d7a4e063ea3283bccd37d9395429c7771932c | [] | no_license | junxzm1990/ASAN-- | 0056a341b8537142e10373c8417f27d7825ad89b | ca96e46422407a55bed4aa551a6ad28ec1eeef4e | refs/heads/master | 2022-08-02T15:38:56.286555 | 2022-06-16T22:19:54 | 2022-06-16T22:19:54 | 408,238,453 | 74 | 13 | null | 2022-06-16T22:19:55 | 2021-09-19T21:14:59 | null | UTF-8 | C++ | false | false | 1,383 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_ncpy_81_goodG2B.cpp
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.string.label.xml
Template File: sources-sink-81_goodG2B.tmpl.cpp
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: Set data pointer to the bad buffer
* GoodSource: Set data pointer to the good buffer
* Sinks: ncpy
* BadSink : Copy string to data using wcsncpy
* Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
*
* */
#ifndef OMITGOOD
#include "std_testcase.h"
#include "CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_ncpy_81.h"
namespace CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_ncpy_81
{
void CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_ncpy_81_goodG2B::action(wchar_t * data) const
{
{
wchar_t source[100];
wmemset(source, L'C', 100-1); /* fill with L'C's */
source[100-1] = L'\0'; /* null terminate */
/* POTENTIAL FLAW: Possible buffer overflow if the size of data is less than the length of source */
wcsncpy(data, source, 100-1);
data[100-1] = L'\0'; /* Ensure the destination buffer is null terminated */
printWLine(data);
}
}
}
#endif /* OMITGOOD */
| [
"yzhang0701@gmail.com"
] | yzhang0701@gmail.com |
313ca22557154577285475efc863baa8638fc823 | a62342d6359a88b0aee911e549a4973fa38de9ea | /0.6.0.3/Internal/SDK/BP_FurnitureActivity_Table_classes.h | 943d25ee01d65735a7e32ac1ce3c071f9db000ba | [] | no_license | zanzo420/Medieval-Dynasty-SDK | d020ad634328ee8ee612ba4bd7e36b36dab740ce | d720e49ae1505e087790b2743506921afb28fc18 | refs/heads/main | 2023-06-20T03:00:17.986041 | 2021-07-15T04:51:34 | 2021-07-15T04:51:34 | 386,165,085 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 834 | h | ๏ปฟ#pragma once
// Name: Medieval Dynasty, Version: 0.6.0.3
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass BP_FurnitureActivity_Table.BP_FurnitureActivity_Table_C
// 0x0000 (FullSize[0x0468] - InheritedSize[0x0468])
class ABP_FurnitureActivity_Table_C : public ABP_MasterFurniture_Activity_StaticMesh_C
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass BP_FurnitureActivity_Table.BP_FurnitureActivity_Table_C");
return ptr;
}
void DisableGhost();
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"zp2kshield@gmail.com"
] | zp2kshield@gmail.com |
a4661c764ef003597450f66282771ccaa1e93e5b | a1cb0c550c99b7ee33d88a64e7476638485be81b | /kmpๆจกๆฟ.cpp | 18e9daec7c354b64d499fe97c679efcd8bd9d839 | [] | no_license | X-Ares/acm | 63443f5350ebab07e61cf86e7ed4742eb4e9c9d1 | bf84f7346f22da539ca5e8944f586336cecb49ff | refs/heads/master | 2021-01-22T05:20:08.222931 | 2017-02-25T04:13:45 | 2017-02-25T04:13:45 | 81,648,157 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 566 | cpp | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int N=50000;
int nexta[N];
char a[N],b[N];
int n,m;
void getnext()
{
int j=-1,i=0;
nexta[0]=-1;
while(i<n)
{
if(j==-1||b[j]==b[i]) i++,j++,nexta[i]=j;
else
j=nexta[j];
}
}
int kmp()
{
int i=0,j=0;
while(i<n&&j<m)
{
if(j==-1||a[i]==b[j])
i++,j++;
else
j=nexta[j];
if(j==m)
return i-m+1;
}
return -1;
}
int main()
{
//cin>>a>>b;
//n=strlen(a);
cin>>b;
n=strlen(b);
getnext();
for(int i=0;i<=n;i++)
printf("%d ",nexta[i]);
//cout<<kmp()<<endl;
}
| [
"731781797@qq.com"
] | 731781797@qq.com |
49e41ed67519eaa1346a9f0dff3e5a15fae536a4 | c0caed81b5b3e1498cbca4c1627513c456908e38 | /src/core/scoring/methods/YHHPlanarityEnergy.cc | fe01664a321f034fc21253d55f5df92104d29c72 | [] | no_license | malaifa/source | 5b34ac0a4e7777265b291fc824da8837ecc3ee84 | fc0af245885de0fb82e0a1144422796a6674aeae | refs/heads/master | 2021-01-19T22:10:22.942155 | 2017-04-19T14:13:07 | 2017-04-19T14:13:07 | 88,761,668 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 4,296 | cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
/// @file core/scoring/methods/YHHPlanarityEnergy.hh
/// @brief Term for chi3 on tyrosine residues to prefer the hydrogen lie in the plane of the ring
/// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
// Unit headers
#include <core/scoring/methods/YHHPlanarityEnergy.hh>
#include <core/scoring/methods/YHHPlanarityEnergyCreator.hh>
// Package headers
#include <core/scoring/methods/ContextIndependentOneBodyEnergy.hh>
#include <core/scoring/EnergyMap.hh>
#include <core/chemical/VariantType.hh>
// Project headers
#include <core/id/TorsionID.hh>
#include <core/pose/Pose.hh>
#include <core/conformation/Residue.hh>
// Numeric headers
#include <numeric/conversions.hh>
#include <numeric/constants.hh>
#include <core/kinematics/Jump.hh>
#include <utility/vector1.hh>
namespace core {
namespace scoring {
namespace methods {
/// @details This must return a fresh instance of the P_AA_pp_Energy class,
/// never an instance already in use
methods::EnergyMethodOP
YHHPlanarityEnergyCreator::create_energy_method(
methods::EnergyMethodOptions const &
) const {
return methods::EnergyMethodOP( new YHHPlanarityEnergy );
}
ScoreTypes
YHHPlanarityEnergyCreator::score_types_for_method() const {
ScoreTypes sts;
sts.push_back( yhh_planarity );
return sts;
}
/// ctor
YHHPlanarityEnergy::YHHPlanarityEnergy() :
parent( methods::EnergyMethodCreatorOP( new YHHPlanarityEnergyCreator ) )
{}
/// clone
EnergyMethodOP
YHHPlanarityEnergy::clone() const
{
return EnergyMethodOP( new YHHPlanarityEnergy );
}
/////////////////////////////////////////////////////////////////////////////
// methods for ContextIndependentOneBodyEnergies
/////////////////////////////////////////////////////////////////////////////
void
YHHPlanarityEnergy::residue_energy(
conformation::Residue const & rsd,
pose::Pose const &,
EnergyMap & emap
) const
{
using numeric::constants::d::degrees_to_radians;
using numeric::constants::d::pi;
// ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
if ( rsd.has_variant_type( core::chemical::REPLONLY ) ) {
return;
}
if ( defines_score_for_rsd(rsd) ) {
emap[ yhh_planarity ] += 0.5 * (std::cos( pi - 2*rsd.chi(3)*degrees_to_radians)+1);
}
}
bool
YHHPlanarityEnergy::defines_dof_derivatives( pose::Pose const & ) const
{
return true;
}
Real
YHHPlanarityEnergy::eval_residue_dof_derivative(
conformation::Residue const & rsd,
ResSingleMinimizationData const &,// min_data,
id::DOF_ID const &,// dof_id,
id::TorsionID const & tor_id,
pose::Pose const &,// pose,
ScoreFunction const &,// sfxn,
EnergyMap const & weights
) const
{
using numeric::constants::d::degrees_to_radians;
using numeric::constants::d::pi;
// ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
if ( rsd.has_variant_type( core::chemical::REPLONLY ) ) return 0.0;
if ( ! tor_id.valid() ) return 0.0;
if ( defines_score_for_rsd(rsd) && tor_id.type() == id::CHI && tor_id.torsion() == 3 ) {
return
weights[ yhh_planarity ] * std::sin(pi -2*rsd.chi(3)*degrees_to_radians);
} else {
return 0.0;
}
}
/// @brief P_AA_pp_Energy is context independent; indicates that no
/// context graphs are required
void
YHHPlanarityEnergy::indicate_required_context_graphs( utility::vector1< bool > & ) const
{}
core::Size
YHHPlanarityEnergy::version() const
{
return 1; // Initial versioning
}
bool
YHHPlanarityEnergy::defines_score_for_rsd( conformation::Residue const & rsd ) const
{
return (rsd.aa() == chemical::aa_tyr || rsd.aa() == chemical::aa_dty ) && rsd.type().nchi() == 3 && rsd.type().atom_is_hydrogen( rsd.type().chi_atoms(3)[4] );
}
} // methods
} // scoring
} // core
| [
"malaifa@yahoo.com"
] | malaifa@yahoo.com |
39efa4d6627a01e36d70aeefaa59d562d3cc0a61 | 1286c5b3d37b0785e99073c8234b44df47561f5a | /2020/0623_ABC163/C.cpp | f5330a979b8d7c671cc4568ea21238039913ff8c | [
"MIT"
] | permissive | kazunetakahashi/atcoder | 930cb5a0f4378914cc643de2f0596a5de7e4a417 | 16ce65829ccc180260b19316e276c2fcf6606c53 | refs/heads/master | 2022-02-15T19:12:10.224368 | 2022-01-29T06:38:42 | 2022-01-29T06:38:42 | 26,685,318 | 7 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 5,977 | cpp | #define DEBUG 1
/**
* File : C.cpp
* Author : Kazune Takahashi
* Created : 6/24/2020, 1:30:11 AM
* Powered by Visual Studio Code
*/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// ----- boost -----
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
// ----- using directives and manipulations -----
using namespace std;
using boost::rational;
using boost::integer::gcd; // for C++14 or for cpp_int
using boost::integer::lcm; // for C++14 or for cpp_int
using boost::multiprecision::cpp_int;
using ll = long long;
using ld = long double;
template <typename T>
using max_heap = priority_queue<T>;
template <typename T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;
// ----- constexpr for Mint and Combination -----
constexpr ll MOD{1'000'000'007LL};
// constexpr ll MOD{998'244'353LL}; // be careful
constexpr ll MAX_SIZE{3'000'010LL};
// constexpr ll MAX_SIZE{30'000'010LL}; // if 10^7 is needed
// ----- ch_max and ch_min -----
template <typename T>
bool ch_max(T &left, T right)
{
if (left < right)
{
left = right;
return true;
}
return false;
}
template <typename T>
bool ch_min(T &left, T right)
{
if (left > right)
{
left = right;
return true;
}
return false;
}
// ----- Mint -----
template <ll MOD = MOD>
class Mint
{
public:
ll x;
Mint() : x{0LL} {}
Mint(ll x) : x{(x % MOD + MOD) % MOD} {}
Mint operator-() const { return x ? MOD - x : 0; }
Mint &operator+=(Mint const &a)
{
if ((x += a.x) >= MOD)
{
x -= MOD;
}
return *this;
}
Mint &operator-=(Mint const &a) { return *this += -a; }
Mint &operator++() { return *this += 1; }
Mint operator++(int)
{
Mint tmp{*this};
++*this;
return tmp;
}
Mint &operator--() { return *this -= 1; }
Mint operator--(int)
{
Mint tmp{*this};
--*this;
return tmp;
}
Mint &operator*=(Mint const &a)
{
(x *= a.x) %= MOD;
return *this;
}
Mint &operator/=(Mint const &a)
{
Mint b{a};
return *this *= b.power(MOD - 2);
}
Mint operator+(Mint const &a) const { return Mint(*this) += a; }
Mint operator-(Mint const &a) const { return Mint(*this) -= a; }
Mint operator*(Mint const &a) const { return Mint(*this) *= a; }
Mint operator/(Mint const &a) const { return Mint(*this) /= a; }
bool operator<(Mint const &a) const { return x < a.x; }
bool operator<=(Mint const &a) const { return x <= a.x; }
bool operator>(Mint const &a) const { return x > a.x; }
bool operator>=(Mint const &a) const { return x >= a.x; }
bool operator==(Mint const &a) const { return x == a.x; }
bool operator!=(Mint const &a) const { return !(*this == a); }
Mint power(ll N) const
{
if (N == 0)
{
return 1;
}
else if (N % 2 == 1)
{
return *this * power(N - 1);
}
else
{
Mint half = power(N / 2);
return half * half;
}
}
};
template <ll MOD>
Mint<MOD> operator+(ll lhs, Mint<MOD> const &rhs) { return rhs + lhs; }
template <ll MOD>
Mint<MOD> operator-(ll lhs, Mint<MOD> const &rhs) { return -rhs + lhs; }
template <ll MOD>
Mint<MOD> operator*(ll lhs, Mint<MOD> const &rhs) { return rhs * lhs; }
template <ll MOD>
Mint<MOD> operator/(ll lhs, Mint<MOD> const &rhs) { return Mint<MOD>{lhs} / rhs; }
template <ll MOD>
istream &operator>>(istream &stream, Mint<MOD> &a) { return stream >> a.x; }
template <ll MOD>
ostream &operator<<(ostream &stream, Mint<MOD> const &a) { return stream << a.x; }
// ----- Combination -----
template <ll MOD = MOD, ll MAX_SIZE = MAX_SIZE>
class Combination
{
public:
vector<Mint<MOD>> inv, fact, factinv;
Combination() : inv(MAX_SIZE), fact(MAX_SIZE), factinv(MAX_SIZE)
{
inv[1] = 1;
for (auto i{2LL}; i < MAX_SIZE; i++)
{
inv[i] = (-inv[MOD % i]) * (MOD / i);
}
fact[0] = factinv[0] = 1;
for (auto i{1LL}; i < MAX_SIZE; i++)
{
fact[i] = Mint<MOD>(i) * fact[i - 1];
factinv[i] = inv[i] * factinv[i - 1];
}
}
Mint<MOD> operator()(int n, int k)
{
if (n >= 0 && k >= 0 && n - k >= 0)
{
return fact[n] * factinv[k] * factinv[n - k];
}
return 0;
}
Mint<MOD> catalan(int x, int y)
{
return (*this)(x + y, y) - (*this)(x + y, y - 1);
}
};
// ----- for C++14 -----
using mint = Mint<MOD>;
using combination = Combination<MOD, MAX_SIZE>;
// ----- for C++17 -----
template <typename T, typename enable_if<is_integral<T>::value>::type * = nullptr>
size_t popcount(T x) { return bitset<64>(x).count(); }
size_t popcount(string const &S) { return bitset<200010>{S}.count(); }
// ----- Infty -----
template <typename T>
constexpr T Infty() { return numeric_limits<T>::max(); }
template <typename T>
constexpr T mInfty() { return numeric_limits<T>::min(); }
// ----- frequently used constexpr -----
// constexpr double epsilon{1e-10};
// constexpr ll infty{1'000'000'000'000'010LL}; // or
// constexpr int infty{1'000'000'010};
// constexpr int dx[4] = {1, 0, -1, 0};
// constexpr int dy[4] = {0, 1, 0, -1};
// ----- Yes() and No() -----
void Yes()
{
cout << "Yes" << endl;
exit(0);
}
void No()
{
cout << "No" << endl;
exit(0);
}
// ----- Solve -----
class Solve
{
public:
Solve()
{
}
void flush()
{
}
private:
};
// ----- main() -----
/*
int main()
{
Solve solve;
solve.flush();
}
*/
int main()
{
int N;
cin >> N;
vector<int> V(N, 0);
for (auto i{0}; i < N - 1; ++i)
{
int A;
cin >> A;
--A;
V[A]++;
}
for (auto i{0}; i < N; ++i)
{
cout << V[i] << endl;
}
}
| [
"kazunetakahashi@gmail.com"
] | kazunetakahashi@gmail.com |
dbc8b87dd331e1a844eb89b116ea314fe7b0acd0 | 6e3ee66e3840a357ef96cf01f1c8b265f80db646 | /flamingoserver/mysql/MysqlThrdMgr.cpp | f7f08050b16a6ec83ff30ce91393100c0aa4bad2 | [] | no_license | guiqinhui/flamingo | 7dab09c6b3e949c702c3b607240071df9de0bce5 | 8062adae6e8ec2f8f5aa34e55b3969ec2bf7b98d | refs/heads/master | 2020-05-18T05:57:35.264866 | 2019-04-30T08:31:15 | 2019-04-30T08:31:15 | 184,221,475 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,367 | cpp | #include "../base/Logging.h"
#include "MysqlThrdMgr.h"
CMysqlThrdMgr::CMysqlThrdMgr(void)
{
}
CMysqlThrdMgr::~CMysqlThrdMgr(void)
{
}
bool CMysqlThrdMgr::AddTask( uint32_t dwHashID, IMysqlTask* poTask )
{
LOG_DEBUG << "CMysqlThrdMgr::AddTask, HashID = " << dwHashID;
uint32_t btIndex = GetTableHashID(dwHashID);
if (btIndex >= m_dwThreadsCount)
{
return false;
}
return m_aoMysqlThreads[btIndex].AddTask(poTask);
}
bool CMysqlThrdMgr::Init(const string& host, const string& user, const string& pwd, const string& dbname)
{
for(uint32_t i = 0; i < m_dwThreadsCount+1; ++i)
{
if (false == m_aoMysqlThreads[i].Start(host, user, pwd, dbname))
{
return false;
}
}
return true;
}
bool CMysqlThrdMgr::ProcessReplyTask(int32_t nCount )
{
bool bResult = false;
for (uint32_t i = 0; i < m_dwThreadsCount + 1; ++i)
{
IMysqlTask* poTask = m_aoMysqlThreads[i].GetReplyTask();
int32_t dwProcessedNbr = 0;
while (((nCount == -1) || (dwProcessedNbr < nCount)) && (NULL != poTask))
{
poTask->Reply();
poTask->Release();
poTask = m_aoMysqlThreads[i].GetReplyTask();
++dwProcessedNbr;
}
if (dwProcessedNbr == nCount)
{
bResult = true;
}
}
return bResult;
}
| [
"carmelogui@tencent.com"
] | carmelogui@tencent.com |
8fdbb3e3600d61492b3628bd173bff15496b6822 | b2139a7f5e04114c39faea797f0f619e69b8b4ae | /src/eMorph/src/simpleSaccade/tutorial_eyeControl.cpp | 758352391bcbbcfb4d99a2be428966ca653275de | [] | no_license | hychyc07/contrib_bk | 6b82391a965587603813f1553084a777fb54d9d7 | 6f3df0079b7ea52d5093042112f55a921c9ed14e | refs/heads/master | 2020-05-29T14:01:20.368837 | 2015-04-02T21:00:31 | 2015-04-02T21:00:31 | 33,312,790 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 6,093 | cpp | // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
#include <stdio.h>
#include <stdlib.h>
#include <yarp/os/Network.h>
#include <yarp/dev/ControlBoardInterfaces.h>
#include <yarp/dev/PolyDriver.h>
#include <yarp/os/Time.h>
#include <yarp/sig/Vector.h>
#include <string>
#define COMMAND_VOCAB_ON VOCAB2('o','n')
#define COMMAND_VOCAB_OFF VOCAB3('o','f','f')
#define COMMAND_VOCAB_DUMP VOCAB4('d','u','m','p')
#define COMMAND_VOCAB_SYNC VOCAB4('s','y','n','c')
#define DELTAENC 0.0000001
using namespace yarp::dev;
using namespace yarp::sig;
using namespace yarp::os;
void moveJoints(IPositionControl *_pos, Vector& _command)
{
_pos->positionMove(_command.data());
Time::delay(0.1);
}
int main(int argc, char *argv[])
{
Network yarp;
Port* _pOutPort = new Port;
//_options.portName+="/command:o";
std::string portName="/simpleSaccade/cmd:o";
_pOutPort->open(portName.c_str());
Property params;
params.fromCommand(argc, argv);
if(params.check("help"))
{
fprintf(stderr, "%s --robot robotName --loop numberOfLoop", argv[0]);
}
if (!params.check("robot"))
{
fprintf(stderr, "Please specify the name of the robot\n");
fprintf(stderr, "--robot name (e.g. icub)\n");
return -1;
}
if (!params.check("loop"))
{
fprintf(stderr, "Please specify the number of repetition\n");
fprintf(stderr, "--loop number\n");
return -1;
}
std::string robotName=params.find("robot").asString().c_str();
std::string remotePorts="/";
remotePorts+=robotName;
remotePorts+="/head"; //"/right_arm"
//int nOl=atoi(params.find("loop").asString().c_str());
int nOl=params.find("loop").asInt();
Network::connect(portName.c_str(), "/aexGrabber");
std::string localPorts="/test/client";
Property options;
options.put("device", "remote_controlboard");
options.put("local", localPorts.c_str()); //local port names
options.put("remote", remotePorts.c_str()); //where we connect to
// create a device
PolyDriver robotDevice(options);
if (!robotDevice.isValid()) {
printf("Device not available. Here are the known devices:\n");
printf("%s", Drivers::factory().toString().c_str());
return 0;
}
IPositionControl *pos;
IEncoders *encs;
bool ok;
ok = robotDevice.view(pos);
ok = ok && robotDevice.view(encs);
if (!ok) {
printf("Problems acquiring interfaces\n");
return 0;
}
int nj=0;
pos->getAxes(&nj);
Vector encoders;
Vector command;
Vector tmp;
encoders.resize(nj);
tmp.resize(nj);
command.resize(nj);
int i;
for (i = 0; i < nj; i++) {
tmp[i] = 50.0;
}
pos->setRefAccelerations(tmp.data());
for (i = 0; i < nj; i++) {
tmp[i] = 100.0;
pos->setRefSpeed(i, tmp[i]);
}
//pos->setRefSpeeds(tmp.data()))
//fisrst zero all joints
//
for(i=0; i<nj; i++)
command[i]=0;
/******************************
* SPECIFIC STARTING POSITIONS *
******************************/
command[0]=-30;
pos->positionMove(command.data());//(4,deg);
double startPos3;
double startPos4;
encs->getEncoder(3, &startPos3);
encs->getEncoder(4, &startPos4);
printf("start position value of joint 3: %lf\n", startPos3);
printf("start position value of joint 4: %lf\n", startPos4);
bool first=true;
int deltaSacc=2;
int times=0;
yarp::os::Bottle bot; //= _pOutPort->prepare();
bot.clear();
bot.addVocab(COMMAND_VOCAB_DUMP);
bot.addVocab(COMMAND_VOCAB_ON);
Bottle inOn;
_pOutPort->write(bot,inOn);
Time::delay(0.1);
fprintf(stderr, "Start saccade(s), number of repetition: %d\n", nOl);
while(times<nOl)
{
times++;
/*Horizontal saccade*/
command[4]=-deltaSacc;
//moveJoints(pos, command);
pos->positionMove(command.data());
if(first)
{
double curPos;
encs->getEncoder(4, &curPos);
printf("current position value of joint 4: %lf\n", curPos);
while((curPos>=startPos4-DELTAENC) && (curPos<=startPos4+DELTAENC))
{
printf("current position value of joint 4: %lf\n", curPos);
encs->getEncoder(4, &curPos);
}
bot.clear();
bot.addVocab(COMMAND_VOCAB_SYNC);
Bottle inStart;
_pOutPort->write(bot,inStart);
printf("1st synch asked\n");
first=false;
}
Time::delay(0.1);
/*command[4]=0;
moveJoints(pos, command);*/
command[4]=deltaSacc;
moveJoints(pos, command);
command[4]=0;
moveJoints(pos, command);
/*Vertical saccade*/
command[3]=-deltaSacc;
moveJoints(pos, command);
/*command[3]=0;
moveJoints(pos, command);*/
command[3]=deltaSacc;
moveJoints(pos, command);
command[3]=0;
moveJoints(pos, command);
if(times>=nOl)
{
double curPos;
encs->getEncoder(3, &curPos);
printf("current position value of joint 3: %lf\n", curPos);
/* while((curPos<startPos3-DELTAENC) || (curPos>startPos3+DELTAENC))
{
command[3]=0;
printf("current position value of joint 3: %lf\n", curPos);
encs->getEncoder(3, &curPos);
}*/
bot.clear();
bot.addVocab(COMMAND_VOCAB_SYNC);
Bottle inEnd;
_pOutPort->write(bot,inEnd);
printf("2nd synch asked\n");
}
/* int count=50;
while(count--)
{
Time::delay(0.1);
encs->getEncoders(encoders.data());
printf("%.1lf %.1lf %.1lf %.1lf\n", encoders[0], encoders[1], encoders[2], encoders[3]);
}
*/
}
Time::delay(0.1);
/*bot.clear();
bot.addVocab(COMMAND_VOCAB_SYNC);
Bottle inEnd;
_pOutPort->write(bot,inEnd);
*/
bot.clear();
bot.addVocab(COMMAND_VOCAB_DUMP);
bot.addVocab(COMMAND_VOCAB_OFF);
Bottle inOff;
_pOutPort->write(bot,inOff);
_pOutPort->close();
robotDevice.close();
return 0;
}
| [
"hychyc07@cs.utexas.edu"
] | hychyc07@cs.utexas.edu |
e31f71a5d058cf2b9ab59779440d342f0b3122f3 | 36006487fbed2c19a2367e968afc11e76a55bb95 | /Codeforces/1065C.cpp | 8a15d33ceef091d3150ebe88d860a456e4066958 | [] | no_license | AkVaya/CP_Solutions | 99bd280470997f048ca2ee9b9dda83488d19ca7e | 60fd900aad28caf34b15b75ce736141dbc074d9f | refs/heads/master | 2021-09-27T13:57:38.897747 | 2021-09-16T16:43:55 | 2021-09-16T16:43:55 | 232,780,223 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,470 | cpp | #include<iostream>
#include<math.h>
#include<algorithm>
#include<stdlib.h>
#include<stack>
#include<set>
#include<string.h>
#include<map>
#include<vector>
#include<queue>
#define pb push_back
#define eb emplace_back
#define ins insert
#define mp make_pair
#define max3(a,b,c) max(c,max(a,b))
#define fr(i,a,b) for (int i = a; i < b; ++i)
#define min3(a,b,c) min(c,min(a,b))
using namespace std;
typedef long long ll ;
const ll M =1e9+7;
const ll nax=2e6+5;
const ll inf=1e18;
using pii = pair<ll,ll>;
ll ans[nax];
void solve(){
ll n,k;
cin>>n>>k;
map<ll,ll> m;
ll a[n];
for (int i = 0; i < n; ++i)
{
cin>>a[i];
}
sort(a,a+n);
for (int i = 1; i < n; ++i)
{
a[i]-=a[0];
}
a[0]=0;
for (int i = 0; i < n; ++i)
{
m[a[i]]++;
}
for (int i = a[n-1]; i>0; --i)
{
m[i]+=m[i+1];
}
ll curr=0,ans=0;
for (int i = a[n-1]; i>0; --i)
{
curr+=m[i];
if(curr>k){
ans++;
curr=m[i];
}
}
cout<<(curr>0 ? ans+1 : ans)<<endl;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll t=1,t1=1;
//cin>>t;
//clock_t t3 = clock();
while(t--){
//cout<<"Case #"<<t1++<<": ";
solve();
}
//clock_t t2 = clock();
//cout << "Time-Taken: " << ((t2 - t3) / (double)CLOCKS_PER_SEC) << endl;
//cout << CLOCKS_PER_SEC << endl;
return 0 ;
} | [
"akshat.18je0072@am.iitism.ac.in"
] | akshat.18je0072@am.iitism.ac.in |
e33a5c01420e0ce84d6d8d1c3419e6f9f2a68844 | 31f5cddb9885fc03b5c05fba5f9727b2f775cf47 | /thirdparty/google/tensorflow/lite/delegates/gpu/common/tasks/depthwise_conv_3x3_stride_h2.h | 71cb4e9f96a5b10792024c126125fb6902ab84ca | [
"MIT"
] | permissive | timi-liuliang/echo | 2935a34b80b598eeb2c2039d686a15d42907d6f7 | d6e40d83c86431a819c6ef4ebb0f930c1b4d0f24 | refs/heads/master | 2023-08-17T05:35:08.104918 | 2023-08-11T18:10:35 | 2023-08-11T18:10:35 | 124,620,874 | 822 | 102 | MIT | 2021-06-11T14:29:03 | 2018-03-10T04:07:35 | C++ | UTF-8 | C++ | false | false | 5,775 | h | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_TASKS_DEPTHWISE_CONV_3X3_STRIDE_H2_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_TASKS_DEPTHWISE_CONV_3X3_STRIDE_H2_H_
#include <vector>
#include "tensorflow/lite/delegates/gpu/common/operations.h"
#include "tensorflow/lite/delegates/gpu/common/task/buffer_desc.h"
#include "tensorflow/lite/delegates/gpu/common/task/gpu_operation.h"
#include "tensorflow/lite/delegates/gpu/common/task/texture2d_desc.h"
namespace tflite {
namespace gpu {
// Depth Wise Convolution for kernel 3x3
// require:
// channels_multiplier = 1;
// kernel_size = 3x3;
// dilation.y = 1;
// stride.y = 2;
class DepthWiseConv3x3StrideH2 : public GPUOperation {
public:
DepthWiseConv3x3StrideH2() = default;
void GetPossibleKernelWorkGroups(
TuningType tuning_type, const GpuInfo& gpu_info,
const KernelInfo& kernel_info,
std::vector<int3>* work_groups) const override;
int3 GetGridSize() const override;
// Move only
DepthWiseConv3x3StrideH2(DepthWiseConv3x3StrideH2&& kernel) = default;
DepthWiseConv3x3StrideH2& operator=(DepthWiseConv3x3StrideH2&& kernel) =
default;
DepthWiseConv3x3StrideH2(const DepthWiseConv3x3StrideH2&) = delete;
DepthWiseConv3x3StrideH2& operator=(const DepthWiseConv3x3StrideH2&) = delete;
private:
explicit DepthWiseConv3x3StrideH2(const OperationDef& definition)
: GPUOperation(definition) {}
friend DepthWiseConv3x3StrideH2 CreateDepthWiseConv3x3StrideH2(
const OperationDef& definition,
const DepthwiseConvolution2DAttributes& attr, const GpuInfo& gpu_info);
template <DataType T>
void UploadWeightsAndBiases(const tflite::gpu::Tensor<OHWI, T>& weights,
const tflite::gpu::Tensor<Linear, T>& biases,
bool weights_are_buffer);
template <DataType S, typename T>
void RearrangeWeightsAndBiasesData(
const tflite::gpu::Tensor<OHWI, S>& weights,
const tflite::gpu::Tensor<Linear, S>& biases, absl::Span<T> dst);
bool local_mem_uploads_;
};
template <DataType T>
void DepthWiseConv3x3StrideH2::UploadWeightsAndBiases(
const tflite::gpu::Tensor<OHWI, T>& weights,
const tflite::gpu::Tensor<Linear, T>& biases, bool weights_are_buffer) {
const int src_depth = DivideRoundUp(weights.shape.i, 4);
int texture_width = 10; // 3x3 kernel + 1 bias
int texture_height = src_depth;
const int elements_count = texture_width * texture_height;
const bool fp32_weights = definition_.precision == CalculationsPrecision::F32;
const int float4_size = fp32_weights ? 16 : 8;
std::vector<uint8_t> data(float4_size * elements_count);
if (fp32_weights) {
float4* ptr = reinterpret_cast<float4*>(data.data());
RearrangeWeightsAndBiasesData(weights, biases,
absl::MakeSpan(ptr, elements_count));
} else {
half4* ptr = reinterpret_cast<half4*>(data.data());
RearrangeWeightsAndBiasesData(weights, biases,
absl::MakeSpan(ptr, elements_count));
}
if (weights_are_buffer) {
BufferDescriptor desc;
desc.element_type = fp32_weights ? DataType::FLOAT32 : DataType::FLOAT16;
desc.element_size = 4;
desc.size = float4_size * elements_count;
desc.data = std::move(data);
args_.AddObject("weights",
absl::make_unique<BufferDescriptor>(std::move(desc)));
} else {
Texture2DDescriptor desc;
desc.element_type = fp32_weights ? DataType::FLOAT32 : DataType::FLOAT16;
desc.size = int2(texture_width, texture_height);
desc.data = std::move(data);
args_.AddObject("weights",
absl::make_unique<Texture2DDescriptor>(std::move(desc)));
}
}
template <DataType S, typename T>
void DepthWiseConv3x3StrideH2::RearrangeWeightsAndBiasesData(
const tflite::gpu::Tensor<OHWI, S>& weights,
const tflite::gpu::Tensor<Linear, S>& biases, absl::Span<T> dst) {
const int src_depth = DivideRoundUp(weights.shape.i, 4);
int counter = 0;
for (int s = 0; s < src_depth; ++s) {
for (int y = 0; y < 3; ++y) {
for (int x = 0; x < 3; ++x) {
T filter_val;
for (int i = 0; i < 4; ++i) {
const int s_ch = s * 4 + i;
if (s_ch < weights.shape.i) {
const int f_index = weights.shape.LinearIndex({0, y, x, s_ch});
filter_val[i] = weights.data[f_index];
} else {
filter_val[i] = 0.0f;
}
}
dst[counter++] = filter_val;
}
}
T bias_val;
for (int i = 0; i < 4; ++i) {
const int dst_ch = s * 4 + i;
bias_val[i] = dst_ch >= biases.shape.v ? 0.0f : biases.data[dst_ch];
}
dst[counter++] = bias_val;
}
}
DepthWiseConv3x3StrideH2 CreateDepthWiseConv3x3StrideH2(
const OperationDef& definition,
const DepthwiseConvolution2DAttributes& attr, const GpuInfo& gpu_info);
bool IsDepthWiseConv3x3StrideH2Supported(
const DepthwiseConvolution2DAttributes& attr);
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_TASKS_DEPTHWISE_CONV_3X3_STRIDE_H2_H_
| [
"qq79402005@gmail.com"
] | qq79402005@gmail.com |
aff8e52c085b9c8bba6a491c4b7796f003724d0c | 4734ee67210e56563c113870e5c77fb67ede63fb | /LeetCode/weekly165/B.cpp | 847433a9cf79dde6cf1e5b28ce6e5484cd52c2ea | [
"MIT"
] | permissive | tanner00/solves | 6eaa795136bef6758b2bf561ac2c9e88bb3cfe86 | 6c640cefe78699abc3bd4988610f6123cda235fb | refs/heads/master | 2020-09-22T15:11:28.500686 | 2019-12-10T21:19:26 | 2019-12-10T21:19:26 | 225,254,423 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 640 | cpp | // URL: https://leetcode.com/contest/weekly-contest-165/problems/number-of-burgers-with-no-waste-of-ingredients/
// TYPE: Math
class Solution {
public:
vector<int> numOfBurgers(int tomatoSlices, int cheeseSlices) {
if (tomatoSlices == 0 && cheeseSlices == 0) return vector<int>{0,0};
if (tomatoSlices < 0 || cheeseSlices < 0) return vector<int>{};
if ((tomatoSlices % 2) != 0) return vector<int>{};
int small = (4 * cheeseSlices - tomatoSlices) / 2;
int large = cheeseSlices - small;
if (small < 0 || large < 0) return vector<int>{};
return vector<int> {large, small};
}
};
| [
"gasquakestudios@gmail.com"
] | gasquakestudios@gmail.com |
8ba0ad426d1df7cdee26848978fe14deef3ebd1c | 2d5d7b44b7f05f8d1d8e1f6fad0065ed89cead0c | /inMyRoom_vulkan/src/Geometry/Cylinder.cpp | 74d5c70d2bf394b02b42a0efc7ea6cd17c9f7b12 | [] | no_license | thesmallcreeper/inMyRoom_vulkan | b84bafbadd32228210969e9b466e7f8c213c90ec | 8b0d96b02ecffd2bed04730363d0e8a349d12530 | refs/heads/master | 2023-04-30T10:09:40.771134 | 2023-04-23T20:47:10 | 2023-04-23T20:47:10 | 158,889,074 | 20 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,701 | cpp | #include "Geometry/Cylinder.h"
#include <cmath>
#include <numbers>
std::pair<std::vector<uint32_t>, std::vector<glm::vec3>> Cylinder::GetCylinderMesh(size_t quality)
{
std::vector<uint32_t> indices;
std::vector<glm::vec3> points;
size_t points_count = quality * 2;
std::vector<uint32_t> upper_indices;
std::vector<uint32_t> lower_indices;
for (size_t i = 0; i != points_count; ++i) {
size_t upper_index = points.size();
size_t lower_index = points.size() + 1;
float phi = 2.f * float(std::numbers::pi) * (float(i) / float(points_count));
float cos_phi = std::cos(phi);
float sin_phi = std::sin(phi);
points.emplace_back(+1.f,
cos_phi,
sin_phi);
points.emplace_back(-1.f,
cos_phi,
sin_phi);
upper_indices.emplace_back(upper_index);
lower_indices.emplace_back(lower_index);
}
assert(upper_indices.size() == lower_indices.size());
for (size_t i = 0; i != upper_indices.size(); ++i) {
uint32_t index_0 = upper_indices[(i + 1) % upper_indices.size()];
uint32_t index_1 = upper_indices[i];
uint32_t index_2 = lower_indices[i];
uint32_t index_3 = lower_indices[(i + 1) % upper_indices.size()];
// Triangle 0
indices.emplace_back(index_0);
indices.emplace_back(index_1);
indices.emplace_back(index_2);
// Triangle 1
indices.emplace_back(index_0);
indices.emplace_back(index_2);
indices.emplace_back(index_3);
}
return std::make_pair(std::move(indices), std::move(points));
}
| [
"nikostpt@hotmail.com"
] | nikostpt@hotmail.com |
e3d09f268ccc29a02e464c47c2c4244ab2cadf23 | 7b6d95a17eab8001523327f795e925c3d5247647 | /Alternating Subsequence.cpp | 4b331936b3edeac90a45ec0f53f54afebcaae04f | [] | no_license | BaraaHalabi/CodeForces | 099ee04529cc8393fb6af1947498ba4e92723418 | b0615de5b22f8dcf46611ba1706058c40ec157b5 | refs/heads/master | 2021-04-02T18:11:43.113199 | 2020-04-25T09:10:21 | 2020-04-25T09:10:21 | 248,305,629 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 809 | cpp | #include <iostream>
#include <bits/stdc++.h>
#define var long long int
#define repN(i, N) for (var i = 0; i < (var)N; i ++)
#define rep(i, A, B) for (var i = A; i <= (var)B; i ++)
#define dep(i, A ,B) for (var i = A; i >= (var)B; i --)
#define FIO ios::sync_with_stdio(false);
using namespace std;
var A[(var)2e5];
var N;
int main() {
FIO;
var T;
cin >> T;
while(T --) {
cin >> N;
repN(i, N)
cin >> A[i];
var Res = 0;
repN(i, N) {
var Num = A[i];
while((A[i] > 0 && Num > 0) || ((A[i] < 0 && Num < 0))) {
Num = max(Num, A[i]);
i ++;
if(i >= N)
break;
}
i --;
Res += Num;
}
cout << Res << endl;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
e1d0d98358be76d0f01a02e85fe7d58c2a75f668 | 0ffbf6dd0f223244b6a416f39c65b98a12700267 | /google/cloud/storage/internal/curl_client.cc | ed4285367058204b5c57c77604953257abd60f6e | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | mbrukman/google-cloud-cpp | 6b867299cf1874e8b0f217a3f50e0ea99155dd9f | a544b394a97178b35dbc5b6250eb1ce705708ee9 | refs/heads/master | 2021-05-06T18:00:38.424758 | 2018-12-14T03:04:29 | 2018-12-14T03:04:29 | 111,938,287 | 0 | 0 | null | 2017-11-24T16:35:52 | 2017-11-24T16:35:52 | null | UTF-8 | C++ | false | false | 66,509 | cc | // Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "google/cloud/storage/internal/curl_client.h"
#include "google/cloud/internal/getenv.h"
#include "google/cloud/internal/make_unique.h"
#include "google/cloud/storage/internal/curl_request_builder.h"
#include "google/cloud/storage/internal/curl_resumable_streambuf.h"
#include "google/cloud/storage/internal/curl_resumable_upload_session.h"
#include "google/cloud/storage/internal/curl_streambuf.h"
#include "google/cloud/storage/internal/generate_message_boundary.h"
#include "google/cloud/storage/object_stream.h"
namespace google {
namespace cloud {
namespace storage {
inline namespace STORAGE_CLIENT_NS {
namespace internal {
namespace {
extern "C" void CurlShareLockCallback(CURL*, curl_lock_data,
curl_lock_access,
void* userptr) {
auto* client = reinterpret_cast<CurlClient*>(userptr);
client->LockShared();
}
extern "C" void CurlShareUnlockCallback(CURL*,
curl_lock_data,
void* userptr) {
auto* client = reinterpret_cast<CurlClient*>(userptr);
client->UnlockShared();
}
std::shared_ptr<CurlHandleFactory> CreateHandleFactory(
ClientOptions const& options) {
if (options.connection_pool_size() == 0U) {
return std::make_shared<DefaultCurlHandleFactory>();
}
return std::make_shared<PooledCurlHandleFactory>(
options.connection_pool_size());
}
std::unique_ptr<HashValidator> CreateHashValidator(bool disable_md5,
bool disable_crc32c) {
if (disable_md5 and disable_crc32c) {
return google::cloud::internal::make_unique<NullHashValidator>();
}
if (disable_md5) {
return google::cloud::internal::make_unique<Crc32cHashValidator>();
}
if (disable_crc32c) {
return google::cloud::internal::make_unique<MD5HashValidator>();
}
return google::cloud::internal::make_unique<CompositeValidator>(
google::cloud::internal::make_unique<Crc32cHashValidator>(),
google::cloud::internal::make_unique<MD5HashValidator>());
}
/// Create a HashValidator for a download request.
std::unique_ptr<HashValidator> CreateHashValidator(
ReadObjectRangeRequest const& request) {
return CreateHashValidator(request.HasOption<DisableMD5Hash>(),
request.HasOption<DisableCrc32cChecksum>());
}
/// Create a HashValidator for an upload request.
std::unique_ptr<HashValidator> CreateHashValidator(
InsertObjectStreamingRequest const& request) {
return CreateHashValidator(request.HasOption<DisableMD5Hash>(),
request.HasOption<DisableCrc32cChecksum>());
}
/// Create a HashValidator for an insert request.
std::unique_ptr<HashValidator> CreateHashValidator(
InsertObjectMediaRequest const&) {
return google::cloud::internal::make_unique<NullHashValidator>();
}
std::string XmlMapPredefinedAcl(std::string const& acl) {
static std::map<std::string, std::string> mapping{
{"authenticatedRead", "authenticated-read"},
{"bucketOwnerFullControl", "bucket-owner-full-control"},
{"bucketOwnerRead", "bucket-owner-read"},
{"private", "private"},
{"projectPrivate", "project-private"},
{"publicRead", "public-read"},
};
auto loc = mapping.find(acl);
if (loc == mapping.end()) {
return acl;
}
return loc->second;
}
std::string UrlEscapeString(std::string const& value) {
CurlHandle handle;
return std::string(handle.MakeEscapedString(value).get());
}
} // namespace
Status CurlClient::SetupBuilderCommon(CurlRequestBuilder& builder,
char const* method) {
auto auth_header_pair = AuthorizationHeader(options_.credentials());
if (not auth_header_pair.first.ok()) {
return auth_header_pair.first;
}
builder.SetMethod(method)
.SetDebugLogging(options_.enable_http_tracing())
.SetCurlShare(share_.get())
.AddUserAgentPrefix(options_.user_agent_prefix())
.AddHeader(auth_header_pair.second);
return Status();
}
template <typename Request>
Status CurlClient::SetupBuilder(CurlRequestBuilder& builder,
Request const& request, char const* method) {
auto status = SetupBuilderCommon(builder, method);
if (not status.ok()) {
return status;
}
request.AddOptionsToHttpRequest(builder);
if (request.template HasOption<UserIp>()) {
std::string value = request.template GetOption<UserIp>().value();
if (value.empty()) {
value = builder.LastClientIpAddress();
}
if (not value.empty()) {
builder.AddQueryParameter(UserIp::name(), value);
}
}
return Status();
}
template <typename RequestType>
std::pair<Status, std::unique_ptr<ResumableUploadSession>>
CurlClient::CreateResumableSessionGeneric(RequestType const& request) {
if (request.template HasOption<UseResumableUploadSession>()) {
auto session_id =
request.template GetOption<UseResumableUploadSession>().value();
if (not session_id.empty()) {
return RestoreResumableSession(session_id);
}
}
CurlRequestBuilder builder(
upload_endpoint_ + "/b/" + request.bucket_name() + "/o", upload_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, std::unique_ptr<ResumableUploadSession>());
}
builder.AddQueryParameter("uploadType", "resumable");
builder.AddQueryParameter("name", request.object_name());
builder.AddHeader("Content-Type: application/json; charset=UTF-8");
std::string request_payload;
if (request.template HasOption<WithObjectMetadata>()) {
request_payload = request.template GetOption<WithObjectMetadata>()
.value()
.JsonPayloadForUpdate();
}
builder.AddHeader("Content-Length: " +
std::to_string(request_payload.size()));
auto http_response = builder.BuildRequest().MakeRequest(request_payload);
if (http_response.status_code >= 300) {
return std::make_pair(
Status{http_response.status_code, std::move(http_response.payload)},
std::unique_ptr<ResumableUploadSession>());
}
auto response =
ResumableUploadResponse::FromHttpResponse(std::move(http_response));
if (response.upload_session_url.empty()) {
std::ostringstream os;
os << __func__ << " - invalid server response, parsed to " << response;
return std::make_pair(Status(600, std::move(os).str()),
std::unique_ptr<ResumableUploadSession>());
}
auto session =
google::cloud::internal::make_unique<CurlResumableUploadSession>(
shared_from_this(), std::move(response.upload_session_url));
return std::make_pair(Status(), std::move(session));
}
CurlClient::CurlClient(ClientOptions options)
: options_(std::move(options)),
share_(curl_share_init(), &curl_share_cleanup),
generator_(google::cloud::internal::MakeDefaultPRNG()),
storage_factory_(CreateHandleFactory(options_)),
upload_factory_(CreateHandleFactory(options_)),
xml_upload_factory_(CreateHandleFactory(options_)),
xml_download_factory_(CreateHandleFactory(options_)) {
storage_endpoint_ = options_.endpoint() + "/storage/" + options_.version();
upload_endpoint_ =
options_.endpoint() + "/upload/storage/" + options_.version();
auto endpoint =
google::cloud::internal::GetEnv("CLOUD_STORAGE_TESTBENCH_ENDPOINT");
if (endpoint.has_value()) {
xml_upload_endpoint_ = options_.endpoint() + "/xmlapi";
xml_download_endpoint_ = options_.endpoint() + "/xmlapi";
} else {
xml_upload_endpoint_ = "https://storage-upload.googleapis.com";
xml_download_endpoint_ = "https://storage-download.googleapis.com";
}
curl_share_setopt(share_.get(), CURLSHOPT_LOCKFUNC, CurlShareLockCallback);
curl_share_setopt(share_.get(), CURLSHOPT_UNLOCKFUNC,
CurlShareUnlockCallback);
curl_share_setopt(share_.get(), CURLSHOPT_USERDATA, this);
curl_share_setopt(share_.get(), CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
curl_share_setopt(share_.get(), CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
curl_share_setopt(share_.get(), CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
CurlInitializeOnce(options.enable_ssl_locking_callbacks());
}
std::pair<Status, ResumableUploadResponse> CurlClient::UploadChunk(
UploadChunkRequest const& request) {
CurlRequestBuilder builder(request.upload_session_url(), upload_factory_);
auto status = SetupBuilder(builder, request, "PUT");
if (not status.ok()) {
return std::make_pair(status, ResumableUploadResponse{});
}
builder.AddHeader(request.RangeHeader());
builder.AddHeader("Content-Type: application/octet-stream");
builder.AddHeader("Content-Length: " +
std::to_string(request.payload().size()));
auto payload = builder.BuildRequest().MakeRequest(request.payload());
bool success_with_308 =
payload.status_code == 308 and
payload.headers.find("range") != payload.headers.end();
if (status.ok() or success_with_308) {
return std::make_pair(Status(), ResumableUploadResponse::FromHttpResponse(
std::move(payload)));
}
return std::make_pair(Status{payload.status_code, std::move(payload.payload)},
ResumableUploadResponse{});
}
std::pair<Status, ResumableUploadResponse> CurlClient::QueryResumableUpload(
QueryResumableUploadRequest const& request) {
CurlRequestBuilder builder(request.upload_session_url(), upload_factory_);
auto status = SetupBuilder(builder, request, "PUT");
if (not status.ok()) {
return std::make_pair(status, ResumableUploadResponse{});
}
builder.AddHeader("Content-Range: bytes */*");
builder.AddHeader("Content-Type: application/octet-stream");
builder.AddHeader("Content-Length: 0");
auto payload = builder.BuildRequest().MakeRequest(std::string{});
bool success_with_308 =
payload.status_code == 308 and
payload.headers.find("range") != payload.headers.end();
if (status.ok() or success_with_308) {
return std::make_pair(Status(), ResumableUploadResponse::FromHttpResponse(
std::move(payload)));
}
return std::make_pair(Status{payload.status_code, std::move(payload.payload)},
ResumableUploadResponse{});
}
std::pair<Status, ListBucketsResponse> CurlClient::ListBuckets(
ListBucketsRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b", storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ListBucketsResponse{});
}
builder.AddQueryParameter("project", request.project_id());
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ListBucketsResponse{});
}
return std::make_pair(
Status(), ListBucketsResponse::FromHttpResponse(std::move(payload)));
}
std::pair<Status, BucketMetadata> CurlClient::CreateBucket(
CreateBucketRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(storage_endpoint_ + "/b", storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, BucketMetadata{});
}
builder.AddQueryParameter("project", request.project_id());
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.json_payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
BucketMetadata{});
}
return std::make_pair(Status(),
BucketMetadata::ParseFromString(payload.payload));
}
std::pair<Status, BucketMetadata> CurlClient::GetBucketMetadata(
GetBucketMetadataRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name(),
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, BucketMetadata{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (200 != payload.status_code) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
BucketMetadata{});
}
return std::make_pair(Status(),
BucketMetadata::ParseFromString(payload.payload));
}
std::pair<Status, EmptyResponse> CurlClient::DeleteBucket(
DeleteBucketRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name(),
storage_factory_);
auto status = SetupBuilder(builder, request, "DELETE");
if (not status.ok()) {
return std::make_pair(status, EmptyResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::EmptyResponse{});
}
return std::make_pair(Status(), internal::EmptyResponse{});
}
std::pair<Status, BucketMetadata> CurlClient::UpdateBucket(
UpdateBucketRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.metadata().name(), storage_factory_);
auto status = SetupBuilder(builder, request, "PUT");
if (not status.ok()) {
return std::make_pair(status, BucketMetadata{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.json_payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
BucketMetadata{});
}
return std::make_pair(Status(),
BucketMetadata::ParseFromString(payload.payload));
}
std::pair<Status, BucketMetadata> CurlClient::PatchBucket(
PatchBucketRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket(),
storage_factory_);
auto status = SetupBuilder(builder, request, "PATCH");
if (not status.ok()) {
return std::make_pair(status, BucketMetadata{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
BucketMetadata{});
}
return std::make_pair(Status(),
BucketMetadata::ParseFromString(payload.payload));
}
std::pair<Status, IamPolicy> CurlClient::GetBucketIamPolicy(
GetBucketIamPolicyRequest const& request) {
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.bucket_name() + "/iam",
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, IamPolicy{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)}, IamPolicy{});
}
return std::make_pair(Status(), ParseIamPolicyFromString(payload.payload));
}
std::pair<Status, IamPolicy> CurlClient::SetBucketIamPolicy(
SetBucketIamPolicyRequest const& request) {
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.bucket_name() + "/iam",
storage_factory_);
auto status = SetupBuilder(builder, request, "PUT");
if (not status.ok()) {
return std::make_pair(status, IamPolicy{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.json_payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)}, IamPolicy{});
}
return std::make_pair(Status(), ParseIamPolicyFromString(payload.payload));
}
std::pair<Status, TestBucketIamPermissionsResponse>
CurlClient::TestBucketIamPermissions(
google::cloud::storage::internal::TestBucketIamPermissionsRequest const&
request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/iam/testPermissions",
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, TestBucketIamPermissionsResponse{});
}
for (auto const& perm : request.permissions()) {
builder.AddQueryParameter("permissions", perm);
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
TestBucketIamPermissionsResponse{});
}
return std::make_pair(
Status(), TestBucketIamPermissionsResponse::FromHttpResponse(payload));
}
std::pair<Status, EmptyResponse> CurlClient::LockBucketRetentionPolicy(
LockBucketRetentionPolicyRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/lockRetentionPolicy",
storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, EmptyResponse{});
}
builder.AddHeader("content-type: application/json");
builder.AddHeader("content-length: 0");
builder.AddOption(IfMetagenerationMatch(request.metageneration()));
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
EmptyResponse{});
}
return std::make_pair(Status(), EmptyResponse{});
}
std::pair<Status, ObjectMetadata> CurlClient::InsertObjectMedia(
InsertObjectMediaRequest const& request) {
// If the object metadata is specified, then we need to do a multipart upload.
if (request.HasOption<WithObjectMetadata>()) {
return InsertObjectMediaMultipart(request);
}
// Unless the request uses a feature that disables it, prefer to use XML.
if (not request.HasOption<IfMetagenerationNotMatch>() and
not request.HasOption<IfGenerationNotMatch>() and
not request.HasOption<QuotaUser>() and not request.HasOption<UserIp>() and
not request.HasOption<Projection>() and request.HasOption<Fields>() and
request.GetOption<Fields>().value().empty()) {
return InsertObjectMediaXml(request);
}
// If the application has set an explicit hash value we need to use multipart
// uploads.
if (not request.HasOption<DisableMD5Hash>() and
not request.HasOption<DisableCrc32cChecksum>()) {
return InsertObjectMediaMultipart(request);
}
// Otherwise do a simple upload.
return InsertObjectMediaSimple(request);
}
std::pair<Status, ObjectMetadata> CurlClient::CopyObject(
CopyObjectRequest const& request) {
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.source_bucket() + "/o/" +
UrlEscapeString(request.source_object()) + "/copyTo/b/" +
request.destination_bucket() + "/o/" +
UrlEscapeString(request.destination_object()),
storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, ObjectMetadata{});
}
builder.AddHeader("Content-Type: application/json");
std::string json_payload("{}");
if (request.HasOption<WithObjectMetadata>()) {
json_payload =
request.GetOption<WithObjectMetadata>().value().JsonPayloadForCopy();
}
auto payload = builder.BuildRequest().MakeRequest(json_payload);
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectMetadata{});
}
return std::make_pair(Status(),
ObjectMetadata::ParseFromString(payload.payload));
}
std::pair<Status, ObjectMetadata> CurlClient::GetObjectMetadata(
GetObjectMetadataRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()),
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ObjectMetadata{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectMetadata{});
}
return std::make_pair(Status(),
ObjectMetadata::ParseFromString(payload.payload));
}
std::pair<Status, std::unique_ptr<ObjectReadStreambuf>> CurlClient::ReadObject(
ReadObjectRangeRequest const& request) {
if (not request.HasOption<IfMetagenerationNotMatch>() and
not request.HasOption<IfGenerationNotMatch>() and
not request.HasOption<QuotaUser>() and not request.HasOption<UserIp>()) {
return ReadObjectXml(request);
}
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()),
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status,
std::unique_ptr<ObjectReadStreambuf>(nullptr));
}
builder.AddQueryParameter("alt", "media");
std::unique_ptr<CurlReadStreambuf> buf(new CurlReadStreambuf(
builder.BuildDownloadRequest(std::string{}),
client_options().download_buffer_size(), CreateHashValidator(request)));
return std::make_pair(Status(),
std::unique_ptr<ObjectReadStreambuf>(std::move(buf)));
}
std::pair<Status, std::unique_ptr<ObjectWriteStreambuf>>
CurlClient::WriteObject(InsertObjectStreamingRequest const& request) {
if (not request.HasOption<IfMetagenerationNotMatch>() and
not request.HasOption<IfGenerationNotMatch>() and
not request.HasOption<QuotaUser>() and not request.HasOption<UserIp>() and
not request.HasOption<Projection>() and request.HasOption<Fields>() and
request.GetOption<Fields>().value().empty()) {
return WriteObjectXml(request);
}
if (request.HasOption<WithObjectMetadata>() or
request.HasOption<UseResumableUploadSession>()) {
return WriteObjectResumable(request);
}
return WriteObjectSimple(request);
}
std::pair<Status, ListObjectsResponse> CurlClient::ListObjects(
ListObjectsRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.bucket_name() + "/o",
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ListObjectsResponse{});
}
builder.AddQueryParameter("pageToken", request.page_token());
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (200 != payload.status_code) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::ListObjectsResponse{});
}
return std::make_pair(
Status(),
internal::ListObjectsResponse::FromHttpResponse(std::move(payload)));
}
std::pair<Status, EmptyResponse> CurlClient::DeleteObject(
DeleteObjectRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()),
storage_factory_);
auto status = SetupBuilder(builder, request, "DELETE");
if (not status.ok()) {
return std::make_pair(status, EmptyResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::EmptyResponse{});
}
return std::make_pair(Status(), internal::EmptyResponse{});
}
std::pair<Status, ObjectMetadata> CurlClient::UpdateObject(
UpdateObjectRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()),
storage_factory_);
auto status = SetupBuilder(builder, request, "PUT");
if (not status.ok()) {
return std::make_pair(status, ObjectMetadata{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.json_payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectMetadata{});
}
return std::make_pair(Status(),
ObjectMetadata::ParseFromString(payload.payload));
}
std::pair<Status, ObjectMetadata> CurlClient::PatchObject(
PatchObjectRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()),
storage_factory_);
auto status = SetupBuilder(builder, request, "PATCH");
if (not status.ok()) {
return std::make_pair(status, ObjectMetadata{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectMetadata{});
}
return std::make_pair(Status(),
ObjectMetadata::ParseFromString(payload.payload));
}
std::pair<Status, ObjectMetadata> CurlClient::ComposeObject(
ComposeObjectRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()) + "/compose",
storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, ObjectMetadata{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.JsonPayload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectMetadata{});
}
return std::make_pair(Status(),
ObjectMetadata::ParseFromString(payload.payload));
}
std::pair<Status, RewriteObjectResponse> CurlClient::RewriteObject(
RewriteObjectRequest const& request) {
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.source_bucket() + "/o/" +
UrlEscapeString(request.source_object()) + "/rewriteTo/b/" +
request.destination_bucket() + "/o/" +
UrlEscapeString(request.destination_object()),
storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, RewriteObjectResponse{});
}
if (not request.rewrite_token().empty()) {
builder.AddQueryParameter("rewriteToken", request.rewrite_token());
}
builder.AddHeader("Content-Type: application/json");
std::string json_payload("{}");
if (request.HasOption<WithObjectMetadata>()) {
json_payload =
request.GetOption<WithObjectMetadata>().value().JsonPayloadForCopy();
}
auto payload = builder.BuildRequest().MakeRequest(json_payload);
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
RewriteObjectResponse{});
}
return std::make_pair(Status(),
RewriteObjectResponse::FromHttpResponse(payload));
}
std::pair<Status, std::unique_ptr<ResumableUploadSession>>
CurlClient::CreateResumableSession(ResumableUploadRequest const& request) {
return CreateResumableSessionGeneric(request);
}
std::pair<Status, std::unique_ptr<ResumableUploadSession>>
CurlClient::RestoreResumableSession(std::string const& session_id) {
auto session =
google::cloud::internal::make_unique<CurlResumableUploadSession>(
shared_from_this(), session_id);
auto response = session->ResetSession();
if (response.first.status_code() == 308 or
response.first.status_code() < 300) {
return std::make_pair(Status(), std::move(session));
}
return std::make_pair(std::move(response.first),
std::unique_ptr<ResumableUploadSession>());
}
std::pair<Status, ListBucketAclResponse> CurlClient::ListBucketAcl(
ListBucketAclRequest const& request) {
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.bucket_name() + "/acl",
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ListBucketAclResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::ListBucketAclResponse{});
}
return std::make_pair(
Status(),
internal::ListBucketAclResponse::FromHttpResponse(std::move(payload)));
}
std::pair<Status, BucketAccessControl> CurlClient::GetBucketAcl(
GetBucketAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/acl/" + UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, BucketAccessControl{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
BucketAccessControl{});
}
return std::make_pair(Status(),
BucketAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, BucketAccessControl> CurlClient::CreateBucketAcl(
CreateBucketAclRequest const& request) {
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.bucket_name() + "/acl",
storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, BucketAccessControl{});
}
builder.AddHeader("Content-Type: application/json");
nl::json object;
object["entity"] = request.entity();
object["role"] = request.role();
auto payload = builder.BuildRequest().MakeRequest(object.dump());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
BucketAccessControl{});
}
return std::make_pair(Status(),
BucketAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, EmptyResponse> CurlClient::DeleteBucketAcl(
DeleteBucketAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/acl/" + UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "DELETE");
if (not status.ok()) {
return std::make_pair(status, EmptyResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::EmptyResponse{});
}
return std::make_pair(Status(), internal::EmptyResponse{});
}
std::pair<Status, BucketAccessControl> CurlClient::UpdateBucketAcl(
UpdateBucketAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/acl/" + UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "PUT");
if (not status.ok()) {
return std::make_pair(status, BucketAccessControl{});
}
builder.AddHeader("Content-Type: application/json");
nl::json patch;
patch["entity"] = request.entity();
patch["role"] = request.role();
auto payload = builder.BuildRequest().MakeRequest(patch.dump());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
BucketAccessControl{});
}
return std::make_pair(Status(),
BucketAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, BucketAccessControl> CurlClient::PatchBucketAcl(
PatchBucketAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/acl/" + UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "PATCH");
if (not status.ok()) {
return std::make_pair(status, BucketAccessControl{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
BucketAccessControl{});
}
return std::make_pair(Status(),
BucketAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, ListObjectAclResponse> CurlClient::ListObjectAcl(
ListObjectAclRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()) + "/acl",
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ListObjectAclResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::ListObjectAclResponse{});
}
return std::make_pair(
Status(),
internal::ListObjectAclResponse::FromHttpResponse(std::move(payload)));
}
std::pair<Status, ObjectAccessControl> CurlClient::CreateObjectAcl(
CreateObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()) + "/acl",
storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, ObjectAccessControl{});
}
builder.AddHeader("Content-Type: application/json");
nl::json object;
object["entity"] = request.entity();
object["role"] = request.role();
auto payload = builder.BuildRequest().MakeRequest(object.dump());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectAccessControl{});
}
return std::make_pair(Status(),
ObjectAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, EmptyResponse> CurlClient::DeleteObjectAcl(
DeleteObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()) + "/acl/" +
UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "DELETE");
if (not status.ok()) {
return std::make_pair(status, EmptyResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::EmptyResponse{});
}
return std::make_pair(Status(), internal::EmptyResponse{});
}
std::pair<Status, ObjectAccessControl> CurlClient::GetObjectAcl(
GetObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()) + "/acl/" +
UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ObjectAccessControl{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectAccessControl{});
}
return std::make_pair(Status(),
ObjectAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, ObjectAccessControl> CurlClient::UpdateObjectAcl(
UpdateObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()) + "/acl/" +
UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "PUT");
if (not status.ok()) {
return std::make_pair(status, ObjectAccessControl{});
}
builder.AddHeader("Content-Type: application/json");
nl::json object;
object["entity"] = request.entity();
object["role"] = request.role();
auto payload = builder.BuildRequest().MakeRequest(object.dump());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectAccessControl{});
}
return std::make_pair(Status(),
ObjectAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, ObjectAccessControl> CurlClient::PatchObjectAcl(
PatchObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/o/" + UrlEscapeString(request.object_name()) + "/acl/" +
UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "PATCH");
if (not status.ok()) {
return std::make_pair(status, ObjectAccessControl{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectAccessControl{});
}
return std::make_pair(Status(),
ObjectAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, ListDefaultObjectAclResponse>
CurlClient::ListDefaultObjectAcl(ListDefaultObjectAclRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.bucket_name() + "/defaultObjectAcl",
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ListDefaultObjectAclResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::ListDefaultObjectAclResponse{});
}
return std::make_pair(
Status(), internal::ListDefaultObjectAclResponse::FromHttpResponse(
std::move(payload)));
}
std::pair<Status, ObjectAccessControl> CurlClient::CreateDefaultObjectAcl(
CreateDefaultObjectAclRequest const& request) {
CurlRequestBuilder builder(
storage_endpoint_ + "/b/" + request.bucket_name() + "/defaultObjectAcl",
storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, ObjectAccessControl{});
}
nl::json object;
object["entity"] = request.entity();
object["role"] = request.role();
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(object.dump());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectAccessControl{});
}
return std::make_pair(Status(),
ObjectAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, EmptyResponse> CurlClient::DeleteDefaultObjectAcl(
DeleteDefaultObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/defaultObjectAcl/" +
UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "DELETE");
if (not status.ok()) {
return std::make_pair(status, EmptyResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::EmptyResponse{});
}
return std::make_pair(Status(), internal::EmptyResponse{});
}
std::pair<Status, ObjectAccessControl> CurlClient::GetDefaultObjectAcl(
GetDefaultObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/defaultObjectAcl/" +
UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ObjectAccessControl{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectAccessControl{});
}
return std::make_pair(Status(),
ObjectAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, ObjectAccessControl> CurlClient::UpdateDefaultObjectAcl(
UpdateDefaultObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/defaultObjectAcl/" +
UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "PUT");
if (not status.ok()) {
return std::make_pair(status, ObjectAccessControl{});
}
builder.AddHeader("Content-Type: application/json");
nl::json object;
object["entity"] = request.entity();
object["role"] = request.role();
auto payload = builder.BuildRequest().MakeRequest(object.dump());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectAccessControl{});
}
return std::make_pair(Status(),
ObjectAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, ObjectAccessControl> CurlClient::PatchDefaultObjectAcl(
PatchDefaultObjectAclRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/defaultObjectAcl/" +
UrlEscapeString(request.entity()),
storage_factory_);
auto status = SetupBuilder(builder, request, "PATCH");
if (not status.ok()) {
return std::make_pair(status, ObjectAccessControl{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectAccessControl{});
}
return std::make_pair(Status(),
ObjectAccessControl::ParseFromString(payload.payload));
}
std::pair<Status, ServiceAccount> CurlClient::GetServiceAccount(
GetProjectServiceAccountRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/projects/" +
request.project_id() + "/serviceAccount",
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ServiceAccount{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ServiceAccount{});
}
return std::make_pair(Status(),
ServiceAccount::ParseFromString(payload.payload));
}
std::pair<Status, ListNotificationsResponse> CurlClient::ListNotifications(
ListNotificationsRequest const& request) {
// Assume the bucket name is validated by the caller.
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/notificationConfigs",
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, ListNotificationsResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
internal::ListNotificationsResponse{});
}
return std::make_pair(Status(),
internal::ListNotificationsResponse::FromHttpResponse(
std::move(payload)));
}
std::pair<Status, NotificationMetadata> CurlClient::CreateNotification(
CreateNotificationRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/notificationConfigs",
storage_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, NotificationMetadata{});
}
builder.AddHeader("Content-Type: application/json");
auto payload = builder.BuildRequest().MakeRequest(request.json_payload());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
NotificationMetadata{});
}
return std::make_pair(Status(),
NotificationMetadata::ParseFromString(payload.payload));
}
std::pair<Status, NotificationMetadata> CurlClient::GetNotification(
GetNotificationRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/notificationConfigs/" +
request.notification_id(),
storage_factory_);
auto status = SetupBuilder(builder, request, "GET");
if (not status.ok()) {
return std::make_pair(status, NotificationMetadata{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
NotificationMetadata{});
}
return std::make_pair(Status(),
NotificationMetadata::ParseFromString(payload.payload));
}
std::pair<Status, EmptyResponse> CurlClient::DeleteNotification(
DeleteNotificationRequest const& request) {
CurlRequestBuilder builder(storage_endpoint_ + "/b/" + request.bucket_name() +
"/notificationConfigs/" +
request.notification_id(),
storage_factory_);
auto status = SetupBuilder(builder, request, "DELETE");
if (not status.ok()) {
return std::make_pair(status, EmptyResponse{});
}
auto payload = builder.BuildRequest().MakeRequest(std::string{});
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
EmptyResponse{});
}
return std::make_pair(Status(), EmptyResponse{});
}
void CurlClient::LockShared() { mu_.lock(); }
void CurlClient::UnlockShared() { mu_.unlock(); }
std::pair<Status, ObjectMetadata> CurlClient::InsertObjectMediaXml(
InsertObjectMediaRequest const& request) {
CurlRequestBuilder builder(xml_upload_endpoint_ + "/" +
request.bucket_name() + "/" +
UrlEscapeString(request.object_name()),
xml_upload_factory_);
auto status = SetupBuilderCommon(builder, "PUT");
if (not status.ok()) {
return std::make_pair(status, ObjectMetadata{});
}
builder.AddHeader("Host: storage.googleapis.com");
//
// Apply the options from InsertObjectMediaRequest that are set, translating
// to the XML format for them.
//
builder.AddOption(request.GetOption<ContentEncoding>());
// Set the content type of a sensible value, the application can override this
// in the options for the request.
if (not request.HasOption<ContentType>()) {
builder.AddHeader("content-type: application/octet-stream");
} else {
builder.AddOption(request.GetOption<ContentType>());
}
builder.AddOption(request.GetOption<EncryptionKey>());
if (request.HasOption<IfGenerationMatch>()) {
builder.AddHeader(
"x-goog-if-generation-match: " +
std::to_string(request.GetOption<IfGenerationMatch>().value()));
}
// IfGenerationNotMatch cannot be set, checked by the caller.
if (request.HasOption<IfMetagenerationMatch>()) {
builder.AddHeader(
"x-goog-if-meta-generation-match: " +
std::to_string(request.GetOption<IfMetagenerationMatch>().value()));
}
// IfMetagenerationNotMatch cannot be set, checked by the caller.
if (request.HasOption<KmsKeyName>()) {
builder.AddHeader("x-goog-encryption-kms-key-name: " +
request.GetOption<KmsKeyName>().value());
}
if (request.HasOption<MD5HashValue>()) {
builder.AddHeader("x-goog-hash: md5=" +
request.GetOption<MD5HashValue>().value());
} else if (not request.HasOption<DisableMD5Hash>()) {
builder.AddHeader("x-goog-hash: md5=" + ComputeMD5Hash(request.contents()));
}
if (request.HasOption<Crc32cChecksumValue>()) {
builder.AddHeader("x-goog-hash: crc32c=" +
request.GetOption<Crc32cChecksumValue>().value());
} else if (not request.HasOption<DisableCrc32cChecksum>()) {
builder.AddHeader("x-goog-hash: crc32c=" +
ComputeCrc32cChecksum(request.contents()));
}
if (request.HasOption<PredefinedAcl>()) {
builder.AddHeader(
"x-goog-acl: " +
XmlMapPredefinedAcl(request.GetOption<PredefinedAcl>().value()));
}
builder.AddOption(request.GetOption<UserProject>());
//
// Apply the options from GenericRequestBase<> that are set, translating
// to the XML format for them.
//
// Fields cannot be set, checked by the caller.
builder.AddOption(request.GetOption<CustomHeader>());
builder.AddOption(request.GetOption<IfMatchEtag>());
builder.AddOption(request.GetOption<IfNoneMatchEtag>());
// QuotaUser cannot be set, checked by the caller.
// UserIp cannot be set, checked by the caller.
builder.AddHeader("Content-Length: " +
std::to_string(request.contents().size()));
auto payload = builder.BuildRequest().MakeRequest(request.contents());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectMetadata{});
}
return std::make_pair(Status(),
ObjectMetadata::ParseFromJson(internal::nl::json{
{"name", request.object_name()},
{"bucket", request.bucket_name()},
}));
}
std::pair<Status, std::unique_ptr<ObjectReadStreambuf>>
CurlClient::ReadObjectXml(ReadObjectRangeRequest const& request) {
CurlRequestBuilder builder(xml_download_endpoint_ + "/" +
request.bucket_name() + "/" +
UrlEscapeString(request.object_name()),
xml_download_factory_);
auto status = SetupBuilderCommon(builder, "GET");
if (not status.ok()) {
return std::make_pair(status,
std::unique_ptr<ObjectReadStreambuf>(nullptr));
}
builder.AddHeader("Host: storage.googleapis.com");
//
// Apply the options from ReadObjectMediaRequest that are set, translating
// to the XML format for them.
//
builder.AddOption(request.GetOption<EncryptionKey>());
builder.AddOption(request.GetOption<Generation>());
if (request.HasOption<IfGenerationMatch>()) {
builder.AddHeader(
"x-goog-if-generation-match: " +
std::to_string(request.GetOption<IfGenerationMatch>().value()));
}
// IfGenerationNotMatch cannot be set, checked by the caller.
if (request.HasOption<IfMetagenerationMatch>()) {
builder.AddHeader(
"x-goog-if-meta-generation-match: " +
std::to_string(request.GetOption<IfMetagenerationMatch>().value()));
}
// IfMetagenerationNotMatch cannot be set, checked by the caller.
builder.AddOption(request.GetOption<UserProject>());
//
// Apply the options from GenericRequestBase<> that are set, translating
// to the XML format for them.
//
builder.AddOption(request.GetOption<CustomHeader>());
builder.AddOption(request.GetOption<IfMatchEtag>());
builder.AddOption(request.GetOption<IfNoneMatchEtag>());
// QuotaUser cannot be set, checked by the caller.
// UserIp cannot be set, checked by the caller.
std::unique_ptr<CurlReadStreambuf> buf(new CurlReadStreambuf(
builder.BuildDownloadRequest(std::string{}),
client_options().download_buffer_size(), CreateHashValidator(request)));
return std::make_pair(Status(),
std::unique_ptr<ObjectReadStreambuf>(std::move(buf)));
}
std::pair<Status, std::unique_ptr<ObjectWriteStreambuf>>
CurlClient::WriteObjectXml(InsertObjectStreamingRequest const& request) {
CurlRequestBuilder builder(xml_upload_endpoint_ + "/" +
request.bucket_name() + "/" +
UrlEscapeString(request.object_name()),
xml_upload_factory_);
auto status = SetupBuilderCommon(builder, "PUT");
if (not status.ok()) {
return std::make_pair(status,
std::unique_ptr<ObjectWriteStreambuf>(nullptr));
}
builder.AddHeader("Host: storage.googleapis.com");
//
// Apply the options from InsertObjectMediaRequest that are set, translating
// to the XML format for them.
//
builder.AddOption(request.GetOption<ContentEncoding>());
// Set the content type of a sensible value, the application can override this
// in the options for the request.
if (not request.HasOption<ContentType>()) {
builder.AddHeader("content-type: application/octet-stream");
} else {
builder.AddOption(request.GetOption<ContentType>());
}
builder.AddOption(request.GetOption<EncryptionKey>());
if (request.HasOption<IfGenerationMatch>()) {
builder.AddHeader(
"x-goog-if-generation-match: " +
std::to_string(request.GetOption<IfGenerationMatch>().value()));
}
// IfGenerationNotMatch cannot be set, checked by the caller.
if (request.HasOption<IfMetagenerationMatch>()) {
builder.AddHeader(
"x-goog-if-meta-generation-match: " +
std::to_string(request.GetOption<IfMetagenerationMatch>().value()));
}
// IfMetagenerationNotMatch cannot be set, checked by the caller.
if (request.HasOption<KmsKeyName>()) {
builder.AddHeader("x-goog-encryption-kms-key-name: " +
request.GetOption<KmsKeyName>().value());
}
if (request.HasOption<PredefinedAcl>()) {
builder.AddHeader(
"x-goog-acl: " +
XmlMapPredefinedAcl(request.GetOption<PredefinedAcl>().value()));
}
builder.AddOption(request.GetOption<UserProject>());
//
// Apply the options from GenericRequestBase<> that are set, translating
// to the XML format for them.
//
// Fields cannot be set, checked by the caller.
builder.AddOption(request.GetOption<CustomHeader>());
builder.AddOption(request.GetOption<IfMatchEtag>());
builder.AddOption(request.GetOption<IfNoneMatchEtag>());
// QuotaUser cannot be set, checked by the caller.
// UserIp cannot be set, checked by the caller.
std::unique_ptr<internal::CurlWriteStreambuf> buf(
new internal::CurlWriteStreambuf(builder.BuildUpload(),
client_options().upload_buffer_size(),
CreateHashValidator(request)));
return std::make_pair(
Status(),
std::unique_ptr<internal::ObjectWriteStreambuf>(std::move(buf)));
}
std::pair<Status, ObjectMetadata> CurlClient::InsertObjectMediaMultipart(
InsertObjectMediaRequest const& request) {
// To perform a multipart upload we need to separate the parts using:
// https://cloud.google.com/storage/docs/json_api/v1/how-tos/multipart-upload
// This function is structured as follows:
// 1. Create a request object, as we often do.
CurlRequestBuilder builder(
upload_endpoint_ + "/b/" + request.bucket_name() + "/o", upload_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, ObjectMetadata{});
}
// 2. Pick a separator that does not conflict with the request contents.
auto boundary = PickBoundary(request.contents());
builder.AddHeader("content-type: multipart/related; boundary=" + boundary);
builder.AddQueryParameter("uploadType", "multipart");
builder.AddQueryParameter("name", request.object_name());
// 3. Perform a streaming upload because computing the size upfront is more
// complicated than it is worth.
std::unique_ptr<internal::CurlWriteStreambuf> buf(
new internal::CurlWriteStreambuf(builder.BuildUpload(),
client_options().upload_buffer_size(),
CreateHashValidator(request)));
ObjectWriteStream writer(std::move(buf));
nl::json metadata = nl::json::object();
if (request.HasOption<WithObjectMetadata>()) {
metadata = request.GetOption<WithObjectMetadata>().value().JsonForUpdate();
}
if (request.HasOption<MD5HashValue>()) {
metadata["md5Hash"] = request.GetOption<MD5HashValue>().value();
} else {
metadata["md5Hash"] = ComputeMD5Hash(request.contents());
}
if (request.HasOption<Crc32cChecksumValue>()) {
metadata["crc32c"] = request.GetOption<Crc32cChecksumValue>().value();
} else {
metadata["crc32c"] = ComputeCrc32cChecksum(request.contents());
}
std::string crlf = "\r\n";
std::string marker = "--" + boundary;
// 4. Format the first part, including the separators and the headers.
writer << marker << crlf << "content-type: application/json; charset=UTF-8"
<< crlf << crlf << metadata.dump() << crlf << marker << crlf;
// 5. Format the second part, which includes all the contents and a final
// separator.
if (request.HasOption<ContentType>()) {
writer << "content-type: " << request.GetOption<ContentType>().value()
<< crlf;
} else if (metadata.count("contentType") != 0) {
writer << "content-type: "
<< metadata.value("contentType", "application/octet-stream") << crlf;
} else {
writer << "content-type: application/octet-stream" << crlf;
}
writer << crlf << request.contents() << crlf << marker << "--" << crlf;
// 6. Return the results as usual.
auto payload = writer.CloseRaw();
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectMetadata{});
}
return std::make_pair(Status(),
ObjectMetadata::ParseFromString(payload.payload));
}
std::string CurlClient::PickBoundary(std::string const& text_to_avoid) {
// We need to find a string that is *not* found in `text_to_avoid`, we pick
// a string at random, and see if it is in `text_to_avoid`, if it is, we grow
// the string with random characters and start from where we last found a
// the candidate. Eventually we will find something, though it might be
// larger than `text_to_avoid`. And we only make (approximately) one pass
// over `text_to_avoid`.
auto generate_candidate = [this](int n) {
static std::string const chars =
"abcdefghijklmnopqrstuvwxyz012456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
std::unique_lock<std::mutex> lk(mu_);
return google::cloud::internal::Sample(generator_, n, chars);
};
constexpr int INITIAL_CANDIDATE_SIZE = 16;
constexpr int CANDIDATE_GROWTH_SIZE = 4;
return GenerateMessageBoundary(text_to_avoid, std::move(generate_candidate),
INITIAL_CANDIDATE_SIZE, CANDIDATE_GROWTH_SIZE);
}
std::pair<Status, ObjectMetadata> CurlClient::InsertObjectMediaSimple(
InsertObjectMediaRequest const& request) {
CurlRequestBuilder builder(
upload_endpoint_ + "/b/" + request.bucket_name() + "/o", upload_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status, ObjectMetadata{});
}
// Set the content type of a sensible value, the application can override this
// in the options for the request.
if (not request.HasOption<ContentType>()) {
builder.AddHeader("content-type: application/octet-stream");
}
builder.AddQueryParameter("uploadType", "media");
builder.AddQueryParameter("name", request.object_name());
builder.AddHeader("Content-Length: " +
std::to_string(request.contents().size()));
auto payload = builder.BuildRequest().MakeRequest(request.contents());
if (payload.status_code >= 300) {
return std::make_pair(
Status{payload.status_code, std::move(payload.payload)},
ObjectMetadata{});
}
return std::make_pair(Status(),
ObjectMetadata::ParseFromString(payload.payload));
}
std::pair<Status, std::unique_ptr<ObjectWriteStreambuf>>
CurlClient::WriteObjectSimple(InsertObjectStreamingRequest const& request) {
auto url = upload_endpoint_ + "/b/" + request.bucket_name() + "/o";
CurlRequestBuilder builder(url, upload_factory_);
auto status = SetupBuilder(builder, request, "POST");
if (not status.ok()) {
return std::make_pair(status,
std::unique_ptr<ObjectWriteStreambuf>(nullptr));
}
// Set the content type of a sensible value, the application can override this
// in the options for the request.
if (not request.HasOption<ContentType>()) {
builder.AddHeader("content-type: application/octet-stream");
}
builder.AddQueryParameter("uploadType", "media");
builder.AddQueryParameter("name", request.object_name());
std::unique_ptr<internal::CurlWriteStreambuf> buf(
new internal::CurlWriteStreambuf(builder.BuildUpload(),
client_options().upload_buffer_size(),
CreateHashValidator(request)));
return std::make_pair(
Status(),
std::unique_ptr<internal::ObjectWriteStreambuf>(std::move(buf)));
}
std::pair<Status, std::unique_ptr<ObjectWriteStreambuf>>
CurlClient::WriteObjectResumable(InsertObjectStreamingRequest const& request) {
auto session = CreateResumableSessionGeneric(request);
if (not session.first.ok()) {
return std::make_pair(std::move(session.first),
std::unique_ptr<ObjectWriteStreambuf>(nullptr));
}
auto buf =
google::cloud::internal::make_unique<internal::CurlResumableStreambuf>(
std::move(session.second), client_options().upload_buffer_size(),
CreateHashValidator(request));
return std::make_pair(
Status(),
std::unique_ptr<internal::ObjectWriteStreambuf>(std::move(buf)));
}
std::pair<Status, std::string> CurlClient::AuthorizationHeader(
std::shared_ptr<google::cloud::storage::oauth2::Credentials> const&
credentials) {
return credentials->AuthorizationHeader();
}
} // namespace internal
} // namespace STORAGE_CLIENT_NS
} // namespace storage
} // namespace cloud
} // namespace google
| [
"noreply@github.com"
] | noreply@github.com |
6bdc1446a8b90a33b7a5db680accdf432aace36d | c3a0f82e6d0fb3e8fb49afc042560e5787e42141 | /codeforces/1061/B.cpp | 208dd3f83cbaa933555bba65bbc8515146d7297a | [] | no_license | SahajGupta11/Codeforces-submissions | 04abcd8b0632e7cdd2748d8b475eed152d00ed1b | 632f87705ebe421f954a59d99428e7009d021db1 | refs/heads/master | 2023-02-05T08:06:53.500395 | 2019-09-18T16:16:00 | 2020-12-22T14:32:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 632 | cpp | #include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
#define INF 2000000000 //2e9
#define min(a,b) (a<b?a:b)
const int N = 1e5 + 5;
int a[N];
int32_t main() {
IOS;
int i, n, m, mx = INF;
int64_t ans = 0;
cin >> n >> m;
for(i = 0; i < n; i++)
cin >> a[i];
sort(a, a+n, greater<int>());
for(i = 0; i < n; i++) {
if (mx == 1) {
ans += a[i]-1;
continue;
}
if (a[i] >= mx) ans += a[i]-mx+1, a[i] = mx-1;
ans += min(a[i+1], a[i]-1);
mx = a[i];
}
cout << ans;
return 0;
} | [
"ghriday.bits@gmail.com"
] | ghriday.bits@gmail.com |
030bbdee088e772fc380c21937c36da846c3b10d | 675fd58eaaec4bf7834bd2487c304b39d2cccb2d | /src/tools.cpp | 2596f8468639666f88c0bf323b8f1aef6b5554a3 | [] | no_license | zengzhi2015/CarND_Exended_Lalman_FIlter_Project | f026228dd8e619ac41e539f90f3b4fb7cf2419b9 | 0941ecbd506e7362d4ce283fb0ad67809a1c61c4 | refs/heads/master | 2021-01-19T20:05:54.533278 | 2017-04-17T08:25:44 | 2017-04-17T08:25:44 | 88,485,287 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,723 | cpp | #include <iostream>
#include "tools.h"
using namespace std;
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/**
TODO:
* Calculate the RMSE here.
*/
// check the validity of the following inputs:
// * the estimation vector size should not be zero
// * the estimation vector size should equal ground truth vector size
VectorXd rmse(4);
rmse << 0,0,0,0;
if(estimations.size() != ground_truth.size()
|| estimations.size() == 0){
cout << "Invalid estimation or ground_truth data" << endl;
return rmse;
}
//accumulate squared residuals
for(unsigned int i=0; i < estimations.size(); ++i){
VectorXd residual = estimations[i] - ground_truth[i];
//coefficient-wise multiplication
residual = residual.array()*residual.array();
rmse += residual;
}
//calculate the mean
rmse = rmse/estimations.size();
//calculate the squared root
rmse = rmse.array().sqrt();
//return the result
return rmse;
}
VectorXd Tools::CalculateStates(const MeasurementPackage &measurement_pack) {
float rho = measurement_pack.raw_measurements_[0];
float phi = measurement_pack.raw_measurements_[1];
float rhodot = measurement_pack.raw_measurements_[2];
VectorXd x(4);
x << rho*cos(phi),rho*sin(phi),rhodot*cos(phi),rhodot*sin(phi);
return x;
}
MatrixXd Tools::CalculateObservation(const Eigen::VectorXd &x_state) {
VectorXd hx(3);
//recover state parameters
float px = x_state(0);
float py = x_state(1);
float vx = x_state(2);
float vy = x_state(3);
//TODO: YOUR CODE HERE
//pre-compute a set of terms to avoid repeated calculation
float c1 = px*px+py*py;
float c2 = sqrt(c1);
float c3;
if(fabs(px) < 0.0001){
c3 = 3.1415926/2;
}
else{
c3 = atan(py/px);
}
float c4 = px*vx+py*vy;
float c5 = vx*vx + vy*vy;
float c6;
if(fabs(c1) < 0.0001){
c6 = sqrt(c5);
}
else{
c6 = c4/c2;
}
hx << c2,c3,c6;
return hx;
}
MatrixXd Tools::CalculateJacobian(const VectorXd& x_state) {
/**
TODO:
* Calculate a Jacobian here.
*/
MatrixXd Hj(3,4);
//recover state parameters
float px = x_state(0);
float py = x_state(1);
float vx = x_state(2);
float vy = x_state(3);
//TODO: YOUR CODE HERE
//pre-compute a set of terms to avoid repeated calculation
float c1 = px*px+py*py;
float c2 = sqrt(c1);
float c3 = (c1*c2);
//check division by zero
if(fabs(c1) < 0.0001){
//return the null Jacobian matrix
Hj << 0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0;
}
else{
//compute the Jacobian matrix
Hj << (px/c2), (py/c2), 0, 0,
-(py/c1), (px/c1), 0, 0,
py*(vx*py - vy*px)/c3, px*(px*vy - py*vx)/c3, px/c2, py/c2;
}
return Hj;
}
MatrixXd Tools::CalculateF(float dt) {
MatrixXd F(4,4);
F << 1, 0, dt, 0,
0, 1, 0, dt,
0, 0, 1, 0,
0, 0, 0, 1;
return F;
}
MatrixXd Tools::CalculateQ(float dt, float noise_ax, float noise_ay) {
float dt_2 = dt * dt;
float dt_3 = dt_2 * dt;
float dt_4 = dt_3 * dt;
//set the process covariance matrix Q
MatrixXd Q(4, 4);
Q << dt_4/4*noise_ax, 0, dt_3/2*noise_ax, 0,
0, dt_4/4*noise_ay, 0, dt_3/2*noise_ay,
dt_3/2*noise_ax, 0, dt_2*noise_ax, 0,
0, dt_3/2*noise_ay, 0, dt_2*noise_ay;
return Q;
}
| [
"zengzhi_2012@hotmail.com"
] | zengzhi_2012@hotmail.com |
8698a988e97c58596c3a04999de60385da10bec7 | bb62c6e70b7b536e658f2c045e224735fb2e9532 | /src/engine/audio/src/audio_filter_biquad.cpp | 7d7359e98c4732ba5eaf55007407f2295d57450a | [
"Apache-2.0"
] | permissive | kariem2k/halley | b66173ef200e9b3479c433f6fd89f2e0a54f585f | 6f2d09b06e49ec22ffc1457b7eda6bcd888b796d | refs/heads/master | 2020-09-20T14:32:06.167665 | 2019-11-28T12:13:37 | 2019-11-28T12:15:19 | 224,511,194 | 1 | 0 | Apache-2.0 | 2019-11-27T20:23:35 | 2019-11-27T20:23:35 | null | UTF-8 | C++ | false | false | 457 | cpp | #include "audio_filter_biquad.h"
using namespace Halley;
AudioFilterBiquad::AudioFilterBiquad(std::shared_ptr<AudioSource> src)
: src(std::move(src))
{
}
size_t AudioFilterBiquad::getNumberOfChannels() const
{
return src->getNumberOfChannels();
}
bool AudioFilterBiquad::isReady() const
{
return src->isReady();
}
bool AudioFilterBiquad::getAudioData(size_t numSamples, AudioSourceData& dst)
{
// TODO
return src->getAudioData(numSamples, dst);
}
| [
"archmagezeratul@gmail.com"
] | archmagezeratul@gmail.com |
d1fc8a1a3fd795348dc7c039915adcd008321e18 | 047600ca8efa01dd308f4549793db97e6ddcec20 | /Src/HLSDK/vgui2/Border.cpp | b3966d1fc95ce24df852be265646e7d2b85d5df5 | [] | no_license | crskycode/Mind-Team | cbb9e98322701a5d437fc9823dd4c296a132330f | ceab21c20b0b51a2652c02c04eb7ae353b82ffd0 | refs/heads/main | 2023-03-16T10:34:31.812155 | 2021-03-02T02:23:40 | 2021-03-02T02:23:40 | 343,616,799 | 6 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 7,890 | cpp | //========= Copyright ?1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include <stdio.h>
#include <string.h>
#include "vgui/IPanel.h"
#include "vgui/IScheme.h"
#include "vgui/ISurface.h"
#include "vgui_border.h"
#include "vgui_internal.h"
#include "KeyValues.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
using namespace vgui;
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
Border::Border()
{
_inset[0]=0;
_inset[1]=0;
_inset[2]=0;
_inset[3]=0;
_name = NULL;
m_eBackgroundType = IBorder::BACKGROUND_FILLED;
memset(_sides, 0, sizeof(_sides));
}
//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
Border::~Border()
{
delete [] _name;
for (int i = 0; i < 4; i++)
{
delete [] _sides[i].lines;
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void Border::SetInset(int left,int top,int right,int bottom)
{
_inset[SIDE_LEFT] = left;
_inset[SIDE_TOP] = top;
_inset[SIDE_RIGHT] = right;
_inset[SIDE_BOTTOM] = bottom;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void Border::GetInset(int& left,int& top,int& right,int& bottom)
{
left = _inset[SIDE_LEFT];
top = _inset[SIDE_TOP];
right = _inset[SIDE_RIGHT];
bottom = _inset[SIDE_BOTTOM];
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void Border::Paint(int x, int y, int wide, int tall)
{
Paint(x, y, wide, tall, -1, 0, 0);
}
//-----------------------------------------------------------------------------
// Purpose: Draws the border with the specified size
//-----------------------------------------------------------------------------
void Border::Paint(int x, int y, int wide, int tall, int breakSide, int breakStart, int breakEnd)
{
// iterate through and draw all lines
// draw left
int i;
for (i = 0; i < _sides[SIDE_LEFT].count; i++)
{
line_t *line = &(_sides[SIDE_LEFT].lines[i]);
g_pSurface->DrawSetColor(line->col[0], line->col[1], line->col[2], line->col[3]);
if (breakSide == SIDE_LEFT)
{
// split into two section
if (breakStart > 0)
{
// draw before the break Start
g_pSurface->DrawFilledRect(x + i, y + line->startOffset, x + i + 1, y + breakStart);
}
if (breakEnd < (tall - line->endOffset))
{
// draw after break end
g_pSurface->DrawFilledRect(x + i, y + breakEnd + 1, x + i + 1, tall - line->endOffset);
}
}
else
{
g_pSurface->DrawFilledRect(x + i, y + line->startOffset, x + i + 1, tall - line->endOffset);
}
}
// draw top
for (i = 0; i < _sides[SIDE_TOP].count; i++)
{
line_t *line = &(_sides[SIDE_TOP].lines[i]);
g_pSurface->DrawSetColor(line->col[0], line->col[1], line->col[2], line->col[3]);
if (breakSide == SIDE_TOP)
{
// split into two section
if (breakStart > 0)
{
// draw before the break Start
g_pSurface->DrawFilledRect(x + line->startOffset, y + i, x + breakStart, y + i + 1);
}
if (breakEnd < (wide - line->endOffset))
{
// draw after break end
g_pSurface->DrawFilledRect(x + breakEnd + 1, y + i, wide - line->endOffset, y + i + 1);
}
}
else
{
g_pSurface->DrawFilledRect(x + line->startOffset, y + i, wide - line->endOffset, y + i + 1);
}
}
// draw right
for (i = 0; i < _sides[SIDE_RIGHT].count; i++)
{
line_t *line = &(_sides[SIDE_RIGHT].lines[i]);
g_pSurface->DrawSetColor(line->col[0], line->col[1], line->col[2], line->col[3]);
g_pSurface->DrawFilledRect(wide - (i+1), y + line->startOffset, (wide - (i+1)) + 1, tall - line->endOffset);
}
// draw bottom
for (i = 0; i < _sides[SIDE_BOTTOM].count; i++)
{
line_t *line = &(_sides[SIDE_BOTTOM].lines[i]);
g_pSurface->DrawSetColor(line->col[0], line->col[1], line->col[2], line->col[3]);
g_pSurface->DrawFilledRect(x + line->startOffset, tall - (i+1), wide - line->endOffset, (tall - (i+1)) + 1);
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void Border::Paint(VPANEL panel)
{
// get panel size
int wide, tall;
g_pIPanel->GetSize(panel, wide, tall);
Paint(0, 0, wide, tall, -1, 0, 0);
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void Border::ApplySchemeSettings(IScheme *pScheme, KeyValues *inResourceData)
{
// load inset information
const char *insetString = inResourceData->GetString("inset", "0 0 0 0");
int left, top, right, bottom;
GetInset(left, top, right, bottom);
sscanf(insetString, "%d %d %d %d", &left, &top, &right, &bottom);
SetInset(left, top, right, bottom);
// get the border information from the scheme
ParseSideSettings(SIDE_LEFT, inResourceData->FindKey("Left"),pScheme);
ParseSideSettings(SIDE_TOP, inResourceData->FindKey("Top"),pScheme);
ParseSideSettings(SIDE_RIGHT, inResourceData->FindKey("Right"),pScheme);
ParseSideSettings(SIDE_BOTTOM, inResourceData->FindKey("Bottom"),pScheme);
m_eBackgroundType = (backgroundtype_e)inResourceData->GetInt("backgroundtype");
}
//-----------------------------------------------------------------------------
// Purpose: parses scheme data
//-----------------------------------------------------------------------------
void Border::ParseSideSettings(int side_index, KeyValues *inResourceData, IScheme *pScheme)
{
if (!inResourceData)
return;
// count the numeber of lines in the side
int count = 0;
KeyValues *kv;
for (kv = inResourceData->GetFirstSubKey(); kv != NULL; kv = kv->GetNextKey())
{
count++;
}
// allocate memory
_sides[side_index].count = count;
_sides[side_index].lines = new line_t[count];
// iterate through the keys
//!! this loads in order, ignoring key names
int index = 0;
for (kv = inResourceData->GetFirstSubKey(); kv != NULL; kv = kv->GetNextKey())
{
line_t *line = &(_sides[side_index].lines[index]);
// this is the color name, get that from the color table
const char *col = kv->GetString("color", NULL);
line->col = pScheme->GetColor(col, Color(0, 0, 0, 0));
col = kv->GetString("offset", NULL);
int Start = 0, end = 0;
if (col)
{
sscanf(col, "%d %d", &Start, &end);
}
line->startOffset = Start;
line->endOffset = end;
index++;
}
}
//-----------------------------------------------------------------------------
// Purpose: data accessor
//-----------------------------------------------------------------------------
const char *Border::GetName()
{
if (_name)
return _name;
return "";
}
//-----------------------------------------------------------------------------
// Purpose: data accessor
//-----------------------------------------------------------------------------
void Border::SetName(const char *name)
{
if (_name)
{
delete [] _name;
}
int len = Q_strlen(name) + 1;
_name = new char[ len ];
Q_strncpy( _name, name, len );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
IBorder::backgroundtype_e Border::GetBackgroundType()
{
return m_eBackgroundType;
}
| [
"crskycode@hotmail.com"
] | crskycode@hotmail.com |
f0ff5851ae45e12dc52c5b3166a91e2fd858af08 | 1eb2187c4428fbaa54f5a7f045884c9310d9fe35 | /file-server/asio/detail/posix_signal_blocker.hpp | f22c1daece03d37883f592a94089a9b406295193 | [] | no_license | AlaskaJoslin/client-server | abed4cda6944517c7240c3a9b826cf27b9753535 | afacaf68a69b20f3a41386476d66a8d29cb2308c | refs/heads/master | 2021-01-23T05:18:24.650747 | 2017-04-02T22:46:18 | 2017-04-02T22:46:18 | 86,293,725 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,862 | hpp | //
// detail/posix_signal_blocker.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP
#define ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "detail/config.hpp"
#if defined(ASIO_HAS_PTHREADS)
#include <csignal>
#include <pthread.h>
#include <signal.h>
#include "detail/noncopyable.hpp"
#include "detail/push_options.hpp"
namespace asio {
namespace detail {
class posix_signal_blocker
: private noncopyable
{
public:
// Constructor blocks all signals for the calling thread.
posix_signal_blocker()
: blocked_(false)
{
sigset_t new_mask;
sigfillset(&new_mask);
blocked_ = (pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask_) == 0);
}
// Destructor restores the previous signal mask.
~posix_signal_blocker()
{
if (blocked_)
pthread_sigmask(SIG_SETMASK, &old_mask_, 0);
}
// Block all signals for the calling thread.
void block()
{
if (!blocked_)
{
sigset_t new_mask;
sigfillset(&new_mask);
blocked_ = (pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask_) == 0);
}
}
// Restore the previous signal mask.
void unblock()
{
if (blocked_)
blocked_ = (pthread_sigmask(SIG_SETMASK, &old_mask_, 0) != 0);
}
private:
// Have signals been blocked.
bool blocked_;
// The previous signal mask.
sigset_t old_mask_;
};
} // namespace detail
} // namespace asio
#include "detail/pop_options.hpp"
#endif // defined(ASIO_HAS_PTHREADS)
#endif // ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP
| [
"mlj.eagle@gmail.com"
] | mlj.eagle@gmail.com |
2fa92add60fa3fe7fd0ebef2e52958617c3c5df4 | 98ad07c482801ebbbdbd53af8680dc6026762b79 | /src/country.cpp | f9f41dad47095dd0221f4f5e3800fabbda26cf2b | [] | no_license | jelkink/democratic-diffusion | a3912e6a1b67c89de721ba8890ff3535e8fc9b8c | 881716422f568e67dc5d31655c237a123407f298 | refs/heads/main | 2023-03-25T23:08:24.340604 | 2021-03-24T09:18:32 | 2021-03-24T09:18:32 | 351,012,856 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,748 | cpp | #include "country.h"
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "province.h"
#include "model.h"
#include "uniform.h"
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)>(b)?(b):(a))
using std::find;
using std::cout;
using std::endl;
using std::left;
using std::right;
using std::setw;
CCountry::CCountry(CModel* p_pModel, CProvince* p_pProvince)
: m_bOriginalRegime(true),
m_nDelay(0),
m_nLastRevolution(0),
m_nRegimeAge(0),
m_dCoupChance(0),
m_nCoupCount(0),
m_nRevolutionCount(0),
m_pModel(p_pModel)
{
// Countries are created by the province which becomes the capital
m_vProvinces.push_back(p_pProvince);
m_pCapital = p_pProvince;
m_nID = p_pProvince->GetID();
m_nIsolation = p_pModel->GetIsolationNormal().GetNextIntFromTo(0,100);
m_bDemocracy = CUniform::GetBoolean(p_pModel->
GetInitialProportionDemocratic());
}
CCountry::~CCountry()
{
}
void CCountry::UpdateIsolation()
{
if (m_bDemocracy)
m_nIsolation = 0;
else
{
m_nIsolation = m_nIsolation + CUniform::GetNextIntFromTo(-1,1);
m_nIsolation = MAX(0,MIN(100,m_nIsolation));
}
}
void CCountry::TestRevolution()
{
m_nRegimeAge++;
if (m_pModel->UseDecay() && !m_bOriginalRegime)
{
m_dCoupChance = m_pModel->GetDecayStart()
* exp(m_pModel->GetDecayStrength()
* m_nRegimeAge);
m_dCoupChance = MAX(m_dCoupChance,
m_pModel->GetRandomRevolutionChance());
}
else
m_dCoupChance = m_pModel->GetRandomRevolutionChance();
bool bChange = false;
if (m_pCapital->AllProtesting() && !m_nDelay)
{
bChange = true;
m_pModel->AddRevolution(false);
m_nLastRevolution = 1;
m_nRevolutionCount++;
}
else if (CUniform::GetBoolean(m_dCoupChance))
{
bChange = true;
m_pModel->AddRevolution(true);
m_nLastRevolution = 2;
m_nCoupCount++;
}
if (bChange)
{
int i;
m_bDemocracy = !m_bDemocracy;
for (i = 0; i < m_vCitizens.size(); ++i)
m_vCitizens[i]->SetProtesting(false);
m_nDelay = m_pModel->GetRegimeDelay();
m_bOriginalRegime = false;
m_nRegimeAge = 0;
}
if (m_nDelay)
--m_nDelay;
}
CProvince& CCountry::GetCapital()
{
return *m_pCapital;
}
void CCountry::SetCapital(CProvince& p_Capital)
{
m_pCapital = &p_Capital;
}
void CCountry::Conquer(CProvince& p_Province)
{
// If the province to be conquered is not already part of this country
// and the country of the province would still be connected after conquering
// then set the country of the province to the this one
// and add the province to this country's provinces
if (p_Province.GetCountry().GetID() != m_nID
&& p_Province.GetCountry().CheckConnectednessWithoutProvince(p_Province))
{
if (p_Province.GetCountry().GetProvinces().size() == 1)
delete &p_Province.GetCountry();
p_Province.SetCountry(this);
m_vProvinces.push_back(&p_Province);
}
}
void CCountry::RemoveProvince(CProvince* p_pProvince)
{
vector<CProvince*>::iterator iter;
// Find this province and remove it
iter = find(m_vProvinces.begin(), m_vProvinces.end(), p_pProvince);
if (iter != m_vProvinces.end())
m_vProvinces.erase(iter);
// If the province to be removed is the capital, and there are other
// provinces left, set a new, random capital
if (m_pCapital == p_pProvince && m_vProvinces.size())
m_pCapital = m_vProvinces[rand() % m_vProvinces.size()];
}
bool CCountry::CheckConnectednessWithoutProvince(CProvince& p_RemovedProvince)
{
vector<int> vCheckedProvinces;
// If this is the only province in the country, no further checking needed
if (IsAtom())
return true;
// Recursively find out whether provinces remaining are still connected
CheckCWPRecursive(*m_pCapital, p_RemovedProvince, vCheckedProvinces);
return vCheckedProvinces.size() == m_vProvinces.size() - 1;
}
void CCountry::CheckCWPRecursive(CProvince& p_CurrentProvince,
CProvince& p_RemovedProvince,
vector<int>& p_vCheckedProvinces)
{
int k, nCurrentID;
nCurrentID = p_CurrentProvince.GetID();
// If the current province is a compatriot of the capital
// and it is not the province to be removed
// and it is not among the provinces already checked
// then add to provinces checked
// and check all four neighbouring provinces
if (m_pCapital->IsCompatriot(p_CurrentProvince)
&& nCurrentID != p_RemovedProvince.GetID()
&& find(p_vCheckedProvinces.begin(), p_vCheckedProvinces.end(),
nCurrentID) == p_vCheckedProvinces.end())
{
p_vCheckedProvinces.push_back(nCurrentID);
// Check all four neighbouring provinces, unless all provinces of
// this country have already been checked
for (k = 0;
k < 4 && p_vCheckedProvinces.size() < m_vProvinces.size() - 1;
++k)
CheckCWPRecursive(p_CurrentProvince.GetNeighbour(k),
p_RemovedProvince, p_vCheckedProvinces);
}
}
int CCountry::GetPopulation()
{
int i, s = 0;
for (i = 0; i < m_vProvinces.size(); ++i)
s += m_vProvinces[i]->GetCitizens().size();
return s;
}
int CCountry::GetProtesting()
{
int i, s = 0;
for (i = 0; i < m_vCitizens.size(); ++i)
s += (int) m_vCitizens[i]->IsProtesting();
return s;
}
int CCountry::GetAvgAttitude()
{
int i, s = 0;
for (i = 0; i < m_vCitizens.size(); ++i)
s += m_vCitizens[i]->GetAttitude();
return (int) round((double) s / (double) m_vCitizens.size());
}
| [
"jos.elkink@ucd.ie"
] | jos.elkink@ucd.ie |
c6fd27e314f0f784547b1ab32f049993cb3e9f1e | f8ef370d3913b012a95b60fa2a09c3bd36126295 | /cylinder_segmentation/src/cylinder_segmentation.cpp | 52a195f3506d98925b4759714f09dba43cb741c9 | [] | no_license | yiyinglai/cylinder_segmentation | 6a95a1e68b231ad0eabe332f9ea02860b0163927 | eb3d9d13b4056bf240ce2e228af67980979e6483 | refs/heads/master | 2022-12-01T23:14:50.133138 | 2020-08-14T16:43:16 | 2020-08-14T16:43:16 | 287,579,954 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,439 | cpp | #include <pcl/ModelCoefficients.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/passthrough.h>
#include <pcl/features/normal_3d.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/visualization/common/shapes.h>
#include <Eigen/Dense>
int
main (int argc, char** argv)
{
// Read in the cloud data
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_f (new pcl::PointCloud<pcl::PointXYZRGB>);
std::string file_name = "cluster_0.pcd";
if (pcl::io::loadPCDFile<pcl::PointXYZRGB> ("/home/yiying/pcl/pcd/" + file_name, *cloud) == -1) //* load the file
{
PCL_ERROR ("Couldn't read file /home/yiying/pcl/pcd/", file_name, "\n");
return (-1);
}
std::cout << "PointCloud before filtering has: " << cloud->points.size () << " data points." << std::endl; //*
// Objects needed
pcl::NormalEstimation<pcl::PointXYZRGB, pcl::Normal> ne;
pcl::SACSegmentationFromNormals<pcl::PointXYZRGB, pcl::Normal> seg;
// pcl::ExtractIndices<pcl::PointXYZRGB> extract;
// pcl::ExtractIndices<pcl::Normal> extract_normals;
pcl::search::KdTree<pcl::PointXYZRGB>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZRGB> ());
// Datasets
pcl::PointCloud<pcl::Normal>::Ptr cloud_normals (new pcl::PointCloud<pcl::Normal>);
pcl::ModelCoefficients::Ptr coefficients_cylinder (new pcl::ModelCoefficients);
pcl::PointIndices::Ptr inliers_cylinder (new pcl::PointIndices);
// Estimate point normals
ne.setSearchMethod (tree);
ne.setInputCloud (cloud);
ne.setKSearch (50);
ne.compute (*cloud_normals);
// Create the segmentation object for cylinder segmentation and set all the parameters
seg.setOptimizeCoefficients (true);
seg.setModelType (pcl::SACMODEL_CYLINDER);
seg.setMethodType (pcl::SAC_RANSAC);
seg.setNormalDistanceWeight (0.1);
seg.setMaxIterations (10000);
seg.setDistanceThreshold (0.05);
seg.setRadiusLimits (0, 0.1);
seg.setInputCloud (cloud);
seg.setInputNormals (cloud_normals);
Eigen::Vector3f ax;
ax << 0, 0, 1;
seg.setAxis(ax);
// Obtain the cylinder inliers and coefficients
seg.segment (*inliers_cylinder, *coefficients_cylinder);
std::cerr << "Cylinder coefficients: " << *coefficients_cylinder << std::endl;
}
| [
"noreply@github.com"
] | noreply@github.com |
e19a217f28b06ea0ee825995a3205f65c336fd28 | 6427bab1537bb24cb02ac4aee7843f2f5c55fa03 | /checks/argChecker.cpp | 746f9d1d713e66a4604def9c5b8b2a7994fa8667 | [] | no_license | HerrNilsen-K/Image-viewer | 33a036b8b26b48c44d9d663ce9edcd9747137e5f | 4ffb087a1a183bc5497bdbce0ad05a50175ec600 | refs/heads/master | 2023-01-05T09:17:31.020917 | 2020-10-29T20:02:39 | 2020-10-29T20:02:39 | 305,733,264 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 698 | cpp | #include <iostream>
#include <string>
namespace IViewer
{
bool checkArgs(int argc, int inputNumber, bool printError = false)
{
try
{
if (argc != 2)
{
if (argc == 1)
{
throw std::string("Error: No input\n");
}
else if (argc > inputNumber)
{
throw std::string("Error: Too many inputs\n");
}
}
}
catch (std::string e)
{
if (printError)
std::cout << e;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
} // namespace IViewer | [
"typnilsen@gmail.com"
] | typnilsen@gmail.com |
bc1e8352e15d2d82bd37d0bdc5f348760f291549 | 6bc307fe35f3306b18a6afccd5f889b3200cd155 | /mainwindow.h | 2249102610dbf119a6e323d451d3d1107c8b6e3d | [] | no_license | Yin-Jui/Sudoku | 2b847d586ca2c4e89a72d63f837fafe304b4f053 | 944814893bdd1722c3fb4b2658a845bcb7e89c83 | refs/heads/master | 2021-06-30T12:21:55.419799 | 2020-09-11T16:53:36 | 2020-09-11T16:53:36 | 152,833,370 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,421 | h | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include<vector>
#include"finisht.h"
#include"delegate.h"
#include<QTimer>
#include<QLCDNumber>
using namespace std;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
bool isCorrect();
bool checkUnity(int arr[]);
bool FindUnassignedLocation( int &row, int &col);
bool isSafe( int row, int col, int num);
bool SolveSudoku();
bool UsedInRow(int row, int num);
bool UsedInCol(int col, int num);
bool UsedInBox(int boxStartRow, int boxStartCol, int num);
bool random();
public slots:
void timer();
private slots:
void on_tableWidget_cellChanged(int row, int column);
void on_checkBox_clicked(bool checked);
void on_manual_clicked();
void on_start_clicked();
void on_restart_clicked();
bool on_random_clicked();
void on_check_clicked();
void on_solve_clicked();
void on_easy_clicked(bool checked);
void on_medium_clicked(bool checked);
void on_hard_clicked(bool checked);
private:
Ui::MainWindow *ui;
vector<int> user;
vector< vector<int> > user_sudoku;
finisht *f;
Delegate *d;
QTimer *timee;
QLCDNumber *l;
QString text;
bool easymode;
bool mediummode;
bool hardmode;
};
#endif // MAINWINDOW_H
| [
"e34042054@mail.ncku.edu.tw"
] | e34042054@mail.ncku.edu.tw |
507a43ba3595f41461a007bc3b2914eda0708166 | 1f5079b24785a0e6a8bef1f15e1bca939e94ba56 | /Dev/C++/Mascaret/include/VEHA/Entity/Color.h | 3c5d59ce7c043913ea23877a880971a0d08a6d56 | [] | no_license | querrec/Mascaret | 7d5d0628dfb93226a602f79a7a974c14a60a88e8 | c71eba3667b3e3fa8a0b18a1f40219aee358c968 | refs/heads/master | 2021-01-17T08:12:10.024097 | 2016-04-14T13:27:52 | 2016-04-14T13:27:52 | 25,727,699 | 0 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 1,145 | h | #ifndef _v2_VEHA_Entity_Color_H
#define _v2_VEHA_Entity_Color_H
#include "Tools/veha_plateform.h"
#include "VEHA/Kernel/ValueSpecification.h"
#include "VEHA/Kernel/PrimitiveType.h"
#include "VEHA/Kernel/Model.h"
// #include "MascaretApplication.h" // Name conflict
namespace VEHA
{
class VEHA_API Color : public ValueSpecification
{
public:
Color(const string& str);
Color(double r=0,double g=0,double b=0);
Color(float a);
double r,g,b;
float a;
shared_ptr<ValueSpecification> clone() const;
Color& operator=(const Color& value);
};
#if 0 // Need MascaretApplication.h meaning Name conflict
inline Color::Color(double r,double g,double b)
: ValueSpecification(MascaretApplication::getInstance()->getModel()->getBasicType("color")), r(r), g(g), b(b)
{
}
inline Color::Color(float alpha)
: ValueSpecification(MascaretApplication::getInstance()->getModel()->getBasicType("color"))
{
a = alpha;
}
#endif
inline Color& Color::operator=(const Color& value)
{
// FIXME: We don't change alpha ? Is it normal ?
this->r=((const Color&)value).r;
this->g=((const Color&)value).g;
this->b=((const Color&)value).b;
return *this;
}
}
#endif
| [
"querrec@querrecPortable.(none)"
] | querrec@querrecPortable.(none) |
65a7de16f899469a298c73bc396487bab4473804 | 5d83739af703fb400857cecc69aadaf02e07f8d1 | /Archive/a2586fee657bc522a6b05337aa15e2d5-61c3814520a8d4318f681038dc4b4da7/main.cpp | c74c168ca156628aaddbbffa63d413c1f65bac4c | [] | no_license | WhiZTiM/coliru | 3a6c4c0bdac566d1aa1c21818118ba70479b0f40 | 2c72c048846c082f943e6c7f9fa8d94aee76979f | refs/heads/master | 2021-01-01T05:10:33.812560 | 2015-08-24T19:09:22 | 2015-08-24T19:09:22 | 56,789,706 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,566 | cpp | #include <cassert>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <string>
#include <typeinfo>
#include <cxxabi.h>
template<typename T>
std::string demangle() noexcept // terminate if exception is throw (fair deal)
{
int st;
char * const p = abi::__cxa_demangle(typeid(T).name(), 0, 0, &st);
switch (st)
{
case 0: return std::unique_ptr<char, decltype(&std::free)>(p, std::free).get();
case -1: assert(!"A memory allocation failure occurred."); // no memory = game over
case -2: assert(!"Not a valid name under the GCC C++ ABI mangling rules.");
case -3: assert(!"One of the arguments is invalid.");
default: assert(!"Unexpected demangle status");
}
}
struct general_exception : virtual std::exception {
// implicit move for the 'name' argument? or a copy?
general_exception(std::string name) : std::exception(), name_(name) {}
virtual ~general_exception() throw() {}
virtual const char* what() const noexcept { return name_.c_str(); }
std::string name_;
};
template<typename T>
struct concrete_exception : virtual general_exception
{
concrete_exception() : general_exception(demangle<T>()) {}
virtual ~concrete_exception() throw() {}
};
namespace foo {
void bar() {
struct error {}; // complete type is required by typeid
throw concrete_exception<error>();
}
}
int main() {
try {
foo::bar();
}
catch (const std::exception & exc) {
std::cerr << exc.what() << std::endl;
}
} | [
"francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df"
] | francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df |
6ec6af71f9ac47c3e9cec81711a9efbe2bebcb28 | 9ada6ca9bd5e669eb3e903f900bae306bf7fd75e | /case3/ddtFoam_Tutorial/0.005400000/Xi | 61dde9a887dc462ab9c46901d4abb692cd76f0d1 | [] | no_license | ptroyen/DDT | a6c8747f3a924a7039b71c96ee7d4a1618ad4197 | 6e6ddc7937324b04b22fbfcf974f9c9ea24e48bf | refs/heads/master | 2020-05-24T15:04:39.786689 | 2018-01-28T21:36:40 | 2018-01-28T21:36:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 98,795 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.005400000";
object Xi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField nonuniform List<scalar>
12384
(
5.74629
10.1391
12.2904
13.7122
14.7003
15.1396
15.1666
14.6421
13.5284
12.2823
10.2719
7.88347
5.19263
4.57714
26.7299
37.9398
45.0911
46.5395
45.6277
44.6817
44.483
44.3173
44.4256
44.5018
44.7517
45.203
46.1883
47.3438
48.9825
50.7383
52.5507
54.0401
54.9044
55.8437
55.2655
55.3448
54.1124
53.3916
51.8641
48.7047
41.7353
30.1733
19.9586
16.8108
29.5725
32.6053
35.9613
41.169
44.9422
48.1079
49.6956
51.9683
51.2995
51.0078
49.7123
49.9443
50.2672
53.5195
55.5494
60.6033
62.6939
67.5196
67.3156
70.5952
69.5055
72.3883
71.544
72.5919
69.8819
64.2489
53.9117
41.8437
27.9577
25.3888
38.8165
44.5108
43.6586
45.212
48.4296
49.1607
50.5847
50.8266
51.5737
53.7073
57.1924
62.0222
67.7365
73.8501
79.6616
85.2855
86.7767
87.3563
87.4365
84.3892
82.0291
78.9359
75.4817
71.6254
70.7346
78.0585
74.8944
59.7885
43.4524
40.9835
40.9923
44.3578
46.6763
49.433
54.7842
62.0021
68.6961
77.992
82.8755
91.503
94.5096
101.241
104.357
106.062
107.423
105.331
108.158
99.4007
101.063
92.4268
88.5322
82.6041
72.9581
66.5733
59.6477
48.6012
35.3321
26.8065
26.9913
29.5871
25.9364
27.6812
31.9012
35.5681
38.5735
41.5542
44.4924
46.4722
47.2489
47.3409
47.5748
49.169
52.5881
55.0783
61.8077
66.4002
69.477
75.4889
77.0552
79.9141
81.3135
83.9755
83.2663
82.7483
79.125
72.5034
62.9971
50.6387
40.2692
34.7536
32.542
38.5341
53.1109
59.2191
63.2423
65.8949
66.6477
64.1138
67.1563
75.4733
84.1732
93.7779
103.098
109.36
117.339
115.749
116.386
108.117
104.339
100.277
91.2713
87.3232
83.5687
82.8727
80.529
83.2484
78.5223
69.5596
58.0291
46.3169
30.9862
31.1065
36.3136
41.3076
45.902
50.6729
57.2794
64.2352
68.8742
79.0873
80.734
92.4629
91.4109
101.978
97.5274
105.302
100.108
99.1153
96.1506
88.9071
84.3228
77.1801
68.3717
61.7884
51.7002
43.393
39.1669
36.6006
33.6763
32.7554
33.3686
45.3966
53.9522
61.6694
70.2227
77.6617
84.3232
94.8255
96.9028
109.356
110.189
110.713
109.318
110.772
100.717
102.048
91.7073
88.2483
80.3168
74.2597
68.5955
56.3253
45.8368
42.5997
39.9028
36.4274
33.8772
30.666
28.3934
25.7026
29.7984
33.8057
43.2021
55.3134
67.5477
78.5373
92.5659
98.8582
120.056
115.344
131.97
122.14
125.119
117.407
119.78
106.615
107.5
95.5612
92.2645
82.6912
75.7144
63.7892
52.9785
49.0446
49.065
47.8142
46.4248
45.9159
46.2113
46.1752
42.6312
46.5061
58.4205
72.9711
87.8362
101.754
116.592
130.657
154.01
153.644
165.644
166.023
162.136
159.366
156.694
149.932
136.609
120.105
104.861
91.2634
79.8972
72.6486
67.331
61.7484
56.7274
53.4868
51.9407
53.2371
54.4236
53.3932
36.7855
44.6523
57.1625
68.2019
73.2381
73.8424
72.7562
68.0306
65.47
65.2819
63.5641
60.698
58.7958
57.7992
58.7785
62.1443
66.9926
72.8167
79.0571
84.5146
88.3654
88.2098
89.007
86.4411
85.2565
80.5285
75.4327
70.3702
53.4235
31.2842
20.5115
28.3828
31.9683
32.4077
35.3449
49.7617
38.4616
43.8748
51.6432
56.7023
61.5592
64.3276
68.6441
70.9836
71.7158
69.0036
64.8738
59.1873
53.0867
45.8279
38.569
30.2458
22.4226
15.4313
10.5454
6.76351
4.57306
3.76127
4.39654
4.24868
11.422
11.1935
11.9661
12.3766
12.62
13.0298
13.4957
14.0967
14.6943
14.9699
14.0296
11.7983
8.03171
9.05643
28.31
29.6673
35.6527
36.0651
34.9435
34.3376
34.1471
33.4034
32.361
31.1756
30.9411
31.8373
33.9448
37.0468
40.8601
44.8584
48.5177
51.3729
52.9125
53.4972
53.4275
52.9846
52.5015
51.6832
49.9918
47.0602
42.4934
36.1862
27.5267
26.9153
29.1928
29.3291
41.4744
51.3448
55.872
56.5088
53.6769
50.175
45.7249
41.5431
38.4044
37.4152
38.4516
42.3385
46.8881
53.1673
58.694
63.9755
67.9457
70.5427
71.8247
72.015
71.4937
69.375
66.0205
59.3252
49.6083
40.2857
32.0915
39.0758
46.413
42.0215
40.5415
40.597
40.4157
39.5233
40.0155
41.8915
45.9097
52.0721
59.7642
68.8711
79.4049
90.8593
102.464
114.537
123.299
128.363
128.104
124.987
118.656
108.728
97.1397
84.0755
70.2545
61.6345
54.647
46.182
40.805
61.5312
40.5943
27.9753
32.4065
41.526
51.5696
61.3752
69.6959
78.812
86.2909
95.0288
101.073
110.159
114.37
122.887
126.688
129.127
129.574
125.343
122.228
114.048
106.323
92.4469
74.3052
57.653
45.4002
37.3783
31.3142
27.7217
26.787
38.8388
35.2827
29.5248
34.6745
38.4016
40.3813
40.791
40.2504
39.1018
38.0936
38.1265
40.249
44.0018
49.7904
56.7213
64.4887
72.1085
82.8747
86.6253
93.8588
97.9206
97.447
98.1999
94.5189
91.1603
84.579
74.7834
62.0137
47.3174
35.1744
44.9621
38.8952
34.776
43.3645
45.7598
42.6571
36.2106
36.4158
46.4286
61.2812
79.1951
96.7272
112.722
128.986
142.218
159.796
165.642
174.971
174.895
172.621
164.645
143.682
131.858
117.204
96.1913
85.2932
75.1748
66.3956
58.8308
49.2136
64.3904
36.3708
20.9986
22.5946
28.2509
36.4814
45.4257
54.2596
63.7132
71.9773
83.1238
90.322
102.961
108.196
119.648
122.331
130.81
126.753
127.315
124.904
114.864
107.427
94.5954
81.9867
68.8943
55.398
41.4497
31.3689
26.5295
26.0457
40.0315
43.7574
44.4564
51.6908
60.0626
69.3488
81.0122
90.6719
105.978
115.541
129.796
139.508
151.471
156.666
159.804
153.564
148.539
136.947
127.368
114.342
99.941
84.9211
65.846
44.8786
32.724
29.8435
28.9983
28.3159
26.973
26.8173
34.7238
39.8123
37.3672
49.6875
64.1277
78.9492
92.4435
111.27
127.377
151.395
166.001
188.357
192.597
198.214
201.508
191.726
181.308
162.43
142.801
129.96
104.583
85.8911
64.199
45.3299
35.4232
37
37.7605
36.311
35.7149
37.6764
49.5114
47.7602
42.9047
59.3931
77.1947
94.9168
115.485
142.872
159.213
189.024
204.502
215.444
225.991
230.806
233.414
232.112
226.333
217.886
193.107
162.06
131.077
96.3206
68.2737
50.572
46.4141
48.6427
49.4373
48.4434
48.1857
50.6189
60.4432
52.4256
35.139
47.8888
58.8181
65.3356
63.3632
64.13
66.2124
64.7871
66.2077
62.8235
58.3437
54.2785
51.0265
50.1599
52.2563
56.7317
63.0942
71.5258
80.8547
90.9926
98.8778
104.79
107.847
104.001
96.5013
85.4645
73.3563
60.0616
67.7018
31.546
29.8838
32.4269
37.1934
57.1197
64.6454
50.1276
58.1896
67.5544
73.9954
78.7088
81.4355
81.6378
80.0624
75.4759
70.8074
63.4118
56.3182
48.406
40.8007
33.1997
26.8437
20.5333
14.7233
10.1028
6.58006
4.52858
3.49488
3.50869
5.12425
14.7619
12.8033
11.7825
11.2159
11.1983
11.3976
11.6057
11.8197
12.0913
12.8477
13.9771
13.322
9.98854
10.7043
32.762
33.2269
34.9989
33.2004
32.8034
33.5137
34.1827
34.4093
34.4494
34.1471
34.3371
35.5679
37.5046
40.0088
42.4456
44.8569
46.8279
48.1387
48.7051
48.5866
47.4228
46.0606
45.2442
44.7845
45.011
44.768
43.3962
39.6607
33.1077
35.8208
30.4321
31.7205
43.0689
50.1336
51.6045
50.181
47.8063
46.0545
43.2743
41.8556
40.9505
42.9556
45.4638
50.6076
53.6758
59.7093
61.7732
67.0344
69.1247
71.5939
71.4629
71.8083
70.3853
70.2205
67.6456
64.8961
56.5994
47.64
37.7971
50.0597
51.6178
43.6666
39.8717
38.4631
39.5131
41.4457
46.0252
51.2474
56.6809
62.4175
68.3254
74.7068
81.8392
89.5542
98.1501
107.639
116.38
123.039
127.222
128.083
123.181
116.897
108.612
96.4399
82.9219
70.0775
60.314
52.0641
45.2712
72.0612
41.1658
31.7111
39.3382
47.9889
54.9323
61.1221
66.1956
72.0535
76.6644
82.7575
87.2757
92.5707
97.4503
103.185
107.035
109.679
113.437
110.487
111.719
108.141
107.467
101.843
90.7526
74.7663
58.8848
46.342
37.5472
31.0565
28.1899
44.78
40.2725
33.8666
38.4255
40.6736
41.3025
40.9217
40.4551
40.1442
40.5697
42.051
44.0315
46.5031
49.9352
52.8716
58.5716
61.6438
69.4119
73.2282
76.8112
80.5117
81.1321
81.5515
81.4919
80.381
78.9203
75.3041
67.1471
54.1716
40.7078
50.6535
44.5048
41.2943
46.7359
42.1488
35.5096
34.4809
47.4331
68.0466
87.227
102.802
117.631
128.25
140.564
146.317
157.179
156.189
167.162
170.049
170.067
162.133
150.56
140.074
116.147
102.25
87.6538
76.3718
69.9949
63.7786
54.5535
71.3311
40.7432
22.2078
25.9139
34.0318
42.489
49.8594
55.9675
63.4647
68.8747
78.6452
83.9912
96.2515
99.0711
112.333
114.181
120.812
123.334
121.62
121.831
114.311
107.574
101.229
92.2566
79.6963
68.6296
55.6438
41.7508
31.9888
27.9071
44.1165
52.0081
50.7577
55.0104
60.4746
66.798
75.0948
82.8661
94.8705
102.702
115.675
123.138
134.019
136.576
142.745
137.9
138.384
128.491
123.895
115.958
107.206
96.5017
81.4055
60.8209
42.59
30.6407
26.1825
26.1609
26.9688
28.2368
37.838
46.1373
48.8518
61.4382
73.6132
85.3858
95.1449
112.878
122.408
148.832
157.188
179.12
183.109
194.134
194.595
187.517
177.936
172.11
150.306
141.582
120.845
100.969
80.3886
59.2231
43.0545
37.4115
33.0339
29.8017
32.566
37.4543
50.0931
47.5366
54.1798
73.4396
92.1941
110.003
125.944
146.709
160.204
182.589
197.61
206.42
217.149
223.087
228.386
227.298
224.171
217.915
209.782
189.354
159.184
123.794
89.3337
65.2236
50.8515
45.0055
41.0446
39.8169
44.673
53.3902
64.3749
59.3984
46.6464
60.1303
69.597
68.9589
73.0946
79.6954
83.0271
85.9539
84.6988
81.1764
78.972
73.4339
69.0728
65.1005
61.9903
60.979
62.0825
65.2162
70.8955
78.7757
85.0442
93.0347
96.8413
98.5819
95.0285
88.2482
78.6565
67.1525
75.4068
34.0612
26.1725
25.4586
45.0773
69.271
56.4463
58.6216
66.6249
72.6227
76.2693
78.5267
79.2446
79.4357
77.4237
75.4227
72.3779
69.1647
64.3981
58.7198
50.5691
41.304
31.7977
23.3855
14.8636
9.62627
6.34793
4.30147
3.3744
3.42737
5.48174
16.5265
12.9272
11.3944
11.3458
11.5995
11.7374
11.6452
11.5427
11.254
11.565
12.9157
13.9346
11.6849
12.0266
38.1934
39.085
35.994
32.5261
31.8056
32.6384
33.8739
35.3869
36.7113
37.649
38.4922
40.1875
42.3282
44.1405
44.9826
44.8006
44.1596
43.391
42.669
41.8684
40.9748
40.0207
39.1659
39.2081
39.9884
41.4933
42.3145
40.9798
36.381
41.3899
32.4023
35.5412
44.6506
48.5958
47.0606
44.8622
43.936
44.0747
43.7373
44.4119
46.0205
50.8772
55.6003
60.3206
62.5413
63.3312
63.4442
64.6514
67.3129
68.7972
70.6511
69.6542
69.3247
68.3755
68.105
65.9355
62.1587
53.099
43.3314
55.8318
55.1387
47.0278
40.3621
37.1646
39.6507
44.958
52.3725
58.971
65.9882
72.3389
76.9763
80.1769
82.4865
85.1791
89.1358
93.9977
100.268
107.204
112.333
114.317
116.969
116.344
111.96
104.573
92.4944
78.5838
66.242
55.7115
47.9591
75.5637
41.8405
35.9158
43.4584
51.126
55.9958
59.7417
62.4676
64.6106
67.7753
71.0134
73.7393
77.4011
80.7313
84.5091
88.2727
91.7798
94.3299
94.9062
97.4973
97.5826
100.681
100.355
96.5732
87.3679
72.1886
57.794
45.9077
37.0246
30.8408
48.767
44.727
38.661
41.5985
41.6168
40.9807
40.5166
40.8433
41.895
43.9068
45.6809
47.1794
48.7401
50.4508
51.3752
54.902
55.5897
58.7691
62.2985
63.3448
66.8789
67.4814
67.821
69.0812
68.9175
70.8891
72.0534
68.9672
59.3435
46.1212
54.0455
51.084
47.7055
46.6793
37.6276
33.7373
43.9657
68.0546
86.065
97.8262
107.848
117.128
119.927
118.567
111.585
110.109
108.42
113.415
122.592
130.089
137.003
143.218
128.568
117.066
102.291
84.9171
75.2889
70.4923
66.0202
60.4111
76.8457
42.7399
23.7758
30.1185
39.3847
46.2609
51.9104
56.5088
60.7763
64.8065
71.5246
76.1782
85.1497
88.9703
101.112
100.314
110.459
112.363
112.461
113.31
107.186
105.815
102.978
94.9481
88.1126
78.5343
64.7701
51.9405
38.6002
30.0346
45.7948
55.5523
51.9465
55.3615
60.2707
66.0458
72.6768
78.9633
88.3663
96.2084
106.97
115.381
121.47
127.412
128.485
126.818
124.239
118.271
116.049
111.693
108.653
103.09
93.3528
75.5105
55.4669
39.5642
28.6298
25.2313
26.931
28.2679
38.0591
49.6195
55.8712
68.0371
78.4052
88.6078
98.2579
110.775
119.935
143.488
149.783
171.738
178.383
180.425
180.893
179.863
166.676
165.747
153.025
143.417
131.315
113.011
93.8099
74.1383
54.8179
44.307
35.5569
28.5619
31.9705
36.9751
49.8527
50.9325
64.2849
85.2567
103.39
120.452
128.338
141.398
152.949
171.766
182.723
193.227
204.807
211.882
216.783
218.721
216.139
212.356
207.76
202.035
183.245
148.123
112.027
82.9706
64.4412
50.7033
39.6208
34.9437
41.8729
54.1667
65.9306
68.0782
60.3823
72.9371
73.3904
78.9823
84.7876
91.8337
91.1157
92.2833
92.3398
90.8559
91.2915
90.9066
86.5178
82.533
77.0437
72.3191
69.4057
67.5254
67.8376
69.987
75.1758
82.4121
86.5658
88.945
90.4156
88.0866
82.119
73.448
79.3714
32.046
22.0233
27.5276
57.3687
63.8992
59.0348
64.9904
70.6741
73.2441
73.8872
74.0567
74.4459
73.6474
73.1715
71.897
70.0748
70.09
68.2717
65.1788
58.8624
48.4534
37.039
26.8298
16.9613
10.3352
6.46527
4.31756
3.50799
3.80954
6.06574
17.2638
12.8562
11.965
12.7465
13.6328
13.3959
12.4528
11.8147
11.22
11.2355
12.6117
14.2407
12.9285
13.2464
43.2373
44.7228
37.1478
32.1277
30.4188
30.562
32.6054
35.8039
38.5007
40.5758
42.2247
44.6993
46.7956
47.4316
45.6236
42.6112
39.1073
36.1902
34.0481
33.2479
32.884
33.3194
33.2958
34.3427
35.6732
38.2182
40.4443
40.9599
38.3805
44.6545
34.6105
39.9573
46.6247
47.2791
43.0938
40.7463
40.9631
43.5164
44.6663
47.6577
51.4899
60.1874
64.2987
69.6758
66.5398
64.6992
60.0052
58.9288
57.7012
61.1252
63.2071
65.8848
65.7421
66.1533
65.9991
65.9802
63.4224
57.578
47.6776
59.7388
60.2567
51.6112
41.8443
37.4591
40.4942
48.6094
57.672
66.058
75.0696
82.1954
85.3348
85.5612
84.0939
81.9933
79.9748
79.5566
81.531
86.321
92.7109
100.993
107.308
110.466
110.94
107.302
98.0123
84.954
70.9127
59.4249
51.0347
78.416
43.3522
37.6558
46.3116
53.7407
57.7084
59.6336
61.602
62.252
62.461
63.6964
63.0786
64.345
64.4758
66.868
68.9868
71.422
75.583
78.4554
82.8929
85.371
90.387
92.2661
95.0585
89.5675
80.5013
66.2043
53.4336
42.0025
33.5567
50.1821
49.3187
43.7224
44.1381
41.999
40.1355
40.1786
41.6412
44.2637
46.8206
48.5959
49.8736
50.7429
52.429
52.5564
52.5736
51.112
48.5339
48.7396
48.1943
50.9942
53.6788
55.5146
57.9065
59.3087
63.2103
67.3767
69.0579
62.655
50.7973
56.1535
57.8831
52.7984
43.9933
34.8949
38.2438
60.3897
78.6837
86.3035
97.8058
109.094
113.652
104.537
90.3318
78.403
75.1359
75.2963
76.8795
83.8819
90.937
106.556
112.625
116.838
112.038
95.8281
82.9025
72.3454
67.8591
68.7718
65.1313
78.9843
43.8542
25.6776
34.0324
43.066
49.5799
53.8292
57.3505
60.1077
62.3381
67.1101
69.2979
75.5516
79.4533
87.8289
89.9192
97.3692
99.2455
101.447
101.039
99.4283
102.624
97.6928
96.3276
92.2718
82.4727
71.8813
58.7931
44.3143
33.4498
46.8246
56.9097
51.8273
56.5287
62.4072
68.1651
73.5581
79.2992
85.9828
90.6924
100.61
105.094
112.41
116.66
119.984
116.168
116.367
109.229
108.04
105.789
106.323
105.51
100.551
87.2672
66.7552
49.303
35.5576
27.798
27.9515
28.698
39.1461
52.0016
59.0683
71.5588
83.0964
92.8234
102.32
110.266
117.142
130.164
131.651
151.177
152.913
169.113
169.129
161.795
157.375
154.267
148.084
141.819
133.153
122.958
103.479
86.1874
66.032
51.3979
40.6384
32.1297
33.7898
36.6042
49.646
55.0335
71.3942
95.1484
113.052
123.475
124.412
132.386
137.082
151.242
163.107
175.366
186.26
191.812
198.392
201.838
203.441
203.006
202.021
201.587
195.647
168.358
130.761
100.003
78.0257
61.1128
45.4199
36.8755
40.841
53.9525
65.9152
77.9284
73.7939
77.7346
80.5906
87.7678
92.0224
91.1933
90.3245
88.2907
89.1149
92.4862
93.9404
98.7802
102.481
100.669
95.7553
87.8587
80.8829
76.3063
70.5037
64.9754
62.6167
67.1172
76.3482
82.1797
85.4389
87.4062
83.6495
78.5689
80.2329
34.6131
21.3798
35.109
59.1526
61.2946
63.3397
69.0024
71.5322
71.092
70.1295
68.962
67.9497
67.837
67.2824
67.6058
67.9651
68.4767
69.4905
68.5009
64.8083
55.1486
41.671
30.0832
20.1107
11.9278
6.92272
4.54494
3.87128
4.64867
6.56246
17.6587
13.0422
13.1666
15.1959
16.5051
15.4757
13.2767
11.7475
11.2487
11.4881
13.2361
14.8325
13.8016
14.2131
48.7274
50.3891
38.6554
31.8813
28.1449
27.7325
30.5462
35.2224
39.5235
42.6711
45.262
48.6273
50.3768
49.1092
44.8795
39.76
34.5164
29.832
26.5031
25.1132
25.3774
26.8718
28.3251
30.4026
32.5712
35.8177
38.7725
40.6706
39.7598
46.4587
36.9851
44.4392
48.1676
46.0254
39.8424
36.2423
38.9413
42.7601
45.7018
50.2671
57.3761
67.0392
71.9287
75.7147
68.7478
66.3357
59.3384
53.2626
48.7195
49.1333
54.3727
58.9691
61.7978
62.5949
63.7395
64.3476
63.9033
59.6705
51.5573
60.8951
64.8992
56.1299
43.8066
38.5768
42.1658
51.372
61.7311
72.7821
83.9106
91.0044
93.8748
93.0207
89.1311
82.8636
76.1035
69.2214
65.9065
63.7413
69.3997
78.676
88.6908
98.3315
105.838
105.577
99.6995
87.3158
73.498
60.5813
51.9837
77.9617
44.4897
39.2539
49.4998
57.322
61.7992
64.6599
66.1019
66.5479
64.132
61.6717
56.2291
52.4289
48.1703
47.7688
47.8893
51.5885
57.0975
61.6603
68.7576
72.8529
79.3526
83.2378
86.7534
86.83
81.0381
70.9219
57.964
46.4945
35.8561
50.8919
54.2598
48.6104
46.2743
41.5879
39.2418
39.9619
42.6014
46.005
49.1069
51.0173
52.2274
54.4389
55.6778
56.4773
53.569
50.6133
43.4756
38.8839
34.3866
35.3168
39.7743
44.1203
48.8292
52.3525
57.4492
64.0776
69.0261
65.0214
54.055
55.9955
64.7828
56.9265
42.1724
36.8181
49.5026
66.5455
74.0713
86.1374
104.944
116.213
109.312
88.7711
72.3224
63.9477
58.1841
56.3116
54.503
60.3843
70.2691
79.6448
93.7763
104.709
99.2386
91.5095
78.558
67.594
66.7179
71.0635
71.048
82.0241
44.494
28.1574
37.7844
46.4631
52.6908
57.2027
60.3903
62.1115
63.78
64.8251
66.5948
66.2487
69.7407
72.6195
75.4269
81.2624
83.4651
87.1931
87.9816
92.8143
93.0478
93.4701
95.7249
90.8347
85.4537
75.6971
61.3924
47.3375
34.7892
47.2183
58.2425
51.4628
58.2771
65.6049
71.7871
76.5104
80.3469
85.0137
84.949
91.3173
90.1028
99.1481
101.043
103.626
104.685
104.567
101.448
101.592
99.5758
102.976
104.479
103.659
93.8461
76.5546
57.3912
41.2603
31.2848
29.241
27.8519
38.0975
56.3826
59.6503
74.4145
87.679
98.4576
104.325
111.73
110.728
114.397
110.614
117.007
117.573
129.742
136.722
147.471
138.114
143.944
134.836
139.084
128.754
125.948
110.308
94.088
74.7869
57.1303
44.368
36.0271
36.266
36.3785
49.5713
61.6373
76.757
102.619
118.428
121.698
118.737
125.356
124.78
137.026
134.752
146.34
146.874
157.174
165.446
174.196
181.337
188.497
193.199
198.798
198.413
179.416
145.086
112.249
88.5715
68.6872
52.371
41.2879
41.5943
52.1671
65.3006
88.6331
85.4227
83.1061
87.0805
91.6022
90.2262
85.7925
82.5509
82.7352
82.178
86.0428
91.2401
96.2061
105.374
110.994
109.758
104.706
94.488
86.6423
77.7187
70.6352
57.3357
54.6091
66.0763
77.7409
84.7053
85.9894
86.0683
83.192
77.4054
35.7597
23.1266
39.8548
59.4296
62.0933
66.5807
71.0116
70.6151
67.8901
64.864
61.7161
59.4727
57.4864
58.2459
60.9347
64.8547
66.2018
69.3677
69.1558
67.9941
60.5553
45.895
32.4161
22.8589
14.0541
7.76579
5.09909
4.65145
6.12839
7.40827
17.7665
13.5416
14.7232
17.7786
19.2893
17.7237
14.5972
12.2519
11.839
12.6864
14.5271
15.4656
14.6855
15.5052
53.9808
54.5285
40.3398
31.9086
26.5924
25.485
28.5373
34.1603
39.8472
44.2153
47.7754
51.7942
52.9992
50.579
44.0911
37.8789
31.7864
26.8247
22.3111
20.4267
20.8845
23.3991
25.7972
28.6981
31.4751
34.7411
37.899
40.166
40.8487
47.1751
39.7692
48.2054
49.3836
45.1919
37.0954
33.4781
36.0794
41.993
45.7106
52.3724
60.8496
72.6248
77.3596
79.4744
74.4746
71.0763
64.3906
58.1737
49.7573
46.3252
48.4987
54.8777
58.1837
60.2146
61.6624
63.0262
63.1263
60.5077
53.9137
60.9493
72.1604
62.4804
46.7473
40.5912
43.7437
54.1817
64.9788
77.4316
89.0859
96.4136
100.562
101.576
97.3835
89.9163
79.9418
69.9832
58.0633
48.633
47.3688
58.4645
73.8739
88.2431
97.9836
103.08
98.3092
87.8009
73.2976
60.6317
53.1122
77.7761
47.5688
42.1839
54.2713
63.5797
69.699
74.3302
75.368
76.0358
73.0146
68.1879
58.799
50.6713
40.1018
33.2529
29.8304
33.6141
41.0621
47.8426
56.2004
61.8593
69.6137
73.5064
78.7042
79.8593
78.0308
70.489
59.9307
48.2734
37.6976
50.8493
59.1587
53.1219
47.7363
41.0838
38.4047
39.8839
43.4265
47.5185
51.0141
52.8957
55.4564
58.8729
61.393
63.0412
59.1097
55.2116
47.0219
39.16
30.5902
27.0342
30.2347
36.7818
43.2549
48.6005
55.2747
64.1756
69.996
66.8843
55.3745
53.8571
72.7679
58.0714
42.796
43.4538
56.2687
63.8921
74.0177
95.1338
116.933
121.391
105.71
81.6496
68.7577
62.7204
55.1586
46.9886
38.1719
44.3035
54.8045
68.9882
83.4817
91.4208
92.9992
85.0227
72.5583
64.7941
66.9399
75.7768
75.9707
80.9717
45.5398
30.9933
41.2331
50.0439
56.807
61.6401
65.2942
66.5508
67.1573
66.0902
66.6138
61.6358
61.6902
57.6439
57.1568
59.639
64.5219
71.1524
78.3951
82.1624
85.2673
89.5826
90.359
89.9358
85.923
75.765
63.2258
48.3554
35.2338
46.4067
59.9465
51.1951
60.133
69.1246
76.1818
81.2527
82.6241
85.5611
81.7389
82.4476
79.2552
79.8123
77.3429
83.3318
86.1848
92.5732
92.0443
94.1808
94.9855
98.1766
102.92
103.086
97.4038
80.8187
62.2341
45.9481
34.8985
31.3929
28.5646
39.6061
63.8377
60.5367
77.1743
91.449
103.181
107.328
115.896
110.115
108.161
96.5123
92.8476
84.0599
89.5606
100.356
120.805
117.621
130.294
122.649
132.424
124.636
125.22
112.689
99.3495
79.7146
60.5711
45.0767
37.7047
37.4019
35.6009
49.8879
73.1638
81.9987
107.393
119.962
119.776
118.109
122.591
121.17
125.384
117.309
121.166
109.441
110.151
117.458
136.331
154.369
170.461
183.234
194.693
191.746
181.575
150.587
120.392
93.5439
72.8413
56.1156
44.9216
42.4469
49.9793
63.4737
97.8546
88.2356
88.3054
91.0729
90.1266
84.287
78.2596
74.4765
74.3229
76.9133
78.8662
84.7057
91.425
98.3254
112.561
114
112.74
106.883
96.5625
87.2805
80.4812
70.281
63.7948
68.3224
78.1559
82.0148
86.2206
86.6237
84.2835
70.7291
38.9256
24.7749
40.7093
58.4175
63.5631
68.2819
71.043
69.6139
64.8737
59.3891
54.2208
49.0606
46.4179
48.789
53.6293
60.7961
64.6832
68.3
69.6196
68.2935
64.3899
49.129
34.1731
24.5176
17.169
9.7017
6.636
6.63595
9.15894
10.3321
18.0384
14.03
16.2298
19.8135
21.2575
19.7235
16.3674
13.9035
13.5071
14.4266
15.8494
16.9329
18.7043
22.6697
57.537
59.8012
42.1814
32.1871
25.2124
23.2417
26.2278
32.9192
39.6586
45.0382
49.6377
54.3338
55.5198
51.6851
43.6758
37.6433
32.2509
27.4516
22.8171
20.8057
21.8083
24.6716
27.4548
30.1871
32.8196
35.4144
38.3845
40.5122
42.1287
49.0094
43.0709
51.8507
49.5211
42.9954
34.7893
30.4105
34.3087
39.8383
45.2512
52.6008
62.5691
75.602
80.7893
84.698
81.335
79.4573
72.8348
69.2874
61.3673
56.6703
54.8041
57.1725
59.0305
60.267
61.2072
62.2598
62.3554
60.2479
55.3537
58.7252
78.7003
66.8523
49.8997
41.5371
44.2529
54.3732
66.7807
80.7951
95.8576
106.846
111.688
111.253
107.706
100.882
90.9665
79.0687
66.5221
53.1297
43.6475
52.0155
68.5256
84.9396
95.3969
100.119
96.6558
85.5741
71.9104
59.7969
54.5062
74.9179
54.2101
47.7457
61.4125
72.2851
79.7771
84.7386
87.055
88.3111
85.062
81.4133
71.4127
62.3451
49.6165
40.621
32.6517
31.2089
35.149
41.15
48.3763
54.6041
61.496
66.7405
70.1059
73.2804
72.1763
67.982
58.7101
48.7251
38.4337
51.408
64.6691
57.3672
48.208
40.032
37.3729
39.1596
43.3338
48.1834
51.8508
54.9849
58.2635
63.3209
68.0584
70.4001
68.0628
61.9456
55.9107
49.0774
40.1134
35.2402
34.5544
38.4888
44.1718
50.1841
58.8339
68.0484
72.1515
66.8894
54.4434
51.2448
80.0277
60.6508
45.0456
47.6518
55.9777
63.0882
78.0805
105.765
125.691
126.712
108.151
86.5437
73.7982
68.965
63.5497
56.8825
46.5042
47.0437
55.6111
69.3409
78.6886
87.5052
87.3404
77.3177
68.0253
63.4314
74.1299
83.0066
81.3848
82.8511
48.3923
34.7795
44.8945
53.8528
61.2528
66.5636
70.3062
71.778
72.3437
70.4897
69.8611
63.9304
61.0871
51.7469
45.5598
39.6989
44.9987
57.7007
68.3996
73.4856
80.5673
84.238
87.5063
88.8119
83.8175
76.3334
63.1707
47.8393
35.629
46.8665
61.3243
51.2897
62.0166
72.5743
80.8926
86.2684
87.2902
89.2463
82.7708
81.7797
72.4406
65.1617
56.5795
56.5579
66.4459
77.8879
82.0606
88.1478
89.7866
95.1658
98.2866
102.188
97.0866
82.6148
63.8616
47.5017
36.6826
31.2684
28.7066
42.6548
70.8457
60.2282
78.1911
93.9808
106.547
114.793
122.259
119.135
113.378
100.099
86.948
67.5668
60.1382
67.4141
95.5413
100.547
118.949
115.352
126.168
120.679
123.702
112.083
101.328
81.1348
60.4354
44.252
37.1254
37.3357
36.7759
55.2522
88.4725
85.9663
110.293
120.526
121.05
120.731
124.823
124.726
126.572
118.909
116.916
97.0596
83.6491
76.9601
101.934
132.052
149.103
174.968
183.193
178.79
175.048
147.364
121.784
95.6577
74.5118
57.913
46.1042
42.6629
46.6399
60.5854
106.719
96.0532
90.5791
92.9969
86.4141
77.5754
69.67
66.0899
64.1744
67.1128
73.8834
78.7743
85.2737
91.7424
100.061
111.637
115.07
111.086
104.862
95.7895
87.1242
81.8299
76.8301
76.0295
79.3181
82.9474
84.4584
85.5963
86.2296
62.847
46.5476
24.9497
39.4539
56.4341
64.067
69.444
70.3156
68.0713
62.7562
55.2324
47.1735
38.1356
31.8355
37.6961
46.5092
56.5552
63.4227
67.5415
69.9065
67.9349
65.4213
51.4375
35.0754
25.1816
20.0486
13.1409
10.7583
13.015
17.3938
20.9683
18.113
14.4494
17.2716
21.1235
22.5743
21.1711
18.2371
16.4553
16.3703
16.8972
18.8576
24.9844
37.8959
47.333
61.8109
76.2336
72.4684
64.1374
45.8113
33.8582
24.7523
21.5598
24.4079
31.3392
38.9877
44.8289
50.4772
56.3201
57.5685
52.8514
45.0891
39.6249
34.6588
31.0765
27.8373
27.1044
28.1492
30.6825
33.4257
35.4718
37.8583
39.1304
40.7383
42.1589
44.3861
45.4057
52.6001
57.7259
54.1321
55.9169
49.4035
41.5758
32.8598
28.6676
31.8263
38.1661
43.4993
51.0347
61.8599
75.9189
83.2426
88.904
88.331
88.0592
83.7527
80.0757
75.1564
71.6295
68.1769
66.1673
65.186
64.2281
63.735
62.7721
61.1903
57.7225
54.14
55.9504
60.8254
74.0584
100.71
74.6642
53.5866
43.2066
42.6363
52.772
65.2634
79.8238
93.6098
106.318
114.899
119.607
118.365
112.455
103.837
92.4248
83.2837
74.0997
66.842
68.9623
77.3855
88.7768
96.2332
100.023
93.8881
83.3309
71.6558
62.8616
61.01
61.686
62.5151
74.1248
65.9457
67.4868
74.3565
82.5408
89.0698
93.8441
97.3644
98.8227
96.6425
96.9561
88.9949
81.3098
69.155
60.198
51.4105
47.2461
45.8947
47.5535
50.6514
54.4532
59.051
62.3146
65.553
67.4545
66.8937
62.7479
55.6681
47.6009
40.8754
42.5059
58.1451
74.5904
74.8695
60.3004
48.1059
39.132
36.3969
37.963
42.7327
47.5736
52.4996
56.2134
60.3287
66.4869
73.8514
77.0925
76.8841
71.2727
64.5068
60.8442
54.849
49.5625
49.0651
49.5965
53.3288
59.5851
67.7902
73.2719
71.9321
62.6662
50.0865
41.7432
73.5278
107.986
95.135
65.0339
52.508
52.6342
56.2882
64.1876
81.0431
110.602
132.821
135.801
121.157
99.235
84.0335
79.3156
74.7527
74.3308
71.0347
69.053
72.5704
77.8977
82.9088
85.98
79.5687
71.8893
65.1641
71.3648
86.4911
90.8088
84.8174
62.8427
57.7247
64.1032
52.2573
46.8247
51.1445
58.0733
65.3709
71.0141
75.0665
77.1598
78.5165
76.2636
76.3781
71.7929
67.7756
61.1671
53.3779
46.3304
46.7381
54.982
65.0961
72.1529
77.289
82.9193
86.2008
85.9041
83.3375
75.0785
61.3077
46.5808
39.5395
47.5166
60.8437
61.1483
46.9938
55.4345
65.2527
75.9175
84.6043
91.4104
93.8648
94.7786
89.8298
88.4161
77.3684
71.7311
59.4188
51.5606
56.3725
69.7015
76.1373
83.061
86.3709
90.3035
96.4319
97.7814
93.8097
80.5923
62.2631
44.587
31.2435
30.1082
44.6687
57.8335
68.7324
71.0505
55.5325
63.0718
79.1709
95.8089
110.234
121.597
130.733
132.284
129.557
114.738
105.066
85.7519
75.7197
72.9562
91.3755
96.2103
113.884
110.661
124.762
117.243
123.408
111.08
100.274
78.8359
56.0843
38.3262
38.0372
53.1961
67.6246
77.4999
88.4357
95.6669
77.3519
96.0121
115.901
124.057
124.933
124.668
130.325
134.495
139.247
132.173
135.231
118.187
110.927
99.054
105.136
132.223
140.84
161.871
162.501
167.721
158.999
140.566
115.996
90.393
70.0493
54.6876
45.2646
42.7554
46.4361
47.897
67.3376
81.6105
110.711
97.1307
94.2109
91.3086
82.8197
72.2698
60.9473
52.8424
51.3325
56.6011
65.9706
74.4694
80.7123
85.4132
88.007
102.064
109.008
111.516
107.04
101.572
92.6099
85.854
82.3618
79.2124
79.3721
80.6699
81.9202
83.8877
82.1957
62.5677
69.4481
77.5305
45.4772
25.5332
36.4138
53.7247
63.221
69.2854
70.401
67.1757
61.0897
53.7528
44.358
32.7437
24.397
34.0354
44.6698
55.5531
62.8315
67.4003
69.7265
67.7168
64.2807
51.9632
35.237
24.9854
23.0362
19.0458
20.2521
25.7861
31.341
31.1191
7.58833
3.49462
18.158
14.6197
17.999
22.0254
23.4846
22.1183
19.6236
18.2243
17.8282
18.3989
22.4442
36.7166
58.8792
71.6993
80.2685
89.8852
83.8711
61.9763
46.4309
34.3526
23.1643
19.9838
22.7584
29.5814
37.2488
43.9095
50.1757
56.8748
59.4565
55.7949
48.4785
42.8639
39.0452
37.0292
35.7639
36.7504
39.3163
42.1199
46.1693
47.5954
49.4688
47.9729
48.1258
47.7311
47.5517
48.3911
47.1655
53.2472
60.6197
53.711
46.9116
38.5192
31.144
27.5639
30.9561
35.8665
41.0913
47.7995
59.3376
73.7109
83.027
91.4831
92.6916
95.0856
93.3887
91.6705
87.08
84.3966
81.1369
78.3366
75.1239
72.1259
68.3109
64.204
58.2941
52.9401
49.4572
52.5918
54.1078
73.3032
107.931
76.1532
55.0421
44.6103
42.6265
49.3654
60.6254
75.4601
92.3684
106.945
117.847
124.098
125.34
122.114
117.268
108.211
97.9042
92.4316
88.3946
88.2497
93.4285
98.2025
101.186
100.436
93.8115
84.6147
75.3964
69.5407
65.7515
66.0322
69.1671
72.78
70.2907
72.2909
78.9946
86.7509
94.0622
100.294
103.764
105.199
107.57
108.319
105.818
101.854
93.9096
83.1826
76.6154
69.806
66.7716
63.497
62.3701
62.8771
63.2327
64.3687
64.9337
64.5233
62.2394
57.0467
50.0481
43.9581
39.4299
40.5706
47.794
61.9775
75.49
60.199
46.6702
37.7881
34.7445
36.3093
40.7865
45.9666
51.4112
56.49
61.2077
67.9339
75.8992
82.2206
81.8814
79.099
73.1935
69.089
68.7625
65.9613
64.3135
66.3846
68.68
72.809
76.0313
74.2387
66.8321
56.1043
47.8491
51.0002
75.2838
96.8828
92.1664
66.8057
56.9762
53.896
56.6039
64.4925
79.6391
107.278
136.108
144.644
137.8
120.11
101.892
91.4932
87.6276
88.7798
87.5784
87.9884
86.8909
87.3632
84.97
79.9068
75.6471
70.9451
75.0973
92.4658
100.229
96.3928
82.9862
54.9883
51.3627
55.7095
50.7422
47.2969
51.5695
58.6738
66.4601
73.1702
78.3428
81.4955
84.1724
83.4937
84.5546
81.5519
81.1188
76.3544
71.8534
69.8415
67.2793
69.0363
73.7088
77.05
79.36
85.192
85.6368
84.8623
82
73.8195
61.4925
49.762
43.9115
44.0007
44.2496
44.3426
48.3424
56.1152
65.5762
76.3321
86.9932
95.6547
98.3312
102.046
100.831
98.9929
92.0285
91.6506
80.1602
76.2698
71.9178
77.4641
77.0169
83.3695
83.2573
89.5143
92.98
93.8677
89.0556
75.9801
58.5555
42.4118
32.161
39.1863
49.6464
51.4439
46.9628
44.5953
45.8247
54.427
71.9133
92.1219
109.755
122.992
138.227
145.203
147.045
136.498
131.942
118.228
112.004
106.028
115.178
108.073
122.282
119.073
124.628
119.653
123.89
110.665
96.6423
75.6329
53.8044
43.6543
51.5911
60.0723
64.4424
65.2728
64.3392
64.3619
71.4031
92.0421
114.955
126.236
128.103
128.335
136.301
145.88
158.629
152.768
161.073
156.426
152.373
149.169
138.732
152.82
145.638
155.641
151.961
154.144
144.223
129.316
107.107
84.6063
65.9805
51.6395
43.4584
41.9276
43.8419
43.0003
42.9897
65.8845
114.584
101.017
95.7752
88.2717
81.2828
66.1585
53.7153
39.7407
34.9415
46.7867
60.1654
69.812
77.4641
82.2558
79.5375
81.5137
95.6769
103.788
105.101
102.16
97.3354
91.1438
84.4999
81.2796
80.4502
78.1643
79.4383
80.3206
75.0584
59.6008
43.5023
45.7594
43.9754
30.4267
33.4228
50.4818
61.6561
67.8579
69.5051
67.4143
61.7077
54.3584
47.8297
39.7759
36.7247
41.9005
49.7184
58.3033
63.6886
67.793
69.4535
66.7282
62.7868
50.75
34.3595
24.1788
24.0131
21.7078
22.8036
27.6125
30.8497
20.4567
4.19873
3.11208
18.0639
14.5846
18.3602
22.6054
24.2257
22.9329
20.5597
19.2653
18.4256
18.5522
21.7311
35.2362
56.6555
69.7222
75.4819
78.9394
74.6017
56.6079
44.7396
30.1406
20.5741
18.1805
21.1381
27.1938
34.9409
41.5896
48.4524
56.4087
61.6608
59.8846
53.4923
48.138
45.7282
45.6643
47.3351
50.7617
55.5768
59.4757
63.1245
62.337
61.929
59.055
56.8929
55.5253
52.8877
53.2654
52.0257
57.4752
58.8077
50.0434
42.6071
35.155
29.3073
27.4101
29.8376
34.144
37.7322
44.4402
53.9917
68.8028
80.3829
89.6167
93.6635
98.1557
98.4308
100.047
98.1061
96.0189
92.7646
89.2585
84.6773
78.8988
72.1003
64.6927
57.4207
53.0798
52.343
57.742
71.6981
88.8381
113.281
78.0876
54.5358
41.4236
37.8497
44.3115
53.5134
66.4495
81.8631
97.8831
112.865
123.89
128.773
127.333
125.202
119.696
114.437
107.838
105.153
104.883
105.159
107.245
105.712
101.252
95.7467
88.8937
79.6516
71.0015
67.6398
67.1948
68.5537
69.3174
68.5857
72.1872
78.4313
86.0109
94.5866
101.435
105.458
110.785
112.912
113.573
115.328
116.025
112.782
111.854
101.163
95.0395
87.8678
84.7818
81.743
77.3427
75.3485
71.759
67.9818
62.9922
56.6797
49.7382
43.4776
39.9103
40.789
48.2664
57.4674
67.3138
74.4875
57.2566
43.8705
35.6488
32.4841
34.2814
38.3629
43.0255
49.1308
55.3288
61.1957
67.3929
75.1997
82.9816
85.6382
82.8247
79.3622
75.6109
74.4731
78.1468
77.4825
78.9819
80.656
78.9141
75.5365
69.2541
61.1753
56.1267
58.1696
71.8867
86.5637
92.0245
83.148
64.2483
55.9567
51.9956
55.6548
62.6326
74.3428
96.9657
128.657
147.615
150.721
145.635
129.873
113.581
103.673
98.9733
97.7525
95.8905
92.7331
91.1865
83.9914
81.9528
80.92
89.3237
104.443
110.554
107.488
95.9094
66.579
52.6888
50.6625
50.5609
45.0998
42.7396
47.9871
55.6495
63.9547
71.9728
78.5361
84.1626
88.0369
89.2414
93.9908
91.1401
95.9803
92.2236
94.2647
89.5422
90.2088
88.7149
86.5505
88.1031
87.0844
88.2232
87.1351
84.9858
80.0592
71.9335
62.1728
52.9258
47.4864
44.15
42.0868
43.095
47.8376
55.1629
63.5144
73.9048
86.8648
95.8766
101.896
111.387
110.731
110.077
112.347
112.135
103.624
101.574
93.556
92.6626
87.0035
87.098
86.4538
88.6946
90.6295
88.5781
82.534
69.6084
53.6492
41.1458
37.5567
44.9921
49.9606
45.7096
36.8503
32.9442
35.0854
44.1269
59.4292
82.2247
102.893
119.667
137.721
152.87
163.211
161.701
162.178
154.298
149.803
146.869
145.382
136.355
136.914
137.602
129.918
128.453
121.631
109.464
91.0244
70.7706
55.2691
52.5253
57.8891
59.1358
56.6077
52.514
49.6657
51.9353
62.0979
82.4256
107.988
125.073
128.652
131.086
142.427
152.817
173.927
177.2
194.876
184.999
192.982
187.827
180.173
177.36
156.786
162.21
149.847
143.937
132.227
116.225
94.6618
73.0015
57.3116
45.7592
39.6366
40.0491
41.5871
38.56
43.8999
71.6195
115.309
100.36
94.11
86.4423
78.5743
64.194
51.063
37.9016
34.558
46.2726
59.1983
67.7405
75.2648
80.3626
75.6791
65.5038
78.5391
90.2028
95.4537
97.5309
96.4002
91.7654
86.2808
81.995
77.6168
74.717
73.3672
68.6683
61.2584
48.667
41.4877
41.3048
38.546
32.8271
33.0464
47.1173
59.007
65.8067
67.9391
67.2672
64.4048
58.2922
54.4558
51.7953
50.4699
53.8543
58.6526
63.3438
66.1889
69.1057
68.9775
64.9467
60.4684
48.1689
32.1852
22.9087
23.5836
22.0756
19.699
23.1413
19.9651
9.64975
2.86598
2.71628
17.5898
14.2098
18.2727
22.6343
24.6221
23.5245
21.056
19.6583
18.821
18.9161
21.4612
33.3412
52.3104
63.7555
66.4465
67.0738
61.5252
50.2965
36.4446
24.166
17.3568
16.8541
19.6837
24.6145
31.7688
38.4213
45.2355
54.2104
61.9167
64.2885
60.3382
56.0215
54.395
56.4477
60.3609
64.2945
69.176
68.4483
68.2843
64.9818
62.9826
63.1535
61.1528
61.4199
57.5401
57.2959
54.5329
56.7193
52.9276
43.6626
37.0578
31.3019
27.8426
27.1462
28.9715
32.4572
34.9567
39.9107
47.7898
61.402
74.0415
85.5056
90.4901
96.4666
97.527
100.587
100.574
100.808
97.3962
92.9175
86.0124
80.5159
74.0929
71.0421
69.8537
71.3321
74.1401
80.857
92.9035
106.364
105.928
70.5561
52.427
39.5158
34.1343
37.0854
44.7461
55.5061
70.4422
87.3263
102.587
116.608
125.75
129.862
127.431
126.219
122.838
119.18
116.53
113.3
111.436
109.151
106.821
102.885
96.5157
88.6266
78.7082
68.5646
64.0223
63.7408
62.0502
60.9836
60.6519
64.3704
71.463
79.5181
87.5592
95.8905
104.753
110.235
114.289
117.411
120.723
121.96
124.182
121.214
122.743
117.302
113.862
106.758
100.536
93.6903
86.4934
78.5074
70.2675
61.5899
53.5751
47.2096
44.1994
46.0506
52.4618
60.4536
65.6231
71.7008
70.3149
51.9917
39.6199
32.1605
29.8745
32.279
35.1924
39.0689
44.859
52.7934
59.6337
65.6238
73.2791
79.5978
85.22
85.6964
82.9291
80.9154
78.0058
77.7097
80.7081
79.3168
78.9173
75.8657
70.8024
65.7402
64.0178
66.3859
74.8289
82.595
85.1446
82.2089
71.7651
57.1522
48.3831
46.0828
50.8501
57.9018
66.9658
83.2473
109.8
138.822
153.776
155.999
156.307
155.039
140.963
126.297
116.237
110.097
105.15
103.176
99.7894
106.276
115.52
122.677
121.318
115.238
94.0321
69.0196
55.2049
49.3497
46.407
42.7416
35.989
34.2292
40.3558
48.4268
57.4054
66.9206
75.9233
83.1715
89.7041
93.4706
98.7077
101.989
107.203
105.767
112.477
109.679
107.687
106.453
100.903
101.357
93.8598
93.301
88.6563
84.1818
77.7595
70.2257
61.5681
54.5679
48.2311
42.9372
38.757
38.5293
43.8602
51.0052
58.4189
68.661
81.1724
92.5062
105.174
113.842
116.515
127.425
129.812
129.884
124.706
123.448
112.018
110.276
98.1138
97.3572
91.3665
90.7852
87.6381
82.7126
74.7173
62.2649
49.7199
42.0684
41.9987
48.1848
48.6527
40.7537
29.9072
24.6779
27.1095
34.8489
46.7216
66.5521
90.6968
108.804
129.266
148.167
172.075
179.363
192.058
189.496
188.13
183.438
174.908
169.215
163.608
150.011
142.268
132.566
118.596
101.557
84.925
67.2199
57.3455
57.1555
58.69
55.3411
48.317
41.2799
37.0766
40.4431
50.9032
67.7628
93.828
116.713
126.191
132.343
142.154
155.416
179.524
190.933
209.957
214.154
216.947
215.665
211.151
205.034
181.883
172.557
152.454
137.85
119.821
101.414
81.4347
62.8522
48.9387
40.7963
38.0544
38.3347
38.296
37.6779
50.9018
77.326
110.311
94.9754
89.4761
82.8597
75.4494
65.647
55.8948
50.1242
50.1089
56.357
64.203
69.8354
76.0023
79.7235
73.8504
57.1245
60.5879
73.488
79.7129
83.2274
87.9088
89.0311
84.17
78.3511
73.7264
69.1497
64.3501
58.8134
51.9744
44.6464
33.8349
28.9692
25.8686
26.7352
31.6919
43.3928
55.0733
62.6208
65.8222
66.4589
66.3923
64.5859
62.0609
63.1979
63.6963
65.1285
67.6487
68.5817
70.2488
70.4963
67.2227
62.552
57.1242
43.6949
28.9015
21.2719
21.6621
18.9175
12.7356
11.0493
7.93454
5.05296
2.26083
2.56294
16.8828
13.4262
17.5583
21.9842
24.4613
24.184
21.5415
19.7457
18.9499
19.2229
21.0939
30.44
45.605
57.5558
58.0919
58.6353
52.8212
41.1925
28.4154
19.4862
15.6372
16.29
18.9072
22.2091
28.41
34.5274
40.9556
49.7149
59.8292
66.0796
67.2047
64.5453
63.1095
64.6931
67.7431
69.4339
70.2543
66.9789
63.8963
60.344
58.2046
55.3451
54.4947
54.1158
51.714
51.7774
48.505
47.6302
43.064
35.7355
31.3534
28.2317
26.8454
27.1215
28.4313
31.3036
33.0493
35.6607
41.0696
51.8963
64.774
78.6493
86.2976
93.1705
93.0632
96.2627
94.8907
95.8611
92.6044
90.6142
86.1511
85.13
85.4727
89.1984
91.3984
92.9404
95.0479
98.2425
102.777
102.109
92.1183
62.2623
45.633
35.4417
32.5305
33.9332
36.9183
42.9051
54.4229
69.6302
85.7018
101.186
115.249
124.341
128.387
126.282
124.659
123.459
119.534
116.619
112.502
108.333
104.256
100.436
94.1529
84.5737
73.3956
64.8632
59.0206
56.2811
54.3221
51.2892
48.6492
51.414
59.3211
67.625
75.5499
85.6338
97.1404
106.031
112.848
117.392
120.617
123.969
124.951
128.393
126.002
124.538
121.885
115.387
109.376
100.426
91.3022
82.4455
73.7952
66.2762
61.0532
58.6202
59.1065
61.8986
65.6606
68.474
70.5287
70.5907
62.8744
44.8184
34.5302
27.94
27.6486
30.4888
32.5298
34.7173
39.7868
47.9029
56.3293
63.8149
69.6409
75.8201
80.3562
84.9166
85.8043
85.5345
85.2325
81.9604
81.2514
81.5301
78.2502
76.8318
74.4168
74.1064
76.3807
80.6316
82.9215
81.9028
77.3813
70.9242
60.2035
46.0513
37.7008
35.3429
40.9643
49.8487
58.5539
69.5546
87.6643
113.109
136.385
155.738
160.999
164.595
166.533
166.328
164.59
161.185
156.645
151.355
146.603
141.417
136.678
131.005
121.337
102.348
68.5538
53.5816
46.9384
43.7684
40.0287
34.972
27.3293
24.1023
30.8522
38.6548
46.972
57.6819
68.7433
78.8777
87.422
94.703
100.633
107.679
114.855
117.519
123.885
122.605
123.545
119.271
115.881
109.693
101.287
96.3607
88.9343
81.559
74.329
66.6063
58.7983
52.2826
46.5522
39.9004
33.1284
30.7367
36.5649
43.7558
51.0785
59.6288
71.7268
87.4447
100.972
110.025
121.882
136.694
141.176
144.597
145.637
142.909
131.963
129.113
111.64
109.167
97.2638
91.9604
83.4611
75.6441
65.4646
54.9348
46.2792
42.6948
44.5275
49.0217
47.2769
38.1034
26.8199
19.7653
21.6075
28.6001
35.9462
48.55
73.2876
93.9481
112.72
136.517
161.456
187.577
208.592
211.307
208.05
203.996
198.916
190.15
174.401
165.586
143.303
127.759
108.735
91.5573
75.2378
63.8085
57.7509
56.4707
55.2372
50.326
42.6745
33.1862
27.3301
31.1437
40.83
52.1335
72.7794
101.037
118.878
129.216
140.253
153.755
171.511
189.25
212.529
221.2
224.726
223.47
219.422
211.432
200.599
172.634
149.889
125.793
104.971
85.6706
67.8808
53.6673
43.4962
39.1899
40.0766
41.3352
41.1305
46.1103
61.1744
78.7927
96.7395
86.2784
80.5708
78.3393
72.6311
69.7171
65.0699
64.7528
65.9873
69.5698
73.2967
75.9979
79.7811
80.2517
71.5375
52.4681
45.3906
57.8998
64.3324
66.7637
71.3225
77.5239
80.3404
78.2584
73.0944
67.0819
60.8044
54.0159
47.0399
39.3277
23.0054
20.9611
20.2793
22.0531
28.2281
38.7567
49.2773
57.3987
62.2907
64.8198
66.7539
69.4271
70.0131
71.5726
74.4732
75.5186
74.6836
74.7908
73.3586
69.631
64.8685
59.5908
51.4331
37.1572
24.6796
19.4305
18.0551
11.4105
6.14227
5.21992
4.32426
2.92402
1.87442
2.42575
15.4276
11.9708
15.8173
20.3266
23.5353
24.7753
22.9408
20.6057
19.7943
19.8405
20.9505
26.2364
35.0923
47.5355
50.8068
51.0534
44.1018
33.5479
22.8897
17.2893
15.5183
16.9186
18.9131
20.8138
25.6065
31.1541
36.1289
43.8943
53.9817
63.8268
69.0672
71.0385
69.9536
70.1303
69.9372
69.4099
66.761
63.509
59.3513
56.0572
52.4268
48.6879
46.9085
44.006
41.8652
41.9509
38.5853
37.8836
34
29.8086
27.9169
26.7418
26.6124
27.1403
28.4336
30.7279
32.2072
33.3449
35.2431
42.3917
52.5924
67.2475
80.3669
90.7952
94.2177
98.5892
97.4217
101.369
99.3434
102.219
101.618
105.227
107.066
111.153
110.908
107.583
101.579
95.9117
92.8687
86.1609
73.2687
53.5485
42.8221
36.1443
34.4681
35.0287
35.3658
36.1674
39.8032
51.6286
65.1803
81.1095
96.1282
110.363
120.063
124.761
126.091
123.687
122.404
117.905
113.097
107.999
102.192
95.5308
87.4807
78.3676
68.1413
59.4353
53.8757
49.6183
45.9858
42.8897
37.7507
36.8977
41.9013
50.8718
60.1302
70.307
82.9853
96.6393
107.83
115.27
121.376
125.965
130.529
130.432
131.839
131.043
125.13
119.697
111.23
103.88
95.5032
88.4091
82.6736
78.4417
76.0105
74.6809
73.8969
73.0864
71.9386
69.9089
67.6964
62.5619
51.7379
36.6456
28.981
25.5418
26.6432
29.1979
30.3959
31.2791
34.4334
41.2366
51.1189
59.5435
66.0788
71.4593
76.3944
80.689
85.7424
88.716
91.3332
94.2595
91.9533
91.6786
91.2614
88.8687
89.3046
88.5011
87.613
84.3795
80.0712
73.5399
67.3273
59.2477
47.648
34.588
27.9468
25.9659
29.5895
37.4561
46.7693
56.6828
69.1259
86.403
105.266
123.183
143.438
162.621
169.177
172.871
174.525
173.176
170.043
164.783
158.69
151.196
142.191
131.534
117.179
88.8001
62.4339
47.7295
40.6663
37.3271
34.4467
31.1269
25.4198
22.0227
26.5809
31.3086
35.4716
45.4976
57.9368
70.2188
81.4553
90.9912
100.115
108.761
116.046
127.264
127.587
134.947
131.267
129.354
123.93
114.064
105.478
96.5528
86.3408
77.1212
68.3515
59.9561
52.9148
47.3924
42.4784
36.8795
30.2378
27.7252
33.4966
38.1216
41.2311
48.1591
60.6086
76.9772
91.2664
104.551
119.531
136.798
142.662
156.089
155.179
157.813
144.428
140.44
121.662
115.074
98.3133
89.8695
77.5101
66.8709
56.9339
49.0284
43.6505
42.4581
44.5899
47.2231
45.4967
38.3057
29.4595
23.9564
25.1888
28.85
30.5459
34.2381
53.2016
76.1402
95.4272
115.748
139.578
166.544
189.253
217.179
216.441
216.69
210.897
202.057
170.258
158.916
133.624
110.901
94.5471
78.9554
66.4501
57.4384
52.6371
50.2343
49.4845
46.253
40.8547
34.4812
32.3005
34.9696
38.4733
39.7398
50.1448
78.917
104.642
120.975
135.26
149.366
162.771
184.743
200.067
216.112
219.13
217.875
212.216
202.224
187.434
156.701
132.693
109.352
89.9588
73.6979
61.0464
52.4697
49.5489
50.4771
51.4074
54.4504
57.9229
60.797
69.1813
74.6988
81.4533
72.3944
70.7748
70.5621
71.9782
73.2453
76.3122
78.5995
81.4069
83.8093
83.3343
84.181
84.9975
80.7773
67.4543
46.8371
36.9648
46.8177
52.1049
53.0336
54.1687
62.0047
67.5797
69.9151
67.9648
63.2059
55.2602
46.7277
34.6065
26.0007
21.4508
20.4049
20.0377
20.781
24.6288
32.6607
41.7397
49.8224
56.2589
61.363
65.4837
70.3277
75.7462
77.6175
81.0768
81.3459
80.6505
77.9261
73.2574
67.9933
61.5735
54.5799
43.4705
29.0822
20.3785
16.8764
12.9011
6.84134
3.9026
3.30897
2.79862
2.0834
1.70108
2.32059
13.3137
10.4613
14.1573
19.0317
22.9519
25.4797
25.7042
23.8394
22.0976
21.711
22.0863
23.7669
26.2652
31.8731
35.6974
37.1834
30.9976
24.5958
19.0132
16.7896
16.5709
18.4498
19.7414
20.4471
24.1558
29.4798
33.0264
37.7566
45.739
55.7046
64.9952
71.0535
73.0792
73.2261
70.9118
68.4665
64.394
60.702
55.707
51.8979
46.9013
43.6256
40.8828
38.8034
37.3827
36.8768
34.4182
33.3819
30.7538
28.7782
27.7655
27.1479
27.1466
27.6391
28.8101
30.6296
32.2719
33.2877
33.1171
35.1633
40.4804
51.4604
65.3253
83.0981
93.8789
102.156
106.439
114.522
117.438
124.76
126.422
130.839
131.026
131.766
127.253
118.225
105.147
91.744
80.0606
70.5488
60.5212
48.9279
44.1782
41.6197
41.5964
41.153
39.6911
38.3521
36.7287
38.4511
45.2244
58.4127
73.2276
88.0479
102.119
113.7
118.787
121.927
120.569
117.912
112.877
106.274
98.4584
89.4584
79.9018
70.423
61.5993
53.6442
47.1658
42.8655
38.559
35.3612
33.4202
33.3872
34.2648
36.7445
43.2543
52.3923
64.69
80.0269
95.6355
107.934
117.152
124.887
129.485
132.773
133.59
128.269
126.083
119.203
111.171
106.221
99.9425
94.6657
90.3747
87.0026
83.9403
80.9312
77.3745
73.0276
67.7127
61.9339
55.7871
48.9243
39.8688
29.7278
27.0172
26.9255
28.3355
29.9043
30.368
30.3319
30.8668
34.1381
42.29
52.3718
60.3618
66.3165
72.3306
77.8251
82.6386
88.4841
92.1396
95.4227
99.0444
98.1984
98.8171
97.0031
93.1529
89.2272
82.9557
76.049
68.0621
60.7575
53.4787
45.8547
35.9634
27.3451
25.9047
26.0439
27.2873
29.5043
34.1336
42.9031
53.1368
65.65
80.6313
94.3193
106.149
120.609
135.86
152.884
164.134
171.474
171.09
167.022
160.744
152.286
141.136
127.617
108.498
84.4298
62.9681
47.1013
38.311
33.7554
32.0796
32.3019
31.9516
32.4966
33.2159
32.8868
30.0015
32.6846
44.548
57.4744
70.5709
82.841
93.9889
104.835
113.786
124.841
130.646
134.988
135.582
132.088
124.617
115.132
103.875
92.7822
80.5249
69.278
58.9519
50.384
44.0506
40.1026
38.0875
37.1234
37.4064
39.7484
41.9681
41.6444
37.4719
38.1559
47.8328
63.0543
79.1896
94.813
109.824
126.84
136.637
151.144
154.371
157.253
145.436
142.107
122.84
113.713
95.7277
84.9131
71.3483
60.7262
52.0405
45.5098
41.3724
39.8276
40.4202
42.4156
43.4769
42.1392
40.6274
40.1016
39.891
38.9863
34.8493
28.2323
34.0999
56.8641
76.8867
94.6909
115.798
137.166
156.325
176.72
187.725
190.483
187.774
169.075
149.899
132.247
112.108
95.7945
79.1719
67.1872
56.8524
49.2547
44.5906
42.8135
43.0453
44.8514
45.7639
47.4198
48.6472
48.4696
46.6701
41.4665
35.8584
52.5887
82.7864
106.35
124.66
145.145
161.744
180.209
193.108
208.46
213.058
210.626
204.545
186.363
170.687
145.8
124.046
104.342
89.5552
79.082
72.8854
70.5153
69.7429
70.2717
71.4017
73.1651
76.1912
73.9026
71.69
67.0089
64.2874
59.1413
59.4537
64.4569
71.0592
79.0121
85.9738
92.7061
96.2556
95.4961
94.5503
93.4765
88.2933
77.3238
58.8608
39.0622
32.9654
38.3648
43.5621
43.4679
43.743
50.1153
59.9759
65.0336
65.9866
63.3553
57.1059
46.9561
37.2989
30.2804
26.3389
23.4571
22.0283
21.3583
22.1771
25.8558
32.7457
39.8527
47.0216
54.6091
61.8327
68.3737
76.1497
80.759
82.6376
83.4114
81.3889
77.058
71.6943
64.4674
56.4521
47.1292
32.7586
21.0239
16.6186
11.0233
7.82303
4.50003
3.0947
2.61212
2.24482
1.9
1.68722
2.23905
10.3444
12.9151
17.8603
22.7427
23.9157
22.4329
21.8487
21.2793
20.5699
21.0666
21.5349
22.8969
22.9949
24.2829
24.6491
26.1915
25.6246
25.159
24.0203
23.9467
24.3192
25.4954
25.2577
24.7608
27.398
33.6461
36.9515
36.5925
35.66
38.6925
42.8288
47.2256
49.8253
54.288
57.3872
60.3625
59.4663
58.2542
54.0194
49.7257
43.9971
40.3611
36.5378
36.2818
35.0573
36.5468
36.0853
36.6972
37.0489
36.9406
37.4593
37.9544
38.792
39.4526
40.5447
39.8689
40.0576
39.8505
39.5892
39.0413
36.019
35.8765
38.7658
49.2802
57.6657
64.911
64.8369
72.4384
70.2546
76.4744
73.3512
77.6169
75.8087
79.8763
82.0451
85.4257
87.6393
86.6372
84.4649
79.5599
73.7874
65.2175
61.3929
57.8547
56.1416
53.5048
50.1499
49.8005
47.1052
47.6985
47.4109
52.0216
59.5413
68.3198
76.8449
82.136
87.4017
89.925
92.3836
94.8284
96.6608
95.709
92.3141
87.7868
82.3471
76.8181
71.3026
66.4492
61.7576
57.2463
54.5933
53.8171
52.3595
51.7605
49.9389
48.2546
48.5523
49.9449
50.3063
56.5015
65.3514
73.7826
78.9236
81.8154
84.1576
84.0823
81.878
82.8021
79.4351
79.6164
74.9212
73.3324
69.7056
66.377
64.0634
62.7293
62.4284
62.971
63.6589
64.0481
63.3683
61.569
58.4462
53.4466
47.1507
42.1741
41.3101
41.7894
42.7937
43.7798
43.8924
43.296
41.8575
39.2347
39.1073
41.6772
47.6064
52.1652
55.634
58.3493
60.1102
60.5195
63.5866
63.1872
68.044
67.4821
71.7998
70.1689
71.5259
69.22
68.3191
65.809
63.7348
61.0006
58.0932
53.54
49.6282
46.4358
44.3951
43.0509
42.1866
41.6357
42.2006
41.9254
40.8646
43.481
53.8682
64.7469
72.0181
76.6122
81.2995
84.0932
85.0874
88.7991
90.0893
94.2099
93.9593
94.5645
93.08
87.1331
82.3134
75.4154
67.7134
61.8046
56.4124
52.4797
50.8587
50.0402
49.4688
49.0946
47.7467
45.4352
41.6548
36.6075
37.6144
45.9748
54.6139
62.554
69.0086
75.2876
78.6401
87.5986
86.6952
96.9529
96.5643
102.632
98.5522
98.5947
91.8719
87.2555
80.7958
74.8
69.3646
65.0914
61.4731
59.137
58.0194
57.4135
57.4054
57.8768
56.5636
53.8984
50.3853
47.3252
46.6945
55.2578
66.0895
74.9582
81.1259
91.1641
94.4847
105.033
104.865
113.553
107.876
114.472
102.839
102.267
91.562
85.6936
76.8961
71.4897
65.8886
62.1492
59.0453
56.7699
55.0299
53.6842
52.4599
50.8186
48.9192
47.1519
45.7367
42.9894
39.6937
35.6205
33.637
44.0119
62.7792
70.1689
81.9522
90.6098
97.8107
114.199
113.374
124.413
124.342
117.6
118.762
105.766
98.5886
91.6185
82.8483
75.5711
69.5644
64.5859
60.5043
57.9388
56.7207
56.2035
55.9734
54.8692
54.3817
53.0373
51.7484
50.059
48.3078
47.2358
60.7755
84.5491
99.9181
118.45
132.411
151.211
159.133
162.211
165.827
169.511
173.097
172.492
170.681
164.474
144.728
130.713
118.036
106.798
97.8136
90.0464
84.6511
80.9799
79.3087
78.62
79.827
79.6711
82.5226
79.0351
79.4789
75.4844
79.3938
82.1101
89.6764
92.6776
99.02
97.2355
94.9871
92.5856
92.0553
88.9738
84.6072
75.2611
55.6773
47.7797
49.2977
54.0671
57.8502
58.7884
57.5329
60.0881
73.4958
80.7777
83.7678
83.1394
78.9177
73.6011
63.9477
55.5762
46.9787
39.1533
34.0783
31.3704
31.0111
32.8713
37.315
43.4612
49.1509
54.4921
59.7529
63.4292
66.0137
66.2383
65.3675
62.9715
60.85
58.8483
56.6373
53.4214
51.6495
44.1026
26.9631
11.9175
6.65566
6.63451
5.85135
4.48957
3.82683
3.50538
3.21961
2.90228
2.5531
2.13519
5.78352
10.1869
12.2876
13.7645
14.6871
15.2357
15.1602
14.6176
13.6539
12.0699
10.4643
7.68106
5.24289
4.60665
26.7258
37.9819
45.1169
46.5788
45.5265
44.7092
44.3177
44.4104
44.3546
44.5114
44.7649
45.3089
46.0615
47.3594
48.9646
50.8197
52.5545
54.0057
54.9411
55.2825
55.8279
54.7578
54.4061
53.2593
51.9372
48.6928
41.6971
30.0693
19.6197
16.126
29.5599
32.5682
36.0429
41.0846
45.4908
47.3899
50.3944
51.0535
51.8256
50.5219
50.1205
49.5965
51.0634
52.291
56.8173
59.1649
64.3885
65.5061
69.3328
68.4024
71.5274
70.7635
72.9209
71.5634
70.5059
63.826
54.2454
41.5639
27.9408
24.8324
38.66
44.8171
43.0077
46.0505
47.3328
49.7929
50.4395
50.8228
51.6152
53.6791
57.2025
61.9429
67.8529
73.9084
79.9056
84.2385
87.9597
87.7836
85.6974
85.1726
82.2804
79.0457
75.4675
71.7497
70.474
78.5161
74.8241
59.6718
43.3815
40.5614
40.8849
44.4811
46.4904
49.6615
54.7671
61.5245
70.1065
75.9393
85.2056
89.1056
96.9305
99.5462
104.032
107.371
106.966
108.411
102.618
105.826
96.2679
94.9093
88.3565
81.8178
73.2899
66.3303
59.7907
48.5223
35.4533
26.8914
27.2318
29.6192
25.8448
27.6544
31.7785
35.6097
38.589
41.6261
44.5263
46.5074
47.1389
47.3117
47.923
49.1976
51.5681
57.1034
59.9592
65.5666
72.1183
73.55
76.8508
79.3903
82.5641
82.7216
84.1529
82.6302
78.8346
72.6805
63.1244
50.5498
40.3109
34.8878
32.734
38.6819
53.1782
59.3909
63.1891
65.9205
66.7322
63.6533
67.941
74.7227
84.6238
94.1145
102.228
111.05
114.333
119.287
111.275
110.521
105.238
97.0943
93.7731
87.4607
84.1169
80.3436
83.3203
81.4354
78.821
70.5691
58.3995
46.0478
30.809
31.0657
36.4101
41.4554
45.7423
51.4367
56.9862
62.9909
71.6871
74.747
86.1339
86.5211
97.944
95.1355
104.863
99.3974
103.949
99.3183
94.0191
90.9711
83.4544
76.3883
70.0037
60.5696
52.4471
43.1065
39.2587
36.2831
33.7908
32.4833
33.5582
45.3178
53.8236
62.2032
69.3053
77.5524
86.4471
90.9923
102.748
102.478
110.788
113.893
112.151
104.882
106.767
96.181
95.6979
86.7483
80.2948
74.2965
68.5292
56.3749
45.8594
42.6183
39.7954
36.9816
33.5903
31.4363
28.2019
26.3385
29.8467
33.8725
43.2757
55.4229
67.2812
80.0261
88.7971
106.345
107.954
129.662
120.893
130.444
121.416
122.441
112.938
114.851
101.494
99.7599
89.1507
84.9062
74.4559
64.5941
52.4884
49.3316
48.9249
48.1367
46.2113
45.8578
46.0759
46.0816
42.8427
46.7551
58.5999
73.1331
87.1623
102.274
117.258
134.346
142.306
162.709
163.045
165.939
163.456
159.769
156.783
153.728
134.785
119.164
105.579
91.6052
79.7366
72.5584
67.6133
61.5354
56.7902
53.2869
52.0954
53.1379
54.3734
53.3748
36.9829
44.7027
57.0263
68.1672
73.4779
73.581
71.4834
68.4746
66.8649
64.525
62.8726
61.2161
58.8522
57.6734
58.8386
62.0795
66.9959
72.8316
78.912
84.8329
88.3208
88.7519
87.2068
87.6237
84.3938
80.4922
75.3031
70.5183
53.2809
31.2352
21.9294
29.4738
32.9181
33.2226
36.1416
50.3579
38.3879
43.9134
51.4307
57.1386
60.773
65.1179
67.5204
71.6238
71.2549
69.1821
64.7124
59.3916
52.9047
45.9876
38.4448
30.4371
22.2661
15.757
10.4802
6.88563
4.54193
3.82607
4.43657
4.26199
11.3432
11.1771
11.9394
12.3133
12.6159
12.9825
13.5084
14.041
14.7403
14.919
14.1769
11.6307
8.12061
9.05032
28.2377
29.5909
35.6109
36.0725
34.9637
34.3777
34.0308
33.4634
32.2739
31.2944
30.9122
31.8529
33.9305
37.0605
40.8684
44.8657
48.5503
51.3397
52.9217
53.6548
53.3383
53.0155
52.4887
51.632
50
47.0116
42.5122
36.1447
27.5603
26.9647
29.2125
29.3298
41.4637
51.4962
55.9521
56.1697
53.9875
49.9945
45.7252
41.4604
38.5091
37.2262
38.7521
41.8835
47.4186
52.8243
58.8412
64.036
67.9439
70.5569
71.8569
72.0195
71.2224
69.6288
65.9227
59.2515
49.8745
40.0776
32.1411
39.2183
47.0055
41.8607
40.4714
40.7039
40.0039
40.0061
39.9173
41.7835
45.9883
52.0827
59.7381
68.9321
79.4116
90.8102
102.865
113.551
123.584
129.713
130.518
126.067
117.793
108.34
97.5157
83.912
70.3345
61.6524
54.745
46.898
41.1017
61.7561
40.7634
27.923
32.5611
41.4006
51.8151
60.9508
70.2508
78.1399
87.1116
94.0752
102.643
107.594
117.061
121.098
126.692
129.333
128.445
126.75
120.355
116.057
105.611
92.808
74.3717
57.624
45.4964
37.1971
31.3314
27.4117
26.5351
38.7251
35.3892
29.5769
34.5721
38.4505
40.3148
40.8346
40.236
39.0987
38.0676
38.2652
40.03
44.289
49.6908
56.5109
64.4992
73.7733
79.415
89.95
93.3853
96.2826
98.8342
96.5037
95.535
90.6105
84.5465
75.0734
61.9367
47.2681
35.22
44.9324
38.5079
34.2099
43.1653
45.7697
42.9765
36.473
36.5297
46.1238
61.6402
78.7937
96.6678
113.501
128.006
144.411
154.52
171.39
173.823
175.317
171.994
161.736
150.695
129.848
113.279
99.8502
84.1226
74.3967
67.2413
58.8746
49.1534
64.7284
36.5601
21.0035
22.5998
28.1484
36.4769
45.4397
54.4279
62.9594
73.2275
81.134
93.1666
99.3589
111.893
116.282
126.344
125.602
132.317
128.892
122.181
117.376
105.359
95.6921
82.0269
68.2256
56.0684
41.5672
31.4343
26.7258
26.0341
40.1899
43.3705
44.4037
51.6416
59.9832
69.8222
79.5626
93.464
102.654
117.844
127.82
141.346
148.889
156.666
157.014
155.697
145.516
138.344
127.051
114.316
99.8342
84.943
65.7736
44.904
32.7964
29.7183
29.2489
28.1057
27.2061
26.7195
34.9933
39.8167
37.4021
49.7232
64.3097
78.1584
94.4591
108.676
130.833
147.522
171.233
181.142
199.35
204.039
198.622
193.197
177.505
163.339
147.807
123.207
108.432
84.8271
64.1674
45.3553
35.4997
36.8568
37.64
36.4973
35.786
37.7019
49.5837
47.634
42.9703
59.3751
76.6015
96.1896
116.784
135.934
171.611
187.441
203.452
216.482
224.795
231.388
233.825
231.848
226.702
217.614
192.073
162.81
130.178
96.6152
68.1025
50.5924
46.416
48.5293
49.4874
48.3935
48.2025
50.5613
60.4394
52.4451
35.2441
47.841
58.7784
65.4782
64.0804
64.2802
64.4319
67.2092
64.5416
62.5761
58.8334
54.3034
50.9927
50.1599
52.3358
56.6697
63.1751
71.3887
81.0353
90.2659
99.5924
106.036
106.101
104.144
96.4253
85.0301
73.6829
60.0813
67.6085
31.885
30.5684
32.2015
37.489
57.3572
64.4032
50.0936
58.2007
67.5261
74.1939
78.7875
81.2022
81.7899
79.488
76.244
69.8738
63.9347
56.1939
48.518
40.7198
33.2567
26.9061
20.6564
15.0318
10.1612
6.6737
4.46939
3.47194
3.47661
4.98261
14.8218
12.7901
11.8424
11.191
11.2103
11.3775
11.6303
11.8122
12.0819
12.879
13.9785
13.2608
10.023
10.6732
32.8118
33.4021
35.1907
33.26
32.6981
33.493
34.2103
34.4659
34.3398
34.1671
34.4052
35.4922
37.5819
39.9641
42.552
44.8083
46.7277
48.0591
48.7477
48.4055
47.3698
46.175
45.1377
44.9185
44.9491
44.8825
43.4399
39.7187
33.0627
35.8015
30.3932
31.59
43.2087
50.0461
51.5842
49.958
48.1495
45.5778
43.6464
41.4396
41.5061
42.345
46.2496
49.535
55.2034
57.7469
63.6966
66.0434
69.7499
70.9261
72.2184
71.2667
71.1337
69.3163
68.6313
64.0875
57.3333
46.9485
37.9227
49.7785
50.8715
43.6623
39.9001
38.7645
38.8422
41.8267
46.0671
51.126
56.6349
62.527
68.4913
74.7143
81.7335
89.6475
98.4015
107.236
116.001
122.905
125.548
125.016
123.145
116.726
107.384
96.4725
82.8514
70.1192
60.155
51.4032
44.6729
71.6426
40.8812
31.6102
39.237
47.9694
55.1121
60.605
66.6961
71.5805
77.536
81.9198
87.6072
92.4628
97.8076
102.248
107.343
111.192
110.507
113.218
109.414
109.865
106.499
101.927
91.1617
74.5448
58.6879
46.3657
37.4717
31.4296
28.5384
45.2522
40.1469
33.8396
38.379
40.7894
41.2492
41.0079
40.3828
40.1823
40.6703
41.8405
44.0844
46.7529
49.3201
53.8164
57.0455
64.111
67.134
73.678
78.3672
79.5946
81.4506
81.5859
80.7799
80.3791
79.074
75.5409
66.8512
54.2978
40.6894
50.6527
44.8138
41.4955
46.8735
41.9505
35.1082
34.3979
47.5873
67.998
87.205
103.445
116.492
129.924
138.53
149.88
151.328
162.494
165.112
170.019
170.15
167.177
153.691
132.542
121.168
101.188
86.2964
78.1357
69.6534
62.9061
54.9377
71.7665
40.5796
22.1811
25.7656
34.1133
42.5018
49.5935
56.5881
62.2551
70.6021
76.2481
87.3468
91.7074
104.768
106.497
117.807
120.949
123.306
123.712
117.906
115.329
109.077
100.285
90.924
81.164
68.1544
54.8412
42.086
31.2622
27.7579
43.8618
52.1387
50.8653
55.0743
60.329
67.0062
74.2366
84.7667
92.409
105.071
113.234
125.676
130.737
139.142
139.755
142.434
133.762
131.127
122.889
116.236
107.324
96.563
81.5031
60.8002
42.5264
30.6192
26.4354
25.7869
26.824
27.9837
37.4724
46.2649
48.7422
61.5773
73.7284
84.3324
98.0476
107.492
130.985
139.652
165.182
172.482
188.386
187.967
191.577
190.326
180.666
164.607
159.232
136.567
121.469
101.88
80.1244
58.8807
43.2824
37.2646
32.8647
29.9941
32.6782
37.5075
50.0819
47.7272
54.2896
73.6293
92.0923
109.514
127.367
143.094
169.946
179.827
194.988
208.265
215.935
223.89
227.441
228.236
223.963
217.947
209.59
188.025
160.979
123.237
89.6471
65.1537
50.8834
45.1548
41.3999
39.5456
44.8032
53.435
64.322
59.3358
46.6724
60.035
69.2467
69.0877
73.3375
79.0745
84.434
84.9494
84.3045
82.7626
77.5017
74.0848
69.1974
64.8218
62.0684
60.871
62.1312
65.3589
70.7464
77.7008
86.7716
92.6768
97.4081
97.7475
95.5988
88.3899
78.6463
67.765
75.5463
34.1949
25.7271
25.7946
45.5245
69.3718
56.1025
58.6472
66.5694
72.5983
76.1984
78.3674
79.5695
79.1623
78.1484
75.5168
72.4961
68.6442
64.7303
58.6174
50.7196
41.1508
31.9232
23.4825
14.9969
9.79273
6.24996
4.25744
3.37156
3.45055
5.43989
16.4699
12.9005
11.4272
11.3296
11.5805
11.7218
11.693
11.4773
11.3088
11.532
12.9294
13.9896
11.6093
12.0416
37.9359
38.8727
35.8706
32.4662
31.9179
32.637
33.823
35.4133
36.752
37.562
38.5265
40.1914
42.3531
44.1246
44.8398
44.783
44.3031
43.5604
42.8171
42.1653
41.0966
39.9268
39.23
39.1119
40.0483
41.4359
42.3542
40.919
36.3782
41.3275
32.2554
35.5418
44.8128
48.3853
47.1971
44.7912
44.1534
43.828
43.9918
44.0577
46.5929
50.0927
56.3175
60.147
62.2681
63.0808
64.2902
65.3576
66.9092
69.9378
69.8589
69.9847
68.9592
68.7578
67.6239
66.4643
61.7963
53.3911
43.2457
56.0345
55.7561
47.0365
40.0605
37.9075
39.0358
45.1566
52.2922
59.0852
65.9379
72.2991
76.8908
80.0625
82.5193
85.2606
88.9002
94.2877
100.364
106.746
113.14
118.99
120.575
117.901
113.514
104.633
92.6805
79.0963
66.3587
56.4599
48.6848
76.1485
42.2075
36.0201
43.5163
50.9243
56.4883
59.4688
62.1599
65.2456
67.6112
70.4478
74.2466
77.0393
80.8168
84.7448
88.3887
91.0369
93.2045
95.9513
96.0576
99.2014
99.3707
100.553
97.206
86.7872
72.4542
57.6231
46.0691
36.6115
30.6228
48.2283
44.7462
38.7022
41.557
41.6724
40.9421
40.4638
40.7465
42.0662
43.7577
45.7149
47.3794
48.6203
49.9725
52.6685
53.1769
56.8903
58.9238
60.7832
64.726
65.5122
67.7193
68.7056
67.8534
69.5796
70.7982
71.9778
68.9199
59.4085
46.1165
54.0468
50.9064
47.5841
46.3426
37.505
33.7098
43.9647
68.3835
86.0848
97.4234
108.448
116.456
120.877
117.138
113.803
107.73
110.269
113.893
120.616
132.626
140.482
134.655
133.486
117.533
99.6027
86.9069
74.8152
70.1536
66.6609
59.9937
75.9554
42.7839
23.8022
30.1496
39.1579
46.4746
51.805
56.2991
60.8721
65.9728
69.9387
77.7219
82.7687
93.3049
94.5672
107.357
106.556
110.91
112.464
109.987
111.526
105.797
99.8333
97.0366
88.3953
77.1506
66.0639
51.8189
39.0854
30.7641
46.0485
55.5077
51.9543
55.4367
60.3563
65.8747
71.9587
80.1444
87.28
97.605
105.711
115.087
123.456
126.175
128.217
127.358
122.849
120.23
114.103
112.628
108.684
102.865
93.302
75.6432
55.6518
39.6584
28.9627
25.6401
27.2364
28.4738
39.0671
49.5284
55.9715
67.7051
78.9026
88.5581
98.8054
108.567
126.222
133.778
159.619
166.253
177.976
184.436
183.218
174.108
173.094
159.349
155.925
144.168
128.629
113.656
95.2005
73.1836
54.8522
44.4697
35.2525
28.6227
32.0119
37.0517
49.8577
50.8519
64.0517
85.3194
105.095
116.624
130.881
140.159
155.692
166.293
182.229
196.014
203.704
211.757
216.786
217.826
216.541
212.526
207.796
202.025
180.661
148.943
111.467
83.3109
64.6667
50.6156
39.6787
35.3522
41.6505
54.35
65.843
67.9763
60.4716
73.0532
74.1678
77.6335
86.6928
89.5471
93.1834
91.5824
90.7797
92.5306
91.7891
89.2601
87.3449
82.4331
76.7596
72.2038
69.525
67.9888
66.752
69.9858
77.0932
81.2717
85.9381
89.6242
90.2949
88.1692
81.4835
73.1415
79.2091
32.0602
22.2967
28.0381
57.7361
63.8895
59.0351
65.0562
70.8001
73.0502
74.0497
74.5005
74.2078
74.3826
72.85
71.7509
71.3814
69.3106
68.2662
65.3784
58.7799
48.577
36.8982
27.0371
16.8539
10.4093
6.33262
4.26903
3.47432
3.77589
5.8074
17.299
12.8158
11.9592
12.7732
13.6041
13.3757
12.4754
11.7548
11.2638
11.182
12.5269
14.3429
12.8749
13.2164
43.5829
44.8883
37.2007
32.2424
30.3137
30.5351
32.6113
35.6672
38.6218
40.5262
42.3246
44.5058
46.8579
47.2243
45.7625
42.6894
39.2092
35.9414
33.9198
32.8785
33.0715
32.9822
33.6148
34.0862
35.9407
38.0886
40.5379
40.9965
38.4085
44.7139
34.533
40.082
46.4714
47.2121
43.2886
40.105
41.6823
42.8382
45.3297
46.9778
52.5036
58.3774
66.9132
67.0744
68.2849
63.8182
61.2311
57.0684
58.2095
59.8804
64.1593
65.3696
66.2298
65.8317
66.3424
65.6192
63.8072
57.1901
47.9536
59.3134
59.7565
51.4037
41.3343
37.5883
40.4842
48.7467
57.4084
66.232
75.2914
81.9625
85.1925
85.864
84.2734
81.6527
79.981
79.9169
81.8002
85.7141
92.4359
97.8819
103.982
109.538
110.946
107.714
98.519
84.6227
70.8947
58.7932
50.2979
77.2511
43.0495
37.6785
46.2794
53.7437
57.6545
60.0058
60.9859
62.3755
63.3926
62.7436
63.8604
63.5537
65.4123
66.2893
68.8667
72.3377
75.0206
79.4715
82.0967
86.5264
88.9845
94.1415
93.4073
90.4579
79.8529
66.6386
53.203
42.4402
33.5284
50.3828
49.378
43.5955
44.245
41.8886
40.2314
40.1366
41.6862
44.0302
46.9157
48.6701
49.6477
51.1933
51.835
53.1806
52.2216
50.616
49.6572
47.5142
49.0145
50.531
53.3131
56.0925
57.1595
59.8137
62.8741
67.5492
69.08
62.6026
50.8217
56.1431
57.6086
52.9359
44.4339
35.0987
38.1461
60.0114
78.3586
86.4427
97.3421
109.78
113.136
105.131
89.2045
79.8312
74.3204
74.5149
78.2523
82.6447
93.4934
101.158
116.745
117.908
108.373
98.1281
82.4529
71.7446
68.7475
68.1794
65.7769
80.2421
43.8329
25.5964
34.1253
43.2087
49.3744
53.9071
57.2391
60.0551
63.6435
65.1578
70.6384
74.1146
81.6007
84.9119
93.7462
94.8221
98.6492
99.7425
101.283
102.393
97.9952
100.413
96.6742
90.6475
83.8699
71.6906
57.9825
44.2717
32.8345
46.9821
57.0012
51.7319
56.5342
62.4904
68.0708
73.611
79.03
85.0599
93.5269
97.3836
107.611
112.526
116.688
117.825
119.2
112.795
111.955
106.731
106.196
106.194
105.532
100.182
86.7956
67.3453
49.4079
35.0683
27.2225
27.7595
28.1079
38.1547
52.2891
59.0794
71.4444
83.3854
93.116
101.321
109.687
120.571
124.371
140.204
141.895
162.535
161.591
166.114
166.366
158.548
151.896
147.816
142.871
134.129
119.212
106.322
85.4026
65.5715
51.7086
40.7167
32.2567
33.8366
36.6761
49.5828
55.154
71.351
95.0301
113.425
121.277
128.446
128.428
140.11
149.622
167.217
174.546
183.761
193.152
198.305
202.49
202.967
202.867
202.363
201.491
195.916
167.218
131.807
99.2115
77.8785
60.2268
45.4115
36.9687
40.7586
53.6951
65.9831
78.32
73.6878
78.4655
81.0765
87.266
91.7501
91.9897
89.1934
89.3341
89.6402
90.29
95.8129
99.0289
100.793
101.636
96.1213
87.693
81.5218
75.6963
70.0363
66.3287
62.6416
67.0739
76.1967
82.8024
86.2936
86.3405
84.7305
78.7656
80.3664
34.3973
21.3588
35.2224
59.635
61.3394
63.1518
69.0164
71.7241
71.0546
69.7019
68.7207
67.9194
66.7542
66.5583
66.9121
68.0641
69.0368
68.754
68.6775
64.8439
55.1555
41.7535
30.0765
20.0154
11.9593
6.83469
4.54825
3.83618
4.7865
6.50324
17.5949
13.0745
13.1564
15.2621
16.434
15.4806
13.2473
11.7607
11.2426
11.5365
13.1894
14.8978
13.7249
14.2786
48.6157
50.371
38.6225
31.8075
28.2607
27.8337
30.7024
35.1795
39.5531
42.6317
45.4675
48.3509
50.4927
49.3765
45.1712
39.4772
34.2964
29.9488
26.6981
25.1571
25.5716
26.6886
28.5052
30.1613
32.784
35.5858
38.9305
40.556
39.8142
46.3647
37.0754
44.2028
48.3626
46.251
39.6005
36.6306
38.8191
42.4136
46.1333
49.8578
57.5854
66.6295
73.7955
72.1602
72.4597
64.4153
59.279
53.4481
49.7016
49.6518
53.8916
59.3207
61.4887
62.6
63.6298
64.5934
63.5575
60.0299
51.3835
61.3741
65.4934
56.9959
43.9197
38.4942
41.9582
52.0464
62.0322
72.2701
82.8687
90.2444
93.0546
92.4727
88.7435
83.0847
76.07
70.1463
64.3126
64.4181
68.8652
78.5292
89.7682
98.0153
103.658
106.897
99.7413
87.5342
73.146
60.7261
52.3436
79.0449
44.6174
39.1345
49.5813
57.2222
61.8552
64.4774
66.3099
66.025
65.0491
60.5791
57.1544
51.8524
49.0927
46.5347
48.5292
51.6069
56.2813
62.9876
67.34
74.1894
78.1859
84.1857
86.8105
86.1951
81.2763
70.8883
58.0969
45.9637
35.8985
50.8818
53.9659
48.539
46.2942
41.691
39.2152
40.055
42.6127
46.1776
49.3079
50.7284
52.5117
54.1078
56.1606
55.794
54.7528
49.0809
44.847
38.0318
34.6742
35.2125
39.3482
44.7051
48.2478
52.4134
57.3418
64.2719
69.0315
64.97
54.0699
56.0184
65.5413
56.3101
41.9387
36.8158
49.8932
66.789
73.9913
86.368
104.659
116.019
109.595
88.8462
72.0218
63.5801
59.6128
54.7133
55.4894
60.2617
68.1773
81.7609
94.4044
100.942
102.403
90.8056
77.9285
68.4369
65.8451
71.2066
70.5948
81.2068
44.4563
28.1131
37.7217
46.5101
52.7613
57.1102
60.0853
62.6839
63.7292
64.762
65.1942
68.5053
69.0574
71.9235
76.737
79.3397
84.7451
87.1888
90.9518
90.0995
93.3061
95.8318
92.9753
92.3446
85.3535
74.7368
62.3575
47.4466
34.8136
46.6715
58.3358
51.4615
58.2086
65.6274
71.931
76.5952
80.5662
82.3976
88.3182
87.1686
95.1456
94.5424
100.65
103.855
104.652
103.735
103.422
99.905
101.055
101.564
105.118
103.263
94.5617
75.2809
56.9409
41.8783
31.6979
29.6081
28.6623
39.1792
56.4458
59.7535
74.3328
88.0662
97.3074
106.392
109.183
114.55
110.439
114.386
113.346
123.576
126.645
138.828
139.15
147.175
135.901
141.496
132.625
134.998
121.363
111.992
94.7656
73.7978
57.7134
44.0479
35.9466
36.2698
36.44
49.488
61.5901
76.9321
102.563
117.309
121.502
123.735
119.488
129.417
130.545
142.039
139.995
153.634
155.206
164.606
173.752
182.094
187.723
194.182
198.428
200.711
177.385
145.324
113.039
87.5933
69.1042
51.8843
41.5631
41.631
52.3161
65.198
88.1962
83.2301
83.0051
87.4962
91.2698
89.9088
85.6979
83.0143
81.144
83.6504
85.8233
89.7621
97.8405
105.894
111.18
109.631
105.593
93.8346
85.9419
79.3546
70.648
57.4101
54.8685
65.9351
77.0155
82.8629
87.0558
85.5947
82.0817
77.1411
35.7765
23.2674
39.5887
59.0148
62.3895
66.5908
70.6255
70.7391
68.1237
65.0235
62.0642
59.3326
58.6028
59.2478
61.3256
63.7471
68.081
68.3964
69.3032
67.78
60.8814
45.6784
32.5622
22.8079
14.2291
7.74579
5.08482
4.6129
6.27807
7.27157
17.8629
13.4903
14.7392
17.768
19.2659
17.7499
14.4946
12.3156
11.8192
12.6987
14.4573
15.6466
14.6339
15.4732
53.4528
54.7392
40.3552
31.8919
26.47
25.3506
28.4682
34.2108
39.9017
43.993
48.0016
51.664
53.6112
50.1194
44.0204
37.4762
32.2333
26.7515
22.5014
20.0978
21.1158
23.1522
26.0534
28.5419
31.6123
34.6627
37.913
40.2571
40.8282
47.222
40.1083
48.2876
49.3297
44.7016
37.262
33.0005
36.6645
41.333
46.4922
51.2089
62.1855
71.4032
78.4702
77.824
76.6542
69.7275
64.4908
57.3582
50.8341
45.4814
49.3362
54.4651
58.5138
60.0162
61.6998
62.8932
62.9901
60.5206
53.7814
60.3471
71.4241
61.5132
47.0392
40.2343
43.4981
53.414
65.3576
78.0572
90.996
99.9927
103.291
101.779
97.4072
90.084
80.612
68.638
58.1208
48.9254
47.659
59.482
74.294
87.454
98.4291
102.791
98.7828
87.1698
73.6093
60.6467
53.0483
77.4205
47.5349
42.1638
54.2874
63.661
69.9156
73.2694
76.5594
75.7987
73.4148
66.9935
60.2695
49.3941
41.1118
32.5918
30.1941
33.8823
40.5177
48.7673
54.9829
63.1795
68.0124
75.0301
77.7652
80.1809
77.5928
71.2039
59.8511
48.7822
37.7015
50.9363
59.3062
53.1995
47.8001
41.0484
38.4414
39.7741
43.3234
47.4756
50.811
53.1024
55.4585
58.5041
62.1853
61.8522
60.5236
53.9192
47.6467
38.8739
31.1326
26.3781
30.359
37.1656
42.9499
48.5094
55.4221
63.9952
70.1542
66.8814
55.3821
53.871
72.5154
57.9065
42.8763
43.1965
55.9791
63.9537
74.0142
95.2762
116.453
122.345
104.876
82.041
68.735
61.9291
56.6822
46.0694
37.7273
42.9658
55.9604
68.0368
81.7966
93.9897
92.3886
84.2156
73.5406
64.0462
67.0717
75.7906
76.2187
81.4969
45.6258
31.1303
41.2884
50.0647
56.8176
61.78
64.8995
66.9021
67.003
67.0754
63.8982
64.7193
59.638
58.7111
56.8339
59.1165
65.4858
72.7283
77.1007
82.1518
86.3903
88.1438
91.32
90.0989
84.9475
76.7387
63.0193
48.2236
35.3573
46.8159
59.9878
51.3245
60.0919
69.083
76.204
80.7981
84.0693
82.7481
84.5291
80.7686
80.3846
77.0737
80.2222
81.7936
88.8857
89.796
93.8343
93.1487
95.3275
98.3623
101.956
104.062
97.2482
81.3129
62.1036
45.4977
34.7835
30.7775
27.6341
38.8426
63.6499
60.3446
76.942
91.7249
101.713
112.308
110.46
112.851
104.806
100.528
87.857
86.8907
87.5308
102.206
110.575
128.883
120.45
131.478
124.605
130.993
121.195
114.434
99.2134
79.7183
60.2686
45.2628
37.7308
37.5797
35.6627
50.0833
73.2507
81.9498
107.533
119.122
120.668
120.034
118.626
124.554
121.025
124.519
112.812
115.164
106.917
117.137
135.78
154.799
170.186
182.804
194.252
199.131
178.021
151.288
120.052
94.2063
74.1315
56.7275
44.9683
42.7482
49.7654
63.3665
98.3446
90.7182
87.1774
91.061
90.5813
84.1119
77.9721
75.3722
74.6755
75.016
80.3482
84.6558
90.1773
99.78
113.604
114.06
112.765
106.95
97.2095
87.9395
80.0225
70.1666
63.4335
67.9167
77.1416
84.3418
85.5112
86.1399
85.7259
70.8656
38.7026
24.7417
41.0395
58.2177
63.3141
68.7339
71.2565
68.7357
64.9178
60.0606
53.921
48.5933
45.7267
48.1761
53.8414
58.8425
65.589
68.7928
68.9168
68.3981
64.2926
49.3035
34.0987
24.6009
17.024
9.50857
6.4838
6.95415
9.70176
10.6599
17.9621
14.0668
16.2189
19.8443
21.2735
19.7719
16.376
14.0016
13.442
14.47
15.8028
16.9848
18.7476
22.947
57.8278
59.887
42.2431
32.2024
25.3417
23.269
26.3364
32.8248
39.7413
44.7846
49.7596
54.2836
55.7376
50.8826
44.2949
37.6322
32.3805
27.1651
22.8508
20.6324
22.0209
24.5229
27.494
30.1465
32.8069
35.5049
38.0433
40.7834
42.2298
48.2951
42.2899
51.9373
49.4482
43.2065
34.8223
30.602
33.8458
40.465
45.3968
51.6348
63.902
74.0021
82.6722
82.7909
83.3036
77.5826
74.5445
67.4712
62.9775
55.6064
55.0242
57.0372
59.048
60.1613
61.2573
62.2398
62.3236
60.3489
55.3175
59.0753
79.334
68.0866
50.1461
42.344
43.833
54.2908
66.2283
80.3267
93.5638
102.795
108.95
111.645
108.253
100.618
90.7503
79.0425
65.8936
53.5376
45.1714
52.341
68.0451
83.2921
95.9352
100.442
96.0965
85.7812
72.0707
59.9043
54.6158
75.0422
54.2329
47.7418
61.4765
72.3119
79.7751
84.5365
87.5291
87.2633
86.2181
79.8662
73.0263
60.6297
50.7073
39.6677
32.5116
30.3902
34.5269
41.4994
47.965
55.183
61.1053
66.7391
70.7097
72.6553
72.4645
67.2099
58.8089
48.3226
38.5762
51.1998
64.7369
57.2798
48.1986
40.0439
37.4552
39.1857
43.4847
47.9436
52.1869
54.8961
58.2454
63.0852
68.7702
69.9416
67.4241
62.9032
55.9148
47.7204
41.5113
34.5052
34.6723
38.7708
43.9276
50.3751
58.6658
68.0482
72.1767
66.9154
54.4835
51.2177
80.5716
60.5259
45.1837
47.7333
56.2045
63.0356
78.0676
105.566
125.998
126.791
108.846
85.6687
74.6273
68.2181
64.3518
55.8438
47.4671
46.922
56.7222
66.7993
81.444
87.5622
85.4648
78.9349
67.2349
63.395
74.806
82.7921
81.0649
83.073
48.444
34.8286
44.9428
53.8364
61.2421
66.7393
70.0921
72.0798
71.7337
71.5817
67.9543
66.5337
58.6008
53.8406
44.0113
40.719
45.6601
57.3356
66.8751
75.7551
79.3041
84.588
88.0411
87.233
85.2295
75.9494
62.9025
47.8887
35.5617
46.6848
61.2718
51.2327
62.2218
72.4278
80.597
86.2979
89.1542
86.1105
86.6898
78.0562
74.1729
65.2858
57.2468
55.9003
68.1833
76.2565
84.1884
86.4842
90.932
93.5164
100.272
101.007
97.1817
82.7703
64.5023
47.2356
36.2253
31.9434
29.4986
43.2392
70.7134
60.263
77.8403
94.1062
106.715
116.486
118.899
120.193
113.057
101.771
83.8187
70.8809
58.3871
72.6899
86.1183
111.556
109.219
122.521
119.626
127.101
118.877
115.006
100.576
81.455
60.2274
44.2015
37.0399
37.1551
36.9058
54.7491
88.4712
85.9762
110.033
120.965
120.915
120.683
122.95
128.123
123.051
123.284
110.719
104.082
77.5747
76.3683
104.096
128.362
155.727
166.444
180.636
189.02
168.338
149.942
121.035
94.2204
73.4055
56.4145
45.9698
42.6236
46.8941
60.5248
106.232
92.7795
92.4363
91.2883
87.2589
77.7091
70.3932
64.6972
64.9537
67.9611
72.2592
79.8375
85.637
90.3156
100.773
111.644
115.079
111.088
104.889
95.363
87.6534
81.4017
77.2431
76.6171
80.1555
81.4933
84.7316
85.9601
85.234
62.7997
46.5207
25.0735
39.5142
56.6614
63.7867
69.0828
71.3632
67.7221
62.1003
55.6501
47.3132
38.2215
32.1804
37.9198
47.7045
55.4906
63.2127
68.7887
69.3999
67.8506
65.4405
51.4593
35.0775
25.1619
20.0569
13.0809
10.7018
13.7803
18.1882
21.1856
18.1791
14.4027
17.3379
21.1337
22.5244
21.1434
18.2811
16.5025
16.1889
16.971
18.8244
25.1338
38.0737
46.7156
61.3307
74.0794
72.5325
64.3842
45.901
33.8158
24.6273
21.5342
24.4361
31.4333
38.8199
44.9808
50.7322
55.7509
57.7165
52.8396
45.5731
39.0645
34.9553
30.7338
28.078
26.8888
28.3224
30.6637
33.1861
35.8689
37.4497
39.3487
40.5672
42.5631
43.8173
46.185
52.3077
59.239
53.5145
55.048
49.4933
41.2037
32.9038
28.3418
32.3482
38.0662
43.3637
50.5167
63.0658
74.3856
84.6271
87.6048
89.626
86.9368
84.3672
79.622
76.0016
71.0326
67.9728
66.3094
64.9678
64.3534
63.6231
62.8867
60.8898
58.0919
54.7349
55.9348
59.6633
74.3918
98.7642
72.5234
53.2379
43.6041
44.4133
53.3744
65.0756
80.1835
96.5985
109.648
116.847
119.172
117.67
112.36
103.94
94.5929
81.9306
71.1617
64.7407
67.678
78.0382
89.1233
98.4171
99.2105
94.0342
83.2778
71.1493
63.0826
61.021
61.5364
62.4932
74.2236
66.0005
67.5344
74.4111
82.2565
89.4191
94.2597
96.5156
98.1208
99.3351
93.9684
90.8601
79.9016
70.7065
59.2195
52.7986
48.4359
46.8642
47.7787
50.517
54.6692
58.5074
62.8673
65.2352
67.4179
67.073
63.3071
55.671
47.7997
40.8098
42.6725
57.543
74.3594
74.7863
60.4282
48.1865
39.2038
36.3733
37.995
42.5424
47.7093
52.3611
56.0533
60.3717
66.6184
73.3177
78.2323
75.4172
70.7237
66.4201
59.4498
54.5889
50.6059
47.9951
49.9453
53.4226
59.7296
67.6636
73.2351
72.0117
62.5807
50.0465
41.719
73.567
108.594
94.7317
65.0575
52.2709
52.6088
56.2257
64.253
81.0463
110.203
133.193
135.306
121.489
99.2191
85.0276
77.1678
77.2301
73.3961
70.7513
69.4162
71.7579
78.4667
84.4204
83.7338
80.3262
71.3877
65.9205
71.0074
86.6949
90.4448
84.9804
62.6584
57.6725
64.1581
52.3026
46.862
51.1416
58.0916
65.31
71.0809
75.0772
77.6806
77.2833
77.9808
74.433
72.8564
67.6234
61.3885
53.0618
45.9737
45.8304
55.3437
64.4045
71.9063
78.2476
82.3406
85.714
86.9686
83.0609
74.6556
61.4872
46.7274
39.5764
47.6392
60.6631
61.3528
46.9452
55.596
65.1591
75.5839
85.1664
91.2745
94.2835
93.3651
92.5788
84.1256
81.5522
69.2599
59.059
49.7612
58.3506
67.9267
77.7544
81.6944
86.0983
91.4849
95.6706
98.1981
93.8701
80.7031
62.3177
45.3984
31.4127
29.578
44.5059
57.8513
68.8667
71.435
55.7692
62.9733
79.2317
96.3822
109.861
121.646
129.659
134.455
126.785
118.569
100.414
90.1251
73.4894
75.3965
83.2335
104.76
104.7
120.518
115.425
126.135
116.353
114.838
99.1532
79.0737
56.0147
38.3201
37.9329
53.178
67.6031
77.4624
88.5224
95.7456
77.4214
95.8374
116.171
124.585
123.735
124.532
131.076
137.86
134.841
139.795
127.375
125.153
104.563
100.793
111.936
123.977
148.293
152.736
168.282
168.024
157.349
141.021
116.902
92.1218
71.9247
56.319
45.9708
43.3503
46.347
47.5898
67.2697
81.8367
110.04
98.9917
92.7786
91.7612
83.1218
71.1535
61.6358
53.1941
50.45
57.0575
65.3762
73.7584
81.6148
85.4899
87.3825
102.084
109.077
111.396
107.002
101.591
93.8475
86.7509
82.432
80.9668
79.7105
80.3946
82.4783
83.1082
82.8205
62.731
69.6808
77.633
45.5016
25.5497
36.3421
53.7982
63.506
68.8852
70.3982
67.2323
61.4866
53.3975
43.8821
33.3113
24.0841
33.7529
45.817
54.3367
62.5285
68.4501
69.6386
67.2323
64.4739
52.0563
35.1195
25.1517
22.4238
18.5187
20.0559
27.1316
31.5387
31.8635
7.99381
3.5578
18.1823
14.6112
18.0072
22.006
23.51
22.1123
19.6123
18.2458
17.6805
18.5418
22.4614
36.4681
59.8495
71.5987
79.2571
90.3935
84.5828
62.3103
46.5012
34.3053
23.3048
19.9338
22.7545
29.472
37.3411
43.6941
50.2098
56.7952
60.1304
55.5304
48.34
42.6947
39.3829
36.7367
36.0139
36.6906
38.9686
42.792
45.3322
48.5485
48.3569
49.039
47.4865
47.417
48.4337
47.8659
47.1274
53.9467
59.9672
53.9845
46.817
38.5328
31.0592
27.7317
30.8221
36.2564
40.5638
48.1562
59.7189
72.5622
84.9148
89.4243
94.267
94.0473
94.1094
90.7956
88.0187
84.1353
81.3841
77.9389
75.3706
72.0172
68.5223
63.8409
58.6734
52.6806
50.1541
51.5772
55.5659
71.4648
107.578
78.2172
55.4031
43.1314
40.7047
49.4831
60.9775
74.8974
89.7683
104.666
116.635
124.021
125.806
122.537
114.657
107.955
101.965
93.6451
89.0243
89.8188
92.9649
98.996
103.055
100.122
93.3634
84.6242
75.9169
68.9465
65.8392
66.0414
69.2975
73.1189
70.293
72.3828
78.7323
86.9738
94.5008
99.6269
103.274
106.737
106.884
107.204
106.274
100.824
93.2993
85.2275
74.6487
69.1863
64.6615
63.5869
62.6563
62.4216
63.4924
64.3204
64.8761
64.7497
62.2129
56.7107
49.9911
43.8227
39.6567
40.3681
47.6078
61.9571
75.5989
60.1988
46.7793
37.7533
34.7345
36.2117
40.9802
46.0409
51.5721
56.432
61.3205
67.7561
76.0297
82.008
83.5516
77.2091
73.0627
70.9644
67.1744
66.1683
65.2253
65.0625
68.7543
73.3549
75.8806
74.2616
66.8371
56.1431
47.8473
51.1352
75.1663
96.0709
92.2928
66.8333
56.9829
54.0425
56.6303
64.5927
79.4717
107.339
136.032
143.804
139.265
119.74
101.671
90.645
88.5227
87.4765
88.8503
87.8505
88.1518
86.3794
84.5417
81.0718
74.1491
70.8969
76.2914
91.8722
99.1293
97.5137
82.5375
55.0387
51.3631
55.7359
50.7952
47.2485
51.572
58.6628
66.3759
73.1759
77.7811
82.1353
83.2068
84.6525
83.0409
83.4865
79.2868
77.3056
73.0873
67.6317
68.477
70.7322
72.5345
76.6833
81.804
82.5368
86.1041
86.104
81.5164
73.4787
61.5835
49.6671
43.8756
44.0284
44.2986
44.2832
48.5045
56.2657
65.4133
76.6511
87.2723
94.2007
100.493
100.921
100.633
97.6109
96.8542
86.0838
83.3963
74.3854
74.7707
73.6804
80.9194
80.2818
85.6633
88.1808
93.3328
93.7004
89.0631
75.9632
58.2931
41.8197
32.1994
39.4487
49.2968
51.6897
46.9512
44.5884
46.0188
54.5687
71.88
92.5822
108.627
124.192
135.807
147.647
144.484
140.392
127.709
123.526
113.708
112.158
105.446
119.261
112.953
123.916
121.462
126.65
116.536
113.466
97.0795
75.0946
53.8187
43.7348
51.6564
60.1254
64.7151
65.1931
63.9787
64.3433
71.4564
92.1995
114.94
126.223
127.119
129.237
137.242
147.783
149.701
161.824
156.272
156.921
149.974
142.046
149.728
140.634
153.371
149.689
157.425
151.996
144.853
129.376
106.837
82.6095
64.2473
50.9807
42.5857
41.0309
44.0327
43.6484
43.5646
66.0243
113.763
102.769
93.3102
91.6089
77.813
67.9377
53.7406
39.487
35.7089
46.9443
58.8028
70.0038
77.8855
82.4728
79.3769
81.2669
95.7382
103.695
105.161
102.246
97.3685
89.8297
84.9465
81.999
78.4715
79.5576
79.2619
78.6812
76.4314
59.8484
43.5961
46.0764
44.1454
30.4892
33.459
50.2988
61.8639
68.0401
69.5168
66.5789
61.879
55.5839
46.594
40.1528
36.54
42.2765
50.3843
56.8966
63.98
68.5287
69.211
66.5575
62.8506
50.9204
34.2087
24.2949
23.7047
21.7401
22.7149
27.9545
30.5614
18.4736
3.84315
2.9604
17.9582
14.5215
18.3665
22.5694
24.2425
22.838
20.5222
19.3004
18.5688
18.5439
21.8778
34.4178
58.334
69.5088
75.6802
79.9767
73.9948
57.0448
44.6163
30.0829
20.3731
18.226
21.1432
27.2644
34.9059
41.6804
48.4933
56.3697
61.6541
59.748
53.5603
48.2242
45.8082
45.5751
47.4435
50.8622
55.1898
60.1846
62.1201
63.5209
61.0493
59.4249
57.1451
54.5841
54.1975
52.0493
53.3194
56.0747
58.7388
50.0183
42.5355
35.0218
29.3638
27.3186
30.0522
33.8469
38.0664
43.7681
54.9272
67.6402
81.3476
88.7969
94.5743
96.9893
99.7249
99.2827
98.4001
95.8056
93.1272
89.2857
84.7088
79.0054
72.0599
64.4748
57.7961
52.7258
52.5475
58.1513
70.4691
89.9724
111.967
76.0768
55.199
43.3866
38.7185
43.4807
53.4723
67.3233
83.4105
99.4065
113.131
123.604
129.137
129.68
123.581
118.438
112.867
110.034
106.623
104.565
105.774
105.606
104.662
102.042
96.3381
88.0816
79.8334
71.8173
66.7746
67.713
68.5272
69
68.6057
71.7543
78.6077
86.3426
93.825
101.151
107.15
109.613
111.992
115.478
116.64
116.427
115.235
107.354
103.911
95.5226
91.1325
84.8743
80.4379
78.5625
74.6977
72.0122
67.9992
63.0599
56.7153
49.8345
43.5124
40.0079
40.6046
48.1536
57.2262
67.4718
74.5945
57.2299
43.8523
35.6986
32.468
34.3629
38.1481
42.9685
49.0014
55.5462
60.8914
67.4851
75.6478
82.2754
85.8965
84.2933
77.664
75.4779
76.5119
75.7479
78.9024
79.4951
79.1262
79.1441
76.018
69.1081
61.3013
56.119
58.2628
71.9413
86.8537
92.8272
82.8198
64.7537
55.2181
52.4321
55.4864
62.478
74.4503
97.0679
128.432
148.464
150.623
145.166
130.489
114.656
102.941
98.6207
96.6445
95.4577
93.772
87.917
86.8385
81.1586
81.0614
88.4856
105.808
110.084
108.384
94.6129
67.051
52.6626
50.5476
50.5872
45.0641
42.7942
47.9188
55.5293
63.9884
72.2153
78.941
84.097
87.4628
91.3557
90.3285
95.577
92.0097
95.4524
91.3194
92.2561
88.807
87.6696
88.4006
86.7123
88.1522
87.3086
87.1855
84.8436
80.1974
72.2929
61.7855
53.1324
47.4699
43.9864
42.0719
43.0389
47.814
54.7589
63.8075
74.2796
85.6561
96.6773
105.04
105.409
112.462
114.976
110.975
106.58
106.66
98.7588
96.8563
89.4393
89.2819
85.6384
86.9236
88.7364
90.1232
88.8496
82.7467
69.3312
53.8527
41.249
37.427
45.0643
50.1609
45.342
36.8069
33.0979
35.1891
44.1302
60.0667
82.6497
103.052
119.846
136.497
155.049
160.418
163.91
157.498
155.762
150.039
143.736
139.059
143.266
137.173
131.729
134.742
128.614
120.73
108.668
91.6912
71.3686
54.7015
52.1541
58.0271
59.0561
56.2206
52.6998
49.848
51.7931
61.7844
82.3138
108.157
124.31
128.911
131.803
140.229
157.674
166.826
187.25
183.204
194.959
188.494
184.254
177.551
165.232
170.919
152.399
153.026
143.288
132.561
116.119
95.3141
74.0814
57.3309
46.0703
40.6348
39.8818
40.666
38.8702
44.0215
72.2533
114.332
102.01
92.2075
89.0782
75.9181
65.1919
51.4489
37.4144
34.8285
46.3542
57.3387
68.5729
76.0094
80.1447
75.3401
65.7451
78.5675
90.1248
95.4205
97.4391
96.4139
91.728
86.8613
80.6999
78.3723
75.5572
72.0056
69.43
61.8921
47.8189
42.6158
40.7404
38.195
32.9945
33.0326
47.0863
58.9803
65.9502
68.5145
66.9714
62.8939
59.8436
54.6035
50.9737
51.1993
53.8961
58.1303
62.5823
67.3901
69.0964
68.3827
65.2433
60.5459
48.0931
32.1753
23.0665
23.7072
22.5083
19.5165
22.2616
19.6267
8.85107
2.9231
2.7723
17.6209
14.1862
18.2943
22.68
24.6221
23.5197
21.0373
19.6805
18.8781
18.7352
21.5633
32.6036
53.7094
64.1673
66.6258
66.7012
62.2745
49.4528
36.7593
23.9466
17.4551
16.7794
19.7344
24.5245
31.8125
38.3298
45.378
54.0335
62.054
64.1769
60.5135
55.8435
54.6127
56.2503
59.9957
65.3196
67.6053
69.924
67.1802
65.5497
63.5327
61.7993
62.831
59.58
59.1524
55.7656
56.4314
54.7253
53.4634
43.7183
36.8724
31.3964
27.7545
27.1813
29.0917
32.1206
35.3684
39.3168
48.5792
60.4331
75.1914
84.2807
92.1536
94.7879
98.7487
99.4923
101.311
100.155
97.7149
92.2922
86.8809
79.6797
74.6377
70.4526
70.4395
70.7264
73.8412
80.8025
92.7342
103.605
108.32
72.2666
50.9317
38.3999
34.4771
38.0828
44.1281
55.2715
69.7307
85.3521
101.983
116.032
126.372
129.654
129.833
124.39
120.761
117.817
115.085
113.53
111.33
109.198
105.589
102.151
97.5969
89.2028
77.5837
68.8325
64.5415
62.9393
62.5146
61.2294
60.4232
64.7424
71.7221
79.0021
87.4241
96.8092
104.142
110.032
114.089
117.62
119.009
121.358
121.647
125.127
119.639
117.206
111.03
107.053
100.855
93.9342
86.3548
78.5966
70.077
61.5848
53.5267
47.2258
44.1816
46.0511
52.522
60.2138
65.7112
71.6456
70.4591
51.8213
39.6781
32.1478
29.9314
32.3639
35.3287
38.9429
45.0013
52.5963
59.5379
66.1792
72.6736
80.1666
83.9189
86.17
84.3603
78.8811
78.3163
79.5081
78.4791
80.8263
78.8594
75.4051
70.7552
65.9319
63.8599
66.385
74.7783
82.7365
84.6792
81.8035
72.1341
57.041
48.7421
46.1153
51.1778
57.7813
67.1603
82.9227
110.134
138.944
153.249
155.821
156.483
153.628
140.215
126.845
116.801
110.136
106.511
101.426
102.322
103.643
116.253
123.043
121.65
115.19
95.5633
68.505
55.0666
49.3791
46.3883
42.5968
35.9337
34.2857
40.2273
48.4195
57.4399
66.8713
75.8017
83.3653
88.9837
94.4483
97.7875
102.647
104.537
111.351
107.132
109.47
108.409
104.525
104.153
96.9045
97.6094
91.463
88.7333
83.9074
78.0267
70.0974
61.7765
54.1849
48.3223
42.9543
38.6317
38.6954
43.7082
50.9568
58.4069
67.9142
81.2071
94.7153
102.323
111.233
123.721
124.258
127.428
128.191
127.782
118.732
117.29
104.912
103.068
93.8727
93.6052
90.0472
87.9674
82.7938
74.3157
62.4313
49.6312
42.0401
42.1316
47.989
48.8035
40.716
29.7894
24.7566
27.0235
35.15
46.4284
66.4385
90.6901
109.105
127.737
151.902
167.272
186.05
186.339
191.135
188.159
183.129
178.303
169.679
158.292
153.466
142.055
131.329
119.021
102.69
83.6981
67.5401
58.1997
57.4155
58.4639
55.2845
48.6879
41.5045
37.2018
40.57
51.2681
67.6252
93.2632
116.668
126.53
131.503
142.58
157.45
171.604
200.651
209.859
215.496
216.378
214.452
210.812
198.859
190.929
167.525
153.85
137.179
120.27
101.18
81.0628
62.91
49.2978
40.3388
37.7744
39.1494
38.1751
37.0825
50.4768
79.5815
107.627
96.7125
87.6678
84.5582
75.0651
65.0456
56.7369
49.9893
50.1742
56.1696
63.4577
71.0912
76.1976
79.1242
73.686
57.189
60.3897
73.4482
79.8011
83.2009
87.9441
88.9841
84.2543
78.3044
73.5707
68.7852
64.2774
58.6764
52.0796
44.6796
34.8613
28.6516
25.6566
26.7587
31.7009
43.5373
54.7748
62.4133
66.2585
67.1618
65.2847
63.883
63.8823
62.1083
63.5347
65.7076
67.2351
69.85
70.2496
69.427
67.5475
62.9771
56.7792
43.6507
28.8796
21.3653
21.6396
19.0914
12.1475
10.1986
7.58638
4.81341
2.23352
2.57917
16.7719
13.3777
17.4989
21.9186
24.4314
24.1436
21.5608
19.7274
19.0824
19.0029
21.3408
29.7588
46.2936
56.9612
59.5305
57.3626
53.4684
40.6152
28.6424
19.3605
15.7128
16.2631
18.9169
22.2594
28.45
34.5999
40.9108
49.825
59.8442
66.1949
67.0926
64.5852
63.1255
64.6268
67.4757
70.2606
69.3076
67.5361
63.5648
60.8909
57.4166
56.0876
54.4258
53.2148
53.5441
50.0572
49.6711
47.0709
43.3313
35.5737
31.3309
28.2136
26.9625
26.9949
28.5382
31.0968
33.373
35.3437
41.4919
51.3619
65.6608
77.5584
87.9982
90.9258
95.0981
94.3894
96.9796
94.0185
93.8096
89.6352
86.9986
84.4156
86.0637
88.7523
91.9852
92.3429
94.6342
97.7085
102.44
104.279
90.6346
62.0457
47.0993
35.6795
32.216
33.775
36.9673
43.0344
54.9843
69.9428
86.0252
101.67
114.845
124.383
127.521
128.944
126.564
122.398
120.166
116.022
112.387
108.993
105.211
100.009
93.3204
84.9926
73.9067
63.9403
59.3445
56.7621
53.7304
51.327
48.9087
51.2023
58.7955
67.2737
75.7854
85.5315
96.5427
106.835
113.005
117.369
121.555
124.25
126.811
125.696
127.689
125.44
121.318
116.39
108.064
100.305
91.5801
82.3775
73.7535
66.2862
61.0255
58.6208
59.0955
61.9902
65.5094
68.5316
70.1772
71.0225
62.8238
44.9982
34.2594
28.1039
27.7228
30.4504
32.4115
34.7813
39.7642
47.7489
56.8371
63.2942
69.9754
75.6242
81.0158
83.574
86.6724
86.6118
83.1281
83.1652
82.1086
79.8768
79.6038
76.1987
74.4816
74.0763
76.7062
80.4039
83.2519
81.3793
77.7207
71.4115
59.8533
46.2292
37.7078
34.9782
41.356
49.6309
58.2532
69.7741
87.8995
112.806
136.913
155.819
160.932
164.669
166.381
166.534
164.619
161.332
156.422
151.735
146.212
141.671
136.916
130.63
121.41
100.427
69.4026
53.4591
46.8232
43.8476
40.0594
35.0136
27.2716
24.1073
30.833
38.6963
46.9824
57.6433
68.7302
78.9398
87.5164
94.2281
101.541
107.418
112.854
120.634
121.067
125.349
122.019
120.366
114.385
108.493
103.822
95.0872
88.7578
81.9215
74.2809
66.5149
58.7878
52.5074
46.3924
40.226
33.2483
30.4351
36.5138
44.2867
50.5056
59.3215
72.8718
86.4083
98.4734
113.727
125.163
130.568
141.998
146.646
145.308
140.794
137.403
121.508
119.507
103.861
100.238
91.0313
84.1032
75.1931
65.5892
55.0475
46.2211
42.6799
44.5873
48.8703
47.2032
38.3782
26.7368
19.784
21.6545
28.5021
35.9966
48.5882
73.3603
93.6534
113.179
135.988
161.922
185.54
207.704
210.403
209.062
203.881
197.047
188.81
182.873
160.178
147.649
126.646
109.297
91.2417
75.7842
63.0239
57.2748
55.9197
55.0582
50.9223
42.2229
33.1059
27.0406
30.8248
40.4434
52.0355
72.5156
101.182
119.092
129.033
140.855
153.197
169.151
194.804
213.192
220.528
224.53
223.77
218.726
211.75
197.52
175.799
147.851
126.296
104.905
85.6012
67.9915
53.4124
43.4319
39.4893
39.8787
40.4439
42.4869
46.123
59.2046
81.2339
96.9327
85.666
81.0288
77.3619
74.3773
67.9519
65.9815
64.7452
67.2534
69.7594
72.7598
76.741
79.4621
79.939
71.7391
52.408
45.3628
57.906
64.3181
66.7832
71.3338
77.5903
80.3185
78.1204
73.1323
67.0802
60.887
54.0084
47.1434
38.8241
23.4241
20.8365
20.2396
22.1126
28.3056
38.6302
49.3595
57.2432
62.1837
65.4944
67.2595
67.7366
70.5228
72.7771
73.6966
74.7207
75.7462
74.3984
72.3963
70.1735
65.2485
59.2863
51.4859
37.2558
24.6616
19.5364
18.156
11.6747
6.08333
5.04448
4.21702
2.87954
1.88453
2.45692
15.4552
12.0686
15.8175
20.4657
23.5093
24.8262
22.9394
20.5923
19.7457
19.5917
21.2063
25.8874
36.145
45.9246
51.9793
49.5898
45.3289
32.6807
23.3692
17.0931
15.6202
16.8031
19.0411
20.7886
25.7635
31.0731
36.2053
43.7891
54.1536
63.5501
69.4087
70.5549
70.4692
69.6464
70.2903
69.24
66.9683
63.1602
59.757
55.6819
52.3006
49.613
45.8247
44.1429
43.1364
40.0345
40.103
37.2174
34.0329
29.8215
27.9151
26.7912
26.6047
27.1992
28.3803
30.6932
32.4026
32.9775
35.5899
41.7244
53.2509
66.3444
81.1468
89.6862
96.1055
96.1204
100.285
98.4924
101.613
100.294
103.265
103.873
108.36
110.681
111.385
106.502
100.977
96.2877
91.7914
86.9468
73.8499
53.4012
42.0263
36.4312
34.8554
35.1206
35.0118
35.8727
40.7381
50.5285
65.9062
80.8485
96.3188
109.835
120.165
124.814
125.16
125.25
121.989
118.221
113.18
107.844
102.301
95.9022
87.4897
77.9322
68.4375
59.9008
53.2091
49.6927
46.486
42.2369
38.1328
36.7907
42.1325
51.1982
60.2413
70.1316
83.1016
96.7063
107.572
115.208
121.034
126.281
128.746
133.283
131.704
128.357
126.898
119.138
112.164
103.056
95.6399
88.5452
82.6072
78.5167
75.991
74.6427
73.8741
73.1889
71.7802
70.0389
67.8397
62.5544
51.8
36.744
28.9084
25.2547
26.744
29.0248
30.4143
31.3424
34.2622
41.5556
50.7593
59.6577
66.0761
71.3367
76.6029
81.358
84.6009
89.2357
92.4756
92.0334
93.6027
91.8253
89.8919
90.2954
88.6102
88.5505
87.4717
84.6199
79.671
73.8039
67.0489
59.4337
47.8022
34.9648
27.7416
25.9554
29.8164
37.3
46.9344
56.691
69.0994
86.1828
105.466
123.165
143.601
162.599
169.125
173.133
174.219
173.387
169.852
165.089
158.534
150.989
142.398
131.314
117.388
89.2344
61.9844
47.8744
40.7585
37.2662
34.3595
31.2649
25.4057
22.106
26.5484
31.3568
35.4338
45.5111
57.9288
70.2087
81.5447
91.3849
99.6804
108.381
118.407
122.127
133.229
131.548
133.859
128.899
121.884
115.543
105.8
95.6764
86.6535
77.1575
68.3349
59.9719
52.8821
47.3096
42.5741
36.7327
30.3525
27.8183
33.3062
37.8878
41.7427
48.6614
60.4243
75.7918
91.8895
106.492
119.72
130.831
148.512
152.031
159.722
152.133
150.395
133.597
128.344
109.69
102.391
88.431
77.956
66.6191
57.1397
48.9144
43.7376
42.368
44.7104
47.1417
45.5561
38.2669
29.5108
23.901
25.0543
28.8477
30.5571
34.2879
53.1324
76.1952
95.2474
115.86
140.095
164.844
193.08
207.787
219.793
217.556
210.959
194.802
185.09
150.111
131.876
113.961
93.8718
78.6343
66.3044
58.0058
52.6675
50.8754
49.3517
46.5028
40.3224
34.9295
32.7641
35.2487
38.5589
39.7453
50.1513
78.9999
104.508
120.927
135.026
148.641
164.667
181.663
206.734
216.596
219.129
217.765
213.719
203.834
182.228
159.02
131.302
109.577
89.96
73.8317
60.9178
52.6116
49.3971
50.3853
52.033
53.887
57.2106
63.1046
66.8085
76.0547
80.5257
73.2899
70.1095
70.8207
71.623
73.9003
75.8838
79.6519
82.1129
81.834
83.6399
84.8066
84.6806
80.72
67.4852
46.9369
36.7889
46.8043
52.1027
52.694
54.1492
62.014
67.5102
70.0279
68.0321
62.9571
55.4095
46.2191
35.1008
25.7249
21.4633
20.3481
20.1024
20.8334
24.5134
32.6682
41.9229
49.8119
55.9176
61.1544
66.4206
70.624
73.8089
79.1962
81.0033
81.6868
79.8235
77.1295
73.8344
68.2887
61.275
54.5326
43.5195
29.1427
20.3871
17.0376
13.3356
7.11257
3.94435
3.27432
2.76178
2.12025
1.71264
2.34748
13.2398
10.3265
13.9201
18.8855
22.8601
25.4737
25.8439
23.7863
22.1492
21.6392
22.2812
23.4207
26.7598
31.0105
36.7592
35.9717
31.9606
23.9254
19.3074
16.6562
16.6454
18.3008
19.7895
20.368
24.1398
29.4377
32.9426
37.8526
45.7816
55.6378
65.0737
70.839
73.5594
72.8212
71.2683
68.0832
64.7785
60.1763
56.3845
51.1476
47.4802
43.425
40.8539
38.8606
37.7167
35.9178
35.4481
32.8431
30.7061
28.848
27.7639
27.1208
27.1796
27.602
28.8342
30.6712
32.1982
33.2433
33.4412
34.771
41.2599
50.5571
66.4682
81.8183
94.8205
100.681
108.478
111.827
119.921
122.473
128.449
129.17
132.176
131.101
127.412
117.897
106.104
91.5295
79.9386
70.7057
60.5194
49.643
43.6695
42.0062
41.3762
41.2755
39.8377
38.0779
37
38.1883
45.3113
58.2939
73.2025
88.1603
102.412
112.261
119.678
121.132
120.954
117.93
112.889
106.193
98.2058
89.4874
80.063
70.4599
61.3509
53.6984
47.6807
42.2969
38.7297
35.8773
32.8385
33.1733
34.4951
36.7278
43.1673
52.5056
64.6809
79.9578
95.7081
107.976
117.33
124.568
130.642
132.304
131.04
131.206
123.66
118.579
113.125
105.243
99.5669
94.7384
90.5837
86.8947
83.9819
80.9227
77.3543
72.9529
67.7817
61.8634
55.8075
48.817
39.6681
29.9975
26.9591
26.7993
28.5016
29.8299
30.3383
30.409
30.7773
34.3377
42.2036
52.3803
60.38
66.4171
72.1425
77.829
83.2811
87.2015
92.7855
96.3864
97.2033
99.8954
98.1821
96.4057
94.0864
88.8232
83.0781
75.8395
68.1088
60.5686
53.5771
45.7104
36.1479
27.409
25.6346
26.1183
27.2555
29.5184
34.0383
43.0239
53.0836
65.696
80.5305
94.1609
106.534
120.572
136.72
150.97
168.172
171.854
170.655
167.209
160.901
152.04
141.094
127.741
109.698
84.8266
62.0879
47.5939
38.1498
33.6479
32.2297
32.1548
31.9544
32.368
33.2444
32.9425
29.9856
32.6815
44.523
57.4941
70.4524
82.9382
94.0537
104.149
115.351
122.998
131.774
135.447
135.482
131.5
124.865
115.319
104.395
92.2895
80.7681
69.2144
58.9485
50.4113
44.023
40.1468
38.1368
37.1535
37.256
39.6737
42.288
41.4088
37.229
38.1584
47.5705
63.0115
79.8159
94.7496
109.94
122.998
140.229
146.797
155.26
152.04
151.591
135.308
128.837
109.26
99.2325
83.166
71.7853
60.7848
51.9768
45.5128
41.4122
39.7786
40.5175
42.409
43.5006
42.2914
40.455
39.8587
40.0067
38.9619
34.8628
28.219
34.1757
56.8859
76.7865
95.0667
115.011
135.235
157.758
174.422
187.821
189.844
180.907
171.209
153.011
131.117
112.91
94.196
80.1498
66.9912
56.7539
49.1671
44.3196
42.4001
43.5107
44.4807
45.7988
47.196
48.4397
48.5609
46.5493
41.4375
35.8883
52.5756
82.8573
106.293
125.109
145.057
162.202
176.927
196.24
208.812
213.136
210.863
204.37
195.712
168.543
146.083
123.108
104.692
89.6991
78.7982
72.883
70.4225
70.0406
69.841
71.4812
73.6359
74.4346
75.5575
70.7379
67.086
64.987
58.5825
59.9734
64.0757
71.1525
78.9751
86.788
91.3207
94.0373
95.7826
95.7367
93.0848
88.2128
77.3951
58.8059
39.0733
33.0799
38.2273
43.5351
43.3433
43.8801
49.9572
59.8983
65.0792
65.9006
63.3735
57.1281
46.6464
37.4233
30.4191
26.0399
23.5544
22.0423
21.252
22.2132
25.9409
32.6828
39.8801
47.1291
54.1789
61.7525
69.6695
74.9122
80.1998
83.4982
83.1231
81.219
77.7536
71.9053
64.1922
56.4036
47.2063
32.7226
20.9973
16.6658
11.1337
8.19792
4.65657
3.1307
2.61001
2.24926
1.90099
1.68491
2.22199
10.3886
12.8762
17.8218
22.7397
23.8733
22.5113
21.9073
21.3243
20.8761
20.7233
21.927
22.3917
23.6021
23.5761
25.2295
25.5494
26.1675
24.7188
24.2471
23.7521
24.5348
25.3746
25.3308
24.815
27.3514
33.6724
37.0858
36.4259
35.8692
38.4498
43.2135
46.7465
50.3237
53.2187
58.5479
59.4426
60.1907
57.6295
54.5867
49.1229
44.6756
39.5232
37.4959
35.1887
36.1502
35.5122
36.7328
36.7103
36.8029
37.0567
37.4144
38.0338
38.6636
39.7073
40.1084
40.3172
39.5793
40.146
39.9321
38.4425
36.6557
35.2085
39.5723
48.0252
59.1748
62.6482
68.8162
68.0079
74.7841
71.8612
77.6208
74.2625
78.0344
78.3413
83.0819
86.2072
87.3812
87.1296
83.8645
80.0138
73.351
66.3607
60.5381
58.6495
55.8974
52.9779
51.8639
48.1592
48.2748
46.7307
48.3747
51.0919
60.3805
68.5225
75.7877
83.1605
86.7424
90.1359
92.2967
94.9957
96.5973
95.5985
92.4549
87.7117
82.3795
76.7539
71.3736
66.1768
61.7548
57.834
54.5211
52.8656
53.4382
51.7795
49.8987
48.2737
49.0951
50.2258
50.2434
56.4817
65.3282
73.7512
78.8259
81.988
83.4711
83.443
83.7902
80.6987
81.2257
77.4571
77.0596
72.3775
69.4095
66.6357
64.1779
62.7567
62.4502
62.9585
63.7033
63.9597
63.3797
61.5252
58.3802
53.528
47.022
42.4032
41.3016
41.6642
42.9481
43.6236
43.8806
43.4249
41.5929
39.581
38.5083
42.0619
47.502
52.1861
55.6561
58.1335
59.561
61.8461
61.805
65.3228
64.9143
70.2646
69.3065
72.1343
70.0924
70.2195
67.7188
66.1337
63.5375
61.1838
57.8906
53.7521
49.413
46.1622
44.5673
43.2439
41.9996
41.9612
42.1229
41.8957
40.6969
43.5698
53.768
64.9605
71.6113
77.0511
80.3129
83.3817
86.6898
87.567
91.8558
92.5063
95.2828
94.2568
91.438
88.972
81.9783
74.6557
68.4172
61.4958
56.22
52.7281
50.5706
50.2154
49.6586
48.9522
47.5941
45.5542
41.6314
36.5793
37.6027
45.9152
54.5489
62.6906
69.2834
74.0511
81.5675
82.6498
92.7092
91.4527
100.879
99.2026
102.225
95.9136
93.5993
86.8651
80.8604
74.712
69.4334
65.0466
61.5148
59.129
57.9919
57.471
57.3325
57.7604
56.7203
54.2748
50.0989
47.019
46.6887
55.4675
66.618
73.613
82.4235
88.1765
99.6452
100.372
109.179
106.942
115.907
106.631
109.046
97.6059
93.7796
84.1223
78.0443
70.7931
66.2004
62.0818
59.039
56.7653
55.0468
53.8094
52.3685
50.8598
49.2175
47.3626
45.4907
43.1779
39.643
35.6334
33.5945
44.303
62.1985
71.8508
79.095
91.0466
104.117
105.566
121.133
120.1
122.742
124.431
111.686
109.511
99.8128
89.8687
82.8368
75.9023
69.6049
64.5184
60.6535
57.8922
56.8043
56.3702
55.7904
54.8464
53.7556
53.1027
51.8096
50.0237
48.2922
47.2378
60.6658
84.6691
99.9575
116.747
134.701
148.281
159.685
163.176
164.448
168.741
172.086
173.424
169.922
159.069
146.358
130.598
117.773
107.103
97.663
90.2641
84.6122
81.2174
78.7798
78.4789
79.5537
82.0686
79.9762
81.1507
78.408
76.795
78.0347
84.0458
87.3264
95.2402
96.549
98.0676
96.5415
94.4231
91.164
88.8669
84.7488
75.2888
55.6332
47.7893
49.4031
53.7479
58.2116
58.4563
57.8688
59.7522
74.2511
80.865
83.589
83.0678
79.5451
72.785
64.1063
55.4349
47.1715
39.2358
33.8024
31.4624
31.0696
32.8067
37.3238
43.4622
49.1579
54.7001
59.2375
63.5992
66.0957
66.9526
64.5048
63.3955
61.2252
58.7887
56.3578
53.4434
51.6574
44.1283
26.9838
11.9138
7.11159
6.83513
6.09885
4.60701
3.94991
3.59261
3.27436
2.95227
2.57716
2.14972
)
;
boundaryField
{
wand
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
| [
"ubuntu@ip-172-31-45-175.eu-west-1.compute.internal"
] | ubuntu@ip-172-31-45-175.eu-west-1.compute.internal | |
4c5f4e2fe183f8077e54dc321fa8a3f250fd1e86 | 745f5ca4aab736a051342cce970a7232fe65aeca | /old_nikki_code/code/FileParser/FileParser/IDXFile.cpp | 474ab7a64d0c2a15f0b2df77b411a4370fa1a471 | [] | no_license | kiddove/nikki | cdf7bd3d83458090a979cf067bd05be9459221a1 | dfbe1db92159f4a80b32318a870b3c522a89ec8f | refs/heads/master | 2021-01-21T04:31:59.582089 | 2016-06-28T19:14:27 | 2016-06-28T19:14:27 | 13,760,340 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 275 | cpp | #include "StdAfx.h"
#include "IDXFile.h"
CIDXFile::CIDXFile(LPCTSTR lpNDFFilePath /* = NULL */)
{
m_strIDXFilePath = lpNDFFilePath;
}
CIDXFile::~CIDXFile(void)
{
}
void CIDXFile::ParseFile()
{
TRACE("%d---%d----%d",sizeof(IDXHeader),sizeof(IDXRecord),sizeof(time_t));
} | [
"kiddove@gmail.com"
] | kiddove@gmail.com |
2b373f859345be44a74fced63f9ff9520db9ee3e | 51af40081bf65fe84a42b3b507f54bd75b4f57a4 | /Electric/MotorDriverBase.cpp | af30b1c5e9851f3958aa48bffa66e449a1082bff | [
"Apache-2.0"
] | permissive | anatoliy1973/RoverKit | df7448772969dba02082013eca33291d06709e17 | 5bd498456ea257b757d092f9647df881d7a9ca4e | refs/heads/master | 2020-04-06T06:40:50.700224 | 2015-05-31T15:30:58 | 2015-05-31T15:30:58 | 32,414,130 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 944 | cpp | /*
* MotorDriverBase.cpp
*
* Created: 01/22/2015 11:12:59
* Author: Default
*/
#include "MotorDriverBase.h"
#define VOLTAGE_LOW_GRADE PWM_GRADE *20 / 100
// default constructor
MotorDriverBase::MotorDriverBase()
{
this->m_currentSpeed = 0;
this->SetVoltageMapping(VOLTAGE_LOW_GRADE, PWM_GRADE);
} //MotorDriverBase
char MotorDriverBase::get_CurrentSpeed()
{
return this->m_currentSpeed;
}
void MotorDriverBase::Throttle(char speed)
{
this->SetThrottle(speed);
this->m_currentSpeed = speed;
}
void MotorDriverBase::Break()
{
this->Throttle(0);
this->SetBreak();
}
void MotorDriverBase::SetVoltageMapping(int low, int high)
{
this->m_voltageLowMapping = low;
this->m_voltageHighMapping = high;
}
int MotorDriverBase::get_VoltageLowMapping()
{
return this->m_voltageLowMapping;
}
int MotorDriverBase::get_VoltageHighMapping()
{
return this->m_voltageHighMapping;
}
| [
"anatoliy_lokshin@mail.ru"
] | anatoliy_lokshin@mail.ru |
3fe7034fcdfaa5e0558000392a3fbdb7a1812ae7 | 6a1cfa936a03723c00fd92c270cf35855f3c6a22 | /src/utlitypkg/src/groundtruthodo.cpp | c56e09d409aef8184d65ec3b6ac7cfcfe1e82a00 | [] | no_license | JSH220/VIR-SLAM | b912eca9b88295248a4aadc7c2cee99da00f0aaf | fd5cb99519971aa95c7c9b9021e32bc2f99a675f | refs/heads/main | 2023-04-28T10:31:49.803919 | 2021-05-31T13:49:44 | 2021-05-31T13:49:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,448 | cpp | #include "ros/ros.h"
#include "std_msgs/String.h"
#include <geometry_msgs/PointStamped.h>
#include <nav_msgs/Path.h>
#include <nav_msgs/Odometry.h>
#include <random>
#include <iostream>
#include <string>
#include "math.h"
#include <vector>
#include <algorithm>
#include <time.h>
double gtx, gty, gtz, stx, sty, stz;
bool getStartPos = false;
std::default_random_engine generator;
std::normal_distribution<double> distribution(0.0,0.03);
ros::Publisher pub_path;
ros::Publisher pub_sim_uwb;
nav_msgs::Path path;
int totalTime = 186; // 186s for Euroc01, 151s for Euroc02, 135s for Euroc03, 102s for Euroc04,114s for Euroc05,
int cycle = totalTime/2; // The pose frequency is 10hz. 20 cycles in total. Each cycle is totalTime*10/20.
std::vector<int> blockStageIndex = { };
int blockStageNum = 0;
int sendIdx = 0;
void receivPos(const nav_msgs::OdometryPtr &odo_msg)
{
int curStage = sendIdx/cycle;
if (std::find(blockStageIndex.begin(), blockStageIndex.end(), curStage ) == blockStageIndex.end()){
geometry_msgs::PointStamped dist;
dist.header = odo_msg->header;
dist.header.frame_id = "world";
float x, y, z;
x = odo_msg->pose.pose.position.x;
y = odo_msg->pose.pose.position.y;
z = odo_msg->pose.pose.position.z;
dist.point.x = sqrt(x*x + y*y + z*z)+distribution(generator);
//dist.point.x = sqrt(x*x + y*y + z*z);
//std::cout<<"Simulated UWB "<<dist.point.x<<std::endl;
pub_sim_uwb.publish(dist);
}
sendIdx += 1;
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "groundtruth");
ros::NodeHandle n("~");
ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Info);
for (int i = 0; i<blockStageNum; i++ ){
srand (time(NULL));
int key = rand()%20;
if(std::find(blockStageIndex.begin(), blockStageIndex.end(), key) == blockStageIndex.end()){
blockStageIndex.push_back(key);
}
else{
i--;
}
}
sort(blockStageIndex.begin(), blockStageIndex.end());
std::cout<< " BlockStageIndex ";
for (auto i = blockStageIndex.begin(); i != blockStageIndex.end(); ++i)
std::cout << *i << ' ';
std::cout << std::endl;
//pub_path = n.advertise<nav_msgs::Path>("path", 100);
pub_sim_uwb = n.advertise<geometry_msgs::PointStamped>("/uwb/corrected_range", 100);
ros::Subscriber sub_gt = n.subscribe("/benchmark_publisher/odometry", 200, receivPos);
ros::spin();
return 0;
}
| [
"yanjundream@outlook.com"
] | yanjundream@outlook.com |
d5212fbf7fc7f1d2715743c619b8d3867e7d2ada | 2af943fbfff74744b29e4a899a6e62e19dc63256 | /BayesianSegmentationModule/vtkITKBayesianClassificationImageFilterTest.cxx | 28fa6339246de9e78e2e15a6e174e283fac54666 | [] | no_license | lheckemann/namic-sandbox | c308ec3ebb80021020f98cf06ee4c3e62f125ad9 | 0c7307061f58c9d915ae678b7a453876466d8bf8 | refs/heads/master | 2021-08-24T12:40:01.331229 | 2014-02-07T21:59:29 | 2014-02-07T21:59:29 | 113,701,721 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 773 | cxx | #include "vtkITKBayesianClassificationImageFilterTest.h"
int main( int argc, char * argv [] )
{
if( argc < 2 )
{
std::cerr << "Missing arguments" << std::endl;
std::cerr << "Usage: InputFile OutputFile" << std::endl;
return -1;
}
vtkPNGReader * reader = vtkPNGReader::New();
reader->SetFileName( argv[1] );
reader->Update();
vtkITKBayesianClassificationImageFilter * filter =
vtkITKBayesianClassificationImageFilter::New();
filter->SetInput( reader->GetOutput() );
filter->SetNumberOfClasses( 2 );
filter->SetNumberOfSmoothingIterations( 2 );
// write tube to file
vtkPNGWriter *writer = vtkPNGWriter::New();
writer->SetInput( filter->GetOutput() );
writer->SetFileName(argv[2]);
writer->Write();
return 0;
}
| [
"melonakos@5e132c66-7cf4-0310-b4ca-cd4a7079c2d8"
] | melonakos@5e132c66-7cf4-0310-b4ca-cd4a7079c2d8 |
045ff3dd15dedeba1c4ad662495c59f59bc7f161 | 0815b2c304917b23945d90e5567a8941c9c90868 | /src/qt/guiutil.h | 64440b13b6a698e9fe6d794791a987bc1c0f88a1 | [
"MIT"
] | permissive | SHRIREMA/shreeji | ed7478b0fddd14214332c9d4981e0ff7a498b910 | 3f080ee65c88e9ddd5d9c77536de06759064ed15 | refs/heads/master | 2021-01-20T03:12:42.600733 | 2017-03-03T18:38:12 | 2017-03-03T18:38:12 | 83,828,966 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,244 | h | #ifndef GUIUTIL_H
#define GUIUTIL_H
#include <QString>
#include <QObject>
#include <QMessageBox>
QT_BEGIN_NAMESPACE
class QFont;
class QLineEdit;
class QWidget;
class QDateTime;
class QUrl;
class QAbstractItemView;
QT_END_NAMESPACE
class SendCoinsRecipient;
/** Utility functions used by the Bitcoin Qt UI.
*/
namespace GUIUtil
{
// Create human-readable string from date
QString dateTimeStr(const QDateTime &datetime);
QString dateTimeStr(qint64 nTime);
// Render Bitcoin addresses in monospace font
QFont bitcoinAddressFont();
// Set up widgets for address and amounts
void setupAddressWidget(QLineEdit *widget, QWidget *parent);
void setupAmountWidget(QLineEdit *widget, QWidget *parent);
// Parse "shreeji:" URI into recipient object, return true on successful parsing
// See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);
// HTML escaping for rich text controls
QString HtmlEscape(const QString& str, bool fMultiLine=false);
QString HtmlEscape(const std::string& str, bool fMultiLine=false);
/** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing
is selected.
@param[in] column Data column to extract from the model
@param[in] role Data role to extract from the model
@see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress
*/
void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole);
/** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix
when no suffix is provided by the user.
@param[in] parent Parent window (or 0)
@param[in] caption Window caption (or empty, for default)
@param[in] dir Starting directory (or empty, to default to documents directory)
@param[in] filter Filter specification such as "Comma Separated Files (*.csv)"
@param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0).
Can be useful when choosing the save file format based on suffix.
*/
QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(),
const QString &dir=QString(), const QString &filter=QString(),
QString *selectedSuffixOut=0);
/** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking.
@returns If called from the GUI thread, return a Qt::DirectConnection.
If called from another thread, return a Qt::BlockingQueuedConnection.
*/
Qt::ConnectionType blockingGUIThreadConnection();
// Determine whether a widget is hidden behind other windows
bool isObscured(QWidget *w);
// Open debug.log
void openDebugLogfile();
/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
representation if needed. This assures that Qt can word-wrap long tooltip messages.
Tooltips longer than the provided size threshold (in characters) are wrapped.
*/
class ToolTipToRichTextFilter : public QObject
{
Q_OBJECT
public:
explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0);
protected:
bool eventFilter(QObject *obj, QEvent *evt);
private:
int size_threshold;
};
bool GetStartOnSystemStartup();
bool SetStartOnSystemStartup(bool fAutoStart);
/** Help message for Bitcoin-Qt, shown with --help. */
class HelpMessageBox : public QMessageBox
{
Q_OBJECT
public:
HelpMessageBox(QWidget *parent = 0);
/** Show message box or print help message to standard output, based on operating system. */
void showOrPrint();
/** Print help message to console */
void printToConsole();
private:
QString header;
QString coreOptions;
QString uiOptions;
};
} // namespace GUIUtil
#endif // GUIUTIL_H
| [
"smcapl@smcapl.com"
] | smcapl@smcapl.com |
9638b14e7e7a839ed714c537994186fe5e357f23 | 38c10c01007624cd2056884f25e0d6ab85442194 | /chrome/browser/ui/views/desktop_media_picker_views.h | 5a978e75b56e100beda8c01959655cf082dbb675 | [
"BSD-3-Clause"
] | permissive | zenoalbisser/chromium | 6ecf37b6c030c84f1b26282bc4ef95769c62a9b2 | e71f21b9b4b9b839f5093301974a45545dad2691 | refs/heads/master | 2022-12-25T14:23:18.568575 | 2016-07-14T21:49:52 | 2016-07-23T08:02:51 | 63,980,627 | 0 | 2 | BSD-3-Clause | 2022-12-12T12:43:41 | 2016-07-22T20:14:04 | null | UTF-8 | C++ | false | false | 6,392 | h | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_
#include "chrome/browser/media/desktop_media_list_observer.h"
#include "chrome/browser/media/desktop_media_picker.h"
#include "ui/views/window/dialog_delegate.h"
namespace views {
class ImageView;
class Label;
} // namespace views
class DesktopMediaPickerDialogView;
class DesktopMediaPickerViews;
class DesktopMediaSourceView;
// View that shows a list of desktop media sources available from
// DesktopMediaList.
class DesktopMediaListView : public views::View,
public DesktopMediaListObserver {
public:
DesktopMediaListView(DesktopMediaPickerDialogView* parent,
scoped_ptr<DesktopMediaList> media_list);
~DesktopMediaListView() override;
void StartUpdating(content::DesktopMediaID dialog_window_id);
// Called by DesktopMediaSourceView when selection has changed.
void OnSelectionChanged();
// Called by DesktopMediaSourceView when a source has been double-clicked.
void OnDoubleClick();
// Returns currently selected source.
DesktopMediaSourceView* GetSelection();
// views::View overrides.
gfx::Size GetPreferredSize() const override;
void Layout() override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
private:
// DesktopMediaList::Observer interface
void OnSourceAdded(int index) override;
void OnSourceRemoved(int index) override;
void OnSourceMoved(int old_index, int new_index) override;
void OnSourceNameChanged(int index) override;
void OnSourceThumbnailChanged(int index) override;
// Accepts whatever happens to be selected right now.
void AcceptSelection();
DesktopMediaPickerDialogView* parent_;
scoped_ptr<DesktopMediaList> media_list_;
base::WeakPtrFactory<DesktopMediaListView> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(DesktopMediaListView);
};
// View used for each item in DesktopMediaListView. Shows a single desktop media
// source as a thumbnail with the title under it.
class DesktopMediaSourceView : public views::View {
public:
DesktopMediaSourceView(DesktopMediaListView* parent,
content::DesktopMediaID source_id);
~DesktopMediaSourceView() override;
// Updates thumbnail and title from |source|.
void SetName(const base::string16& name);
void SetThumbnail(const gfx::ImageSkia& thumbnail);
// Id for the source shown by this View.
const content::DesktopMediaID& source_id() const { return source_id_; }
// Returns true if the source is selected.
bool is_selected() const { return selected_; }
// views::View interface.
const char* GetClassName() const override;
void Layout() override;
views::View* GetSelectedViewForGroup(int group) override;
bool IsGroupFocusTraversable() const override;
void OnPaint(gfx::Canvas* canvas) override;
void OnFocus() override;
void OnBlur() override;
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
private:
// Updates selection state of the element. If |selected| is true then also
// calls SetSelected(false) for the source view that was selected before that
// (if any).
void SetSelected(bool selected);
DesktopMediaListView* parent_;
content::DesktopMediaID source_id_;
views::ImageView* image_view_;
views::Label* label_;
bool selected_;
DISALLOW_COPY_AND_ASSIGN(DesktopMediaSourceView);
};
// Dialog view used for DesktopMediaPickerViews.
class DesktopMediaPickerDialogView : public views::DialogDelegateView {
public:
DesktopMediaPickerDialogView(content::WebContents* parent_web_contents,
gfx::NativeWindow context,
DesktopMediaPickerViews* parent,
const base::string16& app_name,
const base::string16& target_name,
scoped_ptr<DesktopMediaList> media_list);
~DesktopMediaPickerDialogView() override;
// Called by parent (DesktopMediaPickerViews) when it's destroyed.
void DetachParent();
// Called by DesktopMediaListView.
void OnSelectionChanged();
void OnDoubleClick();
// views::View overrides.
gfx::Size GetPreferredSize() const override;
void Layout() override;
// views::DialogDelegateView overrides.
ui::ModalType GetModalType() const override;
base::string16 GetWindowTitle() const override;
bool IsDialogButtonEnabled(ui::DialogButton button) const override;
views::View* GetInitiallyFocusedView() override;
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
bool Accept() override;
void DeleteDelegate() override;
void OnMediaListRowsChanged();
DesktopMediaListView* GetMediaListViewForTesting() const;
DesktopMediaSourceView* GetMediaSourceViewForTesting(int index) const;
private:
DesktopMediaPickerViews* parent_;
base::string16 app_name_;
views::Label* label_;
views::ScrollView* scroll_view_;
DesktopMediaListView* list_view_;
DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerDialogView);
};
// Implementation of DesktopMediaPicker for Views.
class DesktopMediaPickerViews : public DesktopMediaPicker {
public:
DesktopMediaPickerViews();
~DesktopMediaPickerViews() override;
void NotifyDialogResult(content::DesktopMediaID source);
// DesktopMediaPicker overrides.
void Show(content::WebContents* web_contents,
gfx::NativeWindow context,
gfx::NativeWindow parent,
const base::string16& app_name,
const base::string16& target_name,
scoped_ptr<DesktopMediaList> media_list,
const DoneCallback& done_callback) override;
DesktopMediaPickerDialogView* GetDialogViewForTesting() const {
return dialog_;
}
private:
DoneCallback callback_;
// The |dialog_| is owned by the corresponding views::Widget instance.
// When DesktopMediaPickerViews is destroyed the |dialog_| is destroyed
// asynchronously by closing the widget.
DesktopMediaPickerDialogView* dialog_;
DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerViews);
};
#endif // CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_
| [
"zeno.albisser@hemispherian.com"
] | zeno.albisser@hemispherian.com |
3377072dbc0cdaf9e42e9fe2bcac114ebd7fa20d | 37381dee5aa81a713ac55bc3fb3772c9b3fb86ed | /ProFin/src/valconvC++/jeje/arguments.cpp | 46e3206220deed5e1b5f16bbf22024450fa51ff0 | [] | no_license | mj-chuz/Proyectos-Ensambla | 51bbd23ad9f6e04167b45e6ae7bd2f50318d7b33 | 2c0683e7189478886d80cebed1d22fcba7b8ce41 | refs/heads/main | 2023-03-27T03:43:22.054877 | 2021-04-02T01:22:22 | 2021-04-02T01:22:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,251 | cpp | #include <stdio.h>
#include <string.h>
#include "arguments.h"
#include <iostream>
/*void init_arguments(arguments_t* arguments)
{
(*arguments).help_asked = false;
arguments->version_asked = false;
arguments->convert_to = TO_UNKNOWN;
arguments->is_valid = true;
arguments->output_format = NULL;
}
*/
void Arguments::analyze_arguments(int argc, char* argv[])
{
//arguments_t arguments;
//init_arguments(&arguments);
// printf("sizeof(arguments) = %zu\n", sizeof(arguments));
for ( int arg_index = 1; arg_index < argc; ++arg_index )
{
if ( strcmp( argv[arg_index], "--help") == 0 )
this->help_asked = true;
if ( strcmp( argv[arg_index], "--version") == 0 )
this->version_asked = true;
if ( strcmp( argv[arg_index], "-b") == 0 )
analyze_conversion_type(1, 2);
if ( strcmp( argv[arg_index], "-t") == 0 )
analyze_conversion_type(2, 1);
}
}
/*
arguments_t analyze_arguments(int argc, char* argv[])
{
arguments_t arguments;
init_arguments(&arguments);
// printf("sizeof(arguments) = %zu\n", sizeof(arguments));
for ( int arg_index = 1; arg_index < argc; ++arg_index )
{
if ( strcmp( argv[arg_index], "--help") == 0 )
arguments.help_asked = true;
if ( strcmp( argv[arg_index], "--version") == 0 )
arguments.version_asked = true;
if ( strcmp( argv[arg_index], "-b") == 0 )
analyze_conversion_type(&arguments, 1, 2);
if ( strcmp( argv[arg_index], "-t") == 0 )
analyze_conversion_type(&arguments, 2, 1);
}
return arguments;
}
*/
///void analyze_conversion_type(arguments_t* arguments, conversion_t destination, conversion_t complement)
void Arguments::analyze_conversion_type(int destination, int complement)
{
if (this-> convert_to != complement)
///if ( arguments->convert_to != complement )
this-> convert_to = destination;
//arguments->convert_to = destination;
else
{
fprintf(stderr, "valconv: error: only a conversion type is allowed\n");
//arguments->is_valid = false;
this->is_valid = false;
}
}
bool Arguments::isValid()
{
bool valid=false;
if (this->is_valid)
{
valid=true;
}
return valid;
}
bool Arguments::helpAsked()
{
bool help=false;
if (this->help_asked)
{
help=true;
}
return help;
}
bool Arguments::versionAsked()
{
bool version=false;
if (this->version_asked)
{
version=true;
}
return version;
}
/*onst char* const valconv_help =
"usage: valconv [options] files...\n"
"\n"
"Options:\n"
" -b Converts all files to binary\n"
" -t Converts all files to text format\n"
"\n"
"If no conversion type is given, the file extension will be used\n";
*/
int Arguments::print_help(void)
{
const char* const valconv_help =
"usage: valconv [options] files...\n"
"\n"
"Options:\n"
" -b Converts all files to binary\n"
" -t Converts all files to text format\n"
"\n"
"If no conversion type is given, the file extension will be used\n";
//printf("%s", valconv_help);
std::cout << valconv_help;
return 0;
}
int Arguments::print_version(void)
{
std::cout << "valconv v1.1 20200515 ECCI-UCR" << std::endl;
//printf("valconv v1.1 20200515 ECCI-UCR\n");
std::cout << "This is free software. Use it at your own risk" << std::endl;
///printf("This is free software. Use it at your own risk\n");
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
e6a8ee1424a8f038ee1e1ede94e2acd9afa5ba22 | b24a093361caf863b297e7d4105d6c72e761e37c | /src/mynteye/device/standard2/streams_adapter_s2.h | 94479d69e6e280381be10c9bad406eeb09a4afd2 | [
"Apache-2.0"
] | permissive | LSXiang/MYNT-EYE-S-SDK | 2692edc18f958d15d21da857107caab91725ec61 | f921be4ad77701aff09d95039b012b4ab4df8ce0 | refs/heads/master | 2023-05-09T01:39:04.352772 | 2021-05-31T06:21:17 | 2021-05-31T06:21:17 | 333,706,176 | 1 | 1 | NOASSERTION | 2021-01-28T09:17:43 | 2021-01-28T09:17:43 | null | UTF-8 | C++ | false | false | 1,404 | h | // Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_DEVICE_STANDARD2_STREAMS_ADAPTER_S2_H_
#define MYNTEYE_DEVICE_STANDARD2_STREAMS_ADAPTER_S2_H_
#pragma once
#include <map>
#include <memory>
#include <vector>
#include "mynteye/device/streams.h"
MYNTEYE_BEGIN_NAMESPACE
class Standard2StreamsAdapter : public StreamsAdapter {
public:
explicit Standard2StreamsAdapter(const Model &model);
virtual ~Standard2StreamsAdapter();
std::vector<Stream> GetKeyStreams() override;
std::vector<Capabilities> GetStreamCapabilities() override;
std::map<Stream, Streams::unpack_img_data_t>
GetUnpackImgDataMap() override;
std::map<Stream, Streams::unpack_img_pixels_t>
GetUnpackImgPixelsMap() override;
private:
Model model_;
};
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_DEVICE_STANDARD2_STREAMS_ADAPTER_S2_H_
| [
"johnzhao@slightech.com"
] | johnzhao@slightech.com |
bbfc49314baa83650ec6edc390614659f9564c66 | 615e2600fafe5bb4a25adc44a8f7d4d91fa33024 | /src/SimpleSpectrum.cxx | b39d78c888c00e506f49b7048546c23ea6c82840 | [
"BSD-3-Clause"
] | permissive | fermi-lat/flux | 1474e514b6047f545929059c2425ee92e60c35f0 | d75cdb273c93c5eda13b6dc211d9799844131860 | refs/heads/master | 2023-09-01T13:39:18.765691 | 2022-04-28T18:34:08 | 2022-04-28T18:34:08 | 86,004,258 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,601 | cxx | /** @file SimpleSpectrum.cxx
@brief definition of SimpleSpectrum
$Header: /nfs/slac/g/glast/ground/cvs/flux/src/SimpleSpectrum.cxx,v 1.13 2007/08/29 17:40:15 burnett Exp $
*/
#include "flux/SimpleSpectrum.h"
#include "flux/SpectrumFactory.h"
#include "flux/FluxException.h" // for FATAL_MACRO
#include <xercesc/dom/DOMElement.hpp>
#include "xmlBase/Dom.h"
#include "facilities/Util.h"
#include <cstdlib>
#include <utility>
#include <sstream>
#include <cmath>
#include <map>
#include <stdexcept>
static SpectrumFactory<SimpleSpectrum> factory;
namespace {
// useful utility functions
// differential rate: return energy distrbuted as e**-gamma between e1 and e2, if r is uniform from 0 to1
double power_law( double r, double e1, double e2, double gamma)
{
double e= gamma==1
? e1*exp(r*log(e2/e1))
: e1*exp(log(1.0 - r*(1.-pow(e2/e1,1-gamma)))/(1-gamma));
return e;
}
// integral of e**-gamma from e1 to e2
double total_rate(double e1, double e2, double gamma)
{
return gamma==1
? log(e2/e1)
: ( pow(e1, 1-gamma) - pow(e2,1-gamma) ) / (gamma-1);
}
///@class ParMap
///@brief local analysis of keyword string
class ParMap{
public:
ParMap(std::string paramString)
{
facilities::Util::keyValueTokenize(paramString,",",m_tokenMap);
}
double value(std::string name) const{
std::map<std::string,std::string>::const_iterator it = m_tokenMap.find(name);
if( it==m_tokenMap.end() ) {
throw std::invalid_argument("SimpleSPectrum: keyword "+name+" not found");
}
return std::atof(it->second.c_str());
}
private:
std::map<std::string,std::string> m_tokenMap;
};
}
// implement simple broken power law
SimpleSpectrum::SimpleSpectrum(const std::string& paramString)
: m_name("gamma")
, m_E0(10)
, m_index(2.0)
, m_index2(2.0)
, m_ebreak(0)
, m_emax(200000)
{
bool qemax(false);
ParMap parmap(paramString);
try {
m_E0 = parmap.value("emin");
} catch (...) { }
try {
m_emax = parmap.value("emax");
qemax=true;
} catch (...) {}
try {
m_index = parmap.value("gamma");
} catch (...) {}
try {
m_index2 = parmap.value("gamma2");
m_ebreak = parmap.value("ebreak");
} catch (...) {}
setup_power_law();
}
SimpleSpectrum::SimpleSpectrum(const
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* xelem,
bool useGeV)
: m_useGeV(useGeV)
{
m_name = xmlBase::Dom::getAttribute(xelem, "name").c_str();
const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* spectrum =
xmlBase::Dom::findFirstChildByName(xelem, "*");
std::string tagName = xmlBase::Dom::getTagName(spectrum);
if( tagName == "power_law" ){
m_E0 = xmlBase::Dom::getDoubleAttribute(spectrum, "emin");
m_emax = xmlBase::Dom::getDoubleAttribute(spectrum, "emax");
m_index =xmlBase::Dom::getDoubleAttribute(spectrum, "gamma");
m_ebreak = xmlBase::Dom::getDoubleAttribute(spectrum, "ebreak");
m_index2 =xmlBase::Dom::getDoubleAttribute(spectrum, "gamma2");
setup_power_law();
}
else if(tagName=="energy") {
// single energy: no interpolation
m_emax =m_E0 =xmlBase::Dom::getDoubleAttribute(spectrum, "e");
}
else if( tagName == "exponential") {
m_E0 = xmlBase::Dom::getDoubleAttribute(spectrum, "exponential");
m_index = xmlBase::Dom::getDoubleAttribute(spectrum,"exponent");
m_emax = 100.0;
m_index = 0.0;
FATAL_MACRO("exponential spectral component not implemented yet");
}
else {
std::cerr << "Unknown name: " << m_name << std::endl;
FATAL_MACRO("Unknown particle spectrum!");
}
}
void SimpleSpectrum::setup_power_law()
{
if( m_ebreak==0) {
m_ebreak=m_emax;
m_a = 1.0;
}else{
// calculate relative part of spectrum for lower
double a1 = total_rate(m_E0, m_ebreak, m_index);
double a2 = pow(m_ebreak, m_index2-m_index)*total_rate(m_ebreak, m_emax, m_index2);
m_a = a1/(a1+a2);
}
}
std::string SimpleSpectrum::title()const
{
std::stringstream s;
s << particleName() << '(' << m_E0 << (m_useGeV? " GeV" : " MeV") ;
if( m_index >=1 ) s << ',' << m_index ;
if(m_ebreak !=0) s << "," << m_ebreak << "," << m_index2;
s << ")";
return s.str();
}
float
SimpleSpectrum::operator()(float f)
{
if( m_emax==m_E0) return m_E0;
float energy;
if( f<m_a ) {
//float x = 1 - exp((1-m_index)*log(m_emax/m_E0));
//return m_E0*exp(log(1-x*f)/(1-m_index));
// single power law, or first segment
energy = power_law(f/m_a, m_E0, m_ebreak, m_index);
}else{
// break in the power law above the break
energy = power_law( (f-m_a)/(1-m_a), m_ebreak, m_emax, m_index2);
}
return energy;
}
const char*
SimpleSpectrum::particleName() const
{
return m_name.c_str();
}
float SimpleSpectrum::parseParamList(std::string input, int index)
{
std::vector<float> output;
int i=0;
for(;!input.empty() && i!=std::string::npos;){
float f = ::atof( input.c_str() );
output.push_back(f);
i=input.find_first_of(",");
input= input.substr(i+1);
}
// @todo: throw explicit exception
if( index < output.size() ){
return output.at(index);
}else{
return 0;
}
}
| [
""
] | |
f2ae1a7dc8d5100cbebc1d2fd4f73aaba4d763a3 | 55a4fa8f0fe859d9683b5dd826a9b8378a6503df | /c++/typeid.cpp | a01d1c8f882df90508ba4838794f988770b3fbd2 | [] | no_license | rongc5/test | 399536df25d3d3e71cac8552e573f6e2447de631 | acb4f9254ecf647b8f36743899ae38a901b01aa6 | refs/heads/master | 2023-06-26T05:38:37.147507 | 2023-06-15T03:33:08 | 2023-06-15T03:33:08 | 33,905,442 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 430 | cpp | #include <iostream>
#include <string.h>
using namespace std;
int main(int argc, char *argv[])
{
int a = 5;
int b = 6;
float c = 7.5;
double d = 9.9;
//const type_info& t1 =
cout << "****" << typeid(a).name() << "~~~" << typeid(c).name() <<"!!!!" << typeid(d).name()<< endl;
if (typeid(a).name() == typeid(b).name())
{
cout << "==>" << typeid(a).name() << endl;
}
return 0;
}
| [
"zhangming025251@gmail.com"
] | zhangming025251@gmail.com |
70f84fb1efc682242418cc265a0ed45b3001f7b0 | d30e40dcf34d8710f6138b2d3415e7e2ef24a719 | /policy_test.cc | 8de396de4034f5a5eeda446fb81e9ce9f662abe7 | [
"BSD-2-Clause"
] | permissive | asankah/dwimd | a849d7feaa9a841df03ed679948792b22429107b | 8352658aec8d8e542f4da70bea7da32fe48cf628 | refs/heads/master | 2021-01-17T17:05:08.684556 | 2018-08-21T20:05:02 | 2018-08-21T20:05:02 | 31,672,386 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,211 | cc | // See LICENSE file
#include "dwimd.h"
#include "policy_test.h"
#include <shlobj.h>
#include <shobjidl.h>
namespace {
static const GUID kClientID = { /* 8d9d2384-c58d-4b7c-a88d-aa54d498086a */
0x8d9d2384,
0xc58d,
0x4b7c,
{0xa8, 0x8d, 0xaa, 0x54, 0xd4, 0x98, 0x08, 0x6a}
};
} // namespace
bool PolicyTest::Run(const TestParameters& parameters) {
HRESULT hr;
ScopedTimerLog scope;
LOG(INFO) << "Invoking Attachment Services" << std::endl;
CComPtr<IAttachmentExecute> attachment_services;
hr = CoCreateInstance(CLSID_AttachmentServices, NULL,
CLSCTX_INPROC_SERVER, IID_IAttachmentExecute,
(void**) &attachment_services);
if (FAILED(hr)) {
LOG(ERR) << "Can't instantiate Attachment Services class. HR="
<< std::hex << std::endl;
return false;
}
hr = attachment_services->SetClientGuid(kClientID);
if (FAILED(hr)) {
LOG(ERR) << "Can't set client GUID. HR=" << std::hex << hr << std::endl;
return false;
}
hr = attachment_services->SetLocalPath(parameters.path.c_str());
if (FAILED(hr)) {
LOG(ERR) << "Can't set local path. HR=" << std::hex << hr << std::endl;
return false;
}
hr = attachment_services->SetSource(parameters.url.c_str());
if (FAILED(hr)) {
LOG(ERR) << "Can't set source URL. HR=" << std::hex << hr << std::endl;
return false;
}
hr = attachment_services->CheckPolicy();
LOG(INFO) << "IAttachmentExecute::CheckPolicy() returned code "
<< std::hex << hr << " (" << PolicyCheckResultToString(hr) << ")"
<< std::endl;
if (FAILED(hr)) {
LOG(SUMMARY) << "IAttachmentExecute::CheckPolicy() returned code "
<< std::hex << hr
<< " (" << PolicyCheckResultToString(hr) << ")" << std::endl;
if (hr == INET_E_SECURITY_PROBLEM) {
LOG(SUMMARY) << std::endl <<
"This error is likely because your security settings are configured "
"to block downloads from this URL (" << parameters.url << "). "
"Check your security zone settings."
<< std::endl << std::endl;
}
}
HRESULT save_hr = attachment_services->Save();
LOG(INFO) << "IAttachmentExecute::Save() returned code "
<< std::hex << save_hr << " (" << ScanResultToString(save_hr) << ")"
<< std::endl;
if (FAILED(save_hr)) {
LOG(SUMMARY) << "IAttachmentExecute::Save() returned code "
<< std::hex << save_hr
<< " (" << ScanResultToString(save_hr) << ")"
<< std::endl;
if (hr == save_hr && hr == INET_E_SECURITY_PROBLEM) {
LOG(SUMMARY) << "Since the IAttachmentExecute::CheckPolicy() test also "
<< "failed, this error is likely due to that failure."
<< std::endl << std::endl;
} else if (save_hr == __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) {
LOG(SUMMARY) << "The file at " << parameters.path << " may not exist or may not be accessible." << std::endl;
} else {
LOG(SUMMARY) << "Check for errors in the 'AV Scanners' test above."
<< std::endl << std::endl;
}
}
return SUCCEEDED(hr) && SUCCEEDED(save_hr);
}
| [
"asanka@chromium.org"
] | asanka@chromium.org |
22a7fd0cac5fba66a260ed1722098364d8ee4bb7 | 9c5d73ebee96e39f7311f8a29eb46f3aa82c9c34 | /source/native-plugins/zita-rev1/mainwin.cc | 88eabb5cd36f978f9e19827c46e02180cd013602 | [] | no_license | bagnz0r/Carla | 4dcdb22e10e8ae0a620fb5b556fa17ef6d788b56 | 6347381f84dea5c0fda0d299f3786aae58a3d86b | refs/heads/master | 2021-01-22T15:22:17.591706 | 2015-01-23T07:02:13 | 2015-01-23T07:02:13 | 29,738,354 | 1 | 0 | null | 2015-01-23T15:19:50 | 2015-01-23T15:19:50 | null | UTF-8 | C++ | false | false | 7,015 | cc | // ----------------------------------------------------------------------
//
// Copyright (C) 2010 Fons Adriaensen <fons@linuxaudio.org>
// Modified by falkTX on Jan 2015 for inclusion in Carla
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ----------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "styles.h"
#include "global.h"
#include "mainwin.h"
namespace REV1 {
Mainwin::Mainwin (X_rootwin *parent, X_resman *xres, int xp, int yp, Jclient *jclient, ValueChangedCallback* valuecb) :
A_thread ("Main"),
X_window (parent, xp, yp, XSIZE, YSIZE, XftColors [C_MAIN_BG]->pixel),
_stop (false),
_xres (xres),
_jclient (jclient),
_valuecb (valuecb)
{
X_hints H;
char s [256];
int i, x;
_atom = XInternAtom (dpy (), "WM_DELETE_WINDOW", True);
XSetWMProtocols (dpy (), win (), &_atom, 1);
_atom = XInternAtom (dpy (), "WM_PROTOCOLS", True);
sprintf (s, "%s", jclient->jname ());
x_set_title (s);
H.position (xp, yp);
H.minsize (XSIZE, YSIZE);
H.maxsize (XSIZE, YSIZE);
H.rname (xres->rname ());
H.rclas (xres->rclas ());
x_apply (&H);
_ambis = xres->getb (".ambisonic", false);
RotaryCtl::init (disp ());
x = 0;
_rotary [R_DELAY] = new Rlinctl (this, this, &r_delay_img, x, 0, 160, 5, 0.02, 0.100, 0.04, R_DELAY);
_rotary [R_XOVER] = new Rlogctl (this, this, &r_xover_img, x, 0, 200, 5, 50.0, 1000.0, 200.0, R_XOVER);
_rotary [R_RTLOW] = new Rlogctl (this, this, &r_rtlow_img, x, 0, 200, 5, 1.0, 8.0, 3.0, R_RTLOW);
_rotary [R_RTMID] = new Rlogctl (this, this, &r_rtmid_img, x, 0, 200, 5, 1.0, 8.0, 2.0, R_RTMID);
_rotary [R_FDAMP] = new Rlogctl (this, this, &r_fdamp_img, x, 0, 200, 5, 1.5e3, 24.0e3, 6.0e3, R_FDAMP);
x += 315;
_rotary [R_EQ1FR] = new Rlogctl (this, this, &r_parfr_img, x, 0, 180, 5, 40.0, 2.5e3, 160.0, R_EQ1FR);
_rotary [R_EQ1GN] = new Rlinctl (this, this, &r_pargn_img, x, 0, 150, 5, -15.0, 15.0, 0.0, R_EQ1GN);
x += 110;
_rotary [R_EQ2FR] = new Rlogctl (this, this, &r_parfr_img, x, 0, 180, 5, 160.0, 10e3, 2.5e3, R_EQ2FR);
_rotary [R_EQ2GN] = new Rlinctl (this, this, &r_pargn_img, x, 0, 150, 5, -15.0, 15.0, 0.0, R_EQ2GN);
x += 110;
_rotary [R_OPMIX] = new Rlinctl (this, this, &r_opmix_img, x, 0, 180, 5, 0.0 , 1.0, 0.5, R_OPMIX);
_rotary [R_RGXYZ] = new Rlinctl (this, this, &r_rgxyz_img, x, 0, 180, 5, -9.0 , 9.0, 0.0, R_RGXYZ);
for (i = 0; i < R_OPMIX; i++) _rotary [i]->x_map ();
if (_ambis) _rotary [R_RGXYZ]->x_map ();
else _rotary [R_OPMIX]->x_map ();
x_add_events (ExposureMask);
x_map ();
set_time (0);
inc_time (500000);
}
Mainwin::~Mainwin (void)
{
RotaryCtl::fini ();
}
int Mainwin::process (void)
{
int e;
if (_stop) handle_stop ();
e = get_event_timed ();
switch (e)
{
case EV_TIME:
handle_time ();
break;
}
return e;
}
void Mainwin::handle_event (XEvent *E)
{
switch (E->type)
{
case Expose:
expose ((XExposeEvent *) E);
break;
case ClientMessage:
clmesg ((XClientMessageEvent *) E);
break;
}
}
void Mainwin::expose (XExposeEvent *E)
{
if (E->count) return;
redraw ();
}
void Mainwin::clmesg (XClientMessageEvent *E)
{
if (E->message_type == _atom) _stop = true;
}
void Mainwin::handle_time (void)
{
inc_time (500000);
// XFlush (dpy ());
}
void Mainwin::handle_stop (void)
{
put_event (EV_EXIT, 1);
}
void Mainwin::handle_callb (int type, X_window *W, XEvent *E)
{
RotaryCtl *R;
int k;
double v, v2;
switch (type)
{
case RotaryCtl::PRESS:
R = (RotaryCtl *) W;
k = R->cbind ();
switch (k)
{
default:
;
}
break;
case RotaryCtl::DELTA:
R = (RotaryCtl *) W;
k = R->cbind ();
switch (k)
{
case R_DELAY:
v = _rotary [R_DELAY]->value ();
_jclient->reverb ()->set_delay (v);
_valuecb->valueChangedCallback (R_DELAY, v);
break;
case R_XOVER:
v = _rotary [R_XOVER]->value ();
_jclient->reverb ()->set_xover (v);
_valuecb->valueChangedCallback (R_XOVER, v);
break;
case R_RTLOW:
v = _rotary [R_RTLOW]->value ();
_jclient->reverb ()->set_rtlow (v);
_valuecb->valueChangedCallback (R_RTLOW, v);
break;
case R_RTMID:
v = _rotary [R_RTMID]->value ();
_jclient->reverb ()->set_rtmid (v);
_valuecb->valueChangedCallback (R_RTMID, v);
break;
case R_FDAMP:
v = _rotary [R_FDAMP]->value ();
_jclient->reverb ()->set_fdamp (v);
_valuecb->valueChangedCallback (R_FDAMP, v);
break;
case R_OPMIX:
v = _rotary [R_OPMIX]->value ();
_jclient->reverb ()->set_opmix (v);
_valuecb->valueChangedCallback (R_OPMIX, v);
break;
case R_RGXYZ:
v = _rotary [R_RGXYZ]->value ();
_jclient->reverb ()->set_rgxyz (v);
_valuecb->valueChangedCallback (R_RGXYZ, v);
break;
case R_EQ1FR:
case R_EQ1GN:
v = _rotary [R_EQ1FR]->value (), v2 = _rotary [R_EQ1GN]->value ();
_jclient->reverb ()->set_eq1 (v, v2);
_valuecb->valueChangedCallback (R_EQ1FR, v);
_valuecb->valueChangedCallback (R_EQ1GN, v2);
break;
case R_EQ2FR:
case R_EQ2GN:
v = _rotary [R_EQ2FR]->value (), v2 = _rotary [R_EQ2GN]->value ();
_jclient->reverb ()->set_eq2 (v, v2);
_valuecb->valueChangedCallback (R_EQ2FR, v);
_valuecb->valueChangedCallback (R_EQ2GN, v2);
break;
}
break;
}
}
void Mainwin::redraw (void)
{
int x;
x = 0;
XPutImage (dpy (), win (), dgc (), revsect_img, 0, 0, x, 0, 310, 75);
x += 315;
XPutImage (dpy (), win (), dgc (), eq1sect_img, 0, 0, x, 0, 110, 75);
x += 110;
XPutImage (dpy (), win (), dgc (), eq2sect_img, 0, 0, x, 0, 110, 75);
x += 110;
if (_ambis) XPutImage (dpy (), win (), dgc (), ambsect_img, 0, 0, x, 0, 70, 75);
else XPutImage (dpy (), win (), dgc (), mixsect_img, 0, 0, x, 0, 70, 75);
x += 70;
}
}
| [
"falktx@gmail.com"
] | falktx@gmail.com |
f7b5a817dc0ec8694b5e907485e1e8b69d9e629c | 0c65f75f7f52ee9e74df713451a2d47730a32394 | /CPP_StandardLibrary/Sets.h | 81f26a30c670a1b0910e9364ac2618fed623721b | [] | no_license | pradeep87blore/CPP_StandardLibrary | a8bd03ad5af56662df8d3e9c99df30e67ddf398e | 2f09483cb8e5cc89d401d79fca5ed86f5253290b | refs/heads/master | 2021-09-04T18:42:04.624740 | 2018-01-19T11:06:07 | 2018-01-19T11:06:07 | 116,353,820 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 310 | h | #pragma once
#include "DemoClass.h"
class Sets
{
Sets() = delete;
~Sets() = delete;
static void SetInitializationDemo();
static void SetOperationsDemo();
static void MultiSetInitializationDemo();
static void MultiSetOperationsDemo();
public:
static void Demonstrate();
};
| [
"pradeep87blore@users.noreply.github.com"
] | pradeep87blore@users.noreply.github.com |
775172217e62f5b0d9f8819373f099f7a7b60abf | 12fd5a52345329ba7224593ffac292b64c3d8be7 | /Intermediate/Plugins/NativizedAssets/Windows/Game/Source/NativizedAssets/Private/optionsMenu__pf1343218889.cpp | 4c019457cc2ba6f14864da0bdbb9c2bfafee8b20 | [] | no_license | bcharris916/steam | 5efeffaf75a062d1b92bd3f8f08611fedd4da5ef | 5407c4e1e47cee6d139af43bcc8fb715958e567a | refs/heads/master | 2021-05-10T23:27:57.557316 | 2018-04-02T18:36:46 | 2018-04-02T18:36:46 | 118,278,270 | 0 | 0 | null | 2018-03-13T20:31:22 | 2018-01-20T20:30:56 | null | UTF-8 | C++ | false | false | 68,635 | cpp | #include "NativizedAssets.h"
#include "optionsMenu__pf1343218889.h"
#include "GeneratedCodeHelpers.h"
#include "Runtime/UMG/Public/Blueprint/WidgetTree.h"
#include "Runtime/UMG/Public/Components/CanvasPanel.h"
#include "Runtime/UMG/Public/Components/CanvasPanelSlot.h"
#include "Runtime/UMG/Public/Components/Border.h"
#include "Runtime/UMG/Public/Components/BorderSlot.h"
#include "Runtime/UMG/Public/Components/VerticalBox.h"
#include "Runtime/UMG/Public/Components/VerticalBoxSlot.h"
#include "Runtime/UMG/Public/Components/TextBlock.h"
#include "Runtime/Engine/Classes/Engine/Font.h"
#include "Runtime/UMG/Public/Components/EditableTextBox.h"
#include "Runtime/UMG/Public/Components/HorizontalBox.h"
#include "Runtime/UMG/Public/Components/HorizontalBoxSlot.h"
#include "Runtime/UMG/Public/Components/Button.h"
#include "Runtime/UMG/Public/Components/ButtonSlot.h"
#include "Runtime/UMG/Public/Components/SizeBox.h"
#include "Runtime/UMG/Public/Components/SizeBoxSlot.h"
#include "Runtime/UMG/Public/Components/Image.h"
#include "Runtime/UMG/Public/Components/Spacer.h"
#include "Runtime/Engine/Classes/Engine/ComponentDelegateBinding.h"
#include "Runtime/Engine/Classes/Engine/BlueprintGeneratedClass.h"
#include "Runtime/Engine/Classes/Engine/GameInstance.h"
#include "Runtime/CoreUObject/Public/UObject/NoExportTypes.h"
#include "Runtime/Engine/Classes/Engine/LocalPlayer.h"
#include "Runtime/Engine/Classes/Engine/Player.h"
#include "Runtime/Engine/Classes/GameFramework/PlayerController.h"
#include "Runtime/Engine/Classes/GameFramework/Controller.h"
#include "Runtime/Engine/Classes/GameFramework/Actor.h"
#include "Runtime/Engine/Classes/Engine/EngineBaseTypes.h"
#include "Runtime/Engine/Classes/Engine/EngineTypes.h"
#include "Runtime/Engine/Classes/Engine/NetSerialization.h"
#include "Runtime/Engine/Classes/Components/SceneComponent.h"
#include "Runtime/Engine/Classes/Components/ActorComponent.h"
#include "Runtime/Engine/Classes/Engine/AssetUserData.h"
#include "Runtime/Engine/Classes/EdGraph/EdGraphPin.h"
#include "Runtime/Engine/Classes/Interfaces/Interface_AssetUserData.h"
#include "Runtime/Engine/Classes/GameFramework/PhysicsVolume.h"
#include "Runtime/Engine/Classes/GameFramework/Volume.h"
#include "Runtime/Engine/Classes/Engine/Brush.h"
#include "Runtime/Engine/Classes/Components/BrushComponent.h"
#include "Runtime/Engine/Classes/Components/PrimitiveComponent.h"
#include "Runtime/Engine/Classes/PhysicsEngine/BodyInstance.h"
#include "Runtime/Engine/Classes/PhysicalMaterials/PhysicalMaterial.h"
#include "Runtime/Engine/Classes/PhysicsEngine/PhysicsSettingsEnums.h"
#include "Runtime/Engine/Classes/PhysicalMaterials/PhysicalMaterialPropertyBase.h"
#include "Runtime/Engine/Classes/Vehicles/TireType.h"
#include "Runtime/Engine/Classes/Engine/DataAsset.h"
#include "Runtime/InputCore/Classes/InputCoreTypes.h"
#include "Runtime/Engine/Classes/Materials/MaterialInterface.h"
#include "Runtime/Engine/Classes/Engine/SubsurfaceProfile.h"
#include "Runtime/Engine/Classes/Materials/Material.h"
#include "Runtime/Engine/Public/MaterialShared.h"
#include "Runtime/Engine/Classes/Materials/MaterialExpression.h"
#include "Runtime/Engine/Classes/Materials/MaterialFunction.h"
#include "Runtime/Engine/Classes/Materials/MaterialParameterCollection.h"
#include "Runtime/Engine/Classes/Engine/BlendableInterface.h"
#include "Runtime/Engine/Classes/Engine/Texture.h"
#include "Runtime/Engine/Classes/Engine/TextureDefines.h"
#include "Runtime/Engine/Classes/Materials/MaterialInstanceDynamic.h"
#include "Runtime/Engine/Classes/Materials/MaterialInstance.h"
#include "Runtime/Engine/Classes/Engine/Texture2D.h"
#include "Runtime/Engine/Classes/Engine/FontImportOptions.h"
#include "Runtime/SlateCore/Public/Fonts/CompositeFont.h"
#include "Runtime/SlateCore/Public/Fonts/FontProviderInterface.h"
#include "Runtime/Engine/Classes/Materials/MaterialInstanceBasePropertyOverrides.h"
#include "Runtime/Engine/Classes/GameFramework/Pawn.h"
#include "Runtime/Engine/Classes/GameFramework/PlayerState.h"
#include "Runtime/Engine/Classes/GameFramework/Info.h"
#include "Runtime/Engine/Classes/Components/BillboardComponent.h"
#include "Runtime/Engine/Classes/GameFramework/LocalMessage.h"
#include "Runtime/Engine/Classes/GameFramework/OnlineReplStructs.h"
#include "Runtime/CoreUObject/Public/UObject/CoreOnline.h"
#include "Runtime/Engine/Classes/GameFramework/EngineMessage.h"
#include "Runtime/Engine/Classes/GameFramework/PawnMovementComponent.h"
#include "Runtime/Engine/Classes/GameFramework/NavMovementComponent.h"
#include "Runtime/Engine/Classes/GameFramework/MovementComponent.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavigationTypes.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavigationData.h"
#include "Runtime/Engine/Classes/AI/Navigation/RecastNavMesh.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavAgentInterface.h"
#include "Runtime/AIModule/Classes/AIController.h"
#include "Runtime/AIModule/Classes/Navigation/PathFollowingComponent.h"
#include "Runtime/AIModule/Classes/AIResourceInterface.h"
#include "Runtime/AIModule/Classes/BrainComponent.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BlackboardComponent.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BlackboardData.h"
#include "Runtime/AIModule/Classes/BehaviorTree/Blackboard/BlackboardKeyType.h"
#include "Runtime/AIModule/Classes/Perception/AIPerceptionComponent.h"
#include "Runtime/AIModule/Classes/Perception/AISenseConfig.h"
#include "Runtime/AIModule/Classes/Perception/AISense.h"
#include "Runtime/AIModule/Classes/Perception/AIPerceptionTypes.h"
#include "Runtime/AIModule/Classes/Perception/AIPerceptionSystem.h"
#include "Runtime/AIModule/Classes/Perception/AISenseEvent.h"
#include "Runtime/AIModule/Classes/Actions/PawnActionsComponent.h"
#include "Runtime/AIModule/Classes/Actions/PawnAction.h"
#include "Runtime/AIModule/Classes/AITypes.h"
#include "Runtime/GameplayTasks/Classes/GameplayTasksComponent.h"
#include "Runtime/GameplayTasks/Classes/GameplayTask.h"
#include "Runtime/GameplayTasks/Classes/GameplayTaskOwnerInterface.h"
#include "Runtime/GameplayTasks/Classes/GameplayTaskResource.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavFilters/NavigationQueryFilter.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavAreas/NavArea.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BehaviorTree.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BTCompositeNode.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BTNode.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BTTaskNode.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BTService.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BTAuxiliaryNode.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BTDecorator.h"
#include "Runtime/AIModule/Classes/BehaviorTree/BehaviorTreeTypes.h"
#include "Runtime/AIModule/Classes/Perception/AIPerceptionListenerInterface.h"
#include "Runtime/AIModule/Classes/GenericTeamAgentInterface.h"
#include "Runtime/Engine/Public/VisualLogger/VisualLoggerDebugSnapshotInterface.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavRelevantInterface.h"
#include "Runtime/Engine/Classes/PhysicsEngine/BodySetup.h"
#include "Runtime/Engine/Classes/PhysicsEngine/AggregateGeom.h"
#include "Runtime/Engine/Classes/PhysicsEngine/SphereElem.h"
#include "Runtime/Engine/Classes/PhysicsEngine/ShapeElem.h"
#include "Runtime/Engine/Classes/PhysicsEngine/BoxElem.h"
#include "Runtime/Engine/Classes/PhysicsEngine/SphylElem.h"
#include "Runtime/Engine/Classes/PhysicsEngine/ConvexElem.h"
#include "Runtime/Engine/Classes/PhysicsEngine/BodySetupEnums.h"
#include "Runtime/Engine/Classes/Components/InputComponent.h"
#include "Runtime/Engine/Classes/Matinee/MatineeActor.h"
#include "Runtime/Engine/Classes/Matinee/InterpData.h"
#include "Runtime/Engine/Classes/Matinee/InterpGroup.h"
#include "Runtime/Engine/Classes/Matinee/InterpTrack.h"
#include "Runtime/Engine/Classes/Matinee/InterpTrackInst.h"
#include "Runtime/Engine/Classes/Engine/InterpCurveEdSetup.h"
#include "Runtime/Engine/Classes/Matinee/InterpGroupDirector.h"
#include "Runtime/Engine/Classes/Matinee/InterpGroupInst.h"
#include "Runtime/Engine/Classes/Components/ChildActorComponent.h"
#include "Runtime/Engine/Classes/GameFramework/DamageType.h"
#include "Runtime/Engine/Classes/GameFramework/Character.h"
#include "Runtime/Engine/Classes/Components/SkeletalMeshComponent.h"
#include "Runtime/Engine/Classes/Components/SkinnedMeshComponent.h"
#include "Runtime/Engine/Classes/Components/MeshComponent.h"
#include "Runtime/Engine/Classes/Engine/SkeletalMesh.h"
#include "Runtime/Engine/Classes/Animation/Skeleton.h"
#include "Runtime/Engine/Classes/Engine/SkeletalMeshSocket.h"
#include "Runtime/Engine/Classes/Animation/SmartName.h"
#include "Runtime/Engine/Classes/Animation/BlendProfile.h"
#include "Runtime/Engine/Public/BoneContainer.h"
#include "Runtime/Engine/Public/Components.h"
#include "Runtime/Engine/Classes/Animation/AnimSequence.h"
#include "Runtime/Engine/Classes/Animation/AnimSequenceBase.h"
#include "Runtime/Engine/Classes/Animation/AnimationAsset.h"
#include "Runtime/Engine/Classes/Animation/AnimMetaData.h"
#include "Runtime/Engine/Public/Animation/AnimTypes.h"
#include "Runtime/Engine/Classes/Animation/AnimLinkableElement.h"
#include "Runtime/Engine/Classes/Animation/AnimMontage.h"
#include "Runtime/Engine/Classes/Animation/AnimCompositeBase.h"
#include "Runtime/Engine/Public/AlphaBlend.h"
#include "Runtime/Engine/Classes/Curves/CurveFloat.h"
#include "Runtime/Engine/Classes/Curves/CurveBase.h"
#include "Runtime/Engine/Classes/Curves/RichCurve.h"
#include "Runtime/Engine/Classes/Curves/IndexedCurve.h"
#include "Runtime/Engine/Classes/Curves/KeyHandle.h"
#include "Runtime/Engine/Classes/Animation/AnimEnums.h"
#include "Runtime/Engine/Classes/Animation/TimeStretchCurve.h"
#include "Runtime/Engine/Classes/Animation/AnimNotifies/AnimNotify.h"
#include "Runtime/Engine/Classes/Animation/AnimNotifies/AnimNotifyState.h"
#include "Runtime/Engine/Public/Animation/AnimCurveTypes.h"
#include "Runtime/Engine/Classes/PhysicsEngine/PhysicsAsset.h"
#include "Runtime/Engine/Classes/PhysicsEngine/PhysicalAnimationComponent.h"
#include "Runtime/Engine/Classes/PhysicsEngine/PhysicsConstraintTemplate.h"
#include "Runtime/Engine/Classes/PhysicsEngine/ConstraintInstance.h"
#include "Runtime/Engine/Classes/PhysicsEngine/ConstraintTypes.h"
#include "Runtime/Engine/Classes/PhysicsEngine/ConstraintDrives.h"
#include "Runtime/Engine/Classes/EditorFramework/ThumbnailInfo.h"
#include "Runtime/Engine/Public/Animation/NodeMappingContainer.h"
#include "Runtime/Engine/Classes/Engine/Blueprint.h"
#include "Runtime/Engine/Classes/Engine/BlueprintCore.h"
#include "Runtime/Engine/Classes/Engine/SimpleConstructionScript.h"
#include "Runtime/Engine/Classes/Engine/SCS_Node.h"
#include "Runtime/Engine/Classes/Engine/TimelineTemplate.h"
#include "Runtime/Engine/Classes/Components/TimelineComponent.h"
#include "Runtime/Engine/Classes/Curves/CurveVector.h"
#include "Runtime/Engine/Classes/Curves/CurveLinearColor.h"
#include "Runtime/Engine/Classes/Engine/InheritableComponentHandler.h"
#include "Runtime/Engine/Classes/Animation/MorphTarget.h"
#include "Runtime/Engine/Classes/Animation/AnimInstance.h"
#include "Runtime/Engine/Public/Animation/PoseSnapshot.h"
#include "Runtime/ClothingSystemRuntimeInterface/Public/ClothingAssetInterface.h"
#include "Runtime/Engine/Classes/Interfaces/Interface_CollisionDataProvider.h"
#include "Runtime/Engine/Classes/Animation/AnimBlueprintGeneratedClass.h"
#include "Runtime/Engine/Classes/Engine/DynamicBlueprintBinding.h"
#include "Runtime/Engine/Classes/Animation/AnimStateMachineTypes.h"
#include "Runtime/Engine/Classes/Animation/AnimClassInterface.h"
#include "Runtime/Engine/Public/SingleAnimationPlayData.h"
#include "Runtime/ClothingSystemRuntimeInterface/Public/ClothingSimulationFactoryInterface.h"
#include "Runtime/Engine/Classes/GameFramework/CharacterMovementComponent.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavigationAvoidanceTypes.h"
#include "Runtime/Engine/Classes/GameFramework/RootMotionSource.h"
#include "Runtime/Engine/Public/AI/RVOAvoidanceInterface.h"
#include "Runtime/Engine/Classes/Interfaces/NetworkPredictionInterface.h"
#include "Runtime/Engine/Classes/Components/CapsuleComponent.h"
#include "Runtime/Engine/Classes/Components/ShapeComponent.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavAreas/NavArea_Obstacle.h"
#include "Runtime/Engine/Classes/Matinee/InterpTrackInstDirector.h"
#include "Runtime/Engine/Classes/GameFramework/HUD.h"
#include "Runtime/Engine/Classes/Engine/Canvas.h"
#include "Runtime/Engine/Classes/Debug/ReporterGraph.h"
#include "Runtime/Engine/Classes/Debug/ReporterBase.h"
#include "Runtime/Engine/Classes/GameFramework/DebugTextInfo.h"
#include "Runtime/Engine/Classes/Camera/PlayerCameraManager.h"
#include "Runtime/Engine/Classes/Camera/CameraTypes.h"
#include "Runtime/Engine/Classes/Engine/Scene.h"
#include "Runtime/Engine/Classes/Engine/TextureCube.h"
#include "Runtime/Engine/Classes/Camera/CameraModifier.h"
#include "Runtime/Engine/Classes/Particles/EmitterCameraLensEffectBase.h"
#include "Runtime/Engine/Classes/Particles/Emitter.h"
#include "Runtime/Engine/Classes/Particles/ParticleSystemComponent.h"
#include "Runtime/Engine/Classes/Particles/ParticleSystem.h"
#include "Runtime/Engine/Classes/Particles/ParticleEmitter.h"
#include "Runtime/Engine/Classes/Particles/ParticleLODLevel.h"
#include "Runtime/Engine/Classes/Particles/ParticleModuleRequired.h"
#include "Runtime/Engine/Classes/Particles/ParticleModule.h"
#include "Runtime/Engine/Classes/Particles/ParticleSpriteEmitter.h"
#include "Runtime/Engine/Classes/Distributions/DistributionFloat.h"
#include "Runtime/Engine/Classes/Distributions/Distribution.h"
#include "Runtime/Engine/Classes/Particles/SubUVAnimation.h"
#include "Runtime/Engine/Classes/Particles/TypeData/ParticleModuleTypeDataBase.h"
#include "Runtime/Engine/Classes/Particles/Spawn/ParticleModuleSpawn.h"
#include "Runtime/Engine/Classes/Particles/Spawn/ParticleModuleSpawnBase.h"
#include "Runtime/Engine/Classes/Particles/Event/ParticleModuleEventGenerator.h"
#include "Runtime/Engine/Classes/Particles/Event/ParticleModuleEventBase.h"
#include "Runtime/Engine/Classes/Particles/Event/ParticleModuleEventSendToGame.h"
#include "Runtime/Engine/Classes/Particles/Orbit/ParticleModuleOrbit.h"
#include "Runtime/Engine/Classes/Particles/Orbit/ParticleModuleOrbitBase.h"
#include "Runtime/Engine/Classes/Distributions/DistributionVector.h"
#include "Runtime/Engine/Classes/Particles/Event/ParticleModuleEventReceiverBase.h"
#include "Runtime/Engine/Public/ParticleHelper.h"
#include "Runtime/Engine/Classes/Particles/ParticleSystemReplay.h"
#include "Runtime/Engine/Classes/Camera/CameraModifier_CameraShake.h"
#include "Runtime/Engine/Classes/Camera/CameraShake.h"
#include "Runtime/Engine/Classes/Camera/CameraAnim.h"
#include "Runtime/Engine/Classes/Camera/CameraAnimInst.h"
#include "Runtime/Engine/Classes/Matinee/InterpTrackMove.h"
#include "Runtime/Engine/Classes/Matinee/InterpTrackInstMove.h"
#include "Runtime/Engine/Classes/Camera/CameraActor.h"
#include "Runtime/Engine/Classes/Camera/CameraComponent.h"
#include "Runtime/Engine/Classes/GameFramework/CheatManager.h"
#include "Runtime/Engine/Classes/Engine/DebugCameraController.h"
#include "Runtime/Engine/Classes/Components/DrawFrustumComponent.h"
#include "Runtime/Engine/Classes/GameFramework/PlayerInput.h"
#include "Runtime/Engine/Classes/GameFramework/ForceFeedbackEffect.h"
#include "Runtime/Engine/Classes/Engine/NetConnection.h"
#include "Runtime/Engine/Classes/Engine/ChildConnection.h"
#include "Runtime/Engine/Classes/Engine/PackageMapClient.h"
#include "Runtime/Engine/Classes/Engine/NetDriver.h"
#include "Runtime/Engine/Classes/Engine/World.h"
#include "Runtime/Engine/Classes/Engine/Level.h"
#include "Runtime/Engine/Classes/Components/ModelComponent.h"
#include "Runtime/Engine/Classes/Engine/LevelActorContainer.h"
#include "Runtime/Engine/Classes/Engine/LevelScriptActor.h"
#include "Runtime/Engine/Classes/Engine/NavigationObjectBase.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavigationDataChunk.h"
#include "Runtime/Engine/Classes/Engine/MapBuildDataRegistry.h"
#include "Runtime/Engine/Classes/GameFramework/WorldSettings.h"
#include "Runtime/Engine/Classes/GameFramework/DefaultPhysicsVolume.h"
#include "Runtime/Engine/Classes/PhysicsEngine/PhysicsCollisionHandler.h"
#include "Runtime/Engine/Classes/Sound/SoundBase.h"
#include "Runtime/Engine/Classes/Sound/SoundClass.h"
#include "Runtime/Engine/Classes/Sound/SoundMix.h"
#include "Runtime/Engine/Classes/Sound/SoundConcurrency.h"
#include "Runtime/Engine/Classes/Sound/SoundAttenuation.h"
#include "Runtime/Engine/Classes/Engine/Attenuation.h"
#include "Runtime/Engine/Public/IAudioExtensionPlugin.h"
#include "Runtime/Engine/Classes/Sound/SoundSubmix.h"
#include "Runtime/Engine/Classes/Sound/SoundEffectSubmix.h"
#include "Runtime/Engine/Classes/Sound/SoundEffectPreset.h"
#include "Runtime/Engine/Classes/Sound/SoundEffectSource.h"
#include "Runtime/Engine/Classes/Sound/SoundSourceBusSend.h"
#include "Runtime/Engine/Classes/Sound/SoundSourceBus.h"
#include "Runtime/Engine/Classes/Sound/SoundWave.h"
#include "Runtime/Engine/Classes/Sound/SoundGroups.h"
#include "Runtime/Engine/Classes/Engine/CurveTable.h"
#include "Runtime/Engine/Classes/GameFramework/GameModeBase.h"
#include "Runtime/Engine/Classes/GameFramework/GameSession.h"
#include "Runtime/Engine/Classes/GameFramework/GameStateBase.h"
#include "Runtime/Engine/Classes/GameFramework/SpectatorPawn.h"
#include "Runtime/Engine/Classes/GameFramework/DefaultPawn.h"
#include "Runtime/Engine/Classes/Components/SphereComponent.h"
#include "Runtime/Engine/Classes/Components/StaticMeshComponent.h"
#include "Runtime/Engine/Classes/Engine/StaticMesh.h"
#include "Runtime/Engine/Classes/Engine/StaticMeshSocket.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavCollision.h"
#include "Runtime/Engine/Classes/Engine/TextureStreamingTypes.h"
#include "Runtime/Engine/Classes/GameFramework/FloatingPawnMovement.h"
#include "Runtime/Engine/Classes/GameFramework/SpectatorPawnMovement.h"
#include "Runtime/Engine/Classes/GameFramework/GameNetworkManager.h"
#include "Runtime/Engine/Classes/Sound/AudioVolume.h"
#include "Runtime/Engine/Classes/Sound/ReverbEffect.h"
#include "Runtime/Engine/Classes/Engine/BookMark.h"
#include "Runtime/Engine/Classes/Components/LineBatchComponent.h"
#include "Runtime/Engine/Classes/Engine/LevelStreaming.h"
#include "Runtime/Engine/Classes/Engine/LevelStreamingVolume.h"
#include "Runtime/Engine/Classes/Engine/DemoNetDriver.h"
#include "Runtime/Engine/Classes/Particles/ParticleEventManager.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavigationSystem.h"
#include "Runtime/Engine/Classes/Kismet/BlueprintFunctionLibrary.h"
#include "Runtime/Engine/Classes/AI/Navigation/CrowdManagerBase.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavMeshBoundsVolume.h"
#include "Runtime/Engine/Classes/AI/Navigation/NavigationPath.h"
#include "Runtime/AIModule/Classes/Navigation/CrowdManager.h"
#include "Runtime/Engine/Classes/AI/AISystemBase.h"
#include "Runtime/Engine/Classes/AI/Navigation/AvoidanceManager.h"
#include "Runtime/Engine/Classes/Materials/MaterialParameterCollectionInstance.h"
#include "Runtime/Engine/Classes/Engine/WorldComposition.h"
#include "Runtime/Engine/Classes/Engine/Channel.h"
#include "Runtime/Engine/Classes/GameFramework/TouchInterface.h"
#include "Runtime/UMG/Public/Components/Widget.h"
#include "Runtime/UMG/Public/Components/Visual.h"
#include "Runtime/UMG/Public/Components/PanelSlot.h"
#include "Runtime/UMG/Public/Components/PanelWidget.h"
#include "Runtime/UMG/Public/Slate/WidgetTransform.h"
#include "Runtime/SlateCore/Public/Layout/Clipping.h"
#include "Runtime/UMG/Public/Blueprint/WidgetNavigation.h"
#include "Runtime/SlateCore/Public/Input/NavigationReply.h"
#include "Runtime/UMG/Public/Binding/PropertyBinding.h"
#include "Runtime/UMG/Public/Binding/DynamicPropertyPath.h"
#include "Runtime/SlateCore/Public/Types/SlateEnums.h"
#include "Runtime/SlateCore/Public/Layout/Geometry.h"
#include "Runtime/SlateCore/Public/Input/Events.h"
#include "Runtime/SlateCore/Public/Styling/SlateColor.h"
#include "Runtime/SlateCore/Public/Styling/SlateBrush.h"
#include "Runtime/SlateCore/Public/Layout/Margin.h"
#include "Runtime/SlateCore/Public/Styling/SlateTypes.h"
#include "Runtime/UMG/Public/Animation/UMGSequencePlayer.h"
#include "Runtime/UMG/Public/Animation/WidgetAnimation.h"
#include "Runtime/MovieScene/Public/MovieSceneSequence.h"
#include "Runtime/MovieScene/Public/MovieSceneSignedObject.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneEvaluationTemplate.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneEvaluationTrack.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneSegment.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneEvalTemplate.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneTrackImplementation.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneEvaluationField.h"
#include "Runtime/MovieScene/Public/MovieSceneSequenceID.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneTrackIdentifier.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneEvaluationKey.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneSequenceHierarchy.h"
#include "Runtime/MovieScene/Public/Evaluation/MovieSceneSequenceTransform.h"
#include "Runtime/MovieScene/Public/MovieSceneTrack.h"
#include "Runtime/MovieScene/Public/MovieScene.h"
#include "Runtime/MovieScene/Public/MovieSceneSpawnable.h"
#include "Runtime/MovieScene/Public/MovieScenePossessable.h"
#include "Runtime/MovieScene/Public/MovieSceneBinding.h"
#include "Runtime/UMG/Public/Animation/WidgetAnimationBinding.h"
#include "Runtime/Slate/Public/Widgets/Layout/Anchors.h"
#include "Runtime/UMG/Public/Blueprint/DragDropOperation.h"
#include "Runtime/UMG/Public/Components/NamedSlotInterface.h"
#include "Runtime/Engine/Classes/Haptics/HapticFeedbackEffect_Base.h"
#include "Runtime/Engine/Classes/Engine/LatentActionManager.h"
#include "Runtime/Engine/Classes/Engine/GameViewportClient.h"
#include "Runtime/Engine/Classes/Engine/ScriptViewportClient.h"
#include "Runtime/Engine/Classes/Engine/Console.h"
#include "Runtime/Engine/Classes/Engine/DebugDisplayProperty.h"
#include "Runtime/Engine/Classes/Engine/Engine.h"
#include "Runtime/Engine/Classes/GameFramework/GameUserSettings.h"
#include "Runtime/Engine/Classes/Engine/AssetManager.h"
#include "Runtime/Engine/Classes/GameFramework/OnlineSession.h"
#include "gameInfoInstance__pf533497531.h"
#include "Runtime/Engine/Classes/Kismet/GameplayStatics.h"
#include "Runtime/Engine/Classes/Components/AudioComponent.h"
#include "Runtime/Engine/Classes/GameFramework/ForceFeedbackAttenuation.h"
#include "Runtime/Engine/Classes/Components/ForceFeedbackComponent.h"
#include "Runtime/Engine/Classes/Sound/DialogueWave.h"
#include "Runtime/Engine/Classes/Sound/DialogueTypes.h"
#include "Runtime/Engine/Classes/Sound/DialogueVoice.h"
#include "Runtime/Engine/Classes/Sound/DialogueSoundWaveProxy.h"
#include "Runtime/Engine/Classes/Components/DecalComponent.h"
#include "Runtime/Engine/Classes/GameFramework/SaveGame.h"
#include "Runtime/Engine/Classes/Kismet/GameplayStaticsTypes.h"
#include "Runtime/Engine/Classes/Kismet/KismetSystemLibrary.h"
#include "mainMenu__pf1343218889.h"
#include "hostMenu__pf1343218889.h"
#include "serverMenu__pf1343218889.h"
#include "CreateSessionCallbackProxy.h"
#include "Runtime/Engine/Public/Net/OnlineBlueprintCallProxyBase.h"
#include "FindSessionsCallbackProxy.h"
#include "JoinSessionCallbackProxy.h"
#include "loadingScreen__pf1207061625.h"
#include "DestroySessionCallbackProxy.h"
#include "Runtime/Engine/Classes/Engine/CollisionProfile.h"
#include "Runtime/UMG/Public/Blueprint/WidgetBlueprintLibrary.h"
#include "Runtime/Engine/Classes/Slate/SlateBrushAsset.h"
#include "Runtime/Engine/Classes/Kismet/KismetArrayLibrary.h"
#include "Runtime/Engine/Classes/Kismet/KismetMathLibrary.h"
#include "playerSaveGame__pf533497531.h"
#include "Runtime/Engine/Classes/Kismet/KismetTextLibrary.h"
#include "Runtime/UMG/Public/Components/ContentWidget.h"
#include "Runtime/SlateCore/Public/Styling/SlateWidgetStyleAsset.h"
#include "Runtime/SlateCore/Public/Styling/SlateWidgetStyleContainerBase.h"
#include "Runtime/SlateCore/Public/Styling/SlateWidgetStyleContainerInterface.h"
#include "Runtime/SlateCore/Public/Styling/SlateWidgetStyle.h"
#include "Runtime/SlateCore/Public/Sound/SlateSound.h"
#include "Runtime/Engine/Classes/Engine/Texture2DDynamic.h"
#include "Runtime/UMG/Public/Components/TextWidgetTypes.h"
#include "Runtime/SlateCore/Public/Fonts/FontCache.h"
#include "Runtime/Slate/Public/Framework/Text/TextLayout.h"
#include "Runtime/SlateCore/Public/Fonts/SlateFontInfo.h"
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4883)
#endif
PRAGMA_DISABLE_DEPRECATION_WARNINGS
UoptionsMenu_C__pf1343218889::UoptionsMenu_C__pf1343218889(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
if(HasAnyFlags(RF_ClassDefaultObject) && (UoptionsMenu_C__pf1343218889::StaticClass() == GetClass()))
{
UoptionsMenu_C__pf1343218889::__CustomDynamicClassInitialization(CastChecked<UDynamicClass>(GetClass()));
}
bpv__Accept__pf = nullptr;
bpv__backButton__pf = nullptr;
bpv__currentAvatar__pf = nullptr;
bpv__TextBlock_53__pf = nullptr;
bpv__toggleLeft__pf = nullptr;
bpv__toggleRight__pf = nullptr;
bpv__UserPlayerName__pf = nullptr;
bpv__welcomeMessageVis__pf = ESlateVisibility::Hidden;
bpv__gameINstanceRef__pf = nullptr;
bpv__enteredPlayerName__pf = FText::GetEmpty();
bpv__playerInfo__pf.bpv__myPlayerName_2_816FFE264C08408F09C26C8C7F8CDB1A__pf = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Default"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("FCCDCE27438B7835895E47AD475C835C") /* Key */
);
bpv__playerInfo__pf.bpv__myPlayerImage_5_E3B8ED5F4387C5691564BF96105E1E15__pf = CastChecked<UTexture2D>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->UsedAssets[0], ECastCheckedType::NullAllowed);
bpv__playerInfo__pf.bpv__myPlayerStatus_14_F1604291452782409E92779450FED1BE__pf = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Not Ready"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("0A30DD434ACD58561AD3B897574F0563") /* Key */
);
bpv__avatarImage__pf = nullptr;
bpv__playerSettingsSave__pf = FString(TEXT("playerSettingsSave"));
bpv__foundSaveGamex__pfzy = false;
bpv__saveGameREF__pf = nullptr;
bpv__allAvatars__pf = TArray<UTexture2D*> ();
bpv__allAvatars__pf.Reserve(7);
bpv__allAvatars__pf.Add(CastChecked<UTexture2D>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->UsedAssets[1], ECastCheckedType::NullAllowed));
bpv__allAvatars__pf.Add(CastChecked<UTexture2D>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->UsedAssets[2], ECastCheckedType::NullAllowed));
bpv__allAvatars__pf.Add(CastChecked<UTexture2D>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->UsedAssets[3], ECastCheckedType::NullAllowed));
bpv__allAvatars__pf.Add(CastChecked<UTexture2D>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->UsedAssets[4], ECastCheckedType::NullAllowed));
bpv__allAvatars__pf.Add(CastChecked<UTexture2D>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->UsedAssets[5], ECastCheckedType::NullAllowed));
bpv__allAvatars__pf.Add(CastChecked<UTexture2D>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->UsedAssets[6], ECastCheckedType::NullAllowed));
bpv__allAvatars__pf.Add(CastChecked<UTexture2D>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->UsedAssets[7], ECastCheckedType::NullAllowed));
bpv__avatarCount__pf = 0;
bpv__acceptEnabledx__pfzy = false;
bCanEverTick = false;
bCanEverPaint = false;
}
void UoptionsMenu_C__pf1343218889::PostLoadSubobjects(FObjectInstancingGraph* OuterInstanceGraph)
{
Super::PostLoadSubobjects(OuterInstanceGraph);
}
void UoptionsMenu_C__pf1343218889::__CustomDynamicClassInitialization(UDynamicClass* InDynamicClass)
{
ensure(0 == InDynamicClass->ReferencedConvertedFields.Num());
ensure(0 == InDynamicClass->MiscConvertedSubobjects.Num());
ensure(0 == InDynamicClass->DynamicBindingObjects.Num());
ensure(0 == InDynamicClass->ComponentTemplates.Num());
ensure(0 == InDynamicClass->Timelines.Num());
ensure(nullptr == InDynamicClass->AnimClassImplementation);
InDynamicClass->AssembleReferenceTokenStream();
// List of all referenced converted classes
InDynamicClass->ReferencedConvertedFields.Add(UgameInfoInstance_C__pf533497531::StaticClass());
InDynamicClass->ReferencedConvertedFields.Add(UplayerSaveGame_C__pf533497531::StaticClass());
// List of all referenced converted structures
extern UScriptStruct* Z_Construct_UScriptStruct_FPlayerInfo__pf533497531();
InDynamicClass->ReferencedConvertedFields.Add(Z_Construct_UScriptStruct_FPlayerInfo__pf533497531());
FConvertedBlueprintsDependencies::FillUsedAssetsInDynamicClass(InDynamicClass, &__StaticDependencies_DirectlyUsedAssets);
auto __Local__0 = NewObject<UComponentDelegateBinding>(InDynamicClass, UComponentDelegateBinding::StaticClass(), TEXT("ComponentDelegateBinding_3"));
InDynamicClass->DynamicBindingObjects.Add(__Local__0);
auto __Local__1 = NewObject<UWidgetTree>(InDynamicClass, UWidgetTree::StaticClass(), TEXT("WidgetTree"));
InDynamicClass->MiscConvertedSubobjects.Add(__Local__1);
__Local__0->ComponentDelegateBindings = TArray<FBlueprintComponentDelegateBinding> ();
__Local__0->ComponentDelegateBindings.AddUninitialized(5);
FBlueprintComponentDelegateBinding::StaticStruct()->InitializeStruct(__Local__0->ComponentDelegateBindings.GetData(), 5);
auto& __Local__2 = __Local__0->ComponentDelegateBindings[0];
__Local__2.ComponentPropertyName = FName(TEXT("toggleRight"));
__Local__2.DelegatePropertyName = FName(TEXT("OnClicked"));
__Local__2.FunctionNameToBind = FName(TEXT("BndEvt__toggleRight_K2Node_ComponentBoundEvent_4_OnButtonClickedEvent__DelegateSignature"));
auto& __Local__3 = __Local__0->ComponentDelegateBindings[1];
__Local__3.ComponentPropertyName = FName(TEXT("toggleLeft"));
__Local__3.DelegatePropertyName = FName(TEXT("OnClicked"));
__Local__3.FunctionNameToBind = FName(TEXT("BndEvt__toggleLeft_K2Node_ComponentBoundEvent_3_OnButtonClickedEvent__DelegateSignature"));
auto& __Local__4 = __Local__0->ComponentDelegateBindings[2];
__Local__4.ComponentPropertyName = FName(TEXT("Accept"));
__Local__4.DelegatePropertyName = FName(TEXT("OnClicked"));
__Local__4.FunctionNameToBind = FName(TEXT("BndEvt__Accept_K2Node_ComponentBoundEvent_2_OnButtonClickedEvent__DelegateSignature"));
auto& __Local__5 = __Local__0->ComponentDelegateBindings[3];
__Local__5.ComponentPropertyName = FName(TEXT("backButton"));
__Local__5.DelegatePropertyName = FName(TEXT("OnClicked"));
__Local__5.FunctionNameToBind = FName(TEXT("BndEvt__backButton_K2Node_ComponentBoundEvent_1_OnButtonClickedEvent__DelegateSignature"));
auto& __Local__6 = __Local__0->ComponentDelegateBindings[4];
__Local__6.ComponentPropertyName = FName(TEXT("UserPlayerName"));
__Local__6.DelegatePropertyName = FName(TEXT("OnTextChanged"));
__Local__6.FunctionNameToBind = FName(TEXT("BndEvt__UserPlayerName_K2Node_ComponentBoundEvent_0_OnEditableTextBoxChangedEvent__DelegateSignature"));
auto __Local__7 = NewObject<UCanvasPanel>(__Local__1, UCanvasPanel::StaticClass(), TEXT("CanvasPanel_0"));
auto& __Local__8 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__7), UPanelWidget::__PPO__Slots() )));
__Local__8 = TArray<UPanelSlot*> ();
__Local__8.Reserve(2);
auto __Local__9 = NewObject<UCanvasPanelSlot>(__Local__7, UCanvasPanelSlot::StaticClass(), TEXT("CanvasPanelSlot_0"));
__Local__9->LayoutData.Offsets.Left = -284.960938f;
__Local__9->LayoutData.Offsets.Top = -176.492981f;
__Local__9->LayoutData.Offsets.Right = 706.606628f;
__Local__9->LayoutData.Offsets.Bottom = 286.256256f;
__Local__9->LayoutData.Anchors.Minimum = FVector2D(0.500000, 0.455556);
__Local__9->LayoutData.Anchors.Maximum = FVector2D(0.500000, 0.455556);
__Local__9->bAutoSize = true;
__Local__9->Parent = __Local__7;
auto __Local__10 = NewObject<UBorder>(__Local__1, UBorder::StaticClass(), TEXT("Border_82"));
__Local__10->BrushColor = FLinearColor(0.000000, 0.000000, 0.000000, 0.500000);
auto& __Local__11 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__10), UPanelWidget::__PPO__Slots() )));
__Local__11 = TArray<UPanelSlot*> ();
__Local__11.Reserve(1);
auto __Local__12 = NewObject<UBorderSlot>(__Local__10, UBorderSlot::StaticClass(), TEXT("BorderSlot_0"));
__Local__12->Parent = __Local__10;
auto __Local__13 = NewObject<UVerticalBox>(__Local__1, UVerticalBox::StaticClass(), TEXT("VerticalBox_0"));
auto& __Local__14 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__13), UPanelWidget::__PPO__Slots() )));
__Local__14 = TArray<UPanelSlot*> ();
__Local__14.Reserve(6);
auto __Local__15 = NewObject<UVerticalBoxSlot>(__Local__13, UVerticalBoxSlot::StaticClass(), TEXT("VerticalBoxSlot_0"));
__Local__15->Parent = __Local__13;
auto __Local__16 = NewObject<UTextBlock>(__Local__1, UTextBlock::StaticClass(), TEXT("TextBlock_0"));
__Local__16->Text = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Player Options"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("8053BD074A98BACB1FEA5385F3435E91") /* Key */
);
__Local__16->Font.Size = 64;
auto& __Local__17 = (*(AccessPrivateProperty<TEnumAsByte<ETextJustify::Type> >((__Local__16), UTextLayoutWidget::__PPO__Justification() )));
__Local__17 = ETextJustify::Type::Center;
__Local__16->Slot = __Local__15;
__Local__15->Content = __Local__16;
__Local__14.Add(__Local__15);
auto __Local__18 = NewObject<UVerticalBoxSlot>(__Local__13, UVerticalBoxSlot::StaticClass(), TEXT("VerticalBoxSlot_8"));
__Local__18->HorizontalAlignment = EHorizontalAlignment::HAlign_Center;
__Local__18->VerticalAlignment = EVerticalAlignment::VAlign_Center;
__Local__18->Parent = __Local__13;
auto __Local__19 = NewObject<UTextBlock>(__Local__1, UTextBlock::StaticClass(), TEXT("TextBlock_58"));
__Local__19->Text = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Enter your Player Name"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("E7EB12744A199E97609833A0466CEE62") /* Key */
);
__Local__19->Slot = __Local__18;
__Local__18->Content = __Local__19;
__Local__14.Add(__Local__18);
auto __Local__20 = NewObject<UVerticalBoxSlot>(__Local__13, UVerticalBoxSlot::StaticClass(), TEXT("VerticalBoxSlot_9"));
__Local__20->Parent = __Local__13;
auto __Local__21 = NewObject<UEditableTextBox>(__Local__1, UEditableTextBox::StaticClass(), TEXT("UserPlayerName"));
__Local__21->WidgetStyle.Font.Size = 28;
__Local__21->HintText = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Enter your Name"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("757E332A4ABC45A967115FBF68BA1933") /* Key */
);
__Local__21->Slot = __Local__20;
__Local__20->Content = __Local__21;
__Local__14.Add(__Local__20);
auto __Local__22 = NewObject<UVerticalBoxSlot>(__Local__13, UVerticalBoxSlot::StaticClass(), TEXT("VerticalBoxSlot_15"));
__Local__22->HorizontalAlignment = EHorizontalAlignment::HAlign_Center;
__Local__22->VerticalAlignment = EVerticalAlignment::VAlign_Center;
__Local__22->Parent = __Local__13;
auto __Local__23 = NewObject<UTextBlock>(__Local__1, UTextBlock::StaticClass(), TEXT("TextBlock_67"));
__Local__23->Text = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Choose Avatar"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("E2F442B749214A144617E489EB8306D3") /* Key */
);
__Local__23->Slot = __Local__22;
__Local__22->Content = __Local__23;
__Local__14.Add(__Local__22);
auto __Local__24 = NewObject<UVerticalBoxSlot>(__Local__13, UVerticalBoxSlot::StaticClass(), TEXT("VerticalBoxSlot_13"));
__Local__24->HorizontalAlignment = EHorizontalAlignment::HAlign_Center;
__Local__24->VerticalAlignment = EVerticalAlignment::VAlign_Center;
__Local__24->Parent = __Local__13;
auto __Local__25 = NewObject<UHorizontalBox>(__Local__1, UHorizontalBox::StaticClass(), TEXT("HorizontalBox_1"));
auto& __Local__26 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__25), UPanelWidget::__PPO__Slots() )));
__Local__26 = TArray<UPanelSlot*> ();
__Local__26.Reserve(3);
auto __Local__27 = NewObject<UHorizontalBoxSlot>(__Local__25, UHorizontalBoxSlot::StaticClass(), TEXT("HorizontalBoxSlot_0"));
__Local__27->Parent = __Local__25;
auto __Local__28 = NewObject<UButton>(__Local__1, UButton::StaticClass(), TEXT("toggleLeft"));
auto& __Local__29 = (*(AccessPrivateProperty<FLinearColor >(&(__Local__28->WidgetStyle.Hovered.TintColor), FSlateColor::__PPO__SpecifiedColor() )));
__Local__29 = FLinearColor(1.000000, 0.544528, 0.118760, 1.000000);
auto& __Local__30 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__28), UPanelWidget::__PPO__Slots() )));
__Local__30 = TArray<UPanelSlot*> ();
__Local__30.Reserve(1);
auto __Local__31 = NewObject<UButtonSlot>(__Local__28, UButtonSlot::StaticClass(), TEXT("ButtonSlot_0"));
__Local__31->Parent = __Local__28;
auto __Local__32 = NewObject<UTextBlock>(__Local__1, UTextBlock::StaticClass(), TEXT("TextBlock_64"));
__Local__32->Text = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("<"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("179851744BB03A1E2BEA6C91693EAED4") /* Key */
);
__Local__32->Slot = __Local__31;
__Local__31->Content = __Local__32;
__Local__30.Add(__Local__31);
__Local__28->Slot = __Local__27;
__Local__27->Content = __Local__28;
__Local__26.Add(__Local__27);
auto __Local__33 = NewObject<UHorizontalBoxSlot>(__Local__25, UHorizontalBoxSlot::StaticClass(), TEXT("HorizontalBoxSlot_3"));
__Local__33->Parent = __Local__25;
auto __Local__34 = NewObject<USizeBox>(__Local__1, USizeBox::StaticClass(), TEXT("SizeBox_0"));
__Local__34->bOverride_WidthOverride = true;
__Local__34->bOverride_HeightOverride = true;
__Local__34->WidthOverride = 256.000000f;
__Local__34->HeightOverride = 256.000000f;
auto& __Local__35 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__34), UPanelWidget::__PPO__Slots() )));
__Local__35 = TArray<UPanelSlot*> ();
__Local__35.Reserve(1);
auto __Local__36 = NewObject<USizeBoxSlot>(__Local__34, USizeBoxSlot::StaticClass(), TEXT("SizeBoxSlot_0"));
__Local__36->Parent = __Local__34;
auto __Local__37 = NewObject<UImage>(__Local__1, UImage::StaticClass(), TEXT("currentAvatar"));
__Local__37->Slot = __Local__36;
__Local__36->Content = __Local__37;
__Local__35.Add(__Local__36);
__Local__34->Slot = __Local__33;
__Local__33->Content = __Local__34;
__Local__26.Add(__Local__33);
auto __Local__38 = NewObject<UHorizontalBoxSlot>(__Local__25, UHorizontalBoxSlot::StaticClass(), TEXT("HorizontalBoxSlot_2"));
__Local__38->Parent = __Local__25;
auto __Local__39 = NewObject<UButton>(__Local__1, UButton::StaticClass(), TEXT("toggleRight"));
auto& __Local__40 = (*(AccessPrivateProperty<FLinearColor >(&(__Local__39->WidgetStyle.Hovered.TintColor), FSlateColor::__PPO__SpecifiedColor() )));
__Local__40 = FLinearColor(1.000000, 0.544528, 0.118760, 1.000000);
auto& __Local__41 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__39), UPanelWidget::__PPO__Slots() )));
__Local__41 = TArray<UPanelSlot*> ();
__Local__41.Reserve(1);
auto __Local__42 = NewObject<UButtonSlot>(__Local__39, UButtonSlot::StaticClass(), TEXT("ButtonSlot_1"));
__Local__42->Parent = __Local__39;
auto __Local__43 = NewObject<UTextBlock>(__Local__1, UTextBlock::StaticClass(), TEXT("TextBlock_66"));
__Local__43->Text = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT(">"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("F38613E945346895DC4ACFAB36566839") /* Key */
);
__Local__43->Slot = __Local__42;
__Local__42->Content = __Local__43;
__Local__41.Add(__Local__42);
__Local__39->Slot = __Local__38;
__Local__38->Content = __Local__39;
__Local__26.Add(__Local__38);
__Local__25->Slot = __Local__24;
__Local__24->Content = __Local__25;
__Local__14.Add(__Local__24);
auto __Local__44 = NewObject<UVerticalBoxSlot>(__Local__13, UVerticalBoxSlot::StaticClass(), TEXT("VerticalBoxSlot_16"));
__Local__44->Parent = __Local__13;
auto __Local__45 = NewObject<UHorizontalBox>(__Local__1, UHorizontalBox::StaticClass(), TEXT("HorizontalBox_2"));
auto& __Local__46 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__45), UPanelWidget::__PPO__Slots() )));
__Local__46 = TArray<UPanelSlot*> ();
__Local__46.Reserve(3);
auto __Local__47 = NewObject<UHorizontalBoxSlot>(__Local__45, UHorizontalBoxSlot::StaticClass(), TEXT("HorizontalBoxSlot_0"));
__Local__47->Parent = __Local__45;
auto __Local__48 = NewObject<UButton>(__Local__1, UButton::StaticClass(), TEXT("backButton"));
auto& __Local__49 = (*(AccessPrivateProperty<FLinearColor >(&(__Local__48->WidgetStyle.Hovered.TintColor), FSlateColor::__PPO__SpecifiedColor() )));
__Local__49 = FLinearColor(1.000000, 0.544528, 0.118760, 1.000000);
auto& __Local__50 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__48), UPanelWidget::__PPO__Slots() )));
__Local__50 = TArray<UPanelSlot*> ();
__Local__50.Reserve(1);
auto __Local__51 = NewObject<UButtonSlot>(__Local__48, UButtonSlot::StaticClass(), TEXT("ButtonSlot_0"));
__Local__51->Parent = __Local__48;
auto __Local__52 = NewObject<UTextBlock>(__Local__1, UTextBlock::StaticClass(), TEXT("TextBlock_86"));
__Local__52->Text = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Back"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("814726274F9D9126588DDEB76A1F00C3") /* Key */
);
__Local__52->Slot = __Local__51;
__Local__51->Content = __Local__52;
__Local__50.Add(__Local__51);
__Local__48->Slot = __Local__47;
__Local__47->Content = __Local__48;
__Local__46.Add(__Local__47);
auto __Local__53 = NewObject<UHorizontalBoxSlot>(__Local__45, UHorizontalBoxSlot::StaticClass(), TEXT("HorizontalBoxSlot_3"));
__Local__53->Size.SizeRule = ESlateSizeRule::Type::Fill;
__Local__53->Parent = __Local__45;
auto __Local__54 = NewObject<USpacer>(__Local__1, USpacer::StaticClass(), TEXT("Spacer_0"));
__Local__54->Slot = __Local__53;
__Local__53->Content = __Local__54;
__Local__46.Add(__Local__53);
auto __Local__55 = NewObject<UHorizontalBoxSlot>(__Local__45, UHorizontalBoxSlot::StaticClass(), TEXT("HorizontalBoxSlot_2"));
__Local__55->Parent = __Local__45;
auto __Local__56 = NewObject<UButton>(__Local__1, UButton::StaticClass(), TEXT("Accept"));
auto& __Local__57 = (*(AccessPrivateProperty<FLinearColor >(&(__Local__56->WidgetStyle.Hovered.TintColor), FSlateColor::__PPO__SpecifiedColor() )));
__Local__57 = FLinearColor(1.000000, 0.544528, 0.118760, 1.000000);
auto& __Local__58 = (*(AccessPrivateProperty<TArray<UPanelSlot*> >((__Local__56), UPanelWidget::__PPO__Slots() )));
__Local__58 = TArray<UPanelSlot*> ();
__Local__58.Reserve(1);
auto __Local__59 = NewObject<UButtonSlot>(__Local__56, UButtonSlot::StaticClass(), TEXT("ButtonSlot_1"));
__Local__59->Parent = __Local__56;
auto __Local__60 = NewObject<UTextBlock>(__Local__1, UTextBlock::StaticClass(), TEXT("TextBlock_88"));
__Local__60->Text = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Accept"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("0A73A1824FBBD9541D7728B88BCB772E") /* Key */
);
__Local__60->Slot = __Local__59;
__Local__59->Content = __Local__60;
__Local__58.Add(__Local__59);
__Local__56->Slot = __Local__55;
__Local__55->Content = __Local__56;
__Local__46.Add(__Local__55);
__Local__45->Slot = __Local__44;
__Local__44->Content = __Local__45;
__Local__14.Add(__Local__44);
__Local__13->Slot = __Local__12;
__Local__12->Content = __Local__13;
__Local__11.Add(__Local__12);
__Local__10->Slot = __Local__9;
__Local__9->Content = __Local__10;
__Local__8.Add(__Local__9);
auto __Local__61 = NewObject<UCanvasPanelSlot>(__Local__7, UCanvasPanelSlot::StaticClass(), TEXT("CanvasPanelSlot_1"));
__Local__61->LayoutData.Offsets.Left = -412.960938f;
__Local__61->LayoutData.Offsets.Top = 232.000000f;
__Local__61->LayoutData.Offsets.Right = 519.368408f;
__Local__61->LayoutData.Offsets.Bottom = 82.042038f;
__Local__61->LayoutData.Anchors.Minimum = FVector2D(0.500000, 0.000000);
__Local__61->LayoutData.Anchors.Maximum = FVector2D(0.500000, 0.000000);
__Local__61->bAutoSize = true;
__Local__61->Parent = __Local__7;
auto __Local__62 = NewObject<UTextBlock>(__Local__1, UTextBlock::StaticClass(), TEXT("TextBlock_53"));
__Local__62->Text = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(
TEXT("Please Setup Player Profile to Continue"), /* Literal Text */
TEXT(""), /* Namespace */
TEXT("0BF2824F46DDC427413011BED449622E") /* Key */
);
__Local__62->Font.TypefaceFontName = FName(TEXT("Light"));
__Local__62->Font.Size = 36;
__Local__62->Slot = __Local__61;
__Local__61->Content = __Local__62;
__Local__8.Add(__Local__61);
__Local__1->RootWidget = __Local__7;
}
void UoptionsMenu_C__pf1343218889::GetSlotNames(TArray<FName>& SlotNames) const
{
TArray<FName> __Local__63;
SlotNames.Append(__Local__63);
}
void UoptionsMenu_C__pf1343218889::InitializeNativeClassData()
{
TArray<UWidgetAnimation*> __Local__64;
TArray<FDelegateRuntimeBinding> __Local__65;
__Local__65.AddUninitialized(5);
FDelegateRuntimeBinding::StaticStruct()->InitializeStruct(__Local__65.GetData(), 5);
auto& __Local__66 = __Local__65[0];
__Local__66.ObjectName = FString(TEXT("UserPlayerName"));
__Local__66.PropertyName = FName(TEXT("Text"));
auto& __Local__67 = (*(AccessPrivateProperty<TArray<FPropertyPathSegment> >(&(__Local__66.SourcePath), FDynamicPropertyPath::__PPO__Segments() )));
__Local__67 = TArray<FPropertyPathSegment> ();
__Local__67.AddUninitialized(1);
FPropertyPathSegment::StaticStruct()->InitializeStruct(__Local__67.GetData(), 1);
auto& __Local__68 = __Local__67[0];
__Local__68.Name = FName(TEXT("enteredPlayerName"));
__Local__66.Kind = EBindingKind::Property;
auto& __Local__69 = __Local__65[1];
__Local__69.ObjectName = FString(TEXT("currentAvatar"));
__Local__69.PropertyName = FName(TEXT("Brush"));
auto& __Local__70 = (*(AccessPrivateProperty<TArray<FPropertyPathSegment> >(&(__Local__69.SourcePath), FDynamicPropertyPath::__PPO__Segments() )));
__Local__70 = TArray<FPropertyPathSegment> ();
__Local__70.AddUninitialized(1);
FPropertyPathSegment::StaticStruct()->InitializeStruct(__Local__70.GetData(), 1);
auto& __Local__71 = __Local__70[0];
__Local__71.Name = FName(TEXT("avatarImage"));
__Local__69.Kind = EBindingKind::Property;
auto& __Local__72 = __Local__65[2];
__Local__72.ObjectName = FString(TEXT("Accept"));
__Local__72.PropertyName = FName(TEXT("bIsEnabled"));
auto& __Local__73 = (*(AccessPrivateProperty<TArray<FPropertyPathSegment> >(&(__Local__72.SourcePath), FDynamicPropertyPath::__PPO__Segments() )));
__Local__73 = TArray<FPropertyPathSegment> ();
__Local__73.AddUninitialized(1);
FPropertyPathSegment::StaticStruct()->InitializeStruct(__Local__73.GetData(), 1);
auto& __Local__74 = __Local__73[0];
__Local__74.Name = FName(TEXT("acceptEnabled?"));
__Local__72.Kind = EBindingKind::Property;
auto& __Local__75 = __Local__65[3];
__Local__75.ObjectName = FString(TEXT("TextBlock_53"));
__Local__75.PropertyName = FName(TEXT("Visibility"));
auto& __Local__76 = (*(AccessPrivateProperty<TArray<FPropertyPathSegment> >(&(__Local__75.SourcePath), FDynamicPropertyPath::__PPO__Segments() )));
__Local__76 = TArray<FPropertyPathSegment> ();
__Local__76.AddUninitialized(1);
FPropertyPathSegment::StaticStruct()->InitializeStruct(__Local__76.GetData(), 1);
auto& __Local__77 = __Local__76[0];
__Local__77.Name = FName(TEXT("welcomeMessageVis"));
__Local__75.Kind = EBindingKind::Property;
auto& __Local__78 = __Local__65[4];
__Local__78.ObjectName = FString(TEXT("backButton"));
__Local__78.PropertyName = FName(TEXT("Visibility"));
__Local__78.FunctionName = FName(TEXT("Get_backButton_Visibility_0"));
auto& __Local__79 = (*(AccessPrivateProperty<TArray<FPropertyPathSegment> >(&(__Local__78.SourcePath), FDynamicPropertyPath::__PPO__Segments() )));
__Local__79 = TArray<FPropertyPathSegment> ();
__Local__79.AddUninitialized(1);
FPropertyPathSegment::StaticStruct()->InitializeStruct(__Local__79.GetData(), 1);
auto& __Local__80 = __Local__79[0];
__Local__80.Name = FName(TEXT("Get_backButton_Visibility_0"));
UWidgetBlueprintGeneratedClass::InitializeWidgetStatic(this, GetClass(), false, CastChecked<UWidgetTree>(CastChecked<UDynamicClass>(UoptionsMenu_C__pf1343218889::StaticClass())->MiscConvertedSubobjects[0]), __Local__64, __Local__65);
}
void UoptionsMenu_C__pf1343218889::PreSave(const class ITargetPlatform* TargetPlatform)
{
Super::PreSave(TargetPlatform);
TArray<FName> LocalNamedSlots;
GetSlotNames(LocalNamedSlots);
RemoveObsoleteBindings(LocalNamedSlots);
}
void UoptionsMenu_C__pf1343218889::bpf__ExecuteUbergraph_optionsMenu__pf_0(int32 bpp__EntryPoint__pf)
{
int32 bpfv__CallFunc_Array_Length_ReturnValue__pf{};
int32 bpfv__CallFunc_Subtract_IntInt_ReturnValue__pf{};
int32 bpfv__CallFunc_Subtract_IntInt_ReturnValue2__pf{};
int32 bpfv__CallFunc_Clamp_ReturnValue__pf{};
check(bpp__EntryPoint__pf == 21);
// optimized KCST_UnconditionalGoto
bpfv__CallFunc_Array_Length_ReturnValue__pf = FCustomThunkTemplates::Array_Length(bpv__allAvatars__pf);
bpfv__CallFunc_Subtract_IntInt_ReturnValue__pf = UKismetMathLibrary::Subtract_IntInt(bpv__avatarCount__pf, 1);
bpfv__CallFunc_Subtract_IntInt_ReturnValue2__pf = UKismetMathLibrary::Subtract_IntInt(bpfv__CallFunc_Array_Length_ReturnValue__pf, 1);
bpfv__CallFunc_Clamp_ReturnValue__pf = UKismetMathLibrary::Clamp(bpfv__CallFunc_Subtract_IntInt_ReturnValue__pf, 0, bpfv__CallFunc_Subtract_IntInt_ReturnValue2__pf);
bpv__avatarCount__pf = bpfv__CallFunc_Clamp_ReturnValue__pf;
FCustomThunkTemplates::Array_Get(bpv__allAvatars__pf, bpv__avatarCount__pf, /*out*/ b0l__CallFunc_Array_Get_Item2__pf);
bpv__avatarImage__pf = b0l__CallFunc_Array_Get_Item2__pf;
return; // KCST_GotoReturn
}
void UoptionsMenu_C__pf1343218889::bpf__ExecuteUbergraph_optionsMenu__pf_1(int32 bpp__EntryPoint__pf)
{
int32 bpfv__CallFunc_Array_Length_ReturnValue2__pf{};
int32 bpfv__CallFunc_Add_IntInt_ReturnValue__pf{};
int32 bpfv__CallFunc_Add_IntInt_ReturnValue2__pf{};
int32 bpfv__CallFunc_Clamp_ReturnValue2__pf{};
check(bpp__EntryPoint__pf == 24);
// optimized KCST_UnconditionalGoto
bpfv__CallFunc_Array_Length_ReturnValue2__pf = FCustomThunkTemplates::Array_Length(bpv__allAvatars__pf);
bpfv__CallFunc_Add_IntInt_ReturnValue__pf = UKismetMathLibrary::Add_IntInt(bpfv__CallFunc_Array_Length_ReturnValue2__pf, 1);
bpfv__CallFunc_Add_IntInt_ReturnValue2__pf = UKismetMathLibrary::Add_IntInt(bpv__avatarCount__pf, 1);
bpfv__CallFunc_Clamp_ReturnValue2__pf = UKismetMathLibrary::Clamp(bpfv__CallFunc_Add_IntInt_ReturnValue2__pf, 0, bpfv__CallFunc_Add_IntInt_ReturnValue__pf);
bpv__avatarCount__pf = bpfv__CallFunc_Clamp_ReturnValue2__pf;
FCustomThunkTemplates::Array_Get(bpv__allAvatars__pf, bpv__avatarCount__pf, /*out*/ b0l__CallFunc_Array_Get_Item__pf);
bpv__avatarImage__pf = b0l__CallFunc_Array_Get_Item__pf;
return; // KCST_GotoReturn
}
void UoptionsMenu_C__pf1343218889::bpf__ExecuteUbergraph_optionsMenu__pf_2(int32 bpp__EntryPoint__pf)
{
check(bpp__EntryPoint__pf == 13);
// optimized KCST_UnconditionalGoto
bpv__playerInfo__pf.bpv__myPlayerName_2_816FFE264C08408F09C26C8C7F8CDB1A__pf = bpv__enteredPlayerName__pf;
bpv__playerInfo__pf.bpv__myPlayerImage_5_E3B8ED5F4387C5691564BF96105E1E15__pf = bpv__avatarImage__pf;
bpf__saveGame__pf();
bpv__welcomeMessageVis__pf = ESlateVisibility::Hidden;
RemoveFromParent();
if(IsValid(bpv__gameINstanceRef__pf))
{
bpv__gameINstanceRef__pf->bpv__createdSaveFilex__pfzy = true;
}
if(IsValid(bpv__gameINstanceRef__pf))
{
bpv__gameINstanceRef__pf->bpf__ShowMainMenu__pf();
}
return; // KCST_GotoReturn
}
void UoptionsMenu_C__pf1343218889::bpf__ExecuteUbergraph_optionsMenu__pf_3(int32 bpp__EntryPoint__pf)
{
UGameInstance* bpfv__CallFunc_GetGameInstance_ReturnValue__pf{};
check(bpp__EntryPoint__pf == 20);
// optimized KCST_UnconditionalGoto
bpfv__CallFunc_GetGameInstance_ReturnValue__pf = UGameplayStatics::GetGameInstance(this);
b0l__K2Node_DynamicCast_AsGame_Info_Instance__pf = Cast<UgameInfoInstance_C__pf533497531>(bpfv__CallFunc_GetGameInstance_ReturnValue__pf);
b0l__K2Node_DynamicCast_bSuccess__pf = (b0l__K2Node_DynamicCast_AsGame_Info_Instance__pf != nullptr);;
if (!b0l__K2Node_DynamicCast_bSuccess__pf)
{
return; //KCST_GotoReturnIfNot
}
bpv__gameINstanceRef__pf = b0l__K2Node_DynamicCast_AsGame_Info_Instance__pf;
// optimized KCST_UnconditionalGoto
bpf__saveGameCheck__pf();
bpv__enteredPlayerName__pf = bpv__playerInfo__pf.bpv__myPlayerName_2_816FFE264C08408F09C26C8C7F8CDB1A__pf;
bpv__avatarImage__pf = bpv__playerInfo__pf.bpv__myPlayerImage_5_E3B8ED5F4387C5691564BF96105E1E15__pf;
bpf__emptyNameCheck__pf(bpv__enteredPlayerName__pf);
bpf__setupAvatarDisplay__pf();
return; // KCST_GotoReturn
}
void UoptionsMenu_C__pf1343218889::bpf__ExecuteUbergraph_optionsMenu__pf_4(int32 bpp__EntryPoint__pf)
{
check(bpp__EntryPoint__pf == 8);
// optimized KCST_UnconditionalGoto
RemoveFromParent();
if(IsValid(bpv__gameINstanceRef__pf))
{
bpv__gameINstanceRef__pf->bpf__ShowMainMenu__pf();
}
return; // KCST_GotoReturn
}
void UoptionsMenu_C__pf1343218889::bpf__ExecuteUbergraph_optionsMenu__pf_5(int32 bpp__EntryPoint__pf)
{
check(bpp__EntryPoint__pf == 6);
// optimized KCST_UnconditionalGoto
bpf__emptyNameCheck__pf(b0l__K2Node_ComponentBoundEvent_Text__pf);
return; // KCST_GotoReturn
}
void UoptionsMenu_C__pf1343218889::bpf__BndEvt__toggleRight_K2Node_ComponentBoundEvent_4_OnButtonClickedEvent__DelegateSignature__pf()
{
bpf__ExecuteUbergraph_optionsMenu__pf_1(24);
}
void UoptionsMenu_C__pf1343218889::bpf__BndEvt__toggleLeft_K2Node_ComponentBoundEvent_3_OnButtonClickedEvent__DelegateSignature__pf()
{
bpf__ExecuteUbergraph_optionsMenu__pf_0(21);
}
void UoptionsMenu_C__pf1343218889::bpf__Construct__pf()
{
bpf__ExecuteUbergraph_optionsMenu__pf_3(20);
}
void UoptionsMenu_C__pf1343218889::bpf__BndEvt__Accept_K2Node_ComponentBoundEvent_2_OnButtonClickedEvent__DelegateSignature__pf()
{
bpf__ExecuteUbergraph_optionsMenu__pf_2(13);
}
void UoptionsMenu_C__pf1343218889::bpf__BndEvt__backButton_K2Node_ComponentBoundEvent_1_OnButtonClickedEvent__DelegateSignature__pf()
{
bpf__ExecuteUbergraph_optionsMenu__pf_4(8);
}
void UoptionsMenu_C__pf1343218889::bpf__BndEvt__UserPlayerName_K2Node_ComponentBoundEvent_0_OnEditableTextBoxChangedEvent__DelegateSignature__pf(/*out*/ FText const& bpp__Text__pf__const)
{
typedef FText T__Local__81;
T__Local__81& bpp__Text__pf = *const_cast<T__Local__81 *>(&bpp__Text__pf__const);
b0l__K2Node_ComponentBoundEvent_Text__pf = bpp__Text__pf;
bpf__ExecuteUbergraph_optionsMenu__pf_5(6);
}
void UoptionsMenu_C__pf1343218889::bpf__saveGameCheck__pf()
{
bool bpfv__CallFunc_DoesSaveGameExist_ReturnValue__pf{};
int32 __CurrentState = 1;
do
{
switch( __CurrentState )
{
case 1:
{
bpfv__CallFunc_DoesSaveGameExist_ReturnValue__pf = UGameplayStatics::DoesSaveGameExist(bpv__playerSettingsSave__pf, 0);
}
case 2:
{
if (!bpfv__CallFunc_DoesSaveGameExist_ReturnValue__pf)
{
__CurrentState = 4;
break;
}
}
case 3:
{
bpf__loadGame__pf();
__CurrentState = -1;
break;
}
case 4:
{
bpf__saveGame__pf();
__CurrentState = -1;
break;
}
default:
break;
}
} while( __CurrentState != -1 );
}
void UoptionsMenu_C__pf1343218889::bpf__emptyNameCheck__pf(const FText& bpp__nameText__pf__const)
{
typedef FText T__Local__82;
T__Local__82& bpp__nameText__pf = *const_cast<T__Local__82 *>(&bpp__nameText__pf__const);
bool bpfv__CallFunc_TextIsEmpty_ReturnValue__pf{};
int32 __CurrentState = 1;
do
{
switch( __CurrentState )
{
case 1:
{
bpfv__CallFunc_TextIsEmpty_ReturnValue__pf = UKismetTextLibrary::TextIsEmpty(bpp__nameText__pf);
if (!bpfv__CallFunc_TextIsEmpty_ReturnValue__pf)
{
__CurrentState = 4;
break;
}
}
case 2:
{
bpv__enteredPlayerName__pf = bpp__nameText__pf;
}
case 3:
{
bpv__acceptEnabledx__pfzy = false;
__CurrentState = -1;
break;
}
case 4:
{
bpv__enteredPlayerName__pf = bpp__nameText__pf;
}
case 5:
{
bpv__acceptEnabledx__pfzy = true;
__CurrentState = -1;
break;
}
default:
break;
}
} while( __CurrentState != -1 );
}
void UoptionsMenu_C__pf1343218889::bpf__setupAvatarDisplay__pf()
{
}
void UoptionsMenu_C__pf1343218889::bpf__saveGame__pf()
{
bool bpfv__CallFunc_SaveGameToSlot_ReturnValue__pf{};
bool bpfv__CallFunc_IsValid_ReturnValue__pf{};
UplayerSaveGame_C__pf533497531* bpfv__CallFunc_CreateSaveGameObject_ReturnValue__pf{};
UplayerSaveGame_C__pf533497531* bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf{};
bool bpfv__K2Node_DynamicCast_bSuccess__pf{};
int32 __CurrentState = 1;
do
{
switch( __CurrentState )
{
case 1:
{
bpfv__CallFunc_IsValid_ReturnValue__pf = UKismetSystemLibrary::IsValid(bpv__saveGameREF__pf);
if (!bpfv__CallFunc_IsValid_ReturnValue__pf)
{
__CurrentState = 4;
break;
}
}
case 2:
{
if(IsValid(bpv__saveGameREF__pf))
{
bpv__saveGameREF__pf->bpv__S_PlayerINfo__pf = bpv__playerInfo__pf;
}
}
case 3:
{
bpfv__CallFunc_SaveGameToSlot_ReturnValue__pf = UGameplayStatics::SaveGameToSlot(bpv__saveGameREF__pf, bpv__playerSettingsSave__pf, 0);
__CurrentState = -1;
break;
}
case 4:
{
bpfv__CallFunc_CreateSaveGameObject_ReturnValue__pf = CastChecked<UplayerSaveGame_C__pf533497531>(UGameplayStatics::CreateSaveGameObject(UplayerSaveGame_C__pf533497531::StaticClass()), ECastCheckedType::NullAllowed);
}
case 5:
{
bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf = Cast<UplayerSaveGame_C__pf533497531>(bpfv__CallFunc_CreateSaveGameObject_ReturnValue__pf);
bpfv__K2Node_DynamicCast_bSuccess__pf = (bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf != nullptr);;
if (!bpfv__K2Node_DynamicCast_bSuccess__pf)
{
__CurrentState = -1;
break;
}
}
case 6:
{
bpv__saveGameREF__pf = bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf;
__CurrentState = 2;
break;
}
default:
break;
}
} while( __CurrentState != -1 );
}
void UoptionsMenu_C__pf1343218889::bpf__loadGame__pf()
{
USaveGame* bpfv__CallFunc_LoadGameFromSlot_ReturnValue__pf{};
UplayerSaveGame_C__pf533497531* bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf{};
bool bpfv__K2Node_DynamicCast_bSuccess__pf{};
int32 __CurrentState = 1;
do
{
switch( __CurrentState )
{
case 1:
{
bpfv__CallFunc_LoadGameFromSlot_ReturnValue__pf = UGameplayStatics::LoadGameFromSlot(bpv__playerSettingsSave__pf, 0);
}
case 2:
{
bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf = Cast<UplayerSaveGame_C__pf533497531>(bpfv__CallFunc_LoadGameFromSlot_ReturnValue__pf);
bpfv__K2Node_DynamicCast_bSuccess__pf = (bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf != nullptr);;
if (!bpfv__K2Node_DynamicCast_bSuccess__pf)
{
__CurrentState = -1;
break;
}
}
case 3:
{
auto __Local__84 = FPlayerInfo__pf533497531::GetDefaultValue();
FPlayerInfo__pf533497531 __Local__83 = __Local__84;
bpv__playerInfo__pf = ((IsValid(bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf)) ? (bpfv__K2Node_DynamicCast_AsPlayer_Save_Game__pf->bpv__S_PlayerINfo__pf) : (__Local__83));
__CurrentState = -1;
break;
}
default:
break;
}
} while( __CurrentState != -1 );
}
bool UoptionsMenu_C__pf1343218889::bpf__GetbIsEnabled_0__pf()
{
bool bpp__ReturnValue__pf{};
return bpp__ReturnValue__pf;
}
ESlateVisibility UoptionsMenu_C__pf1343218889::bpf__toggleBackButtonDisplay__pf()
{
ESlateVisibility bpp__ReturnValue__pf{};
ESlateVisibility bpfv__backButtonVis__pf{};
bool bpfv__CallFunc_EqualEqual_ByteByte_ReturnValue__pf{};
int32 __CurrentState = 1;
do
{
switch( __CurrentState )
{
case 1:
{
bpfv__backButtonVis__pf = ESlateVisibility::Visible;
}
case 2:
{
bpfv__CallFunc_EqualEqual_ByteByte_ReturnValue__pf = UKismetMathLibrary::EqualEqual_ByteByte(static_cast<uint8>(bpv__welcomeMessageVis__pf), static_cast<uint8>(ESlateVisibility::Visible));
if (!bpfv__CallFunc_EqualEqual_ByteByte_ReturnValue__pf)
{
__CurrentState = 5;
break;
}
}
case 3:
{
bpfv__backButtonVis__pf = ESlateVisibility::Hidden;
}
case 4:
{
bpp__ReturnValue__pf = bpfv__backButtonVis__pf;
__CurrentState = -1;
break;
}
case 5:
{
bpfv__backButtonVis__pf = ESlateVisibility::Visible;
__CurrentState = 4;
break;
}
default:
break;
}
} while( __CurrentState != -1 );
return bpp__ReturnValue__pf;
}
ESlateVisibility UoptionsMenu_C__pf1343218889::bpf__Get_backButton_Visibility_0__pf()
{
ESlateVisibility bpp__ReturnValue__pf{};
ESlateVisibility bpfv__backButtonVis__pf{};
bool bpfv__CallFunc_EqualEqual_ByteByte_ReturnValue__pf{};
int32 __CurrentState = 1;
do
{
switch( __CurrentState )
{
case 1:
{
bpfv__CallFunc_EqualEqual_ByteByte_ReturnValue__pf = UKismetMathLibrary::EqualEqual_ByteByte(static_cast<uint8>(bpv__welcomeMessageVis__pf), static_cast<uint8>(ESlateVisibility::Visible));
if (!bpfv__CallFunc_EqualEqual_ByteByte_ReturnValue__pf)
{
__CurrentState = 4;
break;
}
}
case 2:
{
bpfv__backButtonVis__pf = ESlateVisibility::Hidden;
}
case 3:
{
bpp__ReturnValue__pf = bpfv__backButtonVis__pf;
__CurrentState = -1;
break;
}
case 4:
{
bpfv__backButtonVis__pf = ESlateVisibility::Visible;
__CurrentState = 3;
break;
}
default:
break;
}
} while( __CurrentState != -1 );
return bpp__ReturnValue__pf;
}
void UoptionsMenu_C__pf1343218889::__StaticDependencies_DirectlyUsedAssets(TArray<FBlueprintDependencyData>& AssetsToLoad)
{
const FCompactBlueprintDependencyData LocCompactBlueprintDependencyData[] =
{
{69, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Texture2D /Game/InfinityBladeWarriors/Character/CompleteCharacters/Textures_Materials/CharM_Cardboard/Char_M_Cardboard_D.Char_M_Cardboard_D
{70, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Texture2D /Game/StarterContent/Textures/T_Brick_Clay_New_D.T_Brick_Clay_New_D
{71, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Texture2D /Game/StarterContent/Textures/T_Brick_Clay_New_N.T_Brick_Clay_New_N
{72, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Texture2D /Game/StarterContent/Textures/T_Burst_M.T_Burst_M
{73, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Texture2D /Game/StarterContent/Textures/T_Ceramic_Tile_M.T_Ceramic_Tile_M
{74, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Texture2D /Game/InfinityBladeWarriors/Character/CompleteCharacters/Textures_Materials/CharM_FrostGiant/T_Char_M_FrostGiant_D.T_Char_M_FrostGiant_D
{75, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Texture2D /Game/StarterContent/Textures/T_Bush_N.T_Bush_N
{76, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Texture2D /Game/InfinityBladeWarriors/Character/CompleteCharacters/Textures_Materials/CharM_Barbarous/T_CharM_Barbarous_D.T_CharM_Barbarous_D
};
for(const FCompactBlueprintDependencyData& CompactData : LocCompactBlueprintDependencyData)
{
AssetsToLoad.Add(FBlueprintDependencyData(F__NativeDependencies::Get(CompactData.ObjectRefIndex), CompactData));
}
}
void UoptionsMenu_C__pf1343218889::__StaticDependenciesAssets(TArray<FBlueprintDependencyData>& AssetsToLoad)
{
__StaticDependencies_DirectlyUsedAssets(AssetsToLoad);
const FCompactBlueprintDependencyData LocCompactBlueprintDependencyData[] =
{
{77, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Font /Engine/EngineFonts/Roboto.Roboto
{10, FBlueprintDependencyType(true, false, false, false), FBlueprintDependencyType(false, false, false, false)}, // ScriptStruct /Script/Engine.PointerToUberGraphFrame
{45, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/Engine.GameInstance
{0, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/Engine.Texture2D
{43, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/Engine.GameplayStatics
{78, FBlueprintDependencyType(true, false, false, false), FBlueprintDependencyType(false, false, false, false)}, // Enum /Script/UMG.ESlateVisibility
{79, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/Engine.KismetArrayLibrary
{14, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/Engine.KismetMathLibrary
{42, FBlueprintDependencyType(true, false, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/UMG.UserWidget
{80, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/Engine.SaveGame
{27, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/Engine.KismetSystemLibrary
{81, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // Class /Script/Engine.KismetTextLibrary
{82, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, true, false)}, // Class /Script/UMG.Button
{83, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, true, false)}, // Class /Script/UMG.Image
{84, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, true, false)}, // Class /Script/UMG.TextBlock
{85, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, true, false)}, // Class /Script/UMG.EditableTextBox
{86, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // BlueprintGeneratedClass /Game/Blueprints/allLevels/gameInfoInstance.gameInfoInstance_C
{87, FBlueprintDependencyType(false, true, false, false), FBlueprintDependencyType(false, false, false, false)}, // BlueprintGeneratedClass /Game/Blueprints/allLevels/playerSaveGame.playerSaveGame_C
{88, FBlueprintDependencyType(true, false, false, false), FBlueprintDependencyType(false, false, false, false)}, // UserDefinedStruct /Game/Blueprints/allLevels/PlayerInfo.PlayerInfo
};
for(const FCompactBlueprintDependencyData& CompactData : LocCompactBlueprintDependencyData)
{
AssetsToLoad.Add(FBlueprintDependencyData(F__NativeDependencies::Get(CompactData.ObjectRefIndex), CompactData));
}
}
struct FRegisterHelper__UoptionsMenu_C__pf1343218889
{
FRegisterHelper__UoptionsMenu_C__pf1343218889()
{
FConvertedBlueprintsDependencies::Get().RegisterConvertedClass(TEXT("/Game/UI/MainMenu/optionsMenu"), &UoptionsMenu_C__pf1343218889::__StaticDependenciesAssets);
}
static FRegisterHelper__UoptionsMenu_C__pf1343218889 Instance;
};
FRegisterHelper__UoptionsMenu_C__pf1343218889 FRegisterHelper__UoptionsMenu_C__pf1343218889::Instance;
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#ifdef _MSC_VER
#pragma warning (pop)
#endif
| [
"danielmolokie@yahoo.com"
] | danielmolokie@yahoo.com |
381a6e841e1f1be272a5a35db60dff06eb452ec5 | 6d399fae2ef3cc559dab80364d07e5737b7146ec | /src/device-info.cc | adfcd8129ee9e302c24a6287c211e1d0a1855d9f | [] | no_license | zp1996/pc-device-info | e7d6edf7465a87aa02cca235bebfa66c6a371d26 | 9e890855e35bc761ae7da52fa7583d0e0dca44fb | refs/heads/master | 2020-04-12T16:23:49.095609 | 2018-12-21T16:29:10 | 2018-12-21T16:29:10 | 162,611,263 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,698 | cc | #include <stdio.h>
#include <stdlib.h>
#include "common.h"
using namespace Nan;
#ifdef __DARWIN
static const char* modelKey = "hw.model";
#endif
#define V8_STRING(value) \
New<v8::String>(value).ToLocalChecked() \
#define SET_EXPORT(name, func) \
Set( \
target, \
New<v8::String>(#name).ToLocalChecked(), \
New<v8::FunctionTemplate>(func)->GetFunction() \
); \
char* get_device_verison() {
size_t len = 32;
char* version = (char*)(malloc(len + 1));
#ifdef __DARWIN
FILE *sw_vers = popen("sw_vers -productVersion", "r");
if (sw_vers) {
version = fgets(version, (int)len + 1, sw_vers);
pclose(sw_vers);
int index = sizeof(version) - 1;
if (*(version + index) == '\n') {
*(version + index) = '\0';
}
return version;
}
strcpy(version, "mac");
#endif
#ifdef __WIN32
#pragma warning(suppress : 4996)
OSVERSIONINFOW info = { 0 };
info.dwOSVersionInfoSize = sizeof(info);
GetVersionExW(&info);
uint32_t major = info.dwMajorVersion;
uint32_t minor = info.dwMinorVersion;
if (info.dwMajorVersion == 6) {
if (minor == 1) {
strcpy(version, "windows 7");
} else if (minor == 2) {
strcpy(version, "windows 8");
} else if (minor == 3) {
strcpy(version, "windows Server 2012 R2");
} else if (minor == 0) {
strcpy(version, "windows vista");
}
} else if(major == 10) {
strcpy(version, "windows 10");
} else {
strcpy(version, "windows");
}
#endif
return version;
}
NAN_METHOD(Get_Device_Version) {
char* version = get_device_verison();
info.GetReturnValue().Set(New<v8::String>(version).ToLocalChecked());
free(version);
}
char* get_device_model() {
#ifdef __DARWIN
size_t len = 0;
sysctlbyname(modelKey, NULL, &len, NULL, 0);
char* model = (char*)(malloc(len + 1));
memset(model, 0, len + 1);
sysctlbyname(modelKey, model, &len, NULL, 0);
return model;
#endif
#ifdef __WIN32
int err;
HKEY processor_key;
WCHAR cpu_brand[256];
DWORD cpu_brand_size = sizeof(cpu_brand);
err = RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
0,
KEY_QUERY_VALUE,
&processor_key
);
if (err != 0) return "";
err = RegQueryValueExW(
processor_key,
L"ProcessorNameString",
NULL,
NULL,
(BYTE*)&cpu_brand,
&cpu_brand_size
);
if (err != 0) return "";
_bstr_t b(cpu_brand);
return b;
#endif
}
uint64_t get_device_memory() {
uint64_t mem = 0;
size_t size = sizeof(mem);
#ifdef __DARWIN
int which[] = {CTL_HW, HW_MEMSIZE};
sysctl(which, 2, &mem, &size, NULL, 0);
#endif
#ifdef __WIN32
MEMORYSTATUSEX memory_status;
memory_status.dwLength = sizeof(memory_status);
GlobalMemoryStatusEx(&memory_status);
mem = (uint64_t)memory_status.ullTotalPhys;
#endif
return mem >> 30;
}
NAN_METHOD(Get_Device_Type) {
char* model = get_device_model();
uint64_t mem = get_device_memory();
v8::Local<v8::Object> type_obj = Nan::New<v8::Object>();
Set(type_obj, V8_STRING("model"), V8_STRING(model));
Set(type_obj, V8_STRING("memory"), New<v8::Number>(mem));
info.GetReturnValue().Set(type_obj);
free(model);
}
NAN_MODULE_INIT(Init) {
SET_EXPORT(getDeviceVersion, Get_Device_Version);
SET_EXPORT(getDeviceType, Get_Device_Type);
}
NODE_MODULE(device_info, Init);
| [
"1179258516@qq.com"
] | 1179258516@qq.com |
64977a51bd0e9a97186207051cc980aa06a5a0d2 | 0fb072835947c02a18c3f3cd18b3d316c33b32e4 | /find_merge.cpp | 132c63793f3e351e74ad65afcc9c9198c6089764 | [] | no_license | igauravsehrawat/Algorithms | 04b4c50951141decb09f7f363387ca38b6127e7a | 857941917302b32fee968f1e1277610acb8b80b2 | refs/heads/master | 2016-09-06T00:33:40.187705 | 2014-05-11T21:40:00 | 2014-05-11T21:40:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,384 | cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
using namespace std;
struct Node
{
int data;
Node* next;
};/*
Find merge point of two linked lists
Node is defined as
struct Node
{
int data;
Node* next;
}
*/
int FindMergeNode(Node *headA, Node *headB)
{
//double loop and see if we get to same address instead of value
Node *point1,*point2;
point1=headA;point2=headB;
while(point1->next!=NULL){
while(point2->next!=NULL){
if(point1->next==point2->next){
point1=point2->next;
return point1->data;
}
point2=point2->next;
}
point2=headB;
point1=point1->next;
}
// Complete this function
// Do not write the main method.
}int main()
{
Node *A, *B, *C, *D,*E,*F,*G;
A = new Node(); B= new Node(); C= new Node(); D = new Node(); E = new Node(); F= new Node();G = new Node();
A->data = 2; B->data = 4; C->data = 3; D->data = 5; E->data = 7; F->data = 6;G->data = 11;
// case 1 =
A->next = B; B->next = C; C->next = D; D->next = E; E->next = NULL;
F->next = G; G->next = C;
cout<<FindMergeNode(A,F)<<"\n";
//case 2.
A->next = B; B->next = C; C->next = E; E->next = NULL;
F->next = G; G->next = D;D->next = C;
cout<<FindMergeNode(A,F)<<"\n";
//case 3:
A->next = B; B->next = E; E->next = NULL;
F->next = G; G->next = D;D->next = C; C->next = E;
cout<<FindMergeNode(A,F)<<"\n";
} | [
"igauravsehrawat@gmail.com"
] | igauravsehrawat@gmail.com |
7039649d7ded9ac4e75967fc80a3ff688ccd1ebf | cbabbb709a0378aa00f577a979623fcad3f697f7 | /tests/BowlingScoreTest.cpp | 3be6eae358034dce1739d73799facb04aa56c16c | [] | no_license | MattLeg/BowlingScore | 4889c5883f4d3d435ae7d031b61093a527cf4e02 | 70741d1aa4deb58d7f836d39728472d9c0018b11 | refs/heads/master | 2023-06-07T02:04:23.249147 | 2021-06-26T19:59:02 | 2021-06-26T19:59:02 | 380,527,500 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,868 | cpp | //
// Created by sorge on 26/06/2021.
//
#include "include/BowlingScore.h"
#include "gtest/gtest.h"
class BowlingScoreTest : public::testing::Test {
void SetUp() {
arrayThrow = { std::make_tuple(1, 2), std::make_tuple(10, 0),
std::make_tuple(2, 5), std::make_tuple(3, 3),
std::make_tuple(5, 5), std::make_tuple(1, 2),
std::make_tuple(8, 1), std::make_tuple(0, 10),
std::make_tuple(9, 0), std::make_tuple(10, 0),
std::make_tuple(10, 0), std::make_tuple(6, 0)
};
arrayThrowBestScore = { std::make_tuple(10, 0), std::make_tuple(10, 0),
std::make_tuple(10, 0), std::make_tuple(10, 0),
std::make_tuple(10, 0), std::make_tuple(10, 0),
std::make_tuple(10, 0), std::make_tuple(10, 0),
std::make_tuple(10, 0), std::make_tuple(10, 0),
std::make_tuple(10, 0), std::make_tuple(10, 0)
};
}
void TearDown() {
}
protected:
std::array<std::tuple<int, int>, 12> arrayThrow;// avoid using C-Style syntaxe, use C++ instead
std::array<std::tuple<int, int>, 12> arrayThrowBestScore;// avoid using C-Style syntaxe, use C++ instead
int scoreThrow1 = 3;
int scoreStrike = 17;
};
TEST_F(BowlingScoreTest, testSimpleScore)
{
BowlingScore<int> bowlingScore;
int scoreTemp = 0;
scoreTemp = bowlingScore.calculScoreThrow(arrayThrow[0]);
EXPECT_TRUE(scoreTemp == scoreThrow1);
}
TEST_F(BowlingScoreTest, testIsStrike)
{
BowlingScore<int> bowlingScore;
bool returnTemp = 0;
returnTemp = bowlingScore.isStrike(arrayThrow[0]);
EXPECT_FALSE(returnTemp == true);
returnTemp = bowlingScore.isStrike(arrayThrow[1]);
EXPECT_TRUE(returnTemp == true);
}
TEST_F(BowlingScoreTest, testIsSquare)
{
BowlingScore<int> bowlingScore;
bool returnTemp = 0;
returnTemp = bowlingScore.isSquare(arrayThrow[0]);
EXPECT_FALSE(returnTemp == true);
returnTemp = bowlingScore.isSquare(arrayThrow[1]);
EXPECT_FALSE(returnTemp == true);
returnTemp = bowlingScore.isSquare(arrayThrow[4]);
EXPECT_TRUE(returnTemp == true);
}
TEST_F(BowlingScoreTest, testCalculStrikeScore)
{
BowlingScore<int> bowlingScore;
int returnTemp = 0;
returnTemp = bowlingScore.calculScoreStrike(1, arrayThrow);
EXPECT_TRUE(returnTemp == 17);
returnTemp = bowlingScore.calculScoreStrike(9, arrayThrow);
EXPECT_TRUE(returnTemp == 26);
}
TEST_F(BowlingScoreTest, testCalculSquareScore)
{
BowlingScore<int> bowlingScore;
int returnTemp = 0;
returnTemp = bowlingScore.calculScoreSquare(4, arrayThrow);
EXPECT_TRUE(returnTemp == 11);
returnTemp = bowlingScore.calculScoreSquare(7, arrayThrow);
EXPECT_TRUE(returnTemp == 19);
}
TEST_F(BowlingScoreTest, testCalculAllScore)
{
BowlingScore<int> bowlingScore;
int returnTemp = 0;
returnTemp = bowlingScore.calculScoreAll(arrayThrow);
EXPECT_TRUE(returnTemp == 110);
returnTemp = bowlingScore.calculScoreAll(arrayThrowBestScore);
EXPECT_TRUE(returnTemp == 300);
} | [
"sorgelmatt@gmail.com"
] | sorgelmatt@gmail.com |
04b4c8140489552db9c048408991eebfde2de433 | faa5d1d27a89cba2657f6fe53d9106630ef2c104 | /AUOJ/946.cpp | 90e086393ad4c7c59a6bf94610c9d9b8b74439b6 | [] | no_license | xiao-lin52/My-Codes | f4feef04a05b1904a1f31e0e5a04e0a48ee61cb9 | d8fc530ade2bbac32c016a731c667c4189e3c6c7 | refs/heads/main | 2023-03-12T23:32:55.219341 | 2021-03-07T07:31:32 | 2021-03-07T07:31:32 | 304,806,222 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 325 | cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
inline ll read()
{
register ll x=0,f=1;
register char ch=getchar();
while(!isdigit(ch)) { if(ch=='-') f=-1; ch=getchar(); }
while(isdigit(ch)) { x=x*10+ch-'0'; ch=getchar(); }
return x*f;
}
ll n;
int main()
{
n=read();
printf("%lld",2*n);
return 0;
}
| [
"2492043904@qq.com"
] | 2492043904@qq.com |
5d90aef0180c55f203d539437c00dd679c8ebe31 | 4a25b32d468bd66e64ab58e635bfc8e0224b815d | /trunk/code/server/sdk/Utility/Source/fasttimer.cpp | 2970f627a0c73398a7376c7750ac9b89ece601ab | [] | no_license | davidyj/starhome | 63193070af6c37654f89e6f0d855bea7f8aef1f6 | 5127e3dd42a9fbd8bb4bad99d2d93a7d640aa7d2 | refs/heads/master | 2020-05-30T14:17:15.364339 | 2013-03-21T02:46:05 | 2013-03-21T02:46:05 | 7,891,354 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 317 | cpp | #include "../stdafx.h"
#include "fasttimer.h"
int64 g_ClockSpeed; // Clocks/sec
unsigned long g_dwClockSpeed;
double g_ClockSpeedMicrosecondsMultiplier;
double g_ClockSpeedMillisecondsMultiplier;
double g_ClockSpeedSecondsMultiplier;
// Constructor init the clock speed.
static CClockSpeedInit g_ClockSpeedInit;
| [
"david_yj@msn.com"
] | david_yj@msn.com |
e1cceeffa48564cbb67a8369bb795695894f5db7 | 6d34fa23c708320b2e42d120d107f187106302e3 | /orca/gporca/libgpopt/src/xforms/CXformInnerJoinWithInnerSelect2DynamicIndexGetApply.cpp | ba623f92c5430a489709ef1681ed56f2584b07bd | [
"Apache-2.0"
] | permissive | joe2hpimn/dg16.oss | a38ca233ba5c9f803f9caa99016a4c7560da9f08 | 2c4275c832b3e4b715b7475726db6757b127030c | refs/heads/master | 2021-08-23T19:11:49.831210 | 2017-12-06T05:23:22 | 2017-12-06T05:23:22 | 113,322,478 | 2 | 1 | null | 2017-12-06T13:50:44 | 2017-12-06T13:50:44 | null | UTF-8 | C++ | false | false | 3,018 | cpp | //---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2014 Pivotal, Inc.
//
// @filename:
// CXformInnerJoinWithInnerSelect2DynamicIndexGetApply.cpp
//
// @doc:
// Transform Inner Join with Select over Dynamic Get on inner branch to IndexGet Apply
//
// @owner:
// n
//
// @test:
//
//---------------------------------------------------------------------------
#include "gpos/base.h"
#include "gpopt/operators/ops.h"
#include "gpopt/xforms/CXformInnerJoinWithInnerSelect2DynamicIndexGetApply.h"
using namespace gpopt;
//---------------------------------------------------------------------------
// @function:
// CXformInnerJoinWithInnerSelect2DynamicIndexGetApply::CXformInnerJoinWithInnerSelect2DynamicIndexGetApply
//
// @doc:
// Ctor
//
//---------------------------------------------------------------------------
CXformInnerJoinWithInnerSelect2DynamicIndexGetApply::CXformInnerJoinWithInnerSelect2DynamicIndexGetApply
(
IMemoryPool *pmp
)
:
// pattern
CXformInnerJoin2IndexApply
(
GPOS_NEW(pmp) CExpression
(
pmp,
GPOS_NEW(pmp) CLogicalInnerJoin(pmp),
GPOS_NEW(pmp) CExpression(pmp, GPOS_NEW(pmp) CPatternLeaf(pmp)), // outer child
GPOS_NEW(pmp) CExpression
(
pmp,
GPOS_NEW(pmp) CLogicalSelect(pmp),
GPOS_NEW(pmp) CExpression(pmp, GPOS_NEW(pmp) CLogicalDynamicGet(pmp)),
GPOS_NEW(pmp) CExpression(pmp, GPOS_NEW(pmp) CPatternTree(pmp)) // predicate
),
GPOS_NEW(pmp) CExpression(pmp, GPOS_NEW(pmp) CPatternTree(pmp)) // predicate tree
)
)
{}
//---------------------------------------------------------------------------
// @function:
// CXformInnerJoinWithInnerSelect2DynamicIndexGetApply::Transform
//
// @doc:
// Actual transformation
//
//---------------------------------------------------------------------------
void
CXformInnerJoinWithInnerSelect2DynamicIndexGetApply::Transform
(
CXformContext *pxfctxt,
CXformResult *pxfres,
CExpression *pexpr
)
const
{
GPOS_ASSERT(NULL != pxfctxt);
GPOS_ASSERT(FPromising(pxfctxt->Pmp(), this, pexpr));
GPOS_ASSERT(FCheckPattern(pexpr));
IMemoryPool *pmp = pxfctxt->Pmp();
// extract components
CExpression *pexprOuter = (*pexpr)[0];
CExpression *pexprInner = (*pexpr)[1];
CExpression *pexprScalar = (*pexpr)[2];
GPOS_ASSERT(COperator::EopLogicalSelect == pexprInner->Pop()->Eopid());
CExpression *pexprGet = (*pexprInner)[0];
GPOS_ASSERT(COperator::EopLogicalDynamicGet == pexprGet->Pop()->Eopid());
CLogicalDynamicGet *popDynamicGet = CLogicalDynamicGet::PopConvert(pexprGet->Pop());
CTableDescriptor *ptabdescInner = popDynamicGet->Ptabdesc();
CExpression *pexprAllPredicates = CPredicateUtils::PexprConjunction(pmp, pexprScalar, (*pexprInner)[1]);
CreateHomogeneousIndexApplyAlternatives
(
pmp,
pexpr->Pop()->UlOpId(),
pexprOuter,
pexprGet,
pexprAllPredicates,
ptabdescInner,
popDynamicGet,
pxfres,
IMDIndex::EmdindBtree
);
pexprAllPredicates->Release();
}
// EOF
| [
"fengttt@gmail.com"
] | fengttt@gmail.com |
751b97e330cd4416839429bc4be36ba838db82fd | e327102fce8af65971834008975b12151372d0ba | /45.cpp | 7f6d40f18543c2be333aad240f544516b1278e31 | [] | no_license | GitBingo/projectEuler | abfbe7866396783a518df69ccfc915a34b9fbd6a | 5733c7c78292dec07c2f6841e8d0fc3fe38a3e66 | refs/heads/master | 2021-01-19T23:34:15.344750 | 2017-10-13T06:43:51 | 2017-10-13T06:43:51 | 88,999,318 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 660 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool loopTriangle(ll num)
{
ll curr = 0;
for(ll i = 1; curr <= num; i++)
{
curr = (i*(i + 1)) / 2;
if(num == curr)
{
return true;
}
}
return false;
}
bool loopHexagonal(ll num)
{
ll curr = 0;
for(ll i = 1; curr <= num; i++)
{
curr = (i*(2*i - 1));
if(num == curr)
{
return true;
}
}
return false;
}
bool loopPentagonal()
{
ll curr = 0;
for(ll i = 1; true; i++)
{
curr = (i*(3*i - 1)) / 2;
if(loopHexagonal(curr) && loopTriangle(curr))
{
cout << curr << endl;
}
}
return false;
}
int main()
{
loopPentagonal();
return 0;
}
| [
"7208382@linux13.mcs.sdsmt.edu"
] | 7208382@linux13.mcs.sdsmt.edu |
d320186462dac956bd12104ca0220f63768cbe40 | 38c10c01007624cd2056884f25e0d6ab85442194 | /third_party/deqp/src/modules/egl/teglGetProcAddressTests.inl | 23c88c4f9f0a6f2683f20f9dc1cb040ef1308775 | [
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT"
] | permissive | zenoalbisser/chromium | 6ecf37b6c030c84f1b26282bc4ef95769c62a9b2 | e71f21b9b4b9b839f5093301974a45545dad2691 | refs/heads/master | 2022-12-25T14:23:18.568575 | 2016-07-14T21:49:52 | 2016-07-23T08:02:51 | 63,980,627 | 0 | 2 | BSD-3-Clause | 2022-12-12T12:43:41 | 2016-07-22T20:14:04 | null | UTF-8 | C++ | false | false | 44,481 | inl | /* WARNING: This is auto-generated file. Do not modify, since changes will
* be lost! Modify the generating script instead.
*
* Generated from Khronos EGL API description (egl.xml) revision 31042.
*/
static const char* s_EGL14[] =
{
"eglBindAPI",
"eglBindTexImage",
"eglChooseConfig",
"eglCopyBuffers",
"eglCreateContext",
"eglCreatePbufferFromClientBuffer",
"eglCreatePbufferSurface",
"eglCreatePixmapSurface",
"eglCreateWindowSurface",
"eglDestroyContext",
"eglDestroySurface",
"eglGetConfigAttrib",
"eglGetConfigs",
"eglGetCurrentContext",
"eglGetCurrentDisplay",
"eglGetCurrentSurface",
"eglGetDisplay",
"eglGetError",
"eglGetProcAddress",
"eglInitialize",
"eglMakeCurrent",
"eglQueryAPI",
"eglQueryContext",
"eglQueryString",
"eglQuerySurface",
"eglReleaseTexImage",
"eglReleaseThread",
"eglSurfaceAttrib",
"eglSwapBuffers",
"eglSwapInterval",
"eglTerminate",
"eglWaitClient",
"eglWaitGL",
"eglWaitNative",
};
static const char* s_GLES10[] =
{
"glActiveTexture",
"glAlphaFunc",
"glAlphaFuncx",
"glBindBuffer",
"glBindTexture",
"glBlendFunc",
"glBufferData",
"glBufferSubData",
"glClear",
"glClearColor",
"glClearColorx",
"glClearDepthf",
"glClearDepthx",
"glClearStencil",
"glClientActiveTexture",
"glClipPlanef",
"glClipPlanex",
"glColor4f",
"glColor4ub",
"glColor4x",
"glColorMask",
"glColorPointer",
"glCompressedTexImage2D",
"glCompressedTexSubImage2D",
"glCopyTexImage2D",
"glCopyTexSubImage2D",
"glCullFace",
"glDeleteBuffers",
"glDeleteTextures",
"glDepthFunc",
"glDepthMask",
"glDepthRangef",
"glDepthRangex",
"glDisable",
"glDisableClientState",
"glDrawArrays",
"glDrawElements",
"glEnable",
"glEnableClientState",
"glFinish",
"glFlush",
"glFogf",
"glFogfv",
"glFogx",
"glFogxv",
"glFrontFace",
"glFrustumf",
"glFrustumx",
"glGenBuffers",
"glGenTextures",
"glGetBooleanv",
"glGetBufferParameteriv",
"glGetClipPlanef",
"glGetClipPlanex",
"glGetError",
"glGetFixedv",
"glGetFloatv",
"glGetIntegerv",
"glGetLightfv",
"glGetLightxv",
"glGetMaterialfv",
"glGetMaterialxv",
"glGetPointerv",
"glGetString",
"glGetTexEnvfv",
"glGetTexEnviv",
"glGetTexEnvxv",
"glGetTexParameterfv",
"glGetTexParameteriv",
"glGetTexParameterxv",
"glHint",
"glIsBuffer",
"glIsEnabled",
"glIsTexture",
"glLightModelf",
"glLightModelfv",
"glLightModelx",
"glLightModelxv",
"glLightf",
"glLightfv",
"glLightx",
"glLightxv",
"glLineWidth",
"glLineWidthx",
"glLoadIdentity",
"glLoadMatrixf",
"glLoadMatrixx",
"glLogicOp",
"glMaterialf",
"glMaterialfv",
"glMaterialx",
"glMaterialxv",
"glMatrixMode",
"glMultMatrixf",
"glMultMatrixx",
"glMultiTexCoord4f",
"glMultiTexCoord4x",
"glNormal3f",
"glNormal3x",
"glNormalPointer",
"glOrthof",
"glOrthox",
"glPixelStorei",
"glPointParameterf",
"glPointParameterfv",
"glPointParameterx",
"glPointParameterxv",
"glPointSize",
"glPointSizex",
"glPolygonOffset",
"glPolygonOffsetx",
"glPopMatrix",
"glPushMatrix",
"glReadPixels",
"glRotatef",
"glRotatex",
"glSampleCoverage",
"glSampleCoveragex",
"glScalef",
"glScalex",
"glScissor",
"glShadeModel",
"glStencilFunc",
"glStencilMask",
"glStencilOp",
"glTexCoordPointer",
"glTexEnvf",
"glTexEnvfv",
"glTexEnvi",
"glTexEnviv",
"glTexEnvx",
"glTexEnvxv",
"glTexImage2D",
"glTexParameterf",
"glTexParameterfv",
"glTexParameteri",
"glTexParameteriv",
"glTexParameterx",
"glTexParameterxv",
"glTexSubImage2D",
"glTranslatef",
"glTranslatex",
"glVertexPointer",
"glViewport",
};
static const char* s_GLES20[] =
{
"glActiveTexture",
"glAttachShader",
"glBindAttribLocation",
"glBindBuffer",
"glBindFramebuffer",
"glBindRenderbuffer",
"glBindTexture",
"glBlendColor",
"glBlendEquation",
"glBlendEquationSeparate",
"glBlendFunc",
"glBlendFuncSeparate",
"glBufferData",
"glBufferSubData",
"glCheckFramebufferStatus",
"glClear",
"glClearColor",
"glClearDepthf",
"glClearStencil",
"glColorMask",
"glCompileShader",
"glCompressedTexImage2D",
"glCompressedTexSubImage2D",
"glCopyTexImage2D",
"glCopyTexSubImage2D",
"glCreateProgram",
"glCreateShader",
"glCullFace",
"glDeleteBuffers",
"glDeleteFramebuffers",
"glDeleteProgram",
"glDeleteRenderbuffers",
"glDeleteShader",
"glDeleteTextures",
"glDepthFunc",
"glDepthMask",
"glDepthRangef",
"glDetachShader",
"glDisable",
"glDisableVertexAttribArray",
"glDrawArrays",
"glDrawElements",
"glEnable",
"glEnableVertexAttribArray",
"glFinish",
"glFlush",
"glFramebufferRenderbuffer",
"glFramebufferTexture2D",
"glFrontFace",
"glGenBuffers",
"glGenFramebuffers",
"glGenRenderbuffers",
"glGenTextures",
"glGenerateMipmap",
"glGetActiveAttrib",
"glGetActiveUniform",
"glGetAttachedShaders",
"glGetAttribLocation",
"glGetBooleanv",
"glGetBufferParameteriv",
"glGetError",
"glGetFloatv",
"glGetFramebufferAttachmentParameteriv",
"glGetIntegerv",
"glGetProgramInfoLog",
"glGetProgramiv",
"glGetRenderbufferParameteriv",
"glGetShaderInfoLog",
"glGetShaderPrecisionFormat",
"glGetShaderSource",
"glGetShaderiv",
"glGetString",
"glGetTexParameterfv",
"glGetTexParameteriv",
"glGetUniformLocation",
"glGetUniformfv",
"glGetUniformiv",
"glGetVertexAttribPointerv",
"glGetVertexAttribfv",
"glGetVertexAttribiv",
"glHint",
"glIsBuffer",
"glIsEnabled",
"glIsFramebuffer",
"glIsProgram",
"glIsRenderbuffer",
"glIsShader",
"glIsTexture",
"glLineWidth",
"glLinkProgram",
"glPixelStorei",
"glPolygonOffset",
"glReadPixels",
"glReleaseShaderCompiler",
"glRenderbufferStorage",
"glSampleCoverage",
"glScissor",
"glShaderBinary",
"glShaderSource",
"glStencilFunc",
"glStencilFuncSeparate",
"glStencilMask",
"glStencilMaskSeparate",
"glStencilOp",
"glStencilOpSeparate",
"glTexImage2D",
"glTexParameterf",
"glTexParameterfv",
"glTexParameteri",
"glTexParameteriv",
"glTexSubImage2D",
"glUniform1f",
"glUniform1fv",
"glUniform1i",
"glUniform1iv",
"glUniform2f",
"glUniform2fv",
"glUniform2i",
"glUniform2iv",
"glUniform3f",
"glUniform3fv",
"glUniform3i",
"glUniform3iv",
"glUniform4f",
"glUniform4fv",
"glUniform4i",
"glUniform4iv",
"glUniformMatrix2fv",
"glUniformMatrix3fv",
"glUniformMatrix4fv",
"glUseProgram",
"glValidateProgram",
"glVertexAttrib1f",
"glVertexAttrib1fv",
"glVertexAttrib2f",
"glVertexAttrib2fv",
"glVertexAttrib3f",
"glVertexAttrib3fv",
"glVertexAttrib4f",
"glVertexAttrib4fv",
"glVertexAttribPointer",
"glViewport",
};
static const char* s_GLES30[] =
{
"glBeginQuery",
"glBeginTransformFeedback",
"glBindBufferBase",
"glBindBufferRange",
"glBindSampler",
"glBindTransformFeedback",
"glBindVertexArray",
"glBlitFramebuffer",
"glClearBufferfi",
"glClearBufferfv",
"glClearBufferiv",
"glClearBufferuiv",
"glClientWaitSync",
"glCompressedTexImage3D",
"glCompressedTexSubImage3D",
"glCopyBufferSubData",
"glCopyTexSubImage3D",
"glDeleteQueries",
"glDeleteSamplers",
"glDeleteSync",
"glDeleteTransformFeedbacks",
"glDeleteVertexArrays",
"glDrawArraysInstanced",
"glDrawBuffers",
"glDrawElementsInstanced",
"glDrawRangeElements",
"glEndQuery",
"glEndTransformFeedback",
"glFenceSync",
"glFlushMappedBufferRange",
"glFramebufferTextureLayer",
"glGenQueries",
"glGenSamplers",
"glGenTransformFeedbacks",
"glGenVertexArrays",
"glGetActiveUniformBlockName",
"glGetActiveUniformBlockiv",
"glGetActiveUniformsiv",
"glGetBufferParameteri64v",
"glGetBufferPointerv",
"glGetFragDataLocation",
"glGetInteger64i_v",
"glGetInteger64v",
"glGetIntegeri_v",
"glGetInternalformativ",
"glGetProgramBinary",
"glGetQueryObjectuiv",
"glGetQueryiv",
"glGetSamplerParameterfv",
"glGetSamplerParameteriv",
"glGetStringi",
"glGetSynciv",
"glGetTransformFeedbackVarying",
"glGetUniformBlockIndex",
"glGetUniformIndices",
"glGetUniformuiv",
"glGetVertexAttribIiv",
"glGetVertexAttribIuiv",
"glInvalidateFramebuffer",
"glInvalidateSubFramebuffer",
"glIsQuery",
"glIsSampler",
"glIsSync",
"glIsTransformFeedback",
"glIsVertexArray",
"glMapBufferRange",
"glPauseTransformFeedback",
"glProgramBinary",
"glProgramParameteri",
"glReadBuffer",
"glRenderbufferStorageMultisample",
"glResumeTransformFeedback",
"glSamplerParameterf",
"glSamplerParameterfv",
"glSamplerParameteri",
"glSamplerParameteriv",
"glTexImage3D",
"glTexStorage2D",
"glTexStorage3D",
"glTexSubImage3D",
"glTransformFeedbackVaryings",
"glUniform1ui",
"glUniform1uiv",
"glUniform2ui",
"glUniform2uiv",
"glUniform3ui",
"glUniform3uiv",
"glUniform4ui",
"glUniform4uiv",
"glUniformBlockBinding",
"glUniformMatrix2x3fv",
"glUniformMatrix2x4fv",
"glUniformMatrix3x2fv",
"glUniformMatrix3x4fv",
"glUniformMatrix4x2fv",
"glUniformMatrix4x3fv",
"glUnmapBuffer",
"glVertexAttribDivisor",
"glVertexAttribI4i",
"glVertexAttribI4iv",
"glVertexAttribI4ui",
"glVertexAttribI4uiv",
"glVertexAttribIPointer",
"glWaitSync",
};
static const char* s_EGL_ANDROID_blob_cache[] =
{
"eglSetBlobCacheFuncsANDROID",
};
static const char* s_EGL_ANDROID_native_fence_sync[] =
{
"eglDupNativeFenceFDANDROID",
};
static const char* s_EGL_ANGLE_query_surface_pointer[] =
{
"eglQuerySurfacePointerANGLE",
};
static const char* s_EGL_EXT_device_base[] =
{
"eglQueryDeviceAttribEXT",
"eglQueryDeviceStringEXT",
"eglQueryDevicesEXT",
"eglQueryDisplayAttribEXT",
};
static const char* s_EGL_EXT_device_enumeration[] =
{
"eglQueryDevicesEXT",
};
static const char* s_EGL_EXT_device_query[] =
{
"eglQueryDeviceAttribEXT",
"eglQueryDeviceStringEXT",
"eglQueryDisplayAttribEXT",
};
static const char* s_EGL_EXT_output_base[] =
{
"eglGetOutputLayersEXT",
"eglGetOutputPortsEXT",
"eglOutputLayerAttribEXT",
"eglOutputPortAttribEXT",
"eglQueryOutputLayerAttribEXT",
"eglQueryOutputLayerStringEXT",
"eglQueryOutputPortAttribEXT",
"eglQueryOutputPortStringEXT",
};
static const char* s_EGL_EXT_platform_base[] =
{
"eglCreatePlatformPixmapSurfaceEXT",
"eglCreatePlatformWindowSurfaceEXT",
"eglGetPlatformDisplayEXT",
};
static const char* s_EGL_EXT_stream_consumer_egloutput[] =
{
"eglStreamConsumerOutputEXT",
};
static const char* s_EGL_EXT_swap_buffers_with_damage[] =
{
"eglSwapBuffersWithDamageEXT",
};
static const char* s_EGL_HI_clientpixmap[] =
{
"eglCreatePixmapSurfaceHI",
};
static const char* s_EGL_KHR_cl_event2[] =
{
"eglCreateSync64KHR",
};
static const char* s_EGL_KHR_fence_sync[] =
{
"eglClientWaitSyncKHR",
"eglCreateSyncKHR",
"eglDestroySyncKHR",
"eglGetSyncAttribKHR",
};
static const char* s_EGL_KHR_image[] =
{
"eglCreateImageKHR",
"eglDestroyImageKHR",
};
static const char* s_EGL_KHR_image_base[] =
{
"eglCreateImageKHR",
"eglDestroyImageKHR",
};
static const char* s_EGL_KHR_lock_surface[] =
{
"eglLockSurfaceKHR",
"eglUnlockSurfaceKHR",
};
static const char* s_EGL_KHR_lock_surface3[] =
{
"eglLockSurfaceKHR",
"eglQuerySurface64KHR",
"eglUnlockSurfaceKHR",
};
static const char* s_EGL_KHR_partial_update[] =
{
"eglSetDamageRegionKHR",
};
static const char* s_EGL_KHR_reusable_sync[] =
{
"eglClientWaitSyncKHR",
"eglCreateSyncKHR",
"eglDestroySyncKHR",
"eglGetSyncAttribKHR",
"eglSignalSyncKHR",
};
static const char* s_EGL_KHR_stream[] =
{
"eglCreateStreamKHR",
"eglDestroyStreamKHR",
"eglQueryStreamKHR",
"eglQueryStreamu64KHR",
"eglStreamAttribKHR",
};
static const char* s_EGL_KHR_stream_consumer_gltexture[] =
{
"eglStreamConsumerAcquireKHR",
"eglStreamConsumerGLTextureExternalKHR",
"eglStreamConsumerReleaseKHR",
};
static const char* s_EGL_KHR_stream_cross_process_fd[] =
{
"eglCreateStreamFromFileDescriptorKHR",
"eglGetStreamFileDescriptorKHR",
};
static const char* s_EGL_KHR_stream_fifo[] =
{
"eglQueryStreamTimeKHR",
};
static const char* s_EGL_KHR_stream_producer_eglsurface[] =
{
"eglCreateStreamProducerSurfaceKHR",
};
static const char* s_EGL_KHR_swap_buffers_with_damage[] =
{
"eglSwapBuffersWithDamageKHR",
};
static const char* s_EGL_KHR_wait_sync[] =
{
"eglWaitSyncKHR",
};
static const char* s_EGL_MESA_drm_image[] =
{
"eglCreateDRMImageMESA",
"eglExportDRMImageMESA",
};
static const char* s_EGL_MESA_image_dma_buf_export[] =
{
"eglExportDMABUFImageMESA",
"eglExportDMABUFImageQueryMESA",
};
static const char* s_EGL_NOK_swap_region[] =
{
"eglSwapBuffersRegionNOK",
};
static const char* s_EGL_NOK_swap_region2[] =
{
"eglSwapBuffersRegion2NOK",
};
static const char* s_EGL_NV_native_query[] =
{
"eglQueryNativeDisplayNV",
"eglQueryNativePixmapNV",
"eglQueryNativeWindowNV",
};
static const char* s_EGL_NV_post_sub_buffer[] =
{
"eglPostSubBufferNV",
};
static const char* s_EGL_NV_stream_sync[] =
{
"eglCreateStreamSyncNV",
};
static const char* s_EGL_NV_sync[] =
{
"eglClientWaitSyncNV",
"eglCreateFenceSyncNV",
"eglDestroySyncNV",
"eglFenceNV",
"eglGetSyncAttribNV",
"eglSignalSyncNV",
};
static const char* s_EGL_NV_system_time[] =
{
"eglGetSystemTimeFrequencyNV",
"eglGetSystemTimeNV",
};
static const char* s_GL_APPLE_copy_texture_levels[] =
{
"glCopyTextureLevelsAPPLE",
};
static const char* s_GL_APPLE_framebuffer_multisample[] =
{
"glRenderbufferStorageMultisampleAPPLE",
"glResolveMultisampleFramebufferAPPLE",
};
static const char* s_GL_APPLE_sync[] =
{
"glClientWaitSyncAPPLE",
"glDeleteSyncAPPLE",
"glFenceSyncAPPLE",
"glGetInteger64vAPPLE",
"glGetSyncivAPPLE",
"glIsSyncAPPLE",
"glWaitSyncAPPLE",
};
static const char* s_GL_EXT_discard_framebuffer[] =
{
"glDiscardFramebufferEXT",
};
static const char* s_GL_EXT_map_buffer_range[] =
{
"glFlushMappedBufferRangeEXT",
"glMapBufferRangeEXT",
};
static const char* s_GL_EXT_multi_draw_arrays[] =
{
"glMultiDrawArraysEXT",
"glMultiDrawElementsEXT",
};
static const char* s_GL_EXT_multisampled_render_to_texture[] =
{
"glFramebufferTexture2DMultisampleEXT",
"glRenderbufferStorageMultisampleEXT",
};
static const char* s_GL_EXT_robustness[] =
{
"glGetGraphicsResetStatusEXT",
"glGetnUniformfvEXT",
"glGetnUniformivEXT",
"glReadnPixelsEXT",
};
static const char* s_GL_EXT_texture_storage[] =
{
"glTexStorage1DEXT",
"glTexStorage2DEXT",
"glTexStorage3DEXT",
"glTextureStorage1DEXT",
"glTextureStorage2DEXT",
"glTextureStorage3DEXT",
};
static const char* s_GL_IMG_multisampled_render_to_texture[] =
{
"glFramebufferTexture2DMultisampleIMG",
"glRenderbufferStorageMultisampleIMG",
};
static const char* s_GL_IMG_user_clip_plane[] =
{
"glClipPlanefIMG",
"glClipPlanexIMG",
};
static const char* s_GL_NV_fence[] =
{
"glDeleteFencesNV",
"glFinishFenceNV",
"glGenFencesNV",
"glGetFenceivNV",
"glIsFenceNV",
"glSetFenceNV",
"glTestFenceNV",
};
static const char* s_GL_OES_EGL_image[] =
{
"glEGLImageTargetRenderbufferStorageOES",
"glEGLImageTargetTexture2DOES",
};
static const char* s_GL_OES_blend_equation_separate[] =
{
"glBlendEquationSeparateOES",
};
static const char* s_GL_OES_blend_func_separate[] =
{
"glBlendFuncSeparateOES",
};
static const char* s_GL_OES_blend_subtract[] =
{
"glBlendEquationOES",
};
static const char* s_GL_OES_draw_texture[] =
{
"glDrawTexfOES",
"glDrawTexfvOES",
"glDrawTexiOES",
"glDrawTexivOES",
"glDrawTexsOES",
"glDrawTexsvOES",
"glDrawTexxOES",
"glDrawTexxvOES",
};
static const char* s_GL_OES_fixed_point[] =
{
"glAlphaFuncxOES",
"glClearColorxOES",
"glClearDepthxOES",
"glClipPlanexOES",
"glColor4xOES",
"glDepthRangexOES",
"glFogxOES",
"glFogxvOES",
"glFrustumxOES",
"glGetClipPlanexOES",
"glGetFixedvOES",
"glGetLightxvOES",
"glGetMaterialxvOES",
"glGetTexEnvxvOES",
"glGetTexParameterxvOES",
"glLightModelxOES",
"glLightModelxvOES",
"glLightxOES",
"glLightxvOES",
"glLineWidthxOES",
"glLoadMatrixxOES",
"glMaterialxOES",
"glMaterialxvOES",
"glMultMatrixxOES",
"glMultiTexCoord4xOES",
"glNormal3xOES",
"glOrthoxOES",
"glPointParameterxOES",
"glPointParameterxvOES",
"glPointSizexOES",
"glPolygonOffsetxOES",
"glRotatexOES",
"glSampleCoverageOES",
"glSampleCoveragexOES",
"glScalexOES",
"glTexEnvxOES",
"glTexEnvxvOES",
"glTexParameterxOES",
"glTexParameterxvOES",
"glTranslatexOES",
};
static const char* s_GL_OES_framebuffer_object[] =
{
"glBindFramebufferOES",
"glBindRenderbufferOES",
"glCheckFramebufferStatusOES",
"glDeleteFramebuffersOES",
"glDeleteRenderbuffersOES",
"glFramebufferRenderbufferOES",
"glFramebufferTexture2DOES",
"glGenFramebuffersOES",
"glGenRenderbuffersOES",
"glGenerateMipmapOES",
"glGetFramebufferAttachmentParameterivOES",
"glGetRenderbufferParameterivOES",
"glIsFramebufferOES",
"glIsRenderbufferOES",
"glRenderbufferStorageOES",
};
static const char* s_GL_OES_mapbuffer[] =
{
"glGetBufferPointervOES",
"glMapBufferOES",
"glUnmapBufferOES",
};
static const char* s_GL_OES_matrix_palette[] =
{
"glCurrentPaletteMatrixOES",
"glLoadPaletteFromModelViewMatrixOES",
"glMatrixIndexPointerOES",
"glWeightPointerOES",
};
static const char* s_GL_OES_point_size_array[] =
{
"glPointSizePointerOES",
};
static const char* s_GL_OES_query_matrix[] =
{
"glQueryMatrixxOES",
};
static const char* s_GL_OES_single_precision[] =
{
"glClearDepthfOES",
"glClipPlanefOES",
"glDepthRangefOES",
"glFrustumfOES",
"glGetClipPlanefOES",
"glOrthofOES",
};
static const char* s_GL_OES_texture_cube_map[] =
{
"glGetTexGenfvOES",
"glGetTexGenivOES",
"glGetTexGenxvOES",
"glTexGenfOES",
"glTexGenfvOES",
"glTexGeniOES",
"glTexGenivOES",
"glTexGenxOES",
"glTexGenxvOES",
};
static const char* s_GL_OES_vertex_array_object[] =
{
"glBindVertexArrayOES",
"glDeleteVertexArraysOES",
"glGenVertexArraysOES",
"glIsVertexArrayOES",
};
static const char* s_GL_QCOM_driver_control[] =
{
"glDisableDriverControlQCOM",
"glEnableDriverControlQCOM",
"glGetDriverControlStringQCOM",
"glGetDriverControlsQCOM",
};
static const char* s_GL_QCOM_extended_get[] =
{
"glExtGetBufferPointervQCOM",
"glExtGetBuffersQCOM",
"glExtGetFramebuffersQCOM",
"glExtGetRenderbuffersQCOM",
"glExtGetTexLevelParameterivQCOM",
"glExtGetTexSubImageQCOM",
"glExtGetTexturesQCOM",
"glExtTexObjectStateOverrideiQCOM",
};
static const char* s_GL_QCOM_extended_get2[] =
{
"glExtGetProgramBinarySourceQCOM",
"glExtGetProgramsQCOM",
"glExtGetShadersQCOM",
"glExtIsProgramBinaryQCOM",
};
static const char* s_GL_QCOM_tiled_rendering[] =
{
"glEndTilingQCOM",
"glStartTilingQCOM",
};
static const char* s_GL_AMD_performance_monitor[] =
{
"glBeginPerfMonitorAMD",
"glDeletePerfMonitorsAMD",
"glEndPerfMonitorAMD",
"glGenPerfMonitorsAMD",
"glGetPerfMonitorCounterDataAMD",
"glGetPerfMonitorCounterInfoAMD",
"glGetPerfMonitorCounterStringAMD",
"glGetPerfMonitorCountersAMD",
"glGetPerfMonitorGroupStringAMD",
"glGetPerfMonitorGroupsAMD",
"glSelectPerfMonitorCountersAMD",
};
static const char* s_GL_ANGLE_framebuffer_blit[] =
{
"glBlitFramebufferANGLE",
};
static const char* s_GL_ANGLE_framebuffer_multisample[] =
{
"glRenderbufferStorageMultisampleANGLE",
};
static const char* s_GL_ANGLE_instanced_arrays[] =
{
"glDrawArraysInstancedANGLE",
"glDrawElementsInstancedANGLE",
"glVertexAttribDivisorANGLE",
};
static const char* s_GL_ANGLE_translated_shader_source[] =
{
"glGetTranslatedShaderSourceANGLE",
};
static const char* s_GL_EXT_base_instance[] =
{
"glDrawArraysInstancedBaseInstanceEXT",
"glDrawElementsInstancedBaseInstanceEXT",
"glDrawElementsInstancedBaseVertexBaseInstanceEXT",
};
static const char* s_GL_EXT_copy_image[] =
{
"glCopyImageSubDataEXT",
};
static const char* s_GL_EXT_debug_label[] =
{
"glGetObjectLabelEXT",
"glLabelObjectEXT",
};
static const char* s_GL_EXT_debug_marker[] =
{
"glInsertEventMarkerEXT",
"glPopGroupMarkerEXT",
"glPushGroupMarkerEXT",
};
static const char* s_GL_EXT_disjoint_timer_query[] =
{
"glBeginQueryEXT",
"glDeleteQueriesEXT",
"glEndQueryEXT",
"glGenQueriesEXT",
"glGetQueryObjecti64vEXT",
"glGetQueryObjectivEXT",
"glGetQueryObjectui64vEXT",
"glGetQueryObjectuivEXT",
"glGetQueryivEXT",
"glIsQueryEXT",
"glQueryCounterEXT",
};
static const char* s_GL_EXT_draw_buffers[] =
{
"glDrawBuffersEXT",
};
static const char* s_GL_EXT_draw_buffers_indexed[] =
{
"glBlendEquationSeparateiEXT",
"glBlendEquationiEXT",
"glBlendFuncSeparateiEXT",
"glBlendFunciEXT",
"glColorMaskiEXT",
"glDisableiEXT",
"glEnableiEXT",
"glIsEnablediEXT",
};
static const char* s_GL_EXT_draw_elements_base_vertex[] =
{
"glDrawElementsBaseVertexEXT",
"glDrawElementsInstancedBaseVertexEXT",
"glDrawRangeElementsBaseVertexEXT",
"glMultiDrawElementsBaseVertexEXT",
};
static const char* s_GL_EXT_draw_instanced[] =
{
"glDrawArraysInstancedEXT",
"glDrawElementsInstancedEXT",
};
static const char* s_GL_EXT_geometry_shader[] =
{
"glFramebufferTextureEXT",
};
static const char* s_GL_EXT_instanced_arrays[] =
{
"glDrawArraysInstancedEXT",
"glDrawElementsInstancedEXT",
"glVertexAttribDivisorEXT",
};
static const char* s_GL_EXT_multi_draw_indirect[] =
{
"glMultiDrawArraysIndirectEXT",
"glMultiDrawElementsIndirectEXT",
};
static const char* s_GL_EXT_multiview_draw_buffers[] =
{
"glDrawBuffersIndexedEXT",
"glGetIntegeri_vEXT",
"glReadBufferIndexedEXT",
};
static const char* s_GL_EXT_occlusion_query_boolean[] =
{
"glBeginQueryEXT",
"glDeleteQueriesEXT",
"glEndQueryEXT",
"glGenQueriesEXT",
"glGetQueryObjectuivEXT",
"glGetQueryivEXT",
"glIsQueryEXT",
};
static const char* s_GL_EXT_primitive_bounding_box[] =
{
"glPrimitiveBoundingBoxEXT",
};
static const char* s_GL_EXT_separate_shader_objects[] =
{
"glActiveShaderProgramEXT",
"glBindProgramPipelineEXT",
"glCreateShaderProgramvEXT",
"glDeleteProgramPipelinesEXT",
"glGenProgramPipelinesEXT",
"glGetProgramPipelineInfoLogEXT",
"glGetProgramPipelineivEXT",
"glIsProgramPipelineEXT",
"glProgramParameteriEXT",
"glProgramUniform1fEXT",
"glProgramUniform1fvEXT",
"glProgramUniform1iEXT",
"glProgramUniform1ivEXT",
"glProgramUniform1uiEXT",
"glProgramUniform1uivEXT",
"glProgramUniform2fEXT",
"glProgramUniform2fvEXT",
"glProgramUniform2iEXT",
"glProgramUniform2ivEXT",
"glProgramUniform2uiEXT",
"glProgramUniform2uivEXT",
"glProgramUniform3fEXT",
"glProgramUniform3fvEXT",
"glProgramUniform3iEXT",
"glProgramUniform3ivEXT",
"glProgramUniform3uiEXT",
"glProgramUniform3uivEXT",
"glProgramUniform4fEXT",
"glProgramUniform4fvEXT",
"glProgramUniform4iEXT",
"glProgramUniform4ivEXT",
"glProgramUniform4uiEXT",
"glProgramUniform4uivEXT",
"glProgramUniformMatrix2fvEXT",
"glProgramUniformMatrix2x3fvEXT",
"glProgramUniformMatrix2x4fvEXT",
"glProgramUniformMatrix3fvEXT",
"glProgramUniformMatrix3x2fvEXT",
"glProgramUniformMatrix3x4fvEXT",
"glProgramUniformMatrix4fvEXT",
"glProgramUniformMatrix4x2fvEXT",
"glProgramUniformMatrix4x3fvEXT",
"glUseProgramStagesEXT",
"glValidateProgramPipelineEXT",
};
static const char* s_GL_EXT_tessellation_shader[] =
{
"glPatchParameteriEXT",
};
static const char* s_GL_EXT_texture_border_clamp[] =
{
"glGetSamplerParameterIivEXT",
"glGetSamplerParameterIuivEXT",
"glGetTexParameterIivEXT",
"glGetTexParameterIuivEXT",
"glSamplerParameterIivEXT",
"glSamplerParameterIuivEXT",
"glTexParameterIivEXT",
"glTexParameterIuivEXT",
};
static const char* s_GL_EXT_texture_buffer[] =
{
"glTexBufferEXT",
"glTexBufferRangeEXT",
};
static const char* s_GL_EXT_texture_view[] =
{
"glTextureViewEXT",
};
static const char* s_GL_INTEL_performance_query[] =
{
"glBeginPerfQueryINTEL",
"glCreatePerfQueryINTEL",
"glDeletePerfQueryINTEL",
"glEndPerfQueryINTEL",
"glGetFirstPerfQueryIdINTEL",
"glGetNextPerfQueryIdINTEL",
"glGetPerfCounterInfoINTEL",
"glGetPerfQueryDataINTEL",
"glGetPerfQueryIdByNameINTEL",
"glGetPerfQueryInfoINTEL",
};
static const char* s_GL_KHR_blend_equation_advanced[] =
{
"glBlendBarrierKHR",
};
static const char* s_GL_KHR_debug[] =
{
"glDebugMessageCallbackKHR",
"glDebugMessageControlKHR",
"glDebugMessageInsertKHR",
"glGetDebugMessageLogKHR",
"glGetObjectLabelKHR",
"glGetObjectPtrLabelKHR",
"glGetPointervKHR",
"glObjectLabelKHR",
"glObjectPtrLabelKHR",
"glPopDebugGroupKHR",
"glPushDebugGroupKHR",
};
static const char* s_GL_KHR_robustness[] =
{
"glGetGraphicsResetStatusKHR",
"glGetnUniformfvKHR",
"glGetnUniformivKHR",
"glGetnUniformuivKHR",
"glReadnPixelsKHR",
};
static const char* s_GL_NV_bindless_texture[] =
{
"glGetImageHandleNV",
"glGetTextureHandleNV",
"glGetTextureSamplerHandleNV",
"glIsImageHandleResidentNV",
"glIsTextureHandleResidentNV",
"glMakeImageHandleNonResidentNV",
"glMakeImageHandleResidentNV",
"glMakeTextureHandleNonResidentNV",
"glMakeTextureHandleResidentNV",
"glProgramUniformHandleui64NV",
"glProgramUniformHandleui64vNV",
"glUniformHandleui64NV",
"glUniformHandleui64vNV",
};
static const char* s_GL_NV_blend_equation_advanced[] =
{
"glBlendBarrierNV",
"glBlendParameteriNV",
};
static const char* s_GL_NV_conditional_render[] =
{
"glBeginConditionalRenderNV",
"glEndConditionalRenderNV",
};
static const char* s_GL_NV_copy_buffer[] =
{
"glCopyBufferSubDataNV",
};
static const char* s_GL_NV_coverage_sample[] =
{
"glCoverageMaskNV",
"glCoverageOperationNV",
};
static const char* s_GL_NV_draw_buffers[] =
{
"glDrawBuffersNV",
};
static const char* s_GL_NV_draw_instanced[] =
{
"glDrawArraysInstancedNV",
"glDrawElementsInstancedNV",
};
static const char* s_GL_NV_framebuffer_blit[] =
{
"glBlitFramebufferNV",
};
static const char* s_GL_NV_framebuffer_multisample[] =
{
"glRenderbufferStorageMultisampleNV",
};
static const char* s_GL_NV_instanced_arrays[] =
{
"glVertexAttribDivisorNV",
};
static const char* s_GL_NV_internalformat_sample_query[] =
{
"glGetInternalformatSampleivNV",
};
static const char* s_GL_NV_non_square_matrices[] =
{
"glUniformMatrix2x3fvNV",
"glUniformMatrix2x4fvNV",
"glUniformMatrix3x2fvNV",
"glUniformMatrix3x4fvNV",
"glUniformMatrix4x2fvNV",
"glUniformMatrix4x3fvNV",
};
static const char* s_GL_NV_path_rendering[] =
{
"glCopyPathNV",
"glCoverFillPathInstancedNV",
"glCoverFillPathNV",
"glCoverStrokePathInstancedNV",
"glCoverStrokePathNV",
"glDeletePathsNV",
"glGenPathsNV",
"glGetPathCommandsNV",
"glGetPathCoordsNV",
"glGetPathDashArrayNV",
"glGetPathLengthNV",
"glGetPathMetricRangeNV",
"glGetPathMetricsNV",
"glGetPathParameterfvNV",
"glGetPathParameterivNV",
"glGetPathSpacingNV",
"glGetProgramResourcefvNV",
"glInterpolatePathsNV",
"glIsPathNV",
"glIsPointInFillPathNV",
"glIsPointInStrokePathNV",
"glMatrixLoad3x2fNV",
"glMatrixLoad3x3fNV",
"glMatrixLoadTranspose3x3fNV",
"glMatrixMult3x2fNV",
"glMatrixMult3x3fNV",
"glMatrixMultTranspose3x3fNV",
"glPathCommandsNV",
"glPathCoordsNV",
"glPathCoverDepthFuncNV",
"glPathDashArrayNV",
"glPathGlyphIndexArrayNV",
"glPathGlyphIndexRangeNV",
"glPathGlyphRangeNV",
"glPathGlyphsNV",
"glPathMemoryGlyphIndexArrayNV",
"glPathParameterfNV",
"glPathParameterfvNV",
"glPathParameteriNV",
"glPathParameterivNV",
"glPathStencilDepthOffsetNV",
"glPathStencilFuncNV",
"glPathStringNV",
"glPathSubCommandsNV",
"glPathSubCoordsNV",
"glPointAlongPathNV",
"glProgramPathFragmentInputGenNV",
"glStencilFillPathInstancedNV",
"glStencilFillPathNV",
"glStencilStrokePathInstancedNV",
"glStencilStrokePathNV",
"glStencilThenCoverFillPathInstancedNV",
"glStencilThenCoverFillPathNV",
"glStencilThenCoverStrokePathInstancedNV",
"glStencilThenCoverStrokePathNV",
"glTransformPathNV",
"glWeightPathsNV",
};
static const char* s_GL_NV_read_buffer[] =
{
"glReadBufferNV",
};
static const char* s_GL_NV_viewport_array[] =
{
"glDepthRangeArrayfvNV",
"glDepthRangeIndexedfNV",
"glDisableiNV",
"glEnableiNV",
"glGetFloati_vNV",
"glIsEnablediNV",
"glScissorArrayvNV",
"glScissorIndexedNV",
"glScissorIndexedvNV",
"glViewportArrayvNV",
"glViewportIndexedfNV",
"glViewportIndexedfvNV",
};
static const char* s_GL_OES_copy_image[] =
{
"glCopyImageSubDataOES",
};
static const char* s_GL_OES_draw_buffers_indexed[] =
{
"glBlendEquationSeparateiOES",
"glBlendEquationiOES",
"glBlendFuncSeparateiOES",
"glBlendFunciOES",
"glColorMaskiOES",
"glDisableiOES",
"glEnableiOES",
"glIsEnablediOES",
};
static const char* s_GL_OES_draw_elements_base_vertex[] =
{
"glDrawElementsBaseVertexOES",
"glDrawElementsInstancedBaseVertexOES",
"glDrawRangeElementsBaseVertexOES",
"glMultiDrawElementsBaseVertexOES",
};
static const char* s_GL_OES_geometry_shader[] =
{
"glFramebufferTextureOES",
};
static const char* s_GL_OES_get_program_binary[] =
{
"glGetProgramBinaryOES",
"glProgramBinaryOES",
};
static const char* s_GL_OES_primitive_bounding_box[] =
{
"glPrimitiveBoundingBoxOES",
};
static const char* s_GL_OES_sample_shading[] =
{
"glMinSampleShadingOES",
};
static const char* s_GL_OES_tessellation_shader[] =
{
"glPatchParameteriOES",
};
static const char* s_GL_OES_texture_3D[] =
{
"glCompressedTexImage3DOES",
"glCompressedTexSubImage3DOES",
"glCopyTexSubImage3DOES",
"glFramebufferTexture3DOES",
"glTexImage3DOES",
"glTexSubImage3DOES",
};
static const char* s_GL_OES_texture_border_clamp[] =
{
"glGetSamplerParameterIivOES",
"glGetSamplerParameterIuivOES",
"glGetTexParameterIivOES",
"glGetTexParameterIuivOES",
"glSamplerParameterIivOES",
"glSamplerParameterIuivOES",
"glTexParameterIivOES",
"glTexParameterIuivOES",
};
static const char* s_GL_OES_texture_buffer[] =
{
"glTexBufferOES",
"glTexBufferRangeOES",
};
static const char* s_GL_OES_texture_storage_multisample_2d_array[] =
{
"glTexStorage3DMultisampleOES",
};
static const char* s_GL_OES_texture_view[] =
{
"glTextureViewOES",
};
static const char* s_GL_QCOM_alpha_test[] =
{
"glAlphaFuncQCOM",
};
static const struct
{
const char* name;
const int numFunctions;
const char* const* functions;
} s_extensions[] =
{
{ "EGL_ANDROID_blob_cache", DE_LENGTH_OF_ARRAY(s_EGL_ANDROID_blob_cache), s_EGL_ANDROID_blob_cache },
{ "EGL_ANDROID_native_fence_sync", DE_LENGTH_OF_ARRAY(s_EGL_ANDROID_native_fence_sync), s_EGL_ANDROID_native_fence_sync },
{ "EGL_ANGLE_query_surface_pointer", DE_LENGTH_OF_ARRAY(s_EGL_ANGLE_query_surface_pointer), s_EGL_ANGLE_query_surface_pointer },
{ "EGL_EXT_device_base", DE_LENGTH_OF_ARRAY(s_EGL_EXT_device_base), s_EGL_EXT_device_base },
{ "EGL_EXT_device_enumeration", DE_LENGTH_OF_ARRAY(s_EGL_EXT_device_enumeration), s_EGL_EXT_device_enumeration },
{ "EGL_EXT_device_query", DE_LENGTH_OF_ARRAY(s_EGL_EXT_device_query), s_EGL_EXT_device_query },
{ "EGL_EXT_output_base", DE_LENGTH_OF_ARRAY(s_EGL_EXT_output_base), s_EGL_EXT_output_base },
{ "EGL_EXT_platform_base", DE_LENGTH_OF_ARRAY(s_EGL_EXT_platform_base), s_EGL_EXT_platform_base },
{ "EGL_EXT_stream_consumer_egloutput", DE_LENGTH_OF_ARRAY(s_EGL_EXT_stream_consumer_egloutput), s_EGL_EXT_stream_consumer_egloutput },
{ "EGL_EXT_swap_buffers_with_damage", DE_LENGTH_OF_ARRAY(s_EGL_EXT_swap_buffers_with_damage), s_EGL_EXT_swap_buffers_with_damage },
{ "EGL_HI_clientpixmap", DE_LENGTH_OF_ARRAY(s_EGL_HI_clientpixmap), s_EGL_HI_clientpixmap },
{ "EGL_KHR_cl_event2", DE_LENGTH_OF_ARRAY(s_EGL_KHR_cl_event2), s_EGL_KHR_cl_event2 },
{ "EGL_KHR_fence_sync", DE_LENGTH_OF_ARRAY(s_EGL_KHR_fence_sync), s_EGL_KHR_fence_sync },
{ "EGL_KHR_image", DE_LENGTH_OF_ARRAY(s_EGL_KHR_image), s_EGL_KHR_image },
{ "EGL_KHR_image_base", DE_LENGTH_OF_ARRAY(s_EGL_KHR_image_base), s_EGL_KHR_image_base },
{ "EGL_KHR_lock_surface", DE_LENGTH_OF_ARRAY(s_EGL_KHR_lock_surface), s_EGL_KHR_lock_surface },
{ "EGL_KHR_lock_surface3", DE_LENGTH_OF_ARRAY(s_EGL_KHR_lock_surface3), s_EGL_KHR_lock_surface3 },
{ "EGL_KHR_partial_update", DE_LENGTH_OF_ARRAY(s_EGL_KHR_partial_update), s_EGL_KHR_partial_update },
{ "EGL_KHR_reusable_sync", DE_LENGTH_OF_ARRAY(s_EGL_KHR_reusable_sync), s_EGL_KHR_reusable_sync },
{ "EGL_KHR_stream", DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream), s_EGL_KHR_stream },
{ "EGL_KHR_stream_consumer_gltexture", DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream_consumer_gltexture), s_EGL_KHR_stream_consumer_gltexture },
{ "EGL_KHR_stream_cross_process_fd", DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream_cross_process_fd), s_EGL_KHR_stream_cross_process_fd },
{ "EGL_KHR_stream_fifo", DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream_fifo), s_EGL_KHR_stream_fifo },
{ "EGL_KHR_stream_producer_eglsurface", DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream_producer_eglsurface), s_EGL_KHR_stream_producer_eglsurface },
{ "EGL_KHR_swap_buffers_with_damage", DE_LENGTH_OF_ARRAY(s_EGL_KHR_swap_buffers_with_damage), s_EGL_KHR_swap_buffers_with_damage },
{ "EGL_KHR_wait_sync", DE_LENGTH_OF_ARRAY(s_EGL_KHR_wait_sync), s_EGL_KHR_wait_sync },
{ "EGL_MESA_drm_image", DE_LENGTH_OF_ARRAY(s_EGL_MESA_drm_image), s_EGL_MESA_drm_image },
{ "EGL_MESA_image_dma_buf_export", DE_LENGTH_OF_ARRAY(s_EGL_MESA_image_dma_buf_export), s_EGL_MESA_image_dma_buf_export },
{ "EGL_NOK_swap_region", DE_LENGTH_OF_ARRAY(s_EGL_NOK_swap_region), s_EGL_NOK_swap_region },
{ "EGL_NOK_swap_region2", DE_LENGTH_OF_ARRAY(s_EGL_NOK_swap_region2), s_EGL_NOK_swap_region2 },
{ "EGL_NV_native_query", DE_LENGTH_OF_ARRAY(s_EGL_NV_native_query), s_EGL_NV_native_query },
{ "EGL_NV_post_sub_buffer", DE_LENGTH_OF_ARRAY(s_EGL_NV_post_sub_buffer), s_EGL_NV_post_sub_buffer },
{ "EGL_NV_stream_sync", DE_LENGTH_OF_ARRAY(s_EGL_NV_stream_sync), s_EGL_NV_stream_sync },
{ "EGL_NV_sync", DE_LENGTH_OF_ARRAY(s_EGL_NV_sync), s_EGL_NV_sync },
{ "EGL_NV_system_time", DE_LENGTH_OF_ARRAY(s_EGL_NV_system_time), s_EGL_NV_system_time },
{ "GL_APPLE_copy_texture_levels", DE_LENGTH_OF_ARRAY(s_GL_APPLE_copy_texture_levels), s_GL_APPLE_copy_texture_levels },
{ "GL_APPLE_framebuffer_multisample", DE_LENGTH_OF_ARRAY(s_GL_APPLE_framebuffer_multisample), s_GL_APPLE_framebuffer_multisample },
{ "GL_APPLE_sync", DE_LENGTH_OF_ARRAY(s_GL_APPLE_sync), s_GL_APPLE_sync },
{ "GL_EXT_discard_framebuffer", DE_LENGTH_OF_ARRAY(s_GL_EXT_discard_framebuffer), s_GL_EXT_discard_framebuffer },
{ "GL_EXT_map_buffer_range", DE_LENGTH_OF_ARRAY(s_GL_EXT_map_buffer_range), s_GL_EXT_map_buffer_range },
{ "GL_EXT_multi_draw_arrays", DE_LENGTH_OF_ARRAY(s_GL_EXT_multi_draw_arrays), s_GL_EXT_multi_draw_arrays },
{ "GL_EXT_multisampled_render_to_texture", DE_LENGTH_OF_ARRAY(s_GL_EXT_multisampled_render_to_texture), s_GL_EXT_multisampled_render_to_texture },
{ "GL_EXT_robustness", DE_LENGTH_OF_ARRAY(s_GL_EXT_robustness), s_GL_EXT_robustness },
{ "GL_EXT_texture_storage", DE_LENGTH_OF_ARRAY(s_GL_EXT_texture_storage), s_GL_EXT_texture_storage },
{ "GL_IMG_multisampled_render_to_texture", DE_LENGTH_OF_ARRAY(s_GL_IMG_multisampled_render_to_texture), s_GL_IMG_multisampled_render_to_texture },
{ "GL_IMG_user_clip_plane", DE_LENGTH_OF_ARRAY(s_GL_IMG_user_clip_plane), s_GL_IMG_user_clip_plane },
{ "GL_NV_fence", DE_LENGTH_OF_ARRAY(s_GL_NV_fence), s_GL_NV_fence },
{ "GL_OES_EGL_image", DE_LENGTH_OF_ARRAY(s_GL_OES_EGL_image), s_GL_OES_EGL_image },
{ "GL_OES_blend_equation_separate", DE_LENGTH_OF_ARRAY(s_GL_OES_blend_equation_separate), s_GL_OES_blend_equation_separate },
{ "GL_OES_blend_func_separate", DE_LENGTH_OF_ARRAY(s_GL_OES_blend_func_separate), s_GL_OES_blend_func_separate },
{ "GL_OES_blend_subtract", DE_LENGTH_OF_ARRAY(s_GL_OES_blend_subtract), s_GL_OES_blend_subtract },
{ "GL_OES_draw_texture", DE_LENGTH_OF_ARRAY(s_GL_OES_draw_texture), s_GL_OES_draw_texture },
{ "GL_OES_fixed_point", DE_LENGTH_OF_ARRAY(s_GL_OES_fixed_point), s_GL_OES_fixed_point },
{ "GL_OES_framebuffer_object", DE_LENGTH_OF_ARRAY(s_GL_OES_framebuffer_object), s_GL_OES_framebuffer_object },
{ "GL_OES_mapbuffer", DE_LENGTH_OF_ARRAY(s_GL_OES_mapbuffer), s_GL_OES_mapbuffer },
{ "GL_OES_matrix_palette", DE_LENGTH_OF_ARRAY(s_GL_OES_matrix_palette), s_GL_OES_matrix_palette },
{ "GL_OES_point_size_array", DE_LENGTH_OF_ARRAY(s_GL_OES_point_size_array), s_GL_OES_point_size_array },
{ "GL_OES_query_matrix", DE_LENGTH_OF_ARRAY(s_GL_OES_query_matrix), s_GL_OES_query_matrix },
{ "GL_OES_single_precision", DE_LENGTH_OF_ARRAY(s_GL_OES_single_precision), s_GL_OES_single_precision },
{ "GL_OES_texture_cube_map", DE_LENGTH_OF_ARRAY(s_GL_OES_texture_cube_map), s_GL_OES_texture_cube_map },
{ "GL_OES_vertex_array_object", DE_LENGTH_OF_ARRAY(s_GL_OES_vertex_array_object), s_GL_OES_vertex_array_object },
{ "GL_QCOM_driver_control", DE_LENGTH_OF_ARRAY(s_GL_QCOM_driver_control), s_GL_QCOM_driver_control },
{ "GL_QCOM_extended_get", DE_LENGTH_OF_ARRAY(s_GL_QCOM_extended_get), s_GL_QCOM_extended_get },
{ "GL_QCOM_extended_get2", DE_LENGTH_OF_ARRAY(s_GL_QCOM_extended_get2), s_GL_QCOM_extended_get2 },
{ "GL_QCOM_tiled_rendering", DE_LENGTH_OF_ARRAY(s_GL_QCOM_tiled_rendering), s_GL_QCOM_tiled_rendering },
{ "GL_AMD_performance_monitor", DE_LENGTH_OF_ARRAY(s_GL_AMD_performance_monitor), s_GL_AMD_performance_monitor },
{ "GL_ANGLE_framebuffer_blit", DE_LENGTH_OF_ARRAY(s_GL_ANGLE_framebuffer_blit), s_GL_ANGLE_framebuffer_blit },
{ "GL_ANGLE_framebuffer_multisample", DE_LENGTH_OF_ARRAY(s_GL_ANGLE_framebuffer_multisample), s_GL_ANGLE_framebuffer_multisample },
{ "GL_ANGLE_instanced_arrays", DE_LENGTH_OF_ARRAY(s_GL_ANGLE_instanced_arrays), s_GL_ANGLE_instanced_arrays },
{ "GL_ANGLE_translated_shader_source", DE_LENGTH_OF_ARRAY(s_GL_ANGLE_translated_shader_source), s_GL_ANGLE_translated_shader_source },
{ "GL_EXT_base_instance", DE_LENGTH_OF_ARRAY(s_GL_EXT_base_instance), s_GL_EXT_base_instance },
{ "GL_EXT_copy_image", DE_LENGTH_OF_ARRAY(s_GL_EXT_copy_image), s_GL_EXT_copy_image },
{ "GL_EXT_debug_label", DE_LENGTH_OF_ARRAY(s_GL_EXT_debug_label), s_GL_EXT_debug_label },
{ "GL_EXT_debug_marker", DE_LENGTH_OF_ARRAY(s_GL_EXT_debug_marker), s_GL_EXT_debug_marker },
{ "GL_EXT_disjoint_timer_query", DE_LENGTH_OF_ARRAY(s_GL_EXT_disjoint_timer_query), s_GL_EXT_disjoint_timer_query },
{ "GL_EXT_draw_buffers", DE_LENGTH_OF_ARRAY(s_GL_EXT_draw_buffers), s_GL_EXT_draw_buffers },
{ "GL_EXT_draw_buffers_indexed", DE_LENGTH_OF_ARRAY(s_GL_EXT_draw_buffers_indexed), s_GL_EXT_draw_buffers_indexed },
{ "GL_EXT_draw_elements_base_vertex", DE_LENGTH_OF_ARRAY(s_GL_EXT_draw_elements_base_vertex), s_GL_EXT_draw_elements_base_vertex },
{ "GL_EXT_draw_instanced", DE_LENGTH_OF_ARRAY(s_GL_EXT_draw_instanced), s_GL_EXT_draw_instanced },
{ "GL_EXT_geometry_shader", DE_LENGTH_OF_ARRAY(s_GL_EXT_geometry_shader), s_GL_EXT_geometry_shader },
{ "GL_EXT_instanced_arrays", DE_LENGTH_OF_ARRAY(s_GL_EXT_instanced_arrays), s_GL_EXT_instanced_arrays },
{ "GL_EXT_multi_draw_indirect", DE_LENGTH_OF_ARRAY(s_GL_EXT_multi_draw_indirect), s_GL_EXT_multi_draw_indirect },
{ "GL_EXT_multiview_draw_buffers", DE_LENGTH_OF_ARRAY(s_GL_EXT_multiview_draw_buffers), s_GL_EXT_multiview_draw_buffers },
{ "GL_EXT_occlusion_query_boolean", DE_LENGTH_OF_ARRAY(s_GL_EXT_occlusion_query_boolean), s_GL_EXT_occlusion_query_boolean },
{ "GL_EXT_primitive_bounding_box", DE_LENGTH_OF_ARRAY(s_GL_EXT_primitive_bounding_box), s_GL_EXT_primitive_bounding_box },
{ "GL_EXT_separate_shader_objects", DE_LENGTH_OF_ARRAY(s_GL_EXT_separate_shader_objects), s_GL_EXT_separate_shader_objects },
{ "GL_EXT_tessellation_shader", DE_LENGTH_OF_ARRAY(s_GL_EXT_tessellation_shader), s_GL_EXT_tessellation_shader },
{ "GL_EXT_texture_border_clamp", DE_LENGTH_OF_ARRAY(s_GL_EXT_texture_border_clamp), s_GL_EXT_texture_border_clamp },
{ "GL_EXT_texture_buffer", DE_LENGTH_OF_ARRAY(s_GL_EXT_texture_buffer), s_GL_EXT_texture_buffer },
{ "GL_EXT_texture_view", DE_LENGTH_OF_ARRAY(s_GL_EXT_texture_view), s_GL_EXT_texture_view },
{ "GL_INTEL_performance_query", DE_LENGTH_OF_ARRAY(s_GL_INTEL_performance_query), s_GL_INTEL_performance_query },
{ "GL_KHR_blend_equation_advanced", DE_LENGTH_OF_ARRAY(s_GL_KHR_blend_equation_advanced), s_GL_KHR_blend_equation_advanced },
{ "GL_KHR_debug", DE_LENGTH_OF_ARRAY(s_GL_KHR_debug), s_GL_KHR_debug },
{ "GL_KHR_robustness", DE_LENGTH_OF_ARRAY(s_GL_KHR_robustness), s_GL_KHR_robustness },
{ "GL_NV_bindless_texture", DE_LENGTH_OF_ARRAY(s_GL_NV_bindless_texture), s_GL_NV_bindless_texture },
{ "GL_NV_blend_equation_advanced", DE_LENGTH_OF_ARRAY(s_GL_NV_blend_equation_advanced), s_GL_NV_blend_equation_advanced },
{ "GL_NV_conditional_render", DE_LENGTH_OF_ARRAY(s_GL_NV_conditional_render), s_GL_NV_conditional_render },
{ "GL_NV_copy_buffer", DE_LENGTH_OF_ARRAY(s_GL_NV_copy_buffer), s_GL_NV_copy_buffer },
{ "GL_NV_coverage_sample", DE_LENGTH_OF_ARRAY(s_GL_NV_coverage_sample), s_GL_NV_coverage_sample },
{ "GL_NV_draw_buffers", DE_LENGTH_OF_ARRAY(s_GL_NV_draw_buffers), s_GL_NV_draw_buffers },
{ "GL_NV_draw_instanced", DE_LENGTH_OF_ARRAY(s_GL_NV_draw_instanced), s_GL_NV_draw_instanced },
{ "GL_NV_framebuffer_blit", DE_LENGTH_OF_ARRAY(s_GL_NV_framebuffer_blit), s_GL_NV_framebuffer_blit },
{ "GL_NV_framebuffer_multisample", DE_LENGTH_OF_ARRAY(s_GL_NV_framebuffer_multisample), s_GL_NV_framebuffer_multisample },
{ "GL_NV_instanced_arrays", DE_LENGTH_OF_ARRAY(s_GL_NV_instanced_arrays), s_GL_NV_instanced_arrays },
{ "GL_NV_internalformat_sample_query", DE_LENGTH_OF_ARRAY(s_GL_NV_internalformat_sample_query), s_GL_NV_internalformat_sample_query },
{ "GL_NV_non_square_matrices", DE_LENGTH_OF_ARRAY(s_GL_NV_non_square_matrices), s_GL_NV_non_square_matrices },
{ "GL_NV_path_rendering", DE_LENGTH_OF_ARRAY(s_GL_NV_path_rendering), s_GL_NV_path_rendering },
{ "GL_NV_read_buffer", DE_LENGTH_OF_ARRAY(s_GL_NV_read_buffer), s_GL_NV_read_buffer },
{ "GL_NV_viewport_array", DE_LENGTH_OF_ARRAY(s_GL_NV_viewport_array), s_GL_NV_viewport_array },
{ "GL_OES_copy_image", DE_LENGTH_OF_ARRAY(s_GL_OES_copy_image), s_GL_OES_copy_image },
{ "GL_OES_draw_buffers_indexed", DE_LENGTH_OF_ARRAY(s_GL_OES_draw_buffers_indexed), s_GL_OES_draw_buffers_indexed },
{ "GL_OES_draw_elements_base_vertex", DE_LENGTH_OF_ARRAY(s_GL_OES_draw_elements_base_vertex), s_GL_OES_draw_elements_base_vertex },
{ "GL_OES_geometry_shader", DE_LENGTH_OF_ARRAY(s_GL_OES_geometry_shader), s_GL_OES_geometry_shader },
{ "GL_OES_get_program_binary", DE_LENGTH_OF_ARRAY(s_GL_OES_get_program_binary), s_GL_OES_get_program_binary },
{ "GL_OES_primitive_bounding_box", DE_LENGTH_OF_ARRAY(s_GL_OES_primitive_bounding_box), s_GL_OES_primitive_bounding_box },
{ "GL_OES_sample_shading", DE_LENGTH_OF_ARRAY(s_GL_OES_sample_shading), s_GL_OES_sample_shading },
{ "GL_OES_tessellation_shader", DE_LENGTH_OF_ARRAY(s_GL_OES_tessellation_shader), s_GL_OES_tessellation_shader },
{ "GL_OES_texture_3D", DE_LENGTH_OF_ARRAY(s_GL_OES_texture_3D), s_GL_OES_texture_3D },
{ "GL_OES_texture_border_clamp", DE_LENGTH_OF_ARRAY(s_GL_OES_texture_border_clamp), s_GL_OES_texture_border_clamp },
{ "GL_OES_texture_buffer", DE_LENGTH_OF_ARRAY(s_GL_OES_texture_buffer), s_GL_OES_texture_buffer },
{ "GL_OES_texture_storage_multisample_2d_array", DE_LENGTH_OF_ARRAY(s_GL_OES_texture_storage_multisample_2d_array), s_GL_OES_texture_storage_multisample_2d_array },
{ "GL_OES_texture_view", DE_LENGTH_OF_ARRAY(s_GL_OES_texture_view), s_GL_OES_texture_view },
{ "GL_QCOM_alpha_test", DE_LENGTH_OF_ARRAY(s_GL_QCOM_alpha_test), s_GL_QCOM_alpha_test },
};
| [
"zeno.albisser@hemispherian.com"
] | zeno.albisser@hemispherian.com |
d01b8ed641f144270800cf8b59ea96324e3cb0f9 | 62bf789f19f500aa5aa20f6911573cc0c59902c7 | /cloudapi/src/model/ResetAppSecretResult.cc | 8d9746e0747c2d27c85261b49d36ae4300ecfa50 | [
"Apache-2.0"
] | permissive | liuyuhua1984/aliyun-openapi-cpp-sdk | 0288f0241812e4308975a62a23fdef2403cfd13a | 600883d23a243eb204e39f15505f1f976df57929 | refs/heads/master | 2020-07-04T09:47:49.901987 | 2019-08-13T14:13:11 | 2019-08-13T14:13:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,264 | cc | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/cloudapi/model/ResetAppSecretResult.h>
#include <json/json.h>
using namespace AlibabaCloud::CloudAPI;
using namespace AlibabaCloud::CloudAPI::Model;
ResetAppSecretResult::ResetAppSecretResult() :
ServiceResult()
{}
ResetAppSecretResult::ResetAppSecretResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ResetAppSecretResult::~ResetAppSecretResult()
{}
void ResetAppSecretResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
6e25190095a307efc6db30fa29b874b7ab2078bd | c1572e539b8f79535ebf2dada418012c2cc06869 | /printplugin/dllmain.cpp | c052db9d73cdd8916c8550e46678740e4d61aa6f | [] | no_license | gq5154/Unity_pc_printer_plugin | 4bacaee682608e31fa60b35fa7c010a6bf9fe4c0 | c41441b305515a1cf7449b2ebcc958539875f5d5 | refs/heads/master | 2023-01-13T22:08:45.624046 | 2020-11-05T15:06:52 | 2020-11-05T15:06:52 | 310,333,884 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 18,270 | cpp |
#include <windows.h>
#define memAlloc(size) HeapAlloc(memHeap,HEAP_ZERO_MEMORY,size)
#define memFree(blk) HeapFree(memHeap,0,blk)
#define memSize(blk) HeapSize(memHeap,0,blk)
HANDLE memHeap;
HANDLE printHandle;
HWND MainWindow;
LPDEVMODE dOut;
LONG wOut;
HDC DC;
HDC MemDC;
int xRes;
int yRes;
int xPix;
int yPix;
int xOff;
int yOff;
int xMil;
int yMil;
HFONT ofont;
HFONT ufont;
HPEN open;
HPEN upen;
TCHAR name[130];
BOOL memStart(void) {
ULONG lfh;
memHeap = HeapCreate(0, 0, 0);
lfh = 2;
HeapSetInformation(memHeap, HeapCompatibilityInformation, &lfh, sizeof(ULONG));
return memHeap!=0;
}
void memStop(void) {
HeapDestroy(memHeap);
}
LRESULT CALLBACK MainWindowProcess(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) {
return DefWindowProc(wnd, msg, wParam, lParam);
}
void CreateMainWindow(HINSTANCE instance) {
WNDCLASSA w;
w.style = 0;
w.lpfnWndProc = DefWindowProc;
w.cbClsExtra = 0;
w.cbWndExtra = 0;
w.hInstance = instance;
w.hIcon = 0;
w.hCursor = 0;
w.hbrBackground = 0;
w.lpszClassName = "UnityPrintPlugIn";
w.lpszMenuName = 0;
RegisterClassA(&w);
MainWindow = CreateWindowA("UnityPrintPlugIn", 0, 0, 0, 0, 0, 0, 0, 0, instance, 0);
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved){
switch (ul_reason_for_call){
case DLL_PROCESS_ATTACH:
memStart();
CreateMainWindow(hModule);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
memStop();
break;
}
return TRUE;
}
extern "C" {
__declspec(dllexport) void SetPrinterName(LPCWSTR prn) {
lstrcpy(name,prn);
}
__declspec(dllexport) BOOL StartPrinter(LPCSTR title,int or,int width,int height) {
DOCINFOA di;
bool defprn = true;
if (name[0] != 0) {
DWORD sa, rb;
LPPRINTER_INFO_1 pr;
EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, 0, 1, 0, 0, &sa, &rb);
pr = (LPPRINTER_INFO_1)malloc(sa);
if (pr == 0) {
defprn = true;
} else {
EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, 0, 1, (LPBYTE)pr, sa, &sa, &rb);
bool rv = false;
for (DWORD i = 0; i < rb; i++) {
if (lstrcmpi(name, pr[i].pName) == 0) {
defprn = false;
break;
}
}
free(pr);
}
}
if (defprn) {
DWORD lname = 128;
GetDefaultPrinter(name, &lname);
}
ofont = 0;
ufont = 0;
open = 0;
upen = 0;
if (OpenPrinter(name, &printHandle, NULL)) {
wOut = DocumentProperties(MainWindow, printHandle, name, 0, 0, 0);
dOut = (LPDEVMODE)memAlloc(wOut);
if (dOut) {
if (DocumentProperties(MainWindow, printHandle, name, dOut, 0, DM_OUT_BUFFER) != 0) {
dOut->dmPaperSize = 0;
// dOut->dmFields = DM_PAPERSIZE;
if (width != 0) {
dOut->dmPaperWidth = width;
// dOut->dmFields |= DM_PAPERWIDTH;
}
if(height!=0){
dOut->dmPaperLength = height;
// dOut->dmFields |= DM_PAPERLENGTH;
}
if (or!=0) {
if (or==1) {
dOut->dmOrientation = DMORIENT_PORTRAIT;
}
else {
dOut->dmOrientation = DMORIENT_LANDSCAPE;
}
// dOut->dmFields |= DM_ORIENTATION;
}
DocumentProperties(MainWindow, printHandle, name, dOut, dOut, DM_IN_BUFFER | DM_OUT_BUFFER);
DC = CreateDC(L"WINSPOOL", name, 0, dOut);
if (!GetDeviceCaps(DC, RASTERCAPS & RC_BITBLT)) {
memFree(dOut);
DeleteDC(DC);
ClosePrinter(printHandle);
return FALSE;
}
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = title;
di.lpszOutput = 0;
di.lpszDatatype = 0;
di.fwType = 0;
if (StartDocA(DC, &di) == SP_ERROR) {
memFree(dOut);
DeleteDC(DC);
ClosePrinter(printHandle);
return FALSE;
}
xRes = GetDeviceCaps(DC, HORZRES);
yRes = GetDeviceCaps(DC, VERTRES);
xPix = GetDeviceCaps(DC, PHYSICALWIDTH);
yPix = GetDeviceCaps(DC, PHYSICALHEIGHT);
xOff = GetDeviceCaps(DC, PHYSICALOFFSETX);
yOff = GetDeviceCaps(DC, PHYSICALOFFSETY);
xMil = GetDeviceCaps(DC, HORZSIZE);
yMil = GetDeviceCaps(DC, VERTSIZE);
MemDC = CreateCompatibleDC(DC);
if (StartPage(DC)>0) return TRUE;
return FALSE;
}
}
}
return FALSE;
}
void PrepareGraphics() {
HDC HdnDC = CreateDC(L"DISPLAY", 0, 0, 0);
if (HdnDC) {
MemDC = CreateCompatibleDC(HdnDC);
DeleteDC(HdnDC);
} else {
MemDC = 0;
}
}
__declspec(dllexport) int GetPrinterNames(int size,wchar_t *names) {
DWORD sa, rb;
LPPRINTER_INFO_1 pr;
EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, 0, 1, 0, 0, &sa, &rb);
int err = GetLastError();
if(err!=0 && err!=122){
return -err;
}
pr = (LPPRINTER_INFO_1) malloc(sa);
if (pr == 0) {
return -2;
}
EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, 0, 1, (LPBYTE) pr, sa, &sa, &rb);
err = GetLastError();
if (err != 0) {
return -err;
}
DWORD ct = 0;
if (names != NULL) {
for (DWORD i = 0; i < rb; i++) {
lstrcpy(names + ct, pr[i].pName);
ct += lstrlen(pr[i].pName);
names[ct++] = '\r';
}
ct++;
} else {
for (DWORD i = 0; i < rb; i++) {
ct += (lstrlen(pr[i].pName) + 1);
}
ct++;
}
free(pr);
return ct * sizeof(wchar_t);
}
_declspec(dllexport) bool IsPrinterName(LPWSTR name) {
DWORD sa, rb;
LPPRINTER_INFO_1 pr;
EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, 0, 1, 0, 0, &sa, &rb);
pr = (LPPRINTER_INFO_1)malloc(sa);
if (pr == 0) {
return false;
}
EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, 0, 1, (LPBYTE)pr, sa, &sa, &rb);
bool rv = false;
for (DWORD i = 0; i < rb;i++) {
if (lstrcmpi(name, pr[i].pName) == 0) {
rv = true;
break;
}
}
free(pr);
return rv;
}
__declspec(dllexport) void StopPrinter() {
if(ofont) SelectObject(DC, ofont);
if(ufont) DeleteObject(ufont);
if(open) SelectObject(DC, open);
if(upen) DeleteObject(upen);
memFree(dOut);
if (EndPage(DC) > 0) EndDoc(DC);
DeleteDC(DC);
ClosePrinter(printHandle);
}
__declspec(dllexport) void PrinterNewPage() {
EndPage(DC);
StartPage(DC);
}
__declspec(dllexport) int PaperWidth() {
return xRes;
}
__declspec(dllexport) int PaperHeight() {
return yRes;
}
__declspec(dllexport) void PrintText(wchar_t *text, int x, int y) {
RECT rect;
rect.left = x;
rect.top = y;
rect.right = x;
rect.bottom = y;
int count = lstrlen(text);
DrawText(DC, text, count, &rect, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT);
DrawText(DC, text, count, &rect, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX);
}
__declspec(dllexport) int PrintTextWidth(wchar_t *text) {
RECT rect;
rect.left = 0;
rect.top = 0;
rect.right = 0;
rect.bottom = 0;
int count = lstrlen(text);
DrawText(DC, text, count, &rect, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT);
return rect.right;
}
__declspec(dllexport) int PrintTextHeight(wchar_t *text) {
RECT rect;
rect.left = 0;
rect.top = 0;
rect.right = 0;
rect.bottom = 0;
int count = lstrlen(text);
DrawText(DC, text, count, &rect, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT);
return rect.bottom;
}
__declspec(dllexport) void PrintDrawText(int x,int y,int cx,int cy,int align, wchar_t *txt) {
TEXTMETRIC tm;
RECT r, c;
int sl, fm, ln, ly, fx, xs, mw, dw, mi;
r.top = y;
r.left = x;
r.bottom = cy;
r.right = cx;
sl = (WORD) lstrlen(txt);
switch (align) {
case 0:
fm = DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_NOPREFIX;
break;
case 1:
fm = DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_NOPREFIX;
break;
case 2:
fm = DT_SINGLELINE | DT_RIGHT | DT_VCENTER | DT_NOPREFIX;
break;
case 3:
fm = DT_LEFT | DT_NOPREFIX | DT_WORDBREAK | DT_EXPANDTABS;
ln = (WORD)(cx - x);
ly = (WORD)(cy - y);
c.left = 0;
c.top = 0;
c.right = ln;
c.bottom = 0;
DrawText(DC, txt, sl, &c, fm | DT_CALCRECT);
if (ly>c.bottom) r.top += (ly - c.bottom) / 2;
break;
case 4:
fm = DT_CENTER | DT_NOPREFIX | DT_WORDBREAK | DT_EXPANDTABS;
ln = (WORD)(cx - x);
ly = (WORD)(cy - y);
c.left = 0;
c.top = 0;
c.right = ln;
c.bottom = 0;
DrawText(DC, txt, sl, &c, fm | DT_CALCRECT);
if (ly>c.bottom) r.top += (ly - c.bottom) / 2;
break;
case 5:
fm = DT_RIGHT | DT_NOPREFIX | DT_WORDBREAK | DT_EXPANDTABS;
ln = (WORD)(cx - x);
ly = (WORD)(cy - y);
c.left = 0;
c.top = 0;
c.right = ln;
c.bottom = 0;
DrawText(DC, txt, sl, &c, fm | DT_CALCRECT);
if (ly>c.bottom) r.top += (ly - c.bottom) / 2;
break;
case 6:
fx = (WORD)(cx - x);
c.left = 0;
c.top = 0;
c.right = fx;
c.bottom = 0;
DrawText(DC, txt, sl, &c, DT_CENTER | DT_NOPREFIX | DT_WORDBREAK | DT_CALCRECT);
if (c.right>fx) {
xs = 0;
} else {
mw = (WORD)(fx - fx / 4);
if (c.right<mw) {
dw = (WORD)(mw - c.right);
mw = (WORD)c.right;
c.right = fx;
SetTextCharacterExtra(DC, 1);
DrawText(DC, txt, sl, &c, DT_CENTER | DT_NOPREFIX | DT_WORDBREAK | DT_CALCRECT);
SetTextCharacterExtra(DC, 0);
if (c.right>mw) {
mw = (WORD)(dw / (c.right - mw));
}
GetTextMetrics(DC, &tm);
mi = (WORD)(tm.tmAveCharWidth*3);
if (mw>mi) {
xs = mi;
}
else {
xs = mw;
}
}
else {
xs = 0;
}
}
ly = (WORD)(cy - y);
if (ly>c.bottom) r.top += (ly - c.bottom) / 2;
SetTextCharacterExtra(DC, xs);
DrawText(DC, txt, sl, &r, DT_VCENTER | DT_CENTER | DT_NOPREFIX | DT_WORDBREAK);
SetTextCharacterExtra(DC, 0);
return;
default:
fm = DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_NOPREFIX;
break;
}
DrawText(DC, txt, sl, &r, fm);
}
__declspec(dllexport) void SetPrinterFont(LPCSTR name, int sz,int wg,bool it) {
int hs = sz * 33 / 16;
int hw = hs * 10 / 27;
if (ofont) {
SelectObject(DC, ofont);
ofont = 0;
}
if (ufont) {
DeleteObject(ufont);
}
switch (wg) {
case 1:
wg = FW_BOLD;
break;
case 2:
wg = FW_BLACK;
break;
case 3:
wg = FW_EXTRABOLD;
break;
case 4:
wg = FW_EXTRALIGHT;
break;
case 5:
wg = FW_HEAVY;
break;
default:
wg = FW_NORMAL;
break;
}
if(ufont) DeleteObject(ufont);
ufont = CreateFontA(hs, hw, 0, 0,wg, it, 0, 0, 0, 0, 0, 0, 0, name);
if(ofont){
SelectObject(DC, ufont);
}else{
ofont = (HFONT)SelectObject(DC, ufont);
}
}
__declspec(dllexport) bool SetPrinterOrientation(int or) {
if (or==1) {
dOut->dmOrientation = DMORIENT_PORTRAIT;
}else {
dOut->dmOrientation = DMORIENT_LANDSCAPE;
}
// dOut->dmFields |= DM_ORIENTATION;
if(ResetDC(DC, dOut) != 0) {
xRes = GetDeviceCaps(DC, HORZRES);
yRes = GetDeviceCaps(DC, VERTRES);
return TRUE;
}
return FALSE;
}
__declspec(dllexport) void CreatePrinterPen(int s,int w,int r,int g,int b) {
int style;
switch (s) {
case 1:
style = PS_DASH;
break;
case 2:
style = PS_DOT;
break;
case 3:
style = PS_DASHDOT;
break;
default:
style = PS_SOLID;
break;
}
if (upen) DeleteObject(upen);
upen = CreatePen(style, w,RGB(r,g,b));
if (open) {
SelectObject(DC, upen);
}else{
open = (HPEN)SelectObject(DC, upen);
}
}
__declspec(dllexport) void PrintMoveTo(int x, int y) {
MoveToEx(DC, x, y, 0);
}
__declspec(dllexport) void PrintLineTo(int x, int y) {
LineTo(DC, x, y);
}
__declspec(dllexport) void PrintDrawRect(int x1, int y1, int x2, int y2) {
MoveToEx(DC, x1, y1, 0);
LineTo(DC, x2, y1);
LineTo(DC, x2, y2);
LineTo(DC, x1, y2);
LineTo(DC, x1, y1);
// This may seem useless, however it avoids round corners when pens are 2 o more pixels wide.
MoveToEx(DC, x2, y1, 0);
LineTo(DC, x1, y1);
LineTo(DC, x1, y2);
}
__declspec(dllexport) void PrintDrawLine(int x1, int y1,int x2, int y2) {
MoveToEx(DC, x1, y1, 0);
LineTo(DC, x2, y2);
}
__declspec(dllexport) void PrintFillRect(int x, int y, int cx, int cy, int r,int g,int b) {
RECT rect;
HBRUSH br;
rect.left = x;
rect.top = y;
rect.right = cx;
rect.bottom = cy;
br = CreateSolidBrush(RGB(r,g,b));
FillRect(DC, &rect, br);
DeleteObject(br);
}
__declspec(dllexport) int PrintBitmap(int x, int y, int cx, int cy, byte* binfo, bool adj, int rop) {
BITMAP bmi;
WORD dx, dy, tx, ty, px, py;
// HDC dc;
LPBITMAPFILEHEADER bmf;
LPBITMAPINFOHEADER bih;
HBITMAP bmp;
bmf = (LPBITMAPFILEHEADER) binfo;
bih = (LPBITMAPINFOHEADER)(bmf + 1);
// dc = CreateDC(L"DISPLAY", 0, 0, 0);
// if (dc) {
bmp = CreateDIBitmap(DC, bih, CBM_INIT, (LPSTR)bmf + bmf->bfOffBits, (LPBITMAPINFO)bih, DIB_RGB_COLORS);
if (bmp == 0) {
return GetLastError();
}
/* DeleteDC(dc);
} else {
return GetLastError();
}*/
switch (rop) {
case 1:
rop = SRCAND;
break;
case 2:
rop = SRCPAINT;
break;
default:
rop = SRCCOPY;
break;
}
GetObject(bmp, sizeof(BITMAP), &bmi);
SelectObject(DC, bmp);
if (adj) {
if (bmi.bmWidth>0 && bmi.bmHeight>0) {
dx = (WORD)((cx * 100) / bmi.bmWidth);
dy = (WORD)((cy * 100) / bmi.bmHeight);
dx = (WORD)(dx<dy ? dx : dy);
tx = (WORD)((bmi.bmWidth*dx) / 100);
ty = (WORD)((bmi.bmHeight*dx) / 100);
px = (WORD)(x + ((cx - tx) / 2));
py = (WORD)(y + ((cy - ty) / 2));
StretchBlt(DC, px, py, tx, ty, DC, 0, 0, bmi.bmWidth, bmi.bmHeight, rop);
} else {
return -2;
}
} else {
StretchBlt(DC, x, y, cx, cy, DC, 0, 0, bmi.bmWidth, bmi.bmHeight, rop);
}
return GetLastError();
}
__declspec(dllexport) int PrintLoadBitmap(int x, int y, int cx, int cy, wchar_t *name, bool adj, DWORD rop) {
BITMAP bmi;
WORD dx, dy, tx, ty, px, py;
LPBITMAPFILEHEADER bmf;
LPBITMAPINFOHEADER bih;
HBITMAP bmp;
DWORD rb;
HDC dc;
HDC mdc;
switch (rop) {
case 1:
rop = SRCAND;
break;
case 2:
rop = SRCPAINT;
break;
default:
rop = SRCCOPY;
break;
}
bmp = (HBITMAP) LoadImage(0, name, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE);
if (bmp == 0) {
return GetLastError();
}
GetObject(bmp, sizeof(BITMAP), &bmi);
HBITMAP obmp = (HBITMAP) SelectObject(MemDC, bmp);
if (adj) {
if (bmi.bmWidth>0 && bmi.bmHeight>0) {
dx = (WORD)((cx * 100) / bmi.bmWidth);
dy = (WORD)((cy * 100) / bmi.bmHeight);
dx = (WORD)(dx<dy ? dx : dy);
tx = (WORD)((bmi.bmWidth*dx) / 100);
ty = (WORD)((bmi.bmHeight*dx) / 100);
px = (WORD)(x + ((cx - tx) / 2));
py = (WORD)(y + ((cy - ty) / 2));
if (!StretchBlt(DC, px, py, tx, ty, MemDC, 0, 0, bmi.bmWidth, bmi.bmHeight, rop)) {
return GetLastError();
}
}else{
return -2;
}
} else {
if (!StretchBlt(DC, x, y, cx, cy,MemDC, 0, 0, bmi.bmWidth, bmi.bmHeight, rop)) {
return GetLastError();
}
}
SelectObject(MemDC, obmp);
return GetLastError();
}
} | [
"44678926+gq5154@users.noreply.github.com"
] | 44678926+gq5154@users.noreply.github.com |
b21a6596b095a1c92cef18fffbec6cdfa727fcf5 | 8044ffbf432ba844a16eff60b122a9346bd2f12e | /source/modules/distrho/DistrhoUtils.hpp | 874ec41e27bf85a021a922e10358adcd42f2b5aa | [] | no_license | DanielAeolusLaude/Carla | 0c1fbfa9ccaecfaef58157be0a7cf0ee21f80b54 | 71b9d0cbc497506d1b91f42799e0d233e5f883a4 | refs/heads/master | 2021-01-16T20:06:22.694983 | 2015-09-18T09:58:27 | 2015-09-18T09:58:27 | 42,896,375 | 2 | 0 | null | 2015-09-21T22:07:31 | 2015-09-21T22:07:31 | null | UTF-8 | C++ | false | false | 5,802 | hpp | /*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
* permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
* TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef DISTRHO_UTILS_HPP_INCLUDED
#define DISTRHO_UTILS_HPP_INCLUDED
#include "src/DistrhoDefines.h"
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <limits>
#ifdef DISTRHO_PROPER_CPP11_SUPPORT
# include <cstdint>
#else
# include <stdint.h>
#endif
#if defined(DISTRHO_OS_MAC) && ! defined(CARLA_OS_MAC)
namespace std {
inline float fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); }
inline float fmax(float __x, float __y)
{ return __builtin_fmaxf(__x, __y); }
inline float rint(float __x)
{ return __builtin_rintf(__x); }
inline float round(float __x)
{ return __builtin_roundf(__x); }
}
#endif
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
// -----------------------------------------------------------------------
// misc functions
/*
* Return a 64-bit number from 4 8-bit numbers.
*/
static inline
int64_t d_cconst(const uint8_t a, const uint8_t b, const uint8_t c, const uint8_t d) noexcept
{
return (a << 24) | (b << 16) | (c << 8) | (d << 0);
}
/*
* Dummy function.
*/
static inline
void d_pass() noexcept {}
// -----------------------------------------------------------------------
// string print functions
/*
* Print a string to stdout with newline (gray color).
* Does nothing if DEBUG is not defined.
*/
#ifndef DEBUG
# define d_debug(...)
#else
static inline
void d_debug(const char* const fmt, ...) noexcept
{
try {
::va_list args;
::va_start(args, fmt);
std::fprintf(stdout, "\x1b[30;1m");
std::vfprintf(stdout, fmt, args);
std::fprintf(stdout, "\x1b[0m\n");
::va_end(args);
} catch (...) {}
}
#endif
/*
* Print a string to stdout with newline.
*/
static inline
void d_stdout(const char* const fmt, ...) noexcept
{
try {
::va_list args;
::va_start(args, fmt);
std::vfprintf(stdout, fmt, args);
std::fprintf(stdout, "\n");
::va_end(args);
} catch (...) {}
}
/*
* Print a string to stderr with newline.
*/
static inline
void d_stderr(const char* const fmt, ...) noexcept
{
try {
::va_list args;
::va_start(args, fmt);
std::vfprintf(stderr, fmt, args);
std::fprintf(stderr, "\n");
::va_end(args);
} catch (...) {}
}
/*
* Print a string to stderr with newline (red color).
*/
static inline
void d_stderr2(const char* const fmt, ...) noexcept
{
try {
::va_list args;
::va_start(args, fmt);
std::fprintf(stderr, "\x1b[31m");
std::vfprintf(stderr, fmt, args);
std::fprintf(stderr, "\x1b[0m\n");
::va_end(args);
} catch (...) {}
}
/*
* Print a safe assertion error message.
*/
static inline
void d_safe_assert(const char* const assertion, const char* const file, const int line) noexcept
{
d_stderr2("assertion failure: \"%s\" in file %s, line %i", assertion, file, line);
}
/*
* Print a safe exception error message.
*/
static inline
void d_safe_exception(const char* const exception, const char* const file, const int line) noexcept
{
d_stderr2("exception caught: \"%s\" in file %s, line %i", exception, file, line);
}
// -----------------------------------------------------------------------
// math functions
/*
* Safely compare two floating point numbers.
* Returns true if they match.
*/
template<typename T>
static inline
bool d_isEqual(const T& v1, const T& v2)
{
return std::abs(v1-v2) < std::numeric_limits<T>::epsilon();
}
/*
* Safely compare two floating point numbers.
* Returns true if they don't match.
*/
template<typename T>
static inline
bool d_isNotEqual(const T& v1, const T& v2)
{
return std::abs(v1-v2) >= std::numeric_limits<T>::epsilon();
}
/*
* Safely check if a floating point number is zero.
*/
template<typename T>
static inline
bool d_isZero(const T& value)
{
return std::abs(value) < std::numeric_limits<T>::epsilon();
}
/*
* Safely check if a floating point number is not zero.
*/
template<typename T>
static inline
bool d_isNotZero(const T& value)
{
return std::abs(value) >= std::numeric_limits<T>::epsilon();
}
/*
* Get next power of 2.
*/
static inline
uint32_t d_nextPowerOf2(uint32_t size) noexcept
{
DISTRHO_SAFE_ASSERT_RETURN(size > 0, 0);
// http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
--size;
size |= size >> 1;
size |= size >> 2;
size |= size >> 4;
size |= size >> 8;
size |= size >> 16;
return ++size;
}
// -----------------------------------------------------------------------
#ifndef DONT_SET_USING_DISTRHO_NAMESPACE
// If your code uses a lot of DISTRHO classes, then this will obviously save you
// a lot of typing, but can be disabled by setting DONT_SET_USING_DISTRHO_NAMESPACE.
namespace DISTRHO_NAMESPACE {}
using namespace DISTRHO_NAMESPACE;
#endif
// -----------------------------------------------------------------------
#endif // DISTRHO_UTILS_HPP_INCLUDED
| [
"falktx@gmail.com"
] | falktx@gmail.com |
3f1d15d1f1bf981f22697027d5dcb70e487b7b0e | e217eaf05d0dab8dd339032b6c58636841aa8815 | /IfcAlignment/src/OpenInfraPlatform/IfcAlignment/entity/include/IfcCurtainWallTypeEnum.h | 66598f244ab7009d8edacf8b7c965639dfb5991c | [] | no_license | bigdoods/OpenInfraPlatform | f7785ebe4cb46e24d7f636e1b4110679d78a4303 | 0266e86a9f25f2ea9ec837d8d340d31a58a83c8e | refs/heads/master | 2021-01-21T03:41:20.124443 | 2016-01-26T23:20:21 | 2016-01-26T23:20:21 | 57,377,206 | 0 | 1 | null | 2016-04-29T10:38:19 | 2016-04-29T10:38:19 | null | UTF-8 | C++ | false | false | 1,293 | h | /*! \verbatim
* \copyright Copyright (c) 2015 Julian Amann. All rights reserved.
* \author Julian Amann <julian.amann@tum.de> (https://www.cms.bgu.tum.de/en/team/amann)
* \brief This file is part of the BlueFramework.
* \endverbatim
*/
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "OpenInfraPlatform/IfcAlignment/model/shared_ptr.h"
#include "OpenInfraPlatform/IfcAlignment/model/IfcAlignmentP6Object.h"
namespace OpenInfraPlatform
{
namespace IfcAlignment
{
// TYPE IfcCurtainWallTypeEnum = ENUMERATION OF (USERDEFINED ,NOTDEFINED);
class IfcCurtainWallTypeEnum : public IfcAlignmentP6AbstractEnum, public IfcAlignmentP6Type
{
public:
enum IfcCurtainWallTypeEnumEnum
{
ENUM_USERDEFINED,
ENUM_NOTDEFINED
};
IfcCurtainWallTypeEnum();
IfcCurtainWallTypeEnum( IfcCurtainWallTypeEnumEnum e ) { m_enum = e; }
~IfcCurtainWallTypeEnum();
virtual const char* classname() const { return "IfcCurtainWallTypeEnum"; }
virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
static shared_ptr<IfcCurtainWallTypeEnum> readStepData( std::string& arg );
IfcCurtainWallTypeEnumEnum m_enum;
};
} // end namespace IfcAlignment
} // end namespace OpenInfraPlatform
| [
"planung.cms.bv@tum.de"
] | planung.cms.bv@tum.de |
53bb0dca7bfd0183ee9a282f2d25d01afe74ee25 | 255c4886a061c0e17fbc458db3998637d058a0d0 | /code/imageanalysis/ImageAnalysis/ImageRotator.cc | ec595e1ec6c75bdda61e2afb1659e2e7c67bf99e | [] | no_license | keflavich/casa | 9f8aed7d3a1e7e944dedb57228b3f42665e7a245 | 175b53c57b66aa7a47aa90fdf3d76d33a99415d6 | refs/heads/master | 2021-01-17T11:03:24.350141 | 2016-05-25T21:07:56 | 2016-05-25T21:07:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,054 | cc | //# ImageRotator.cc
//# Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//
#include <imageanalysis/ImageAnalysis/ImageRotator.h>
#include <imageanalysis/ImageAnalysis/ImageRegridder.h>
#include <memory>
namespace casa {
const String ImageRotator::CLASS_NAME = "ImageRotator";
ImageRotator::ImageRotator(
const SPCIIF image, const Record *const ®ionPtr,
const String& mask,const String& outname, Bool overwrite
) : ImageTask<Float>(
image, "", regionPtr, "", "", "", mask, outname, overwrite
) {
this->_construct(True);
}
ImageRotator::~ImageRotator() {}
SPIIF ImageRotator::rotate() {
*this->_getLog() << LogOrigin(getClass(), __func__);
if (_shape.empty()) {
IPosition imShape = this->_getImage()->shape();
_shape = this->_getDropDegen() ? imShape.nonDegenerate() : imShape;
}
auto subImage = SubImageFactory<Float>::createSubImageRO(
*this->_getImage(), *this->_getRegion(), this->_getMask(),
this->_getLog().get(), AxesSpecifier(! this->_getDropDegen()), this->_getStretch()
);
const auto& cSysFrom = subImage->coordinates();
auto cSysTo = cSysFrom;
// We automatically find a DirectionCoordinate or LInearCoordinate
// These must hold *only* 2 axes at this point (restriction in ImageRegrid)
Vector<Int> pixelAxes;
if (cSysTo.hasDirectionCoordinate()) {
auto index = cSysTo.directionCoordinateNumber();
pixelAxes = cSysTo.pixelAxes(index);
std::unique_ptr<DirectionCoordinate> dc(
dynamic_cast<DirectionCoordinate *>(
cSysTo.directionCoordinate().rotate(_angle)
)
);
cSysTo.replaceCoordinate(*dc, (uInt)index);
*this->_getLog() << "Rotating DirectionCoordinate holding axes "
<< pixelAxes << LogIO::POST;
}
else if (cSysTo.hasLinearCoordinate()) {
auto index = cSysTo.linearCoordinateNumber();
pixelAxes = cSysTo.pixelAxes(index);
ThrowIf(
pixelAxes.size() != 2,
"Can only rotate a linear coordinate with exactly two axes"
);
std::unique_ptr<LinearCoordinate> lc(
dynamic_cast<LinearCoordinate *>(
cSysTo.linearCoordinate(index).rotate(_angle)
)
);
cSysTo.replaceCoordinate(*lc, (uInt)index);
}
else {
ThrowCc(
"Can only rotate a direction coordinate or a linear "
"coordiante with exactly two axes"
);
}
IPosition axes2(pixelAxes);
ImageRegridder regridder(
subImage, nullptr, "", this->_getOutname(),
this->_getOverwrite(), cSysTo, axes2, _shape
);
regridder.setDecimate(_decimate);
regridder.setMethod(_method);
regridder.setReplicate(_replicate);
regridder.setShape(_shape);
regridder.addHistory(this->getHistory());
return regridder.regrid();
}
}
| [
"dmehring@zia.aoc.nrao.edu"
] | dmehring@zia.aoc.nrao.edu |
f002b3807b54dc67681e48a8634a4488eb66cee3 | d20876df1308f1eaf3c280f6d3dd78c47633a2d8 | /src/Corrade/Containers/Test/ArrayTest.cpp | e1f361146aed12fc4412d657f8e1832cbe4a7d13 | [
"MIT",
"LicenseRef-scancode-public-domain",
"Unlicense"
] | permissive | mosra/corrade | 729ff71a9c8ceb7d27507b635be6433114b963bf | 183b375b73fa3e819a6b41dbcc0cf2f06773d2b4 | refs/heads/master | 2023-08-24T21:56:12.599589 | 2023-08-23T14:07:19 | 2023-08-24T09:43:55 | 2,863,909 | 470 | 143 | NOASSERTION | 2023-09-12T02:52:28 | 2011-11-28T00:51:12 | C++ | UTF-8 | C++ | false | false | 43,329 | cpp | /*
This file is part of Corrade.
Copyright ยฉ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
2017, 2018, 2019, 2020, 2021, 2022, 2023
Vladimรญr Vondruลก <mosra@centrum.cz>
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 <sstream>
#include "Corrade/Containers/Array.h"
#include "Corrade/TestSuite/Tester.h"
#include "Corrade/Utility/DebugStl.h" /** @todo remove when <sstream> is gone */
namespace {
struct IntView {
IntView(int* data, std::size_t size): data{data}, size{size} {}
int* data;
std::size_t size;
};
struct ConstIntView {
ConstIntView(const int* data, std::size_t size): data{data}, size{size} {}
const int* data;
std::size_t size;
};
}
namespace Corrade { namespace Containers {
namespace Implementation {
template<> struct ArrayViewConverter<int, IntView> {
static IntView to(ArrayView<int> other) {
return {other.data(), other.size()};
}
};
template<> struct ArrayViewConverter<const int, ConstIntView> {
static ConstIntView to(ArrayView<const int> other) {
return {other.data(), other.size()};
}
};
}
namespace Test { namespace {
struct ArrayTest: TestSuite::Tester {
explicit ArrayTest();
void constructDefault();
void constructEmpty();
void construct();
void constructZeroSize();
void constructDefaultInit();
void constructDefaultInitZeroSize();
void constructValueInit();
void constructValueInitZeroSize();
void constructNoInitTrivial();
void constructNoInitTrivialZeroSize();
void constructNoInitNonTrivial();
void constructNoInitNonTrivialZeroSize();
void constructDirectInit();
void constructDirectInitZeroSize();
void constructInPlaceInit();
void constructInPlaceInitZeroSize();
void constructFromExisting();
void constructMove();
void constructDirectReferences();
void constructZeroNullPointerAmbiguity();
void convertBool();
void convertPointer();
void convertView();
void convertViewDerived();
void convertViewOverload();
void convertVoid();
void convertConstVoid();
void convertToExternalView();
void convertToConstExternalView();
void access();
void accessConst();
void accessInvalid();
void rvalueArrayAccess();
void rangeBasedFor();
void slice();
void slicePointer();
void sliceToStatic();
void sliceToStaticPointer();
void sliceZeroNullPointerAmbiguity();
void release();
void defaultDeleter();
void customDeleter();
void customDeleterArrayView();
void customDeleterNullData();
void customDeleterZeroSize();
void customDeleterMovedOutInstance();
void customDeleterType();
void customDeleterTypeNoConstructor();
void customDeleterTypeExplicitDefaultConstructor();
void customDeleterTypeNullData();
void customDeleterTypeZeroSize();
void customDeleterTypeMovedOutInstance();
void cast();
void size();
void emplaceConstructorExplicitInCopyInitialization();
void copyConstructPlainStruct();
void moveConstructPlainStruct();
};
typedef Containers::Array<int> Array;
typedef Containers::ArrayView<int> ArrayView;
typedef Containers::ArrayView<const int> ConstArrayView;
typedef Containers::ArrayView<void> VoidArrayView;
typedef Containers::ArrayView<const void> ConstVoidArrayView;
ArrayTest::ArrayTest() {
addTests({&ArrayTest::constructDefault,
&ArrayTest::constructEmpty,
&ArrayTest::construct,
&ArrayTest::constructZeroSize,
&ArrayTest::constructDefaultInit,
&ArrayTest::constructDefaultInitZeroSize,
&ArrayTest::constructValueInit,
&ArrayTest::constructValueInitZeroSize,
&ArrayTest::constructNoInitTrivial,
&ArrayTest::constructNoInitTrivialZeroSize,
&ArrayTest::constructNoInitNonTrivial,
&ArrayTest::constructNoInitNonTrivialZeroSize,
&ArrayTest::constructDirectInit,
&ArrayTest::constructDirectInitZeroSize,
&ArrayTest::constructInPlaceInit,
&ArrayTest::constructInPlaceInitZeroSize,
&ArrayTest::constructFromExisting,
&ArrayTest::constructMove,
&ArrayTest::constructDirectReferences,
&ArrayTest::constructZeroNullPointerAmbiguity,
&ArrayTest::convertBool,
&ArrayTest::convertPointer,
&ArrayTest::convertView,
&ArrayTest::convertViewDerived,
&ArrayTest::convertViewOverload,
&ArrayTest::convertVoid,
&ArrayTest::convertConstVoid,
&ArrayTest::convertToExternalView,
&ArrayTest::convertToConstExternalView,
&ArrayTest::access,
&ArrayTest::accessConst,
&ArrayTest::accessInvalid,
&ArrayTest::rvalueArrayAccess,
&ArrayTest::rangeBasedFor,
&ArrayTest::slice,
&ArrayTest::slicePointer,
&ArrayTest::sliceToStatic,
&ArrayTest::sliceToStaticPointer,
&ArrayTest::sliceZeroNullPointerAmbiguity,
&ArrayTest::release,
&ArrayTest::defaultDeleter,
&ArrayTest::customDeleter,
&ArrayTest::customDeleterArrayView,
&ArrayTest::customDeleterNullData,
&ArrayTest::customDeleterZeroSize,
&ArrayTest::customDeleterMovedOutInstance,
&ArrayTest::customDeleterType,
&ArrayTest::customDeleterTypeNoConstructor,
&ArrayTest::customDeleterTypeExplicitDefaultConstructor,
&ArrayTest::customDeleterTypeNullData,
&ArrayTest::customDeleterTypeZeroSize,
&ArrayTest::customDeleterTypeMovedOutInstance,
&ArrayTest::cast,
&ArrayTest::size,
&ArrayTest::emplaceConstructorExplicitInCopyInitialization,
&ArrayTest::copyConstructPlainStruct,
&ArrayTest::moveConstructPlainStruct});
}
void ArrayTest::constructDefault() {
const Array a1;
/* GCC 4.8 tries to use the deleted Array copy constructor with = nullptr,
probably due to the workaround to avoid Array{0} being ambiguous between
a std::size_t and a nullptr constructor */
/** @todo drop this once the single-argument size constructor is
deprecated in favor of explicit DefaultInit / ValueInit */
#if defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ < 5
const Array a2{nullptr};
#else
const Array a2 = nullptr;
#endif
CORRADE_VERIFY(a1 == nullptr);
CORRADE_VERIFY(a2 == nullptr);
CORRADE_VERIFY(a1.isEmpty());
CORRADE_VERIFY(a2.isEmpty());
CORRADE_COMPARE(a1.size(), 0);
CORRADE_COMPARE(a2.size(), 0);
}
void ArrayTest::constructEmpty() {
/* Zero-length should not call new */
const std::size_t size = 0;
const Array b(size);
CORRADE_VERIFY(b == nullptr);
CORRADE_COMPARE(b.size(), 0);
}
void ArrayTest::construct() {
const Array a(5);
CORRADE_VERIFY(a != nullptr);
CORRADE_VERIFY(!a.isEmpty());
CORRADE_COMPARE(a.size(), 5);
/* Values should be zero-initialized (same as ValueInit) */
CORRADE_COMPARE(a[0], 0);
CORRADE_COMPARE(a[1], 0);
CORRADE_COMPARE(a[2], 0);
CORRADE_COMPARE(a[3], 0);
CORRADE_COMPARE(a[4], 0);
/* Implicit construction from std::size_t is not allowed */
CORRADE_VERIFY(!std::is_convertible<std::size_t, Array>::value);
}
void ArrayTest::constructZeroSize() {
Array a{0};
CORRADE_VERIFY(!a.data());
CORRADE_VERIFY(a.isEmpty());
CORRADE_COMPARE(a.size(), 0);
}
void ArrayTest::constructFromExisting() {
int* a = new int[25];
Array b{a, 25};
CORRADE_VERIFY(b == a);
CORRADE_VERIFY(!b.isEmpty());
CORRADE_COMPARE(b.size(), 25);
}
void ArrayTest::constructDefaultInit() {
const Array a{Corrade::DefaultInit, 5};
CORRADE_VERIFY(a);
CORRADE_COMPARE(a.size(), 5);
/* Values are random memory */
}
void ArrayTest::constructDefaultInitZeroSize() {
Array a{Corrade::DefaultInit, 0};
CORRADE_VERIFY(!a.data());
CORRADE_COMPARE(a.size(), 0);
}
void ArrayTest::constructValueInit() {
const Array a{Corrade::ValueInit, 5};
CORRADE_VERIFY(a);
CORRADE_COMPARE(a.size(), 5);
/* Values should be zero-initialized (same as the default constructor) */
CORRADE_COMPARE(a[0], 0);
CORRADE_COMPARE(a[1], 0);
CORRADE_COMPARE(a[2], 0);
CORRADE_COMPARE(a[3], 0);
CORRADE_COMPARE(a[4], 0);
}
void ArrayTest::constructValueInitZeroSize() {
Array a{Corrade::ValueInit, 0};
CORRADE_VERIFY(!a.data());
CORRADE_COMPARE(a.size(), 0);
}
void ArrayTest::constructNoInitTrivial() {
const Array a{Corrade::NoInit, 5};
CORRADE_VERIFY(a);
CORRADE_COMPARE(a.size(), 5);
CORRADE_VERIFY(!a.deleter());
}
void ArrayTest::constructNoInitTrivialZeroSize() {
Array a{Corrade::NoInit, 0};
CORRADE_VERIFY(!a.data());
CORRADE_COMPARE(a.size(), 0);
}
struct Foo {
static int constructorCallCount;
Foo() { ++constructorCallCount; }
};
int Foo::constructorCallCount = 0;
void ArrayTest::constructNoInitNonTrivial() {
const Containers::Array<Foo> a{Corrade::NoInit, 5};
CORRADE_VERIFY(a);
CORRADE_COMPARE(a.size(), 5);
CORRADE_VERIFY(a.deleter());
CORRADE_COMPARE(Foo::constructorCallCount, 0);
const Containers::Array<Foo> b{Corrade::DefaultInit, 7};
CORRADE_COMPARE(Foo::constructorCallCount, 7);
}
void ArrayTest::constructNoInitNonTrivialZeroSize() {
Containers::Array<Foo> a{Corrade::NoInit, 0};
CORRADE_VERIFY(!a.data());
CORRADE_COMPARE(a.size(), 0);
}
void ArrayTest::constructDirectInit() {
const Array a{Corrade::DirectInit, 2, -37};
CORRADE_VERIFY(a);
CORRADE_COMPARE(a.size(), 2);
CORRADE_COMPARE(a[0], -37);
CORRADE_COMPARE(a[1], -37);
}
void ArrayTest::constructDirectInitZeroSize() {
Array a{Corrade::DirectInit, 0, -37};
CORRADE_VERIFY(!a.data());
CORRADE_COMPARE(a.size(), 0);
}
void ArrayTest::constructInPlaceInit() {
Array a1{Corrade::InPlaceInit, {1, 3, 127, -48}};
CORRADE_VERIFY(a1);
CORRADE_COMPARE(a1.size(), 4);
CORRADE_COMPARE(a1[0], 1);
CORRADE_COMPARE(a1[1], 3);
CORRADE_COMPARE(a1[2], 127);
CORRADE_COMPARE(a1[3], -48);
Array a2 = array<int>({1, 3, 127, -48});
CORRADE_VERIFY(a2);
CORRADE_COMPARE(a2.size(), 4);
CORRADE_COMPARE(a2[0], 1);
CORRADE_COMPARE(a2[1], 3);
CORRADE_COMPARE(a2[2], 127);
CORRADE_COMPARE(a2[3], -48);
Array b1{Corrade::InPlaceInit, {}};
CORRADE_VERIFY(!b1);
Array b2 = array<int>({});
CORRADE_VERIFY(!b2);
}
void ArrayTest::constructInPlaceInitZeroSize() {
Array a{Corrade::InPlaceInit, {}};
CORRADE_VERIFY(!a.data());
CORRADE_COMPARE(a.size(), 0);
}
void ArrayTest::constructMove() {
auto myDeleter = [](int* data, std::size_t) { delete[] data; };
Array a(new int[5], 5, myDeleter);
CORRADE_VERIFY(a);
const int* const ptr = a;
Array b(Utility::move(a));
CORRADE_VERIFY(a == nullptr);
CORRADE_VERIFY(b == ptr);
CORRADE_COMPARE(a.size(), 0);
CORRADE_COMPARE(b.size(), 5);
CORRADE_VERIFY(a.deleter() == nullptr);
CORRADE_VERIFY(b.deleter() == myDeleter);
auto noDeleter = [](int*, std::size_t) {};
Array c{reinterpret_cast<int*>(0x3), 3, noDeleter};
c = Utility::move(b);
CORRADE_VERIFY(b == reinterpret_cast<int*>(0x3));
CORRADE_VERIFY(c == ptr);
CORRADE_COMPARE(b.size(), 3);
CORRADE_COMPARE(c.size(), 5);
CORRADE_VERIFY(b.deleter() == noDeleter);
CORRADE_VERIFY(c.deleter() == myDeleter);
CORRADE_VERIFY(std::is_nothrow_move_constructible<Array>::value);
CORRADE_VERIFY(std::is_nothrow_move_assignable<Array>::value);
}
void ArrayTest::constructDirectReferences() {
struct NonCopyable {
NonCopyable(const NonCopyable&) = delete;
NonCopyable(NonCopyable&&) = delete;
NonCopyable& operator=(const NonCopyable&) = delete;
NonCopyable& operator=(NonCopyable&&) = delete;
NonCopyable() = default;
} a;
struct Reference {
Reference(NonCopyable&) {}
};
const Containers::Array<Reference> b{Corrade::DirectInit, 5, a};
CORRADE_COMPARE(b.size(), 5);
}
/* Without a corresponding SFINAE check in the std::nullptr_t constructor, this
is ambiguous, but *only* if the size_t overload has a second 64-bit
argument. If both would be the same, it wouldn't be ambigous, if the size_t
overload second argument was 32-bit and the other 16-bit it wouldn't be
either. */
int integerArrayOverload(std::size_t, long long) {
return 76;
}
int integerArrayOverload(const Array&, int) {
return 39;
}
void ArrayTest::constructZeroNullPointerAmbiguity() {
/* Obvious cases */
CORRADE_COMPARE(integerArrayOverload(25, 2), 76);
CORRADE_COMPARE(integerArrayOverload(nullptr, 2), 39);
/* This should pick the integer overload, not convert 0 to nullptr */
CORRADE_COMPARE(integerArrayOverload(0, 3), 76);
}
void ArrayTest::convertBool() {
CORRADE_VERIFY(Array(2));
CORRADE_VERIFY(!Array());
/* Explicit conversion to bool is allowed, but not to int */
CORRADE_VERIFY(std::is_constructible<bool, Array>::value);
CORRADE_VERIFY(!std::is_constructible<int, Array>::value);
}
void ArrayTest::convertPointer() {
Array a(2);
int* b = a;
CORRADE_COMPARE(b, a.begin());
const Array c(3);
const int* d = c;
CORRADE_COMPARE(d, c.begin());
/* Pointer arithmetic */
const Array e(3);
const int* f = e + 2;
CORRADE_COMPARE(f, &e[2]);
/* Verify that we can't convert rvalues. Not using is_convertible to catch
also accidental explicit conversions. */
CORRADE_VERIFY(std::is_constructible<int*, Array&>::value);
CORRADE_VERIFY(std::is_constructible<const int*, const Array&>::value);
CORRADE_VERIFY(!std::is_constructible<int*, Array>::value);
CORRADE_VERIFY(!std::is_constructible<int*, Array&&>::value);
/* Deleting const&& overload and leaving only const& one will not, in fact,
disable conversion of const Array&& to pointer, but rather make the
conversion ambiguous, which is not what we want, as it breaks e.g.
rvalueArrayAccess() test. Not using is_convertible to catch also
accidental explicit conversions. */
{
CORRADE_EXPECT_FAIL("I don't know how to properly disable conversion of const Array&& to pointer.");
CORRADE_VERIFY(!std::is_constructible<const int*, const Array>::value);
CORRADE_VERIFY(!std::is_constructible<const int*, const Array&&>::value);
}
}
void ArrayTest::convertView() {
Array a(5);
const Array ca(5);
Containers::Array<const int> ac{a.data(), a.size(), [](const int*, std::size_t){}};
const Containers::Array<const int> cac{a.data(), a.size(), [](const int*, std::size_t){}};
{
const ArrayView b = a;
const ConstArrayView cb = ca;
const ConstArrayView bc = ac;
const ConstArrayView cbc = cac;
CORRADE_VERIFY(b.begin() == a.begin());
CORRADE_VERIFY(bc.begin() == ac.begin());
CORRADE_VERIFY(cb.begin() == ca.begin());
CORRADE_VERIFY(cbc.begin() == cac.begin());
CORRADE_COMPARE(b.size(), 5);
CORRADE_COMPARE(cb.size(), 5);
CORRADE_COMPARE(bc.size(), 5);
CORRADE_COMPARE(cbc.size(), 5);
ArrayView c = Array{3};
CORRADE_COMPARE(c.size(), 3);
/* The rest is a dangling pointer, can't test */
} {
const auto b = arrayView(a);
const auto cb = arrayView(ca);
const auto bc = arrayView(ac);
const auto cbc = arrayView(cac);
CORRADE_VERIFY(std::is_same<decltype(b), const ArrayView>::value);
CORRADE_VERIFY(std::is_same<decltype(cb), const ConstArrayView>::value);
CORRADE_VERIFY(std::is_same<decltype(bc), const ConstArrayView>::value);
CORRADE_VERIFY(std::is_same<decltype(cbc), const ConstArrayView>::value);
CORRADE_VERIFY(b.begin() == a.begin());
CORRADE_VERIFY(bc.begin() == ac.begin());
CORRADE_VERIFY(cb.begin() == ca.begin());
CORRADE_VERIFY(cbc.begin() == cac.begin());
CORRADE_COMPARE(b.size(), 5);
CORRADE_COMPARE(cb.size(), 5);
CORRADE_COMPARE(bc.size(), 5);
CORRADE_COMPARE(cbc.size(), 5);
auto c = arrayView(Array{3});
CORRADE_VERIFY(std::is_same<decltype(c), ArrayView>::value);
CORRADE_COMPARE(c.size(), 3);
/* The rest is a dangling pointer, can't test */
}
}
void ArrayTest::convertViewDerived() {
struct A { int i; };
struct B: A {};
/* Valid use case: constructing Containers::ArrayView<Math::Vector<3, Float>>
from Containers::ArrayView<Color3> because the data have the same size
and data layout */
Containers::Array<B> b{5};
Containers::ArrayView<A> a = b;
CORRADE_VERIFY(a == b);
CORRADE_COMPARE(a.size(), 5);
}
bool takesAView(Containers::ArrayView<int>) { return true; }
bool takesAConstView(Containers::ArrayView<const int>) { return true; }
CORRADE_UNUSED bool takesAView(Containers::ArrayView<float>) { return false; }
CORRADE_UNUSED bool takesAConstView(Containers::ArrayView<const float>) { return false; }
void ArrayTest::convertViewOverload() {
Array a(5);
const Array ca(5);
/* It should pick the correct one and not fail, assert or be ambiguous */
CORRADE_VERIFY(takesAView(a));
CORRADE_VERIFY(takesAConstView(a));
CORRADE_VERIFY(takesAConstView(ca));
}
void ArrayTest::convertVoid() {
Array a(6);
VoidArrayView b = a;
CORRADE_VERIFY(b == a);
CORRADE_COMPARE(b.size(), a.size()*sizeof(int));
}
void ArrayTest::convertConstVoid() {
Array a(6);
const Array ca(6);
ConstVoidArrayView b = a;
ConstVoidArrayView cb = ca;
CORRADE_VERIFY(b == a);
CORRADE_VERIFY(cb == ca);
CORRADE_COMPARE(b.size(), a.size()*sizeof(int));
CORRADE_COMPARE(cb.size(), ca.size()*sizeof(int));
}
void ArrayTest::convertToExternalView() {
Array a{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
IntView b = a;
CORRADE_COMPARE(b.data, a);
CORRADE_COMPARE(b.size, a.size());
ConstIntView cb = a;
CORRADE_COMPARE(cb.data, a);
CORRADE_COMPARE(cb.size, a.size());
/* Conversion to a different type is not allowed. Not using is_convertible
to catch also accidental explicit conversions. */
CORRADE_VERIFY(std::is_constructible<IntView, Containers::Array<int>>::value);
CORRADE_VERIFY(std::is_constructible<ConstIntView, Containers::Array<int>>::value);
CORRADE_VERIFY(!std::is_constructible<IntView, Containers::Array<float>>::value);
CORRADE_VERIFY(!std::is_constructible<ConstIntView, Containers::Array<float>>::value);
}
void ArrayTest::convertToConstExternalView() {
const Array a{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
ConstIntView b = a;
CORRADE_COMPARE(b.data, a);
CORRADE_COMPARE(b.size, a.size());
/* Conversion to a different type is not allowed. Not using is_convertible
to catch also accidental explicit conversions. */
CORRADE_VERIFY(std::is_constructible<ConstIntView, const Containers::Array<int>>::value);
CORRADE_VERIFY(!std::is_constructible<ConstIntView, const Containers::Array<float>>::value);
}
void ArrayTest::access() {
Array a(7);
for(std::size_t i = 0; i != 7; ++i)
a[i] = i;
CORRADE_COMPARE(a.data(), static_cast<int*>(a));
CORRADE_COMPARE(a.front(), 0);
CORRADE_COMPARE(a.back(), 6);
CORRADE_COMPARE(*(a.begin()+2), 2);
CORRADE_COMPARE(a[4], 4);
CORRADE_COMPARE(a.end()-a.begin(), a.size());
CORRADE_COMPARE(a.cbegin(), a.begin());
CORRADE_COMPARE(a.cend(), a.end());
const Array b{Corrade::InPlaceInit, {7, 3, 5, 4}};
CORRADE_COMPARE(b.data(), static_cast<const int*>(b));
CORRADE_COMPARE(b[2], 5);
}
void ArrayTest::accessConst() {
Array a(7);
for(std::size_t i = 0; i != 7; ++i)
a[i] = i;
const Array& ca = a;
CORRADE_COMPARE(ca.data(), static_cast<int*>(a));
CORRADE_COMPARE(ca.front(), 0);
CORRADE_COMPARE(ca.back(), 6);
CORRADE_COMPARE(*(ca.begin()+2), 2);
CORRADE_COMPARE(ca[4], 4);
CORRADE_COMPARE(ca.end() - ca.begin(), ca.size());
CORRADE_COMPARE(ca.cbegin(), ca.begin());
CORRADE_COMPARE(ca.cend(), ca.end());
}
void ArrayTest::accessInvalid() {
CORRADE_SKIP_IF_NO_DEBUG_ASSERT();
std::stringstream out;
Error redirectError{&out};
Array a;
Array b{5};
a.front();
a.back();
b[5];
CORRADE_COMPARE(out.str(),
"Containers::Array::front(): array is empty\n"
"Containers::Array::back(): array is empty\n"
"Containers::Array::operator[](): index 5 out of range for 5 elements\n");
}
void ArrayTest::rvalueArrayAccess() {
CORRADE_COMPARE((Array{Corrade::InPlaceInit, {1, 2, 3, 4}}[2]), 3);
}
void ArrayTest::rangeBasedFor() {
Array a(5);
for(auto& i: a)
i = 3;
CORRADE_COMPARE(a[0], 3);
CORRADE_COMPARE(a[1], 3);
CORRADE_COMPARE(a[2], 3);
CORRADE_COMPARE(a[3], 3);
CORRADE_COMPARE(a[4], 3);
/* To verify the constant begin()/end() accessors */
const Array& ca = a;
for(auto&& i: ca)
CORRADE_COMPARE(i, 3);
}
void ArrayTest::slice() {
Array a{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
const Array ac{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
ArrayView b1 = a.slice(1, 4);
CORRADE_COMPARE(b1.size(), 3);
CORRADE_COMPARE(b1[0], 2);
CORRADE_COMPARE(b1[1], 3);
CORRADE_COMPARE(b1[2], 4);
ConstArrayView bc1 = ac.slice(1, 4);
CORRADE_COMPARE(bc1.size(), 3);
CORRADE_COMPARE(bc1[0], 2);
CORRADE_COMPARE(bc1[1], 3);
CORRADE_COMPARE(bc1[2], 4);
ArrayView b2 = a.sliceSize(1, 3);
CORRADE_COMPARE(b2.size(), 3);
CORRADE_COMPARE(b2[0], 2);
CORRADE_COMPARE(b2[1], 3);
CORRADE_COMPARE(b2[2], 4);
ConstArrayView bc2 = ac.sliceSize(1, 3);
CORRADE_COMPARE(bc2.size(), 3);
CORRADE_COMPARE(bc2[0], 2);
CORRADE_COMPARE(bc2[1], 3);
CORRADE_COMPARE(bc2[2], 4);
ArrayView c = a.prefix(3);
CORRADE_COMPARE(c.size(), 3);
CORRADE_COMPARE(c[0], 1);
CORRADE_COMPARE(c[1], 2);
CORRADE_COMPARE(c[2], 3);
ConstArrayView cc = ac.prefix(3);
CORRADE_COMPARE(cc.size(), 3);
CORRADE_COMPARE(cc[0], 1);
CORRADE_COMPARE(cc[1], 2);
CORRADE_COMPARE(cc[2], 3);
ArrayView d = a.exceptPrefix(2);
CORRADE_COMPARE(d.size(), 3);
CORRADE_COMPARE(d[0], 3);
CORRADE_COMPARE(d[1], 4);
CORRADE_COMPARE(d[2], 5);
ConstArrayView dc = ac.exceptPrefix(2);
CORRADE_COMPARE(dc.size(), 3);
CORRADE_COMPARE(dc[0], 3);
CORRADE_COMPARE(dc[1], 4);
CORRADE_COMPARE(dc[2], 5);
ArrayView e = a.exceptSuffix(2);
CORRADE_COMPARE(e.size(), 3);
CORRADE_COMPARE(e[0], 1);
CORRADE_COMPARE(e[1], 2);
CORRADE_COMPARE(e[2], 3);
ConstArrayView ce = ac.exceptSuffix(2);
CORRADE_COMPARE(ce.size(), 3);
CORRADE_COMPARE(ce[0], 1);
CORRADE_COMPARE(ce[1], 2);
CORRADE_COMPARE(ce[2], 3);
}
void ArrayTest::slicePointer() {
Array a{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
const Array ac{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
ArrayView b1 = a.slice(a + 1, a + 4);
CORRADE_COMPARE(b1.size(), 3);
CORRADE_COMPARE(b1[0], 2);
CORRADE_COMPARE(b1[1], 3);
CORRADE_COMPARE(b1[2], 4);
ConstArrayView bc1 = ac.slice(ac + 1, ac + 4);
CORRADE_COMPARE(bc1.size(), 3);
CORRADE_COMPARE(bc1[0], 2);
CORRADE_COMPARE(bc1[1], 3);
CORRADE_COMPARE(bc1[2], 4);
ArrayView b2 = a.sliceSize(a + 1, 3);
CORRADE_COMPARE(b2.size(), 3);
CORRADE_COMPARE(b2[0], 2);
CORRADE_COMPARE(b2[1], 3);
CORRADE_COMPARE(b2[2], 4);
ConstArrayView bc2 = ac.sliceSize(ac + 1, 3);
CORRADE_COMPARE(bc2.size(), 3);
CORRADE_COMPARE(bc2[0], 2);
CORRADE_COMPARE(bc2[1], 3);
CORRADE_COMPARE(bc2[2], 4);
ArrayView c = a.prefix(a + 3);
CORRADE_COMPARE(c.size(), 3);
CORRADE_COMPARE(c[0], 1);
CORRADE_COMPARE(c[1], 2);
CORRADE_COMPARE(c[2], 3);
ConstArrayView cc = ac.prefix(ac + 3);
CORRADE_COMPARE(cc.size(), 3);
CORRADE_COMPARE(cc[0], 1);
CORRADE_COMPARE(cc[1], 2);
CORRADE_COMPARE(cc[2], 3);
ArrayView d = a.suffix(a + 2);
CORRADE_COMPARE(d.size(), 3);
CORRADE_COMPARE(d[0], 3);
CORRADE_COMPARE(d[1], 4);
CORRADE_COMPARE(d[2], 5);
ConstArrayView dc = ac.suffix(ac + 2);
CORRADE_COMPARE(dc.size(), 3);
CORRADE_COMPARE(dc[0], 3);
CORRADE_COMPARE(dc[1], 4);
CORRADE_COMPARE(dc[2], 5);
}
void ArrayTest::sliceToStatic() {
Array a{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
const Array ac{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
StaticArrayView<3, int> b1 = a.slice<3>(1);
CORRADE_COMPARE(b1[0], 2);
CORRADE_COMPARE(b1[1], 3);
CORRADE_COMPARE(b1[2], 4);
StaticArrayView<3, const int> bc1 = ac.slice<3>(1);
CORRADE_COMPARE(bc1[0], 2);
CORRADE_COMPARE(bc1[1], 3);
CORRADE_COMPARE(bc1[2], 4);
StaticArrayView<3, int> b2 = a.slice<1, 4>();
CORRADE_COMPARE(b2[0], 2);
CORRADE_COMPARE(b2[1], 3);
CORRADE_COMPARE(b2[2], 4);
StaticArrayView<3, const int> bc2 = ac.slice<1, 4>();
CORRADE_COMPARE(bc2[0], 2);
CORRADE_COMPARE(bc2[1], 3);
CORRADE_COMPARE(bc2[2], 4);
StaticArrayView<3, int> b3 = a.sliceSize<1, 3>();
CORRADE_COMPARE(b3[0], 2);
CORRADE_COMPARE(b3[1], 3);
CORRADE_COMPARE(b3[2], 4);
StaticArrayView<3, const int> bc3 = ac.sliceSize<1, 3>();
CORRADE_COMPARE(bc3[0], 2);
CORRADE_COMPARE(bc3[1], 3);
CORRADE_COMPARE(bc3[2], 4);
StaticArrayView<3, int> c = a.prefix<3>();
CORRADE_COMPARE(c[0], 1);
CORRADE_COMPARE(c[1], 2);
CORRADE_COMPARE(c[2], 3);
StaticArrayView<3, const int> cc = ac.prefix<3>();
CORRADE_COMPARE(cc[0], 1);
CORRADE_COMPARE(cc[1], 2);
CORRADE_COMPARE(cc[2], 3);
StaticArrayView<3, int> d = a.suffix<3>();
CORRADE_COMPARE(d[0], 3);
CORRADE_COMPARE(d[1], 4);
CORRADE_COMPARE(d[2], 5);
StaticArrayView<3, const int> dc = ac.suffix<3>();
CORRADE_COMPARE(dc[0], 3);
CORRADE_COMPARE(dc[1], 4);
CORRADE_COMPARE(dc[2], 5);
}
void ArrayTest::sliceToStaticPointer() {
Array a{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
const Array ac{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
StaticArrayView<3, int> b = a.slice<3>(a + 1);
CORRADE_COMPARE(b[0], 2);
CORRADE_COMPARE(b[1], 3);
CORRADE_COMPARE(b[2], 4);
StaticArrayView<3, const int> bc = ac.slice<3>(ac + 1);
CORRADE_COMPARE(bc[0], 2);
CORRADE_COMPARE(bc[1], 3);
CORRADE_COMPARE(bc[2], 4);
}
void ArrayTest::sliceZeroNullPointerAmbiguity() {
Array a{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
const Array ac{Corrade::InPlaceInit, {1, 2, 3, 4, 5}};
/* These should all unambigously pick the std::size_t overloads, not the
T* overloads */
ArrayView b = a.sliceSize(0, 3);
CORRADE_COMPARE(b.size(), 3);
CORRADE_COMPARE(b[0], 1);
CORRADE_COMPARE(b[1], 2);
CORRADE_COMPARE(b[2], 3);
ConstArrayView bc = ac.sliceSize(0, 3);
CORRADE_COMPARE(bc.size(), 3);
CORRADE_COMPARE(bc[0], 1);
CORRADE_COMPARE(bc[1], 2);
CORRADE_COMPARE(bc[2], 3);
ArrayView c = a.prefix(0);
CORRADE_COMPARE(c.size(), 0);
CORRADE_COMPARE(c.data(), static_cast<void*>(a.data()));
ConstArrayView cc = ac.prefix(0);
CORRADE_COMPARE(cc.size(), 0);
CORRADE_COMPARE(cc.data(), static_cast<const void*>(ac.data()));
/** @todo suffix(0), once the non-deprecated suffix(std::size_t size) is a
thing */
StaticArrayView<3, int> e = a.slice<3>(0);
CORRADE_COMPARE(e[0], 1);
CORRADE_COMPARE(e[1], 2);
CORRADE_COMPARE(e[2], 3);
StaticArrayView<3, const int> ec = ac.slice<3>(0);
CORRADE_COMPARE(ec[0], 1);
CORRADE_COMPARE(ec[1], 2);
CORRADE_COMPARE(ec[2], 3);
}
void ArrayTest::release() {
auto myDeleter = [](int* data, std::size_t) { delete[] data; };
Array a(new int[5], 5, myDeleter);
int* const data = a;
int* const released = a.release();
delete[] released;
/* Not comparing pointers directly because then Clang Analyzer complains
that printing the value of `released` is use-after-free. Um.
GCC 13 now also crashes in, breathing heavily, trying to be helpful with
a "warning: pointer may be used after โvoid operator delete [](void*)โ".
Well, no shit? I'm looking at the value. If I'd be comparing the value
before a delete instead, you'd complain that I might have a potential
leak. Happens only in a Release build. Possibly related is the
following, however this didn't happen on GCC 12:
https://gcc.gnu.org/bugzilla//show_bug.cgi?id=106119 */
#if defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ == 13
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuse-after-free"
#endif
CORRADE_COMPARE(reinterpret_cast<std::intptr_t>(data), reinterpret_cast<std::intptr_t>(released));
#if defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG) && __GNUC__ == 13
#pragma GCC diagnostic pop
#endif
CORRADE_COMPARE(a.begin(), nullptr);
CORRADE_COMPARE(a.size(), 0);
CORRADE_VERIFY(a.deleter() == nullptr);
}
void ArrayTest::defaultDeleter() {
Array a{5};
CORRADE_VERIFY(a.deleter() == nullptr);
}
int CustomDeleterCallCount = 0;
void ArrayTest::customDeleter() {
CustomDeleterCallCount = 0;
int data[25]{1337};
CORRADE_VERIFY(true); /* to register proper function name */
{
Array a{data, 25, [](int* data, std::size_t size) {
CORRADE_VERIFY(data);
CORRADE_COMPARE(data[0], 1337);
CORRADE_COMPARE(size, 25);
++CustomDeleterCallCount;
}};
CORRADE_VERIFY(a == data);
CORRADE_COMPARE(a.size(), 25);
CORRADE_COMPARE(CustomDeleterCallCount, 0);
}
CORRADE_COMPARE(CustomDeleterCallCount, 1);
}
void ArrayTest::customDeleterArrayView() {
CustomDeleterCallCount = 0;
int data[25]{1337};
CORRADE_VERIFY(true); /* to register proper function name */
{
Array a{ArrayView{data, 25}, [](int* data, std::size_t size) {
CORRADE_VERIFY(data);
CORRADE_COMPARE(data[0], 1337);
CORRADE_COMPARE(size, 25);
++CustomDeleterCallCount;
}};
CORRADE_VERIFY(a == data);
CORRADE_COMPARE(a.size(), 25);
CORRADE_COMPARE(CustomDeleterCallCount, 0);
}
CORRADE_COMPARE(CustomDeleterCallCount, 1);
}
void ArrayTest::customDeleterNullData() {
CustomDeleterCallCount = 0;
CORRADE_VERIFY(true); /* to register proper function name */
{
Array a{nullptr, 25, [](int* data, std::size_t size) {
CORRADE_VERIFY(!data);
CORRADE_COMPARE(size, 25);
++CustomDeleterCallCount;
}};
CORRADE_VERIFY(a == nullptr);
CORRADE_COMPARE(a.size(), 25);
CORRADE_COMPARE(CustomDeleterCallCount, 0);
}
/* The deleter should be called even in case the data is null. This is to
have correct behavior e.g. in Array<char, Utility::Path::MapDeleter>
where the data can be null for an empty file, but the fd should still
get properly closed after. */
CORRADE_COMPARE(CustomDeleterCallCount, 1);
}
void ArrayTest::customDeleterZeroSize() {
CustomDeleterCallCount = 0;
int data[25]{1337};
CORRADE_VERIFY(true); /* to register proper function name */
{
Array a{data, 0, [](int* data, std::size_t size) {
CORRADE_VERIFY(data);
CORRADE_COMPARE(data[0], 1337);
CORRADE_COMPARE(size, 0);
++CustomDeleterCallCount;
}};
CORRADE_VERIFY(a == data);
CORRADE_COMPARE(a.size(), 0);
CORRADE_COMPARE(CustomDeleterCallCount, 0);
}
/* Variant of the above, while not as common, the deleter should
unconditionally get called here as well */
CORRADE_COMPARE(CustomDeleterCallCount, 1);
}
void ArrayTest::customDeleterMovedOutInstance() {
CustomDeleterCallCount = 0;
int data[25]{};
CORRADE_VERIFY(true); /* to register proper function name */
{
Array a{data, 25, [](int*, std::size_t) {
++CustomDeleterCallCount;
}};
CORRADE_COMPARE(CustomDeleterCallCount, 0);
Array b = std::move(a);
CORRADE_COMPARE(CustomDeleterCallCount, 0);
}
/* The deleter got reset to nullptr in a, which means the function gets
called only once */
CORRADE_COMPARE(CustomDeleterCallCount, 1);
}
void ArrayTest::customDeleterType() {
int data[25]{1337};
int deletedCount = 0;
CORRADE_VERIFY(true); /* to register proper function name */
struct CustomDeleter {
CustomDeleter(int& deletedCountOutput): deletedCount{deletedCountOutput} {}
void operator()(int* data, std::size_t size) {
CORRADE_VERIFY(data);
CORRADE_COMPARE(data[0], 1337);
CORRADE_COMPARE(size, 25);
++deletedCount;
}
int& deletedCount;
};
{
Containers::Array<int, CustomDeleter> a{data, 25, CustomDeleter{deletedCount}};
CORRADE_VERIFY(a == data);
CORRADE_COMPARE(a.size(), 25);
CORRADE_COMPARE(deletedCount, 0);
}
CORRADE_COMPARE(deletedCount, 1);
}
void ArrayTest::customDeleterTypeNoConstructor() {
struct CustomImplicitDeleter {
void operator()(int*, std::size_t) {}
};
/* Just verify that this compiles */
Containers::Array<int, CustomImplicitDeleter> a;
Containers::Array<int, CustomImplicitDeleter> b{nullptr};
int c;
Containers::Array<int, CustomImplicitDeleter> d{&c, 1};
CORRADE_VERIFY(true);
}
void ArrayTest::customDeleterTypeExplicitDefaultConstructor() {
struct CustomExplicitDeleter {
explicit CustomExplicitDeleter() = default;
void operator()(int*, std::size_t) {}
};
/* Just verify that this compiles */
Containers::Array<int, CustomExplicitDeleter> a;
Containers::Array<int, CustomExplicitDeleter> b{nullptr};
int c;
Containers::Array<int, CustomExplicitDeleter> d{&c, 1, CustomExplicitDeleter{}};
CORRADE_VERIFY(true);
}
void ArrayTest::customDeleterTypeNullData() {
int deletedCount = 0;
CORRADE_VERIFY(true); /* to register proper function name */
struct CustomDeleter {
CustomDeleter(int& deletedCountOutput): deletedCount{deletedCountOutput} {}
void operator()(int* data, std::size_t size) {
CORRADE_VERIFY(!data);
CORRADE_COMPARE(size, 25);
++deletedCount;
}
int& deletedCount;
};
{
Containers::Array<int, CustomDeleter> a{nullptr, 25, CustomDeleter{deletedCount}};
CORRADE_VERIFY(a == nullptr);
CORRADE_COMPARE(a.size(), 25);
CORRADE_COMPARE(deletedCount, 0);
}
/* Just to check that the behavior is the same as with plain deleter
pointers -- see comment in customDeleterNullData() for details */
CORRADE_COMPARE(deletedCount, 1);
}
void ArrayTest::customDeleterTypeZeroSize() {
int deletedCount = 0;
int data[25]{1337};
CORRADE_VERIFY(true); /* to register proper function name */
struct CustomDeleter {
CustomDeleter(int& deletedCountOutput): deletedCount{deletedCountOutput} {}
void operator()(int* data, std::size_t size) {
CORRADE_VERIFY(data);
CORRADE_COMPARE(data[0], 1337);
CORRADE_COMPARE(size, 0);
++deletedCount;
}
int& deletedCount;
};
{
Containers::Array<int, CustomDeleter> a{data, 0, CustomDeleter{deletedCount}};
CORRADE_VERIFY(a == data);
CORRADE_COMPARE(a.size(), 0);
CORRADE_COMPARE(deletedCount, 0);
}
/* Just to check that the behavior is the same as with plain deleter
pointers -- see comment in customDeleterZeroSize() for details */
CORRADE_COMPARE(deletedCount, 1);
}
void ArrayTest::customDeleterTypeMovedOutInstance() {
CustomDeleterCallCount = 0;
int deletedCount = 0;
int data[25]{};
CORRADE_VERIFY(true); /* to register proper function name */
struct CustomDeleter {
CustomDeleter(): deletedCount{} {}
CustomDeleter(int& deletedCountOutput): deletedCount{&deletedCountOutput} {}
void operator()(int*, std::size_t) {
if(deletedCount) ++*deletedCount;
++CustomDeleterCallCount;
}
int* deletedCount;
};
{
Containers::Array<int, CustomDeleter> a{data, 0, CustomDeleter{deletedCount}};
CORRADE_COMPARE(deletedCount, 0);
CORRADE_COMPARE(CustomDeleterCallCount, 0);
Containers::Array<int, CustomDeleter> b = std::move(a);
CORRADE_COMPARE(deletedCount, 0);
CORRADE_COMPARE(CustomDeleterCallCount, 0);
}
/* The deleter got reset to a default-constructed state in a, which means
the deletedCount pointer gets reset -- but the default-constructed
instance still gets called for it, so the global counter is 2 */
CORRADE_COMPARE(deletedCount, 1);
CORRADE_COMPARE(CustomDeleterCallCount, 2);
}
void ArrayTest::cast() {
Containers::Array<std::uint32_t> a{6};
const Containers::Array<std::uint32_t> ca{6};
Containers::Array<const std::uint32_t> ac{a.data(), a.size(), [](const std::uint32_t*, std::size_t){}};
const Containers::Array<const std::uint32_t> cac{a.data(), a.size(), [](const std::uint32_t*, std::size_t){}};
auto b = Containers::arrayCast<std::uint64_t>(a);
auto bc = Containers::arrayCast<const std::uint64_t>(ac);
auto cb = Containers::arrayCast<const std::uint64_t>(ca);
auto cbc = Containers::arrayCast<const std::uint64_t>(cac);
auto d = Containers::arrayCast<std::uint16_t>(a);
auto dc = Containers::arrayCast<const std::uint16_t>(ac);
auto cd = Containers::arrayCast<const std::uint16_t>(ca);
auto cdc = Containers::arrayCast<const std::uint16_t>(cac);
CORRADE_VERIFY(std::is_same<decltype(b), Containers::ArrayView<std::uint64_t>>::value);
CORRADE_VERIFY(std::is_same<decltype(bc), Containers::ArrayView<const std::uint64_t>>::value);
CORRADE_VERIFY(std::is_same<decltype(cb), Containers::ArrayView<const std::uint64_t>>::value);
CORRADE_VERIFY(std::is_same<decltype(cbc), Containers::ArrayView<const std::uint64_t>>::value);
CORRADE_VERIFY(std::is_same<decltype(d), Containers::ArrayView<std::uint16_t>>::value);
CORRADE_VERIFY(std::is_same<decltype(cd), Containers::ArrayView<const std::uint16_t>>::value);
CORRADE_VERIFY(std::is_same<decltype(dc), Containers::ArrayView<const std::uint16_t>>::value);
CORRADE_VERIFY(std::is_same<decltype(cdc), Containers::ArrayView<const std::uint16_t>>::value);
CORRADE_COMPARE(static_cast<void*>(b.begin()), static_cast<void*>(a.begin()));
CORRADE_COMPARE(static_cast<const void*>(cb.begin()), static_cast<const void*>(ca.begin()));
CORRADE_COMPARE(static_cast<const void*>(bc.begin()), static_cast<const void*>(ac.begin()));
CORRADE_COMPARE(static_cast<const void*>(cbc.begin()), static_cast<const void*>(cac.begin()));
CORRADE_COMPARE(static_cast<void*>(d.begin()), static_cast<void*>(a.begin()));
CORRADE_COMPARE(static_cast<const void*>(cd.begin()), static_cast<const void*>(ca.begin()));
CORRADE_COMPARE(static_cast<const void*>(dc.begin()), static_cast<const void*>(ac.begin()));
CORRADE_COMPARE(static_cast<const void*>(cdc.begin()), static_cast<const void*>(cac.begin()));
CORRADE_COMPARE(a.size(), 6);
CORRADE_COMPARE(ca.size(), 6);
CORRADE_COMPARE(ac.size(), 6);
CORRADE_COMPARE(cac.size(), 6);
CORRADE_COMPARE(b.size(), 3);
CORRADE_COMPARE(cb.size(), 3);
CORRADE_COMPARE(bc.size(), 3);
CORRADE_COMPARE(cbc.size(), 3);
CORRADE_COMPARE(d.size(), 12);
CORRADE_COMPARE(cd.size(), 12);
CORRADE_COMPARE(dc.size(), 12);
CORRADE_COMPARE(cdc.size(), 12);
}
void ArrayTest::size() {
Array a{3};
CORRADE_COMPARE(Containers::arraySize(a), 3);
}
void ArrayTest::emplaceConstructorExplicitInCopyInitialization() {
/* See constructHelpers.h for details about this compiler-specific issue */
struct ExplicitDefault {
explicit ExplicitDefault() = default;
};
struct ContainingExplicitDefaultWithImplicitConstructor {
ExplicitDefault a;
};
/* This alone works */
ContainingExplicitDefaultWithImplicitConstructor a;
static_cast<void>(a);
/* So this should too */
Containers::Array<ContainingExplicitDefaultWithImplicitConstructor> b{Corrade::DirectInit, 5};
CORRADE_COMPARE(b.size(), 5);
}
void ArrayTest::copyConstructPlainStruct() {
struct ExtremelyTrivial {
int a;
char b;
};
/* This needs special handling on GCC 4.8, where T{b} (copy-construction)
attempts to convert ExtremelyTrivial to int to initialize the first
argument and fails miserably. */
Containers::Array<ExtremelyTrivial> a{Corrade::DirectInit, 2, 3, 'a'};
CORRADE_COMPARE(a.size(), 2);
/* This copy-constructs the new values */
Containers::Array<ExtremelyTrivial> b{Corrade::InPlaceInit, {
{4, 'b'},
{5, 'c'},
{6, 'd'}
}};
CORRADE_COMPARE(b.size(), 3);
}
void ArrayTest::moveConstructPlainStruct() {
struct MoveOnlyStruct {
int a;
char c;
Array b;
};
/* This needs special handling on GCC 4.8, where T{std::move(b)} attempts
to convert MoveOnlyStruct to int to initialize the first argument and
fails miserably. */
Containers::Array<MoveOnlyStruct> a{Corrade::DirectInit, 2, 3, 'a', nullptr};
CORRADE_COMPARE(a.size(), 2);
/* Unlike with copyConstructPlainStruct(), the InPlaceInit doesn't use
move-construction, so that's not affected */
}
}}}}
CORRADE_TEST_MAIN(Corrade::Containers::Test::ArrayTest)
| [
"mosra@centrum.cz"
] | mosra@centrum.cz |
a917e9de34bb71e7602eca93b15285ee5f74ebfa | ad4051f17e964aaa43cdd7a0349651b7c708cf73 | /MC/MC/mcParticle.cpp | a6995dc0b71954d3e00e58aaf2974555178586d0 | [
"MIT"
] | permissive | RadOncSys/MC | 6f1839878de69cdec8ae0bffa26adf7fe058e55f | 35c924f81a217c1f0814c0f6c725e7d4db77562a | refs/heads/master | 2023-08-24T22:27:06.751628 | 2023-01-29T11:31:24 | 2023-01-29T11:31:24 | 84,407,888 | 5 | 3 | MIT | 2023-06-12T04:30:28 | 2017-03-09T06:45:15 | C++ | UTF-8 | C++ | false | false | 1,192 | cpp | #include "mcParticle.h"
mcParticle::mcParticle(void)
:t(MCP_PHOTON)
, q(0)
, ke(0)
, dnear(0)
, weight(1)
, mfps(0)
, regDensityRatio(1)
, transport_(nullptr)
, transportNearest_(nullptr)
, trackScore_(nullptr)
, thread_(nullptr)
, regionBirth(0)
, regionFlags(0)
, exitSurface_(temb_shit_t::Undefined)
{
}
mcParticle::mcParticle(mc_particle_t pt, int pq, double pke, const geomVector3D& pp, const geomVector3D& pu)
:t(pt)
, q(pq)
, ke(pke)
, p(pp)
, u(pu)
, dnear(0)
, weight(1)
, mfps(0)
, regDensityRatio(1)
, transport_(nullptr)
, transportNearest_(nullptr)
, trackScore_(nullptr)
, thread_(nullptr)
, regionBirth(0)
, regionFlags(0)
, exitSurface_(temb_shit_t::Undefined)
{
}
mcParticle::mcParticle(const mcParticle& p)
:t(p.t)
, q(p.q)
, ke(p.ke)
, p(p.p)
, plast(p.plast)
, u(p.u)
, dnear(p.dnear)
, region(p.region)
, weight(p.weight)
, mfps(p.mfps)
, regDensityRatio(p.regDensityRatio)
, transport_(p.transport_)
, transportNearest_(p.transportNearest_)
, trackScore_(p.trackScore_)
, thread_(p.thread_)
, regionBirth(p.regionBirth)
, regionFlags(p.regionFlags)
, exitSurface_(p.exitSurface_)
{
}
mcParticle::~mcParticle(void)
{
}
| [
"ggorlachev@roiss.ru"
] | ggorlachev@roiss.ru |
16efa0692d9c0a68c32485c4e560daede907eea9 | 22f135cc74821c8d7fbe17a6a6992c7c3dd58904 | /lib/graph_lib_test/MQI_test.cpp | 43af458e125a76c1d4bd7252b5a0085d43442aa9 | [] | no_license | dgleich/graph_lib | 3af4754fd2928bef33c94984129ee068d2513042 | eca3dd2db1671ea47b88c7945ad623eb78549975 | refs/heads/master | 2021-01-21T02:11:33.505932 | 2017-08-29T15:55:10 | 2017-08-29T15:55:10 | 101,885,978 | 0 | 0 | null | 2017-08-30T13:38:51 | 2017-08-30T13:38:51 | null | UTF-8 | C++ | false | false | 2,253 | cpp | #include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <unordered_map>
#include <utility>
#include <stdint.h>
#include <typeinfo>
#include <sstream>
#include <stdio.h>
#include "../include/MQI.h"
#include "../include/MQI_c_interface.h"
#include "../include/readData.hpp"
using namespace std;
int main()
{
cout << "test MQI on file minnesota.smat with 0 offset" << endl;
//Read and convert data
string filename;
filename = "../../graph/minnesota.smat";
int64_t m = 0, n = 0;
int64_t* ai = NULL, *aj = NULL;
double* a = NULL;
read_and_convert<int64_t, int64_t>(filename.c_str(), &m, &n, &ai, &aj, &a);
//Read seed
filename = "../../graph/minnesota_R.smat";
stringstream ss;
int64_t nR = 0;
int64_t* R = NULL;
read_seed<int64_t, int64_t>(filename.c_str(), &nR, &R);
int64_t* ret_set = (int64_t*)malloc(sizeof(int64_t)*nR);
//Begin calling C function
cout << "calling C function" << endl;
int64_t actual_length = MQI64(m, nR, ai, aj, 0, R, ret_set);
cout << "output set" << endl;
for(int i = 0; i < actual_length; i ++){
cout << ret_set[i] << " ";
}
cout << endl << "total number of vertices is " << actual_length << endl;
free(R);
free(ai);
free(aj);
free(a);
//Check the output
cout << "compare the output with correct results" << endl;
filename = "correct_output/MQI/minnesota_results.smat";
char* read_file = readSMAT(filename.c_str());
ss << read_file;
free(read_file);
int64_t correct_length;
ss >> correct_length;
int64_t* correct_ret_set = (int64_t *)malloc(sizeof(int64_t) * correct_length);
for(size_t i = 0; i < correct_length; i ++){
ss >> correct_ret_set[i];
}
ss.str("");
if(actual_length != correct_length){
cout << "output length is not correct!" << endl;
return EXIT_FAILURE;
}
else{
for(size_t i = 0; i < correct_length; i ++){
if(ret_set[i] != correct_ret_set[i]){
cout << "output is not correct!" << endl;
return EXIT_FAILURE;
}
}
}
cout << "output is correct!" << endl;
free(correct_ret_set);
free(ret_set);
return EXIT_SUCCESS;
}
| [
"mengliu@Mengs-MacBook-Pro.local"
] | mengliu@Mengs-MacBook-Pro.local |
8054e683997a38df33b43f79002d84490048cfca | f54159c4c1f64397abdf1bedc60a3c3890747e0b | /Source/OCCore/Task/ITask.h | 90fdc7e575cb1b9d9bc418fe38437223b317281e | [] | no_license | PeterZs/opencine | 36364e68565e9b5ad210e0a0f4ceb645cd9c91e4 | d5816ea59e5dcacf740f062052df3d2bd9bf21eb | refs/heads/master | 2021-01-12T11:40:08.618522 | 2016-07-19T23:07:48 | 2016-07-19T23:07:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 145 | h | #ifndef ITASK_H
#define ITASK_h
#include "OCCore_export.h"
class OCCORE_EXPORT ITask
{
virtual void Run() = 0;
};
#endif //ITAASK_H | [
"b.andrej@cumir.de"
] | b.andrej@cumir.de |
860c1a02db79ada52bf328f6c470ed00b2940c1b | fb61b5a0264d42d976ee383b7302779621aab327 | /02_OF_cylinder/ppGrad/0.7/phi | dee782e14c78d4f3ec8fb46886e6673929f61564 | [] | no_license | Ccaccia73/Aerodinamica | 31062b24a6893262000df2f3d53dde304969182a | 49485cde03a6a4fd569722c9ca4b3558825221ad | refs/heads/master | 2021-01-23T03:16:31.037716 | 2018-01-21T14:55:05 | 2018-01-21T14:55:05 | 86,064,538 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 11,038 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "0.7";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
760
(
3.1633e-05
3.05785e-11
3.1633e-05
8.57218e-12
3.1633e-05
-1.49525e-11
3.1633e-05
6.85631e-12
3.1633e-05
-2.67201e-12
3.1633e-05
1.46245e-12
3.1633e-05
-2.86115e-12
3.1633e-05
4.551e-12
3.1633e-05
2.27768e-12
3.1633e-05
3.41635e-12
3.1633e-05
-4.79949e-13
3.1633e-05
3.98516e-12
3.1633e-05
3.89076e-12
3.1633e-05
5.41142e-12
3.1633e-05
2.90223e-12
3.1633e-05
4.40525e-12
3.1633e-05
5.46735e-13
3.1633e-05
1.19695e-11
3.1633e-05
1.83998e-11
-1.72184e-11
8.85669e-05
8.3847e-11
8.85669e-05
3.72156e-11
8.85669e-05
-3.77787e-11
8.85669e-05
1.28599e-11
8.85669e-05
-4.20931e-12
8.85669e-05
4.09284e-12
8.85669e-05
-5.4047e-12
8.85669e-05
9.56461e-12
8.85669e-05
4.97887e-12
8.85669e-05
8.62918e-12
8.85669e-05
6.75269e-13
8.85669e-05
9.13204e-12
8.85669e-05
8.90901e-12
8.85669e-05
1.25077e-11
8.85669e-05
7.01673e-12
8.85669e-05
1.25248e-11
8.85669e-05
-3.27413e-12
8.85669e-05
3.99605e-11
8.85669e-05
5.31132e-11
-4.36439e-11
0.00013917
1.3741e-10
0.00013917
7.82215e-11
0.00013917
-5.33825e-11
0.00013917
1.58133e-11
0.00013917
-3.64662e-12
0.00013917
6.68848e-12
0.00013917
-5.87131e-12
0.00013917
1.33012e-11
0.00013917
7.61585e-12
0.00013917
1.35416e-11
0.00013917
3.82354e-12
0.00013917
1.46108e-11
0.00013917
1.41008e-11
0.00013917
1.91262e-11
0.00013917
1.14993e-11
0.00013917
2.28718e-11
0.00013917
-9.55083e-12
0.00013917
7.72121e-11
0.00013917
9.52877e-11
-6.73923e-11
0.000183445
1.78103e-10
0.000183445
1.20727e-10
0.000183445
-5.32762e-11
0.000183445
1.88458e-11
0.000183445
-1.64116e-12
0.000183445
9.19358e-12
0.000183445
-4.81941e-12
0.000183445
1.5702e-11
0.000183445
1.00892e-11
0.000183445
1.75134e-11
0.000183445
7.69945e-12
0.000183445
1.98474e-11
0.000183445
1.87851e-11
0.000183445
2.49535e-11
0.000183445
1.55241e-11
0.000183445
3.36024e-11
0.000183445
-1.63562e-11
0.000183445
1.16266e-10
0.000183445
1.40445e-10
-8.44854e-11
0.000221391
1.96109e-10
0.000221391
1.56132e-10
0.000221391
-3.40928e-11
0.000221391
2.4559e-11
0.000221391
2.01466e-12
0.000221391
1.13702e-11
0.000221391
-2.61806e-12
0.000221391
1.72577e-11
0.000221391
1.25086e-11
0.000221391
2.06092e-11
0.000221391
1.1859e-11
0.000221391
2.46128e-11
0.000221391
2.32642e-11
0.000221391
3.00831e-11
0.000221391
1.9154e-11
0.000221391
4.38149e-11
0.000221391
-2.24367e-11
0.000221391
1.52047e-10
0.000221391
1.84205e-10
-9.22696e-11
0.000253011
1.85767e-10
0.000253011
1.77354e-10
0.000253011
3.99085e-12
0.000253011
3.43098e-11
0.000253011
7.29786e-12
0.000253011
1.3179e-11
0.000253011
3.97153e-13
0.000253011
1.81569e-11
0.000253011
1.47659e-11
0.000253011
2.27703e-11
0.000253011
1.59162e-11
0.000253011
2.86265e-11
0.000253011
2.73858e-11
0.000253011
3.4309e-11
0.000253011
2.23222e-11
0.000253011
5.25052e-11
0.000253011
-2.65809e-11
0.000253011
1.80192e-10
0.000253011
2.21934e-10
-8.9448e-11
0.000278306
1.46184e-10
0.000278306
1.8007e-10
0.000278306
5.75301e-11
0.000278306
4.81147e-11
0.000278306
1.39278e-11
0.000278306
1.4596e-11
0.000278306
3.93273e-12
0.000278306
1.85372e-11
0.000278306
1.67557e-11
0.000278306
2.39757e-11
0.000278306
1.96354e-11
0.000278306
3.17569e-11
0.000278306
3.10021e-11
0.000278306
3.74429e-11
0.000278306
2.50355e-11
0.000278306
5.89278e-11
0.000278306
-2.77786e-11
0.000278306
1.97771e-10
0.000278306
2.49515e-10
-7.61915e-11
0.000297276
8.11762e-11
0.000297276
1.63363e-10
0.000297276
1.20653e-10
0.000297276
6.47208e-11
0.000297276
2.13219e-11
0.000297276
1.55617e-11
0.000297276
7.71535e-12
0.000297276
1.84723e-11
0.000297276
1.83903e-11
0.000297276
2.42569e-11
0.000297276
2.28686e-11
0.000297276
3.3946e-11
0.000297276
3.39688e-11
0.000297276
3.93595e-11
0.000297276
2.73125e-11
0.000297276
6.26142e-11
0.000297276
-2.54699e-11
0.000297276
2.03361e-10
0.000297276
2.63916e-10
-5.40083e-11
0.000309923
-1.41532e-12
0.000309923
1.29799e-10
0.000309923
1.86056e-10
0.000309923
8.18831e-11
0.000309923
2.86494e-11
0.000309923
1.59658e-11
0.000309923
1.14804e-11
0.000309923
1.79908e-11
0.000309923
1.95937e-11
0.000309923
2.36818e-11
0.000309923
2.55106e-11
0.000309923
3.51758e-11
0.000309923
3.61522e-11
0.000309923
3.99937e-11
0.000309923
2.91316e-11
0.000309923
6.34035e-11
0.000309923
-1.97023e-11
0.000309923
1.97021e-10
0.000309923
2.6363e-10
-2.54694e-11
0.000316246
-9.09542e-11
0.000316246
8.4853e-11
0.000316246
2.46048e-10
0.000316246
9.68239e-11
0.000316246
3.49505e-11
0.000316246
1.56739e-11
0.000316246
1.49825e-11
0.000316246
1.70993e-11
0.000316246
2.02989e-11
0.000316246
2.23448e-11
0.000316246
2.74845e-11
0.000316246
3.54613e-11
0.000316246
3.74355e-11
0.000316246
3.93463e-11
0.000316246
3.04145e-11
0.000316246
6.14487e-11
0.000316246
-1.11369e-11
0.000316246
1.80119e-10
0.000316246
2.48885e-10
6.17109e-12
0.000316246
-1.75627e-10
0.000316246
3.57925e-11
0.000316246
2.93519e-10
0.000316246
1.06789e-10
0.000316246
3.93133e-11
0.000316246
1.45844e-11
0.000316246
1.80055e-11
0.000316246
1.57996e-11
0.000316246
2.04466e-11
0.000316246
2.03588e-11
0.000316246
2.87323e-11
0.000316246
3.48422e-11
0.000316246
3.77192e-11
0.000316246
3.74775e-11
0.000316246
3.10314e-11
0.000316246
5.71726e-11
0.000316246
-9.36967e-13
0.000316246
1.55066e-10
0.000316246
2.21584e-10
3.73844e-11
0.000309923
-2.44213e-10
0.000309923
-9.7414e-12
0.000309923
3.22737e-10
0.000309923
1.09604e-10
0.000309923
4.10597e-11
0.000309923
1.26912e-11
0.000309923
2.0372e-11
0.000309923
1.41027e-11
0.000309923
1.99871e-11
0.000309923
1.7852e-11
0.000309923
2.92103e-11
0.000309923
3.3378e-11
0.000309923
3.69228e-11
0.000309923
3.44974e-11
0.000309923
3.08289e-11
0.000309923
5.11825e-11
0.000309923
9.43935e-12
0.000309923
1.24977e-10
0.000309923
1.85001e-10
6.47607e-11
0.000297276
-2.87756e-10
0.000297276
-4.51777e-11
0.000297276
3.29974e-10
0.000297276
1.04143e-10
0.000297276
3.9892e-11
0.000297276
1.01299e-11
0.000297276
2.19448e-11
0.000297276
1.20395e-11
0.000297276
1.88849e-11
0.000297276
1.49676e-11
0.000297276
2.88873e-11
0.000297276
3.11433e-11
0.000297276
3.49896e-11
0.000297276
3.0556e-11
0.000297276
2.96718e-11
0.000297276
4.41621e-11
0.000297276
1.84977e-11
0.000297276
9.32872e-11
0.000297276
1.4329e-10
8.53604e-11
0.000278306
-3.00907e-10
0.000278306
-6.62014e-11
0.000278306
3.13945e-10
0.000278306
9.06304e-11
0.000278306
3.59641e-11
0.000278306
7.19041e-12
0.000278306
2.26147e-11
0.000278306
9.67082e-12
0.000278306
1.71272e-11
0.000278306
1.18687e-11
0.000278306
2.77417e-11
0.000278306
2.82224e-11
0.000278306
3.18962e-11
0.000278306
2.58388e-11
0.000278306
2.74903e-11
0.000278306
3.67604e-11
0.000278306
2.49676e-11
0.000278306
6.33373e-11
0.000278306
1.00898e-10
9.70064e-11
0.000253011
-2.82759e-10
0.000253011
-7.14718e-11
0.000253011
2.7607e-10
0.000253011
7.07326e-11
0.000253011
2.98589e-11
0.000253011
4.28289e-12
0.000253011
2.22698e-11
0.000253011
7.0967e-12
0.000253011
1.47359e-11
0.000253011
8.74241e-12
0.000253011
2.5745e-11
0.000253011
2.46949e-11
0.000253011
2.76667e-11
0.000253011
2.05677e-11
0.000253011
2.43095e-11
0.000253011
2.94979e-11
0.000253011
2.80053e-11
0.000253011
3.79477e-11
0.000253011
6.20006e-11
9.85093e-11
0.000221391
-2.37113e-10
0.000221391
-6.27844e-11
0.000221391
2.20545e-10
0.000221391
4.74575e-11
0.000221391
2.2475e-11
0.000221391
1.85418e-12
0.000221391
2.07691e-11
0.000221391
4.48406e-12
0.000221391
1.17971e-11
0.000221391
5.82263e-12
0.000221391
2.28499e-11
0.000221391
2.06357e-11
0.000221391
2.24161e-11
0.000221391
1.50395e-11
0.000221391
2.02883e-11
0.000221391
2.27036e-11
0.000221391
2.73205e-11
0.000221391
1.90398e-11
0.000221391
3.00207e-11
8.98225e-11
0.000183445
-1.7222e-10
0.000183445
-4.46822e-11
0.000183445
1.5433e-10
0.000183445
2.48332e-11
0.000183445
1.48455e-11
0.000183445
2.64795e-13
0.000183445
1.79147e-11
0.000183445
2.14326e-12
0.000183445
8.52019e-12
0.000183445
3.39498e-12
0.000183445
1.89671e-11
0.000183445
1.61332e-11
0.000183445
1.6461e-11
0.000183445
9.69431e-12
0.000183445
1.56982e-11
0.000183445
1.6531e-11
0.000183445
2.31992e-11
0.000183445
7.30141e-12
0.000183445
7.37495e-12
7.21225e-11
0.00013917
-9.98018e-11
0.00013917
-2.38432e-11
0.00013917
8.65736e-11
0.00013917
7.75722e-12
0.00013917
7.85506e-12
0.00013917
-5.30338e-13
0.00013917
1.33242e-11
0.00013917
4.39808e-13
0.00013917
5.17659e-12
0.00013917
1.59932e-12
0.00013917
1.3501e-11
0.00013917
1.09905e-11
0.00013917
1.01748e-11
0.00013917
4.88839e-12
0.00013917
1.05966e-11
0.00013917
1.04665e-11
0.00013917
1.61771e-11
0.00013917
2.04343e-12
0.00013917
-4.94577e-12
4.75816e-11
8.85669e-05
-3.46061e-11
8.85669e-05
-7.699e-12
8.85669e-05
2.9246e-11
8.85669e-05
7.50268e-13
8.85669e-05
1.81809e-12
8.85669e-05
-4.72343e-13
8.85669e-05
6.89832e-12
8.85669e-05
4.82224e-14
8.85669e-05
2.06786e-12
8.85669e-05
5.77924e-13
8.85669e-05
6.27582e-12
8.85669e-05
5.44821e-12
8.85669e-05
4.28557e-12
8.85669e-05
1.2436e-12
8.85669e-05
5.03878e-12
8.85669e-05
4.42293e-12
8.85669e-05
7.43256e-12
8.85669e-05
5.72479e-13
8.85669e-05
-6.80779e-12
1.96939e-11
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
3.1633e-05
)
;
boundaryField
{
top
{
type calculated;
value uniform 0;
}
bottom
{
type calculated;
value uniform 0;
}
inlet
{
type calculated;
value nonuniform List<scalar>
20
(
-3.1633e-05
-8.8567e-05
-0.00013917
-0.000183445
-0.000221391
-0.000253011
-0.000278306
-0.000297276
-0.000309923
-0.000316246
-0.000316246
-0.000309923
-0.000297276
-0.000278306
-0.000253011
-0.000221391
-0.000183445
-0.00013917
-8.85669e-05
-3.1633e-05
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
20
(
3.1633e-05
8.85669e-05
0.00013917
0.000183445
0.000221391
0.000253011
0.000278306
0.000297276
0.000309923
0.000316246
0.000316246
0.000309923
0.000297276
0.000278306
0.000253011
0.000221391
0.000183445
0.00013917
8.85669e-05
3.1633e-05
)
;
}
frontAndBack
{
type empty;
value nonuniform 0();
}
}
// ************************************************************************* //
| [
"c.caccia@libero.it"
] | c.caccia@libero.it | |
6897b89e7239a2276df6e84f9a5771af22b4fe7b | 79e512bdceace8934adbf91f5167d75511d8cfc4 | /1082. ๅฐๅปๆฏ่ต (20).cpp | c8f9d9e5bad7a8dee623a1b5c3bf984950b8fe5d | [] | no_license | iceshadows/PAT_BASIC | c4d2b8ff51f7631523075b88522b14d3ebe0b4a2 | a4af68542d71bffe384a76de57975e7e1eb7c968 | refs/heads/master | 2020-04-06T09:24:38.407794 | 2018-11-13T07:57:22 | 2018-11-13T07:57:22 | 157,341,552 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 449 | cpp | #include <iostream>
using namespace std;
int main() {
int n, id, x, y, maxid, maxdis = -1, minid, mindis = 99999;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> id >> x >> y;
int dis = x * x + y * y;
if (dis > maxdis) maxid = id;
if (dis < mindis) minid = id;
maxdis = max(maxdis, dis);
mindis = min(mindis, dis);
}
printf("%04d %04d", minid, maxid);
return 0;
} | [
"iceshadows@qq.com"
] | iceshadows@qq.com |
d9901f7e05ca75b15567f1effb5228557aaea584 | f99fe9008616902d5ee5e0c01a96f114ef5d8eac | /urlearning/base/node.h | 3754543e735f609735080c210b6d177be5957045 | [
"MIT"
] | permissive | HaoHan1997/urlearning-cpp | 3fa4399eb9d07ab374d0238aaffe3b72fe38cf41 | 0b90679df3055c5558eaa5e78e5d006bd352e58c | refs/heads/master | 2020-09-09T12:51:48.983824 | 2017-03-08T22:33:33 | 2017-03-08T22:33:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,185 | h | /*
* File: Node.h
* Author: malone
*
* Created on August 21, 2012, 10:35 PM
*/
#ifndef NODE_H
#define NODE_H
#include <limits>
#include <iostream>
#include <ostream>
#include <fstream>
#include "typedefs.h"
namespace boost {
namespace serialization {
class access;
}
}
class Node {
public:
Node(): g(0), h(0), subnetwork(varset(0)), leaf(0), pqPos(-1) {}
Node(int variableCount) : g(0), h(0), subnetwork(varset(variableCount)), leaf(0), pqPos(-1) {
}
Node(float g, float h, varset &subnetwork, byte &leaf) :
g(g), h(h), subnetwork(subnetwork), leaf(leaf), pqPos(0) {
}
float getF() const {
return g + h;
}
varset getSubnetwork() const {
return subnetwork;
}
int getPqPos() const {
return pqPos;
}
byte getLeaf() const {
return leaf;
}
float getH() const {
return h;
}
float getG() const {
return g;
}
/**
* Count layer of this node.
* @return
*/
byte getLayer() {
return cardinality(subnetwork);
}
void copy(Node* n) {
g = n->g;
h = n->h;
leaf = n->leaf;
subnetwork = n->subnetwork;
}
void setSubnetwork(varset subnetwork) {
this->subnetwork = subnetwork;
}
void setPqPos(int pqPos) {
this->pqPos = pqPos;
}
void setLeaf(byte leaf) {
this->leaf = leaf;
}
void setG(float g) {
this->g = g;
}
void setH(float h) {
this->h = h;
}
void save(std::ofstream& of) {
of.write((char*)&g, sizeof(g));
of.write((char*)&h, sizeof(h));
of.write((char*)&subnetwork, sizeof(subnetwork));
}
void load(std::ifstream& inf) {
inf.read((char*)&g, sizeof(g));
inf.read((char*)&h, sizeof(h));
inf.read((char*)&subnetwork, sizeof(subnetwork));
}
private:
friend class boost::serialization::access;
// When the class Archive corresponds to an output archive, the
// & operator is defined similar to <<. Likewise, when the class Archive
// is a type of input archive the & operator is defined similar to >>.
template<class Archive>
void serialize(Archive & ar, const unsigned int version) {
ar & g;
ar & h;
ar & subnetwork;
}
protected:
float g;
float h;
varset subnetwork;
byte leaf;
int pqPos;
};
struct CompareNodeStar {
bool operator()(Node *a, Node * b) {
float diff = a->getF() - b->getF();
if (fabs(diff) < std::numeric_limits<float>::epsilon()) {
return (b->getLayer() - a->getLayer()) > 0;
}
return (diff > 0);
}
};
// TODO: make this work for boost::bitset representation
struct CompareNodeStarLexicographic {
bool operator()(Node *a, Node *b) {
int diff = differenceBetweenVarsets(a->getSubnetwork(),b->getSubnetwork());
if (diff == 0) {
diff = a->getF() - b->getF();
if (fabs(diff) < std::numeric_limits<float>::epsilon()) {
return false;
}
}
return (diff > 0);
}
};
#endif /* NODE_H */
| [
"bmmalone@gmail.com"
] | bmmalone@gmail.com |
c800a34e39644b2d1ef399a417dd95af2452ca43 | ed7e1851605dc417f471b24bceaa4efe3ebd577e | /Export/mac64/cpp/release/obj/include/haxe/ds/IntMap.h | 8453efa1ac71e886d5557aca4ee2a0cb850e0e20 | [] | no_license | matthewswallace/StableUITest | 60d88c31540b07b68fc5867cb42901676012cf31 | 8ad46db8245bb8a9bc38b3525dfcdfe90c78b845 | refs/heads/master | 2021-01-12T14:41:07.354460 | 2016-10-26T23:13:43 | 2016-10-26T23:13:43 | 72,050,029 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 3,201 | h | // Generated by Haxe 3.3.0
#ifndef INCLUDED_haxe_ds_IntMap
#define INCLUDED_haxe_ds_IntMap
#ifndef HXCPP_H
#include <hxcpp.h>
#endif
#ifndef INCLUDED_haxe_IMap
#include <haxe/IMap.h>
#endif
HX_DECLARE_CLASS1(haxe,IMap)
HX_DECLARE_CLASS2(haxe,ds,IntMap)
namespace haxe{
namespace ds{
class HXCPP_CLASS_ATTRIBUTES IntMap_obj : public hx::Object
{
public:
typedef hx::Object super;
typedef IntMap_obj OBJ_;
IntMap_obj();
public:
void __construct();
inline void *operator new(size_t inSize, bool inContainer=true,const char *inName="haxe.ds.IntMap")
{ return hx::Object::operator new(inSize,inContainer,inName); }
inline void *operator new(size_t inSize, int extra)
{ return hx::Object::operator new(inSize+extra,true,"haxe.ds.IntMap"); }
static hx::ObjectPtr< IntMap_obj > __new();
static Dynamic __CreateEmpty();
static Dynamic __Create(hx::DynamicArray inArgs);
//~IntMap_obj();
HX_DO_RTTI_ALL;
hx::Val __Field(const ::String &inString, hx::PropertyAccess inCallProp);
hx::Val __SetField(const ::String &inString,const hx::Val &inValue, hx::PropertyAccess inCallProp);
void __GetFields(Array< ::String> &outFields);
static void __register();
void __Mark(HX_MARK_PARAMS);
void __Visit(HX_VISIT_PARAMS);
void *_hx_getInterface(int inHash);
::String __ToString() const { return HX_HCSTRING("IntMap","\x0d","\xa9","\x08","\xd3"); }
::Dynamic h;
void set(Int key, ::Dynamic value);
::Dynamic set_dyn();
::Dynamic get(Int key);
::Dynamic get_dyn();
Bool exists(Int key);
::Dynamic exists_dyn();
Bool remove(Int key);
::Dynamic remove_dyn();
::Dynamic iterator();
::Dynamic iterator_dyn();
inline void set(int key, ::null value) { __int_hash_set(h,key,value); }
inline void set(int key, bool value) { __int_hash_set(h,key,value); }
inline void set(int key, char value) { __int_hash_set_int(h,key,value); }
inline void set(int key, unsigned char value) { __int_hash_set_int(h,key,value); }
inline void set(int key, signed char value) { __int_hash_set_int(h,key,value); }
inline void set(int key, short value) { __int_hash_set_int(h,key,value); }
inline void set(int key, unsigned short value) { __int_hash_set_int(h,key,value); }
inline void set(int key, int value) { __int_hash_set_int(h,key,value); }
inline void set(int key, unsigned int value) { __int_hash_set_int(h,key,value); }
inline void set(int key, float value) { __int_hash_set_float(h,key,value); }
inline void set(int key, double value) { __int_hash_set_float(h,key,value); }
inline void set(int key, ::String value) { __int_hash_set_string(h,key,value); }
template<typename V, typename H>
inline void set(int key, const ::cpp::Struct<V,H> &value) {__int_hash_set(h,key,value); }
template<typename F>
inline void set(int key, const ::cpp::Function<F> &value) {__int_hash_set(h,key,value); }
template<typename V>
inline void set(int key, const ::cpp::Pointer<V> &value) {__int_hash_set(h,key,(Dynamic)value ); }
template<typename VALUE>
inline Void set(Dynamic &key, const VALUE &value) { set( (int)key, value ); return null(); }
};
} // end namespace haxe
} // end namespace ds
#endif /* INCLUDED_haxe_ds_IntMap */
| [
"matthew.wallace@riotgames.com"
] | matthew.wallace@riotgames.com |
86467ebc3dd488319e224ba182622ac50bdbfc70 | 661bf2758579ac8bd7573652f0c90ec68c1b54ec | /Code/Tools/GuiFoundation/Widgets/Implementation/EventTrackWidget.cpp | d6295c724398770ba6e32770ba8174d4feb7d302 | [
"MIT"
] | permissive | rawrunprotected/ezEngine | df42787c258629b02ded372bd29c5e141551208b | ebf64c9b012afdc7f8e549b7a51df01b2eedf998 | refs/heads/master | 2020-04-26T13:19:20.291297 | 2019-02-19T21:27:58 | 2019-02-19T21:27:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 26,959 | cpp | #include <GuiFoundationPCH.h>
#include <Foundation/Containers/HybridArray.h>
#include <Foundation/Strings/StringBuilder.h>
#include <GuiFoundation/Widgets/EventTrackWidget.moc.h>
#include <GuiFoundation/Widgets/GridBarWidget.moc.h>
#include <GuiFoundation/Widgets/WidgetUtils.h>
#include <QPainter>
#include <QRubberBand>
#include <qevent.h>
ezQtEventTrackWidget::ezQtEventTrackWidget(QWidget* parent)
: QWidget(parent)
{
setFocusPolicy(Qt::FocusPolicy::ClickFocus);
setMouseTracking(true);
m_fSceneTranslationX = -2;
m_SceneToPixelScale = QPointF(1, -1);
m_ControlPointBrush.setColor(QColor(200, 150, 0));
m_ControlPointBrush.setStyle(Qt::BrushStyle::SolidPattern);
m_ControlPointPen.setStyle(Qt::PenStyle::DashLine);
m_ControlPointPen.setCosmetic(true);
m_SelectedControlPointBrush.setColor(QColor(220, 200, 50));
m_SelectedControlPointBrush.setStyle(Qt::BrushStyle::SolidPattern);
}
void ezQtEventTrackWidget::SetData(const ezEventTrackData* pData, double fMinCurveLength)
{
m_pEditData = pData;
m_fMaxCurveExtent = fMinCurveLength;
RecreateSortedData();
// // make sure the selection does not contain points that got deleted
// for (ezUInt32 i = 0; i < m_SelectedCPs.GetCount(); )
// {
// if (m_SelectedCPs[i].m_uiCurve >= m_Curves.GetCount() ||
// m_SelectedCPs[i].m_uiPoint >= m_Curves[m_SelectedCPs[i].m_uiCurve].GetNumControlPoints())
// {
// m_SelectedCPs.RemoveAtAndCopy(i);
// }
// else
// {
// ++i;
// }
// }
ComputeSelectionRect();
update();
}
void ezQtEventTrackWidget::RecreateSortedData()
{
for (auto& cat : m_Categories)
{
cat.m_SortedPoints.Clear();
}
for (ezUInt32 idx = 0; idx < m_pEditData->m_ControlPoints.GetCount(); ++idx)
{
const auto& pt = m_pEditData->m_ControlPoints[idx];
ezUInt32 uiCategory = 0;
if (!m_NameToCategory.TryGetValue(pt.m_sEvent, uiCategory))
{
uiCategory = m_Categories.GetCount();
m_NameToCategory[pt.m_sEvent] = uiCategory;
m_Categories.ExpandAndGetRef().m_sName = pt.m_sEvent;
}
auto& npt = m_Categories[uiCategory].m_SortedPoints.ExpandAndGetRef();
npt.m_uiOrgIndex = idx;
npt.m_fPosX = pt.GetTickAsTime().GetSeconds();
}
// actually this is not needed (or used)
// and when we sort, the selection index does not match when moving points around
// sort points by X position
// for (auto& cat : m_Categories)
//{
// cat.m_SortedPoints.Sort([](const ezQtEventTrackWidget::Point& lhs, const ezQtEventTrackWidget::Point& rhs) -> bool
// {
// return lhs.m_fPosX < rhs.m_fPosX;
// });
//}
}
void ezQtEventTrackWidget::SetScrubberPosition(double fPosition)
{
m_bShowScrubber = true;
m_fScrubberPosition = fPosition;
update();
}
void ezQtEventTrackWidget::FrameCurve()
{
m_bFrameBeforePaint = false;
double fWidth = m_fMaxCurveExtent;
double fOffsetX = 0;
if (m_pEditData->m_ControlPoints.GetCount() == 0)
{
fWidth = 10.0;
}
else if (m_SelectedPoints.GetCount() > 1)
{
double minX = m_Categories[m_SelectedPoints[0].m_uiCategory].m_SortedPoints[m_SelectedPoints[0].m_uiSortedIdx].m_fPosX;
double maxX = minX;
for (const auto& cpSel : m_SelectedPoints)
{
const double pos = m_Categories[cpSel.m_uiCategory].m_SortedPoints[cpSel.m_uiSortedIdx].m_fPosX;
minX = ezMath::Min(minX, pos);
maxX = ezMath::Max(maxX, pos);
}
// fWidth = m_selectionBRect.width();
// fOffsetX = m_selectionBRect.left();
fWidth = maxX - minX;
fOffsetX = minX;
}
else if (m_SelectedPoints.GetCount() == 1)
{
fWidth = 0.1f;
fOffsetX = m_Categories[m_SelectedPoints[0].m_uiCategory].m_SortedPoints[m_SelectedPoints[0].m_uiSortedIdx].m_fPosX - 0.05;
}
fWidth = ezMath::Max(fWidth, 0.1);
const double fFinalWidth = fWidth * 1.2;
fOffsetX -= (fFinalWidth - fWidth) * 0.5;
m_SceneToPixelScale.setX(rect().width() / fFinalWidth);
m_fSceneTranslationX = fOffsetX;
ClampZoomPan();
update();
}
QPoint ezQtEventTrackWidget::MapFromScene(const QPointF& pos) const
{
double x = pos.x() - m_fSceneTranslationX;
double y = pos.y();
x *= m_SceneToPixelScale.x();
y *= m_SceneToPixelScale.y();
return QPoint((int)x, (int)y);
}
QPointF ezQtEventTrackWidget::MapToScene(const QPoint& pos) const
{
double x = pos.x();
double y = pos.y();
x /= m_SceneToPixelScale.x();
y /= m_SceneToPixelScale.y();
return QPointF(x + m_fSceneTranslationX, y);
}
void ezQtEventTrackWidget::ClearSelection()
{
m_selectionBRect = QRectF();
if (!m_SelectedPoints.IsEmpty())
{
for (const auto& cpSel : m_SelectedPoints)
{
m_Categories[cpSel.m_uiCategory].m_SortedPoints[cpSel.m_uiSortedIdx].m_bSelected = false;
}
m_SelectedPoints.Clear();
update();
}
Q_EMIT SelectionChangedEvent();
}
void ezQtEventTrackWidget::GetSelection(ezHybridArray<ezUInt32, 32>& out_Selection) const
{
out_Selection.Clear();
for (const auto& pt : m_SelectedPoints)
{
out_Selection.PushBack(m_Categories[pt.m_uiCategory].m_SortedPoints[pt.m_uiSortedIdx].m_uiOrgIndex);
}
}
bool ezQtEventTrackWidget::IsSelected(SelectedPoint cp) const
{
return m_Categories[cp.m_uiCategory].m_SortedPoints[cp.m_uiSortedIdx].m_bSelected;
}
void ezQtEventTrackWidget::SetSelection(SelectedPoint cp)
{
ClearSelection();
m_SelectedPoints.PushBack(cp);
m_Categories[cp.m_uiCategory].m_SortedPoints[cp.m_uiSortedIdx].m_bSelected = true;
ComputeSelectionRect();
Q_EMIT SelectionChangedEvent();
}
void ezQtEventTrackWidget::SetSelection(const ezHybridArray<SelectedPoint, 32>& selection)
{
for (const auto& cpSel : m_SelectedPoints)
{
m_Categories[cpSel.m_uiCategory].m_SortedPoints[cpSel.m_uiSortedIdx].m_bSelected = false;
}
m_SelectedPoints = selection;
for (const auto& cpSel : m_SelectedPoints)
{
m_Categories[cpSel.m_uiCategory].m_SortedPoints[cpSel.m_uiSortedIdx].m_bSelected = true;
}
Q_EMIT SelectionChangedEvent();
}
void ezQtEventTrackWidget::ToggleSelected(SelectedPoint cp)
{
SetSelected(cp, !IsSelected(cp));
ComputeSelectionRect();
Q_EMIT SelectionChangedEvent();
}
void ezQtEventTrackWidget::SetSelected(SelectedPoint cp, bool set)
{
if (m_Categories[cp.m_uiCategory].m_SortedPoints[cp.m_uiSortedIdx].m_bSelected == set)
return;
m_Categories[cp.m_uiCategory].m_SortedPoints[cp.m_uiSortedIdx].m_bSelected = set;
if (!set)
{
m_SelectedPoints.RemoveAndCopy(cp);
}
else
{
m_SelectedPoints.PushBack(cp);
}
ComputeSelectionRect();
Q_EMIT SelectionChangedEvent();
}
QRectF ezQtEventTrackWidget::ComputeViewportSceneRect() const
{
const QPointF topLeft = MapToScene(rect().topLeft());
const QPointF bottomRight = MapToScene(rect().bottomRight());
return QRectF(topLeft, bottomRight);
}
static ezColorGammaUB g_EventColors[10 * 3] = {
ezColorGammaUB(255, 102, 0), ezColorGammaUB(76, 255, 0), ezColorGammaUB(0, 255, 255), ezColorGammaUB(239, 35, 0),
ezColorGammaUB(127, 255, 0), ezColorGammaUB(0, 0, 255), ezColorGammaUB(205, 92, 92), ezColorGammaUB(120, 158, 39),
ezColorGammaUB(81, 120, 188), ezColorGammaUB(255, 105, 180), ezColorGammaUB(0, 250, 154), ezColorGammaUB(0, 191, 255),
ezColorGammaUB(220, 20, 60), ezColorGammaUB(0, 255, 127), ezColorGammaUB(30, 144, 255), ezColorGammaUB(240, 128, 128),
ezColorGammaUB(60, 179, 113), ezColorGammaUB(135, 206, 250), ezColorGammaUB(178, 34, 34), ezColorGammaUB(46, 139, 87),
ezColorGammaUB(65, 105, 225), ezColorGammaUB(211, 122, 122), ezColorGammaUB(144, 238, 144), ezColorGammaUB(135, 206, 235),
ezColorGammaUB(219, 112, 147), ezColorGammaUB(0, 128, 0), ezColorGammaUB(70, 130, 180), ezColorGammaUB(255, 182, 193),
ezColorGammaUB(102, 205, 170), ezColorGammaUB(100, 149, 237),
};
void ezQtEventTrackWidget::paintEvent(QPaintEvent* e)
{
if (m_bFrameBeforePaint)
FrameCurve();
ClampZoomPan();
QPainter painter(this);
painter.fillRect(rect(), palette().base());
painter.translate(0.5, 0.5);
painter.setRenderHint(QPainter::Antialiasing, true);
const QRectF viewportSceneRect = ComputeViewportSceneRect();
double fFineGridDensity = 0.01;
double fRoughGridDensity = 0.01;
ezWidgetUtils::AdjustGridDensity(fFineGridDensity, fRoughGridDensity, rect().width(), viewportSceneRect.width(), 20);
RenderVerticalGrid(&painter, viewportSceneRect, fRoughGridDensity);
if (m_pGridBar)
{
m_pGridBar->SetConfig(viewportSceneRect, fRoughGridDensity, fFineGridDensity,
[this](const QPointF& pt) -> QPoint { return MapFromScene(pt); });
}
PaintOutsideAreaOverlay(&painter);
PaintControlPoints(&painter);
PaintMultiSelectionSquare(&painter);
PaintScrubber(painter);
}
void ezQtEventTrackWidget::ClampZoomPan()
{
m_fSceneTranslationX = ezMath::Clamp(m_fSceneTranslationX, -2.0, 50000.0);
m_SceneToPixelScale.setX(ezMath::Clamp(m_SceneToPixelScale.x(), 0.0005, 10000.0));
m_SceneToPixelScale.setY(ezMath::Clamp(m_SceneToPixelScale.y(), -10000.0, -0.0005));
}
void ezQtEventTrackWidget::mousePressEvent(QMouseEvent* e)
{
QWidget::mousePressEvent(e);
m_LastMousePos = e->pos();
if (m_State != EditState::None)
return;
if (e->button() == Qt::RightButton)
{
m_State = EditState::RightClick;
return;
}
if (e->buttons() == Qt::LeftButton) // nothing else pressed
{
const ClickTarget clickedOn = DetectClickTarget(e->pos());
if (clickedOn == ClickTarget::Nothing || clickedOn == ClickTarget::SelectedPoint)
{
if (e->modifiers() == Qt::NoModifier)
{
m_scaleStartPoint = MapToScene(e->pos());
switch (WhereIsPoint(e->pos()))
{
case ezQtEventTrackWidget::SelectArea::Center:
m_State = EditState::DraggingPoints;
m_totalPointDrag = QPointF();
break;
case ezQtEventTrackWidget::SelectArea::Left:
m_State = EditState::ScaleLeftRight;
m_scaleReferencePoint = m_selectionBRect.topRight();
break;
case ezQtEventTrackWidget::SelectArea::Right:
m_State = EditState::ScaleLeftRight;
m_scaleReferencePoint = m_selectionBRect.topLeft();
break;
}
}
if (m_State == EditState::None)
{
SelectedPoint selectedCP;
if (PickCpAt(e->pos(), 8, selectedCP))
{
if (e->modifiers().testFlag(Qt::ControlModifier))
{
ToggleSelected(selectedCP);
}
else if (e->modifiers().testFlag(Qt::ShiftModifier))
{
SetSelected(selectedCP, true);
}
else if (e->modifiers().testFlag(Qt::AltModifier))
{
SetSelected(selectedCP, false);
}
else
{
if (clickedOn == ClickTarget::Nothing)
SetSelection(selectedCP);
m_State = EditState::DraggingPoints;
m_totalPointDrag = QPointF();
}
}
}
if (m_State == EditState::None)
{
m_State = EditState::MultiSelect;
}
EZ_ASSERT_DEBUG(!m_bBegunChanges, "Invalid State");
if (m_State == EditState::DraggingPoints)
{
Q_EMIT BeginOperationEvent("Drag Points");
m_bBegunChanges = true;
}
else if (m_State == EditState::ScaleLeftRight)
{
Q_EMIT BeginOperationEvent("Scale Points Left / Right");
m_bBegunChanges = true;
}
update();
}
}
if (m_State == EditState::MultiSelect && m_pRubberband == nullptr)
{
m_multiSelectionStart = e->pos();
m_multiSelectRect = QRect();
m_pRubberband = new QRubberBand(QRubberBand::Shape::Rectangle, this);
m_pRubberband->setGeometry(QRect(m_multiSelectionStart, QSize()));
m_pRubberband->hide();
}
}
void ezQtEventTrackWidget::mouseReleaseEvent(QMouseEvent* e)
{
QWidget::mouseReleaseEvent(e);
if (e->button() == Qt::RightButton)
{
if (m_State == EditState::Panning)
m_State = EditState::None;
if (m_State == EditState::RightClick)
{
m_State = EditState::None;
ContextMenuEvent(mapToGlobal(e->pos()), MapToScene(e->pos()));
}
}
if (e->button() == Qt::LeftButton &&
(m_State == EditState::DraggingPoints || m_State == EditState::ScaleLeftRight || m_State == EditState::MultiSelect))
{
m_State = EditState::None;
m_totalPointDrag = QPointF();
if (m_bBegunChanges)
{
m_bBegunChanges = false;
Q_EMIT EndOperationEvent(true);
}
update();
}
if (m_State != EditState::MultiSelect && m_pRubberband)
{
delete m_pRubberband;
m_pRubberband = nullptr;
if (!m_multiSelectRect.isEmpty())
{
ezHybridArray<SelectedPoint, 32> newSelection = m_SelectedPoints;
ezHybridArray<SelectedPoint, 32> change;
ExecMultiSelection(change);
m_multiSelectRect = QRect();
if (e->modifiers().testFlag(Qt::AltModifier))
{
CombineSelection(newSelection, change, false);
}
else if (e->modifiers().testFlag(Qt::ShiftModifier) || e->modifiers().testFlag(Qt::ControlModifier))
{
CombineSelection(newSelection, change, true);
}
else
{
newSelection = change;
}
SetSelection(newSelection);
ComputeSelectionRect();
update();
Q_EMIT SelectionChangedEvent();
}
}
if (e->buttons() == Qt::NoButton)
{
unsetCursor();
m_State = EditState::None;
if (m_bBegunChanges)
{
m_bBegunChanges = false;
Q_EMIT EndOperationEvent(true);
}
update();
}
}
void ezQtEventTrackWidget::mouseMoveEvent(QMouseEvent* e)
{
QWidget::mouseMoveEvent(e);
Qt::CursorShape cursor = Qt::ArrowCursor;
const QPoint diff = e->pos() - m_LastMousePos;
double moveX = (double)diff.x() / m_SceneToPixelScale.x();
double moveY = 0; // (double)diff.y() / m_SceneToPixelScale.y();
if (m_State == EditState::RightClick || m_State == EditState::Panning)
{
m_State = EditState::Panning;
cursor = Qt::ClosedHandCursor;
m_fSceneTranslationX = m_fSceneTranslationX - moveX;
ClampZoomPan();
update();
}
if (m_State == EditState::DraggingPoints)
{
MoveControlPointsEvent(moveX);
m_totalPointDrag += QPointF(moveX, moveY);
}
if (m_State == EditState::MultiSelect && m_pRubberband)
{
m_multiSelectRect = QRect(m_multiSelectionStart, e->pos()).normalized();
m_pRubberband->setGeometry(m_multiSelectRect);
m_pRubberband->show();
}
if (m_State == EditState::None && !m_selectionBRect.isEmpty())
{
switch (WhereIsPoint(e->pos()))
{
case ezQtEventTrackWidget::SelectArea::Center:
// cursor = Qt::SizeAllCursor;
break;
case ezQtEventTrackWidget::SelectArea::Left:
case ezQtEventTrackWidget::SelectArea::Right:
cursor = Qt::SizeHorCursor;
break;
}
}
if (m_State == EditState::ScaleLeftRight)
{
cursor = Qt::SizeHorCursor;
const QPointF wsPos = MapToScene(e->pos());
const QPointF norm = m_scaleReferencePoint - m_scaleStartPoint;
const QPointF wsDiff = m_scaleReferencePoint - wsPos;
ScaleControlPointsEvent(m_scaleReferencePoint, wsDiff.x() / norm.x());
}
setCursor(cursor);
m_LastMousePos = e->pos();
}
void ezQtEventTrackWidget::mouseDoubleClickEvent(QMouseEvent* e)
{
QWidget::mouseDoubleClickEvent(e);
if (e->button() == Qt::LeftButton)
{
SelectedPoint selPt;
if (PickCpAt(e->pos(), 15, selPt))
{
SetSelection(selPt);
}
else
{
const QPointF epsilon = MapToScene(QPoint(15, 15)) - MapToScene(QPoint(0, 0));
const QPointF scenePos = MapToScene(e->pos());
if (m_bBegunChanges)
{
m_bBegunChanges = false;
Q_EMIT EndOperationEvent(true);
}
Q_EMIT DoubleClickEvent(scenePos.x(), epsilon.x());
}
}
}
void ezQtEventTrackWidget::wheelEvent(QWheelEvent* e)
{
const double ptAtX = MapToScene(mapFromGlobal(e->globalPos())).x();
double posDiff = m_fSceneTranslationX - ptAtX;
double changeX = 1.2;
double changeY = 1.2;
if (e->modifiers().testFlag(Qt::ShiftModifier))
changeX = 1;
if (e->modifiers().testFlag(Qt::ControlModifier))
changeY = 1;
const double oldScaleX = m_SceneToPixelScale.x();
const double oldScaleY = m_SceneToPixelScale.y();
if (e->delta() > 0)
{
m_SceneToPixelScale.setX(m_SceneToPixelScale.x() * changeX);
m_SceneToPixelScale.setY(m_SceneToPixelScale.y() * changeY);
}
else
{
m_SceneToPixelScale.setX(m_SceneToPixelScale.x() * (1.0 / changeX));
m_SceneToPixelScale.setY(m_SceneToPixelScale.y() * (1.0 / changeY));
}
ClampZoomPan();
changeX = m_SceneToPixelScale.x() / oldScaleX;
changeY = m_SceneToPixelScale.y() / oldScaleY;
posDiff = posDiff * (1.0 / changeX);
m_fSceneTranslationX = ptAtX + posDiff;
ClampZoomPan();
update();
}
void ezQtEventTrackWidget::keyPressEvent(QKeyEvent* e)
{
QWidget::keyPressEvent(e);
if (e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_F)
{
FrameCurve();
}
if (e->modifiers() == Qt::NoModifier)
{
if (e->key() == Qt::Key_Escape)
{
ClearSelection();
}
if (e->key() == Qt::Key_Delete)
{
Q_EMIT DeleteControlPointsEvent();
ClearSelection();
}
}
}
void ezQtEventTrackWidget::PaintOutsideAreaOverlay(QPainter* painter) const
{
const int iRightEdge = MapFromScene(QPointF(ezMath::Max(0.0, m_fMaxCurveExtent), 0)).x();
if (iRightEdge >= rect().width())
return;
QRect area = rect();
area.setLeft(iRightEdge);
QBrush b;
b.setColor(palette().light().color());
b.setStyle(Qt::BrushStyle::Dense6Pattern);
painter->setPen(Qt::NoPen);
painter->setBrush(b);
painter->drawRect(area);
}
void ezQtEventTrackWidget::PaintControlPoints(QPainter* painter) const
{
if (m_Categories.IsEmpty())
return;
painter->save();
ezHybridArray<QLineF, 100> lines;
ezHybridArray<QRectF, 100> rects;
ezHybridArray<QLineF, 100> linesSelected;
ezHybridArray<QRectF, 100> rectsSelected;
const double fRectLeft = rect().left() - 10;
const double fRectRight = rect().right() + 10;
const double fHeight = rect().bottom() - rect().top();
const double fStepY = fHeight / m_Categories.GetCount();
const double fLineStepY = fStepY / 3.5;
double fOffsetY = rect().top() + fStepY * 0.5;
for (ezUInt32 catIdx = 0; catIdx < m_Categories.GetCount(); ++catIdx)
{
const PointCategory& cat = m_Categories[catIdx];
const auto& allPoints = cat.m_SortedPoints;
for (const auto& point : allPoints)
{
double ptPosX = MapFromScene(QPointF(point.m_fPosX, 0)).x();
if (ptPosX < fRectLeft || ptPosX > fRectRight)
continue;
QLineF& l = point.m_bSelected ? linesSelected.ExpandAndGetRef() : lines.ExpandAndGetRef();
l.setLine(ptPosX, fOffsetY - fLineStepY, ptPosX, fOffsetY + fLineStepY);
QRectF& r = point.m_bSelected ? rectsSelected.ExpandAndGetRef() : rects.ExpandAndGetRef();
r.setX(ptPosX - 5.0);
r.setY(fOffsetY - 5.0);
r.setWidth(10.0);
r.setHeight(10.0);
}
QBrush brush = m_ControlPointBrush;
QPen pen = m_ControlPointPen;
if (!rects.IsEmpty())
{
const ezColorGammaUB& col = g_EventColors[catIdx % EZ_ARRAY_SIZE(g_EventColors)];
brush.setColor(qRgb(col.r, col.g, col.b));
pen.setColor(qRgb(col.r, col.g, col.b));
painter->setBrush(brush);
painter->setPen(pen);
painter->drawLines(lines.GetData(), lines.GetCount());
painter->setPen(Qt::NoPen);
painter->drawRects(rects.GetData(), rects.GetCount());
lines.Clear();
rects.Clear();
}
if (!rectsSelected.IsEmpty())
{
const QColor hlCol = palette().highlight().color();
brush.setColor(hlCol);
pen.setColor(hlCol);
pen.setStyle(Qt::PenStyle::SolidLine);
painter->setBrush(brush);
painter->setPen(pen);
painter->drawLines(linesSelected.GetData(), linesSelected.GetCount());
painter->drawRects(rectsSelected.GetData(), rectsSelected.GetCount());
linesSelected.Clear();
rectsSelected.Clear();
}
fOffsetY += fStepY;
}
painter->restore();
}
void ezQtEventTrackWidget::PaintMultiSelectionSquare(QPainter* painter) const
{
if (m_selectionBRect.isEmpty())
return;
painter->save();
painter->setPen(Qt::NoPen);
QColor col = palette().highlight().color();
col.setAlpha(100);
painter->setBrush(col);
const QPoint tl = MapFromScene(m_selectionBRect.topLeft());
const QPoint br = MapFromScene(m_selectionBRect.bottomRight());
QRectF r = QRect(tl, br);
r.adjust(-4.5, +4.5, +3.5, -5.5);
painter->drawRect(r);
col.setAlpha(255);
QPen pen(col);
pen.setStyle(Qt::PenStyle::SolidLine);
pen.setCosmetic(true);
pen.setWidth(1);
pen.setCapStyle(Qt::PenCapStyle::SquareCap);
painter->setPen(pen);
painter->drawLine(tl.x() - 10, tl.y(), tl.x() - 10, br.y());
painter->drawLine(br.x() + 10, tl.y(), br.x() + 10, br.y());
// painter->drawLine(tl.x(), br.y() - 10, br.x(), br.y() - 10);
// painter->drawLine(tl.x(), tl.y() + 10, br.x(), tl.y() + 10);
painter->restore();
}
void ezQtEventTrackWidget::PaintScrubber(QPainter& p) const
{
if (!m_bShowScrubber)
return;
const QRect area = rect();
const ezInt32 xPos = MapFromScene(QPointF(m_fScrubberPosition, 0)).x();
if (xPos < 0 || xPos > area.width())
return;
p.save();
QPen pen;
pen.setCosmetic(true);
pen.setColor(palette().highlight().color());
pen.setWidth(1);
p.setPen(pen);
p.drawLine(QLine(xPos, area.top(), xPos, area.bottom()));
p.restore();
}
void ezQtEventTrackWidget::RenderVerticalGrid(QPainter* painter, const QRectF& viewportSceneRect, double fRoughGridDensity)
{
double lowX, highX;
ezWidgetUtils::ComputeGridExtentsX(viewportSceneRect, fRoughGridDensity, lowX, highX);
lowX = ezMath::Max(lowX, 0.0);
const int iy = rect().bottom();
// render grid lines
{
QPen pen(palette().light(), 1.0f);
pen.setCosmetic(true);
painter->setPen(pen);
ezHybridArray<QLine, 100> lines;
for (double x = lowX; x <= highX; x += fRoughGridDensity)
{
const int ix = MapFromScene(QPointF(x, x)).x();
QLine& l = lines.ExpandAndGetRef();
l.setLine(ix, 0, ix, iy);
}
painter->drawLines(lines.GetData(), lines.GetCount());
}
}
bool ezQtEventTrackWidget::PickCpAt(const QPoint& pos, float fMaxPixelDistance, SelectedPoint& out_Result) const
{
const ezVec2 at((float)pos.x(), (float)pos.y());
float fMaxDistSqr = ezMath::Square(fMaxPixelDistance);
out_Result.m_uiCategory = 0xFFFFFFFF;
out_Result.m_uiSortedIdx = 0xFFFFFFFF;
const double fHeight = rect().bottom() - rect().top();
const double fStepY = fHeight / m_Categories.GetCount();
double fOffsetY = rect().top() + fStepY * 0.5;
for (ezUInt32 catIdx = 0; catIdx < m_Categories.GetCount(); ++catIdx)
{
const auto& cat = m_Categories[catIdx];
const double diffY = fOffsetY - pos.y();
if (ezMath::Abs(diffY) < 20)
{
const auto& allPoints = cat.m_SortedPoints;
for (ezUInt32 ptIdx = 0; ptIdx < allPoints.GetCount(); ++ptIdx)
{
const auto& point = allPoints[ptIdx];
double ptPosX = MapFromScene(QPointF(point.m_fPosX, 0)).x();
const ezVec2 fDiff(ptPosX - pos.x(), diffY);
const float fDistSqr = fDiff.GetLengthSquared();
if (fDistSqr <= fMaxDistSqr)
{
fMaxDistSqr = fDistSqr;
out_Result.m_uiCategory = catIdx;
out_Result.m_uiSortedIdx = ptIdx;
}
}
}
fOffsetY += fStepY;
}
return out_Result.m_uiSortedIdx != 0xFFFFFFFF;
}
ezQtEventTrackWidget::ClickTarget ezQtEventTrackWidget::DetectClickTarget(const QPoint& pos)
{
SelectedPoint ptSel;
if (PickCpAt(pos, 15.0f, ptSel))
{
if (IsSelected(ptSel))
return ClickTarget::SelectedPoint;
}
return ClickTarget::Nothing;
}
void ezQtEventTrackWidget::ExecMultiSelection(ezHybridArray<SelectedPoint, 32>& out_Selection)
{
out_Selection.Clear();
const double fHeight = rect().bottom() - rect().top();
const double fStepY = fHeight / m_Categories.GetCount();
double fOffsetY = rect().top() + fStepY * 0.5;
for (ezUInt32 catIdx = 0; catIdx < m_Categories.GetCount(); ++catIdx)
{
const PointCategory& cat = m_Categories[catIdx];
const auto& allPoints = cat.m_SortedPoints;
const int iY = (int)fOffsetY;
for (ezUInt32 ptIdx = 0; ptIdx < allPoints.GetCount(); ++ptIdx)
{
const auto& point = allPoints[ptIdx];
QPoint cpPos = MapFromScene(QPointF(point.m_fPosX, 0));
cpPos.setY(iY);
if (m_multiSelectRect.contains(cpPos))
{
auto& sel = out_Selection.ExpandAndGetRef();
sel.m_uiCategory = catIdx;
sel.m_uiSortedIdx = ptIdx;
}
}
fOffsetY += fStepY;
}
}
bool ezQtEventTrackWidget::CombineSelection(ezHybridArray<SelectedPoint, 32>& inout_Selection,
const ezHybridArray<SelectedPoint, 32>& change, bool add)
{
bool bChange = false;
for (ezUInt32 i = 0; i < change.GetCount(); ++i)
{
const auto& cp = change[i];
if (!add)
{
bChange |= inout_Selection.RemoveAndCopy(cp);
}
else if (!inout_Selection.Contains(cp))
{
inout_Selection.PushBack(cp);
bChange = true;
}
}
return bChange;
}
void ezQtEventTrackWidget::ComputeSelectionRect()
{
m_selectionBRect = QRectF();
if (m_SelectedPoints.GetCount() < 2)
return;
ezBoundingBox bbox;
bbox.SetInvalid();
// TODO: properly implement the Y value
// for (const auto& cpSel : m_SelectedPoints)
//{
// const double pos = m_Categories[cpSel.m_uiCategory].m_SortedPoints[cpSel.m_uiSortedIdx].m_fPosX;
// bbox.ExpandToInclude(ezVec3(pos, cpSel.m_uiCategory - 1, 0));
// bbox.ExpandToInclude(ezVec3(pos, cpSel.m_uiCategory + 1, 0));
//}
if (bbox.IsValid())
{
m_selectionBRect.setCoords(bbox.m_vMin.x, bbox.m_vMin.y, bbox.m_vMax.x, bbox.m_vMax.y);
m_selectionBRect.normalized();
}
}
ezQtEventTrackWidget::SelectArea ezQtEventTrackWidget::WhereIsPoint(QPoint pos) const
{
if (m_selectionBRect.isEmpty())
return SelectArea::None;
const QPoint tl = MapFromScene(m_selectionBRect.topLeft());
const QPoint br = MapFromScene(m_selectionBRect.bottomRight());
QRect selectionRectSS = QRect(tl, br);
selectionRectSS.adjust(-4.5, +4.5, +3.5, -5.5);
const QRect barLeft(selectionRectSS.left() - 10, selectionRectSS.top(), 10, selectionRectSS.height());
const QRect barRight(selectionRectSS.right(), selectionRectSS.top(), 10, selectionRectSS.height());
if (barLeft.contains(pos))
return SelectArea::Left;
if (barRight.contains(pos))
return SelectArea::Right;
if (selectionRectSS.contains(pos))
return SelectArea::Center;
return SelectArea::None;
}
| [
"jan@krassnigg.de"
] | jan@krassnigg.de |
a63d5aaca594e8faeaf6cddf39426c7ed557e173 | 04e442bcfea57602f06b62b1a84e9ff7bdb0f41a | /src/net_processing.h | db04b6014c914a5001eeadbe1fb941be9f44569c | [
"MIT"
] | permissive | amiller87/puracore | e0c8429f86ea9b3029a589b650ce5235b6dd8006 | 1f96477266f247dc9235e8a7c18c07d9743373a3 | refs/heads/master | 2021-01-19T23:21:27.328913 | 2017-08-24T06:58:36 | 2017-08-24T07:44:54 | 101,263,827 | 0 | 2 | null | 2017-09-02T21:27:49 | 2017-08-24T06:54:46 | C++ | UTF-8 | C++ | false | false | 1,786 | h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_NET_PROCESSING_H
#define BITCOIN_NET_PROCESSING_H
#include "net.h"
#include "validationinterface.h"
/** Register with a network node to receive its signals */
void RegisterNodeSignals(CNodeSignals& nodeSignals);
/** Unregister a network node */
void UnregisterNodeSignals(CNodeSignals& nodeSignals);
class PeerLogicValidation : public CValidationInterface {
private:
CConnman* connman;
public:
PeerLogicValidation(CConnman* connmanIn);
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
virtual void BlockChecked(const CBlock& block, const CValidationState& state);
};
struct CNodeStateStats {
int nMisbehavior;
int nSyncHeight;
int nCommonHeight;
std::vector<int> vHeightInFlight;
};
/** Get statistics from node state */
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);
/** Increase a node's misbehavior score. */
void Misbehaving(NodeId nodeid, int howmuch);
/** Process protocol messages received from a given node */
bool ProcessMessages(CNode* pfrom, CConnman& connman, std::atomic<bool>& interrupt);
/**
* Send queued protocol messages to be sent to a give node.
*
* @param[in] pto The node which we are sending messages to.
* @param[in] connman The connection manager for that node.
* @param[in] interrupt Interrupt condition for processing threads
*/
bool SendMessages(CNode* pto, CConnman& connman, std::atomic<bool>& interrupt);
#endif // BITCOIN_NET_PROCESSING_H
| [
"pura@pura1"
] | pura@pura1 |
cd62af27ded35cde0db1acd8f49fb6e69e19db7c | 1bc8d532f358caec8f06f514dbfdd59eb7cf897e | /srcanamdw_os/leavescan/test/testcases/DEF-testcases/pct-leavescan-def132396-338.cpp | 5c44c18513c36c4fe6e7f1c02051421c21071738 | [] | no_license | SymbianSource/oss.FCL.sf.os.buildtools | 9cd33884e5f7dd49dce8016a79b9443cc3551b07 | 7b35cd328d3a5e8e0bc177d0169fd409c3273193 | refs/heads/master | 2021-01-12T10:57:19.083691 | 2010-07-13T15:41:02 | 2010-07-13T15:41:02 | 72,765,750 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 617 | cpp | /*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
//desc: test class name identify
//option:
//date:2009-1-12 11:0:58
//author:bolowyou
//type: CT
template<typename t, class tt>
class Aclass
{
LCleanedup mem; //check:Aclass
};
| [
"kirill.dremov@nokia.com"
] | kirill.dremov@nokia.com |
33314a6c42bf6c106019a3df9bb21ec320d75a02 | dff7a6adb387f96aac7dccbe564b4e2509041c6c | /dht.ino | 5373033626c3eba37c5d4e9debf32a9921187c83 | [
"Apache-2.0"
] | permissive | zerrium/Fuzzy_Arduino | b9bf428b865bd0afd9b3938aae5a81e732492bae | 9f500242951d4f6ae08b79d7738e5e7de7ac6afa | refs/heads/master | 2023-01-06T19:13:39.328533 | 2020-11-09T10:09:32 | 2020-11-09T10:09:32 | 277,310,702 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 945 | ino | #include <DHT.h>;
const int led = 23;
int count = 0;
const int DHTPIN = 22; // what pin we're connected to
#define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino
//Variables
int chk;
float hum; //Stores humidity value
float temp; //Stores temperature value
void setup() {
Serial.begin(115200);
dht.begin();
Serial.println("Test");
}
void loop() {
/*
count++;
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
Serial.println(count);
*/
//Read data and store it to variables hum and temp
hum = dht.readHumidity();
temp= dht.readTemperature();
//Print temp and humidity values to serial monitor
Serial.print("Humidity: ");
Serial.print(hum);
Serial.print(" %, Temp: ");
Serial.print(temp);
Serial.println(" Celsius");
delay(2000); //Delay 2 sec.
}
| [
"noreply@github.com"
] | noreply@github.com |
c0709b20d9c5e256c15c8b55029051c1206901ee | e4a50114db2830a5cc93a740eea0b016daa06932 | /23_1.cpp | 57a19daf1c7f4cdd3312faf3a9ff6d9a135679a6 | [] | no_license | DPCEKY/myleet | abb516ad3d318e10e70443990647d936c65dd516 | 081703f0b6e6df9f4959225e8ba62e00fafa1d78 | refs/heads/master | 2021-06-18T14:15:45.519346 | 2019-08-01T18:40:44 | 2019-08-01T18:40:44 | 130,633,713 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,210 | cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* merge(ListNode* a, ListNode* b) {
ListNode* result = NULL;
ListNode* last = result;
while(a != NULL && b != NULL) {
ListNode res;
if(a->val <= b->val) {
res.val = a->val;
a = a->next;
}
else {
res.val = b->val;
b = b->next;
}
if(last != NULL) {
last->next = &res;
last = &res;
}
else {
result = &res;
last = result;
}
}
while(a != NULL) {
ListNode res;
res.val = a->val;
last->next = &res;
last = &res;
}
while(b != NULL) {
ListNode res;
res.val = b->val;
last->next = &res;
last = &res;
}
return result;
}
ListNode* mergeKLists(vector<ListNode*>& lists) {
if(lists.empty())
return NULL;
else if(lists.size() == 1)
return lists[0];
ListNode* res = lists.back();
for(int i = lists.size() - 1; i > 0; i--) {
res = merge(lists[i - 1], res);
}
return res;
}
};
| [
"dpceky@whale.im"
] | dpceky@whale.im |
e95d20df6471932aed09d21033545d133d1f9226 | 7af3a23088b816b367368e0b61e81429a67d1943 | /redist/bundle.cpp | edcbc54d9fd390b0ad20f7fb3280acaa92681224 | [
"BSL-1.0",
"BSD-3-Clause",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | pombreda/bundle | 3bce839b67bbe5968d39285ecac113546facc605 | 3ca6e75447f7e815dd0ca5012c5fcbfd3f78d967 | refs/heads/master | 2020-05-20T23:09:20.670419 | 2015-04-08T16:04:23 | 2015-04-08T16:06:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 29,721 | cpp | /*
* Simple compression interface.
* Copyright (c) 2013, 2014, 2015, Mario 'rlyeh' Rodriguez
*
* Distributed under the Boost Software License, Version 1.0.
* (See license copy at http://www.boost.org/LICENSE_1_0.txt)
* - rlyeh ~~ listening to Boris / Missing Pieces
*/
#include <cassert>
#include <stdio.h>
#include <stdint.h>
#include <cctype> // std::isprint
#include <cstdio> // std::sprintf
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include "bundle.hpp"
#include "deps/giant/giant.hpp"
// easylzma interface
namespace {
/* callbacks for streamed input and output */
struct wrbuf {
size_t pos;
const size_t size;
uint8_t *const data;
wrbuf( uint8_t *const data_, size_t size_ ) : pos(0), size(size_), data(data_)
{}
size_t writebuf( const void *buf, size_t len ) {
if( pos + len > size ) {
len = size - pos;
}
memcpy( &data[ pos ], buf, len );
pos += len;
return len;
}
};
struct rdbuf {
size_t pos;
const size_t size;
const uint8_t *const data;
rdbuf( const uint8_t *const data_, size_t size_ ) : pos(0), size(size_), data(data_)
{}
size_t readbuf( void *buf, size_t len ) {
if( pos + len > size ) {
len = size - pos;
}
memcpy( buf, &data[ pos ], len );
pos += len;
return len;
}
};
size_t elzma_write_callback( void *ctx, const void *buf, size_t size ) {
wrbuf * f = (wrbuf *) ctx;
assert( f );
return f->writebuf( buf, size );
}
int elzma_read_callback( void *ctx, void *buf, size_t *size ) {
rdbuf * f = (rdbuf *) ctx;
assert( f );
return *size = f->readbuf( buf, *size ), 0;
}
template<bool is_lzip>
size_t lzma_decompress( const uint8_t * const data, const size_t size,
uint8_t * const new_data, size_t * const out_sizep )
{
rdbuf rd( data, size );
wrbuf wr( new_data, *out_sizep );
elzma_file_format format = is_lzip ? ELZMA_lzip : ELZMA_lzma;
elzma_decompress_handle hand = elzma_decompress_alloc();
bool ok = false, init = NULL != hand;
if( init && ELZMA_E_OK == elzma_decompress_run(
hand, elzma_read_callback, (void *) &rd,
elzma_write_callback, (void *) &wr, format) ) {
ok = true;
}
if( init ) elzma_decompress_free(&hand);
return ok ? 1 : 0;
}
template<bool is_lzip>
size_t lzma_compress( const uint8_t * const data, const size_t size,
uint8_t * const new_data, size_t * const out_sizep )
{
/* default compression parameters, some of which may be overridded by
* command line arguments */
unsigned char level = 9;
unsigned char lc = ELZMA_LC_DEFAULT;
unsigned char lp = ELZMA_LP_DEFAULT;
unsigned char pb = ELZMA_PB_DEFAULT;
unsigned int maxDictSize = ELZMA_DICT_SIZE_DEFAULT_MAX;
unsigned int dictSize = 0;
elzma_file_format format = is_lzip ? ELZMA_lzip : ELZMA_lzma;
elzma_compress_handle hand = NULL;
/* determine a reasonable dictionary size given input size */
dictSize = elzma_get_dict_size(size);
if (dictSize > maxDictSize) dictSize = maxDictSize;
/* allocate a compression handle */
hand = elzma_compress_alloc();
if (hand == NULL) {
return 0;
}
if (ELZMA_E_OK != elzma_compress_config(hand, lc, lp, pb, level,
dictSize, format,
size)) {
elzma_compress_free(&hand);
return 0;
}
int rv;
int pCtx = 0;
rdbuf rd( data, size );
wrbuf wr( new_data, *out_sizep );
rv = elzma_compress_run(hand, elzma_read_callback, (void *) &rd,
elzma_write_callback, (void *) &wr,
(NULL), &pCtx);
if (ELZMA_E_OK != rv) {
elzma_compress_free(&hand);
return 0;
}
*out_sizep = wr.pos;
/* clean up */
elzma_compress_free(&hand);
return wr.pos;
}
}
// zpaq interface
namespace
{
class In: public libzpaq::Reader, public rdbuf {
public:
In( const uint8_t *const data_, size_t size_ ) : rdbuf( data_, size_ )
{}
int get() {
if( pos >= size ) {
return -1;
}
return data[pos++];
}
int read(char* buf, int n) {
return this->readbuf( buf, n );
}
};
class Out: public libzpaq::Writer, public wrbuf {
public:
Out( uint8_t *const data_, size_t size_ ) : wrbuf( data_, size_ )
{}
void put(int c) {
if( pos < size ) {
data[pos++] = (unsigned char)(c);
}
}
int write(char* buf, int n) {
return this->writebuf( buf, n );
}
};
size_t zpaq_compress( const uint8_t * const data, const size_t size,
uint8_t * const new_data, size_t * const out_sizep )
{
In rd( data, size );
Out wr( new_data, *out_sizep );
libzpaq::compress(&rd, &wr, 3); // level [1..3]
*out_sizep = wr.pos;
return wr.pos;
}
size_t zpaq_decompress( const uint8_t * const data, const size_t size,
uint8_t * const new_data, size_t * const out_sizep )
{
In rd( data, size );
Out wr( new_data, *out_sizep );
libzpaq::decompress( &rd, &wr );
return 1;
}
}
namespace libzpaq {
// Implement error handler
void error(const char* msg) {
fprintf( stderr, "<bundle/bundle.cpp> says: ZPAQ fatal error! %s\n", msg );
exit(1);
}
}
namespace bundle {
enum { verbose = false };
namespace
{
std::string hexdump( const std::string &str ) {
char spr[ 80 ];
std::string out1, out2;
for( unsigned i = 0; i < 16 && i < str.size(); ++i ) {
std::sprintf( spr, "%c ", std::isprint(str[i]) ? str[i] : '.' );
out1 += spr;
std::sprintf( spr, "%02X ", (unsigned char)str[i] );
out2 += spr;
}
for( unsigned i = str.size(); i < 16; ++i ) {
std::sprintf( spr, ". " );
out1 += spr;
std::sprintf( spr, "?? " );
out2 += spr;
}
return out2 + "[...] (" + out1 + "[...])";
}
void shout( unsigned q, const char *context, size_t from, size_t to ) {
if( verbose ) {
std::cout << context << " q:" << q << ",from:" << from << ",to:" << to << std::endl;
}
}
}
const char *const name_of( unsigned q ) {
switch( q ) {
break; default : return "NONE";
break; case LZ4: return "LZ4";
break; case MINIZ: return "MINIZ";
break; case SHOCO: return "SHOCO";
break; case LZIP: return "LZIP";
break; case LZMA20: return "LZMA20";
break; case LZMA25: return "LZMA25";
break; case ZPAQ: return "ZPAQ";
break; case LZ4HC: return "LZ4HC";
break; case BROTLI: return "BROTLI";
break; case AUTO: return "AUTO";
break; case ZSTD: return "ZSTD";
break; case BSC: return "BSC";
#if 0
// for archival purposes
break; case BZIP2: return "BZIP2";
break; case BLOSC: return "BLOSC";
break; case FSE: return "FSE";
break; case LZFX: return "LZFX";
break; case LZHAM: return "LZHAM";
break; case LZP1: return "LZP1";
break; case YAPPY: return "YAPPY";
#endif
}
}
const char *const version_of( unsigned q ) {
return "0";
}
const char *const ext_of( unsigned q ) {
switch( q ) {
break; default : return "";
break; case LZ4: return "lz4";
break; case MINIZ: return "zip";
break; case SHOCO: return "shoco";
break; case LZIP: return "lz";
break; case LZMA20: return "lzma";
break; case LZMA25: return "lzma";
break; case ZPAQ: return "zpaq";
break; case LZ4HC: return "lz4";
break; case BROTLI: return "brotli";
break; case AUTO: return "auto";
break; case ZSTD: return "zstd";
break; case BSC: return "bsc";
#if 0
// for archival purposes
break; case BZIP2: return "bz2";
break; case BLOSC: return "blosc";
break; case FSE: return "fse";
break; case LZFX: return "lzfx";
break; case LZHAM: return "lzham";
break; case LZP1: return "lzp1";
break; case YAPPY: return "yappy";
#endif
}
}
unsigned type_of( const void *ptr, size_t size ) {
unsigned char *mem = (unsigned char *)ptr;
//std::string s; s.resize( size ); memcpy( &s[0], mem, size );
//std::cout << hexdump( s) << std::endl;
if( size >= 4 && mem && mem[0] == 'L' && mem[1] == 'Z' && mem[2] == 'I' && mem[3] == 'P' ) return LZIP;
if( size >= 1 && mem && mem[0] == 0xEC ) return MINIZ;
if( size >= 1 && mem && mem[0] >= 0xF0 ) return LZ4;
return NONE;
}
size_t bound( unsigned q, size_t len ) {
enum { MAX_BUNDLE_HEADERS = 1 + 1 + (16 + 1) + (16 + 1) }; // up to 128-bit length sized streams
size_t zlen = len;
switch( q ) {
break; default : zlen = zlen * 2;
break; case LZ4: case LZ4HC: zlen = LZ4_compressBound((int)(len));
break; case MINIZ: zlen = mz_compressBound(len);
break; case ZSTD: zlen = ZSTD_compressBound(len);
#if 0
// for archival purposes
break; case LZP1: zlen = lzp_bound_compress((int)(len));
//break; case FSE: zlen = FSE_compressBound((int)len);
#endif
}
return zlen += MAX_BUNDLE_HEADERS, shout( q, "[bound]", len, zlen ), zlen;
}
size_t unc_payload( unsigned q ) {
size_t payload;
switch( q ) {
break; default : payload = 0;
#if 0
break; case LZP1: payload = 256;
#endif
}
return payload;
}
// for archival purposes:
// const bool pre_init = (Yappy_FillTables(), true);
bool pack( unsigned q, const void *in, size_t inlen, void *out, size_t &outlen ) {
bool ok = false;
if( in && inlen && out && outlen >= inlen ) {
ok = true;
switch( q ) {
break; default: ok = false;
break; case LZ4: outlen = LZ4_compress( (const char *)in, (char *)out, inlen );
break; case LZ4HC: outlen = LZ4_compressHC2( (const char *)in, (char *)out, inlen, 16 );
break; case MINIZ: case AUTO: outlen = tdefl_compress_mem_to_mem( out, outlen, in, inlen, TDEFL_MAX_PROBES_MASK ); // TDEFL_DEFAULT_MAX_PROBES );
break; case SHOCO: outlen = shoco_compress( (const char *)in, inlen, (char *)out, outlen );
break; case LZMA20: case LZMA25: { //outlen = lzma_compress<0>( (const uint8_t *)in, inlen, (uint8_t *)out, &outlen );
SizeT propsSize = LZMA_PROPS_SIZE;
outlen = outlen - LZMA_PROPS_SIZE - 8;
#if 0
ok = ( SZ_OK == LzmaCompress(
&((unsigned char *)out)[LZMA_PROPS_SIZE + 8], &outlen,
(const unsigned char *)in, inlen,
&((unsigned char *)out)[0], &propsSize,
level, dictSize, lc, lp, pb, fb, numThreads ) );
#else
CLzmaEncProps props;
LzmaEncProps_Init(&props);
props.level = 9; /* 0 <= level <= 9, default = 5 */
props.dictSize = 1 << (q == LZMA25 ? 25 : 20); /* default = (1 << 24) */
props.lc = 3; /* 0 <= lc <= 8, default = 3 */
props.lp = 0; /* 0 <= lp <= 4, default = 0 */
props.pb = 2; /* 0 <= pb <= 4, default = 2 */
props.fb = 32; /* 5 <= fb <= 273, default = 32 */
props.numThreads = 1; /* 1 or 2, default = 2 */
props.writeEndMark = 1; /* 0 or 1, default = 0 */
ok = (SZ_OK == LzmaEncode(
&((unsigned char *)out)[LZMA_PROPS_SIZE + 8], &outlen,
(const unsigned char *)in, inlen,
&props, &((unsigned char *)out)[0], (SizeT*)&propsSize, props.writeEndMark,
NULL, &g_Alloc, &g_Alloc));
ok = ok && (propsSize == LZMA_PROPS_SIZE);
#endif
if( ok ) {
// serialize outsize as well (classic 13-byte LZMA header)
uint64_t x = giant::htole( (uint64_t)outlen );
memcpy( &((unsigned char *)out)[LZMA_PROPS_SIZE], (unsigned char *)&x, 8 );
outlen = outlen + LZMA_PROPS_SIZE + 8;
}
}
break; case LZIP: outlen = lzma_compress<1>( (const uint8_t *)in, inlen, (uint8_t *)out, &outlen );
break; case ZPAQ: outlen = zpaq_compress( (const uint8_t *)in, inlen, (uint8_t *)out, &outlen );
break; case BROTLI: {
brotli::BrotliParams bp; bp.mode = brotli::BrotliParams::MODE_TEXT;
ok = (1 == brotli::BrotliCompressBuffer( bp, inlen, (const uint8_t *)in, &outlen, (uint8_t *)out ));
}
break; case ZSTD: outlen = ZSTD_compress( out, outlen, in, inlen ); if( ZSTD_isError(outlen) ) outlen = 0;
break; case BSC: outlen = bsc_compress((const unsigned char *)in, (unsigned char *)out, inlen, LIBBSC_DEFAULT_LZPHASHSIZE, LIBBSC_DEFAULT_LZPMINLEN, LIBBSC_DEFAULT_BLOCKSORTER, LIBBSC_CODER_QLFC_ADAPTIVE, LIBBSC_FEATURE_FASTMODE | 0);
#if 0
// for archival purposes:
break; case YAPPY: outlen = Yappy_Compress( (const unsigned char *)in, (unsigned char *)out, inlen ) - out;
break; case BZIP2: { unsigned int o(outlen); if( BZ_OK != BZ2_bzBuffToBuffCompress( (char *)out, &o, (char *)in, inlen, 9 /*level*/, 0 /*verbosity*/, 30 /*default*/ ) ) outlen = 0; else outlen = o; }
break; case BLOSC: { int clevel = 9, doshuffle = 0, typesize = 1;
int r = blosc_compress( clevel, doshuffle, typesize, inlen, in, out, outlen);
if( r <= 0 ) outlen = 0; else outlen = r; }
break; case FSE: outlen = FSE_compress( out, (const unsigned char *)in, inlen ); if( outlen < 0 ) outlen = 0;
break; case LZFX: if( lzfx_compress( in, inlen, out, &outlen ) < 0 ) outlen = 0;
break; case LZP1: outlen = lzp_compress( (const uint8_t *)in, inlen, (uint8_t *)out, outlen );
break; case LZHAM: {
// lzham_z_ulong l; lzham_z_compress2( (unsigned char *)out, &l, (const unsigned char *)in, inlen, LZHAM_Z_BEST_COMPRESSION ); outlen = l;
lzham_compress_params comp_params = {0};
comp_params.m_struct_size = sizeof(comp_params);
comp_params.m_dict_size_log2 = 23;
comp_params.m_level = static_cast<lzham_compress_level>(0);
comp_params.m_max_helper_threads = 1;
comp_params.m_compress_flags |= LZHAM_COMP_FLAG_FORCE_POLAR_CODING;
lzham_compress_status_t comp_status =
lzham_lib_compress_memory(&comp_params, (lzham_uint8 *)out, &outlen, (const lzham_uint8*)in, inlen, 0 );
if (comp_status != LZHAM_COMP_STATUS_SUCCESS) {
outlen = 0;
}
}
#endif
}
// std::cout << name_of( type_of( out, outlen ) ) << std::endl;
}
ok = ok && outlen > 0 && outlen < inlen;
outlen = ok && outlen ? outlen : 0;
return shout( q, "[pack]", inlen, outlen ), ok;
}
bool unpack( unsigned q, const void *in, size_t inlen, void *out, size_t &outlen ) {
if( q == AUTO ) {
size_t outlen2;
if( outlen2 = outlen, unpack(LZ4, in, inlen, out, outlen2 ) ) return outlen = outlen2, true;
if( outlen2 = outlen, unpack(MINIZ, in, inlen, out, outlen2 ) ) return outlen = outlen2, true;
if( outlen2 = outlen, unpack(BROTLI, in, inlen, out, outlen2 ) ) return outlen = outlen2, true;
if( outlen2 = outlen, unpack(LZMA20, in, inlen, out, outlen2 ) ) return outlen = outlen2, true; // LZMA25 enters here too
if( outlen2 = outlen, unpack(LZIP, in, inlen, out, outlen2 ) ) return outlen = outlen2, true;
if( outlen2 = outlen, unpack(SHOCO, in, inlen, out, outlen2 ) ) return outlen = outlen2, true;
if( outlen2 = outlen, unpack(ZSTD, in, inlen, out, outlen2 ) ) return outlen = outlen2, true;
//if( outlen2 = outlen, unpack(ZPAQ, in, inlen, out, outlen ) ) return outlen = outlen2, true; // ignored (returns true always)
return false;
}
bool ok = false;
size_t bytes_read = 0;
if( in && inlen && out && outlen ) {
ok = true;
switch( q ) {
break; default: ok = false;
break; case LZ4: case LZ4HC: if( LZ4_decompress_safe( (const char *)in, (char *)out, inlen, outlen ) >= 0 ) bytes_read = inlen; // faster: bytes_read = LZ4_uncompress( (const char *)in, (char *)out, outlen );
break; case MINIZ: if( TINFL_DECOMPRESS_MEM_TO_MEM_FAILED != tinfl_decompress_mem_to_mem( out, outlen, in, inlen, TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF ) ) bytes_read = inlen;
break; case SHOCO: bytes_read = shoco_decompress( (const char *)in, inlen, (char *)out, outlen ) == outlen ? inlen : 0;
break; case LZMA20: case LZMA25: {
size_t inlen2 = inlen - LZMA_PROPS_SIZE - 8;
if( SZ_OK == LzmaUncompress((unsigned char *)out, &outlen, (unsigned char *)in + LZMA_PROPS_SIZE + 8, &inlen2, (unsigned char *)in, LZMA_PROPS_SIZE) ) {
bytes_read = inlen;
}
}
break; case LZIP: if( lzma_decompress<1>( (const uint8_t *)in, inlen, (uint8_t *)out, &outlen ) ) bytes_read = inlen;
break; case ZPAQ: if( zpaq_decompress( (const uint8_t *)in, inlen, (uint8_t *)out, &outlen ) ) bytes_read = inlen;
break; case BROTLI: if( 1 == BrotliDecompressBuffer(inlen, (const uint8_t *)in, &outlen, (uint8_t *)out ) ) bytes_read = inlen;
break; case ZSTD: bytes_read = ZSTD_decompress( out, outlen, in, inlen ); if( !ZSTD_isError(bytes_read) ) bytes_read = inlen;
break; case BSC: bsc_decompress((const unsigned char *)in, inlen, (unsigned char *)out, outlen, /*LIBBSC_FEATURE_FASTMODE | */0); bytes_read = inlen;
#if 0
// for archival purposes:
break; case EASYLZMA: if( lzma_decompress<0>( (const uint8_t *)in, inlen, (uint8_t *)out, &outlen ) ) bytes_read = inlen;
break; case YAPPY: Yappy_UnCompress( (const unsigned char *)in, ((const unsigned char *)in) + inlen, (unsigned char *)out ); bytes_read = inlen;
break; case BZIP2: { unsigned int o(outlen); if( BZ_OK == BZ2_bzBuffToBuffDecompress( (char *)out, &o, (char *)in, inlen, 0 /*fast*/, 0 /*verbosity*/ ) ) { bytes_read = inlen; outlen = o; }}
break; case BLOSC: if( blosc_decompress( in, out, outlen ) > 0 ) bytes_read = inlen;
break; case FSE: { int r = FSE_decompress( (unsigned char*)out, outlen, (const void *)in ); if( r >= 0 ) bytes_read = r; }
break; case LZFX: if( lzfx_decompress( in, inlen, out, &outlen ) >= 0 ) bytes_read = inlen;
break; case LZP1: lzp_decompress( (const uint8_t *)in, inlen, (uint8_t *)out, outlen ); bytes_read = inlen;
break; case LZHAM: {
//bytes_read = inlen; { lzham_z_ulong l = outlen; lzham_z_uncompress( (unsigned char *)out, &l, (const unsigned char *)in, inlen ); }
lzham_decompress_params decomp_params = {0};
decomp_params.m_struct_size = sizeof(decomp_params);
decomp_params.m_dict_size_log2 = 23;
decomp_params.m_decompress_flags |= LZHAM_DECOMP_FLAG_OUTPUT_UNBUFFERED;
lzham_decompress_status_t status = lzham_lib_decompress_memory(&decomp_params,
(lzham_uint8*)out, &outlen, (const lzham_uint8*)in, inlen, 0);
if( status == LZHAM_DECOMP_STATUS_SUCCESS ) {
bytes_read = inlen;
}
}
#endif
}
}
ok = ok && bytes_read == inlen;
outlen = ok && outlen ? outlen : 0;
return shout( q, "[unpack]", inlen, outlen ), ok;
}
}
namespace bundle
{
// public API
unsigned type_of( const std::string &self ) {
return is_packed( self ) ? self[ 1 ] & 0x0F : NONE;
}
std::string name_of( const std::string &self ) {
return bundle::name_of( type_of(self) );
}
std::string version_of( const std::string &self ) {
return bundle::version_of( type_of(self) );
}
std::string ext_of( const std::string &self ) {
return bundle::ext_of( type_of(self) );
}
std::string vlebit( size_t i ) {
std::string out;
do {
out += (unsigned char)( 0x80 | (i & 0x7f));
i >>= 7;
} while( i > 0 );
*out.rbegin() ^= 0x80;
return out;
}
size_t vlebit( const char *&i ) {
size_t out = 0, j = -7;
do {
out |= ((size_t(*i) & 0x7f) << (j += 7) );
} while( size_t(*i++) & 0x80 );
return out;
}
}
namespace bundle
{
bool file::has( const std::string &property ) const {
return this->find( property ) != this->end();
}
// binary serialization
bool archive::bin( const std::string &binary )
{
this->clear();
std::vector<file> result;
if( !binary.size() )
return true; // :)
if( type == container::ZIP )
{
// Try to open the archive.
mz_zip_archive zip_archive;
memset(&zip_archive, 0, sizeof(zip_archive));
mz_bool status = mz_zip_reader_init_mem( &zip_archive, (void *)binary.c_str(), binary.size(), 0 );
if( !status )
return "mz_zip_reader_init_file() failed!", false;
// Get and print information about each file in the archive.
for( unsigned int i = 0; i < mz_zip_reader_get_num_files(&zip_archive); i++ )
{
mz_zip_archive_file_stat file_stat;
if( !mz_zip_reader_file_stat( &zip_archive, i, &file_stat ) )
{
mz_zip_reader_end( &zip_archive );
return "mz_zip_reader_file_stat() failed!", false;
}
result.push_back( file() );
result.back()["/**/"] = file_stat.m_comment;
result.back()["name"] = file_stat.m_filename;
result.back()["size"] = (unsigned int)file_stat.m_uncomp_size;
result.back()["zlen"] = (unsigned int)file_stat.m_comp_size;
//result.back()["modify_time"] = ze.mtime;
//result.back()["access_time"] = ze.atime;
//result.back()["create_time"] = ze.ctime;
//result.back()["attributes"] = ze.attr;
if( const bool decode = true )
{
// Try to extract file to the heap.
size_t uncomp_size;
void *p = mz_zip_reader_extract_file_to_heap(&zip_archive, file_stat.m_filename, &uncomp_size, 0);
if( !p )
{
mz_zip_reader_end(&zip_archive);
return "mz_zip_reader_extract_file_to_heap() failed!", false;
}
// Make sure the extraction really succeeded.
/*
if ((uncomp_size != strlen(s_pStr)) || (memcmp(p, s_pStr, strlen(s_pStr))))
{
free(p);
mz_zip_reader_end(&zip_archive);
return "mz_zip_reader_extract_file_to_heap() failed to extract the proper data", false;
}
*/
result.back()["data"].resize( uncomp_size );
memcpy( (void *)result.back()["data"].data(), p, uncomp_size );
free(p);
}
}
// We're done.
mz_zip_reader_end(&zip_archive);
}
else
{}
this->resize( result.size() );
std::copy( result.begin(), result.end(), this->begin() );
return true;
}
std::string archive::bin( unsigned q ) const
{
std::string result;
if( type == container::ZIP )
{
mz_zip_archive zip_archive;
memset( &zip_archive, 0, sizeof(zip_archive) );
zip_archive.m_file_offset_alignment = 8;
mz_bool status = mz_zip_writer_init_heap( &zip_archive, 0, 0 );
if( !status ) {
assert( status );
return "mz_zip_writer_init_heap() failed!", std::string();
}
for( const_iterator it = this->begin(), end = this->end(); it != end; ++it ) {
std::map< std::string, bundle::string >::const_iterator filename = it->find("name");
std::map< std::string, bundle::string >::const_iterator content = it->find("data");
std::map< std::string, bundle::string >::const_iterator comment = it->find("/**/");
if( filename != it->end() && content != it->end() ) {
const size_t bufsize = content->second.size();
int quality = q;
if( it->find("comp") != it->end() ) {
std::stringstream ss( it->find("comp")->second );
if( !(ss >> quality) ) quality = q;
}
switch( quality ) {
break; case DEFAULT: default: quality = MZ_DEFAULT_LEVEL;
break; case UNCOMPRESSED: quality = MZ_NO_COMPRESSION;
break; case FAST: case ASCII: quality = MZ_BEST_SPEED;
break; case EXTRA: case UBER: quality = MZ_BEST_COMPRESSION;
}
std::string pathfile = filename->second;
std::replace( pathfile.begin(), pathfile.end(), '\\', '/');
//std::cout << hexdump(content->second) << std::endl;
if( comment == it->end() )
status = mz_zip_writer_add_mem_ex( &zip_archive, pathfile.c_str(), content->second.c_str(), bufsize,
0, 0, quality, 0, 0 );
else
status = mz_zip_writer_add_mem_ex( &zip_archive, pathfile.c_str(), content->second.c_str(), bufsize,
comment->second.c_str(), comment->second.size(), quality, 0, 0 );
//status = mz_zip_writer_add_mem( &zip_archive, filename->second.c_str(), content->second.c_str(), bufsize, quality );
if( !status ) {
assert( status );
return "mz_zip_writer_add_mem() failed!", std::string();
}
}
}
void *pBuf;
size_t pSize;
status = mz_zip_writer_finalize_heap_archive( &zip_archive, &pBuf, &pSize);
if( !status ) {
assert( status );
return "mz_zip_writer_finalize_heap_archive() failed!", std::string();
}
// Ends archive writing, freeing all allocations, and closing the output file if mz_zip_writer_init_file() was used.
// Note for the archive to be valid, it must have been finalized before ending.
status = mz_zip_writer_end( &zip_archive );
if( !status ) {
assert( status );
return "mz_zip_writer_end() failed!", std::string();
}
result.resize( pSize );
memcpy( &result.at(0), pBuf, pSize );
free( pBuf );
}
else
{}
return result;
}
}
| [
"rlyeh.nospam@gmail.com"
] | rlyeh.nospam@gmail.com |
e99a1a29671cccaee8c7756eb17b25cb8be2b34c | 135288a340a6e6fe930c42da51fd212c197355db | /staging/arm-none-linux-gnueabi/include/webkit/webkitpalmsettings.h | 9f9f94e0195fe6da72a692b5eecd1937ba084548 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | halfhalo/build-support | eacc7835e7e46090ca7730f6e703d8f7fcd4753a | c55a46fdea227dbf663a8cb5f5eb37879037477f | refs/heads/master | 2020-12-24T11:18:09.754890 | 2012-07-12T18:51:58 | 2012-07-12T18:51:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,760 | h |
/*
Copyright 2008 Palm Inc.
*/
#ifndef __webkitpalmsettings_h__
#define __webkitpalmsettings_h__
#include "webkitpalmdefines.h"
#include <string>
#define kMaxFilePath (1024)
#define kMaxAgentStringLen (1024)
#define kMaxMediaPipelineOptionStringLen (1024)
struct WebKitPalmSettings
{
enum SpellChecking {
DISABLED,
UNDERLINE,
AUTO_CORRECT
};
bool private_browsing;
bool java_script_enabled;
bool java_script_can_open_windows_automatically;
bool plugins_enabled;
bool acceptCookies;
bool runningInBrowserServer;
bool enableEnhancedViewport;
int browserViewWidth;
int browserViewHeight;
unsigned long memCacheMinDeadBytes;
unsigned long memCacheMaxDeadBytes;
unsigned long memCacheTotalBytes;
unsigned long pageCacheCapacity;
bool diskCacheEnabled;
unsigned long diskCacheTotalBytes;
bool diskCacheDebug;
unsigned long diskCacheLargestObjectSize;
char diskCachePath[kMaxFilePath+1];
bool logURLs;
bool enableTextIndexing; ///< Automatically create hyperlinks for text that looks like URL's, etc.
bool enableStickyState; ///< If modifier key is pressed w/o another key then remember state.
SpellChecking checkSpelling; ///< Check for spelling errors and underline/auto-correct if specified.
bool checkGrammar; ///< Auto capitalize first word of sentence.
bool shortcutChecking; ///< Should I look for shortcuts and replace if found?
unsigned wordCompletionStartLength; ///< minimum number of characters we need before offering word completions.
bool enableFitWidth;
bool enableLayoutPaintThrottling;
bool enableFrameFlattening;
char font_symbol[kMaxFilePath+1];
char appDatabasePath[kMaxFilePath+1];
char webkitDataPath[kMaxFilePath+1];
unsigned long long appDatabaseQuota;
char cookieJarPath[kMaxFilePath+1];
char s_pluginsPath[kMaxFilePath+1];
char s_userInstalledPluginsPath[kMaxFilePath+1];
int debuggerServerPort;
bool debuggerEnable;
bool enableDeveloperExtras;
int profilerVerbosity; ///< 0: profiling disabled
bool debugServiceHandles;
bool outputFpsEnable;
char outputFpsFileName[kMaxFilePath+1];
bool enableLocalStorage;
char localStoragePath[kMaxFilePath+1];
bool enableAppCache;
char appCacheDbPath[kMaxFilePath+1];
int appCacheDbMaxSize;
bool lunaCacheResources;
bool enableBytecodeCache;
bool disableAlphaBlend;
bool disableAutoScroll;
float fontScaleFactor;
bool showClickedLink;
int clickSearchRectangleTopPadding;
int clickSearchRectangleRightPadding;
int clickSearchRectangleBottomPadding;
int clickSearchRectangleLeftPadding;
bool enableClickSearchRectangleExpansion;
bool enableFastLocalLoad;
int networkTimeoutSeconds;
bool enableSqliteExtensions;
bool enableSynchronousDatabase;
char sharedClipboardFile[kMaxFilePath+1];
int userAgentIndex;
char userAgentTokensPath[kMaxFilePath+1];
char userAgentOverride[kMaxAgentStringLen+1];
float defaultZoomFactor;
int defaultVisibleHeight;
int minFontSize;
int minLogicalFontSize;
int defaultFixedFontSize;
int defaultFontSize;
int minTextAutoSizeFontSize;
bool disableGifAnimations;
int v8maxYoungSpaceBytes;
int v8maxOldSpaceBytes;
int v8StackLimitBytes;
int v8ExternalMemoryBytes;
double scriptMinimumTimerInterval;
char tempSSLCertLocationPath[kMaxFilePath+1];
bool cachePluginsInDOM;
char diskImageCachePath[kMaxFilePath+1];
int diskImageCacheTotalBytes;
int diskImageFrameCacheTotalBytes;
bool sslStrictNameChecking;
bool enhanceExceptions;
bool enableEmoticons;
char emoticonImagesPath[kMaxFilePath+1];
char emoticonBaseDictionaryFileAndPath[kMaxFilePath+1];
char emoticonClassName[kMaxFilePath+1]; ///< Class name to apply to all auto-replaced emoticons
bool enableNoSteCommonTagsCheck;
char noSteCommonTagsFilePath[kMaxFilePath+1];
char fontsPath[kMaxFilePath+1];
bool logObjects;
char logObjectsFile[kMaxFilePath+1];
bool enableMemoryStats;
int maxActiveConnections;
bool enableCssOptimizations;
int freeMemoryThreshold;
int freeSwapThreshold;
int swapRateThreshold;
bool enableMemoryTracking;
bool enableOrphanedNodeReporting;
int maxInactiveFontData;
int targetInactiveFontData;
int maxImagePixelCount;
unsigned long htmlDbSize;
char defaultSerifFontFamilyName[kMaxFilePath+1];
char defaultSansSerifFontFamilyName[kMaxFilePath+1];
char defaultFixedFontFamilyName[kMaxFilePath+1];
char defaultStandardFontFamilyName[kMaxFilePath+1];
bool enableFileAccessWhitelist;
int spellWidgetYMargin;
bool enableAcceleratedCompositing; // Use OpenGL ES to composite layers
bool showCompositedLayerBorders; // Draw borders around layers for debugging purposes
bool sharedTexturesForCompositedLayers;
char defaultPrinterIP[kMaxFilePath+1];
bool clipboardWidgetsEnabled;
bool paintTextSelectionOnly;
int selectionMarkersTapTargetWidth;
int selectionMarkersTapTargetHeight;
int selectionHitTestOffset;
char mediaPlayPipelineOption[kMaxMediaPipelineOptionStringLen+1];
bool smartTextEnabled() const;
};
// This is the global accessor to get the settings object.
WEBKIT_API WebKitPalmSettings* PalmBrowserSettings( const char* configFile = 0 );
void WebKitPalmApplySettings();
#endif
| [
"w@wdtz.org"
] | w@wdtz.org |
67f6469747e3788d39cc05a1bfe3c3712cce2ee8 | 88acd33ac4fffa2fcea532a5d82cfab3dc3acab6 | /Dcmapp3/ImageMatrix.cpp | 71f3387eef2a918ba3f3cb92fec2f8dbb2550dc9 | [] | no_license | fengbs/Dicom | 8ce0dba4868162e164887d09d22ccf9815eb2f09 | f9ffe0686f4b862e1bba6a28ec9c67ba11232579 | refs/heads/master | 2021-01-14T19:35:10.305372 | 2014-03-02T10:11:12 | 2014-03-02T10:11:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,134 | cpp | #pragma once
#include "StdAfx.h"
#include "DCMConst.h"
#include "ImageMatrix.h"
ImageMatrix::ImageMatrix(void)
{
}
ImageMatrix::ImageMatrix(DcmDataset* dataset)
{
Uint16 bitsAllocated;
Uint16 bitsStored;
const char * name;
dataset->findAndGetString(DCM_PatientID,name);
patientid = name;
dataset->findAndGetString(DCM_PatientName,name);
patientname = name;
dataset->findAndGetUint16(DCM_BitsAllocated,bitsAllocated);
dataset->findAndGetUint16(DCM_BitsStored,bitsStored);
dataset->findAndGetUint16(DCM_Columns,mColumns);
dataset->findAndGetUint16(DCM_Rows,mRows);
dataset->findAndGetFloat64(DCM_WindowCenter,mWindowCenter);
dataset->findAndGetFloat64(DCM_WindowWidth,mWindowWidth);
dataset->findAndGetFloat32(PWI_COE_KEY,PWICoe);
dataset->findAndGetFloat64(DCM_PixelSpacing,pixelSpacing);
dataset->findAndGetFloat64(DCM_SliceThickness,sliceThickness);
unsigned long count;
kind = (bitsAllocated == 16)?1:0;
if(bitsAllocated == 16 && bitsAllocated == bitsStored){
const Uint16 *pixData;
dataset->findAndGetUint16Array(DCM_PixelData, pixData, &count);
if(count != mColumns * mRows){
printf("Unsupported File Format");
return;
}
mPixLength = 16;
mPixData16 = (Uint16 *)malloc(sizeof(Uint16) * count);
for(size_t i = 0; i < count; i++)
mPixData16[i] = pixData[i];
}
else if(bitsAllocated == 8 && bitsAllocated == bitsStored){
const Uint8 *pixData;
dataset->findAndGetUint8Array(DCM_PixelData, pixData, &count);
if(count != mColumns * mRows){
printf("Unsupported File Format");
return;
}
mPixData8 = (Uint8 *)malloc(sizeof(Uint8) * count);
for(size_t i = 0; i < count; i++)
mPixData8[i] = pixData[i];
}
else printf("Unsupported File Format");
}
ImageMatrix::~ImageMatrix(void)
{
if(mPixData8 != NULL)
delete mPixData8;
if(mPixData16 != NULL)
delete mPixData16;
}
Uint16 ImageMatrix::getColumns()
{
return mColumns;
}
Uint16 ImageMatrix::getRows()
{
return mRows;
}
double ImageMatrix::getWinCenter()
{
return mWindowCenter;
}
double ImageMatrix::getWinWidth()
{
return mWindowWidth;
}
Uint16 ImageMatrix::getUint16Pixel(int row, int column)
{
if(row >= mRows || column >= mColumns)
return 0;
return mPixData16[row * mColumns + column];
}
void ImageMatrix::setUint16Pixel(int row, int column, Uint16 pixelValue)
{
if(row >= mRows || column >= mColumns)
return;
mPixData16[row * mColumns + column] = pixelValue;
}
Uint8 ImageMatrix::getUint8Pixel(int row, int column)
{
if(row >= mRows || column >= mColumns)
return 0;
return mPixData8[row * mColumns + column];
}
Uint16* ImageMatrix::getUint16Data()
{
return mPixData16;
}
Uint8* ImageMatrix::getUint8Data()
{
return mPixData8;
}
std::string ImageMatrix::get_patientname(const std::string & dirpath){
std::string filepath = dirpath + "\\ADC\\ADC_1";
DcmFileFormat *pDicomFile = new DcmFileFormat();
OFCondition oc = pDicomFile->loadFile(filepath.c_str());
if(oc.good()){
DcmDataset *pDataset = pDicomFile->getDataset();
const char * name;
pDataset -> findAndGetString(DCM_PatientName, name);
std::string res(name);
delete pDataset;
return res;
}
else
return "fuck";
} | [
"blackhero98@gmail.com"
] | blackhero98@gmail.com |
3c193253fa62d503d2b2fe4b7520ebf2bf7de800 | 35e8e33d0597ab92176d5f477b02356b72855930 | /FES_Teensy_Code/lib/definitions/globalVars.cpp | 92abc1818e98f938883857257966a0d21d1ce52f | [] | no_license | jeremydg3/FES_actual | 1462d2203dc79d19cd8a3a2471544349c31ca711 | 07e1c20d4b1220b157595ff7566e324ed9469dd8 | refs/heads/master | 2020-12-29T07:27:34.955132 | 2020-03-05T05:56:08 | 2020-03-05T05:56:08 | 238,513,571 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 988 | cpp | #include "GlobalVars.h"
// fsr reading and thresholds
float fsr[4];
float fsrThresh[4];
bool fsrFlag[4];
bool fsrFlagPrev[4];
bool fsrStep[4][2];
int fsrStepC;
int toeIndx = 0;
int heelIndx = 0;
// String parsing data
float phaseVar;
// variables for relay control
bool rel1stat = false;
bool rel2stat = false;
// fsr threshold met variables
bool FSR_h1 = false;
bool FSR_t1 = false;
bool FSR_h2 = false;
bool FSR_t2 = false;
// variables for timing
//unsigned long int currT = 0;
//unsigned long int prevT = 0;
unsigned long int deltaC = 0;
unsigned long int deltaL = 0;
unsigned long int deltaR = 0;
int fade = 0;
// razor data parsing variables
int ind1, ind2, ind3, pind;
String A, G;
// experiment data logging
int expNum = 0;
String expTitle = "";
bool sdLog = false;
bool sdWorking = false;
int state = 0;
int controlMethod = 0; // 0: FSR, 1: phase Variable
bool controlState = false;
int affectedInput = 1; // 1:Left , 2:Right
| [
"noreply@github.com"
] | noreply@github.com |
6f5ba62113dff745e6df1aa56633fcd533d3b237 | f519601785318eb9c5101f2baad03186c9768ee9 | /libsafs/safs_file.h | ea723e80a60979f477172d7a7d9c7adf145868ea | [
"Apache-2.0"
] | permissive | flashxio/FlashX | d28f35468060411b39530b1b5d9d5951dafeab3b | 2a649ffad07238344942ca7f7ae3d6c1d784b70d | refs/heads/release | 2021-01-17T01:12:50.343015 | 2017-08-21T02:18:33 | 2017-08-21T02:18:33 | 19,077,386 | 72 | 29 | Apache-2.0 | 2019-01-08T20:54:48 | 2014-04-23T16:41:37 | C++ | UTF-8 | C++ | false | false | 3,627 | h | #ifndef __SAFS_FILE_H__
#define __SAFS_FILE_H__
/*
* Copyright 2014 Open Connectome Project (http://openconnecto.me)
* Written by Da Zheng (zhengda1936@gmail.com)
*
* This file is part of SAFSlib.
*
* 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 <stdlib.h>
#include <string>
#include <vector>
#include <set>
#include "common.h"
#include "native_file.h"
#include "safs_header.h"
#include "parameters.h"
namespace safs
{
/*
* This stores the local filesystem file information that stores
* each partition of SAFS files.
*/
class part_file_info
{
// The file name in the local filesystem.
std::string name;
// The disk ID where the block is stored.
int disk_id;
// The NUMA node id where the disk is connected to.
int node_id;
public:
part_file_info() {
disk_id = 0;
node_id = 0;
}
part_file_info(const std::string &name, int disk_id, int node_id) {
this->name = name;
this->disk_id = disk_id;
this->node_id = node_id;
}
std::string get_file_name() const {
return name;
}
int get_disk_id() const {
return disk_id;
}
int get_node_id() const {
return node_id;
}
};
class RAID_config;
class safs_file_group;
class safs_file
{
// The collection of native files.
std::vector<part_file_info> native_dirs;
// The path of the header file in the local Linux filesystem.
std::string header_file;
std::string name;
// These are system-wise configuration.
int sys_mapping_option;
int sys_block_size;
std::vector<std::string> get_data_files() const;
std::string get_header_file() const;
// This gets physical file sizes in each directory of `native_dirs'.
std::vector<size_t> get_size_per_disk(size_t file_size) const;
public:
static std::vector<std::string> erase_header_file(
const std::vector<std::string> &files);
safs_file(const RAID_config &conf, const std::string &file_name);
safs_header get_header() const;
/*
* An SAFS file allows a user to store user-defined metadata along with
* the data in the file.
*/
bool set_user_metadata(const std::vector<char> &data);
std::vector<char> get_user_metadata() const;
const std::string &get_name() const {
return name;
}
bool exist() const;
ssize_t get_size() const;
bool resize(size_t new_size);
bool create_file(size_t file_size,
int block_size = params.get_RAID_block_size(),
int mapping_option = params.get_RAID_mapping_option(),
std::shared_ptr<safs_file_group> group = NULL);
bool delete_file();
bool rename(const std::string &new_name);
/*
* Load data from a file in the Linux filesystem.
*/
bool load_data(const std::string &ext_file,
size_t block_size = params.get_RAID_block_size());
};
class safs_file_group
{
public:
enum group_t {
NAIVE,
ROTATE,
RAND_ROTATE,
};
typedef std::shared_ptr<safs_file_group> ptr;
static ptr create(const RAID_config &conf, group_t type);
virtual std::vector<int> add_file(safs_file &file) = 0;
virtual std::string get_name() const = 0;
};
size_t get_all_safs_files(std::set<std::string> &files);
bool exist_safs_file(const std::string &name);
ssize_t get_safs_size(const std::string &name);
}
#endif
| [
"zhengda1936@gmail.com"
] | zhengda1936@gmail.com |
0baf3ea964ae55d5447601e5c3a411360b70f321 | ba9322f7db02d797f6984298d892f74768193dcf | /ecsops/include/alibabacloud/ecsops/model/OpsDescribeInstancesRequest.h | 50406732a27c725b9bbf0d4e7db1117c91ac9c99 | [
"Apache-2.0"
] | permissive | sdk-team/aliyun-openapi-cpp-sdk | e27f91996b3bad9226c86f74475b5a1a91806861 | a27fc0000a2b061cd10df09cbe4fff9db4a7c707 | refs/heads/master | 2022-08-21T18:25:53.080066 | 2022-07-25T10:01:05 | 2022-07-25T10:01:05 | 183,356,893 | 3 | 0 | null | 2019-04-25T04:34:29 | 2019-04-25T04:34:28 | null | UTF-8 | C++ | false | false | 3,630 | h | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_ECSOPS_MODEL_OPSDESCRIBEINSTANCESREQUEST_H_
#define ALIBABACLOUD_ECSOPS_MODEL_OPSDESCRIBEINSTANCESREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ecsops/EcsopsExport.h>
namespace AlibabaCloud
{
namespace Ecsops
{
namespace Model
{
class ALIBABACLOUD_ECSOPS_EXPORT OpsDescribeInstancesRequest : public RpcServiceRequest
{
public:
OpsDescribeInstancesRequest();
~OpsDescribeInstancesRequest();
std::string getVswId()const;
void setVswId(const std::string& vswId);
long getResourceOwnerId()const;
void setResourceOwnerId(long resourceOwnerId);
std::string getIzNo()const;
void setIzNo(const std::string& izNo);
std::string getImageId()const;
void setImageId(const std::string& imageId);
std::string getPrivateIpAddresses()const;
void setPrivateIpAddresses(const std::string& privateIpAddresses);
bool getIoOptimized()const;
void setIoOptimized(bool ioOptimized);
std::string getNetWorkType()const;
void setNetWorkType(const std::string& netWorkType);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
int getPageSize()const;
void setPageSize(int pageSize);
std::string getPublicIpAddresses()const;
void setPublicIpAddresses(const std::string& publicIpAddresses);
std::string getEcsInstanceIds()const;
void setEcsInstanceIds(const std::string& ecsInstanceIds);
std::string getGroupId()const;
void setGroupId(const std::string& groupId);
std::string getCreateTimeFrom()const;
void setCreateTimeFrom(const std::string& createTimeFrom);
bool getMountAvailable()const;
void setMountAvailable(bool mountAvailable);
std::string getRegionNo()const;
void setRegionNo(const std::string& regionNo);
std::string getEcsInstanceName()const;
void setEcsInstanceName(const std::string& ecsInstanceName);
int getPageNo()const;
void setPageNo(int pageNo);
std::string getVpcId()const;
void setVpcId(const std::string& vpcId);
std::string getCreateTimeTo()const;
void setCreateTimeTo(const std::string& createTimeTo);
std::string getStatus()const;
void setStatus(const std::string& status);
private:
std::string vswId_;
long resourceOwnerId_;
std::string izNo_;
std::string imageId_;
std::string privateIpAddresses_;
bool ioOptimized_;
std::string netWorkType_;
std::string accessKeyId_;
int pageSize_;
std::string publicIpAddresses_;
std::string ecsInstanceIds_;
std::string groupId_;
std::string createTimeFrom_;
bool mountAvailable_;
std::string regionNo_;
std::string ecsInstanceName_;
int pageNo_;
std::string vpcId_;
std::string createTimeTo_;
std::string status_;
};
}
}
}
#endif // !ALIBABACLOUD_ECSOPS_MODEL_OPSDESCRIBEINSTANCESREQUEST_H_ | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
2ca9d4b14ae2739206a95520c983a363ea4ef29e | 98b1f0cae414375eb4636e617ad78f3b71caefc8 | /SAT_VecMat.h | 3fb943117b9d6620cd9807bd827396d63ffe97aa | [] | no_license | iGNSS/SatPack | 423c91dd6a0d6abcdfd9164e00b01eb3376cccf5 | 9d677d370db90a8c24830d9e60c2acefc5c7f898 | refs/heads/main | 2023-03-28T09:35:14.926844 | 2020-10-06T21:18:38 | 2020-10-06T21:18:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,044 | h | //------------------------------------------------------------------------------
//
// SAT_VecMat.h
//
// Purpose:
//
// Vector/matrix operations
//
// Notes:
//
// This software is protected by national and international copyright.
// Any unauthorized use, reproduction or modificaton is unlawful and
// will be prosecuted. Commercial and non-private application of the
// software in any form is strictly prohibited unless otherwise granted
// by the authors.
//
// The code is provided without any warranty; without even the implied
// warranty of merchantibility or fitness for a particular purpose.
//
// Last modified:
//
// 2000/03/04 OMO Final version (1st edition)
// 2005/04/14 OMO Final version (2nd reprint)
//
// (c) 1999-2005 O. Montenbruck, E. Gill
//
//------------------------------------------------------------------------------
#ifndef INC_SAT_VECMAT_H
#define INC_SAT_VECMAT_H
#include <iostream>
class Matrix;
Matrix R_x(double Angle);
Matrix R_y(double Angle);
Matrix R_z(double Angle);
Matrix Transp(const Matrix& Mat);
Matrix Inv(const Matrix& Mat);
class Vector;
Vector VecPolar (double azim, double elev, double r);
Matrix Id(int Size);
//------------------------------------------------------------------------------
//
// Vector (class definition)
//
// Purpose:
//
// Vector data type and associated operations
//
//------------------------------------------------------------------------------
class Vector
{
public:
friend class Matrix;
// Constructors
Vector (); // Vector without elements
Vector (int Size); // Nullvector of specified size
Vector (const Vector& V); // Vector copy
Vector (const double* p, int N); // Array copy
Vector (double x, double y, double z); // 3dim-Vector
Vector (double x, double y, double z, // 6dim-Vector
double X, double Y, double Z);
// Destructor
~Vector();
// Size
int size() const { return n; };
Vector& resize(int Size);
// Assignment
Vector& operator=(const double value);
Vector& operator=(const Vector& V);
// Component access (Fortran notation)
double operator () (int i) const { return v[i]; };
double& operator () (int i) { return v[i]; };
Vector slice (int first, int last) const;
// Square root of vector elements
Vector Sqrt() const;
// Concatenation
friend Vector operator &(const Vector& a, double b);
friend Vector operator &(double a, const Vector& b);
friend Vector operator &(const Vector& a, const Vector& b);
friend Vector Stack (const Vector& a, const Vector& b);
// Vector from polar angles
friend Vector VecPolar (double azim, double elev, double r=1.0);
// Vector addition/subtraction with assignment
void operator += (const Vector& V);
void operator -= (const Vector& V);
// Dot product, norm, cross product
friend double Dot (const Vector& left, const Vector& right);
friend double Norm (const Vector& V);
friend Vector Cross (const Vector& left, const Vector& right);
// Scalar multiplication and division of a vector
friend Vector operator * (double value, const Vector& V);
friend Vector operator * (const Vector& V, double value);
friend Vector operator / (const Vector& V, double value);
// Negation of a vector (unary minus)
friend Vector operator - (const Vector& V);
// Vector addition and subtraction
friend Vector operator + (const Vector& left, const Vector& right);
friend Vector operator - (const Vector& left, const Vector& right);
// Diagonal matrix
friend Matrix Diag(const Vector& Vec);
// Vector/matrix product
friend Vector operator * (const Matrix& Mat, const Vector& Vec);
friend Vector operator * (const Vector& Vec, const Matrix& Mat);
// Dyadic product
friend Matrix Dyadic (const Vector& left, const Vector& right);
// Output
friend std::ostream& operator << (std::ostream& os, const Vector& Vec);
private:
// Elements
int n; // Dimension
double *v; // Vector v(n)
};
//------------------------------------------------------------------------------
//
// Matrix (class definition)
//
// Purpose:
//
// Matrix data type and associated operations
//
//------------------------------------------------------------------------------
class Matrix
{
public:
// Constructors
Matrix (); // Matrix without elements
Matrix (int dim1, int dim2); // Nullmatrix
Matrix (const Matrix& M_); // Matrix copy
Matrix (const double* p, int dim1, int dim2); // Array copy
// Destructor
~Matrix();
// Assignment
Matrix& operator=(const double value);
Matrix& operator=(const Matrix& M_);
// Size
int size1() const { return n; };
int size2() const { return m; };
Matrix& resize(int dim1, int dim2);
// Component access (Fortran notation)
double operator () (int i, int j) const { return M[i][j]; };
double& operator () (int i, int j) { return M[i][j]; };
Vector Col(int j) const;
Vector Row(int i) const;
Vector Diag() const;
double Trace() const;
double Trace(int low, int upp) const;
Matrix slice(int first_row, int last_row, int first_col, int last_col);
void SetCol(int j, const Vector& Col);
void SetRow(int i, const Vector& Row);
// Concatenation
friend Matrix operator &(const Matrix& A, const Vector& Row);
friend Matrix operator &(const Vector& Row, const Matrix& A);
friend Matrix operator &(const Matrix& A, const Matrix& B);
friend Matrix operator |(const Matrix& A, const Vector& Col);
friend Matrix operator |(const Vector& Col, const Matrix& A);
friend Matrix operator |(const Matrix& A, const Matrix& B);
// Matrix addition/subtraction with assignment
void operator += (const Matrix& V);
void operator -= (const Matrix& V);
// Unit matrix
friend Matrix Id(int Size);
// Diagonal matrix
friend Matrix Diag(const Vector& Vec);
// Elementary rotations
friend Matrix R_x(double Angle);
friend Matrix R_y(double Angle);
friend Matrix R_z(double Angle);
// Transposition and inverse
friend Matrix Transp(const Matrix& Mat);
friend Matrix Inv(const Matrix& Mat);
// Scalar multiplication and division of a matrix
friend Matrix operator * (double value, const Matrix& Mat);
friend Matrix operator * (const Matrix& Mat, double value);
friend Matrix operator / (const Matrix& Mat, double value);
// Unary minus
friend Matrix operator - (const Matrix& Mat);
// Matrix addition and subtraction
friend Matrix operator + (const Matrix& left, const Matrix& right);
friend Matrix operator - (const Matrix& left, const Matrix& right);
// Matrix product
friend Matrix operator * (const Matrix& left, const Matrix& right);
// Vector/matrix product
friend Vector operator * (const Matrix& Mat, const Vector& Vec);
friend Vector operator * (const Vector& Vec, const Matrix& Mat);
// Dyadic product
friend Matrix Dyadic (const Vector& left, const Vector& right);
// Output
friend std::ostream& operator << (std::ostream& os, const Matrix& Mat);
private:
// Elements
int n; // First dimension (number of rows)
int m; // Second dimension (number of columns)
double **M; // Matrix M(n,m)
};
//------------------------------------------------------------------------------
//
// Basic Linear Algebra
//
//------------------------------------------------------------------------------
void LU_Decomp ( Matrix& A, Vector& Indx );
void LU_BackSub ( Matrix& A, Vector& Indx, Vector& b );
#endif // include-Blocker
| [
"jorge.zuluaga@udea.edu.co"
] | jorge.zuluaga@udea.edu.co |
f53a995f9e9a9d6c07240885b89a2e2ff71a9d91 | b6b0c0b540a1caf9be49cbbb2010be805846d0fe | /src/task1000.cpp | 5b0c6f9275ca121908450dff0fd962e6b66631cb | [
"BSD-3-Clause"
] | permissive | sam002/acm.timus.ru | 0b3a137398445a3be775b2309d2f89e5fba0605b | b0a21a0745572c018201945145fdbd8bc1367071 | refs/heads/main | 2023-01-30T14:35:35.786983 | 2020-12-20T10:13:15 | 2020-12-20T10:13:15 | 322,659,649 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 386 | cpp | #include <iostream>
#include "task.h"
void solution1000()
{
long long c;
long long result = 0;
std::cin >> c;
while (!std::cin.fail())
{
result += c;
std::cin >> c;
}
std::cout << result << std::endl;
}
auto task1000 = new task(1000,
"1 5",
"6\n",
&solution1000
);
| [
"semen@sam002.net"
] | semen@sam002.net |
46609e2e1996e0628dc204918aae1eb5ba644438 | a35b30a7c345a988e15d376a4ff5c389a6e8b23a | /boost/msm/mpl_graph/search_colors.hpp | 12da2ca512b4a15d52e7abf69b5bfa0e712ffef9 | [] | no_license | huahang/thirdparty | 55d4cc1c8a34eff1805ba90fcbe6b99eb59a7f0b | 07a5d64111a55dda631b7e8d34878ca5e5de05ab | refs/heads/master | 2021-01-15T14:29:26.968553 | 2014-02-06T07:35:22 | 2014-02-06T07:35:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 73 | hpp | #include "thirdparty/boost_1_55_0/boost/msm/mpl_graph/search_colors.hpp"
| [
"liuhuahang@xiaomi.com"
] | liuhuahang@xiaomi.com |
55a11dd01cce64d5c2948bf3884b416648af17ca | 0b15c7a046d703e153b6e6054cb57a0664a2d4df | /RobWork/ext/fcl/fcl/include/fcl/collision_object.h | 25f8b7728c1c94b633a601100bfd9d44f2dd124a | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | skyellen/robwork-mirror | bf5d97ce19775c2928432854a93fb87ab2f7cd26 | 5a74a49d9ef98eff7c75f48fe48c2e655480e9b3 | refs/heads/master | 2020-04-16T06:10:11.359979 | 2018-09-06T09:26:01 | 2018-09-06T09:26:01 | 165,335,340 | 4 | 0 | null | 2019-01-12T02:01:40 | 2019-01-12T02:01:40 | null | UTF-8 | C++ | false | false | 12,720 | h | /*
* Software License Agreement (BSD License)
*
* Copyright (c) 2011-2014, Willow Garage, Inc.
* Copyright (c) 2014-2016, Open Source Robotics Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Open Source Robotics Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/** \author Jia Pan */
#ifndef FCL_COLLISION_OBJECT_BASE_H
#define FCL_COLLISION_OBJECT_BASE_H
#include <fcl/deprecated.h>
#include "fcl/BV/AABB.h"
#include "fcl/math/transform.h"
#include "fcl/ccd/motion_base.h"
#include <memory>
namespace fcl
{
/// @brief object type: BVH (mesh, points), basic geometry, octree
enum OBJECT_TYPE {OT_UNKNOWN, OT_BVH, OT_GEOM, OT_OCTREE, OT_COUNT};
/// @brief traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18, kDOP24), basic shape (box, sphere, ellipsoid, capsule, cone, cylinder, convex, plane, halfspace, triangle), and octree
enum NODE_TYPE {BV_UNKNOWN, BV_AABB, BV_OBB, BV_RSS, BV_kIOS, BV_OBBRSS, BV_KDOP16, BV_KDOP18, BV_KDOP24,
GEOM_BOX, GEOM_SPHERE, GEOM_ELLIPSOID, GEOM_CAPSULE, GEOM_CONE, GEOM_CYLINDER, GEOM_CONVEX, GEOM_PLANE, GEOM_HALFSPACE, GEOM_TRIANGLE, GEOM_OCTREE, NODE_COUNT};
/// @brief The geometry for the object for collision or distance computation
class CollisionGeometry
{
public:
CollisionGeometry() : cost_density(1),
threshold_occupied(1),
threshold_free(0)
{
}
virtual ~CollisionGeometry() {}
/// @brief get the type of the object
virtual OBJECT_TYPE getObjectType() const { return OT_UNKNOWN; }
/// @brief get the node type
virtual NODE_TYPE getNodeType() const { return BV_UNKNOWN; }
/// @brief compute the AABB for object in local coordinate
virtual void computeLocalAABB() = 0;
/// @brief get user data in geometry
void* getUserData() const
{
return user_data;
}
/// @brief set user data in geometry
void setUserData(void *data)
{
user_data = data;
}
/// @brief whether the object is completely occupied
inline bool isOccupied() const { return cost_density >= threshold_occupied; }
/// @brief whether the object is completely free
inline bool isFree() const { return cost_density <= threshold_free; }
/// @brief whether the object has some uncertainty
inline bool isUncertain() const { return !isOccupied() && !isFree(); }
/// @brief AABB center in local coordinate
Vec3f aabb_center;
/// @brief AABB radius
FCL_REAL aabb_radius;
/// @brief AABB in local coordinate, used for tight AABB when only translation transform
AABB aabb_local;
/// @brief pointer to user defined data specific to this object
void *user_data;
/// @brief collision cost for unit volume
FCL_REAL cost_density;
/// @brief threshold for occupied ( >= is occupied)
FCL_REAL threshold_occupied;
/// @brief threshold for free (<= is free)
FCL_REAL threshold_free;
/// @brief compute center of mass
virtual Vec3f computeCOM() const { return Vec3f(); }
/// @brief compute the inertia matrix, related to the origin
virtual Matrix3f computeMomentofInertia() const { return Matrix3f(); }
/// @brief compute the volume
virtual FCL_REAL computeVolume() const { return 0; }
/// @brief compute the inertia matrix, related to the com
virtual Matrix3f computeMomentofInertiaRelatedToCOM() const
{
Matrix3f C = computeMomentofInertia();
Vec3f com = computeCOM();
FCL_REAL V = computeVolume();
return Matrix3f(C(0, 0) - V * (com[1] * com[1] + com[2] * com[2]),
C(0, 1) + V * com[0] * com[1],
C(0, 2) + V * com[0] * com[2],
C(1, 0) + V * com[1] * com[0],
C(1, 1) - V * (com[0] * com[0] + com[2] * com[2]),
C(1, 2) + V * com[1] * com[2],
C(2, 0) + V * com[2] * com[0],
C(2, 1) + V * com[2] * com[1],
C(2, 2) - V * (com[0] * com[0] + com[1] * com[1]));
}
};
/// @brief the object for collision or distance computation, contains the geometry and the transform information
class CollisionObject
{
public:
CollisionObject(const std::shared_ptr<CollisionGeometry> &cgeom_) :
cgeom(cgeom_), cgeom_const(cgeom_)
{
if (cgeom)
{
cgeom->computeLocalAABB();
computeAABB();
}
}
CollisionObject(const std::shared_ptr<CollisionGeometry> &cgeom_, const Transform3f& tf) :
cgeom(cgeom_), cgeom_const(cgeom_), t(tf)
{
cgeom->computeLocalAABB();
computeAABB();
}
CollisionObject(const std::shared_ptr<CollisionGeometry> &cgeom_, const Matrix3f& R, const Vec3f& T):
cgeom(cgeom_), cgeom_const(cgeom_), t(Transform3f(R, T))
{
cgeom->computeLocalAABB();
computeAABB();
}
~CollisionObject()
{
}
/// @brief get the type of the object
OBJECT_TYPE getObjectType() const
{
return cgeom->getObjectType();
}
/// @brief get the node type
NODE_TYPE getNodeType() const
{
return cgeom->getNodeType();
}
/// @brief get the AABB in world space
inline const AABB& getAABB() const
{
return aabb;
}
/// @brief compute the AABB in world space
inline void computeAABB()
{
if(t.getQuatRotation().isIdentity())
{
aabb = translate(cgeom->aabb_local, t.getTranslation());
}
else
{
Vec3f center = t.transform(cgeom->aabb_center);
Vec3f delta(cgeom->aabb_radius);
aabb.min_ = center - delta;
aabb.max_ = center + delta;
}
}
/// @brief get user data in object
void* getUserData() const
{
return user_data;
}
/// @brief set user data in object
void setUserData(void *data)
{
user_data = data;
}
/// @brief get translation of the object
inline const Vec3f& getTranslation() const
{
return t.getTranslation();
}
/// @brief get matrix rotation of the object
inline const Matrix3f& getRotation() const
{
return t.getRotation();
}
/// @brief get quaternion rotation of the object
inline const Quaternion3f& getQuatRotation() const
{
return t.getQuatRotation();
}
/// @brief get object's transform
inline const Transform3f& getTransform() const
{
return t;
}
/// @brief set object's rotation matrix
void setRotation(const Matrix3f& R)
{
t.setRotation(R);
}
/// @brief set object's translation
void setTranslation(const Vec3f& T)
{
t.setTranslation(T);
}
/// @brief set object's quatenrion rotation
void setQuatRotation(const Quaternion3f& q)
{
t.setQuatRotation(q);
}
/// @brief set object's transform
void setTransform(const Matrix3f& R, const Vec3f& T)
{
t.setTransform(R, T);
}
/// @brief set object's transform
void setTransform(const Quaternion3f& q, const Vec3f& T)
{
t.setTransform(q, T);
}
/// @brief set object's transform
void setTransform(const Transform3f& tf)
{
t = tf;
}
/// @brief whether the object is in local coordinate
bool isIdentityTransform() const
{
return t.isIdentity();
}
/// @brief set the object in local coordinate
void setIdentityTransform()
{
t.setIdentity();
}
/// @brief get geometry from the object instance
FCL_DEPRECATED
const CollisionGeometry* getCollisionGeometry() const
{
return cgeom.get();
}
/// @brief get geometry from the object instance
const std::shared_ptr<const CollisionGeometry>& collisionGeometry() const
{
return cgeom_const;
}
/// @brief get object's cost density
FCL_REAL getCostDensity() const
{
return cgeom->cost_density;
}
/// @brief set object's cost density
void setCostDensity(FCL_REAL c)
{
cgeom->cost_density = c;
}
/// @brief whether the object is completely occupied
inline bool isOccupied() const
{
return cgeom->isOccupied();
}
/// @brief whether the object is completely free
inline bool isFree() const
{
return cgeom->isFree();
}
/// @brief whether the object is uncertain
inline bool isUncertain() const
{
return cgeom->isUncertain();
}
protected:
std::shared_ptr<CollisionGeometry> cgeom;
std::shared_ptr<const CollisionGeometry> cgeom_const;
Transform3f t;
/// @brief AABB in global coordinate
mutable AABB aabb;
/// @brief pointer to user defined data specific to this object
void *user_data;
};
/// @brief the object for continuous collision or distance computation, contains the geometry and the motion information
class ContinuousCollisionObject
{
public:
ContinuousCollisionObject(const std::shared_ptr<CollisionGeometry>& cgeom_) :
cgeom(cgeom_), cgeom_const(cgeom_)
{
}
ContinuousCollisionObject(const std::shared_ptr<CollisionGeometry>& cgeom_, const std::shared_ptr<MotionBase>& motion_) :
cgeom(cgeom_), cgeom_const(cgeom), motion(motion_)
{
}
~ContinuousCollisionObject() {}
/// @brief get the type of the object
OBJECT_TYPE getObjectType() const
{
return cgeom->getObjectType();
}
/// @brief get the node type
NODE_TYPE getNodeType() const
{
return cgeom->getNodeType();
}
/// @brief get the AABB in the world space for the motion
inline const AABB& getAABB() const
{
return aabb;
}
/// @brief compute the AABB in the world space for the motion
inline void computeAABB()
{
IVector3 box;
TMatrix3 R;
TVector3 T;
motion->getTaylorModel(R, T);
Vec3f p = cgeom->aabb_local.min_;
box = (R * p + T).getTightBound();
p[2] = cgeom->aabb_local.max_[2];
box = bound(box, (R * p + T).getTightBound());
p[1] = cgeom->aabb_local.max_[1];
p[2] = cgeom->aabb_local.min_[2];
box = bound(box, (R * p + T).getTightBound());
p[2] = cgeom->aabb_local.max_[2];
box = bound(box, (R * p + T).getTightBound());
p[0] = cgeom->aabb_local.max_[0];
p[1] = cgeom->aabb_local.min_[1];
p[2] = cgeom->aabb_local.min_[2];
box = bound(box, (R * p + T).getTightBound());
p[2] = cgeom->aabb_local.max_[2];
box = bound(box, (R * p + T).getTightBound());
p[1] = cgeom->aabb_local.max_[1];
p[2] = cgeom->aabb_local.min_[2];
box = bound(box, (R * p + T).getTightBound());
p[2] = cgeom->aabb_local.max_[2];
box = bound(box, (R * p + T).getTightBound());
aabb.min_ = box.getLow();
aabb.max_ = box.getHigh();
}
/// @brief get user data in object
void* getUserData() const
{
return user_data;
}
/// @brief set user data in object
void setUserData(void* data)
{
user_data = data;
}
/// @brief get motion from the object instance
inline MotionBase* getMotion() const
{
return motion.get();
}
/// @brief get geometry from the object instance
FCL_DEPRECATED
inline const CollisionGeometry* getCollisionGeometry() const
{
return cgeom.get();
}
/// @brief get geometry from the object instance
inline const std::shared_ptr<const CollisionGeometry>& collisionGeometry() const
{
return cgeom_const;
}
protected:
std::shared_ptr<CollisionGeometry> cgeom;
std::shared_ptr<const CollisionGeometry> cgeom_const;
std::shared_ptr<MotionBase> motion;
/// @brief AABB in the global coordinate for the motion
mutable AABB aabb;
/// @brief pointer to user defined data specific to this object
void* user_data;
};
}
#endif
| [
"tnt@mmmi.sdu.dk"
] | tnt@mmmi.sdu.dk |
3af57871dc3ce3d3700947f3cd1d8aadde190cec | 64c15978d0b2baf12ca26e48ab4f7404bc31cc07 | /pthread/Singlethread.cpp | a7c65f105e6ee0b9a26e42b9efaa932741968a31 | [] | no_license | ITechnoCare/Development_Master | 3de41e97f33c0eab8cdc34ef50e3a06b0c53f76c | 68f02735c37a85632279ec04ff4795d522781aa7 | refs/heads/master | 2021-01-01T17:34:07.699133 | 2017-07-23T18:21:09 | 2017-07-23T18:21:09 | 98,098,669 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,634 | cpp | #include<iostream>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
using namespace std;
namespace TC ///TC-Techno Care
{
class ThreadC
{
public:
ThreadC();
virtual ~ThreadC();
void create_thread();
void *function(void *ptr);
protected:
private:
int ret,ret1;
const char *message1;
const char *message2;
};
ThreadC::ThreadC()
{
message1 = "Thread 1";
message2 = "Thread 2";
}
ThreadC::~ThreadC(){}
void ThreadC::create_thread()
{
pthread_t thread1, thread2;
/* Create independent threads each of which will execute function */
ret = pthread_create( &thread1, NULL, function,(void*)message1);
if(ret)
{
fprintf(stderr,"Error - pthread_create() return code: %d\n",ret);
exit(EXIT_FAILURE);
}
ret1 = pthread_create( &thread2, NULL, function,(void*)message2);
if(ret1)
{
fprintf(stderr,"Error - pthread_create() return code: %d\n",ret1);
exit(EXIT_FAILURE);
}
printf("Thread 1 returns: %d\n",ret);
printf("Thread 2 returns: %d\n",ret1);
/* Wait till threads are complete before main continues. Unless we */
/* wait we run the risk of executing an exit which will terminate */
/* the process and all threads before the threads have completed. */
pthread_join( thread1, NULL);
pthread_join( thread2, NULL);
exit(EXIT_SUCCESS);
}
void *ThreadC::function(void *ptr)
{
char *message;
message = (char *) ptr;
printf("%s \n", message);
}
int main()
{
ThreadC t1;
t1.create_thread();
return 0;
}
}//namespace TC
| [
"technoenergycare@gmail.com"
] | technoenergycare@gmail.com |
e3cf280e187bf36b2b6eb1b834dad78005ab1506 | 2f557f60fc609c03fbb42badf2c4f41ef2e60227 | /Geometry/CaloGeometry/src/CaloNumberingScheme.cc | 77d28b55f307fd7db5f88f7f3c47c33dfa3eead9 | [
"Apache-2.0"
] | permissive | CMS-TMTT/cmssw | 91d70fc40a7110832a2ceb2dc08c15b5a299bd3b | 80cb3a25c0d63594fe6455b837f7c3cbe3cf42d7 | refs/heads/TMTT_1060 | 2020-03-24T07:49:39.440996 | 2020-03-04T17:21:36 | 2020-03-04T17:21:36 | 142,576,342 | 3 | 5 | Apache-2.0 | 2019-12-05T21:16:34 | 2018-07-27T12:48:13 | C++ | UTF-8 | C++ | false | false | 463 | cc | ///////////////////////////////////////////////////////////////////////////////
// File: CaloNumberingScheme.cc
// Description: Base class for numbering scheme of calorimeters
///////////////////////////////////////////////////////////////////////////////
#include "Geometry/CaloGeometry/interface/CaloNumberingScheme.h"
CaloNumberingScheme::CaloNumberingScheme(int iv) : verbosity(iv) {}
void CaloNumberingScheme::setVerbosity(const int iv) {verbosity = iv;}
| [
"giulio.eulisse@gmail.com"
] | giulio.eulisse@gmail.com |
bcf4ea03633700fd5c465762c4b42980d4481e88 | bc0945070d150c8af7cc56bf6e045a8c2cc7873d | /3230/2155557_WA.cpp | 44ad30e43bd32d1d9cd56f61c9fdb5ea272ce4e0 | [] | no_license | fengrenchang86/PKU | ab889d88cd62b3c0b3e00cde5d5c3a652a16221a | 0c4adf6b740d2186b7f23124673cd56520d1c818 | refs/heads/master | 2021-01-10T12:12:18.100884 | 2016-03-07T14:14:33 | 2016-03-07T14:14:33 | 53,328,385 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 883 | cpp | #include <iostream>
#include <fstream>
using namespace std;
int main ()
{
fstream fin("file.txt");
int n,m;
int *a = new int[120];
int *b = new int[120];
int *c;
int v[120][120];
int h[120][120];
int i,j,k;
int max;
while ( fin>>n>>m && !(m==0&&n==0))
{
for ( i = 1; i <= n; i++ )
{
for ( j = 1; j <= n; j++ )
fin>>v[i][j];
}
for ( i = 1; i <= m; i++ )
{
for ( j = 1; j <= n; j++ )
fin>>h[i][j];
}
for ( i = 1; i <= n; i++ )
a[i] = h[1][i] - v[1][i];
for ( i = 2; i <= m; i++ )
{
for ( j = 1; j <= n; j++ )
{
max = -99999;
for ( k = 1; k <= n; k++ )
{
if ( a[k] + h[i][j] - v[k][j] > max )
max = a[k] + h[i][j] - v[k][j];
}
b[j] = max ;
}
c = b;
b = a;
a = c;
}
max = -99999;
for ( i = 1; i <= n; i++ )
{
if ( max < a[i] )
max = a[i];
}
cout<<max<<endl;
}
return 0;
} | [
"fengrenchang86@gmail.com"
] | fengrenchang86@gmail.com |
c9aecf30de2d1dc44a9b805b5e6b15a8f3387283 | 612325535126eaddebc230d8c27af095c8e5cc2f | /src/net/tools/cert_verify_tool/cert_verify_tool.cc | 1ee7df652604eebcfcc96613ff434588d782a647 | [
"BSD-3-Clause"
] | permissive | TrellixVulnTeam/proto-quic_1V94 | 1a3a03ac7a08a494b3d4e9857b24bb8f2c2cd673 | feee14d96ee95313f236e0f0e3ff7719246c84f7 | refs/heads/master | 2023-04-01T14:36:53.888576 | 2019-10-17T02:23:04 | 2019-10-17T02:23:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,660 | cc | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <iostream>
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/time/time.h"
#include "net/tools/cert_verify_tool/cert_verify_tool_util.h"
#include "net/tools/cert_verify_tool/verify_using_cert_verify_proc.h"
#include "net/tools/cert_verify_tool/verify_using_path_builder.h"
namespace {
const char kUsage[] =
" [flags] <target/chain>\n"
"\n"
" <target/chain> is a file containing certificates [1]. Minimally it\n"
" contains the target certificate. Optionally it may subsequently list\n"
" additional certificates needed to build a chain (this is equivalent to\n"
" specifying them through --intermediates)\n"
"\n"
"Flags:\n"
"\n"
" --hostname=<hostname>\n"
" The hostname required to match the end-entity certificate.\n"
" Required for the CertVerifyProc implementation.\n"
"\n"
" --roots=<certs path>\n"
" <certs path> is a file containing certificates [1] to interpret as\n"
" trust anchors (without any anchor constraints).\n"
"\n"
" --intermediates=<certs path>\n"
" <certs path> is a file containing certificates [1] for use when\n"
" path building is looking for intermediates.\n"
"\n"
" --time=<time>\n"
" Use <time> instead of the current system time. <time> is\n"
" interpreted in local time if a timezone is not specified.\n"
" Many common formats are supported, including:\n"
" 1994-11-15 12:45:26 GMT\n"
" Tue, 15 Nov 1994 12:45:26 GMT\n"
" Nov 15 12:45:26 1994 GMT\n"
"\n"
" --dump=<file prefix>\n"
" Dumps the verified chain to PEM files starting with\n"
" <file prefix>.\n"
"\n"
"\n"
"[1] A \"file containing certificates\" means a path to a file that can\n"
" either be:\n"
" * A binary file containing a single DER-encoded RFC 5280 Certificate\n"
" * A PEM file containing one or more CERTIFICATE blocks (DER-encoded\n"
" RFC 5280 Certificate)\n";
void PrintUsage(const char* argv0) {
std::cerr << "Usage: " << argv0 << kUsage;
// TODO(mattm): allow <certs path> to be a directory containing DER/PEM files?
// TODO(mattm): allow target to specify an HTTPS URL to check the cert of?
// TODO(mattm): allow target to be a verify_certificate_chain_unittest PEM
// file?
}
} // namespace
int main(int argc, char** argv) {
base::AtExitManager at_exit_manager;
// TODO(eroman): Is this needed?
base::MessageLoopForIO message_loop;
if (!base::CommandLine::Init(argc, argv)) {
std::cerr << "ERROR in CommandLine::Init\n";
return 1;
}
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
logging::InitLogging(settings);
base::CommandLine::StringVector args = command_line.GetArgs();
if (args.size() != 1U || command_line.HasSwitch("help")) {
PrintUsage(argv[0]);
return 1;
}
std::string hostname = command_line.GetSwitchValueASCII("hostname");
base::Time verify_time;
std::string time_flag = command_line.GetSwitchValueASCII("time");
if (!time_flag.empty()) {
if (!base::Time::FromString(time_flag.c_str(), &verify_time)) {
std::cerr << "Error parsing --time flag\n";
return 1;
}
} else {
verify_time = base::Time::Now();
}
base::FilePath roots_path = command_line.GetSwitchValuePath("roots");
base::FilePath intermediates_path =
command_line.GetSwitchValuePath("intermediates");
base::FilePath target_path = base::FilePath(args[0]);
base::FilePath dump_prefix_path = command_line.GetSwitchValuePath("dump");
std::vector<CertInput> root_der_certs;
std::vector<CertInput> intermediate_der_certs;
CertInput target_der_cert;
if (!roots_path.empty())
ReadCertificatesFromFile(roots_path, &root_der_certs);
if (!intermediates_path.empty())
ReadCertificatesFromFile(intermediates_path, &intermediate_der_certs);
if (!ReadChainFromFile(target_path, &target_der_cert,
&intermediate_der_certs)) {
std::cerr << "ERROR: Couldn't read certificate chain\n";
return 1;
}
if (target_der_cert.der_cert.empty()) {
std::cerr << "ERROR: no target cert\n";
return 1;
}
// TODO(eroman): Also use CertVerifyProcBuiltin.
std::cout << "CertVerifyProc:\n";
bool cert_verify_proc_ok = true;
if (!time_flag.empty()) {
std::cerr << "ERROR: --time is not supported with CertVerifyProc, "
"skipping.\n";
} else if (hostname.empty()) {
std::cerr << "ERROR: --hostname is required for CertVerifyProc, skipping\n";
} else {
cert_verify_proc_ok = VerifyUsingCertVerifyProc(
target_der_cert, hostname, intermediate_der_certs, root_der_certs,
dump_prefix_path);
}
std::cout << "\nCertPathBuilder:\n";
if (!hostname.empty()) {
std::cerr
<< "WARNING: --hostname is not yet verified with CertPathBuilder\n";
}
bool path_builder_ok =
VerifyUsingPathBuilder(target_der_cert, intermediate_der_certs,
root_der_certs, verify_time, dump_prefix_path);
return (cert_verify_proc_ok && path_builder_ok) ? 0 : 1;
}
| [
"2100639007@qq.com"
] | 2100639007@qq.com |
e819c7116895752ebf2f505823a51541fccd460a | ed1fab36011044d5d434081b6caea5c6ed24a579 | /LightOJ - Ekka Dokka.cpp | 0d314e04f6bb9bdce2bc9a784940af5b752a3fa9 | [] | no_license | ssavi-ict/LightOJ-Solved-Problems | 78f924e7504b5303919f0c4e5b3f86d6c43ef061 | e800ae80dc0519577a27ca50fd4a8c353c90f9ba | refs/heads/master | 2021-01-17T12:14:04.447503 | 2018-12-08T13:58:52 | 2018-12-08T13:58:52 | 84,062,120 | 4 | 1 | null | 2018-12-08T13:58:53 | 2017-03-06T10:49:23 | C++ | UTF-8 | C++ | false | false | 832 | cpp | #include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#define MAX 1000008
#define PI acos(-1)
using namespace std;
int main()
{
long long int t, w, even, j=0;
cin>>t;
while(t--)
{
cin>>w;
if(w%2!=0)
cout<<"Case "<<++j<<": Impossible"<<endl;
else
{
even = 1;
while(w%2==0)
{
even = even*2;
w = w/2;
}
cout<<"Case "<<++j<<": "<<w<<" "<<even<<endl;
}
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
e479c762c9b3c0df197fe24d33be7d8b2fb0e53a | 878175c7acd229de8d905cf7affdd2e1a879951f | /contests/uri/uri-1467.cpp | 15f2b4e03d2f6ea9e3dcf41c06ce61465da18256 | [
"MIT"
] | permissive | leomaurodesenv/contest-codes | a9c99dad48db4804c5b5aa6d54b0f7b296922d7e | f7ae7e9d8c67e43dea7ac7dd71afce20d804f518 | refs/heads/master | 2021-10-16T09:12:30.988244 | 2019-02-09T20:26:37 | 2019-02-09T20:26:37 | 126,015,286 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 599 | cpp | /*
* Problema: Zerinho ou Um
* https://www.urionlinejudge.com.br/judge/pt/problems/view/1467
*/
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <locale>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
using namespace std;
int main(void){
int a, b, c;
while(cin>>a>>b>>c){
if(a == b && c != a) cout<<"C";
else if(a == c && b != a) cout<<"B";
else if(b == c && b != a) cout<<"A";
else cout<<"*";
cout<<endl;
}
return 0;
}
| [
"leo.mauro.desenv@gmail.com"
] | leo.mauro.desenv@gmail.com |
7d0d3efbe4450d5d2eee22992c90b4c9b59195b7 | 8f9a6ca8f37eb4a85e4a0519bc76d6a4525493cc | /hackerearth/algo/graph/easy/oliver-and-the-battle-1.cpp | cb0f438ee513cb6713773ba2aa8d76aaab69c1e4 | [] | no_license | shivam04/codes | 58057cc7c79171fdad6b597f744448573f581ea0 | 46f7c0f0f81304b2169a1a25ed7e95835d63e92c | refs/heads/master | 2023-07-19T17:17:21.414147 | 2023-07-09T17:41:07 | 2023-07-09T17:41:07 | 75,619,021 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,181 | cpp | #include <bits/stdc++.h>
using namespace std;
int adj[1010][1010],n,m;
int visit[1010][1010];
int solve(int x,int y){
visit[x][y]=1;
int i,j;
queue<pair<int,int> > q;
q.push(make_pair(x,y));
int count=1;
while(!q.empty()){
x = q.front().first;
y = q.front().second;
q.pop();
for(i=-1;i<=1;i++){
for(j=-1;j<=1;j++){
if(adj[x+i][y+j]==1 and !visit[x+i][y+j]){
q.push(make_pair(x+i,y+j));
count++;
visit[x+i][y+j]=1;
}
}
}
}
return count;
}
int main()
{
int t;
int i,j;
cin>>t;
while(t--){
cin>>n>>m;
for(i=1;i<=n;i++){
for(j=1;j<=m;j++){
cin>>adj[i][j];
visit[i][j]=0;
}
}
int count = 0;
int ans = 0;
for(i=1;i<=n;i++){
for(j=1;j<=m;j++){
if(!visit[i][j]&&adj[i][j]==1){
count++;
ans = max(solve(i,j),ans);
}
}
}
cout<<count<<" "<<ans<<"\n";
}
return 0;
} | [
"sinhashivam04@gmail.com"
] | sinhashivam04@gmail.com |
aba81391b91fa8675093b6eed0ce94fe1e269d1a | 2768a3b992d10f23bd0f6ff0f19e01a05908d853 | /include/Shader.h | 84464a5e6d5ed0db481e4d2c4665011a84d2cc73 | [] | no_license | Iisus/TakeOne | 42e1a35f5949a80ae41829a9fe163f6fed0ea89e | 4e7dbbeaa52af7abc27c9de182bbf4dd7dcf6a19 | refs/heads/master | 2016-09-09T22:03:02.623829 | 2016-03-06T11:49:13 | 2016-03-06T11:49:13 | 25,479,786 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 714 | h | #pragma once
#include <string>
namespace TakeOne
{
enum class ShaderType
{
VERTEX,
FRAGMENT
};
class Shader
{
public:
Shader(const std::string &pShaderPath, ShaderType pShaderType);
Shader(const Shader&) = delete;
Shader& operator=(const Shader&) = delete;
Shader(Shader&&);
Shader& operator=(Shader&&);
~Shader();
void Reload();
unsigned int GetShaderId() const;
ShaderType GetShaderType() const;
private:
void Compile(const std::string& pShaderSource);
void Unload();
std::string mShaderPath;
ShaderType mShaderType;
unsigned int mShaderId;
};
}
| [
"alexandruandrei91@gmail.com"
] | alexandruandrei91@gmail.com |
59c0b07bdd710883d24fcb1b017dc18105258860 | 2a4222ca06aad8d9116fc1bfbe1df13dcbcb1ea7 | /Debug/ext.h | c9b0448c8a11112920880389bc1309b77f2d1f2a | [] | no_license | RezWaki/IceFox_ | da1d0b618662cb41367f807a794e2b198369c9e5 | 2cb394cf030e4bc14cf14b5e4a7a082d9e6355c0 | refs/heads/master | 2021-04-12T07:59:29.060916 | 2018-03-20T08:25:30 | 2018-03-20T08:25:30 | 125,983,875 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 294 | h | #include <Windows.h>
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
void Extension(){
MessageBox::Show("EXT", "EXT");
} | [
"noreply@github.com"
] | noreply@github.com |
18723f9f38110aa7f8fbbbd1e11601af036bfe0b | 70ba87d1d4edbc44de7057a4be01c9c6cc1da01f | /10.Python/2.JiSuanKe/1.C่ฏญ่จ็จๅบ่ฎพ่ฎก๏ผๆตท่ดผ็งๆ๏ผ/15.่ๅคด็ฌๆฅผๆขฏ.cpp | d4b0b2cae0fa4e7ef0c65bf5d77e269afa3d5c35 | [] | no_license | Zip000000/CppPractice | f4ffa1bef0453f8c04906dd85f8a4c1053d2e782 | 9967443b2dea8ce253befac8e3330ed99f52ab8d | refs/heads/master | 2020-07-24T03:33:49.613419 | 2019-11-03T12:11:33 | 2019-11-03T12:11:33 | 207,788,632 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 339 | cpp | #include <stdio.h>
int step(int n)
{
if(n==0)
{
return 1;
}
else if(n==-1)
{
return 0;
}
else if(n==1)
{
return 0;
}
else
{
return (step(n-2)+step(n-3));
}
}
int main() {
int n;
scanf("%d",&n);
int ans=step(n);
printf("%d",ans);
return 0;
} | [
"307110017@qq.com"
] | 307110017@qq.com |
96303c4cd6de7b429c57fad3c74c7ac0dd45b8ea | 352e35c23a764f062604a67ae85740161b8e3d85 | /tema1.cpp | 1d41adc5e46127a5f0bd111b4840651f234b261a | [] | no_license | anemonamaria/tema1_EGC | 0dffcbc319336ea7b38e14e24cfd829820b9b576 | 4de08294591e48269e62c1789722432bb221a88a | refs/heads/main | 2023-09-05T04:32:01.970039 | 2021-11-15T18:27:27 | 2021-11-15T18:27:27 | 423,871,566 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,089 | cpp | #include "lab_m1/Tema1/tema1.h"
#include <vector>
#include <iostream>
#include <math.h>
#include "lab_m1/Tema1/transform2D.h"
#include "lab_m1/Tema1/object2D.h"
using namespace std;
using namespace m1;
Tema1::Tema1()
{
}
Tema1::~Tema1()
{
}
void Tema1::Init()
{
glm::ivec2 resolution = window->GetResolution();
player.lives = lives = 1.0f;
player.angle = projectile.angle = 0;
player.x = projectile.x = 0;
player.y = projectile.y = 0;
projectile.length = 10;
projectile.shot = false;
projectile.sec = 0;
obstacle.x = obstacle.y = 0;
score = 0;
maxScore = 5; // change this if you want to play longer
enemy_timer = 0;
game = 1;
auto camera = GetSceneCamera();
camera->SetOrthographic(0, (float)resolution.x, 0, (float)resolution.y, 0.01f, 400);
camera->SetPosition(glm::vec3((player.x + 2.0f) * resolution.x / 4 - resolution.x / 2, (player.y + 2.0f) * resolution.y / 4 - resolution.y / 2, 50));
camera->SetRotation(glm::vec3(0, 0, 0));
camera->Update();
GetCameraInput()->SetActive(false);
logicSpace.x = player.x + 1.f; // logic x
logicSpace.y = player.y + 1.f; // logic y
logicSpace.width = 2; // logic width
logicSpace.height = 2; // logic height
glm::vec3 corner = glm::vec3(0.001, 0.001, 0);
length = 0.99f;
Mesh* healthBar = object2D::CreateSquare1("healthBar", glm::vec3(0, 0, 0), 0.7f, 0.10f, glm::vec3(0.850, 0.792, 0.701), true);
AddMeshToList(healthBar);
Mesh* healthBar_wf = object2D::CreateSquare1("healthBar_wf", glm::vec3(0, 0, 0), 0.7f, 0.10f, glm::vec3(0.850, 0.792, 0.710), false);
AddMeshToList(healthBar_wf);
numberOfObstacles = 9;
Mesh* obstacleMesh = object2D::CreateSquare1("obstacle", glm::vec3(obstacle.x, obstacle.y, 0), 0.5f, 0.5f, glm::vec3(0.529, 0.658, 0.643), true);
AddMeshToList(obstacleMesh);
Mesh* margin1 = object2D::CreateSquare1("margin1", glm::vec3(0, 0, 0), 0.05f, 4.f, glm::vec3(0.529, 0.658, 0.643), true);
AddMeshToList(margin1);
Mesh* margin2 = object2D::CreateSquare1("margin2", glm::vec3(0.f, 3.93f, 0), 4.f, 0.07f, glm::vec3(0.529, 0.658, 0.643), true);
AddMeshToList(margin2);
Mesh* margin3 = object2D::CreateSquare1("margin3", glm::vec3(3.95f, 0, 0), 0.05f, 4.f, glm::vec3(0.529, 0.658, 0.643), true);
AddMeshToList(margin3);
Mesh* margin4 = object2D::CreateSquare1("margin4", glm::vec3(0.f, 0.f, 0), 4.f, 0.07f, glm::vec3(0.529, 0.658, 0.643), true);
AddMeshToList(margin4);
Mesh* projectile = object2D::CreateSquare1("projectile", glm::vec3(0.0, 0.0, 0), 0.03f, 0.06f, glm::vec3(0.137, 0.011, 0.207), true);
AddMeshToList(projectile);
player.angle = 0;
Mesh* player = object2D::CreatePlayer("player");
AddMeshToList(player);
{
numberOfEnemies = 10;
for (int i = 0; i < numberOfEnemies; ++i) {
enemy_aux.width = 0.3f;
enemy_aux.height = 0.3f;
enemy_aux.x = ((i + 1) * rand()) % 2;
enemy_aux.y = ((i + 1) * rand()) % 2;
enemy_aux.diffX = 4.0f - enemy_aux.x;
enemy_aux.diffY = 4.0f - enemy_aux.y;
enemy_aux.onScreen = true;
enemy_aux.color = glm::vec3(0.596, 0.427, 0.556);
enemy_aux.scale = 1;
enemy.push_back(enemy_aux);
}
}
Mesh* enemy_new;
enemy_new = object2D::CreateEnemy("enemy", glm::vec3(0, 0, 0), enemy_aux.color, glm::vec3(0, 0, 0));
AddMeshToList(enemy_new);
printf("HELLO! GOOD LUCK PLAYING SURVIVAL SHOOTER - MICKEY MOUSE EDITION!\n\n");
printf("Maximum score is %d and you start at %d score. You have %f lives, don't lose them!\n", maxScore, score, lives);
}
bool Tema1::checkProjectileEnemyCollision(int i) {
if (!enemy[i].onScreen)
return false;
float a = enemy[i].width;
float b = enemy[i].height;
float x = (projectile.x + 0.03f * cos(projectile.angle)) - enemy[i].x + 2.0f;
float y = (projectile.y + 0.06f * sin(projectile.angle)) - enemy[i].y + 2.0f;
if (pow(x / a, 2) + pow(y / b, 2) <= 1 && (projectile.x != player.x || projectile.y != player.y)) {
enemy[i].onScreen = false;
projectile.x = player.x;
projectile.y = player.y;
projectile.shot = false;
score += 1;
if (score == maxScore) {
printf("Congratulations! you are the winner! :)\n");
Exit();
} else
printf("~~~~~~Your score is %d! Keep playing!~~~~~~~\n", score);
return true;
}
return false;
}
bool Tema1::checkProjectileObstacleCollision(int i) {
float a = 0.5f;
float b = 0.5f;
float x = (projectile.x + 0.03f * cos(projectile.angle)) - obstacle_struct[i].x + 2.0f;
float y = (projectile.y + 0.06f * sin(projectile.angle)) - obstacle_struct[i].y + 2.0f;
if (pow(x / a, 2) + pow(y / b, 2) <= 1 && (projectile.x != player.x || projectile.y != player.y)) {
projectile.x = player.x;
projectile.y = player.y;
projectile.shot = false;
return true;
}
return false;
}
bool Tema1::checkPlayerObstacleCollision(int i) {
float a = 0.5f;
float b = 0.5f;
float x = (player.x + 2.0f) - obstacle_struct[i].x;
float y = (player.y + 2.0f) - obstacle_struct[i].y;
if (pow(x / a, 2) + pow(y / b, 2) <= 1) {
return true;
}
return false;
}
// 2D visualization matrix
glm::mat3 Tema1::VisualizationTransf2D(const LogicSpace& logicSpace, const ViewportSpace& viewSpace)
{
float sx, sy, tx, ty;
sx = viewSpace.width / logicSpace.width;
sy = viewSpace.height / logicSpace.height;
tx = viewSpace.x - sx * logicSpace.x;
ty = viewSpace.y - sy * logicSpace.y;
return glm::transpose(glm::mat3(
sx, 0.0f, tx,
0.0f, sy, ty,
0.0f, 0.0f, 1.0f));
}
// Uniform 2D visualization matrix (same scale factor on x and y axes)
glm::mat3 Tema1::VisualizationTransf2DUnif(const LogicSpace& logicSpace, const ViewportSpace& viewSpace)
{
float sx, sy, tx, ty, smin;
sx = viewSpace.width / logicSpace.width;
sy = viewSpace.height / logicSpace.height;
if (sx < sy)
smin = sx;
else
smin = sy;
tx = viewSpace.x - smin * logicSpace.x + (viewSpace.width - smin * logicSpace.width) / 2;
ty = viewSpace.y - smin * logicSpace.y + (viewSpace.height - smin * logicSpace.height) / 2;
return glm::transpose(glm::mat3(
smin, 0.0f, tx,
0.0f, smin, ty,
0.0f, 0.0f, 1.0f));
}
void Tema1::SetViewportArea(const ViewportSpace& viewSpace, glm::vec3 colorColor, bool clear)
{
glViewport(viewSpace.x, viewSpace.y, viewSpace.width, viewSpace.height);
glEnable(GL_SCISSOR_TEST);
glScissor(viewSpace.x, viewSpace.y, viewSpace.width, viewSpace.height);
// Clears the color buffer (using the previously set color) and depth buffer
glClearColor(colorColor.r, colorColor.g, colorColor.b, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
GetSceneCamera()->SetOrthographic((float)viewSpace.x, (float)(viewSpace.x + viewSpace.width), (float)viewSpace.y, (float)(viewSpace.y + viewSpace.height), 0.1f, 400);
GetSceneCamera()->Update();
}
void Tema1::FrameStart()
{
// Clears the color buffer (using the previously set color) and depth buffer
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
bool Tema1::projectileOutOfBounds() {
return (projectile.x > 0.75 + player.x || projectile.y < -0.75 + player.y ||
projectile.y > 0.75 + player.y || projectile.x < -0.75 + player.x // distanta de propagare
|| projectile.x > 1.9 || projectile.x < -1.9 || projectile.y < -1.9 // sa nu depaseasca harta
|| projectile.y > 1.9);
}
bool Tema1::positionOutOfBonds(float x, float y) {
return (x > 4 || y < 0 || y > 4 || x < 0);
}
void Tema1::ResetProjectile() {
projectile.x = player.x;
projectile.y = player.y;
projectile.angle = player.angle + 3 * M_PI / 2;
projectile.shot = false;
}
void Tema1::Update(float deltaTimeSeconds)
{
glm::ivec2 resolution = window->GetResolution();
auto camera = GetSceneCamera();
camera->SetPosition(glm::vec3((player.x + 2.0f), (player.y + 2.0f), 50));
// Sets the screen area where to draw
viewSpace = ViewportSpace(0, 0, resolution.x, resolution.y);
SetViewportArea(viewSpace, glm::vec3(0.937, 0.890, 0.815), true);
// Compute the 2D visualization matrix
visMatrix_outside = glm::mat3(1);
visMatrix_outside *= VisualizationTransf2D(logicSpace, viewSpace);
DrawScene(visMatrix_outside);
viewSpace = ViewportSpace(0, 0, resolution.x, resolution.y);
SetViewportArea(viewSpace, glm::vec3(0.937, 0.890, 0.815), true);
// Compute the 2D visualization matrix
visMatrix_inside = glm::mat3(1);
visMatrix_inside *= VisualizationTransf2D(logicSpace, viewSpace);
//projectile movement
{
if (projectile.shot) {
projectile.x += projectile.power * deltaTimeSeconds * 2.f * cos(projectile.angle);
projectile.y += projectile.power * deltaTimeSeconds * 2.f * sin(projectile.angle);
}
for (int i = 0; i < numberOfEnemies; ++i) {
checkProjectileEnemyCollision(i);
}
// for (int i = 0; i < 8; i++) {
// checkProjectileObstacleCollision(i);
//}
if (projectileOutOfBounds())
ResetProjectile();
}
srand(time(NULL));
// Enemy Movement
{
for (int i = 0; i < numberOfEnemies; ++i) {
if (enemy[i].onScreen) {
if (player.y + 2.0f > enemy[i].y) {
do {
enemy[i].y += deltaTimeSeconds * (((i / 10 + 1) * rand()) % 4) / 5;
} while (enemy[i].y + enemy[i].diffY - 2.0f == player.y + 2.0f);
}
if(player.y + 2.0f < enemy[i].y) {
do {
enemy[i].y -= deltaTimeSeconds * (((i / 10 + 1) * rand()) % 4) / 5;
} while (enemy[i].y + enemy[i].diffY - 2.0f == player.y + 2.0f);
}
if (player.x + 2.0f > enemy[i].x) {
do {
enemy[i].x += deltaTimeSeconds * (((i / 10 + 1) * rand()) % 4) / 5;
} while (enemy[i].x + enemy[i].diffX - 2.0f == player.y + 2.0f);
}
if(player.x + 2.0f < enemy[i].x) {
do {
enemy[i].x -= deltaTimeSeconds * (((i / 10 + 1) * rand()) % 4) / 5;
} while (enemy[i].x + enemy[i].diffX - 2.0f == player.x + 2.0f);
}
if (pow(player.x + 2.7f - enemy[i].x, 2) + pow(player.y + 2.7f - enemy[i].x, 2) <= 1
&& enemy[i].onScreen == true) {
enemy[i].onScreen = false;
player.lives -= 0.1f;
if (player.lives <= 0) {
for (int j = 0; j < numberOfEnemies; j++) {
enemy[j].onScreen = false;
game = 0;
}
} else
printf("You have %f lives left!\n", player.lives);
}
}
}
}
DrawScene(visMatrix_inside);
}
void Tema1::FrameEnd()
{
}
void Tema1::DrawScene(glm::mat3 visMatrix)
{
modelMatrix = visMatrix_inside * transform2D::Translate(player.x + 3.2, player.y + 3.8) * transform2D::Scale(1.0f, 1.0f);
RenderMesh2D(meshes["healthBar_wf"], shaders["VertexColor"], modelMatrix);
modelMatrix = visMatrix_inside * transform2D::Translate(player.x + 3.2, player.y + 3.8) * transform2D::Scale(player.lives, 1.0f);
RenderMesh2D(meshes["healthBar"], shaders["VertexColor"], modelMatrix);
modelMatrix = visMatrix_outside * transform2D::Translate(0, 0);
RenderMesh2D(meshes["margin1"], shaders["VertexColor"], modelMatrix);
modelMatrix = visMatrix_outside * transform2D::Translate(0, 0);
RenderMesh2D(meshes["margin2"], shaders["VertexColor"], modelMatrix);
modelMatrix = visMatrix_outside * transform2D::Translate(0, 0);
RenderMesh2D(meshes["margin3"], shaders["VertexColor"], modelMatrix);
modelMatrix = visMatrix_outside * transform2D::Translate(0, 0);
RenderMesh2D(meshes["margin4"], shaders["VertexColor"], modelMatrix);
modelMatrix = visMatrix_inside * transform2D::Translate(player.x + 2.0f, player.y + 2.0f) * transform2D::Scale(0.05, 0.06)
* transform2D::Rotate(player.angle);
RenderMesh2D(meshes["player"], shaders["VertexColor"], modelMatrix);
modelMatrix = visMatrix_outside * transform2D::Translate(projectile.x + 2.0f, projectile.y + 2.0f)
* transform2D::Rotate(projectile.angle);
RenderMesh2D(meshes["projectile"], shaders["VertexColor"], modelMatrix);
// Enemy Render
{
float enemy_clock = std::clock() / CLOCKS_PER_SEC;
for (int i = 0; i < numberOfEnemies; ++i) {
if (enemy[i].onScreen == true) {
modelMatrix = visMatrix_inside * transform2D::Translate(enemy[i].x, enemy[i].y) * transform2D::Scale(0.3f, 0.3f);
RenderMesh2D(meshes["enemy"], shaders["VertexColor"], modelMatrix);
}
}
}
obstacle_t aux_obstacle;
aux_obstacle.x = 0.25f;
aux_obstacle.y = 0.4f;
aux_obstacle.scaleX = 0.5f;
aux_obstacle.scaleY = 1.3f;
obstacle_struct.push_back(aux_obstacle);
aux_obstacle.x = 0.5f;
aux_obstacle.y = 2.5f;
aux_obstacle.scaleX = 0.8f;
aux_obstacle.scaleY = 0.5f;
obstacle_struct.push_back(aux_obstacle);
aux_obstacle.x = 0.5f;
aux_obstacle.y = 3.3f;
aux_obstacle.scaleX = 0.8f;
aux_obstacle.scaleY = 0.5f;
obstacle_struct.push_back(aux_obstacle);
aux_obstacle.x = 0.8f;
aux_obstacle.y = 1.f;
aux_obstacle.scaleX = 0.6f;
aux_obstacle.scaleY = 0.6f;
obstacle_struct.push_back(aux_obstacle);
aux_obstacle.x = 1.3f;
aux_obstacle.y = 2.4f;
aux_obstacle.scaleX = 0.6f;
aux_obstacle.scaleY = 1.5f;
obstacle_struct.push_back(aux_obstacle);
aux_obstacle.x = 2.5f;
aux_obstacle.y = 3.f;
aux_obstacle.scaleX = 0.5f;
aux_obstacle.scaleY = 0.8f;
obstacle_struct.push_back(aux_obstacle);
aux_obstacle.x = 2.2f;
aux_obstacle.y = 1.4f;
aux_obstacle.scaleX = 0.9f;
aux_obstacle.scaleY = 0.9f;
obstacle_struct.push_back(aux_obstacle);
aux_obstacle.x = 3.3f;
aux_obstacle.y = 0.7f;
aux_obstacle.scaleX = 0.5f;
aux_obstacle.scaleY = 1.4f;
obstacle_struct.push_back(aux_obstacle);
obstacle.x = 3.3f;
obstacle.y = 2.7f;
obstacle.scaleX = 0.5f;
obstacle.scaleY = 1.4f;
obstacle_struct.push_back(aux_obstacle);
for (int i = 0; i < obstacle_struct.size(); i++) {
modelMatrix = visMatrix_outside * transform2D::Translate(obstacle_struct[i].x, obstacle_struct[i].y)
* transform2D::Scale(obstacle_struct[i].scaleX, obstacle_struct[i].scaleY);
RenderMesh2D(meshes["obstacle"], shaders["VertexColor"], modelMatrix);
}
if (game == 0) {
printf("You lost :( Please exit the game!\n");
Exit();
}
}
/*
* These are callback functions. To find more about callbacks and
* how they behave, see `input_controller.h`.
*/
void Tema1::OnInputUpdate(float deltaTime, int mods)
{
glm::ivec2 resolution = window->GetResolution();
for (int i = 0; i < obstacle_struct.size(); i++) {
if (!checkPlayerObstacleCollision(i) && window->KeyHold(GLFW_KEY_W)) {
if (player.y < 1.9f) {
player.y += deltaTime / obstacle_struct.size();
if (!projectile.shot)
projectile.y = player.y;
// logicSpace.x = player.x + 1.f; // logic x
logicSpace.y = player.y + 1.f; // logic y
}
}
if (!checkPlayerObstacleCollision(i) && window->KeyHold(GLFW_KEY_A)) {
if (player.x > -1.9f) {
player.x -= deltaTime / obstacle_struct.size();
if (!projectile.shot)
projectile.x = player.x;
logicSpace.x = player.x + 1.f; // logic x
//logicSpace.y = player.y + 1.f; // logic y
}
}
if (!checkPlayerObstacleCollision(i) && window->KeyHold(GLFW_KEY_S)) {
if (player.y > -1.9f) {
player.y -= deltaTime / obstacle_struct.size();
if (!projectile.shot)
projectile.y = player.y;
//logicSpace.x = player.x + 1.f; // logic x
logicSpace.y = player.y + 1.f; // logic y
}
}
if (!checkPlayerObstacleCollision(i) && window->KeyHold(GLFW_KEY_D)) {
if (player.x < 1.9f) {
player.x += deltaTime / obstacle_struct.size();
if (!projectile.shot)
projectile.x = player.x;
logicSpace.x = player.x + 1.f; // logic x
//logicSpace.y = player.y + 1.f; // logic y
}
}
}
float mytime = std::clock() / CLOCKS_PER_SEC + 1;
if (!projectile.shot && window->MouseHold(GLFW_MOUSE_BUTTON_LEFT) && mytime - projectile.sec > 1) {
projectile.shot = true;
projectile.sec = mytime;
projectile.power = 1.1;
}
}
void Tema1::OnKeyPress(int key, int mods)
{
}
void Tema1::OnKeyRelease(int key, int mods)
{
// Add key release event
}
void Tema1::setPlayerAngle() {
glm::ivec2 resolution = window->GetResolution();
int ax = player.x * resolution.x / 4 + resolution.x / 2;
int ay = player.y * resolution.y / 4 + resolution.y / 2;
ax = cursorX - ax;
ay = - cursorY + ay;
glm::vec2 auxvect = glm::normalize(glm::vec2(ax, ay));
if (auxvect.y < 0) {
auxvect.x = -auxvect.x;
}
if(auxvect.x == 0 && auxvect.y < 0) {
player.angle = 180.f;
}
else if (auxvect.x == 0 && auxvect.y > 0) {
player.angle = 0.f;
}
else
{
player.angle = atan(auxvect.x / auxvect.y);
}
if (auxvect.y > 0) {
player.angle = -player.angle + M_PI;
}
if (!projectile.shot)
projectile.angle = player.angle + 3 * M_PI / 2;
}
void Tema1::OnMouseMove(int mouseX, int mouseY, int deltaX, int deltaY)
{
// Add mouse move event
cursorX = mouseX - deltaX;
cursorY = mouseY - deltaY;
setPlayerAngle();
}
void Tema1::OnMouseBtnPress(int mouseX, int mouseY, int button, int mods)
{
// Add mouse button press event
}
void Tema1::OnMouseBtnRelease(int mouseX, int mouseY, int button, int mods)
{
// Add mouse button release event
}
void Tema1::OnMouseScroll(int mouseX, int mouseY, int offsetX, int offsetY)
{
}
| [
"noreply@github.com"
] | noreply@github.com |
321c7e16cfa0d620c333ffab33a912987a2b20ee | 325629fde51468c5d03f4028a13c43d967d1b05b | /signal-slot-benchmarks/benchmark/cpp/benchmark_nss_sts.cpp | 9b0bdedc9b7e75a2381cfed5eeea139d0e9353ef | [
"MIT"
] | permissive | j-jorge/signals | cc05945517f377735e3b38741d41868dedafe9dd | 02653304840ed294bb907d13cdce3cc260b5d8ce | refs/heads/master | 2021-03-10T02:25:01.766388 | 2020-03-11T07:39:20 | 2020-03-11T07:39:20 | 246,407,802 | 0 | 0 | MIT | 2020-03-10T21:03:29 | 2020-03-10T21:03:28 | null | UTF-8 | C++ | false | false | 1,287 | cpp | #include "../hpp/benchmark_nss_sts.hpp"
NOINLINE(void Nss_sts::initialize())
{
// NOOP
}
NOINLINE(void Nss_sts::validate_assert(std::size_t N))
{
return Benchmark<Signal, Nss_sts>::validation_assert(N);
}
NOINLINE(double Nss_sts::construction(std::size_t N, std::size_t limit))
{
return Benchmark<Signal, Nss_sts>::construction(N, limit);
}
NOINLINE(double Nss_sts::destruction(std::size_t N, std::size_t limit))
{
return Benchmark<Signal, Nss_sts>::destruction(N, limit);
}
NOINLINE(double Nss_sts::connection(std::size_t N, std::size_t limit))
{
return Benchmark<Signal, Nss_sts>::connection(N, limit);
}
NOINLINE(double Nss_sts::disconnect(std::size_t N, std::size_t limit))
{
return Benchmark<Signal, Nss_sts>::disconnect(N, limit);
}
NOINLINE(double Nss_sts::reconnect(std::size_t N, std::size_t limit))
{
return Benchmark<Signal, Nss_sts>::reconnect(N, limit);
}
NOINLINE(double Nss_sts::emission(std::size_t N, std::size_t limit))
{
return Benchmark<Signal, Nss_sts>::emission(N, limit);
}
NOINLINE(double Nss_sts::combined(std::size_t N, std::size_t limit))
{
return Benchmark<Signal, Nss_sts>::combined(N, limit);
}
NOINLINE(double Nss_sts::threaded(std::size_t N, std::size_t limit))
{
// NOT IMPLEMENTED FOR THIS LIB
return 0.0;
}
| [
"feiteng@gmail.com"
] | feiteng@gmail.com |
c21a08b6ec908a43804f66c42a47312dca32aa17 | 2c27dd8c10e5450dd638eb52a11428f8fc389f6f | /src/kernel/plus_loop_sys.cpp | 8ad4382b57788b7ac5bdb9bfe9fbddf836a3dfec | [
"MIT"
] | permissive | wa1tnr/yaffa_samD51-exp | 30a7908b396ca9364bf0b1b19e0c446b7779b00f | 555f0e0bbba5c453366960d16573d368065f62f3 | refs/heads/master | 2020-07-14T07:24:03.474141 | 2019-08-30T04:36:10 | 2019-08-30T04:36:10 | 205,272,617 | 0 | 0 | MIT | 2019-08-30T04:44:40 | 2019-08-30T00:18:48 | C | UTF-8 | C++ | false | false | 607 | cpp | // Fri Jun 9 02:32:35 UTC 2017
// 4735-a0f
#include <Arduino.h>
#include "../../yaffa.h"
// #include "Error_Codes.h"
#ifdef EXT_KERN_PLUS_LOOP_SYS
#include "plus_loop_sys.h"
const char plus_loop_sys_str[] = "plus_loop-sys";
void _plus_loop_sys(void) {
cell_t limit = rStack_pop(); // fetch limit
cell_t index = rStack_pop(); // fetch index
index += dStack_pop();
if (limit != index) {
rStack_push(index);
rStack_push(limit);
ip = (cell_t*)*ip;
} else {
ip++;
if (rStack_pop() != LOOP_SYS) {
//dStack_push(-22);
_throw(-22);
return;
}
}
}
#endif
| [
"samsuanchen@gmail.com"
] | samsuanchen@gmail.com |
e6ee89a1d69776eff677fcf7f71d05786da60ae1 | 3ab136aa6adf5c22bb9cad730b0491d6c931ff8d | /shader_loader.h | ff7a9a7e4c1316c3c3b4af54bcb82ad8f1ac493e | [] | no_license | source-code-repo/ogl | f04c1bba3b42d801c82aae4ca516f21ed6b674c4 | f2ae69de6d811f1931d1b1182684c1feaf2e24f8 | refs/heads/master | 2022-07-18T19:51:30.871433 | 2020-05-23T13:27:23 | 2020-05-23T13:27:23 | 263,045,366 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 168 | h | #pragma once
#include <sstream>
class ShaderLoader {
public:
std::stringstream getCode(const char * path);
GLuint compileShader(const char* code, int shaderType);
}; | [
"me@anonymous.com"
] | me@anonymous.com |
8ce01223fe4023a81ef95fcbfbc33b89931a6185 | e3ef6ff25d8322cf479210846ebc677702e8edab | /necrodancer/soundManager.cpp | 2ec66b65fcedd39fdff70444830716eb7544dd83 | [] | no_license | dongnamyoooooooooon/yoOoOoOon | 885dbfe0c982ddc3c79eca8b129a2b11bbfd53c5 | 8a1e84a053bcf752532fb102d54fe5d810ce255b | refs/heads/master | 2020-05-01T14:05:27.437184 | 2019-04-09T08:44:05 | 2019-04-09T08:44:05 | 177,509,953 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 20,548 | cpp | #include "stdafx.h"
#include "soundManager.h"
soundManager::soundManager()
:_system(NULL),
_channel(NULL),
_sound(NULL)
{
}
soundManager::~soundManager()
{
}
void soundManager::playZone(string keyName, float volume)
{
int count = 0;
int count_BGM, count_shop; //๋ฐฐ๊ฒฝ, ์์ ์ฃผ์ธ์ฉ ์นด์ดํธ
string keyName_shop = keyName + "_shopkeeper"; //์์ ์ฃผ์ธ์ฉ ํค๊ฐ์ ์ํด ์ฐ์ธ๋ค.
arrSoundsIter iter_BGM = _mTotalSounds.begin(); //๋ฐฐ๊ฒฝ์์
์ฉ iter
arrSoundsIter iter_shop = _mTotalSounds.begin(); //์์ ์ฃผ์ธ์ฉ iter
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
iter_BGM = iter;
count_BGM = count;
}
else if (keyName_shop == iter->first)
{
iter_shop = iter;
count_shop = count;
}
}
_system->playSound(FMOD_CHANNEL_REUSE, *iter_BGM->second, false, &_channel[count_BGM]);
_channel[count_BGM]->setVolume(volume);
if (keyName != "music_loddy")
{
_system->playSound(FMOD_CHANNEL_REUSE, *iter_shop->second, false, &_channel[count_shop]);
_channel[count_shop]->setVolume(volume);
}
}
void soundManager::pauseZone(string keyName)
{
int count = 0;
int count_BGM, count_shop; //๋ฐฐ๊ฒฝ, ์์ ์ฃผ์ธ์ฉ ์นด์ดํธ
string keyName_shop = keyName + "_shopkeeper"; //์์ ์ฃผ์ธ์ฉ ํค๊ฐ์ ์ํด ์ฐ์ธ๋ค.
arrSoundsIter iter_BGM = _mTotalSounds.begin(); //๋ฐฐ๊ฒฝ์์
arrSoundsIter iter_shop = _mTotalSounds.begin(); //์์ ์ฃผ์ธ
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
iter_BGM = iter;
count_BGM = count;
}
else if (keyName_shop == iter->first)
{
iter_shop = iter;
count_shop = count;
}
}
_channel[count_BGM]->setPaused(true);
_channel[count_shop]->setPaused(true);
}
void soundManager::resumeZone(string keyName, float volume)
{
int count = 0;
int count_BGM, count_shop; //๋ฐฐ๊ฒฝ, ์์ ์ฃผ์ธ์ฉ ์นด์ดํธ
string keyName_shop = keyName + "_shopkeeper"; //์์ ์ฃผ์ธ์ฉ ํค๊ฐ์ ์ํด ์ฐ์ธ๋ค.
arrSoundsIter iter_BGM = _mTotalSounds.begin(); //๋ฐฐ๊ฒฝ์์
arrSoundsIter iter_shop = _mTotalSounds.begin(); //์์ ์ฃผ์ธ
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
iter_BGM = iter;
count_BGM = count;
}
else if (keyName_shop == iter->first)
{
iter_shop = iter;
count_shop = count;
}
}
_channel[count_BGM]->setPaused(false);
_channel[count_shop]->setPaused(false);
}
void soundManager::ShopVolume(string keyName, float volume)
{
int count = 0;
int count_BGM, count_shop; //๋ฐฐ๊ฒฝ, ์์ ์ฃผ์ธ์ฉ ์นด์ดํธ
_shopVolume = volume;
string keyName_shop = keyName + "_shopkeeper"; //์์ ์ฃผ์ธ์ฉ ํค๊ฐ์ ์ํด ์ฐ์ธ๋ค.
arrSoundsIter iter_BGM = _mTotalSounds.begin(); //๋ฐฐ๊ฒฝ์์
arrSoundsIter iter_shop = _mTotalSounds.begin(); //์์ ์ฃผ์ธ
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
iter_BGM = iter;
count_BGM = count;
}
else if (keyName_shop == iter->first)
{
iter_shop = iter;
count_shop = count;
}
}
_channel[count_shop]->setVolume(volume);
}
void soundManager::setBossVolume(string keyName, float volume)
{
int count = 0;
int count_bass, count_drum, count_horn, count_keytar, count_strings;
string keyName_bass = keyName + "_bass";
string keyName_drum = keyName + "_drum";
string keyName_horn = keyName + "_horn";
string keyName_keytar = keyName + "_keytar";
string keyName_strings = keyName + "_strings";
arrSoundsIter iter_bass = _mTotalSounds.begin();
arrSoundsIter iter_drum = _mTotalSounds.begin();
arrSoundsIter iter_horn = _mTotalSounds.begin();
arrSoundsIter iter_keytar = _mTotalSounds.begin();
arrSoundsIter iter_strings = _mTotalSounds.begin();
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName_bass == iter->first)
{
iter_bass = iter;
count_bass = count;
}
else if (keyName_drum == iter->first)
{
iter_drum = iter;
count_drum = count;
}
else if (keyName_horn == iter->first)
{
iter_horn = iter;
count_horn = count;
}
else if (keyName_keytar == iter->first)
{
iter_keytar = iter;
count_keytar = count;
}
else if (keyName_strings == iter->first)
{
iter_strings = iter;
count_strings = count;
}
}
_channel[count_bass]->setVolume(volume);
_channel[count_drum]->setVolume(volume);
_channel[count_horn]->setVolume(volume);
_channel[count_keytar]->setVolume(volume);
_channel[count_strings]->setVolume(volume);
}
void soundManager::setDrumVolume(string keyName, float volume)
{
int count = 0;
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_drumVolume -= volume;
if (_drumVolume <= 0) _drumVolume = 0;
_channel[count]->setVolume(_drumVolume);
break;
}
}
}
void soundManager::setHornVolume(string keyName, float volume)
{
int count = 0;
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_hornVolume -= volume;
if (_hornVolume <= 0) _hornVolume = 0;
_channel[count]->setVolume(_hornVolume);
break;
}
}
}
void soundManager::setKeytarVolume(string keyName, float volume)
{
int count = 0;
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_keytarVolume -= volume;
if (_keytarVolume <= 0) _keytarVolume = 0;
_channel[count]->setVolume(_keytarVolume);
break;
}
}
}
void soundManager::setStringsVolume(string keyName, float volume)
{
int count = 0;
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_stringsVolume -= volume;
if (_stringsVolume <= 0) _stringsVolume = 0;
_channel[count]->setVolume(_stringsVolume);
break;
}
}
}
void soundManager::playBossZone(string keyName, float volume)
{
int count = 0;
int count_bass, count_drum, count_horn, count_keytar, count_strings;
string keyName_bass = keyName + "_bass";
string keyName_drum = keyName + "_drum";
string keyName_horn = keyName + "_horn";
string keyName_keytar = keyName + "_keytar";
string keyName_strings = keyName + "_strings";
arrSoundsIter iter_bass = _mTotalSounds.begin();
arrSoundsIter iter_drum = _mTotalSounds.begin();
arrSoundsIter iter_horn = _mTotalSounds.begin();
arrSoundsIter iter_keytar = _mTotalSounds.begin();
arrSoundsIter iter_strings = _mTotalSounds.begin();
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName_bass == iter->first)
{
iter_bass = iter;
count_bass = count;
}
else if (keyName_drum == iter->first)
{
iter_drum = iter;
count_drum = count;
}
else if (keyName_horn == iter->first)
{
iter_horn = iter;
count_horn = count;
}
else if (keyName_keytar == iter->first)
{
iter_keytar = iter;
count_keytar = count;
}
else if (keyName_strings == iter->first)
{
iter_strings = iter;
count_strings = count;
}
}
_system->playSound(FMOD_CHANNEL_FREE, *iter_bass->second, false, &_channel[count_bass]);
_channel[count_bass]->setVolume(volume);
_system->playSound(FMOD_CHANNEL_FREE, *iter_drum->second, false, &_channel[count_drum]);
_channel[count_drum]->setVolume(volume);
_system->playSound(FMOD_CHANNEL_FREE, *iter_horn->second, false, &_channel[count_horn]);
_channel[count_horn]->setVolume(volume);
_system->playSound(FMOD_CHANNEL_FREE, *iter_keytar->second, false, &_channel[count_keytar]);
_channel[count_keytar]->setVolume(volume);
_system->playSound(FMOD_CHANNEL_FREE, *iter_strings->second, false, &_channel[count_strings]);
_channel[count_strings]->setVolume(volume);
}
void soundManager::playEff(string keyName)
{
arrSoundsIter iter = _mTotalSounds.begin();
int count = 0;
for (iter; iter != _mTotalSounds.end(); ++iter, ++count)
{
Sound* sound = *iter->second;
SoundGroup* soundGroup = nullptr;
if (keyName == iter->first)
{
// ์ด๋ ์ฌ์ด๋ ๊ทธ๋ฃน์ ์ํด์๋์ง ํ์ธ
sound->getSoundGroup(&soundGroup);
if (soundGroup == _bgmSoundGroup) // bgm soundgroup
{
_bgmSoundGroup->stop(); // ํ๋ ์ด์ค์ธ bgm ์ ์ง
_channel[count]->setChannelGroup(_bgmGroup);
}
else // effect soundgroup
_channel[count]->setChannelGroup(_effectGroup);
_system->playSound(FMOD_CHANNEL_REUSE, sound, false, &_channel[count]);
_channel[count]->setVolume(_effectVol);
break;
}
}
}
void soundManager::loadBeat(const char * fileName, string keyName)
{
_vBeat.clear(); //๋น์ด๋ค. ๋นํธ๋ฒกํฐ. ๊น๋ํ
vector<string> vTemp; //์์๋ก ๋นํธ๋ฅผ ๋ด์ ๋ฒกํฐ
vTemp = TXTDATA->txtLoad(fileName); //ํ์ผ์ ๋ก๋ํ๋ค. ๋ก๋ํ๋ฉด์ ๋นํธ๋ ๊ตฌ๋ถ์์ ์ํด ์ชผ๊ฐ์ง๋ค.
int size = vTemp.size(); //์์๋ฒกํฐ๋งํผ ์ฌ์ด์ฆ๋ก ๋นํธ๋ฒกํฐ์ ๋ฃ์ ์์
//stoi์ ํ์ํ ๋ณ์
if (_mBeat.find(keyName) == _mBeat.end()) //๋ง์ฝ ํค๊ฐ์ด ๋งต์ ์์๊ฒฝ์ฐ(์ค๋ณตX)
{
for (int i = 0; i < size; i++) //์์๋ฒกํฐ๋งํผ for๋ฌธ ๋๋ฆฐ๋ค.
{
_note.beat = stoi(vTemp[i]); //์์๋ฒกํฐ์ ์๋ string์ int๋ก ๋ณํํด์ note์ ๋ฃ์ด์ค๋ค.
_vBeat.push_back(_note); //๋นํธ๋ฒกํฐ์ note์ ๋ค์ด์๋ ๊ฐ์ ๋ฃ์ด์ค๋ค.
}
_mBeat.insert(make_pair(keyName, _vBeat)); //๋งต์ ํค๊ฐ๊ณผ ๋นํธ๋ฒกํฐ ๋ฃ์ด์ค๋ค.
for (int i = 0; i < _vBeat.size(); i++)
{
if (keyName != "boss")
{
if ((_vBeat.back().beat - 30000) > _vBeat[i].beat)
_vBeat[i].img = IMAGEMANAGER->findImage("ui_beat_marker");
else
_vBeat[i].img = IMAGEMANAGER->findImage("ui_beat_marker_red");
}
else if (keyName == "boss")
{
_vBeat[i].img = IMAGEMANAGER->findImage("ui_beat_marker");
}
}
}
else //ํค๊ฐ์ด ๋งต์ ์กด์ฌํ๋ค๋ฉด(์ค๋ณตO)
{
for (_miBeat = _mBeat.begin(); _miBeat != _mBeat.end(); _miBeat++) //iter๋ก for๋ฌธ ๋๋ฆฐ๋ค. (์ค๋ณต๋ ํค๊ฐ ์ฐพ๊ธฐ์ํด)
{
if (_miBeat->first == keyName) //ํค๊ฐ ์ฐพ์์ผ๋ฉด
{
_vBeat = _miBeat->second; //๋งต์ ์ ์ฅ๋ ๊ฐ์ ๋ฃ์ด์ค๋ค.
for (int i = 0; i < _vBeat.size(); i++)
{
if (keyName != "boss")
{
if ((_vBeat.back().beat - 30000) > _vBeat[i].beat)
_vBeat[i].img = IMAGEMANAGER->findImage("ui_beat_marker");
else
_vBeat[i].img = IMAGEMANAGER->findImage("ui_beat_marker_red");
}
else if (keyName == "boss")
{
_vBeat[i].img = IMAGEMANAGER->findImage("ui_beat_marker");
}
}
break;
}
}
}
}
void soundManager::setPitch(float pitch)
{
_system->getMasterChannelGroup(&_bgmGroup);
_system->getMasterChannelGroup(&_effectGroup);
_bgmGroup->setPitch(pitch);
_effectGroup->setPitch(pitch);
}
int soundManager::getLength(string keyName)
{
int count = 0;
int count_BGM, count_shop; //๋ฐฐ๊ฒฝ, ์์ ์ฃผ์ธ์ฉ ์นด์ดํธ
UINT start = 0;
string keyName_shop = keyName + "_shopkeeper"; //์์ ์ฃผ์ธ์ฉ ํค๊ฐ์ ์ํด ์ฐ์ธ๋ค.
arrSoundsIter iter_BGM = _mTotalSounds.begin(); //๋ฐฐ๊ฒฝ์์
์ฉ iter
arrSoundsIter iter_shop = _mTotalSounds.begin(); //์์ ์ฃผ์ธ์ฉ iter
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
count_BGM = count;
_sound[count_BGM]->getLength(&start, FMOD_TIMEUNIT_MS);
return start;
}
else if (keyName_shop == iter->first)
{
count_shop = count;
_sound[count_shop]->getLength(&start, FMOD_TIMEUNIT_MS);
return start;
}
}
}
int soundManager::getPosition(string keyName)
{
int count = 0;
int count_BGM, count_shop; //๋ฐฐ๊ฒฝ, ์์ ์ฃผ์ธ์ฉ ์นด์ดํธ
UINT now = 0;
string keyName_shop = keyName + "_shopkeeper"; //์์ ์ฃผ์ธ์ฉ ํค๊ฐ์ ์ํด ์ฐ์ธ๋ค.
arrSoundsIter iter_BGM = _mTotalSounds.begin(); //๋ฐฐ๊ฒฝ์์
์ฉ iter
arrSoundsIter iter_shop = _mTotalSounds.begin(); //์์ ์ฃผ์ธ์ฉ iter
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
count_BGM = count;
_channel[count_BGM]->getPosition(&now, FMOD_TIMEUNIT_MS);
return now;
}
else if (keyName_shop == iter->first)
{
count_shop = count;
_channel[count_shop]->getPosition(&now, FMOD_TIMEUNIT_MS);
return now;
}
}
}
int soundManager::getBossPosition(string keyName)
{
int count = 0;
int count_bass;
UINT now = 0;
string keyName_bass = keyName + "_bass";
arrSoundsIter iter_bass = _mTotalSounds.begin();
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName_bass == iter->first)
{
count_bass = count;
_channel[count_bass]->getPosition(&now, FMOD_TIMEUNIT_MS);
return now;
}
}
}
void soundManager::getSingShopkeeper(string keyName)
{
int size = 64;
_specLeft = new float[size];
_specRight = new float[size];
_spec = new float[size];
int count = 0;
int count_BGM, count_shop; //๋ฐฐ๊ฒฝ, ์์ ์ฃผ์ธ์ฉ ์นด์ดํธ
UINT now = 0;
string keyName_shop = keyName + "_shopkeeper"; //์์ ์ฃผ์ธ์ฉ ํค๊ฐ์ ์ํด ์ฐ์ธ๋ค.
arrSoundsIter iter_BGM = _mTotalSounds.begin(); //๋ฐฐ๊ฒฝ์์
์ฉ iter
arrSoundsIter iter_shop = _mTotalSounds.begin(); //์์ ์ฃผ์ธ์ฉ iter
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName_shop == iter->first)
{
count_shop = count;
_channel[count_shop]->getSpectrum(_specLeft, size, 0, FMOD_DSP_FFT_WINDOW_RECT);
_channel[count_shop]->getSpectrum(_specRight, size, 1, FMOD_DSP_FFT_WINDOW_RECT);
break;
}
}
for (int i = 0; i < size; i++)
{
_spec[i] = (_specLeft[i] + _specRight[i]) / 2;
}
auto maxIterator = std::max_element(&_spec[0], &_spec[size]);
float maxVolume = *maxIterator;
if (maxVolume != 0)
std::transform(&_spec[0], &_spec[size], &_spec[0], [maxVolume](float dB) -> float { return dB / maxVolume; });
}
HRESULT soundManager::init()
{
//FMOD ์ฌ์ด๋ ์์ง์ ์ฌ์ฉํ๊ฒ ๋ค๊ณ ์ ์ธ
System_Create(&_system);
_system->init(TOTALSOUNDBUFFER, FMOD_INIT_NORMAL, NULL);
_sound = new Sound*[TOTALSOUNDBUFFER];
_channel = new Channel*[TOTALSOUNDBUFFER];
memset(_sound, 0, sizeof(Sound*) * (TOTALSOUNDBUFFER));
memset(_channel, 0, sizeof(Channel*) * (TOTALSOUNDBUFFER));
// ์ฌ์ด๋ ๊ทธ๋ฃน ์์ฑ
_system->createSoundGroup("bgmSound", &_bgmSoundGroup);
_system->createSoundGroup("effectSound", &_effectSoundGroup);
// ์ฑ๋ ๊ทธ๋ฃน ์์ฑ
_system->createChannelGroup("bgm", &_bgmGroup);
_system->createChannelGroup("effect", &_effectGroup);
return S_OK;
}
void soundManager::release()
{
//์ฌ์ด๋ ์ญ์
if (_channel != NULL || _sound != NULL)
{
for (int i = 0; i < TOTALSOUNDBUFFER; i++)
{
if (_channel != NULL)
{
if (_channel[i]) _channel[i]->stop();
}
if (_sound != NULL)
{
if (_sound != NULL) _sound[i]->release();
}
}
}
//๋ฉ๋ชจ๋ฆฌ ์ง์ฐ๊ธฐ
SAFE_DELETE_ARRAY(_channel);
SAFE_DELETE_ARRAY(_sound);
SAFE_RELEASE(_effectGroup);
SAFE_RELEASE(_bgmGroup);
SAFE_RELEASE(_bgmSoundGroup);
SAFE_RELEASE(_effectSoundGroup);
delete[] _spec;
delete[] _specLeft;
delete[] _specRight;
_effectGroup = nullptr;
_bgmGroup = nullptr;
_bgmSoundGroup = nullptr;
_effectSoundGroup = nullptr;
//์์คํ
๋ซ๊ธฐ
if (_system != NULL)
{
_system->release();
_system->close();
}
}
void soundManager::update()
{
//์ฌ์ด๋ System ๊ณ์์ ์ผ๋ก ์
๋ฐ์ดํธ
_system->update();
//๋ณผ๋ฅจ์ด ๋ฐ๋๊ฑฐ๋
//์ฌ์์ด ๋๋ ์ฌ์ด๋๋ฅผ ์ฑ๋์์ ๋นผ๋ด๋๋ฑ์ ๋ค์ํ
//์์
์ ์๋์ผ๋ก ํด์ค๋ค
}
void soundManager::addSound(string keyName, string soundName, bool bgm, bool loop)
{
// ์ฌ์ด๋๋ TOTALSOUNDBUFFER๊ฐ ๊น์ง๋ง ์ถ๊ฐ ํ ์ ์๋ค.
if (TOTALSOUNDBUFFER <= _mTotalSounds.size())
return;
// ๋ฃจํ์ฌ์?
FMOD_MODE mode = NULL;
if (loop)
mode = FMOD_LOOP_NORMAL;
else
mode = FMOD_DEFAULT;
// ๋น์ด์๋ ์ฌ์ด๋์นธ์ ์๋ก์ด ์ฌ์ด๋๋ฅผ ํ ๋น
int useSoundIdx = static_cast<int>(_mTotalSounds.size());
if (bgm)
{
_system->createStream(soundName.c_str(), mode, NULL, &_sound[useSoundIdx]);
_sound[useSoundIdx]->setSoundGroup(_bgmSoundGroup);
}
else
{
_system->createSound(soundName.c_str(), mode, NULL, &_sound[useSoundIdx]);
_sound[useSoundIdx]->setSoundGroup(_effectSoundGroup);
}
_mTotalSounds.insert(make_pair(keyName, &_sound[useSoundIdx]));
}
void soundManager::play(string keyName, float volume)// 0.0 ~ 1.0f -> 0 ~ 255
{
arrSoundsIter iter = _mTotalSounds.begin();
int count = 0;
for (iter; iter != _mTotalSounds.end(); ++iter, ++count)
{
Sound* sound = *iter->second;
SoundGroup* soundGroup = nullptr;
if (keyName == iter->first)
{
// ์ด๋ ์ฌ์ด๋ ๊ทธ๋ฃน์ ์ํด์๋์ง ํ์ธ
sound->getSoundGroup(&soundGroup);
if (soundGroup == _bgmSoundGroup) // bgm soundgroup
{
_bgmSoundGroup->stop(); // ํ๋ ์ด์ค์ธ bgm ์ ์ง
_channel[count]->setChannelGroup(_bgmGroup);
}
else // effect soundgroup
_channel[count]->setChannelGroup(_effectGroup);
_system->playSound(FMOD_CHANNEL_REUSE, sound, false, &_channel[count]);
_channel[count]->setVolume(volume);
break;
}
}
}
void soundManager::stop(string keyName)
{
arrSoundsIter iter = _mTotalSounds.begin();
int count = 0;
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_channel[count]->stop();
break;
}
}
}
void soundManager::pause(string keyName)
{
arrSoundsIter iter = _mTotalSounds.begin();
int count = 0;
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_channel[count]->setPaused(true);
break;
}
}
}
void soundManager::resume(string keyName)
{
arrSoundsIter iter = _mTotalSounds.begin();
int count = 0;
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_channel[count]->setPaused(false);
break;
}
}
}
bool soundManager::isPlaySound(string keyName)
{
bool isPlay = false;
arrSoundsIter iter = _mTotalSounds.begin();
int count = 0;
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_channel[count]->isPlaying(&isPlay);
break;
}
}
return isPlay;
}
bool soundManager::isPauseSound(string keyName)
{
bool isPause = false;
arrSoundsIter iter = _mTotalSounds.begin();
int count = 0;
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
if (keyName == iter->first)
{
_channel[count]->getPaused(&isPause);
break;
}
}
return isPause;
}
void soundManager::setEffectVolume(float volume)
{
if (volume < 0.f)
volume = 0.f;
else if (1.0f < volume)
volume = 1.0f;
_effectGroup->setVolume(volume);
cout << "effect volume : " << volume << endl;
}
void soundManager::setBgmVolume(float volume)
{
if (volume < 0.f)
volume = 0.f;
else if (1.0f < volume)
volume = 1.0f;
_bgmSoundGroup->setVolume(volume);
cout << "bgm volume : " << volume << endl;
}
void soundManager::setAllSoundVolume(float volume)
{
_bgmGroup->setVolume(volume);
_effectGroup->setVolume(volume);
}
void soundManager::setEffectPause()
{
_effectGroup->setPaused(true);
}
void soundManager::setBgmPause()
{
_bgmGroup->setPaused(true);
}
void soundManager::setAllSoundPause()
{
_bgmGroup->setPaused(true);
_effectGroup->setPaused(true);
}
void soundManager::setEffectResume()
{
_effectGroup->setPaused(false);
}
void soundManager::setBgmResume()
{
_bgmGroup->setPaused(false);
}
void soundManager::setAllSoundResume()
{
_bgmGroup->setPaused(false);
_effectGroup->setPaused(false);
}
void soundManager::allSoundStop()
{
int count = 0;
arrSoundsIter iter = _mTotalSounds.begin();
for (iter; iter != _mTotalSounds.end(); ++iter, count++)
{
_channel[count]->stop();
}
} | [
"46731689+dongnamyoooooooooon@users.noreply.github.com"
] | 46731689+dongnamyoooooooooon@users.noreply.github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.