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
c8c49cc33f7bd88422d4be8dca15f4e5d862a55f
87d54cc7065aa8f4823e96a9c0333d4a45ec0a77
/arduino_speedometer_timepassed/arduino_speedometer_timepassed.ino
585cbf6f64134f3bf19b88fd0a46a2cd2b3b4445
[]
no_license
positionering/hjulodometri
68b6cc669afc33d26e6aed2d92bfbfcbcbcd5f2e
ffd0edafbf4daf38b0a7c2eb9599a69068c3692c
refs/heads/master
2020-05-07T18:52:25.094518
2019-05-14T14:08:02
2019-05-14T14:08:02
180,787,261
1
0
null
null
null
null
UTF-8
C++
false
false
1,926
ino
#include <Time.h> float current_v_right = 0; float current_v_left = 0; float old_v_right = 0; float old_v_left = 0; float c_right = 0; float c_left = 0; float to_left = millis(); // "old time" float to_right = millis(); float dist_pp = 0.55*3.1415926535/29; float a_left = 0; float a_right = 0; float tp_right = 0; float tp_left = 0; void setup() { // put your setup code here, to run once: Serial.begin (9600); pinMode(2, INPUT_PULLUP); // set pin to input pinMode(3, INPUT_PULLUP); // set pin to input attachInterrupt(digitalPinToInterrupt(2), updateright, RISING); attachInterrupt(digitalPinToInterrupt(3), updateleft, RISING); } void loop() { // put your main code here, to run repeatedly: String s = (String) current_v_left + " " + current_v_right + " " + c_left + " " + c_right; // Orig. Output for cam //String s = (String) "current_v_left:" + current_v_left + " current_v_right:" + current_v_right + " c_left:" + c_left + " c_right:" + c_right; Serial.println(s); if ((millis() - to_left) > tp_left*2){ current_v_left = 0; } if ((millis() - to_right) > tp_right*2){ current_v_right = 0; } if (current_v_left + a_left * (millis() - to_left) < 0) { current_v_left = 0; a_left = 0; } if (current_v_right + a_right * (millis() - to_right) < 0) { current_v_right = 0; a_right = 0; } } void updateleft(){ c_left++; float tc_left = millis(); tp_left = tc_left - to_left; current_v_left = dist_pp/tp_left*1000; a_left = (current_v_left - old_v_left) / (tc_left - to_left); old_v_left = current_v_left; to_left = tc_left; } void updateright(){ c_right++; float tc_right = millis(); tp_right = tc_right - to_right; current_v_right = dist_pp/tp_right*1000; a_right = (current_v_right - old_v_right) / (tc_right - to_right); old_v_right = current_v_right; to_right = tc_right; }
[ "skoghall@student.chalmers.se" ]
skoghall@student.chalmers.se
55e4d2976c25c63581b2d035008841edd4e41789
58063d4eea870398faec59c307fcfa2187744ec7
/MyForm.cpp
9beff2a9ed0bd0be23a6c0a7d4dc5a7589e0a2b8
[]
no_license
Desss64/Currency-Converter
3fb1d7c3e9f550cf36b4423df3d725305acc1a3d
01834c20d80596cf1911fe430387e6cf43147114
refs/heads/master
2022-11-26T00:20:17.921098
2020-07-30T19:34:27
2020-07-30T19:34:27
282,329,543
0
0
null
null
null
null
UTF-8
C++
false
false
275
cpp
#include "MyForm.h" using namespace System; using namespace System::Windows::Forms; void main(array<String^>^ args) { Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); CurrencyConverter::MyForm form; Application::Run(% form); }
[ "52009371+Desss64@users.noreply.github.com" ]
52009371+Desss64@users.noreply.github.com
caab3ac985c2fda335d34b30da0a2087e6f27058
a92b18defb50c5d1118a11bc364f17b148312028
/src/prod/test/FabricTest/SecureStoreTestClient.cpp
d2ccff5f902d7276fb3c6b90ed60582938ca8f7b
[ "MIT" ]
permissive
KDSBest/service-fabric
34694e150fde662286e25f048fb763c97606382e
fe61c45b15a30fb089ad891c68c893b3a976e404
refs/heads/master
2023-01-28T23:19:25.040275
2020-11-30T11:11:58
2020-11-30T11:11:58
301,365,601
1
0
MIT
2020-11-30T11:11:59
2020-10-05T10:05:53
null
UTF-8
C++
false
false
22,310
cpp
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #include "stdafx.h" using namespace Common; using namespace FabricTest; using namespace std; using namespace ServiceModel; using namespace Management; using namespace CentralSecretService; StringLiteral const TraceSource = "SecureStoreTestClient"; // // Construction/instantiation. // SecureStoreTestClient::SecureStoreTestClient(FabricTestDispatcher & dispatcher) : dispatcher_(dispatcher) { SetCommandHandlers(); expectedFailureIsSet_ = false; expectedValueIsSet_ = false; expectedValuesAreSet_ = false; } SecureStoreTestClient::~SecureStoreTestClient() { } bool SecureStoreTestClient::IsSecureStoreClientCommand(std::wstring const & command) { auto cmdCopy = std::wstring(command.c_str()); StringUtility::ToLower(cmdCopy); return commandHandlers_.end() != commandHandlers_.find(cmdCopy); } void SecureStoreTestClient::SetCommandHandlers() { commandHandlers_[FabricTestCommands::SecretCommands::PutSecret] = [this](StringCollection const & paramCollection) { return PutSecret(paramCollection); }; commandHandlers_[FabricTestCommands::SecretCommands::AddVersionedPlaintextSecretValue] = [this](StringCollection const & paramCollection) { return PutVersionedPlaintextSecret(paramCollection); }; commandHandlers_[FabricTestCommands::SecretCommands::GetSecret] = [this](StringCollection const & paramCollection) { return GetSecret(paramCollection); }; commandHandlers_[FabricTestCommands::SecretCommands::GetVersionedSecretValue] = [this](StringCollection const & paramCollection) { return GetVersionedSecretValue(paramCollection); }; commandHandlers_[FabricTestCommands::SecretCommands::ListVersions] = [this](StringCollection const & paramCollection) { return ListSecretVersions(paramCollection); }; commandHandlers_[FabricTestCommands::SecretCommands::List] = [this](StringCollection const & paramCollection) { return ListSecrets(paramCollection); }; commandHandlers_[FabricTestCommands::SecretCommands::Remove] = [this](StringCollection const & paramCollection) { return RemoveSecret(paramCollection); }; commandHandlers_[FabricTestCommands::SecretCommands::RemoveVersion] = [this](StringCollection const & paramCollection) { return RemoveSecretVersion(paramCollection); }; commandHandlers_[FabricTestCommands::SecretCommands::Clear] = [this](StringCollection const & paramCollection) { return ClearAllSecrets(paramCollection); }; } bool SecureStoreTestClient::ExecuteCommand( std::wstring const & command, Common::StringCollection const & params) { if (command.empty() || !IsSecureStoreClientCommand(command)) { TestSession::WriteInfo( TraceSource, "Unrecognized command: '{0}'", command); return false; } // ensure the inner client is instantiated InstantiateInnerSecureStoreClient(FABRICSESSION.FabricDispatcher.Federation); auto commandIter = commandHandlers_.find(command); return commandIter != commandHandlers_.end() && commandIter->second(params); } // // Mock APIs - translate test script commands into corresponding SecretStoreClient API calls. // bool SecureStoreTestClient::PutSecret(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; expectedParameterNames.push_back(SecretCommandParameters::Name); expectedParameterNames.push_back(SecretCommandParameters::Kind); std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for test command PutSecret: {0}", errorMsg); } // call secret store client here auto secretFromParameters = InstantiateSecretFromParameters(parsedParameters); std::vector<Management::CentralSecretService::Secret> secrets; secrets.push_back(*secretFromParameters.get()); Common::AsyncOperationSPtr opPtr; Management::CentralSecretService::SecretsDescription input(secrets); Management::CentralSecretService::SecretsDescription result; auto operation = secureStoreClient_->BeginSetSecrets( input, FabricTestSessionConfig::GetConfig().NamingOperationTimeout, [this, result](AsyncOperationSPtr const & operation) { this->OnSetSecretsComplete(operation, (Management::CentralSecretService::SecretsDescription&)result, false); }, opPtr); OnSetSecretsComplete(operation, result, true); return true; } bool SecureStoreTestClient::PutVersionedPlaintextSecret(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; expectedParameterNames.push_back(SecretCommandParameters::Name); expectedParameterNames.push_back(SecretCommandParameters::Version); expectedParameterNames.push_back(SecretCommandParameters::Value); std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for test command PutVersionedPlaintextSecret: {0}", errorMsg); } // call secret store client here auto secretFromParameters = InstantiateSecretFromParameters(parsedParameters); std::vector<Management::CentralSecretService::Secret> secrets; secrets.push_back(*secretFromParameters.get()); Common::AsyncOperationSPtr opPtr; Management::CentralSecretService::SecretsDescription input(secrets); Management::CentralSecretService::SecretsDescription result; auto context = secureStoreClient_.get()->BeginSetSecrets( input, FabricTestSessionConfig::GetConfig().NamingOperationTimeout, [this, result](AsyncOperationSPtr const & operation) { OnSetSecretsComplete(operation, (Management::CentralSecretService::SecretsDescription&)result, false); }, opPtr); OnSetSecretsComplete(context, result, true); return true; } bool SecureStoreTestClient::GetSecret(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; expectedParameterNames.push_back(SecretCommandParameters::Name); std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for test command GetSecret: {0}", errorMsg); } // call secret store client here Common::AsyncOperationSPtr asyncOpPtr; std::vector<SecretReference> references; references.push_back(*InstantiateSecretReferenceFromParameters(parsedParameters)); GetSecretsDescription input(references, false); Management::CentralSecretService::SecretsDescription result; auto context = secureStoreClient_->BeginGetSecrets( input, FabricTestSessionConfig::GetConfig().NamingOperationTimeout, [this, result](AsyncOperationSPtr const & operation) { OnGetSecretsComplete(operation, (Management::CentralSecretService::SecretsDescription&)result, false); }, asyncOpPtr); OnGetSecretsComplete(context, result, true); return true; } bool SecureStoreTestClient::GetVersionedSecretValue(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; expectedParameterNames.push_back(SecretCommandParameters::Name); expectedParameterNames.push_back(SecretCommandParameters::Version); std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for operation GetSecretVersion: {0}", errorMsg); } // call secret store client here Common::AsyncOperationSPtr asyncOpPtr; std::vector<SecretReference> references; references.push_back(*InstantiateSecretReferenceFromParameters(parsedParameters)); GetSecretsDescription input(references, true); Management::CentralSecretService::SecretsDescription result; auto context = secureStoreClient_->BeginGetSecrets( input, FabricTestSessionConfig::GetConfig().NamingOperationTimeout, [this, result](AsyncOperationSPtr const & operation) {OnGetSecretsComplete(operation, (Management::CentralSecretService::SecretsDescription&)result, false); }, asyncOpPtr); OnGetSecretsComplete(context, result, true); return true; } bool SecureStoreTestClient::ListSecretVersions(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; expectedParameterNames.push_back(SecretCommandParameters::Name); std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for operation ListSecretVersions: {0}", errorMsg); } // call secret store client here Common::AsyncOperationSPtr asyncOpPtr; std::vector<SecretReference> references; references.push_back(*InstantiateSecretReferenceFromParameters(parsedParameters)); SecretReferencesDescription input(references); Management::CentralSecretService::SecretReferencesDescription results; auto context = secureStoreClient_->BeginGetSecretVersions( input, FabricTestSessionConfig::GetConfig().NamingOperationTimeout, [this, results](AsyncOperationSPtr const & operation) { OnGetSecretVersionsComplete(operation, (Management::CentralSecretService::SecretReferencesDescription&)results, false); }, asyncOpPtr); OnGetSecretVersionsComplete(context, results, true); return true; } bool SecureStoreTestClient::ListSecrets(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for operation ListSecrets: {0}", errorMsg); } // call secret store client here Common::AsyncOperationSPtr asyncOpPtr; std::vector<SecretReference> references; GetSecretsDescription input(references, false); Management::CentralSecretService::SecretsDescription results; auto context = secureStoreClient_->BeginGetSecrets( input, FabricTestSessionConfig::GetConfig().NamingOperationTimeout, [this, results](AsyncOperationSPtr const & operation) { OnGetSecretsComplete(operation, (Management::CentralSecretService::SecretsDescription&)results, false); }, asyncOpPtr); OnGetSecretsComplete(context, results, true); return true; } bool SecureStoreTestClient::RemoveSecret(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; expectedParameterNames.push_back(SecretCommandParameters::Name); std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for operation RemoveSecret: {0}", errorMsg); } // call secret store client here Common::AsyncOperationSPtr asyncOpPtr; std::vector<SecretReference> references; references.push_back(*InstantiateSecretReferenceFromParameters(parsedParameters)); SecretReferencesDescription input(references); SecretReferencesDescription results; auto context = secureStoreClient_->BeginRemoveSecrets( input, FabricTestSessionConfig::GetConfig().NamingOperationTimeout, [this, results](AsyncOperationSPtr const & operation) { OnRemoveSecretsComplete(operation, (Management::CentralSecretService::SecretReferencesDescription&)results, false); }, asyncOpPtr); OnRemoveSecretsComplete(context, results, true); return true; } bool SecureStoreTestClient::RemoveSecretVersion(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; expectedParameterNames.push_back(SecretCommandParameters::Name); expectedParameterNames.push_back(SecretCommandParameters::Version); std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for operation RemoveSecretVersion: {0}", errorMsg); } // call secret store client here Common::AsyncOperationSPtr asyncOpPtr; std::vector<SecretReference> references; references.push_back(*InstantiateSecretReferenceFromParameters(parsedParameters)); SecretReferencesDescription input(references); SecretReferencesDescription results; auto context = secureStoreClient_->BeginRemoveSecrets( input, FabricTestSessionConfig::GetConfig().NamingOperationTimeout, [this, results](AsyncOperationSPtr const & operation) { OnRemoveSecretsComplete(operation, (Management::CentralSecretService::SecretReferencesDescription&)results, false); }, asyncOpPtr); OnRemoveSecretsComplete(context, results, true); return true; } bool SecureStoreTestClient::ClearAllSecrets(Common::StringCollection const & parameters) { std::vector<std::wstring> expectedParameterNames; std::map<std::wstring, std::wstring> parsedParameters; std::wstring errorMsg = L""; if (!TryParseParameters(parameters, expectedParameterNames, parsedParameters, errorMsg)) { TestSession::WriteInfo( TraceSource, "Incorrect parameters provided for operation ClearAllSecrets: {0}", errorMsg); } // call secret store client here return false; } void SecureStoreTestClient::OnGetSecretsComplete(AsyncOperationSPtr operation, Management::CentralSecretService::SecretsDescription & result, bool expectedSynchronousCompletion) { if (operation->CompletedSynchronously != expectedSynchronousCompletion) { return; } auto error = secureStoreClient_->EndGetSecrets(operation, result); if (!error.IsSuccess()) { TestSession::WriteInfo( TraceSource, "End(OnGetSecretsCompleted): ErrorCode={0}", error); } operation->TryComplete(operation->Parent, error); } void SecureStoreTestClient::OnRemoveSecretsComplete(AsyncOperationSPtr operation, Management::CentralSecretService::SecretReferencesDescription & results, bool expectedSynchronousCompletion) { if (operation->CompletedSynchronously != expectedSynchronousCompletion) { return; } auto error = secureStoreClient_->EndRemoveSecrets(operation, results); if (!error.IsSuccess()) { TestSession::WriteInfo( TraceSource, "End(OnRemoveSecretsCompleted): ErrorCode={0}", error); } operation->TryComplete(operation->Parent, error); } void SecureStoreTestClient::OnGetSecretVersionsComplete(AsyncOperationSPtr operation, Management::CentralSecretService::SecretReferencesDescription & results, bool expectedSynchronousCompletion) { if (operation->CompletedSynchronously != expectedSynchronousCompletion) { return; } auto error = secureStoreClient_->EndGetSecretVersions(operation, results); if (!error.IsSuccess()) { TestSession::WriteInfo( TraceSource, "End(OnGetSecretVersionsCompleted): ErrorCode={0}: {1}", error, error.Message); } operation->TryComplete(operation->Parent, error); } void SecureStoreTestClient::OnSetSecretsComplete(AsyncOperationSPtr operation, Management::CentralSecretService::SecretsDescription & result, bool expectedSynchronousCompletion) { if (operation->CompletedSynchronously != expectedSynchronousCompletion) { return; } auto error = secureStoreClient_->EndSetSecrets(operation, result); if (!error.IsSuccess()) { TestSession::WriteInfo( TraceSource, "End(OnSetSecretsCompleted): ErrorCode={0}: {1}", error, error.Message); } operation->TryComplete(operation->Parent, error); } // // Parameter handling. // bool SecureStoreTestClient::TryParseParameters( Common::StringCollection const & parameters, std::vector<std::wstring> expectedParameters, std::map<std::wstring, std::wstring> & parsedParameters, std::wstring & firstError) { if (expectedParameters.size() > parameters.size()) { firstError = wformatString(L"the command expects {0} parameters, but only {1} parameters were provided.", expectedParameters.size(), parameters.size()); return false; } auto validatedAllParams = true; CommandLineParser parser(parameters); std::wstring paramValue = L""; // parse required parameters for (auto const & paramKey : expectedParameters) { validatedAllParams &= parser.TryGetString(paramKey, paramValue); if (!validatedAllParams) { firstError = wformatString(L"expected parameter '{0}' was not specified.", paramKey); break; } parsedParameters[paramKey] = paramValue; } if (validatedAllParams) { // proceed with parsing of optional/behavioral parameters ('expected*') expectedFailureIsSet_ = parser.TryGetBool(SecureStoreTestClient::SecretCommandParameters::ExpectedFailure, expectedFailure_); expectedValuesAreSet_ = parser.GetVector(SecureStoreTestClient::SecretCommandParameters::ExpectedValues, expectedValues_); expectedValueIsSet_ = parser.TryGetString(SecureStoreTestClient::SecretCommandParameters::ExpectedValue, expectedValue_); } else { parsedParameters.clear(); } return validatedAllParams; } void SecureStoreTestClient::InstantiateInnerSecureStoreClient(__in FabricTestFederation & testFederation) { if (secureStoreClient_.get() == NULL) { auto factoryPtr = TestFabricClient::FabricCreateNativeClientFactory(testFederation); auto error = factoryPtr->CreateSecretStoreClient(secureStoreClient_); TestSession::FailTestIfNot(error.IsSuccess(), "InternalClientFactory does not support ISecretStoreClient"); } } std::shared_ptr<Secret> SecureStoreTestClient::InstantiateSecretFromParameters(std::map<std::wstring, std::wstring> parameterMap) { std::wstring secretName; auto it = parameterMap.find(SecretCommandParameters::Name); if (it != parameterMap.end()) { secretName = it->second; } std::wstring secretVersionId; it = parameterMap.find(SecretCommandParameters::Version); if (it != parameterMap.end()) { secretVersionId = it->second; } it = parameterMap.find(SecretCommandParameters::Value); std::wstring secretValue; if (it != parameterMap.end()) { secretValue = it->second; } std::wstring kind = L""; it = parameterMap.find(SecretCommandParameters::Kind); if (it != parameterMap.end()) kind = it->second; std::wstring contentType = L""; it = parameterMap.find(SecretCommandParameters::ContentType); if (it != parameterMap.end()) contentType = it->second; std::wstring description = L""; it = parameterMap.find(SecretCommandParameters::Description); if (it != parameterMap.end()) description = it->second; return std::make_shared<Secret>(secretName, secretVersionId, secretValue, kind, contentType, description); } std::shared_ptr<SecretReference> SecureStoreTestClient::InstantiateSecretReferenceFromParameters(std::map<std::wstring, std::wstring> parameterMap) { std::wstring secretName; auto it = parameterMap.find(SecretCommandParameters::Name); if (it != parameterMap.end()) { secretName = it->second; } std::wstring secretVersionId; it = parameterMap.find(SecretCommandParameters::Version); if (it != parameterMap.end()) { secretVersionId = it->second; } return std::make_shared<SecretReference>(secretName, secretVersionId); } // parameter name constants std::wstring const SecureStoreTestClient::SecretCommandParameters::Name = L"name"; std::wstring const SecureStoreTestClient::SecretCommandParameters::Version = L"version"; std::wstring const SecureStoreTestClient::SecretCommandParameters::Value = L"value"; std::wstring const SecureStoreTestClient::SecretCommandParameters::ExpectedValue = L"expectedvalue"; std::wstring const SecureStoreTestClient::SecretCommandParameters::ExpectedValues = L"expectedvalues"; std::wstring const SecureStoreTestClient::SecretCommandParameters::ExpectedFailure = L"expectedfailure"; std::wstring const SecureStoreTestClient::SecretCommandParameters::Kind = L"kind"; std::wstring const SecureStoreTestClient::SecretCommandParameters::ContentType = L"contentType"; std::wstring const SecureStoreTestClient::SecretCommandParameters::Description = L"description";
[ "31968192+bpm-ms@users.noreply.github.com" ]
31968192+bpm-ms@users.noreply.github.com
09f2e6895353c80c8efc4105392fb147746ff48d
d0c44dd3da2ef8c0ff835982a437946cbf4d2940
/cmake-build-debug/programs_tiling/function14739/function14739_schedule_13/function14739_schedule_13_wrapper.cpp
1c61e8bfdc09509d559347352611d5793e7b80da
[]
no_license
IsraMekki/tiramisu_code_generator
8b3f1d63cff62ba9f5242c019058d5a3119184a3
5a259d8e244af452e5301126683fa4320c2047a3
refs/heads/master
2020-04-29T17:27:57.987172
2019-04-23T16:50:32
2019-04-23T16:50:32
176,297,755
1
2
null
null
null
null
UTF-8
C++
false
false
923
cpp
#include "Halide.h" #include "function14739_schedule_13_wrapper.h" #include "tiramisu/utils.h" #include <cstdlib> #include <iostream> #include <time.h> #include <fstream> #include <chrono> #define MAX_RAND 200 int main(int, char **){ Halide::Buffer<int32_t> buf00(64); Halide::Buffer<int32_t> buf0(64, 64, 64, 64); init_buffer(buf0, (int32_t)0); auto t1 = std::chrono::high_resolution_clock::now(); function14739_schedule_13(buf00.raw_buffer(), buf0.raw_buffer()); auto t2 = std::chrono::high_resolution_clock::now(); std::chrono::duration<double> diff = t2 - t1; std::ofstream exec_times_file; exec_times_file.open("../data/programs/function14739/function14739_schedule_13/exec_times.txt", std::ios_base::app); if (exec_times_file.is_open()){ exec_times_file << diff.count() * 1000000 << "us" <<std::endl; exec_times_file.close(); } return 0; }
[ "ei_mekki@esi.dz" ]
ei_mekki@esi.dz
daad0294edbe57d73bc5d54193421bdfff2ebb97
3ecf469914839c476354b044874d1a335d769a63
/src/CUSketch.h
bd6555353282a35eb093390d4e56ee4a1e03c9a0
[]
no_license
PKURio/unbalanced-sketch
f1dd74c99986537c77bae861f0f64c45fc9ab332
73af34e39b6c4611a2016befde888317c6493580
refs/heads/master
2021-04-18T22:25:52.602997
2018-05-17T00:37:03
2018-05-17T00:37:03
126,920,480
1
0
null
null
null
null
UTF-8
C++
false
false
2,187
h
#ifndef _CUSKETCH_H #define _CUSKETCH_H #include "params.h" #include "BOBHash32.h" #include "SPA.h" #include <cstring> #include <algorithm> using namespace std; template <int memory_in_bytes, int d> // d is num of hash func class CUSketch: public SPA { private: static constexpr int w = memory_in_bytes * 8 / 32; int counters[w]; BOBHash32 * hash[d]; public: CUSketch() { memset(counters, 0, sizeof(counters)); for (int i = 0; i < d; i++) hash[i] = new BOBHash32(i + 750); } void print_basic_info() { printf("CU sketch\n"); printf("\tCounters: %d\n", w); printf("\tMemory: %.6lfKB\n", w * 4.0 / 1024); } virtual ~CUSketch() { for (int i = 0; i < d; i++) delete hash[i]; } // f is num of package void insert(uint32_t key, int f = 1) { int index[d]; int value[d]; int min_val = 1 << 30; for (int i = 0; i < d; i++) { index[i] = (hash[i]->run((const char *)&key, 4)) % w; value[i] = counters[index[i]]; //min_val = min(min_val, value[i]); // find the min min_val = min_val < value[i] ? min_val : value[i]; // find the min } int temp = min_val + f; for (int i = 0; i < d; i++) { //counters[index[i]] = max(counters[index[i]], temp); counters[index[i]] = (counters[index[i]] > temp) ? counters[index[i]] : temp; } } int query(uint32_t key) { int ret = 1 << 30; for (int i = 0; i < d; i++) { int tmp = counters[(hash[i]->run((const char *)&key, 4)) % w]; //ret = min(ret, tmp); ret = ret < tmp ? ret : tmp; } return ret; } int batch_query(uint32_t * data, int n) { int ret = 0; for (int i = 0; i < n; ++i) { ret += query(data[i]); } return ret; } void build(uint32_t * data, int n) { for (int i = 0; i < n; ++i) { insert(data[i], 1); } } }; #endif //_CUSKETCH_H
[ "noreply@github.com" ]
noreply@github.com
737af6c5f9dd781fe43cadea63fe48fe40214c5e
44b2b37cad77f4162d8362c99a24d94b2cb2aa0a
/boost/singlepramter.cpp
c15eb9e0e70d696a22a5fbbd0dbe1dfaa0139cf9
[]
no_license
bzmctl/shujujiegou
19416d7afc1ae4e5e81f9e3e1b7901b5661d821d
ae708260b377a4467c1aeebce4f729e84dcc1067
refs/heads/master
2020-03-17T04:41:05.821319
2018-08-10T05:02:53
2018-08-10T05:02:53
127,827,154
0
0
null
null
null
null
UTF-8
C++
false
false
1,027
cpp
/*单参数测试用例*/ /*有时候需要对一个测试用例使用不同的参数运行测试,前面提到的BOOST_AUTO_TEST_CASE不能满足需求,此时需要对测试用例进行手动注册(来自Boost文档):*/ #include <boost/test/included/unit_test.hpp> #include <boost/test/parameterized_test.hpp> using namespace boost::unit_test; void free_test_function(int i) { BOOST_CHECK(i < 4/*test assertion*/); } test_suite* init_unit_test_suite(int argc,char* argv[]) { int params[] = {1,2,3,4,5}; framework::master_test_suite().add(BOOST_PARAM_TEST_CASE(&free_test_function,params,params+5)); return 0; } /*示例代码将会分别以参数1、2、3、4、5运行测试free_test_function五次。 手动注册需要定义测试函数,此处为free_test_function,然后定义init_unit_test_suite函数,并在该函数中将测试用例加入到主测试套件中。 BOOST_PARAM_TEST_CASE有三个参数:第一个参数为测试函数指针,第二个与第三个为输入参数迭代器。*/
[ "wt@example.com" ]
wt@example.com
661b424f4f58c0114cbf0f4933b8c90cb59fdfbf
4c1abce6baabb84c9cd2ce320a42380aed9f9fd7
/leetcode_448/leetcode_448/leetcode_448.cpp
2dc7ecc392ea41b7889645b7aaa268b70c049c70
[]
no_license
louise365/To-be-SDE
1a1d9ad2fa3acf5acff5f10045c59090440beb95
cbdb12c5c69f720b5ddebf2636af9617a2452014
refs/heads/master
2020-12-28T02:23:41.191921
2020-04-14T07:18:36
2020-04-14T07:18:36
238,149,414
0
0
null
null
null
null
UTF-8
C++
false
false
663
cpp
// leetcode_448.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <vector> using namespace std; int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize) { int *ret = (int*)malloc(sizeof(int)*numsSize); memset(ret, 0, sizeof(int)*numsSize); for (int i = 0; i < numsSize; i++) ret[nums[i]-1]++; int index = 0; for (int i = 0; i < numsSize; i++) if (ret[i] == 0) ret[index++] = i + 1; ret = (int*)realloc(ret, index * sizeof(int)); *returnSize = index; return ret; } int main() { int input[8] = { 4,3,2,7,8,2,3,1 }; int size; int* out = findDisappearedNumbers(input,8,&size); return 0; }
[ "louise_290@foxmail.com" ]
louise_290@foxmail.com
e7f10f953339966562c4f88a11cb48cdddae76c3
b047d363833960c968de376b368348054b33c30c
/Lab assignment 4/Implementation of stack using two queues.cpp
511ce2e1de06712d5932e4138d12cb855ecbbe13
[]
no_license
saideepakreddy0308/Data-Structures-Part-1
786e6a92b75296b5ec0c2e90fe2153a42a162dd9
6c53077a8c4990b5a15bfd476371840405d53ab5
refs/heads/main
2023-07-29T14:09:26.862844
2021-09-16T10:50:36
2021-09-16T10:50:36
407,124,400
0
0
null
null
null
null
UTF-8
C++
false
false
2,220
cpp
#include<stdio.h> #include<stdlib.h> int *stack,*queue,*queue1; int n,top=0,front=1,rear=0,front1=1,rear1=0; void enqueue(int x); int dequeue(void); void enqueue1(int x); void func(void); void push(int x); int pop(void); void display_stack(void); void enqueue(int x) { rear=rear+1; queue[rear]=x; } int dequeue(void) { return queue[front++]; } void enqueuex(int x) { rear1=rear1+1; queue1[rear1]=x; } int dequeuex(void) { return queue1[front1++]; } void func(void) { while(front!=rear) { int data; data=dequeue(); enqueuex(data); } push(queue[front]); } void func1(void) { while(front1!=rear1) { int data; data=dequeuex(); enqueue(data); } push(queue1[front1]); } void push(int x) { top=top+1; stack[top]=x; printf("\nElement insertion in stack is successfull....\n"); return; } int pop(void) { return stack[top--]; } void display_stack(void) { int i; for(i=top;i>0;i--) { printf("Data : %d\n",stack[i]); } } int main() { printf("Enter the size of the array : \n"); scanf("%d",&n); queue=(int *)malloc(sizeof(int)*n); queue1=(int *)malloc(sizeof(int)*n); stack=(int *)malloc(sizeof(int)*n); int i; for(i=1;i<=n;i++) { int data; printf("Enter Data : "); scanf("%d",&data); enqueue(data); } printf("Data of First Queue : \n"); for(i=front;i<=rear;i++) { printf("Data %d : %d\n",i,queue[i]); } for(i=1;i<=n/2;i++) { func(); front=1; rear=1; func1(); front1=1; rear1=1; } if(n%2!=0) { push(queue[front]); } printf("\nElements of First Stack from top to bottom : \n"); display_stack(); int choice; while(1) { printf("1->pop\n"); printf("2->exit\n"); printf("Enter Your Choice : \n"); scanf("%d",&choice); switch(choice) { case 1 : if(top>0) { int popped_element; popped_element=pop(); printf("%d is popped out from the stack....\n",popped_element); printf("%d is the value of the top....\n",top); } else { printf("Stack is empty ....\n"); } break; case 2 : return 0; default : printf("Invalid Input....\n"); } } }
[ "noreply@github.com" ]
noreply@github.com
e4dec41ed893f11bbc8e2bf91586a93675334c51
a14e6c291683721ad01f1985c45f059735d7f187
/Hmwk/Assignment 4/Gaddis_8thEd_Chap13_Prog_Prob10_NumberArrayClass/Array.h
319421d6366c5cb09a732af08400f11c2fcff59a
[]
no_license
jventura10/Ventura_Javier_CSC17A_Fall2017
cdf342ef91c628a7eb8603d6dc309a63034d9648
8398ca7e56d7ce56363f9bb010eff589413cd569
refs/heads/master
2021-10-19T04:17:55.863981
2019-02-18T00:10:56
2019-02-18T00:10:56
103,473,934
0
0
null
null
null
null
UTF-8
C++
false
false
443
h
/* * File: main.cpp * Author: * Purpose: Number Array Class * Created on October 18, 2017, 6:37 PM */ #ifndef ARRAY_H #define ARRAY_H class NumArr{ private: float* numA; int numE; public: NumArr(int); ~NumArr(); void storeN(); float getNum(int)const; float highV(int)const; float lowV(int)const; float avgV(int)const; }; #endif /* ARRAY_H */
[ "jventura1097@gmail.com" ]
jventura1097@gmail.com
308e2c50b81a3196975d236f77d01eb5c544732b
746b383e363d2a84094e5a9acee5a5d10b71d2c2
/src/patch/jan16/src/AnaTda/AnaTdav2.cxx
2a7a43aa627422f45f14603020570c6753f03228
[]
no_license
atomssa/panda-work
485bd08f875be751afac0420e30f455dba70ae3f
1c155d9367dabd03ec1da6f2bce9dafc4fa24280
refs/heads/master
2021-01-21T04:36:22.426511
2016-04-18T11:29:28
2016-04-18T11:34:36
25,123,698
1
0
null
null
null
null
UTF-8
C++
false
false
88,039
cxx
#include "AnaTdav2.h" #include "FairTask.h" #include "RhoCandList.h" #include "PndKinFitter.h" #include "PndPidProbability.h" #include "FairRootManager.h" #include "TH1F.h" #include "TH2F.h" #include "TF1.h" #include "TEfficiency.h" #include "TFile.h" #include "TRandom.h" #include "TVector3.h" #include "TVectorD.h" #include "TLorentzVector.h" #include "TClonesArray.h" using namespace std; AnaTdav2::AnaTdav2(const int& _iplab, const int& itype, const int& brem, const int& eid_meth): verb(false), nevt(0), brem_corr(brem!=0), mc_type(itype), eid_param_method(eid_meth!=0), iplab((_iplab>=0&&_iplab<3)?_iplab:0), plab{5.513,8.,12.}, mom_antip(plab[iplab]), boost_to_cm(), boost_to_lab(), p4pbar(), p4targ(), p4sys(), event_t(-9999.), event_u(-9999.), //tmin{-0.443789, -0.5, -0.5}, //tmax{0.616486, 0.457248, 0.31538}, //tmin{-0.443789, -2.76, -6.50}, //tmax{0.616486, 0.457248, 0.31538}, //tmin{-0.092, -1.3, -2.85}, tmin{-0.092, -1.0, -1.0}, tmid{-0.45, -2.76, -6.5}, tmax{0.59, 0.43, 0.3}, //nevt_sim{81874.0, 224120.0, 189015.0}, // 1st index: 0->pi0pipm, 1->pi0jpsi, 2->pi02pipm, 3->pi0pipm2, 4->pi02jpsi nevt_sim{ {814794.0,888292.0,898721.0}, {32780.0,50142.0,51860.0}, {214780.0,174864.0,160099.0}, {570751.0,609044.0,527506.0}, {200000.0,200000.0,200000.0}, {100000.0,100000.0,100000.0}, {100000.0,100000.0,100000.0}}, //nevt_xsect{4.0e11, 1e11, 1e9}, // xsect={0.2mb, 0.05mb, 0.02mb} nevt_xsect{ {4.0e11, 1e11, 2e10}, {32780.0,50142.0,51860.0}, {1.15e12, 3.15e11, 6.84e10}, {3.19e12, 1.14e12, 2.92e11}, {94243.0, 157947.3, 177361.2}, {100000.0,100000.0,100000.0}, {100000.0,100000.0,100000.0}}, eff_file_name("eff/effic_smooth.root"), eff_hist_name("eff_ep_em_rad"), eff_hist_rad(true), pi_eff_file_name("eff/hadd_out/eff.pi.root"), pi_eff_hist_name("prob_cut_5/eff2d_e_id"), pi_eff_hist_rad(false), eid_prob_min(0.5), mcList(), apply_pi0evsoa_cut(true), lw{{0.11,-0.05,+0.00},{0.12,-0.03,-0.03},{0.15,-0.06,-0.07}}, up{{0.14,0.21,0.07},{0.12,0.15,0.15},{0.11,0.10,0.20}}, apply_pi0m_cut(true), pi0m_cut_min(0.11), pi0m_cut_max(0.16), apply_mtot_cut(true), mtot_cut_min(3.0), mtot_cut_max(3.7), apply_dth_dph_cut(true), dth_sigma(0.4), dph_sigma(0.4), dth_dph_cm_cut_max(3.0), require_exclusivity(false), jpsi_m_3sig_min(2.8), jpsi_m_3sig_max(3.3), chi2_cut{20.0,50.0,100.0} { assert(iplab>=0&&iplab<=2); rcl.resize(nrcl); gRandom->SetSeed(); // bootstrap the pi0pi0jpsi (idx4) x-sect from pi0jpsi (idx1) xsect using the pi0pi0pipipm(idx2)/pi0pippim(idx0) ratio //nevt_xsect[4][0] = 60000.; //nevt_xsect[4][1] = 60000.*(nevt_xsect[1][1]/nevt_xsect[1][0]); //nevt_xsect[4][2] = 60000.*(nevt_xsect[1][2]/nevt_xsect[1][0]); for (int ii=0; ii < 3; ++ii) { nevt_xsect[4][ii] = nevt_xsect[1][ii]*(nevt_xsect[2][ii]/nevt_xsect[0][ii]); //nevt_xsect[4][ii] = nevt_xsect[1][ii]*(nevt_xsect[2][ii]/nevt_xsect[0][ii]); cout << " pi0pipm nevt_xsect of iplab("<< iplab<< ") = " << nevt_xsect[0][ii] << endl; cout << " pi0jpsi nevt_xsect of iplab("<< iplab<< ") = " << nevt_xsect[1][ii] << endl; cout << " pi02pipm nevt_xsect of iplab("<< iplab<< ") = " << nevt_xsect[2][ii] << endl; cout << " pi0pipm2 nevt_xsect of iplab("<< iplab<< ") = " << nevt_xsect[3][ii] << endl; cout << " pi0pi0jpsi nevt_xsect of iplab("<< iplab<< ") = " << nevt_xsect[4][ii] << endl; } } AnaTdav2::~AnaTdav2() { } TClonesArray* AnaTdav2::init_tca(TString name) { TClonesArray *tca = dynamic_cast<TClonesArray *> (m_ioman->GetObject(name)); if ( ! tca ) { cout << "-W- EffHists::Init: " << "No " << name << " array!" << endl; return NULL; } else { cout << "-I- EffHists::Init: " << " finished reading " << name << " array!" << endl; return tca; } } void AnaTdav2::init_tcas() { m_ioman = FairRootManager::Instance(); if ( ! m_ioman ){ cout << "-E- EffHists::Init: " << "RootManager not instantiated!" << endl; return; } m_cand_array = init_tca( "PidChargedCand"); m_drc_array = init_tca( "PidAlgoDrc"); m_disc_array = init_tca( "PidAlgoDisc"); m_stt_array = init_tca( "PidAlgoStt"); m_mvd_array = init_tca( "PidAlgoMvd"); m_emcb_array = init_tca( "PidAlgoEmcBayes"); } double _pi_eff_func(double *x, double *p) { double xx=x[0]; double f1 = p[0]+ p[2]*TMath::Sin(xx*p[1]*1.0)+ p[3]*TMath::Sin(xx*p[1]*2.0)+ p[4]*TMath::Cos(xx*p[1]*1.0) + p[5]*TMath::Cos(xx*p[1]*2.0); double t1 = f1/(p[6]+(p[7]*TMath::Power(xx,p[8]))); double p2 = p[9]+ p[10]*x[0]+ p[11]*x[0]*x[0]; double t2 = p[12]*p2; return p[13]+t1+t2; } void AnaTdav2::init_hists() { eff_file = TFile::Open(eff_file_name.c_str()); heff_epm = (TH2F*) eff_file->Get(eff_hist_name.c_str())->Clone("heff_epm"); pi_eff_file = TFile::Open(pi_eff_file_name.c_str()); TEfficiency *tmp = (TEfficiency*) pi_eff_file->Get(pi_eff_hist_name.c_str()); if (tmp->GetDimension()==2) { //pi_eff = smooth_eff2d((TEfficiency*)pi_eff_file->Get(pi_eff_hist_name.c_str())->Clone("pi_eff"),1000); //pi_eff = smooth_eff2d(rebin2d((TEfficiency*)pi_eff_file->Get(pi_eff_hist_name.c_str())->Clone("pi_eff"), 5),1000); pi_eff = (TEfficiency*) pi_eff_file->Get(pi_eff_hist_name.c_str())->Clone("pi_eff2d"); } else { //pi_eff = (TEfficiency*) pi_eff_file->Get(pi_eff_hist_name.c_str())->Clone("pi_eff"); pi_eff = smooth_eff1d((TEfficiency*) pi_eff_file->Get(pi_eff_hist_name.c_str())->Clone("pi_eff1d")); double pars[14] = { 6.35356e+00, 1.0, 4.13113e+00, -4.43669e+00, 0.1, 0.01, 0.1, 9.64513e+03, 1.22279e+00, 4.66147e-04, 2.96494e-05, -6.21090e-06, 1.0, -3.23049e-06 }; pi_eff_func = new TF1("pi_eff_func",_pi_eff_func,0.0001,10,14); for (int ii=0; ii < 14; ++ii) { if (ii==9||ii==10||ii==11) pi_eff_func->FixParameter(ii,pars[ii]); else pi_eff_func->SetParameter(ii,pars[ii]); } pi_eff->Fit(pi_eff_func,"+RME"); } hwt = new TH1F("hwt", "event by event weight distribution", 2000,0,100); // These do not depend on steps hng = new TH1F(Form("hng"),Form("hng"),11,-0.5,10.5); hng20mev_nocut = new TH1F(Form("hng20mev_nocut"),Form("hng20mev_nocut"),11,-0.5,10.5); hng20mev_excl = new TH1F(Form("hng20mev_excl"),Form("hng20mev_excl"),11,-0.5,10.5); hng20mev_chi2sig = new TH1F(Form("hng20mev_chi2sig"),Form("hng20mev_chi2sig"),11,-0.5,10.5); hng20mev_chi2bg = new TH1F(Form("hng20mev_chi2bg"),Form("hng20mev_chi2bg"),11,-0.5,10.5); hng20mev_kinall = new TH1F(Form("hng20mev_kinall"),Form("hng20mev_kinall"),11,-0.5,10.5); hnch = new TH1F(Form("hnch"),Form("hnch"),11,-0.5,10.5); hmiss_e_pvth_acc = new TH2F("hmiss_e_pvth_acc","hmiss_e_pvth_acc",200,0,180,200,0,8); hmiss_p_pvth_acc = new TH2F("hmiss_p_pvth_acc","hmiss_p_pvth_acc",200,0,180,200,0,8); hmiss_e_pvth_eid = new TH2F("hmiss_e_pvth_eid","hmiss_e_pvth_eid",200,0,180,200,0,8); hmiss_p_pvth_eid = new TH2F("hmiss_p_pvth_eid","hmiss_p_pvth_eid",200,0,180,200,0,8); for (int is = 0; is< nstep; ++is) { hmep[is] = new TH1F(Form("hmep_%d",is),Form("hmep_%d",is),400,0,5); hmep_valid[is] = new TH1F(Form("hmep_valid_%d",is),Form("hmep_valid_%d",is),400,0,5); hmgg[is] = new TH1F(Form("hmgg_%d",is),Form("hmgg_%d",is),400,0,0.2); hmgg_valid[is] = new TH1F(Form("hmgg_valid_%d",is),Form("hmgg_valid_%d",is),400,0,0.2); hnep[is] = new TH1F(Form("hnep_%d",is),Form("hnep_%d",is),6,-0.5,5.5); hngg[is] = new TH1F(Form("hngg_%d",is),Form("hngg_%d",is),26,-0.5,25.5); hnpi0jpsi[is] = new TH1F(Form("hnpi0jpsi_%d",is),Form("hnpi0jpsi_%d",is),6,-0.5,5.5); hmep_mct[is] = new TH1F(Form("hmep_mct_%d",is),Form("hmep_mct_%d",is),400,0,5); hmep_non_mct[is] = new TH1F(Form("hmep_non_mct_%d",is),Form("hmep_non_mct_%d",is),400,0,5); hthe_ep_mct[is] = new TH1F(Form("hthe_ep_mct_%d",is),Form("hthe_ep_mct_%d",is),400,0,TMath::Pi()); hthe_ep_mct_fwd[is] = new TH1F(Form("hthe_ep_mct_fwd_%d",is),Form("hthe_ep_mct_fwd_%d",is),400,0,TMath::Pi()); hthe_ep_mct_bwd[is] = new TH1F(Form("hthe_ep_mct_bwd_%d",is),Form("hthe_ep_mct_bwd_%d",is),400,0,TMath::Pi()); hmgg_mct[is] = new TH1F(Form("hmgg_mct_%d",is),Form("hmgg_mct_%d",is),400,0.0,0.2); hmgg_non_mct[is] = new TH1F(Form("hmgg_non_mct_%d",is),Form("hmgg_non_mct_%d",is),400,0.0,0.2); hthe_gg_mct[is] = new TH1F(Form("hthe_gg_mct_%d",is),Form("hthe_gg_mct_%d",is),400,0,TMath::Pi()); hthe_gg_mct_fwd[is] = new TH1F(Form("hthe_gg_mct_fwd_%d",is),Form("hthe_gg_mct_fwd_%d",is),400,0,TMath::Pi()); hthe_gg_mct_bwd[is] = new TH1F(Form("hthe_gg_mct_bwd_%d",is),Form("hthe_gg_mct_bwd_%d",is),400,0,TMath::Pi()); hoa_gg_mct[is] = new TH1F(Form("hoa_gg_mct_%d",is),Form("hoa_gg_mct_%d",is),400,0,2*TMath::Pi()); } hpi0th = new TH1F("hpi0th", "hpi0th", 1000, 0, TMath::Pi()); hpi0cost_cm = new TH1F("hpi0cost_cm", "hpi0cost_cm", 1100, -1.1, 1.1); hpi0th_mcut = new TH1F("hpi0th_mcut", "hpi0th_mcut", 1000, 0, TMath::Pi()); hpi0cost_cm_mcut = new TH1F("hpi0cost_cm_mcut", "hpi0cost_cm_mcut", 1100, -1.1, 1.1); for (int ib=0; ib<tu_binning.size()-1; ++ib) { hmep_pi0cost_cm.push_back( new TH1F(Form("hmep_pi0cost_cm_%d", ib), Form("hmep_pi0cost_cm_%d", ib), 200, 0, 5)); hmep_pi0th.push_back( new TH1F(Form("hmep_pi0th_%d", ib), Form("hmep_pi0th_%d", ib), 200, 0, 5)); hmept.push_back(new TH1F(Form("hmept%d", ib), Form("%4.2f < t < %4.2f;M_{inv}", tu_binning[ib], tu_binning[ib+1]), 200, 0, 5)); hmepu.push_back(new TH1F(Form("hmepu%d", ib), Form("%4.2f < u < %4.2f;M_{inv}", tu_binning[ib], tu_binning[ib+1]), 200, 0, 5)); } for (int iby=0; iby < costh_binning_2d.size()-1; ++iby) { for (int ibx=0; ibx < tu_binning_2d.size()-1; ++ibx) { const char *s_base = Form("%5.3f < t < %5.3f & %4.2f < cos(#theta) < %4.2f", tu_binning_2d[ibx], tu_binning_2d[ibx+1], costh_binning_2d[iby], costh_binning_2d[iby+1]); hmeptcth.push_back(new TH1F(Form("hmep_t%d_cth%d", ibx, iby), Form("%s;M_{inv}", s_base), 200, 0, 5)); hmeptcth[hmeptcth.size()-1]->Sumw2(); hmeptcth0.push_back(new TH1F(Form("hmep_t%d_cth%d_wt0", ibx, iby), Form("%s, A=1.0;M_{inv}", s_base), 200, 0, 5)); hmeptcth0[hmeptcth0.size()-1]->Sumw2(); hmeptcth1.push_back(new TH1F(Form("hmep_t%d_cth%d_wt1", ibx, iby), Form("%s, A=0.4;M_{inv}", s_base), 200, 0, 5)); hmeptcth1[hmeptcth1.size()-1]->Sumw2(); f_hmeptcth.push_back(new TH1F(Form("f_hmep_t%d_cth%d", ibx, iby), Form("%s;M_{inv}", s_base), 200, 0, 5)); f_hmeptcth[f_hmeptcth.size()-1]->Sumw2(); f_hmeptcth0.push_back(new TH1F(Form("f_hmep_t%d_cth%d_wt0", ibx, iby), Form("%s, A=1.0;M_{inv}", s_base), 200, 0, 5)); f_hmeptcth0[f_hmeptcth0.size()-1]->Sumw2(); f_hmeptcth1.push_back(new TH1F(Form("f_hmep_t%d_cth%d_wt1", ibx, iby), Form("%s, A=0.4;M_{inv}", s_base), 200, 0, 5)); f_hmeptcth1[f_hmeptcth1.size()-1]->Sumw2(); } } for (int iby=0; iby < costh_binning_2d.size()-1; ++iby) { for (int ibx=0; ibx < tu_binning_2d.size()-1; ++ibx) { const char *s_base = Form("%5.3f < u < %5.3f & %4.2f < cos(#theta) < %4.2f", tu_binning_2d[ibx], tu_binning_2d[ibx+1], costh_binning_2d[iby], costh_binning_2d[iby+1]); hmepucth.push_back(new TH1F(Form("hmep_u%d_cth%d", ibx, iby), Form("%s;M_{inv}", s_base), 200, 0, 5)); hmepucth[hmepucth.size()-1]->Sumw2(); hmepucth0.push_back(new TH1F(Form("hmep_u%d_cth%d_wt0", ibx, iby), Form("%s, A=1.0;M_{inv}", s_base), 200, 0, 5)); hmepucth0[hmepucth0.size()-1]->Sumw2(); hmepucth1.push_back(new TH1F(Form("hmep_u%d_cth%d_wt1", ibx, iby), Form("%s, A=0.4;M_{inv}", s_base), 200, 0, 5)); hmepucth1[hmepucth1.size()-1]->Sumw2(); f_hmepucth.push_back(new TH1F(Form("f_hmep_u%d_cth%d", ibx, iby), Form("%s;M_{inv}", s_base), 200, 0, 5)); f_hmepucth[f_hmepucth.size()-1]->Sumw2(); f_hmepucth0.push_back(new TH1F(Form("f_hmep_u%d_cth%d_wt0", ibx, iby), Form("%s, A=1.0;M_{inv}", s_base), 200, 0, 5)); f_hmepucth0[f_hmepucth0.size()-1]->Sumw2(); f_hmepucth1.push_back(new TH1F(Form("f_hmep_u%d_cth%d_wt1", ibx, iby), Form("%s, A=0.4;M_{inv}", s_base), 200, 0, 5)); f_hmepucth1[f_hmepucth1.size()-1]->Sumw2(); } } hmmiss = new TH1F("hmmiss", "hmmiss", 400, -0.6, 0.6); hmmiss2 = new TH1F("hmmiss2", "hmmiss2", 400, -0.2, 0.3); hmmiss_jpsi = new TH1F("hmmiss_jpsi", "hmmiss_jpsi", 400, -0.6, 0.9); hmmiss2_jpsi = new TH1F("hmmiss2_jpsi", "hmmiss2_jpsi", 400, -0.2, 0.5); hmtot = new TH1F("hmtot", "hmtot", 200, 0, 8); hcmoa = new TH2F("hcmoa", "hcmoa", 200, 0, 2*TMath::Pi(), 200, 0, 2*TMath::Pi()); hmep_mconst = new TH1F(Form("hmep_mconst"),Form("hmep_mconst"),200,0,5); hmtot_mconst = new TH1F("hmtot_mconst", "hmtot_mconst", 200, 0, 8); hcmoa_mconst = new TH2F("hcmoa_mconst", "hcmoa_mconst", 200, 0, 2*TMath::Pi(), 200, 0, 2*TMath::Pi()); hmtot_mconst_cut = new TH1F("hmtot_mconst_cut", "hmtot_mconst_cut", 200, 0, 8); hcmoa_mconst_cut = new TH2F("hcmoa_mconst_cut", "hcmoa_mconst_cut", 200, 0, 2*TMath::Pi(), 200, 0, 2*TMath::Pi()); double _tmin = iplab==0?-1.9:(iplab==1?-6.5:-14); if (is_dpm()) { _tmin = iplab==0?-11:(iplab==1?-16:-24); } double tbins_da[40] = {0.}; for (int ib=0; ib<tu_binning.size(); ++ib) { tbins_da[ib] = tu_binning[ib]; } httrumc_vb = new TH1F("httrumc_vb", "httrumc_vb", tu_binning.size()-1, tbins_da); hutrumc_vb = new TH1F("hutrumc_vb", "hutrumc_vb", tu_binning.size()-1, tbins_da); httrumc = new TH1F("httrumc", "httrumc", 1000, _tmin, 1); hutrumc = new TH1F("hutrumc", "hutrumc", 1000, _tmin, 1); htrecgg = new TH1F("htrecgg", "htrecgg", 1000, _tmin, 1); hurecgg = new TH1F("hurecgg", "hurecgg", 1000, _tmin, 1); htrecep = new TH1F("htrecep", "htrecep", 1000, _tmin, 1); hurecep = new TH1F("hurecep", "hurecep", 1000, _tmin, 1); htrecgg_excl = new TH1F("htrecgg_excl", "htrecgg_excl", 1000, _tmin, 1); hurecgg_excl = new TH1F("hurecgg_excl", "hurecgg_excl", 1000, _tmin, 1); htrecep_excl = new TH1F("htrecep_excl", "htrecep_excl", 1000, _tmin, 1); hurecep_excl = new TH1F("hurecep_excl", "hurecep_excl", 1000, _tmin, 1); htrecgg_mcut = new TH1F("htrecgg_mcut", "htrecgg_mcut", 1000, _tmin, 1); hurecgg_mcut = new TH1F("hurecgg_mcut", "hurecgg_mcut", 1000, _tmin, 1); htrecep_mcut = new TH1F("htrecep_mcut", "htrecep_mcut", 1000, _tmin, 1); hurecep_mcut = new TH1F("hurecep_mcut", "hurecep_mcut", 1000, _tmin, 1); htresgg = new TH1F("htresgg", "htresgg", 1000, -3, 3); huresgg = new TH1F("huresgg", "huresgg", 1000, -3, 3); htresep = new TH1F("htresep", "htresep", 1000, -3, 3); huresep = new TH1F("huresep", "huresep", 1000, -3, 3); hepcosth_res = new TH1F("hepcosth_res", "hepcosth_res", 1000, -0.5, 0.5); f_hepcosth_res = new TH1F("f_hepcosth_res", "f_hepcosth_res", 1000, -0.5, 0.5); hepcosth_jpsi_mc_all = new TH1F("hepcosth_jpsi_mc_all", "hepcosth_jpsi_mc_all", 1000, -1.1, 1.1); hepcosth_jpsi_mc_all_wt0 = new TH1F("hepcosth_jpsi_mc_all_wt0", "hepcosth_jpsi_mc_all_wt0", 1000, -1.1, 1.1); hepcosth_jpsi_mc_all_wt1 = new TH1F("hepcosth_jpsi_mc_all_wt1", "hepcosth_jpsi_mc_all_wt1", 1000, -1.1, 1.1); hepcosth_jpsi_vs_epthlab_mc_all = new TH2F("hepcosth_jpsi_vs_epthlab_mc_all", "hepcosth_jpsi_vs_epthlab_mc_all", 200, -1.1, 1.1, 200, 0, 180); hepcosth_jpsi_vs_emthlab_mc_all = new TH2F("hepcosth_jpsi_vs_emthlab_mc_all", "hepcosth_jpsi_vs_emthlab_mc_all", 200, -1.1, 1.1, 200, 0, 180); hepcosth_jpsi_rec_all = new TH1F("hepcosth_jpsi_rec_all", "hepcosth_jpsi_rec_all", 1000, -1.1, 1.1); hepcosth_jpsi_rec_all_wt0 = new TH1F("hepcosth_jpsi_rec_all_wt0", "hepcosth_jpsi_rec_all_wt0", 1000, -1.1, 1.1); hepcosth_jpsi_rec_all_wt1 = new TH1F("hepcosth_jpsi_rec_all_wt1", "hepcosth_jpsi_rec_all_wt1", 1000, -1.1, 1.1); hepcosth_jpsi_vs_epthlab_rec_all = new TH2F("hepcosth_jpsi_vs_epthlab_rec_all", "hepcosth_jpsi_vs_epthlab_rec_all", 200, -1.1, 1.1, 200, 0, 180); hepcosth_jpsi_vs_emthlab_rec_all = new TH2F("hepcosth_jpsi_vs_emthlab_rec_all", "hepcosth_jpsi_vs_emthlab_rec_all", 200, -1.1, 1.1, 200, 0, 180); f_hepcosth_jpsi_rec_all = new TH1F("f_hepcosth_jpsi_rec_all", "f_hepcosth_jpsi_rec_all", 1000, -1.1, 1.1); f_hepcosth_jpsi_rec_all_wt0 = new TH1F("f_hepcosth_jpsi_rec_all_wt0", "f_hepcosth_jpsi_rec_all_wt0", 1000, -1.1, 1.1); f_hepcosth_jpsi_rec_all_wt1 = new TH1F("f_hepcosth_jpsi_rec_all_wt1", "f_hepcosth_jpsi_rec_all_wt1", 1000, -1.1, 1.1); f_hepcosth_jpsi_vs_epthlab_rec_all = new TH2F("f_hepcosth_jpsi_vs_epthlab_rec_all", "f_hepcosth_jpsi_vs_epthlab_rec_all", 200, -1.1, 1.1, 200, 0, 180); f_hepcosth_jpsi_vs_emthlab_rec_all = new TH2F("f_hepcosth_jpsi_vs_emthlab_rec_all", "f_hepcosth_jpsi_vs_emthlab_rec_all", 200, -1.1, 1.1, 200, 0, 180); for (int ii=0; ii < 4; ++ii) { hepcosth_jpsi_rec[ii] = new TH1F(Form("hepcosth_jpsi_rec_itu%d",ii), Form("hepcosth_jpsi_rec_itu%d",ii), 1000, -1.1, 1.1); hepcosth_jpsi_rec_wt0[ii] = new TH1F(Form("hepcosth_jpsi_rec_wt0_itu%d",ii), Form("hepcosth_jpsi_rec_wt0_itu%d",ii), 1000, -1.1, 1.1); hepcosth_jpsi_rec_wt1[ii] = new TH1F(Form("hepcosth_jpsi_rec_wt1_itu%d",ii), Form("hepcosth_jpsi_rec_wt1_itu%d",ii), 1000, -1.1, 1.1); hepcosth_jpsi_vs_epthlab_rec[ii] = new TH2F(Form("hepcosth_jpsi_vs_epthlab_rec_itu%d",ii), Form("hepcosth_jpsi_vs_epthlab_rec_itu%d",ii), 1000, -1.1, 1.1, 200, 0, 180); hepcosth_jpsi_vs_emthlab_rec[ii] = new TH2F(Form("hepcosth_jpsi_vs_emthlab_rec_itu%d",ii), Form("hepcosth_jpsi_vs_emthlab_rec_itu%d",ii), 1000, -1.1, 1.1, 200, 0, 180); f_hepcosth_jpsi_rec[ii] = new TH1F(Form("f_hepcosth_jpsi_rec_itu%d",ii), Form("hepcosth_jpsi_rec_itu%d",ii), 1000, -1.1, 1.1); f_hepcosth_jpsi_rec_wt0[ii] = new TH1F(Form("f_hepcosth_jpsi_rec_wt0_itu%d",ii), Form("f_hepcosth_jpsi_rec_wt0_itu%d",ii), 1000, -1.1, 1.1); f_hepcosth_jpsi_rec_wt1[ii] = new TH1F(Form("f_hepcosth_jpsi_rec_wt1_itu%d",ii), Form("f_hepcosth_jpsi_rec_wt1_itu%d",ii), 1000, -1.1, 1.1); f_hepcosth_jpsi_vs_epthlab_rec[ii] = new TH2F(Form("f_hepcosth_jpsi_vs_epthlab_rec_itu%d",ii), Form("hepcosth_jpsi_vs_epthlab_rec_itu%d",ii), 1000, -1.1, 1.1, 200, 0, 180); f_hepcosth_jpsi_vs_emthlab_rec[ii] = new TH2F(Form("f_hepcosth_jpsi_vs_emthlab_rec_itu%d",ii), Form("hepcosth_jpsi_vs_emthlab_rec_itu%d",ii), 1000, -1.1, 1.1, 200, 0, 180); hepcosth_jpsi_mc[ii] = new TH1F(Form("hepcosth_jpsi_mc_itu%d",ii), Form("hepcosth_jpsi_mc_itu%d",ii), 1000, -1.1, 1.1); hepcosth_jpsi_mc_wt0[ii] = new TH1F(Form("hepcosth_jpsi_mc_wt0_itu%d",ii), Form("hepcosth_jpsi_mc_wt0_itu%d",ii), 1000, -1.1, 1.1); hepcosth_jpsi_mc_wt1[ii] = new TH1F(Form("hepcosth_jpsi_mc_wt1_itu%d",ii), Form("hepcosth_jpsi_mc_wt1_itu%d",ii), 1000, -1.1, 1.1); hepcosth_jpsi_vs_epthlab_mc[ii] = new TH2F(Form("hepcosth_jpsi_vs_epthlab_mc_itu%d",ii), Form("hepcosth_jpsi_vs_epthlab_mc_itu%d",ii), 1000, -1.1, 1.1, 200, 0, 180); hepcosth_jpsi_vs_emthlab_mc[ii] = new TH2F(Form("hepcosth_jpsi_vs_emthlab_mc_itu%d",ii), Form("hepcosth_jpsi_vs_emthlab_mc_itu%d",ii), 1000, -1.1, 1.1, 200, 0, 180); } htrupi0thcm = new TH1F("htrupi0thcm", "htrupi0thch", 1000, 0., TMath::Pi()); htrupi0costhcm = new TH1F("htrupi0costhcm", "htrupi0costhcm", 1100, -1.1, 1.1); htrupi0thlab = new TH1F("htrupi0thlab", "htrupi0thlab", 1000, 0., TMath::Pi()); htrupi0thcm_mcut = new TH1F("htrupi0thcm_mcut", "htrupi0thch_mc", 1000, 0., TMath::Pi()); htrupi0costhcm_mcut = new TH1F("htrupi0costhcm_mcut", "htrupi0costhcm_mcut", 1100, -1.1, 1.1); htrupi0thlab_mcut = new TH1F("htrupi0thlab_mcut", "htrupi0thlab_mcut", 1000, 0., TMath::Pi()); htrupi0thcm_tcut = new TH1F("htrupi0thcm_tcut", "htrupi0thch_tc", 1000, 0., TMath::Pi()); htrupi0costhcm_tcut = new TH1F("htrupi0costhcm_tcut", "htrupi0costhcm_tcut", 1100, -1.1, 1.1); htrupi0thlab_tcut = new TH1F("htrupi0thlab_tcut", "htrupi0thlab_tcut", 1000, 0., TMath::Pi()); htrupi0thcm_tcut_mcut = new TH1F("htrupi0thcm_tcut_mcut", "htrupi0thch_tc_mc", 1000, 0., TMath::Pi()); htrupi0costhcm_tcut_mcut = new TH1F("htrupi0costhcm_tcut_mcut", "htrupi0costhcm_tcut_mcut", 1100, -1.1, 1.1); htrupi0thlab_tcut_mcut = new TH1F("htrupi0thlab_tcut_mcut", "htrupi0thlab_tcut_mcut", 1000, 0., TMath::Pi()); htrupi0thcm_vs_m = new TH2F("htrupi0thcm_vs_m", "htrupi0thch_vs_m", 200, 0, 5, 1000, 0., TMath::Pi()); htrupi0costhcm_vs_m = new TH2F("htrupi0costhcm_vs_m", "htrupi0costhcm_vs_m", 200, 0, 5, 1100, -1.1, 1.1); htrupi0thlab_vs_m = new TH2F("htrupi0thlab_vs_m", "htrupi0thlab_vs_m", 200, 0, 5, 1000, 0., TMath::Pi()); htrupi0thcm_mcut_vs_m = new TH2F("htrupi0thcm_mcut_vs_m", "htrupi0thch_mc_vs_m", 200, 0, 5, 1000, 0., TMath::Pi()); htrupi0costhcm_mcut_vs_m = new TH2F("htrupi0costhcm_mcut_vs_m", "htrupi0costhcm_mcut_vs_m", 200, 0, 5, 1100, -1.1, 1.1); htrupi0thlab_mcut_vs_m = new TH2F("htrupi0thlab_mcut_vs_m", "htrupi0thlab_mcut_vs_m", 200, 0, 5, 1000, 0., TMath::Pi()); hnevt = new TH1F("hnevt","hnevt", 10,0,10); hnevt->SetBinContent(3, nevt_sim[mc_type][iplab]); hnevt->SetBinContent(4, nevt_xsect[mc_type][iplab]); hpi0jpsi_chi24c = new TH1F("hpi0jpsi_chi24c","hpi0jpsi_chi24c",2000,0,10000); hpi0jpsi_chi24c_c = new TH1F("hpi0jpsi_chi24c_c","hpi0jpsi_chi24c_c",1000,0,500); hpi0jpsi_prob4c = new TH1F("hpi0jpsi_prob4c ","hpi0jpsi_prob4c ",1000,0,1.0); hpi0jpsi_pull4c = new TH1F("hpi0jpsi_pull4c ","hpi0jpsi_pull4c ",1000,-6,6); hpi0jpsi_chi2diff4c = new TH1F("hpi0jpsi_chi2diff4c ","hpi0jpsi_chi2diff4c ",1000,-100,100); double hist_mmin[3] = {2.6,2.8,3.8}; double hist_mmax[3] = {3.8,5.,6.}; hpi0jpsi_chi24c_vs_mtot_r = new TH2F("hpi0jpsi_chi24c_vs_mtot_r","hpi0jpsi_chi24c_vs_mtot_r",2000,0,10000,200,hist_mmin[iplab],hist_mmax[iplab]); hpi0jpsi_chi24c_vs_cm_dth_r = new TH2F("hpi0jpsi_chi24c_vs_cm_dth_r","hpi0jpsi_chi24c_vs_cm_dth_r",2000,0,10000,200,1.0,5.0); hpi0jpsi_chi24c_vs_cm_dph_r = new TH2F("hpi0jpsi_chi24c_vs_cm_dph_r","hpi0jpsi_chi24c_vs_cm_dph_r",2000,0,10000,200,1.5,5.0); hpi0jpsi_chi24c_vs_mtot_f = new TH2F("hpi0jpsi_chi24c_vs_mtot_f","hpi0jpsi_chi24c_vs_mtot_f",500,0,1000,200,hist_mmin[iplab],hist_mmax[iplab]); hpi0jpsi_chi24c_vs_cm_dth_f = new TH2F("hpi0jpsi_chi24c_vs_cm_dth_f","hpi0jpsi_chi24c_vs_cm_dth_f",500,0,1000,500,1.0,5.0); hpi0jpsi_chi24c_vs_cm_dph_f = new TH2F("hpi0jpsi_chi24c_vs_cm_dph_f","hpi0jpsi_chi24c_vs_cm_dph_f",500,0,1000,500,1.5,5.0); hpi0pi0jpsi_chi24c = new TH1F("hpi0pi0jpsi_chi24c","hpi0pi0jpsi_chi24c",2000,0,10000); hpi0pi0jpsi_chi24c_c = new TH1F("hpi0pi0jpsi_chi24c_c","hpi0pi0jpsi_chi24c_c",1000,0,500); hpi0vs2pi0_chi24c = new TH2F("hpi0vs2pi0_chi24c","hpi0vs2pi0_chi24c",2000,0,10000,2000,0,10000); hpi0vs2pi0_chi24c_c = new TH2F("hpi0vs2pi0_chi24c_c","hpi0vs2pi0_chi24c_c",1000,0,500,1000,0,500); // pull distributions double zoom = (mc_type == 1||mc_type == 5)? 1.0:2.0; hmom_pull_ep_r = new TH1F("hmom_pull_ep_r","mom pull e^{+} (reco)",150,-3.*zoom,3.*zoom); hmom_pull_ep_f = new TH1F("hmom_pull_ep_f","mom pull e^{+} (fit)",150,-3.*zoom,3.*zoom); hmom_pull_em_r = new TH1F("hmom_pull_em_r","mom pull e^{-} (reco)",150,-3.*zoom,3.*zoom); hmom_pull_em_f = new TH1F("hmom_pull_em_f","mom pull e^{-} (fit)",150,-3.*zoom,3.*zoom); hpx_pull_ep_r = new TH1F("hpx_pull_ep_r","px pull e^{+} (reco)",150,-3.*zoom,3.*zoom); hpx_pull_ep_f = new TH1F("hpx_pull_ep_f","px pull e^{+} (fit)",150,-3.*zoom,3.*zoom); hpx_pull_em_r = new TH1F("hpx_pull_em_r","px pull e^{-} (reco)",150,-3.*zoom,3.*zoom); hpx_pull_em_f = new TH1F("hpx_pull_em_f","px pull e^{-} (fit)",150,-3.*zoom,3.*zoom); hpy_pull_ep_r = new TH1F("hpy_pull_ep_r","py pull e^{+} (reco)",150,-3.*zoom,3.*zoom); hpy_pull_ep_f = new TH1F("hpy_pull_ep_f","py pull e^{+} (fit)",150,-3.*zoom,3.*zoom); hpy_pull_em_r = new TH1F("hpy_pull_em_r","py pull e^{-} (reco)",150,-3.*zoom,3.*zoom); hpy_pull_em_f = new TH1F("hpy_pull_em_f","py pull e^{-} (fit)",150,-3.*zoom,3.*zoom); hpz_pull_ep_r = new TH1F("hpz_pull_ep_r","pz pull e^{+} (reco)",150,-3.*zoom,3.*zoom); hpz_pull_ep_f = new TH1F("hpz_pull_ep_f","pz pull e^{+} (fit)",150,-3.*zoom,3.*zoom); hpz_pull_em_r = new TH1F("hpz_pull_em_r","pz pull e^{-} (reco)",150,-3.*zoom,3.*zoom); hpz_pull_em_f = new TH1F("hpz_pull_em_f","pz pull e^{-} (fit)",150,-3.*zoom,3.*zoom); } void AnaTdav2::beam_cond(){ //TLorentzVector ini = TLorentzVector(0, 0, 5.513, 6.53023); // need some info about if (mom_antip<0) { cout << "Antiproton momentum has to be given before intialization" << endl; exit(1); } const double mass_prot= 0.938; const double E_antip = TMath::Hypot(mass_prot, mom_antip); const double beta_cm = mom_antip/(E_antip + mass_prot); cout << "betac_cm = " << beta_cm << endl; boost_to_cm.SetZ(-beta_cm); boost_to_lab.SetZ(beta_cm); boost_to_cm.Print(); boost_to_lab.Print(); p4pbar.SetPxPyPzE(0,0,mom_antip,TMath::Hypot(mass_prot,mom_antip)); p4targ.SetPxPyPzE(0,0,0,mass_prot); p4sys = p4pbar + p4targ; double ftmin[3] = {-0.45, -2.0, -5.0}; double delta[3] = {0.1, 0.2, 0.2}; //double ftmin[3] = {-0.1, -1.3, -2.8}; //double delta[3] = {0.08, 0.2, 0.4}; cout << "double range[iplab=" << iplab << "][]= {"; for (int i=0; i<30; ++i) { double xx = ftmin[iplab] + delta[iplab]*i; //double xx = i==0 ? tmin[iplab]: (ftmin[iplab] + delta[iplab]*i); if (xx>tmax[iplab]) { cout << tmax[iplab] << " }; // n=" << i << endl;; tu_binning.push_back(tmax[iplab]); break; } else { tu_binning.push_back(xx); cout << xx << ","; } } print_binning(tu_binning, "tu_binning"); tu_binning_2d.push_back(tmid[iplab]); tu_binning_2d.push_back(tmin[iplab]); //tu_binning_2d.push_back((tmin[iplab]+tmax[iplab])/2.0); tu_binning_2d.push_back(tmax[iplab]); //for (int icth=0; icth < 9; ++icth) { costh_binning_2d.push_back(-1.0 + (2.0*icth/8.0)); } cout << "costh binning= { "; for (int icth=0; icth < 9; ++icth) { double b = -0.8 + (2.0*icth/10.0); costh_binning_2d.push_back(b); cout << b << ", "; } cout << "}" << endl; // Equal subdivisions in costh_cm, boost to lab for th bins TLorentzVector pi0; TVector3 u; for (int ii = 0; ii < tu_binning.size(); ++ii) { pi0cost_cm_binning.push_back(-1.0 + ( 2.0*ii/(tu_binning.size()-1) )); } for (int ii = pi0cost_cm_binning.size()-1; ii >=0; --ii) { u.SetMagThetaPhi(1,TMath::ACos(pi0cost_cm_binning[ii]),0); pi0.SetPxPyPzE(u.Px(),u.Py(),u.Pz(),TMath::Hypot(0.1349766,1.0)); pi0.Boost(boost_to_lab); pi0th_binning.push_back( pi0.Theta()); } pi0th_binning[0]-=0.0001; // safety for numerical error pi0th_binning[tu_binning.size()-1]+=0.0001; // safety for numerical error print_binning(pi0cost_cm_binning,"pi0cost_cm_binning"); print_binning(pi0th_binning,"pi0th_binning"); } void AnaTdav2::print_binning(const vector<double> &b, const char* n) { cout << n << ": {"; for (int ii = 0; ii < b.size(); ++ii) cout << b[ii] << (ii==b.size()-1?"":", "); cout << "}; nbins= //" << b.size()-1 << endl; } InitStatus AnaTdav2::Init() { cout << "AnaTdav2::Init" << endl; fAna = new PndAnalysis(); beam_cond(); init_hists(); init_tcas(); return kSUCCESS; } void AnaTdav2::fill_mtot(RhoCandList& _ep, RhoCandList& _gg, TH1F* dest) { for (int jep = 0; jep < _ep.GetLength(); ++jep) for (int jgg = 0; jgg < _gg.GetLength(); ++jgg) dest->Fill(m(_gg[jgg], _ep[jep]), m_evt_wt); } void AnaTdav2::fill_mmiss(RhoCandList& _ep, RhoCandList& _gg, TH1F* dest, TH1F* dest2) { assert(_ep.GetLength()<=1&&_gg.GetLength()<=1); if (_ep.GetLength()==1&&_gg.GetLength()==1) { double _mmiss = (p4sys - (_gg[0]->P4() + _ep[0]->P4())).M(); double _mmiss2 = (p4sys - (_gg[0]->P4() + _ep[0]->P4())).M2(); dest->Fill(_mmiss, m_evt_wt); dest2->Fill(_mmiss2, m_evt_wt); } } void AnaTdav2::fill_mmiss_jpsi(RhoCandList& _ep, TH1F* dest, TH1F* dest2) { assert(_ep.GetLength()<=1); if (_ep.GetLength()==1) { double _mmiss = (p4sys - _ep[0]->P4()).M(); double _mmiss2 = (p4sys - _ep[0]->P4()).M2(); dest->Fill(_mmiss, m_evt_wt); dest2->Fill(_mmiss2, m_evt_wt); } } void AnaTdav2::fill_dth_dph_cm(RhoCandList& _ep, RhoCandList& _gg, TH2F* dest) { double _dth_cm=0, _dph_cm=0; for (int jep = 0; jep < _ep.GetLength(); ++jep) for (int jgg = 0; jgg < _gg.GetLength(); ++jgg) { dth_dph_cm(_gg[jgg], _ep[jep], _dth_cm, _dph_cm); dest->Fill(_dth_cm, _dph_cm); } } // Here, weight that is applied is the "event" weight. For mutli-pair events all pairs get the same weight. // It is possible to do better, by calculating the weight for each pair based on the MC truth info // but this will require big changes in structure void AnaTdav2::fill_pair_mass(RhoCandList& org, TH1F* dest) { for (int j = 0; j < org.GetLength(); ++j) dest->Fill(org[j]->M(),m_evt_wt); } // Here, weight that is applied is the "event" weight. For mutli-pair events all pairs get the same weight. // It is possible to do better, by calculating the weight for each pair based on the MC truth info // but this will require big changes in structure void AnaTdav2::fill_pair_mass(RhoCandList& org, TH1F* dest, double more_weight) { for (int j = 0; j < org.GetLength(); ++j) dest->Fill(org[j]->M(),m_evt_wt*more_weight); } bool AnaTdav2::check_mct_jpsi(RhoCandidate* _cand) { if (mct_uid_e<0||mct_uid_p<0) return false; if (_cand->NDaughters()!=2) return false; int i0 = _cand->Daughter(0)->Uid(); int i1 = _cand->Daughter(1)->Uid(); return (i0==mct_uid_e&&i1==mct_uid_p)||(i0==mct_uid_p&&i1==mct_uid_e); } bool AnaTdav2::check_mct_pi0(RhoCandidate* _cand) { if (mct_uid_g1<0||mct_uid_g2<0) return false; if (_cand->NDaughters()!=2) return false; int i0 = _cand->Daughter(0)->Uid(); int i1 = _cand->Daughter(1)->Uid(); return (i0==mct_uid_g1&&i1==mct_uid_g2)||(i0==mct_uid_g2&&i1==mct_uid_g1); } double AnaTdav2::the_bwd(RhoCandidate* _cand) { if (_cand->NDaughters()!=2) return -9999.; double the0 = _cand->Daughter(0)->P3().Theta(); double the1 = _cand->Daughter(1)->P3().Theta(); return TMath::RadToDeg()*(the0>the1?the0:the1); } double AnaTdav2::the_fwd(RhoCandidate* _cand) { if (_cand->NDaughters()!=2) return -9999.; double the0 = _cand->Daughter(0)->P3().Theta(); double the1 = _cand->Daughter(1)->P3().Theta(); return TMath::RadToDeg()*(the0<the1?the0:the1); } double AnaTdav2::oa(RhoCandidate* _cand) { if (_cand->NDaughters()!=2) return -9999.; RhoCandidate *d1 = _cand->Daughter(0); RhoCandidate *d2 = _cand->Daughter(1); return oa(d1,d2); } void AnaTdav2::fill_mctruth(RhoCandList& _ep, RhoCandList& _gg, int step) { for (int ii=0; ii < _ep.GetLength(); ++ii) { for (int jj=0; jj < _gg.GetLength(); ++jj) { if (check_mct_jpsi(_ep[ii]) and check_mct_pi0(_gg[jj])) { hmep_mct[step]->Fill(_ep[ii]->M(), m_evt_wt); hthe_ep_mct[step]->Fill(_ep[ii]->P3().Theta()*TMath::RadToDeg(), m_evt_wt); hthe_ep_mct_fwd[step]->Fill(the_fwd(_ep[ii]), m_evt_wt); hthe_ep_mct_bwd[step]->Fill(the_bwd(_ep[ii]), m_evt_wt); hmgg_mct[step]->Fill(_gg[jj]->M(),m_evt_wt); hthe_gg_mct[step]->Fill(_gg[jj]->P3().Theta()*TMath::RadToDeg(), m_evt_wt); hthe_gg_mct_fwd[step]->Fill(the_fwd(_gg[jj]), m_evt_wt); hthe_gg_mct_bwd[step]->Fill(the_bwd(_gg[jj]), m_evt_wt); hoa_gg_mct[step]->Fill(oa(_gg[jj]), m_evt_wt); } else { hmep_non_mct[step]->Fill(_ep[ii]->M(), m_evt_wt); hmgg_non_mct[step]->Fill(_gg[jj]->M(), m_evt_wt); } } } } void AnaTdav2::fill_count_hists(int _gg, int _ep, int ihist) { hnep[ihist]->Fill(rcl[_ep].GetLength()); hngg[ihist]->Fill(rcl[_gg].GetLength()); hnpi0jpsi[ihist]->Fill(rcl[_gg].GetLength()*rcl[_ep].GetLength()); } void AnaTdav2::print_indices() { cout << "e= " << e << " p= " << p << " g= " << g << "ie = " << ie<< " ip = " << ip<< " gg = " << gg<< " gg_sel = " << gg_sel<< " ep = " << ep<< " iep = " << iep<< " iep_uniq = " << iep_uniq<< " iep_asso = " << iep_asso<< " iep_excl = " << iep_excl<< " gg_excl = " << gg_excl << " nrcl= " << nrcl << endl; } bool AnaTdav2::check_eid(RhoCandidate* cand) { if (eid_param_method) { // Eid Paramterisation cand->SetType(-11*cand->Charge()); double mom = cand->P3().Mag(); double theta = cand->P3().Theta(); if (fAna->McTruthMatch(cand)) { mom = cand->GetMcTruth()->P3().Mag(); theta = cand->GetMcTruth()->P3().Theta(); } if (!eff_hist_rad) theta *= TMath::RadToDeg(); const int ix = heff_epm->GetXaxis()->FindBin(mom); const int iy = heff_epm->GetYaxis()->FindBin(theta); const double eff = heff_epm->GetBinContent(ix,iy); const double prob = gRandom->Uniform(); //cout << "eff = " << eff << endl; return (prob<eff); } else { // Ronald's Method return bayes_pid(cand); } } inline double AnaTdav2::dist_photon_match(RhoCandidate *rec, RhoCandidate *mc) { const double _dth = (rec->P3().Theta()-mc->P3().Theta())/8.0e-3; const double _dph = (rec->P3().Phi()-mc->P3().Phi())/8.22e-3; return TMath::Hypot(_dph, _dth) / 3.0; } inline double AnaTdav2::dist_chpi_match(RhoCandidate *rec, RhoCandidate *mc) { const double _dth = (rec->P3().Theta()-mc->P3().Theta())/1.54e-3; const double _dph = (rec->P3().Phi()-mc->P3().Phi())/3.95e-3; return TMath::Hypot(_dth, _dph); } void AnaTdav2::charged_pion_filter(RhoCandList& outp, RhoCandList& outm, RhoCandList& inp_pi, RhoCandList& inm_pi, RhoCandList& inp_e, RhoCandList& inm_e) { // Assume tracks returned by pion and electrn hypothesis come in the same order // The least requirement is that they have the same number of tracks assert(inp_pi.GetLength()==inp_e.GetLength()); assert(inm_pi.GetLength()==inm_e.GetLength()); // Quck test of "identity"-- seems like everythign is legit here //for (int ii = 0; ii < inp_pi.GetLength(); ++ii) assert(inp_pi[ii]->GetTrackNumber()==inp_e[ii]->GetTrackNumber()); //for (int ii = 0; ii < inm_pi.GetLength(); ++ii) assert(inm_pi[ii]->GetTrackNumber()==inm_e[ii]->GetTrackNumber()); //for (int ii = 0; ii < inm_pi.GetLength(); ++ii) { // cout << "p(pihyp)= " << inm_pi[ii]->P3().Mag() << " p(elhyp)= " << inm_e[ii]->P3().Mag() << endl;; // cout << "E(pihyp)= " << inm_pi[ii]->Energy() << " E(elhyp)= " << inm_e[ii]->Energy() << endl;; //} int pdg_pip = 211, pdg_pim = -211; int mc_p = -1, mc_m = -1; for (int j=0;j<mcList.GetLength();++j) { if (mcList[j]->PdgCode()!=pdg_pip and mcList[j]->PdgCode()!=pdg_pim) continue; if (!mcList[j]->TheMother()) { if (mcList[j]->PdgCode()==pdg_pip) mc_p = j; if (mcList[j]->PdgCode()==pdg_pim) mc_m = j; } if (mc_p>=0&&mc_m>=0) break; } // These shouldn't really happen! assert(0 <= mc_p and mc_p < mcList.GetLength()); assert(0 <= mc_m and mc_m < mcList.GetLength()); if (inp_pi.GetLength()==0 or inm_pi.GetLength()==0) return; // not interested in such events if (inp_pi.GetLength()==1 and inm_pi.GetLength()==1) { // accept such events without condition... outp.Append(inp_e[0]); outm.Append(inm_e[0]); return; } // Here keep the cosest matching pair double dmin = 1e9; int match_p = -1, match_m = -1; for (int iip = 0; iip < inp_pi.GetLength(); ++iip) { for (int iim = 0; iim < inm_pi.GetLength(); ++iim) { const double dp = dist_chpi_match(inp_pi[iip],mcList[mc_p]); const double dm = dist_chpi_match(inm_pi[iim],mcList[mc_m]); const double dtot = TMath::Hypot(dp,dm); if (dtot < dmin) { match_p = iip; match_m = iim; dmin = dtot; } } } if (dmin<10000) { outp.Append(inp_e[match_p]); outm.Append(inm_e[match_m]); } else { cout << "pi+ pi- match couldn't be found because reco tracks are too far away from MC tracks dist= " << dmin << endl; } } void AnaTdav2::mctruth_match_jpsi(RhoCandList& elec, RhoCandList& posit) { mct_uid_e = -1; mct_uid_p = -1; if (elec.GetLength()==0 || posit.GetLength()==0) return; int pdg_jpsi = 443, pdg_elec = 11, pdg_posit = -11; //int mc_elec = -1, mc_posit = -1; mc_elec = -1; mc_posit = -1; for (int j=0;j<mcList.GetLength();++j) { if (mcList[j]->PdgCode()!=pdg_elec and mcList[j]->PdgCode()!=pdg_posit) continue; if (!mcList[j]->TheMother()) continue; if (mcList[j]->TheMother()->PdgCode()==pdg_jpsi) { if (mcList[j]->PdgCode()==pdg_elec) mc_elec = j; if (mcList[j]->PdgCode()==pdg_posit) mc_posit = j; } if (mc_elec>=0&&mc_posit>=0) break; } if (mc_elec<0||mc_posit<0) { cout << "McTrue e+e- from jpsi not found!!" << endl; return; } // These shouldn't really happen! assert(0 <= mc_elec and mc_elec < mcList.GetLength()); assert(0 <= mc_posit and mc_posit < mcList.GetLength()); double dmin = 1e9; int match_elec = -1, match_posit = -1; for (int iielec = 0; iielec < elec.GetLength(); ++iielec) { for (int iiposit = 0; iiposit < posit.GetLength(); ++iiposit) { const double delec = dist_chpi_match(elec[iielec],mcList[mc_elec]); const double dposit = dist_chpi_match(posit[iiposit],mcList[mc_posit]); const double dtot = TMath::Hypot(delec,dposit); if (dtot < dmin) { match_elec = iielec; match_posit = iiposit; dmin = dtot; } } } if (dmin<10000) { mct_uid_e = elec[match_elec]->Uid(); mct_uid_p = posit[match_posit]->Uid(); } else { cout << "e+ e- match couldn't be found because reco tracks are too far away from MC tracks dist= " << dmin << endl; } } void AnaTdav2::mctruth_match_pi0(RhoCandList& gamma) { mct_uid_g1 = -1; mct_uid_g2 = -1; if (gamma.GetLength()<1) return; int pdg_pi0 = 111, pdg_gamma = 22; //int mc_g1 = -1, mc_g2 = -1; mc_g1 = -1; mc_g2 = -1; for (int j=0;j<mcList.GetLength();++j) { if (mcList[j]->PdgCode()!=pdg_gamma) continue; if (!mcList[j]->TheMother()) continue; if (mcList[j]->TheMother()->PdgCode()==pdg_pi0) { if (mcList[j]->PdgCode()==pdg_gamma) { if (mc_g1 == -1) mc_g1 = j; else mc_g2 = j; } } if (mc_g1>=0&&mc_g2>=0) break; } if (mc_g1<0||mc_g1<0) { cout << "McTrue gg from pi0 not found!!" << endl; return; } // These shouldn't really happen! assert(0 <= mc_g1 and mc_g1 < mcList.GetLength()); assert(0 <= mc_g2 and mc_g2 < mcList.GetLength()); double dmin = 1e9; int match_g1 = -1, match_g2 = -1; for (int iig1 = 0; iig1 < gamma.GetLength(); ++iig1) { for (int iig2 = 0; iig2 < gamma.GetLength(); ++iig2) { const double dg1 = dist_photon_match(gamma[iig1],mcList[mc_g1]); const double dg2 = dist_photon_match(gamma[iig2],mcList[mc_g2]); const double dtot = TMath::Hypot(dg1,dg2); if (dtot < dmin) { match_g1 = iig1; match_g2 = iig2; dmin = dtot; } } } if (dmin<10000) { mct_uid_g1 = gamma[match_g1]->Uid(); mct_uid_g2 = gamma[match_g2]->Uid(); } else { cout << "pi0->gg match couldn't be found because reco tracks are too far away from MC tracks dist= " << dmin << endl; } } void AnaTdav2::eid_filter(RhoCandList&out, RhoCandList&in) { for (int i=0; i< in.GetLength(); ++i) { if ( check_eid(in[i]) ) out.Append(in[i]); } } double AnaTdav2::eff_weight(const TVector3 &mom) { int gb = 0; if (pi_eff->GetDimension()==2) { int bx = pi_eff->GetTotalHistogram()->GetXaxis()->FindBin(mom.Mag()); int by = pi_eff_hist_rad? pi_eff->GetTotalHistogram()->GetXaxis()->FindBin(mom.Theta()*TMath::RadToDeg()): pi_eff->GetTotalHistogram()->GetXaxis()->FindBin(mom.Theta()); gb = pi_eff->GetGlobalBin(bx,by); } else { if (pi_eff_func) { if (mom.Mag()<0.1) return pi_eff_func->Eval(0.1); if (mom.Mag()>10) return pi_eff_func->Eval(10); else return pi_eff_func->Eval(mom.Mag()); } int bx = pi_eff->GetTotalHistogram()->GetXaxis()->FindBin(mom.Mag()); gb = pi_eff->GetGlobalBin(bx); } return pi_eff->GetEfficiency(gb); } //Signal //Track 0 (PDG:88888) has mother -1 and daughter(s) 1 2 //Track 1 (PDG:443) has mother 0 and daughter(s) 3 4 //Track 2 (PDG:111) has mother 0 and daughter(s) 5 6 //Track 3 (PDG:-11) has mother 1 and daughter(s) 909 910 ... //Track 4 (PDG:11) has mother 1 and daughter(s) 178 179 ... //Track 5 (PDG:22) has mother 2 and daughter(s) 23 177 //Track 6 (PDG:22) has mother 2 and daughter(s) 7 22 //Background //Track 0 (PDG:211) has mother -1 and daughter(s) 857 961 //Track 1 (PDG:111) has mother -1 and daughter(s) 2 3 //Track 2 (PDG:22) has mother 1 and daughter(s) 157 856 //Track 3 (PDG:22) has mother 1 and daughter(s) 6 156 bool AnaTdav2::calc_true_tu() { for (int j=0;j<mcList.GetLength();++j) { if (mcList[j]->PdgCode()==111) { // in case of multi pi0 events just use the first pi0 to define "true" t and u. Anyways, these don't make much sense RhoCandidate *mcmother = mcList[j]->TheMother(); int muid = mcmother? mcmother->GetTrackNumber(): -1; //if (( (mc_type!=1&&mc_type!=4&&mc_type!=5&&mc_type!=6) and muid == -1) or // DPM simulation doesn't have pbar-p system at index 0 if (( is_dpm() and muid == -1) or // DPM simulation doesn't have pbar-p system at index 0 ( is_evt_gen() and muid == 0)) { // EvtGen simulation has pbar-p system at index 0 event_t = t_gg(mcList[j]); event_u = u_gg(mcList[j]); event_pi0costh_cm = pi0cost_cm(mcList[j]); event_pi0theta_cm = pi0theta_cm(mcList[j]); event_pi0theta_lab = mcList[j]->P4().Theta(); int itbin_2d = find_bin(event_t, tu_binning_2d); int iubin_2d = find_bin(event_u, tu_binning_2d); int itu2d = itbin_2d>=0?itbin_2d:(iubin_2d>=0?2+iubin_2d:-1); m_epcth_wt0 = 1.0; m_epcth_wt1 = 1.0; event_epthe_jpsi = -9999.0; event_epcosth_jpsi = -9999.0; if (is_evt_gen()) { for (int ik=0; ik < mcList.GetLength(); ++ik) { if (mcList[ik]->PdgCode()==443) { event_epthe_jpsi = the_b(get_p4ep(mcList[ik]), -mcList[ik]->P4().BoostVector()); event_epcosth_jpsi = cost_b(get_p4ep(mcList[ik]), -mcList[ik]->P4().BoostVector()); double _epth_lab = get_p4ep(mcList[ik]).Vect().Theta() *TMath::RadToDeg(); double _emth_lab = get_p4em(mcList[ik]).Vect().Theta() *TMath::RadToDeg(); m_epcth_wt0 = (1 + event_epcosth_jpsi*event_epcosth_jpsi)/1.5; m_epcth_wt1 = (1 + 0.4*event_epcosth_jpsi*event_epcosth_jpsi)/1.2; hepcosth_jpsi_mc_all->Fill(event_epcosth_jpsi); hepcosth_jpsi_mc_all_wt0->Fill(event_epcosth_jpsi, m_epcth_wt0); hepcosth_jpsi_mc_all_wt1->Fill(event_epcosth_jpsi, m_epcth_wt1); hepcosth_jpsi_vs_epthlab_mc_all->Fill(event_epcosth_jpsi, _epth_lab ); hepcosth_jpsi_vs_emthlab_mc_all->Fill(event_epcosth_jpsi, _emth_lab ); if (itu2d>=0){ hepcosth_jpsi_mc[itu2d]->Fill(event_epcosth_jpsi); hepcosth_jpsi_mc_wt0[itu2d]->Fill(event_epcosth_jpsi, m_epcth_wt0); hepcosth_jpsi_mc_wt1[itu2d]->Fill(event_epcosth_jpsi, m_epcth_wt1); hepcosth_jpsi_vs_epthlab_mc[itu2d]->Fill(event_epcosth_jpsi, _epth_lab); hepcosth_jpsi_vs_emthlab_mc[itu2d]->Fill(event_epcosth_jpsi, _emth_lab); } } } } httrumc->Fill(event_t); hutrumc->Fill(event_u); httrumc_vb->Fill(event_t); hutrumc_vb->Fill(event_u); htrupi0thcm->Fill(event_pi0costh_cm); htrupi0costhcm->Fill(event_pi0theta_cm); htrupi0thlab->Fill(event_pi0theta_lab); bool t_ok = (tmin[iplab] < event_t && event_t < tmax[iplab]); bool u_ok = (tmin[iplab] < event_u && event_u < tmax[iplab]); if (t_ok || u_ok) { htrupi0thcm_tcut->Fill(event_pi0theta_cm); htrupi0costhcm_tcut->Fill(event_pi0costh_cm); htrupi0thlab_tcut->Fill(event_pi0theta_lab); } // MC pi0 angluar distributions with jpsi mass cut on the pippim pair if (is_dpm()) { int kpip = -1, kpim=-1; for (int k=0; k<mcList.GetLength(); ++k) { if (mcList[k]->PdgCode()==211) { kpip = k; } if (mcList[k]->PdgCode()==-211) { kpim = k; } if (kpip>0&&kpim>0) { // in case of multi pip+pi- events, use the first found pi+pi- event to define mass cuts double mpippim = (mcList[kpip]->P4()+mcList[kpim]->P4()).M(); htrupi0thcm_vs_m->Fill(mpippim, event_pi0theta_cm); htrupi0costhcm_vs_m->Fill(mpippim, event_pi0costh_cm); htrupi0thlab_vs_m->Fill(mpippim, event_pi0theta_lab); if ( mpippim>jpsi_m_3sig_min && mpippim<jpsi_m_3sig_max) { htrupi0thcm_mcut->Fill(event_pi0theta_cm); htrupi0costhcm_mcut->Fill(event_pi0costh_cm); htrupi0thlab_mcut->Fill(event_pi0theta_lab); if (t_ok || u_ok) { htrupi0thcm_tcut_mcut->Fill(event_pi0theta_cm); htrupi0costhcm_tcut_mcut->Fill(event_pi0costh_cm); htrupi0thlab_tcut_mcut->Fill(event_pi0theta_lab); } htrupi0thcm_mcut_vs_m->Fill(mpippim, event_pi0theta_cm); htrupi0costhcm_mcut_vs_m->Fill(mpippim, event_pi0theta_cm); htrupi0thlab_mcut_vs_m->Fill(mpippim, event_pi0theta_lab); } break; } } } else { if (t_ok || u_ok) { htrupi0thcm_tcut_mcut->Fill(pi0theta_cm(mcList[j])); htrupi0costhcm_tcut_mcut->Fill(pi0cost_cm(mcList[j])); htrupi0thlab_tcut_mcut->Fill(mcList[j]->P4().Theta()); } } return true; } } } cout << "MCtrue Pi0 not found. Not normal This shouldn't happen" << endl; return false; } inline bool comp_dth(std::pair<pair<int,int>,double> lhs, std::pair<pair<int,int>,double> rhs) { return lhs.second<rhs.second; } void AnaTdav2::calc_evt_wt() { if (mc_type==0 /*pi0pipm*/||mc_type==2 /*pi0pi0pipm*/) { bool pip_found = false, pim_found = false; for (int j=0;j<mcList.GetLength();++j) { if (mcList[j]->PdgCode()==211&&!pip_found) { m_pip_wt = eff_weight(mcList[j]->GetMomentum()); pip_found = true; } if (mcList[j]->PdgCode()==-211&&!pim_found) { m_pim_wt = eff_weight(mcList[j]->GetMomentum()); pim_found = true; } if (pip_found&&pim_found) break; } m_evt_wt = nevt_xsect[mc_type][iplab]*m_pip_wt*m_pim_wt/nevt_sim[mc_type][iplab]; } else if (mc_type==1 /*pi0jpsi->epm*/ || mc_type==5 /*pi0jpsi_10cm*/ || mc_type==6 /*pi0jpsi_5cm*/ ){ m_evt_wt = 1.0; } else if (mc_type==4 /*pi0pi0jpsi->epm*/) { m_evt_wt = nevt_xsect[mc_type][iplab]/nevt_sim[mc_type][iplab]; } else if (mc_type==3 /*pi0pipmpippim*/) { // find the most back to back pip-pim pair to the pi0, and use that to set the event weight std::vector<TLorentzVector> p4pip, p4pim, p4pi0; for (int j=0;j<mcList.GetLength();++j) { if (mcList[j]->PdgCode()==211 && p4pip.size()<2) p4pip.push_back(mcList[j]->P4()); if (mcList[j]->PdgCode()==-211 && p4pim.size()<2) p4pim.push_back(mcList[j]->P4()); if (mcList[j]->PdgCode()==111 && p4pi0.size()<1) p4pi0.push_back(mcList[j]->P4()); if (p4pip.size()==2 && p4pim.size()==2 && p4pi0.size()==1) break; } assert(p4pip.size()==2 && p4pim.size()==2 && p4pi0.size()==1); // if not, wrong type of event std::vector<std::pair<std::pair<int,int>,double> > combs; for (int iip=0; iip<2; iip++) for (int iim=0; iim<2; iim++) combs.push_back(make_pair(make_pair(iip,iim),dth_cm(p4pi0[0],p4pip[iip]+p4pim[iim]))); sort(combs.begin(),combs.end(),comp_dth); m_pip_wt = eff_weight(p4pip[combs[0].first.first].Vect()); m_pim_wt = eff_weight(p4pim[combs[0].first.second].Vect()); m_evt_wt = nevt_xsect[mc_type][iplab]*m_pip_wt*m_pim_wt/nevt_sim[mc_type][iplab]; } else { m_evt_wt = 1.0; } hwt->Fill(m_evt_wt); } void AnaTdav2::print_mc_list() { cout << "mcList.Length() = " << mcList.GetLength() << endl; int pi0id = -1; for (int j=0;j<mcList.GetLength();++j) { RhoCandidate *mcmother = mcList[j]->TheMother(); int muid = -1; if (mcmother) muid = mcmother->GetTrackNumber(); if (muid==-1 and mcList[j]->PdgCode()==111) pi0id=j; if ( not (muid==-1 or (pi0id!=-1&&muid==pi0id)) ) continue; cout << "Track "<< mcList[j]->GetTrackNumber()<<" (PDG:"<<mcList[j]->PdgCode() <<") has mother "<<muid; if (mcList[j]->NDaughters()>0) cout <<" and daughter(s) "; for (int k=0;k<mcList[j]->NDaughters();++k) cout <<mcList[j]->Daughter(k)->GetTrackNumber()<<" "; cout<<endl; } cout <<endl; } /** * Fills reconstructed single particle lists * returns true */ void AnaTdav2::fill_lists() { //print_indices(); cleanup_lists(); mcList.Cleanup(); // *** Select with no PID info ('All'); type and mass are set fAna->FillList(mcList, "McTruth"); fAna->FillList(rcl[p], (brem_corr?"BremElectronAllPlus":"ElectronAllPlus")); fAna->FillList(rcl[e], (brem_corr?"BremElectronAllMinus":"ElectronAllMinus")); fAna->FillList(rcl[g], "Neutral"); if (is_dpm()) { // if final state is not electrons, use efficiency weight fAna->FillList(rcl[pip], "PionAllPlus"); fAna->FillList(rcl[pim], "PionAllMinus"); // all pions accepted as identified, but they will be wieghted when filling with the corresponding // product of efficiency of the two tracks fAna->FillList(rcl[ip], (brem_corr?"BremElectronAllPlus":"ElectronAllPlus")); fAna->FillList(rcl[ie], (brem_corr?"BremElectronAllMinus":"ElectronAllMinus")); //fAna->FillList(rcl[ip], (brem_corr?"BremElectronVeryTightPlus":"ElectronAllPlus"), "PidAlgoEmcBayes"); //fAna->FillList(rcl[ie], (brem_corr?"BremElectronVeryTightMinus":"ElectronAllMinus"), "PidAlgoEmcBayes"); //fAna->FillList(rcl[ip], (brem_corr?"BremElectronAllPlus":"ElectronAllPlus")); //fAna->FillList(rcl[ie], (brem_corr?"BremElectronAllMinus":"ElectronAllMinus")); //charged_pion_filter(rcl[ip], rcl[ie], rcl[pip], rcl[pim], rcl[p], rcl[e]); } else { eid_filter(rcl[ip],rcl[p]); eid_filter(rcl[ie],rcl[e]); } // If signal sim, tag tracks from true jpsi and pi0 if (mc_type==1||mc_type==4||mc_type==5) { mctruth_match_pi0(rcl[g]); mctruth_match_jpsi(rcl[e], rcl[p]); } count_ng20mev(); hng20mev_nocut->Fill(m_ng20mev); hng->Fill(rcl[g].GetLength()); hnch->Fill(rcl[e].GetLength()+rcl[p].GetLength()); } // counts the number of photons above 20MeV at any given // point in the analysis. void AnaTdav2::count_ng20mev() { m_ng20mev = 0; for (int ig=0; ig < rcl[g].GetLength(); ++ig) { if (rcl[g][ig]->Energy()>0.02) m_ng20mev++; } } bool AnaTdav2::is_dpm() { return mc_type==0||mc_type==2||mc_type==3; } bool AnaTdav2::is_evt_gen() { return mc_type==1||mc_type==4||mc_type==5||mc_type==6; } void AnaTdav2::nocut_ref() { rcl[gg].Combine(rcl[g],rcl[g]); rcl[ep].Combine(rcl[e],rcl[p]); double tmp_eid_wt = m_evt_wt*nevt_sim[mc_type][iplab]/nevt_xsect[mc_type][iplab]; if (is_dpm()) m_evt_wt = nevt_xsect[mc_type][iplab]/nevt_sim[mc_type][iplab]; fill_pair_mass(rcl[ep], hmep[0]); fill_pair_mass(rcl[gg], hmgg[0]); fill_mctruth(rcl[ep], rcl[gg], 0); fill_count_hists(gg,ep,0); if (is_dpm()) m_evt_wt *= tmp_eid_wt; rcl[iep].Combine(rcl[ie],rcl[ip]); fill_pair_mass(rcl[iep], hmep[1]); fill_pair_mass(rcl[gg], hmgg[1]); fill_mctruth(rcl[iep], rcl[gg], 1); fill_count_hists(gg,iep,1); } void AnaTdav2::missing_track_dists() { if ( rcl[e].GetLength()==0 ) { TVector3 mom3 = mcList[mc_elec]->GetMomentum(); hmiss_e_pvth_acc->Fill(mom3.Theta()*TMath::RadToDeg(), mom3.Mag()); } else if (rcl[p].GetLength()==0) { TVector3 mom3 = mcList[mc_posit]->GetMomentum(); hmiss_e_pvth_acc->Fill(mom3.Theta()*TMath::RadToDeg(), mom3.Mag()); } if ( rcl[e].GetLength() == 1 && rcl[ie].GetLength()==0 ) { TVector3 mom3 = mcList[mc_elec]->GetMomentum(); hmiss_e_pvth_eid->Fill(mom3.Theta()*TMath::RadToDeg(), mom3.Mag()); } else if ( rcl[p].GetLength()==1 && rcl[ip].GetLength()==0) { TVector3 mom3 = mcList[mc_posit]->GetMomentum(); hmiss_e_pvth_eid->Fill(mom3.Theta()*TMath::RadToDeg(), mom3.Mag()); } } /** * Makes a pid selected e-p pair list on the condition that there is * an exclusive e-p pair in a reasonable mass range, events with more than one * pair in a "reasonable" mass range are rejected. The pair found within that * mass range is selected for further analysis */ void AnaTdav2::ep_uniq() { if (rcl[iep].GetLength() == 1) { assert( rcl[ie].GetLength()<=1 and rcl[ip].GetLength()<=1 ); rcl[iep_uniq].Combine(rcl[ie],rcl[ip]); } fill_pair_mass(rcl[iep_uniq], hmep[2]); fill_pair_mass(rcl[gg], hmgg[2]); fill_mctruth(rcl[iep_uniq], rcl[gg], 2); fill_count_hists(gg,iep_uniq,2); } /** * This alternative analysis combines all reconstructed pairs and leaves * it to later stages to select the best matching pi0-jpsi pair or fill all * of them with a weight */ void AnaTdav2::ep_all() { rcl[iep_all].Combine(rcl[ie],rcl[ip]); fill_pair_mass(rcl[iep_all], hmep[2]); fill_pair_mass(rcl[gg], hmgg[2]); fill_mctruth(rcl[iep_all],rcl[gg], 2); fill_count_hists(gg,iep_all,2); } bool AnaTdav2::oa_vs_avg_cut(const double& _oa, const double &_avg){ bool acc = (_avg > (lw[iplab][2] + (lw[iplab][0]/(_oa-lw[iplab][1])))); if (_oa>up[iplab][1]) acc = acc && (_avg < (up[iplab][2] + (up[iplab][0] / (_oa-up[iplab][1])))); return acc; } /** * Makes a sublist of gg pairs that satisfies minimal pi0 selection cuts * that reduce combinatorial */ void AnaTdav2::pi0_sel() { for (int i = 0; i < rcl[gg].GetLength(); ++i) { RhoCandidate *_g1 = rcl[gg][i]->Daughter(0); RhoCandidate *_g2 = rcl[gg][i]->Daughter(1); const double _oa = oa(_g1,_g2); const double _e_avg = 0.5*(_g1->Energy()+_g2->Energy()); if (apply_pi0evsoa_cut and !oa_vs_avg_cut(_oa, _e_avg) ) continue; if (apply_pi0m_cut and (rcl[gg][i]->M() < pi0m_cut_min or rcl[gg][i]->M() > pi0m_cut_max) ) continue; rcl[gg_sel].Append(rcl[gg][i]); } fill_count_hists(gg_sel,iep_uniq,3); } /** * Looks in the event if there is an associated gg pair which * passes the pi0 selection cuts (loose cuts at this point) */ void AnaTdav2::ep_pi0_asso() { assert(rcl[iep_uniq].GetLength()<=1); for (int i = 0; i < rcl[iep_uniq].GetLength(); ++i) { if (rcl[gg_sel].GetLength()>0) { rcl[iep_asso].Append(rcl[iep]); } } fill_pair_mass(rcl[iep_asso], hmep[3]); fill_pair_mass(rcl[gg_sel], hmgg[3]); fill_mctruth(rcl[iep_asso], rcl[gg_sel], 3); fill_count_hists(gg_sel,iep_asso,4); } /** * Looks in the event if there is an associated gg pair which * passes the pi0 selection cuts (loose cuts at this point). Here * the assumption of uniquness of ep pair is not made. All possible * pairs are kept */ void AnaTdav2::ep_pi0_asso_all() { if (rcl[gg_sel].GetLength()>0) { rcl[iep_asso_all].Append(rcl[iep_all]); } fill_pair_mass(rcl[iep_asso_all], hmep[3]); fill_pair_mass(rcl[gg_sel], hmgg[3]); fill_mctruth(rcl[iep_asso_all], rcl[gg_sel], 3); fill_count_hists(gg_sel,iep_asso_all,4); } /** * After applying kinematic cuts, (dPhi, dTh and mTot), checks that there * is only one pi0 left in the event. This is to insure exclusivity. The * unique pi0 is appended to the exgg, and the e-p pair is filled to exep */ void AnaTdav2::kin_excl() { assert(rcl[iep_asso].GetLength()<=1); double _dth_dph_cm_min = 1e9; int jgg_most_btb = -1; for (int jep = 0; jep < rcl[iep_asso].GetLength(); ++jep) { int ngg_ok=0, jgg_ok; // count gg_sel's that satisfy the kinematic and exclusivity cuts for (int jgg = 0; jgg < rcl[gg_sel].GetLength(); ++jgg) { double _mtot = m(rcl[gg_sel][jgg], rcl[iep_asso][jep]); double _dth_cm=0, _dph_cm=0; dth_dph_cm(rcl[gg_sel][jgg], rcl[iep_asso][jep], _dth_cm, _dph_cm); double _dth_dph_cm = hypot((_dth_cm-TMath::Pi())/dth_sigma, (_dph_cm-TMath::Pi())/dph_sigma); if (_dth_dph_cm<_dth_dph_cm_min) { _dth_dph_cm_min = _dth_dph_cm; jgg_most_btb = jgg; } if (apply_dth_dph_cut and (_dth_dph_cm > dth_dph_cm_cut_max) ) continue; if (apply_mtot_cut and ( (_mtot < mtot_cut_min) or (_mtot > mtot_cut_max) ) ) continue; ngg_ok++; jgg_ok = jgg; } if (require_exclusivity) { if (ngg_ok==1) { rcl[iep_excl].Append(rcl[iep_asso][jep]); rcl[gg_excl].Append(rcl[gg_sel][jgg_ok]); } } else { // just pick the most back to back rcl[iep_excl].Append(rcl[iep_asso][jep]); rcl[gg_excl].Append(rcl[gg_sel][jgg_most_btb]); } } fill_dth_dph_cm(rcl[iep_excl],rcl[gg_excl], hcmoa); fill_mtot(rcl[iep_excl],rcl[gg_excl], hmtot); fill_mmiss(rcl[iep_excl],rcl[gg_excl], hmmiss, hmmiss2); fill_mmiss_jpsi(rcl[iep_excl], hmmiss_jpsi, hmmiss2_jpsi); fill_pair_mass(rcl[iep_excl], hmep[4]); fill_pair_mass(rcl[gg_excl], hmgg[4]); fill_mctruth(rcl[iep_excl], rcl[gg_excl], 4); fill_count_hists(gg_excl,iep_excl,5); } /** * Select the most back to back and the mclosest to sqrt(s) pair * Check that it passes the cut windows on dTh and mtot */ void AnaTdav2::kin_excl_all() { double _dth_dph_cm_min = 1e9; int jgg_most_btb = -1; int jep_most_btb = -1; double _dmtot_min = 1e9; int jgg_dmtot_best = -1; int jep_dmtot_best = -1; for (int jep = 0; jep < rcl[iep_asso_all].GetLength(); ++jep) { int ngg_ok=0, jgg_ok; // count gg_sel's that satisfy the kinematic and exclusivity cuts for (int jgg = 0; jgg < rcl[gg_sel].GetLength(); ++jgg) { double _mtot = m(rcl[gg_sel][jgg], rcl[iep_asso_all][jep]); double _dmtot = _mtot - p4sys.M(); double _dth_cm=0, _dph_cm=0; dth_dph_cm(rcl[gg_sel][jgg], rcl[iep_asso_all][jep], _dth_cm, _dph_cm); double _dth_dph_cm = hypot((_dth_cm-TMath::Pi())/dth_sigma, (_dph_cm-TMath::Pi())/dph_sigma); if (_dth_dph_cm<_dth_dph_cm_min) { _dth_dph_cm_min = _dth_dph_cm; jgg_most_btb = jgg; jep_most_btb = jep; } if (_dmtot<_dmtot_min) { _dmtot_min = _dmtot; jgg_dmtot_best = jgg; jep_dmtot_best = jep; } } } // if no pairs, nothing to do if (jgg_most_btb<0||jep_most_btb<0) return; hng20mev_excl->Fill(m_ng20mev); rcl[iep_excl].Append(rcl[iep_asso_all][jep_most_btb]); rcl[gg_excl].Append(rcl[gg_sel][jgg_most_btb]); double trecgg = t_gg(rcl[gg_excl][0]); double urecgg = u_gg(rcl[gg_excl][0]); double trecep = t_ep(rcl[iep_excl][0]); double urecep = u_ep(rcl[iep_excl][0]); htrecgg_excl->Fill(trecgg); hurecgg_excl->Fill(urecgg); htrecep_excl->Fill(trecep); hurecep_excl->Fill(urecep); fill_dth_dph_cm(rcl[iep_excl],rcl[gg_excl], hcmoa); fill_mtot(rcl[iep_excl],rcl[gg_excl], hmtot); fill_mmiss(rcl[iep_excl],rcl[gg_excl], hmmiss, hmmiss2); fill_mmiss_jpsi(rcl[iep_excl], hmmiss_jpsi, hmmiss2_jpsi); fill_pair_mass(rcl[iep_excl], hmep[4]); fill_pair_mass(rcl[gg_excl], hmgg[4]); fill_mctruth(rcl[iep_excl], rcl[gg_excl], 4); fill_count_hists(gg_excl,iep_excl,5); } void AnaTdav2::kin_fit() { assert(rcl[iep_excl].GetLength()<=1 and rcl[gg_excl].GetLength()<=1); if (rcl[iep_excl].GetLength()==1 and rcl[gg_excl].GetLength()==1) { PndKinFitter fitter(rcl[iep_excl][0]); fitter.AddMassConstraint(3.096); fitter.Fit(); hmep_mconst->Fill(rcl[iep_excl][0]->GetFit()->M()); double _mtot = (rcl[iep_excl][0]->GetFit()->P4()+rcl[gg_excl][0]->P4()).M(); hmtot_mconst->Fill( _mtot); double _dph, _dth; dth_dph_cm(rcl[gg_excl][0],rcl[iep_excl][0],_dth,_dph); hcmoa_mconst->Fill(_dth,_dph); if (fabs(_dth-TMath::Pi())<TMath::Pi()*20./180.) { fill_pair_mass(rcl[iep_excl], hmep[5]); fill_pair_mass(rcl[gg_excl], hmgg[5]); fill_mctruth(rcl[iep_excl], rcl[gg_excl], 5); hmtot_mconst_cut->Fill(_mtot); hcmoa_mconst_cut->Fill(_dth,_dph); } } } double AnaTdav2::err_mom_sq(RhoCandidate *rr) { TLorentzVector prec = rr->P4(); RhoError err = rr->P4Err(); double err_mom_fc_sq = prec.X()*prec.X()*err[0][0] + prec.Y()*prec.Y()*err[1][1] + prec.Z()*prec.Z()*err[2][2] + 2*prec.X()*prec.Y()*err[0][1] + 2*prec.X()*prec.Z()*err[0][2] + 2*prec.Y()*prec.Z()*err[1][2]; return err_mom_fc_sq/prec.Vect().Mag2(); } double AnaTdav2::mom_pull_r(RhoCandidate* rf, RhoCandidate *mc) { return (rf->P4().Vect().Mag()-mc->P4().Vect().Mag())/sqrt(err_mom_sq(rf)); } double AnaTdav2::mom_pull_f(RhoCandidate* rf, RhoCandidate *mc) { return (rf->GetFit()->P4().Vect().Mag()-mc->P4().Vect().Mag())/sqrt(err_mom_sq(rf)); } double AnaTdav2::px_pull_r(RhoCandidate* rf, RhoCandidate *mc) { return (rf->P4().X()-mc->P4().X())/sqrt(rf->P4Err()[0][0]); } double AnaTdav2::px_pull_f(RhoCandidate* rf, RhoCandidate *mc) { return (rf->GetFit()->P4().X()-mc->P4().X())/sqrt(rf->P4Err()[0][0]); } double AnaTdav2::py_pull_r(RhoCandidate* rf, RhoCandidate *mc) { return (rf->P4().Y()-mc->P4().Y())/sqrt(rf->P4Err()[1][1]); } double AnaTdav2::py_pull_f(RhoCandidate* rf, RhoCandidate *mc) { return (rf->GetFit()->P4().Y()-mc->P4().Y())/sqrt(rf->P4Err()[1][1]); } double AnaTdav2::pz_pull_r(RhoCandidate* rf, RhoCandidate *mc) { return (rf->P4().Z()-mc->P4().Z())/sqrt(rf->P4Err()[2][2]); } double AnaTdav2::pz_pull_f(RhoCandidate* rf, RhoCandidate *mc) { return (rf->GetFit()->P4().Z()-mc->P4().Z())/sqrt(rf->P4Err()[2][2]); } void AnaTdav2::kin_fit_4c() { assert(rcl[iep_excl].GetLength()<=1 and rcl[gg_excl].GetLength()<=1); if (rcl[iep_excl].GetLength()==1 and rcl[gg_excl].GetLength()==1) { RhoCandList pi0jpsi; pi0jpsi.Combine(rcl[iep_excl],rcl[gg_excl]); PndKinFitter fitter(pi0jpsi[0]); fitter.Add4MomConstraint(p4sys); fitter.Fit(); double sig_chi2_4c = fitter.GetChi2(); // get chi2 of fit double sig_prob_4c = fitter.GetProb(); // access probability of fit double sig_pull_4c = fitter.GetPull(); // pull ? double sig_chi2diff4c = fitter.Chi2Diff(); // chi2diff ? //int ndf_4c = fitter.GetNdf(); //cout << "sig_chi2_4c/NDF = " << sig_chi2_4c << "/" << ndf_4c << " sig_prob_4c = " << sig_prob_4c << endl; hpi0jpsi_chi24c->Fill(sig_chi2_4c); hpi0jpsi_chi24c_c->Fill(sig_chi2_4c); hpi0jpsi_prob4c->Fill(sig_prob_4c); hpi0jpsi_pull4c->Fill(sig_pull_4c); hpi0jpsi_chi2diff4c->Fill(sig_chi2diff4c); // Fill correlation histograms between chi2 of 4c and Mtot, cm opening angle double raw_mtot = (rcl[iep_excl][0]->P4()+rcl[gg_excl][0]->P4()).M(); double fit_mtot = (rcl[iep_excl][0]->GetFit()->P4()+rcl[gg_excl][0]->GetFit()->P4()).M(); double fit_mtot2 = pi0jpsi[0]->GetFit()->P4().M(); double raw_cm_dph, raw_cm_dth; double fit_cm_dph, fit_cm_dth; dth_dph_cm(rcl[gg_excl][0],rcl[iep_excl][0],raw_cm_dth,raw_cm_dph); dth_dph_cm(rcl[gg_excl][0]->GetFit(),rcl[iep_excl][0]->GetFit(),fit_cm_dth,fit_cm_dph); hpi0jpsi_chi24c_vs_mtot_r->Fill(sig_chi2_4c,raw_mtot); hpi0jpsi_chi24c_vs_cm_dth_r->Fill(sig_chi2_4c,raw_cm_dth); hpi0jpsi_chi24c_vs_cm_dph_r->Fill(sig_chi2_4c,raw_cm_dph); hpi0jpsi_chi24c_vs_mtot_f->Fill(sig_chi2_4c,fit_mtot); hpi0jpsi_chi24c_vs_cm_dth_f->Fill(sig_chi2_4c,fit_cm_dth); hpi0jpsi_chi24c_vs_cm_dph_f->Fill(sig_chi2_4c,fit_cm_dph); int idp_r = rcl[iep_excl][0]->Daughter(0)->Charge()>0?0:1; int idm_r = rcl[iep_excl][0]->Daughter(0)->Charge()<0?0:1; assert(idp_r!=idm_r); int id_jpsi = (pi0jpsi[0]->Daughter(0)->Daughter(0)->PdgCode()!=22) ? 0:1; int idp_f = pi0jpsi[0]->Daughter(id_jpsi)->Daughter(0)->Charge()>0?0:1; int idm_f = pi0jpsi[0]->Daughter(id_jpsi)->Daughter(0)->Charge()<0?0:1; assert(idp_f!=idm_f); hmom_pull_ep_r->Fill(mom_pull_r(rcl[iep_excl][0]->Daughter(idp_r),mcList[mc_posit])); hmom_pull_ep_f->Fill(mom_pull_f(rcl[iep_excl][0]->Daughter(idp_r),mcList[mc_posit])); hmom_pull_em_r->Fill(mom_pull_r(rcl[iep_excl][0]->Daughter(idm_r),mcList[mc_elec])); hmom_pull_em_f->Fill(mom_pull_f(rcl[iep_excl][0]->Daughter(idm_r),mcList[mc_elec])); hpx_pull_ep_r->Fill(px_pull_r(rcl[iep_excl][0]->Daughter(idp_r),mcList[mc_posit])); hpx_pull_ep_f->Fill(px_pull_f(rcl[iep_excl][0]->Daughter(idp_r),mcList[mc_posit])); hpx_pull_em_r->Fill(px_pull_r(rcl[iep_excl][0]->Daughter(idm_r),mcList[mc_elec])); hpx_pull_em_f->Fill(px_pull_f(rcl[iep_excl][0]->Daughter(idm_r),mcList[mc_elec])); hpy_pull_ep_r->Fill(py_pull_r(rcl[iep_excl][0]->Daughter(idp_r),mcList[mc_posit])); hpy_pull_ep_f->Fill(py_pull_f(rcl[iep_excl][0]->Daughter(idp_r),mcList[mc_posit])); hpy_pull_em_r->Fill(py_pull_r(rcl[iep_excl][0]->Daughter(idm_r),mcList[mc_elec])); hpy_pull_em_f->Fill(py_pull_f(rcl[iep_excl][0]->Daughter(idm_r),mcList[mc_elec])); hpz_pull_ep_r->Fill(pz_pull_r(rcl[iep_excl][0]->Daughter(idp_r),mcList[mc_posit])); hpz_pull_ep_f->Fill(pz_pull_f(rcl[iep_excl][0]->Daughter(idp_r),mcList[mc_posit])); hpz_pull_em_r->Fill(pz_pull_r(rcl[iep_excl][0]->Daughter(idm_r),mcList[mc_elec])); hpz_pull_em_f->Fill(pz_pull_f(rcl[iep_excl][0]->Daughter(idm_r),mcList[mc_elec])); double _t_gg = t_gg(rcl[gg_excl][0]); double _u_gg = u_gg(rcl[gg_excl][0]); bool t_ok = (tmin[iplab] < _t_gg && _t_gg < tmax[iplab]); bool u_ok = (tmin[iplab] < _u_gg && _u_gg < tmax[iplab]); bool _valid = t_ok || u_ok; fill_pair_mass(rcl[iep_excl], hmep[5]); fill_pair_mass(rcl[gg_excl], hmgg[5]); if (_valid) fill_pair_mass(rcl[iep_excl], hmep_valid[5]); if (_valid) fill_pair_mass(rcl[gg_excl], hmgg_valid[5]); fill_mctruth(rcl[iep_excl], rcl[gg_excl], 5); // loop over all gg pair candiates, and check if there is // a pair that has gives better pi0pi0jpsi than the pi0jpsi hypthesis RhoCandList pi0pi0jpsi; RhoCandList gg_mcut; // First narrow down the pi0 candiate list using just mass cut (no Energy vs OA cut) // for better acceptance of multi pi0 background events for (int igg=0; igg<rcl[gg].GetLength(); ++igg) { if (rcl[gg][igg] == rcl[gg_excl][0]) continue; if (0.1 < rcl[gg][igg]->M() && rcl[gg][igg]->M() < 0.17) gg_mcut.Append(rcl[gg][igg]); } pi0pi0jpsi.Combine(pi0jpsi,gg_mcut); double bg_chi2_4c = 1e9; bool xtra_pi0_found = false; for (int ibg=0; ibg<pi0pi0jpsi.GetLength(); ++ibg) { PndKinFitter bg_fitter(pi0pi0jpsi[ibg]); bg_fitter.Add4MomConstraint(p4sys); bg_fitter.Fit(); if ( bg_fitter.GetChi2() < bg_chi2_4c) { bg_chi2_4c = bg_fitter.GetChi2(); xtra_pi0_found = true; } } if (xtra_pi0_found) { hpi0pi0jpsi_chi24c->Fill(bg_chi2_4c); hpi0pi0jpsi_chi24c_c->Fill(bg_chi2_4c); hpi0vs2pi0_chi24c->Fill(sig_chi2_4c, bg_chi2_4c); hpi0vs2pi0_chi24c_c->Fill(sig_chi2_4c, bg_chi2_4c); } // if bg_chi2_4c = 1e9 at this point, it means there was no other pi0 // candidate to test bg hypthesis. This automatically qualifies the event // as signal if chi2 passes the chi2 cut. If bg_chi2_4c < 1e9, then it means // another pi0 in the event was xtra_pi0_found, in this case, reject the event if the // chi2 of multi pi0 background hypothesis is better than signal hypothesis if (sig_chi2_4c<chi2_cut[iplab]) { rcl[iep_kinc].Append(rcl[iep_excl][0]); rcl[gg_kinc].Append(rcl[gg_excl][0]); fill_pair_mass(rcl[iep_excl], hmep[6]); fill_pair_mass(rcl[gg_excl], hmgg[6]); if (_valid) fill_pair_mass(rcl[iep_excl], hmep_valid[6]); if (_valid) fill_pair_mass(rcl[gg_excl], hmgg_valid[6]); fill_mctruth(rcl[iep_excl], rcl[gg_excl], 6); hng20mev_chi2sig->Fill(m_ng20mev); if (!xtra_pi0_found || (xtra_pi0_found && bg_chi2_4c > sig_chi2_4c)) { rcl[iep_kinc_bg].Append(rcl[iep_excl][0]); rcl[gg_kinc_bg].Append(rcl[gg_excl][0]); fill_pair_mass(rcl[iep_excl], hmep[7]); fill_pair_mass(rcl[gg_excl], hmgg[7]); if (_valid) fill_pair_mass(rcl[iep_excl], hmep_valid[7]); if (_valid) fill_pair_mass(rcl[gg_excl], hmgg_valid[7]); fill_mctruth(rcl[iep_excl], rcl[gg_excl], 7); hng20mev_chi2bg->Fill(m_ng20mev); if (m_ng20mev<4) { rcl[iep_ngcut].Append(rcl[iep_excl][0]); rcl[gg_ngcut].Append(rcl[gg_excl][0]); fill_pair_mass(rcl[iep_excl], hmep[8]); fill_pair_mass(rcl[gg_excl], hmgg[8]); if (_valid) fill_pair_mass(rcl[iep_excl], hmep_valid[8]); if (_valid) fill_pair_mass(rcl[gg_excl], hmgg_valid[8]); fill_mctruth(rcl[iep_excl], rcl[gg_excl], 8); hng20mev_kinall->Fill(m_ng20mev); } } } //// Put everything in //if (m_ng20mev<3) { // rcl[iep_ngcut].Append(rcl[iep_excl][0]); // rcl[gg_ngcut].Append(rcl[gg_excl][0]); // fill_pair_mass(rcl[iep_excl], hmep[6]); // if (sig_chi2_4c<chi2_cut[iplab]) { // rcl[iep_kinc].Append(rcl[iep_excl][0]); // rcl[gg_kinc].Append(rcl[gg_excl][0]); // fill_pair_mass(rcl[iep_excl], hmep[7]); // } //} } } double AnaTdav2::pi0cost_cm(RhoCandidate* pi0) { TLorentzVector p4gg(pi0->P4()); p4gg.Boost(boost_to_cm); return p4gg.CosTheta(); } double AnaTdav2::pi0theta_cm(RhoCandidate* pi0) { TLorentzVector p4gg(pi0->P4()); p4gg.Boost(boost_to_cm); return p4gg.Theta(); } int AnaTdav2::find_bin(double val, const vector<double> &binning) { for (int ii = 0; ii < binning.size()-1; ++ii) { if (binning[ii] < val and val < binning[ii+1]) { return ii; } } return -1; // Crash } void AnaTdav2::fill_bins_kinc() { fill_bins(rcl[iep_kinc], rcl[gg_kinc]); } void AnaTdav2::fill_bins_kinc_bg() { fill_bins(rcl[iep_kinc_bg], rcl[gg_kinc_bg]); } void AnaTdav2::fill_bins_ngcut() { fill_bins(rcl[iep_ngcut], rcl[gg_ngcut]); } void AnaTdav2::fill_bins_excl() { fill_bins(rcl[iep_excl], rcl[gg_excl]); } TLorentzVector AnaTdav2::boost_transf(const TLorentzVector& vect_in, const TVector3& boost) { TLorentzVector vect_out(vect_in); vect_out.Boost(boost); return vect_out; } double AnaTdav2::cost_b(const TLorentzVector& v, const TVector3& boost) { return boost_transf(v,boost).CosTheta(); } double AnaTdav2::the_b(const TLorentzVector& v, const TVector3& boost) { return TMath::RadToDeg()*(boost_transf(v,boost).Vect().Theta()); } TLorentzVector AnaTdav2::get_p4ep(RhoCandidate* _epem) { return _epem->Daughter(0)->Charge()>0? _epem->Daughter(0)->P4(): _epem->Daughter(1)->P4(); } TLorentzVector AnaTdav2::get_p4em(RhoCandidate* _epem) { return _epem->Daughter(0)->Charge()<0? _epem->Daughter(0)->P4(): _epem->Daughter(1)->P4(); } int AnaTdav2::comb_bins(int nx, int ix, int iy) { return iy*nx + ix; } void AnaTdav2::fill_bins(RhoCandList& rclep, RhoCandList& rclgg) { assert(rclep.GetLength()<=1 and rclgg.GetLength()<=1); if (rclep.GetLength()==1 and rclgg.GetLength()==1) { double trecgg = t_gg(rclgg[0]); double urecgg = u_gg(rclgg[0]); double trecep = t_ep(rclep[0]); double urecep = u_ep(rclep[0]); double pi0cost_cm_rec = pi0cost_cm(rclgg[0]); double pi0theta_rec = rclgg[0]->P4().Theta(); hpi0th->Fill(pi0theta_rec); hpi0cost_cm->Fill(pi0cost_cm_rec); htrecgg->Fill(trecgg); hurecgg->Fill(urecgg); htrecep->Fill(trecep); hurecep->Fill(urecep); if (rclep[0]->M()>jpsi_m_3sig_min&&rclep[0]->M()<jpsi_m_3sig_max) { htrecgg_mcut->Fill(trecgg); hurecgg_mcut->Fill(urecgg); htrecep_mcut->Fill(trecep); hurecep_mcut->Fill(urecep); hpi0th_mcut->Fill(pi0theta_rec); hpi0cost_cm_mcut->Fill(pi0cost_cm_rec); } if (event_pi0costh_cm>0) { htresgg->Fill(trecgg-event_t); htresep->Fill(trecep-event_t); } else { huresgg->Fill(urecgg-event_u); huresep->Fill(urecep-event_u); } int itbin = find_bin(trecgg,tu_binning); int iubin = find_bin(urecgg,tu_binning); if (itbin>=0)fill_pair_mass(rclep, hmept[itbin]); if (iubin>=0)fill_pair_mass(rclep, hmepu[iubin]); int ibin_pi0th = find_bin(pi0theta_rec,pi0th_binning); int ibin_pi0cost_cm = find_bin(pi0cost_cm_rec,pi0cost_cm_binning); fill_pair_mass(rclep, hmep_pi0th[ibin_pi0th]); fill_pair_mass(rclep, hmep_pi0cost_cm[ibin_pi0cost_cm]); /// below the positron angle dependnt stuff double epcosth_jpsi_rec = cost_b(get_p4ep(rclep[0]), -rclep[0]->P4().BoostVector()); hepcosth_res->Fill(epcosth_jpsi_rec-event_epcosth_jpsi); int itbin_2d = find_bin(trecgg, tu_binning_2d); int iubin_2d = find_bin(urecgg, tu_binning_2d); int ibin_costh_2d = find_bin(epcosth_jpsi_rec, costh_binning_2d); int itu2d = itbin_2d>=0?itbin_2d:(iubin_2d>=0?2+iubin_2d:-1); if (itbin_2d>=0&&ibin_costh_2d>=0) fill_pair_mass(rclep, hmeptcth[comb_bins(tu_binning_2d.size()-1,itbin_2d,ibin_costh_2d)]); if (iubin_2d>=0&&ibin_costh_2d>=0) fill_pair_mass(rclep, hmepucth[comb_bins(tu_binning_2d.size()-1,iubin_2d,ibin_costh_2d)]); if (itbin_2d>=0&&ibin_costh_2d>=0) fill_pair_mass(rclep, hmeptcth0[comb_bins(tu_binning_2d.size()-1,itbin_2d,ibin_costh_2d)], m_epcth_wt0); if (iubin_2d>=0&&ibin_costh_2d>=0) fill_pair_mass(rclep, hmepucth0[comb_bins(tu_binning_2d.size()-1,iubin_2d,ibin_costh_2d)], m_epcth_wt0); if (itbin_2d>=0&&ibin_costh_2d>=0) fill_pair_mass(rclep, hmeptcth1[comb_bins(tu_binning_2d.size()-1,itbin_2d,ibin_costh_2d)], m_epcth_wt1); if (iubin_2d>=0&&ibin_costh_2d>=0) fill_pair_mass(rclep, hmepucth1[comb_bins(tu_binning_2d.size()-1,iubin_2d,ibin_costh_2d)], m_epcth_wt1); double ep_the_lab = get_p4ep(rclep[0]).Vect().Theta(); double em_the_lab = get_p4em(rclep[0]).Vect().Theta(); hepcosth_jpsi_rec_all->Fill(epcosth_jpsi_rec); hepcosth_jpsi_rec_all_wt0->Fill(epcosth_jpsi_rec,m_epcth_wt0); hepcosth_jpsi_rec_all_wt1->Fill(epcosth_jpsi_rec,m_epcth_wt1); hepcosth_jpsi_vs_epthlab_rec_all->Fill(epcosth_jpsi_rec,TMath::RadToDeg()*ep_the_lab); hepcosth_jpsi_vs_emthlab_rec_all->Fill(epcosth_jpsi_rec,TMath::RadToDeg()*em_the_lab); if (itu2d>=0){ hepcosth_jpsi_rec[itu2d]->Fill(epcosth_jpsi_rec); hepcosth_jpsi_rec_wt0[itu2d]->Fill(epcosth_jpsi_rec,m_epcth_wt0); hepcosth_jpsi_rec_wt1[itu2d]->Fill(epcosth_jpsi_rec,m_epcth_wt1); hepcosth_jpsi_vs_epthlab_rec[itu2d]->Fill(epcosth_jpsi_rec,TMath::RadToDeg()*ep_the_lab); hepcosth_jpsi_vs_emthlab_rec[itu2d]->Fill(epcosth_jpsi_rec,TMath::RadToDeg()*em_the_lab); } // This is a bit crazy but replicate the analysis with fitted pi0 mom instead of reco jpsi mom to boost e+ angle //TLorentzVector _p4piz = -rclgg[0]->GetFit()->P4(); TLorentzVector _p4jpsi = rcl[iep_excl][0]->GetFit()->P4(); //double f_epcosth_jpsi_rec = cost_b(get_p4ep(rclep[0]), -_p4jpsi.BoostVector()); double f_epcosth_jpsi_rec = cost_b(get_p4ep(rcl[iep_excl][0]->GetFit()), -_p4jpsi.BoostVector()); f_hepcosth_res->Fill(f_epcosth_jpsi_rec-event_epcosth_jpsi); int f_ibin_costh_2d = find_bin(f_epcosth_jpsi_rec, costh_binning_2d); if (itbin_2d>=0&&f_ibin_costh_2d>=0) fill_pair_mass(rclep, f_hmeptcth[comb_bins(tu_binning_2d.size()-1,itbin_2d,f_ibin_costh_2d)]); if (iubin_2d>=0&&f_ibin_costh_2d>=0) fill_pair_mass(rclep, f_hmepucth[comb_bins(tu_binning_2d.size()-1,iubin_2d,f_ibin_costh_2d)]); if (itbin_2d>=0&&f_ibin_costh_2d>=0) fill_pair_mass(rclep, f_hmeptcth0[comb_bins(tu_binning_2d.size()-1,itbin_2d,f_ibin_costh_2d)], m_epcth_wt0); if (iubin_2d>=0&&f_ibin_costh_2d>=0) fill_pair_mass(rclep, f_hmepucth0[comb_bins(tu_binning_2d.size()-1,iubin_2d,f_ibin_costh_2d)], m_epcth_wt0); if (itbin_2d>=0&&f_ibin_costh_2d>=0) fill_pair_mass(rclep, f_hmeptcth1[comb_bins(tu_binning_2d.size()-1,itbin_2d,f_ibin_costh_2d)], m_epcth_wt1); if (iubin_2d>=0&&f_ibin_costh_2d>=0) fill_pair_mass(rclep, f_hmepucth1[comb_bins(tu_binning_2d.size()-1,iubin_2d,f_ibin_costh_2d)], m_epcth_wt1); //double ep_the_lab = get_p4ep(rclep[0]).Vect().Theta(); //double em_the_lab = get_p4em(rclep[0]).Vect().Theta(); f_hepcosth_jpsi_rec_all->Fill(f_epcosth_jpsi_rec); f_hepcosth_jpsi_rec_all_wt0->Fill(f_epcosth_jpsi_rec,m_epcth_wt0); f_hepcosth_jpsi_rec_all_wt1->Fill(f_epcosth_jpsi_rec,m_epcth_wt1); f_hepcosth_jpsi_vs_epthlab_rec_all->Fill(f_epcosth_jpsi_rec,TMath::RadToDeg()*ep_the_lab); f_hepcosth_jpsi_vs_emthlab_rec_all->Fill(f_epcosth_jpsi_rec,TMath::RadToDeg()*em_the_lab); if (itu2d>=0){ f_hepcosth_jpsi_rec[itu2d]->Fill(f_epcosth_jpsi_rec); f_hepcosth_jpsi_rec_wt0[itu2d]->Fill(f_epcosth_jpsi_rec,m_epcth_wt0); f_hepcosth_jpsi_rec_wt1[itu2d]->Fill(f_epcosth_jpsi_rec,m_epcth_wt1); f_hepcosth_jpsi_vs_epthlab_rec[itu2d]->Fill(f_epcosth_jpsi_rec,TMath::RadToDeg()*ep_the_lab); f_hepcosth_jpsi_vs_emthlab_rec[itu2d]->Fill(f_epcosth_jpsi_rec,TMath::RadToDeg()*em_the_lab); } } } void AnaTdav2::Exec(Option_t* opt) { if (verb>1 or nevt%100==0) cout << "======== AnaTdav2::Exec evt " << nevt << " ======== " << endl; fAna->GetEvent(); nevt++; fill_lists(); hnevt->Fill(0); if (!calc_true_tu()) return; hnevt->Fill(1); // calc_true_tu(); calc_evt_wt(); nocut_ref(); missing_track_dists(); bool old = false; if (old) { ep_uniq(); pi0_sel(); ep_pi0_asso(); kin_excl(); kin_fit(); fill_bins_excl(); } else { ep_all(); pi0_sel(); ep_pi0_asso_all(); kin_excl_all(); kin_fit_4c(); //fill_bins_kinc_bg(); fill_bins_ngcut(); //fill_bins_kinc(); } } void AnaTdav2::FinishTask() { cout << "AnaTdav2::FinishTask" << endl; cout << "Total #Evt= " << nevt << endl; fAna->Reset(); write_hists(); } void AnaTdav2::write_hists() { const char *root_dir = gDirectory->GetPath(); TVectorD v(tu_binning.size()); for (int ib=0; ib < tu_binning.size(); ++ib) { v[ib] = tu_binning[ib]; } v.Write("tu_binning"); TVectorD vv(tu_binning.size()); for (int ib=0; ib < tu_binning.size(); ++ib) { vv[ib] = pi0th_binning[ib]; } vv.Write("pi0th_binning"); TVectorD vvv(tu_binning.size()); for (int ib=0; ib < tu_binning.size(); ++ib) { vvv[ib] = pi0cost_cm_binning[ib]; } vvv.Write("pi0cost_cm_binning"); hnevt->Write(); hwt->Write(); pi_eff->Write(); heff_epm->Write(); hmiss_e_pvth_acc->Write(); hmiss_p_pvth_acc->Write(); hmiss_e_pvth_eid->Write(); hmiss_p_pvth_eid->Write(); for (int is = 0; is< nstep; ++is) { hmep[is]->Write(); hmgg[is]->Write(); hmep_valid[is]->Write(); hmgg_valid[is]->Write(); hnep[is]->Write(); hngg[is]->Write(); hnpi0jpsi[is]->Write(); } hmtot->Write(); hmmiss->Write(); hmmiss2->Write(); hcmoa->Write(); hmep_mconst->Write(); hmtot_mconst->Write(); hcmoa_mconst->Write(); hmtot_mconst_cut->Write(); hcmoa_mconst_cut->Write(); hpi0jpsi_chi24c->Write(); hpi0jpsi_chi24c_c->Write(); hpi0jpsi_prob4c->Write(); hpi0jpsi_pull4c->Write(); hpi0jpsi_chi2diff4c->Write(); hpi0jpsi_chi24c_vs_mtot_r->Write(); hpi0jpsi_chi24c_vs_cm_dth_r->Write(); hpi0jpsi_chi24c_vs_cm_dph_r->Write(); hpi0jpsi_chi24c_vs_mtot_f->Write(); hpi0jpsi_chi24c_vs_cm_dth_f->Write(); hpi0jpsi_chi24c_vs_cm_dph_f->Write(); hpi0pi0jpsi_chi24c->Write(); hpi0pi0jpsi_chi24c_c->Write(); hpi0vs2pi0_chi24c->Write(); hpi0vs2pi0_chi24c_c->Write(); hng->Write(); hng20mev_nocut->Write(); hng20mev_excl->Write(); hng20mev_chi2sig->Write(); hng20mev_chi2bg->Write(); hng20mev_kinall->Write(); hnch->Write(); gDirectory->mkdir("epeff"); gDirectory->cd("epeff"); hepcosth_res->Write(); f_hepcosth_res->Write(); hepcosth_jpsi_mc_all->Write(); hepcosth_jpsi_mc_all_wt0->Write(); hepcosth_jpsi_mc_all_wt1->Write(); hepcosth_jpsi_vs_epthlab_mc_all->Write(); hepcosth_jpsi_vs_emthlab_mc_all->Write(); hepcosth_jpsi_rec_all->Write(); hepcosth_jpsi_rec_all_wt0->Write(); hepcosth_jpsi_rec_all_wt1->Write(); hepcosth_jpsi_vs_epthlab_rec_all->Write(); hepcosth_jpsi_vs_emthlab_rec_all->Write(); f_hepcosth_jpsi_rec_all->Write(); f_hepcosth_jpsi_rec_all_wt0->Write(); f_hepcosth_jpsi_rec_all_wt1->Write(); f_hepcosth_jpsi_vs_epthlab_rec_all->Write(); f_hepcosth_jpsi_vs_emthlab_rec_all->Write(); for (int ii=0; ii < 4; ++ii) { hepcosth_jpsi_rec[ii]->Write(); hepcosth_jpsi_rec_wt0[ii]->Write(); hepcosth_jpsi_rec_wt1[ii]->Write(); hepcosth_jpsi_vs_epthlab_rec[ii]->Write(); hepcosth_jpsi_vs_emthlab_rec[ii]->Write(); f_hepcosth_jpsi_rec[ii]->Write(); f_hepcosth_jpsi_rec_wt0[ii]->Write(); f_hepcosth_jpsi_rec_wt1[ii]->Write(); f_hepcosth_jpsi_vs_epthlab_rec[ii]->Write(); f_hepcosth_jpsi_vs_emthlab_rec[ii]->Write(); hepcosth_jpsi_mc[ii]->Write(); hepcosth_jpsi_mc_wt0[ii]->Write(); hepcosth_jpsi_mc_wt1[ii]->Write(); hepcosth_jpsi_vs_epthlab_mc[ii]->Write(); hepcosth_jpsi_vs_emthlab_mc[ii]->Write(); } gDirectory->cd(root_dir); gDirectory->mkdir("tcosthbins"); gDirectory->cd("tcosthbins"); for (int ib=0; ib < hmeptcth.size(); ++ib) { hmeptcth[ib]->Write(); hmeptcth0[ib]->Write(); hmeptcth1[ib]->Write(); f_hmeptcth[ib]->Write(); f_hmeptcth0[ib]->Write(); f_hmeptcth1[ib]->Write(); } gDirectory->cd(root_dir); gDirectory->mkdir("ucosthbins"); gDirectory->cd("ucosthbins"); for (int ib=0; ib < hmepucth.size(); ++ib) { hmepucth[ib]->Write(); hmepucth0[ib]->Write(); hmepucth1[ib]->Write(); f_hmepucth[ib]->Write(); f_hmepucth0[ib]->Write(); f_hmepucth1[ib]->Write(); } gDirectory->cd(root_dir); gDirectory->mkdir("pi0cost_cm_bins"); gDirectory->cd("pi0cost_cm_bins"); hpi0cost_cm->Write(); hpi0cost_cm_mcut->Write(); for (int ib=0; ib<tu_binning.size()-1; ++ib) { hmep_pi0cost_cm[ib]->Write(); } gDirectory->cd(root_dir); gDirectory->mkdir("pi0th_bins"); gDirectory->cd("pi0th_bins"); hpi0th->Write(); hpi0th_mcut->Write(); for (int ib=0; ib<tu_binning.size()-1; ++ib) { hmep_pi0th[ib]->Write(); } gDirectory->cd(root_dir); gDirectory->mkdir("tu_bins"); gDirectory->cd("tu_bins"); hpi0th->Write(); for (int ib=0; ib<tu_binning.size()-1; ++ib) { hmept[ib]->Write(); hmepu[ib]->Write(); } gDirectory->cd(root_dir); gDirectory->mkdir("mct"); gDirectory->cd("mct"); for (int is=0; is < nstep; ++is) { hmep_mct[is]->Write(); hmep_non_mct[is]->Write(); hthe_ep_mct[is]->Write(); hthe_ep_mct_fwd[is]->Write(); hthe_ep_mct_bwd[is]->Write(); hmgg_mct[is]->Write(); hmgg_non_mct[is]->Write(); hthe_gg_mct[is]->Write(); hthe_gg_mct_fwd[is]->Write(); hthe_gg_mct_bwd[is]->Write(); hoa_gg_mct[is]->Write(); } gDirectory->cd(root_dir); gDirectory->mkdir("tu"); gDirectory->cd("tu"); htrecgg->Write(); hurecgg->Write(); htrecep->Write(); hurecep->Write(); htrecgg_excl->Write(); hurecgg_excl->Write(); htrecep_excl->Write(); hurecep_excl->Write(); httrumc->Write(); hutrumc->Write(); htrecgg_mcut->Write(); hurecgg_mcut->Write(); htrecep_mcut->Write(); hurecep_mcut->Write(); httrumc_vb->Write(); hutrumc_vb->Write(); htresgg->Write(); huresgg->Write(); htresep->Write(); huresep->Write(); htrupi0thcm->Write(); htrupi0costhcm->Write(); htrupi0thlab->Write(); htrupi0thcm_mcut->Write(); htrupi0costhcm_mcut->Write(); htrupi0thlab_mcut->Write(); htrupi0thcm_tcut->Write(); htrupi0costhcm_tcut->Write(); htrupi0thlab_tcut->Write(); htrupi0thcm_tcut_mcut->Write(); htrupi0costhcm_tcut_mcut->Write(); htrupi0thlab_tcut_mcut->Write(); htrupi0thcm_vs_m->Write(); htrupi0costhcm_vs_m->Write(); htrupi0thlab_vs_m->Write(); htrupi0thcm_mcut_vs_m->Write(); htrupi0costhcm_mcut_vs_m->Write(); htrupi0thlab_mcut_vs_m->Write(); gDirectory->cd(root_dir); gDirectory->mkdir("pull"); gDirectory->cd("pull"); hmom_pull_ep_r->Write(); hmom_pull_ep_f->Write(); hmom_pull_em_r->Write(); hmom_pull_em_f->Write(); hpx_pull_ep_r->Write(); hpx_pull_ep_f->Write(); hpx_pull_em_r->Write(); hpx_pull_em_f->Write(); hpy_pull_ep_r->Write(); hpy_pull_ep_f->Write(); hpy_pull_em_r->Write(); hpy_pull_em_f->Write(); hpz_pull_ep_r->Write(); hpz_pull_ep_f->Write(); hpz_pull_em_r->Write(); hpz_pull_em_f->Write(); gDirectory->cd(root_dir); } double AnaTdav2::dph_cm(TLorentzVector p4gg, TLorentzVector p4pm) { double retval = 0, dummy = 0; dth_dph_cm(p4gg,p4pm,dummy,retval); return retval; } double AnaTdav2::dth_cm(TLorentzVector p4gg, TLorentzVector p4pm) { double retval = 0, dummy = 0; dth_dph_cm(p4gg,p4pm,retval,dummy); return retval; } // We want to copy TLVs here before applying boost to CM. Thta way the original vector is preserved in // case it is needed in calling function for further processing void AnaTdav2::dth_dph_cm(TLorentzVector p4gg, TLorentzVector p4pm, double &_dth, double &_dph) { p4gg.Boost(boost_to_cm); p4pm.Boost(boost_to_cm); _dth = fabs(p4gg.Vect().Theta() + p4pm.Vect().Theta()); _dph = p4gg.Vect().Phi() - p4pm.Vect().Phi(); if (_dph<0) _dph *= -1; } void AnaTdav2::dth_dph_cm(RhoCandidate* _gg, RhoCandidate *_epem, double &_dth, double &_dph ) { TLorentzVector p4gg = _gg->P4(); TLorentzVector p4epair = _epem->P4(); //TLorentzVector p4ep = _epem->Daughter(0)->Charge()>0? _epem->Daughter(0)->P4(): _epem->Daughter(1)->P4(); //p4gg.Boost(boost_to_cm); //p4epair.Boost(boost_to_cm); //_dth = fabs(p4gg.Vect().Theta() + p4epair.Vect().Theta()); //_dph = p4gg.Vect().Phi() - p4epair.Vect().Phi(); //if (_dph<0) _dph *= -1; dth_dph_cm(p4gg,p4epair,_dth,_dph); } bool AnaTdav2::bayes_pid(RhoCandidate* cand) { const int itrk = cand->GetTrackNumber(); m_prob_drc = (PndPidProbability*) m_drc_array->At(itrk); m_prob_disc = (PndPidProbability*) m_disc_array->At(itrk); m_prob_mvd = (PndPidProbability*) m_mvd_array->At(itrk); m_prob_stt = (PndPidProbability*) m_stt_array->At(itrk); m_prob_emcb = (PndPidProbability*) m_emcb_array->At(itrk); double prob_comb = get_comb_prob(&PndPidProbability::GetElectronPidProb); return prob_comb>eid_prob_min; } double AnaTdav2::get_comb_prob(prob_func func) { Double_t prob_emc = (m_prob_emcb->*func)(NULL); Double_t prob_stt = (m_prob_stt->*func)(NULL); Double_t prob_mvd = (m_prob_mvd->*func)(NULL); Double_t prob_drc = (m_prob_drc->*func)(NULL); Double_t prob_disc = (m_prob_disc->*func)(NULL); Double_t xx = (prob_drc/(1-prob_drc))*(prob_disc/(1-prob_disc)) *(prob_mvd/(1-prob_mvd))*(prob_stt/(1-prob_stt)) *(prob_emc/(1-prob_emc)); return xx/(xx+1); } TEfficiency* AnaTdav2::rebin2d(TEfficiency *eff, int rebin) { assert(eff->GetDimension()==2); TEfficiency *tmp = (TEfficiency*) eff->Clone(Form("%s_rebinned",eff->GetName())); tmp->SetName(Form("%s (Rebinned, %d)", eff->GetName(), rebin)); if (rebin<2) return eff; TH2F* tmpN = (TH2F*)tmp->GetPassedHistogram(); TH2F* tmpD = (TH2F*)tmp->GetTotalHistogram(); tmpN->RebinX(rebin); tmpN->RebinY(rebin); tmpD->RebinX(rebin); tmpD->RebinY(rebin); TEfficiency *retval = new TEfficiency(*tmpN,*tmpD); retval->SetTitle(tmp->GetTitle()); return retval; } TH2F* AnaTdav2::smooth_hist2d(TH2F* h, int nbins= 400) { int nbinx = h->GetXaxis()->GetNbins(); double xmax = h->GetXaxis()->GetBinUpEdge(nbinx); int nbiny = h->GetYaxis()->GetNbins(); double ymax = h->GetYaxis()->GetBinUpEdge(nbiny); TH2F *smooth = new TH2F(Form("%s_smooth",h->GetName()), Form("%s (smoothed)",h->GetTitle()), nbins, 0, xmax, nbins, 0, ymax); cout << "xmax= " << xmax << " ymax= " << ymax << endl; smooth->GetXaxis()->SetTitle(h->GetXaxis()->GetTitle()); smooth->GetYaxis()->SetTitle(h->GetYaxis()->GetTitle()); TH1F *smoothx = (TH1F*) smooth->ProjectionX(); TH1F *smoothy = (TH1F*) smooth->ProjectionY(); for (int i = 1; i <= nbins; i++) { for (int j = 1; j <= nbins; j++) { double xx = smoothx->GetBinCenter(i); double yy = smoothy->GetBinCenter(j); double eff= h->Interpolate(xx,yy); smooth->SetBinContent(i,j,eff); } } return smooth; } TEfficiency* AnaTdav2::smooth_eff2d(TEfficiency *eff, int nbins=400) { cout << "Smoothing 2d Eff" << endl; assert(eff->GetDimension()==2); TH2F* num = smooth_hist2d((TH2F*)eff->GetPassedHistogram(),nbins); TH2F* den = smooth_hist2d((TH2F*)eff->GetTotalHistogram(),nbins); TEfficiency *smooth = new TEfficiency(*num,*den); smooth->SetTitle(eff->GetTitle()); cout << "Done smoothing 2d Eff" << endl; return smooth; } TH1F* AnaTdav2::smooth_hist1d(TH1F* h) { TH1F* hret = (TH1F*)h->Clone(Form("%s_smooth1d", h->GetName())); hret->SetTitle(h->GetTitle()); hret->Smooth(10); return hret; } TEfficiency* AnaTdav2::smooth_eff1d(TEfficiency *eff) { assert(eff->GetDimension()==1); TH1F* num = smooth_hist1d((TH1F*)eff->GetPassedHistogram()); TH1F* den = smooth_hist1d((TH1F*)eff->GetTotalHistogram()); TEfficiency *smooth = new TEfficiency(*num,*den); smooth->SetTitle(Form("%s(1d Smoothed)", eff->GetTitle())); return smooth; }
[ "etatomssa@gmail.com" ]
etatomssa@gmail.com
a91add9f72f4c72535ab0fe7cedaae74335deaef
a06a9ae73af6690fabb1f7ec99298018dd549bb7
/_Library/_Include/boost/algorithm/string/iter_find.hpp
71dfd4b98f6a1fe5fa25096315ddcab72c757702
[]
no_license
longstl/mus12
f76de65cca55e675392eac162dcc961531980f9f
9e1be111f505ac23695f7675fb9cefbd6fa876e9
refs/heads/master
2021-05-18T08:20:40.821655
2020-03-29T17:38:13
2020-03-29T17:38:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,520
hpp
// Boost string_algo library iter_find.hpp header file ---------------------------// // Copyright Pavol Droba 2002-2003. // // 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) // See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_ITER_FIND_HPP #define BOOST_STRING_ITER_FIND_HPP #include <boost/algorithm/string/config.hpp> #include <algorithm> #include <iterator> #include <boost/iterator/transform_iterator.hpp> #include <boost/range/iterator_range_core.hpp> #include <boost/range/begin.hpp> #include <boost/range/end.hpp> #include <boost/range/iterator.hpp> #include <boost/range/value_type.hpp> #include <boost/range/as_literal.hpp> #include <boost/algorithm/string/concept.hpp> #include <boost/algorithm/string/find_iterator.hpp> #include <boost/algorithm/string/detail/util.hpp> /*! \file Defines generic split algorithms. Split algorithms can be used to divide a sequence into several part according to a given criteria. Result is given as a 'container of containers' where elements are copies or references to extracted parts. There are two algorithms provided. One iterates over matching substrings, the other one over the gaps between these matches. */ namespace boost { namespace algorithm { // iterate find ---------------------------------------------------// //! Iter find algorithm /*! This algorithm executes a given finder in iteration on the input, until the end of input is reached, or no match is found. Iteration is done using built-in find_iterator, so the real searching is performed only when needed. In each iteration new match is found and added to the result. \param Result A 'container container' to contain the result of search. Both outer and inner container must have constructor taking a pair of iterators as an argument. Typical type of the result is \c std::vector<boost::iterator_range<iterator>> (each element of such a vector will container a range delimiting a match). \param Input A container which will be searched. \param Finder A Finder object used for searching \return A reference to the result \note Prior content of the result will be overwritten. */ template< typename SequenceSequenceT, typename RangeT, typename FinderT > inline SequenceSequenceT& iter_find( SequenceSequenceT& Result, RangeT& Input, FinderT Finder ) { BOOST_CONCEPT_ASSERT(( FinderConcept< FinderT, BOOST_STRING_TYPENAME range_iterator<RangeT>::type> )); iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input)); typedef BOOST_STRING_TYPENAME range_iterator<RangeT>::type input_iterator_type; typedef find_iterator<input_iterator_type> find_iterator_type; typedef detail::copy_iterator_rangeF< BOOST_STRING_TYPENAME range_value<SequenceSequenceT>::type, input_iterator_type> copy_range_type; input_iterator_type InputEnd=::boost::end(lit_input); typedef transform_iterator<copy_range_type, find_iterator_type> transform_iter_type; transform_iter_type itBegin= ::boost::make_transform_iterator( find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ), copy_range_type()); transform_iter_type itEnd= ::boost::make_transform_iterator( find_iterator_type(), copy_range_type()); SequenceSequenceT Tmp(itBegin, itEnd); Result.swap(Tmp); return Result; } // iterate split ---------------------------------------------------// //! Split find algorithm /*! This algorithm executes a given finder in iteration on the input, until the end of input is reached, or no match is found. Iteration is done using built-in find_iterator, so the real searching is performed only when needed. Each match is used as a separator of segments. These segments are then returned in the result. \param Result A 'container container' to contain the result of search. Both outer and inner container must have constructor taking a pair of iterators as an argument. Typical type of the result is \c std::vector<boost::iterator_range<iterator>> (each element of such a vector will container a range delimiting a match). \param Input A container which will be searched. \param Finder A finder object used for searching \return A reference to the result \note Prior content of the result will be overwritten. */ template< typename SequenceSequenceT, typename RangeT, typename FinderT > inline SequenceSequenceT& iter_split( SequenceSequenceT& Result, RangeT& Input, FinderT Finder ) { BOOST_CONCEPT_ASSERT(( FinderConcept<FinderT, BOOST_STRING_TYPENAME range_iterator<RangeT>::type> )); iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input)); typedef BOOST_STRING_TYPENAME range_iterator<RangeT>::type input_iterator_type; typedef split_iterator<input_iterator_type> find_iterator_type; typedef detail::copy_iterator_rangeF< BOOST_STRING_TYPENAME range_value<SequenceSequenceT>::type, input_iterator_type> copy_range_type; input_iterator_type InputEnd=::boost::end(lit_input); typedef transform_iterator<copy_range_type, find_iterator_type> transform_iter_type; transform_iter_type itBegin= ::boost::make_transform_iterator( find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ), copy_range_type() ); transform_iter_type itEnd= ::boost::make_transform_iterator( find_iterator_type(), copy_range_type() ); SequenceSequenceT Tmp(itBegin, itEnd); Result.swap(Tmp); return Result; } } // namespace algorithm // pull names to the boost namespace using algorithm::iter_find; using algorithm::iter_split; } // namespace boost #endif // BOOST_STRING_ITER_FIND_HPP ///////////////////////////////////////////////// // vnDev.Games - Trong.LIVE - DAO VAN TRONG // ////////////////////////////////////////////////////////////////////////////////
[ "adm.fael.hs@gmail.com" ]
adm.fael.hs@gmail.com
085edba2b5d19b26eeacafd5f01b8a104871cf20
c01300844a372e202bed3e43ed4b5cdccfcc46fd
/android/app/src/cpp/src/crypto/randomx/vm_interpreted_light.hpp
8a1b5a3644083a867181d4526c3470e14a9ea063
[ "GPL-3.0-only", "MIT" ]
permissive
FlameSalamander/react-native-xmrig
085a0e9d35e0a62a9567cb1260cbb81c775ba06c
6a6e3b301bd78b88459989f334d759f65e434082
refs/heads/main
2023-07-03T04:42:35.863230
2021-08-04T17:08:07
2021-08-04T17:08:07
392,767,012
0
0
MIT
2021-08-04T17:00:51
2021-08-04T17:00:51
null
UTF-8
C++
false
false
2,227
hpp
/* Copyright (c) 2018-2019, tevador <tevador@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include <new> #include "crypto/randomx/vm_interpreted.hpp" namespace randomx { template<int softAes> class InterpretedLightVm : public InterpretedVm<softAes> { public: using VmBase<softAes>::mem; using VmBase<softAes>::cachePtr; void* operator new(size_t, void* ptr) { return ptr; } void operator delete(void*) {} void setDataset(randomx_dataset* dataset) override { } void setCache(randomx_cache* cache) override; protected: void datasetRead(uint64_t address, int_reg_t(&r)[8]) override; void datasetPrefetch(uint64_t address) override { } }; using InterpretedLightVmDefault = InterpretedLightVm<1>; using InterpretedLightVmHardAes = InterpretedLightVm<0>; }
[ "garry@lachman.co" ]
garry@lachman.co
49ec7f653d53410f50033278ac8292996d073c7d
ddac2b6e789b41a6350d924120b290511dd2838c
/c++Primer/construction/constructor/main.cpp
86b4ae522ff9c08aa0817425f79169311ca3095e
[]
no_license
guoguo-linux/CppNotes
4947c6f9d131ac3f8ec1d4c4ebe334a135473255
71434aa20bff931177114ab6e85bbea0ebd8dfea
refs/heads/main
2023-08-15T09:08:32.273615
2021-09-14T10:01:38
2021-09-14T10:01:38
389,585,163
0
0
null
null
null
null
UTF-8
C++
false
false
218
cpp
#include "constructor.h" #include <iostream> #include <memory> using namespace std; int main() { std::unique_ptr<Constructor> conPtr = nullptr; conPtr.reset(new Constructor); conPtr->printMesg(); return 0; }
[ "1421780358@qq.com" ]
1421780358@qq.com
084130ecc140693e0d1396d44ff1404e68729864
b2139a7f5e04114c39faea797f0f619e69b8b4ae
/src/morphoGen/src/vision/MeccanoObjDet/src/YarpWrapper.cpp
26ed211f9b303b75e88872fede876a1a9d4e07ef
[]
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
3,770
cpp
#undef __GXX_EXPERIMENTAL_CXX0X__ #include "opencv/cv.h" #include "opencv/highgui.h" #include "yarp/os/all.h" #include "yarp/sig/all.h" #include "TLdetector.hpp" #include <iostream> #include <fstream> using namespace yarp::os; using namespace yarp::sig; int main(char** argv, int argc) { Network network; BufferedPort<ImageOf<PixelRgb> >* imageInputPort = new BufferedPort<ImageOf<PixelRgb> >(); BufferedPort<ImageOf<PixelRgb> >* imageOutputPort = new BufferedPort<ImageOf<PixelRgb> >(); BufferedPort<Bottle>* bbOutputPort = new BufferedPort<Bottle>(); yarp::os::BufferedPort<yarp::os::Bottle > dataPortMec; imageInputPort->open("/img:i"); imageOutputPort->open("/img:o"); //bbOutputPort->open("/bb:o"); editted VM network.connect("/icub/camcalib/left/out", "/img:i"); dataPortMec.open("/Shapedata:o"); string para_yml_file = "data/para_cmp8toys.yml"; ///////////////////////////////////////////////// // STEP1: initiate ///////////////////////////////////////////////// bool flag; CTLdetector detector; flag = detector.initiate(para_yml_file); if (!flag) return 0; ///////////////////////////////////////////////// // STEP2: train ///////////////////////////////////////////////// flag = detector.train(); if (!flag) return 0; ///////////////////////////////////////////////// // STEP3: detect ///////////////////////////////////////////////// int key = 0; cv::Mat cvMatImage; std::cout<<"***Detecting..."<<std::endl; while(key != 27) { ImageOf<PixelRgb> *img = imageInputPort->read(true); cvMatImage.create(img->height(), img->width(), CV_8UC3); unsigned char* ptr = img->getRawImage(); memcpy(cvMatImage.data, ptr, cvMatImage.cols * cvMatImage.rows * 3); cv::cvtColor(cvMatImage, cvMatImage, CV_RGB2BGR); detector.detect(cvMatImage); //detector.showDetObjs(cvMatImage,Scalar(0,255,0),Scalar(255,255,255),480); //chaged 3.2.2013 Rea changed to orinal size detector.showDetObjs(cvMatImage,Scalar(0,255,0),Scalar(255,255,255),0); //detector.dispDetObjs(); std::vector<DetObj> objects; objects = detector.getDetObjs(); //sending out through image port the image out if(imageOutputPort->getOutputCount()) { cv::Mat ppIm = detector.getPostProcessIm(); cv::cvtColor(ppIm, ppIm, CV_BGR2RGB); // printf("image %d %d \n", cvMatImage.cols, cvMatImage.rows); ImageOf<PixelRgb>& tmpImage = imageOutputPort->prepare(); tmpImage.resize(img->width(),img->height()); unsigned char* ptrd = tmpImage.getRawImage(); unsigned char* ptrs = ppIm.data; memcpy(ptrd,ptrs, cvMatImage.cols * cvMatImage.rows * 3 ); imageOutputPort->write(); } // preparing the bottle port out, sending information out Bottle& ShapOp = dataPortMec.prepare(); ShapOp.clear(); //Bottle output = bbOutputPort->prepare(); for (int i = 0; i < objects.size(); i++) { ShapOp.addInt(objects[i].box_tight.x); ShapOp.addInt(objects[i].box_tight.y); ShapOp.addInt(objects[i].box_tight.width); ShapOp.addInt(objects[i].box_tight.height); ShapOp.addInt(objects[i].id_label); //ShapOp.addInt(10); //if want to know the object name: detector.all_obj_cls[objects[i].id_label] } // free the memory of the objects. for (int i=0;i<objects.size();i++){ objects[i].mat_edge_NN_tr.release(); } objects.clear(); //bbOutputPort->write(); dataPortMec.write(); key = cv::waitKey(100); } cvMatImage.release(); imageInputPort->close(); imageOutputPort->close(); //bbOutputPort->close(); dataPortMec.close(); std::cout<<"***Done."<<std::endl; return 0; }
[ "hychyc07@cs.utexas.edu" ]
hychyc07@cs.utexas.edu
dd3f9c14708aebb70325e25f327d59ff4c1b531c
01d00a6c80d362794f1e1b0c05ce47b18c3b47f9
/include/oglplus/opt/resources.hpp
403518016f77a4d7ecb199a3f16d20674145b41d
[ "BSL-1.0" ]
permissive
bananu7/oglplus
988bd43ee36765143ec86baba1f78b4ad12d9150
c7ce822aa72118bdf26befb8f3df68232d9b0dba
refs/heads/master
2021-01-18T08:08:00.311615
2013-07-10T20:28:43
2013-07-10T20:28:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,691
hpp
/** * @file oglplus/opt/resources.hpp * @brief Resource (texture, model, etc.) file find functions * * @author Matus Chochlik * * Copyright 2010-2013 Matus Chochlik. 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) */ #pragma once #ifndef OGLPLUS_OPT_RESOURCES_1107121519_HPP #define OGLPLUS_OPT_RESOURCES_1107121519_HPP #include <oglplus/config.hpp> #include <oglplus/string.hpp> #include <oglplus/opt/application.hpp> #include <oglplus/auxiliary/filesystem.hpp> # include <fstream> #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY) # include <stdexcept> #endif namespace oglplus { namespace aux { OGLPLUS_LIB_FUNC std::size_t FindResourceFile( std::ifstream& file, const std::string& path, const char** exts, std::size_t nexts ) #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY) { for(std::size_t e=0; e!=nexts; ++e) { file.open(path + exts[e], std::ios::binary); if(file.good()) return e; } return nexts; } #else ; #endif } // namespace aux OGLPLUS_LIB_FUNC std::size_t FindResourceFile( std::ifstream& file, const std::string& category, const std::string& name, const char** exts, unsigned nexts ) #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY) { const std::string dirsep = aux::FilesysPathSep(); const std::string pardir(aux::FilesysPathParDir() + dirsep); const std::string path = category+dirsep+name; const std::string apppath = Application::RelativePath(); std::string prefix; for(std::size_t i=0; i!=5; ++i) { std::size_t iext = aux::FindResourceFile( file, apppath+prefix+path, exts, nexts ); if(iext != nexts) return iext; prefix = pardir + prefix; } return nexts; } #else ; #endif inline bool OpenResourceFile( std::ifstream& file, const std::string& category, const std::string& name, const char* ext ) { return FindResourceFile( file, category, name, &ext, 1 ) == 0; } class ResourceFile : public std::ifstream { public: std::ifstream& stream(void) { return *this; } ResourceFile( const std::string& category, const std::string& name, const char* ext ); }; #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY) OGLPLUS_LIB_FUNC ResourceFile::ResourceFile( const std::string& category, const std::string& name, const char* ext ) { if(!OpenResourceFile(stream(), category, name, ext) || !good()) { throw std::runtime_error( std::string("Failed to open resource file '")+ category + '/' + name + '/' + ext + std::string("'") ); } } #endif } // namespace oglplus #endif // include guard
[ "chochlik@gmail.com" ]
chochlik@gmail.com
ac285cb851fd927b1e36fdf817cf3cb0c01a098b
ed9017f0222c52af0d2a6da73b9d046acae1ed76
/workspace/Activity_timak/src/Graphics/ContainerGraphics.cpp
30cc532693a8c589fbf687e6b69641020a46ae69
[]
no_license
next-dimension-team/Timak_15-16
7989d3a90d3cb20ec2a0d78fe604bf60740bf31d
0902a296ff835a1a7f091b1d25351330ea5e74e8
refs/heads/master
2021-01-11T02:11:11.558451
2016-10-06T10:08:31
2016-10-06T10:08:31
70,096,900
0
1
null
null
null
null
UTF-8
C++
false
false
5,396
cpp
/* * ContainerGraphics.cpp * * Created on: 14.10.2013 * Author: Schade */ #include "ContainerGraphics.h" #include <OgreMath.h> #include <OgrePrerequisites.h> #include <OgreSceneNode.h> #include <OgreVector2.h> #include <OgreVector3.h> #include "../Core/Utilities.h" #include "../HelperTeam4.h" ContainerGraphics::ContainerGraphics(Ogre::ManualObject* manualObject, Ogre::SceneNode* sceneNode, DrawingAlgorithm* drawingAlgorihtm, int width, int height) : ElementGraphics(manualObject, sceneNode, drawingAlgorihtm) { this->width = width; this->height = height; } ContainerGraphics::~ContainerGraphics() {} void ContainerGraphics::setSize(int width, int height) { this->width = width; this->height = height; } int ContainerGraphics::getWidth() { return this->width; } int ContainerGraphics::getHeight() { return this->height; } Ogre::Vector3 ContainerGraphics::getConnectorBeginPoint(const std::string& A_name) { DEF_BEGIN; Ogre::SceneNode* endNode = Utilities::getConnectorTargetSceneNode(A_name); if (endNode->convertLocalToWorldPosition(Ogre::Vector3::ZERO).z != this->getSceneNode()->convertLocalToWorldPosition(Ogre::Vector3::ZERO).z) return ElementGraphics::getConnectorBeginPoint(A_name); double x = 0; double y = 0; Ogre::Vector3 vecBeginLocal = getSceneNode()->convertLocalToWorldPosition(Ogre::Vector3::ZERO); Ogre::Vector3 vecEndLocal = endNode->convertLocalToWorldPosition(Ogre::Vector3::ZERO); double thisWidth = this->getWidth(); double thisHeight = this->getHeight(); double fullWidth = Ogre::Math::Abs(this->getSceneNode()->convertLocalToWorldPosition(Ogre::Vector3::ZERO).x - endNode->convertLocalToWorldPosition(Ogre::Vector3::ZERO).x); double fullHeight = Ogre::Math::Abs(this->getSceneNode()->convertLocalToWorldPosition(Ogre::Vector3::ZERO).y - endNode->convertLocalToWorldPosition(Ogre::Vector3::ZERO).y); double thisRatio = thisWidth / thisHeight; double fullRatio = fullWidth / fullHeight; Ogre::Vector2 tmp = Ogre::Vector2(vecBeginLocal.x - vecEndLocal.x, vecBeginLocal.y - vecEndLocal.y); Ogre::Real angle = Ogre::Vector2(0, 1).angleTo(tmp).valueRadians(); if (thisRatio <= fullRatio) { if (angle < Ogre::Math::PI) { x = thisWidth / 2; } else { x = - thisWidth / 2; } if (angle < 1.5 * Ogre::Math::PI && angle > 0.5 * Ogre::Math::PI) { y = thisHeight / 2 * thisRatio / fullRatio; } else { y = - thisHeight / 2 * thisRatio / fullRatio; } } else { if (angle < Ogre::Math::PI) { x = thisWidth / 2 * fullRatio / thisRatio; } else { x = - thisWidth / 2 * fullRatio / thisRatio; } if (angle < 1.5 * Ogre::Math::PI && angle > 0.5 * Ogre::Math::PI) { y = thisHeight / 2; } else { y = - thisHeight / 2; } } return this->node->convertLocalToWorldPosition(Ogre::Vector3(x, y, 0)); } Ogre::Vector3 ContainerGraphics::getConnectorEndPoint(const std::string& A_name) { Ogre::SceneNode* beginNode = Utilities::getConnectorSourceSceneNode(A_name); if (beginNode->convertLocalToWorldPosition(Ogre::Vector3::ZERO).z != this->getSceneNode()->convertLocalToWorldPosition(Ogre::Vector3::ZERO).z) return ElementGraphics::getConnectorEndPoint(A_name); double x = 0; double y = 0; Ogre::Vector3 vecBeginLocal = beginNode->convertLocalToWorldPosition(Ogre::Vector3::ZERO); Ogre::Vector3 vecEndLocal = getSceneNode()->convertLocalToWorldPosition(Ogre::Vector3::ZERO); double thisWidth = this->getWidth(); double thisHeight = this->getHeight(); double fullWidth = Ogre::Math::Abs(beginNode->convertLocalToWorldPosition(Ogre::Vector3::ZERO).x - this->getSceneNode()->convertLocalToWorldPosition(Ogre::Vector3::ZERO).x); double fullHeight = Ogre::Math::Abs(beginNode->convertLocalToWorldPosition(Ogre::Vector3::ZERO).y - this->getSceneNode()->convertLocalToWorldPosition(Ogre::Vector3::ZERO).y); double thisRatio = thisWidth / thisHeight; double fullRatio = fullWidth / fullHeight; Ogre::Vector2 tmp = Ogre::Vector2(vecEndLocal.x - vecBeginLocal.x, vecEndLocal.y - vecBeginLocal.y); Ogre::Real angle = Ogre::Vector2(0, 1).angleTo(tmp).valueRadians(); if (thisRatio <= fullRatio) { if (angle < Ogre::Math::PI) { x = thisWidth / 2; } else { x = - thisWidth / 2; } if (angle < 1.5 * Ogre::Math::PI && angle > 0.5 * Ogre::Math::PI) { y = thisHeight / 2 * thisRatio / fullRatio; } else { y = - thisHeight / 2 * thisRatio / fullRatio; } } else { if (angle < Ogre::Math::PI) { x = thisWidth / 2 * fullRatio / thisRatio; } else { x = - thisWidth / 2 * fullRatio / thisRatio; } if (angle < 1.5 * Ogre::Math::PI && angle > 0.5 * Ogre::Math::PI) { y = thisHeight / 2; } else { y = - thisHeight / 2; } } return this->node->convertLocalToWorldPosition(Ogre::Vector3(x, y, 0)); }
[ "Peter.Zajac11@sk.ibm.com" ]
Peter.Zajac11@sk.ibm.com
8cd88a279da24c7a5f13cd5326b7de0771fc6eb6
2324d8e4544a9b813153ce0ed0f858972ea7f909
/面试题51-数组中的逆序对-a.cpp
056719f0f44b448f072a8b48b0b02af65732b520
[]
no_license
Terry-Ma/Leetcode
af8a4ad8059975f8d12b0351610336f1f5f01097
cc7f41e2fb3ed5734c2a5af97e49a5bc17afbceb
refs/heads/master
2021-08-10T16:40:20.482851
2021-07-03T08:35:56
2021-07-03T08:35:56
225,814,239
0
1
null
null
null
null
UTF-8
C++
false
false
372
cpp
class Solution { public: int reversePairs(vector<int>& nums) { if(nums.size() < 2) return 0; int result = 0; for(int i = 0; i < nums.size() - 1; i++){ for(int j = i + 1; j < nums.size(); j++){ if(nums[i] > nums[j]) result++; } } return result; } };
[ "rssmyq@aliyun.com" ]
rssmyq@aliyun.com
9a101cff9a08c08f418f18f9c3ea0e226f260495
0e7c19e654fa899f2de7cfe430025832d82532c6
/src/pumpkin_backup/Propagators/Dynamic/PseudoBooleanLower/database_pseudo_boolean.h
3a3aeab8bd438428eb73dcbdea007dc0e971ccc4
[]
no_license
JensLangerak/thesis
f3b08f70123cfce079ad33bab7739fb537935915
042155b5c441eac4e7ad1cd7f6ee8db2fc2bcb8e
refs/heads/master
2023-08-23T08:27:10.411442
2021-09-30T19:32:43
2021-09-30T19:32:43
292,589,320
0
0
null
null
null
null
UTF-8
C++
false
false
1,360
h
// // Created by jens on 10-12-20. // #ifndef SIMPLESATSOLVER_SRC_PUMPKIN_PROPAGATORS_DYNAMIC_PSEUDOBOOLEANLOWER_DATABASE_PSEUDO_BOOLEAN_H_ #define SIMPLESATSOLVER_SRC_PUMPKIN_PROPAGATORS_DYNAMIC_PSEUDOBOOLEANLOWER_DATABASE_PSEUDO_BOOLEAN_H_ #include "watch_list_pseudo_boolean.h" #include <cstdint> #include "learnt_group.h" #include "node_database.h" namespace Pumpkin { class SolverState; class DatabasePseudoBoolean3 { public: explicit DatabasePseudoBoolean3(uint64_t num_vars); /// Create a new WatchedCardinalityConstraint from the given constraint. Add the constraint to the watched lists. /// /// \param constraint /// \param state /// \return the constructed constraint. WatchedPseudoBooleanConstraint3* AddPermanentConstraint(PseudoBooleanConstraint &constraint, SolverState &state); WatchListPseudoBoolean3 watch_list_true; std::vector<WatchedPseudoBooleanConstraint3*> permanent_constraints_; NodeDatabase node_database_; // std::vector<LearntGroup*> learnt_groups_; // std::map<BooleanLiteral, std::vector<LearntGroup*>> member_groups_; ~DatabasePseudoBoolean3(); private: void AddWatchers(WatchedPseudoBooleanConstraint3 *constraint); }; } // namespace Pumpkin #endif // SIMPLESATSOLVER_SRC_PUMPKIN_PROPAGATORS_DYNAMIC_PSEUDOBOOLEAN_DATABASE_PSEUDO_BOOLEAN_H_
[ "j.langerak@student.tudelft.nl" ]
j.langerak@student.tudelft.nl
b18051e46619ce0dcf9c9152e6f9ba2a7dca9b4b
632eef0f1187e0d9aa3c48464d6153d62b261e5f
/DirectX11_PutWall/App.hpp
8a50bd1de9d9d91f98078df89fd0024663427f2d
[]
no_license
momijzi/DirectX11_PutWall
dcf674766d298abba4c146d200be9a0525c37c48
02433c1253e2df24c0831a051a9abe44a909dd31
refs/heads/master
2020-03-18T18:27:42.309983
2018-07-02T13:54:59
2018-07-02T13:54:59
135,094,431
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
4,483
hpp
#pragma once #define OEMRESOURCE//無いとエラーが出る #include <memory> #include <vector> #include <Windows.h> #include <atlbase.h> #include <d3d11.h> #include <d3dcompiler.h> #include <DirectXMath.h> #include <wincodec.h> #include<fbxsdk.h> #pragma comment(lib,"d3d11.lib") #pragma comment(lib,"d3dcompiler.lib") //初期設定の自動化 #if defined(_WIN64) #define A "x64/" #else #define A "x86/" #endif #if defined(_DEBUG) #define B "debug/" #else #define B "release/" #endif #if defined(_DLL) #define C "libfbxsdk-md.lib" #else #define C "libfbxsdk-mt.lib" #endif #pragma comment(lib,A B C) #undef A #undef B #undef C //------------------------------------- #define MAIN() APIENTRY wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int) #include "Utility.hpp" class App final { public: #include "Window.h" #include "Graphics.h" #include "Input.h" #include "Timer.h" static constexpr wchar_t* NAME = L"DirectX11"; App() = delete; static bool Refresh() { GetGraphics().Update(); GetInput().Update(); GetTimer().Update(); return GetWindow().Update(); } static void Initialize() { static bool isInitialized = false; if (!isInitialized) { CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); isInitialized = true; } } //ウィンドウ関係 static HWND GetWindowHandle() { return GetWindow().GetHandle(); } static DirectX::XMINT2 GetWindowSize() { return GetWindow().GetSize(); } static void SetWindowSize(int width, int height) { GetWindow().SetSize(width, height); } //グラフィック関係 static ID3D11Device& GetGraohicsDevice() { return GetGraphics().GetDevice(); } static ID3D11DeviceContext& GetGraphicsContext() { return GetGraphics().GetContext(); } static IDXGISwapChain& GetSwapChain() { return GetGraphics().GetSwapChain(); } //入力関係 static bool GetKey(int VK_CODE) { return GetInput().GetKey(VK_CODE); } static bool GetKeyDown(int VK_CODE) { return GetInput().GetKeyDown(VK_CODE); } static bool GetKeyUp(int VK_CODE) { return GetInput().GetKeyUp(VK_CODE); } static Float2 GetMousePosition() { return GetInput().GetMousePosition(); } static void SetMousePosition(float x, float y) { GetInput().SetMousePosition(x, y); } static void SetShowCursor(bool isShowCursor) { GetInput().SetShowCursor(isShowCursor); } //タイム関係 static float GetTime() { return GetTimer().GetTime(); } static float GetDeltaTime() { return GetTimer().GetDeltaTime(); } static int GetFrameRate() { return GetTimer().GetFrameRate(); } //Utility関係 static bool SameChackFloat2(Float2 value1, Float2 value2) { if (value1.x == value2.x && value1.y == value2.y) { return true; } return false; } static bool SameChackFloat3(Float3 value1,Float3 value2) { if (value1.x == value2.x && value1.y == value2.y && value1.z == value2.z) { return true; } return false; } static bool SameChackFloat4(Float4 value1, Float4 value2) { if (value1.x == value2.x && value1.y == value2.y && value1.z == value2.z && value1.w == value2.w) { return true; } return false; } private: static Window& GetWindow() { static std::unique_ptr<Window> window(new Window()); return *window.get(); } static Graphics& GetGraphics() { static std::unique_ptr<Graphics> graphics(new Graphics()); return *graphics.get(); } static Input& GetInput() { static std::unique_ptr<Input> input(new Input()); return *input.get(); } static Timer& GetTimer() { static std::unique_ptr<Timer> timer(new Timer()); return *timer.get(); } }; #include "Texture.h" #include "Material.h" #include "Mesh.h" #include "Camera.h" #include "Model.h" #include "UIData.h" #include "Move.hpp" #include "Wall.h" #include "PlayerManager.h" #include "MediaFoundation.h" #include "XAudio2.h" #include "Ray.h" #include "GameScene.h"
[ "l7momip1z6junin3y@outlook.jp" ]
l7momip1z6junin3y@outlook.jp
b444fbb5ebaf70f2ebc69e4ea3f98b8411c6a4ac
a6e25cd7cb524ca50cba9b3dbd48cebe814c66f7
/Graph.cpp
341bfd3b5b485bbecbe65502bf81b33797d97e69
[]
no_license
B1anky/CS-240-Lab-8-Graphs
78535c42bccb6987eeb0667ca1eb9928256c98e0
bbd23c656a6a1e6ccb9befa246e2bf040b348d2f
refs/heads/master
2021-01-10T22:46:17.855475
2016-10-08T20:02:45
2016-10-08T20:02:45
70,354,562
0
0
null
null
null
null
UTF-8
C++
false
false
3,354
cpp
//Brett Sackstein #include "Graph.h" Graph::Graph(unsigned int cityCnt, unsigned int flightCnt, std::string *vertexes, std::string *flights){ for(unsigned int i = 0; i < cityCnt; i++){ adjLists.push_back(new Vertex(vertexes[i], NULL)); } for(unsigned int j = 0; j < flightCnt; j++){ std::vector<std::string> toIndex = split(flights[j]); int v1 = indexForName(toIndex[0]); int v2 = indexForName(toIndex[1]); adjLists[v1]->setNextCity(new City(v2, adjLists[v1]->getCities())); } setVisited(cityCnt); } Graph::~Graph(){ for(unsigned int i = 0; i < adjLists.size(); i++){ delete(adjLists[i]); } if(visited != NULL) delete []visited; } void Graph::setVisited(int cityCnt){ visited = new int[cityCnt]; } std::vector<Vertex*> Graph::getAdjList(){ return adjLists; } int Graph::indexForName(std::string name){ for(unsigned int i = 0; i < adjLists.size(); i++) { if(adjLists[i]->getName() == name){ return i; } } return -1; } void Graph::showGraph(){ for(unsigned int i = 0; i < adjLists.size(); i++){ for(City *city = adjLists[i]->getCities(); city != NULL; city = city->getNextCity()){ std::cout << adjLists[i]->getName() << " --> " << adjLists[city->getVertexInd()]->getName(); if(city->getNextCity() != NULL) std::cout << ", "; } std::cout << std::endl; } } std::vector<std::string> Graph::split(std::string toParse){ std::string buf; std::stringstream ss(toParse); std::vector<std::string> places; while(ss >> buf) places.push_back(buf); return places; } void Graph::printHomeRoute(std::string home){ printTravelRoute(home, "", true); } void Graph::printTravelRoute(std::string from, std::string to, bool home){ std::vector<int> vertexRoute; if(from == to){ printHomeRoute(from); return; }else{ vertexRoute = DFST(indexForName(from), indexForName(to), vertexRoute, home); } std::cout << std::endl; if(vertexRoute.size() != 0){ for (unsigned int i = 0; i < vertexRoute.size(); ++i){ std::cout << getAdjList()[vertexRoute[i]]->getName() << " "; } std::cout << std::endl; } else{ std::cout << "No" << std::endl; } } std::vector<int> Graph::DFST(int start, int end, std::vector<int> &vertexRoute, bool home){ if(end == -1 && home){ vertexRoute.push_back(start); int i = 0; std::vector<int> sol; City *p = getAdjList()[start]->getCities(); while(p != NULL){ i = p->getVertexInd(); sol = DFST(i, start, vertexRoute, false); if(sol.size() != 0){ return sol; }else{ vertexRoute.clear(); vertexRoute.push_back(start); } p = p->getNextCity(); } return {}; }else{ for(unsigned int i = 0; i < getAdjList().size(); i++) visited[i] = 0; bool a = DFST1(start, end, vertexRoute); if(a) return vertexRoute; else return {}; } } bool Graph::DFST1(int i, int stop, std::vector<int> &vertexRoute){ vertexRoute.push_back(i); if(i == stop){ return true; } City *p = getAdjList()[i]->getCities(); visited[i] = 1; while(p != NULL){ i = p->getVertexInd(); if(!visited[i]){ auto before = vertexRoute; bool found = DFST1(i, stop, vertexRoute); if(!found){ vertexRoute = before; }else{ return true; } } p=p->getNextCity(); } return false; }
[ "noreply@github.com" ]
noreply@github.com
b470f79c8130bddc6cb5d6616f047fa515857852
fa55d8ed32564195f2687d1e18b99f80c5683073
/spw/111-min-depth-tree/min_depth_tree.cc
b01a696f05d7f4de924baf5836ac4783042f04a4
[]
no_license
TenFifteen/SummerCamp
1841bf1bd212938cee818540658185cd3e429f0c
383b9321eee9e0721772f93a897c890f737f2eff
refs/heads/master
2020-04-05T23:48:01.393256
2018-03-11T12:37:38
2018-03-11T12:37:38
38,595,086
9
4
null
2016-07-18T14:21:15
2015-07-06T03:15:55
C++
UTF-8
C++
false
false
1,297
cc
/** * Problem: Given a binary tree, find its minimum depth. The minimum depth is * the number of nodes along the shortest path * from the root node down to the nearest leaf node. * Solve: recursive * Tips: the leaf mean nodes whose two children are all NULL. * Then if one of the children is NULL, the depth(root) = depth(child not NULL) + 1 */ int minDepth(TreeNode* root) { if (root == NULL) return 0; int left = minDepth(root->left); int right = minDepth(root->right); if (left == 0) { return right + 1; } if (right == 0) { return left + 1; } return right < left ? right + 1 : left + 1; } class Solution { public: int minDepth(TreeNode* root) { if (root == NULL) return 0; if (root->left == NULL && root->right == NULL) return 1; int left = root->left ? minDepth(root->left) : INT_MAX; int right = root->right ? minDepth(root->right) : INT_MAX; return min(left, right) + 1; } }; int minDepth(TreeNode* root) { if (root == NULL) return 0; int left = minDepth(root->left); int right = minDepth(root->right); if (left == 0 || right == 0) return left + right + 1; return min(left, right) + 1; }
[ "songpengwei40@gmail.com" ]
songpengwei40@gmail.com
e5b726cb4edcbf26e59d3afd63604f3fe1a7b477
d5eb13726d96fd9510b1e14bbeed0cd8b805e022
/obj/Newtons_Method.cpp
4ce06c222cb6bd5e3c0495e77e0325940b78af81
[]
no_license
Abdelrhman98/Curve-Fitting
6d7c8ba3c47ac8ff3f51892ec0a8c450d2db4373
e8277c5dde232c20a0ad933b454326e54839def7
refs/heads/master
2020-03-15T15:10:47.180098
2018-05-05T02:12:20
2018-05-05T02:12:20
132,206,334
0
0
null
null
null
null
UTF-8
C++
false
false
1,406
cpp
#include<iostream> #include<cmath> using namespace std ; double func ( double num ) { return ( num - cos(num) ) ; } double derivative_1 ( double num ) { return ( 1 + sin(num) ) ; } double derivative_2 ( double num ) { return ( cos(num) ) ; } double decimal_places_calc ( int dp ) { return ( (double)( pow(0.1,dp) ) ) ; } double calc_xnew ( double x , double fx , double f_dash_x ) { double x_new ; x_new = x - fx / f_dash_x ; return x_new ; } double calculate ( double x , int decimal_places ) { double x_old , fx , f_dash_x , x_new , dp ; dp = decimal_places_calc ( decimal_places ) ; do { x_old = x_new ; fx = func ( x_old ) ; f_dash_x = derivative_1 ( x_old ) ; x_new = calc_xnew ( x_old , fx , f_dash_x ) ; }while ( abs(x_old - x_new) > dp ) ; return x_new ; } bool check_number ( double x ) { double c ; c = abs( (func ( x ) * derivative_2(x)) / pow(derivative_1(x),2)) ; return ( c < 1 ) ; } int main () { double x ; int decimal_places ; x:cout << "Enter X: \n" ; cin >> x ; cout << "Enter Decimal Places : \n" ; cin >> decimal_places ; if ( !(check_number ( x )) ) { cout << "Please Retry Another Number \n" ; goto x ; } else { cout << "\nX Approximately Equals " << (float)calculate ( x , decimal_places ) ; } return 0 ; }
[ "abdelrhman.soleman98@gmail.com" ]
abdelrhman.soleman98@gmail.com
230a3286ffa2651d04c0ca233544f3fe9c90be9f
c9c5c2e97f4a18fc34c198640478ee533ee3d2cf
/src/qt/cashcash/navmenuwidget.h
bf608d471a2736c6e938f3d64a58db6166573709
[ "MIT" ]
permissive
cashcash-project/cashcash-2.0
d0c64f909f645f605412f5a2f8a14dbabdf36748
18ce7648c6f973a18bf8918d3cf68ff220cf8a3d
refs/heads/master
2023-05-30T23:50:25.245029
2021-07-08T22:45:06
2021-07-08T22:45:06
383,936,393
0
0
null
null
null
null
UTF-8
C++
false
false
1,170
h
// Copyright (c) 2019-2020 The cashcash developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef NAVMENUWIDGET_H #define NAVMENUWIDGET_H #include <QWidget> #include "qt/cashcash/pwidget.h" class cashcashGUI; namespace Ui { class NavMenuWidget; } class NavMenuWidget : public PWidget { Q_OBJECT public: explicit NavMenuWidget(cashcashGUI* mainWindow, QWidget *parent = nullptr); ~NavMenuWidget(); void loadWalletModel() override; virtual void showEvent(QShowEvent *event) override; public Q_SLOTS: void selectSettings(); void onShowHideColdStakingChanged(bool show); private Q_SLOTS: void onSendClicked(); void onDashboardClicked(); void onAddressClicked(); void onMasterNodesClicked(); void onColdStakingClicked(); void onSettingsClicked(); void onReceiveClicked(); void updateButtonStyles(); private: Ui::NavMenuWidget *ui; QList<QWidget*> btns; void connectActions(); void onNavSelected(QWidget* active, bool startup = false); bool init = false; }; #endif // NAVMENUWIDGET_H
[ "w.menezes@loro.com.co" ]
w.menezes@loro.com.co
ac8cb06aa67463ff388b6e07cf31fa10d54f3940
a9994594a815a834cbfd16cca684c5c060f85f39
/BOJ/7579 앱.cpp
78c9c9b2d93c30b1ba5e4f3d3513edb0453c6869
[]
no_license
KyungminYu/Algorithm
25af17819b01e5e0a78a6e8edb45738d3f9ee4ec
405f30434ddca419330e7db12a44d091cf90b41c
refs/heads/master
2023-04-08T13:01:59.725887
2021-04-03T09:06:57
2021-04-03T09:06:57
94,004,576
0
1
null
null
null
null
UTF-8
C++
false
false
508
cpp
#include <stdio.h> int m[101], c[101], dp[10001]; int N, M, i, j, size; int main(){ scanf("%d %d", &N, &M); for(i = 1; i <= N; i++) scanf("%d", &m[i]); for(i = 1; i <= N; i++) { scanf("%d", &c[i]); size += c[i]; } for(i = 1; i <= N; i++){ for(j = size - c[i]; j >= 0; j--) if(dp[j + c[i]] < dp[j] + m[i] && dp[j + c[i]] < M) dp[j + c[i]] = dp[j] + m[i]; } for(i = 0; i <= size; i++) if(dp[i] >= M) break; printf("%d\n", i); return 0; }
[ "ykmyou@naver.com" ]
ykmyou@naver.com
b9c5b916f3b7f4334a954405dc64aff261cacb23
f98581489a3b965988f2019792f5ea9dcdd34285
/GCLPrint-src/ado2.cpp
703d09e6964d7f0e7075c96ce3eae8160fa22119
[]
no_license
hrmoh/gclprint
6a3a642e81d6e95eed6842493d4a9ac979c594f7
0e4aec833911c3b73790596bafa4a1c9790fd0b8
refs/heads/master
2023-02-04T04:32:57.230837
2020-12-27T16:51:19
2020-12-27T16:51:19
300,379,690
0
0
null
null
null
null
ISO-8859-2
C++
false
false
44,713
cpp
// // MODULE: Ado2.cpp // // AUTHOR: Carlos Antollini // // mailto: cantollini@hotmail.com // // Date: 07/02/2003 // // Version 2.10 // #include "stdafx.h" #include "ado2.h" #define ChunkSize 100 /////////////////////////////////////////////////////// // // CJetEngine Class // BOOL CJetEngine::CCompactDatabase(CString strDatabaseSource, CString strDatabaseDestination) { try { ::CoInitialize(NULL); IJetEnginePtr jet(__uuidof(JetEngine)); HRESULT hr = jet->CompactDatabase(_bstr_t(strDatabaseSource.GetBuffer(0)), _bstr_t(strDatabaseDestination.GetBuffer(0))); ::CoUninitialize(); return hr == S_OK; } catch(_com_error &e) { ::CoUninitialize(); return FALSE; } } /////////////////////////////////////////////////////// // // CADODatabase Class // DWORD CADODatabase::GetRecordCount(_RecordsetPtr m_pRs) { DWORD numRows = 0; numRows = m_pRs->GetRecordCount(); if(numRows == -1) { if(m_pRs->EndOfFile != VARIANT_TRUE) m_pRs->MoveFirst(); while(m_pRs->EndOfFile != VARIANT_TRUE) { numRows++; m_pRs->MoveNext(); } if(numRows > 0) m_pRs->MoveFirst(); } return numRows; } BOOL CADODatabase::Open(LPCTSTR lpstrConnection, LPCTSTR lpstrUserID, LPCTSTR lpstrPassword) { HRESULT hr = S_OK; if(IsOpen()) Close(); if(strcmp(lpstrConnection, _T("")) != 0) m_strConnection = lpstrConnection; ASSERT(!m_strConnection.IsEmpty()); try { if(m_nConnectionTimeout != 0) m_pConnection->PutConnectionTimeout(m_nConnectionTimeout); hr = m_pConnection->Open(_bstr_t(m_strConnection), _bstr_t(lpstrUserID), _bstr_t(lpstrPassword), NULL); return hr == S_OK; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } void CADODatabase::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format( "CADODataBase Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n", e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription); m_strErrorDescription = (LPCSTR)bstrDescription ; m_strLastError = _T("Connection String = " + GetConnectionString() + '\n' + ErrorStr); m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox(ErrorStr, MB_OK | MB_ICONERROR ); #endif } BOOL CADODatabase::IsOpen() { if(m_pConnection ) return m_pConnection->GetState() != adStateClosed; return FALSE; } void CADODatabase::Close() { if(IsOpen()) m_pConnection->Close(); } /////////////////////////////////////////////////////// // // CADORecordset Class // CADORecordset::CADORecordset() { m_pRecordset = NULL; m_pCmd = NULL; m_strQuery = _T(""); m_strLastError = _T(""); m_dwLastError = 0; m_pRecBinding = NULL; m_pRecordset.CreateInstance(__uuidof(Recordset)); m_pCmd.CreateInstance(__uuidof(Command)); m_nEditStatus = CADORecordset::dbEditNone; m_nSearchDirection = CADORecordset::searchForward; } CADORecordset::CADORecordset(CADODatabase* pAdoDatabase) { m_pRecordset = NULL; m_pCmd = NULL; m_strQuery = _T(""); m_strLastError = _T(""); m_dwLastError = 0; m_pRecBinding = NULL; m_pRecordset.CreateInstance(__uuidof(Recordset)); m_pCmd.CreateInstance(__uuidof(Command)); m_nEditStatus = CADORecordset::dbEditNone; m_nSearchDirection = CADORecordset::searchForward; m_pConnection = pAdoDatabase->GetActiveConnection(); } BOOL CADORecordset::Open(_ConnectionPtr mpdb, LPCTSTR lpstrExec, int nOption) { Close(); if(strcmp(lpstrExec, _T("")) != 0) m_strQuery = lpstrExec; ASSERT(!m_strQuery.IsEmpty()); if(m_pConnection == NULL) m_pConnection = mpdb; m_strQuery.TrimLeft(); BOOL bIsSelect = m_strQuery.Mid(0, strlen("Select ")).CompareNoCase("select ") == 0 && nOption == openUnknown; try { m_pRecordset->CursorType = adOpenStatic; m_pRecordset->CursorLocation = adUseClient; if(bIsSelect || nOption == openQuery || nOption == openUnknown) m_pRecordset->Open((LPCSTR)m_strQuery, _variant_t((IDispatch*)mpdb, TRUE), adOpenStatic, adLockOptimistic, adCmdUnknown); else if(nOption == openTable) m_pRecordset->Open((LPCSTR)m_strQuery, _variant_t((IDispatch*)mpdb, TRUE), adOpenKeyset, adLockOptimistic, adCmdTable); else if(nOption == openStoredProc) { m_pCmd->ActiveConnection = mpdb; m_pCmd->CommandText = _bstr_t(m_strQuery); m_pCmd->CommandType = adCmdStoredProc; m_pConnection->CursorLocation = adUseClient; m_pRecordset = m_pCmd->Execute(NULL, NULL, adCmdText); } else { TRACE( "Unknown parameter. %d", nOption); return FALSE; } } catch(_com_error &e) { dump_com_error(e); return FALSE; } return m_pRecordset != NULL; } BOOL CADORecordset::Open(LPCTSTR lpstrExec, int nOption) { ASSERT(m_pConnection != NULL); ASSERT(m_pConnection->GetState() != adStateClosed); return Open(m_pConnection, lpstrExec, nOption); } BOOL CADORecordset::OpenSchema(int nSchema, LPCTSTR SchemaID) { try { _variant_t vtSchemaID = vtMissing; if(strlen(SchemaID) != 0) vtSchemaID = SchemaID; m_pRecordset = m_pConnection->OpenSchema((enum SchemaEnum)nSchema, vtMissing, vtSchemaID); return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::Requery() { if(IsOpen()) { try { m_pRecordset->Requery(adExecuteRecord); } catch(_com_error &e) { dump_com_error(e); return FALSE; } } return TRUE; } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, double& dbValue) { double val = (double)NULL; _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; switch(vtFld.vt) { case VT_R4: val = vtFld.fltVal; break; case VT_R8: val = vtFld.dblVal; break; case VT_DECIMAL: //Corrected by José Carlos Martínez Galán val = vtFld.decVal.Lo32; val *= (vtFld.decVal.sign == 128)? -1 : 1; val /= pow(10, vtFld.decVal.scale); break; case VT_UI1: val = vtFld.iVal; break; case VT_I2: case VT_I4: val = vtFld.lVal; break; case VT_INT: val = vtFld.intVal; break; case VT_NULL: case VT_EMPTY: val = 0; break; default: val = vtFld.dblVal; } dbValue = val; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, double& dbValue) { double val = (double)NULL; _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; switch(vtFld.vt) { case VT_R4: val = vtFld.fltVal; break; case VT_R8: val = vtFld.dblVal; break; case VT_DECIMAL: //Corrected by José Carlos Martínez Galán val = vtFld.decVal.Lo32; val *= (vtFld.decVal.sign == 128)? -1 : 1; val /= pow(10, vtFld.decVal.scale); break; case VT_UI1: val = vtFld.iVal; break; case VT_I2: case VT_I4: val = vtFld.lVal; break; case VT_INT: val = vtFld.intVal; break; case VT_NULL: case VT_EMPTY: val = 0; break; default: val = 0; } dbValue = val; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, long& lValue) { long val = (long)NULL; _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; if(vtFld.vt != VT_NULL && vtFld.vt != VT_EMPTY) val = vtFld.lVal; lValue = val; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, long& lValue) { long val = (long)NULL; _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; if(vtFld.vt != VT_NULL && vtFld.vt != VT_EMPTY) val = vtFld.lVal; lValue = val; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, unsigned long& ulValue) { long val = (long)NULL; _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; if(vtFld.vt != VT_NULL && vtFld.vt != VT_EMPTY) val = vtFld.ulVal; ulValue = val; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, unsigned long& ulValue) { long val = (long)NULL; _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; if(vtFld.vt != VT_NULL && vtFld.vt != VT_EMPTY) val = vtFld.ulVal; ulValue = val; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, int& nValue) { int val = NULL; _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; switch(vtFld.vt) { case VT_BOOL: val = vtFld.boolVal; break; case VT_I2: case VT_UI1: val = vtFld.iVal; break; case VT_INT: val = vtFld.intVal; break; case VT_NULL: case VT_EMPTY: val = 0; break; default: val = vtFld.iVal; } nValue = val; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, int& nValue) { int val = (int)NULL; _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; switch(vtFld.vt) { case VT_BOOL: val = vtFld.boolVal; break; case VT_I2: case VT_UI1: val = vtFld.iVal; break; case VT_INT: val = vtFld.intVal; break; case VT_NULL: case VT_EMPTY: val = 0; break; default: val = vtFld.iVal; } nValue = val; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, CString& strValue, CString strDateFormat) { CString str = _T(""); _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; switch(vtFld.vt) { case VT_R4: str = DblToStr(vtFld.fltVal); break; case VT_R8: str = DblToStr(vtFld.dblVal); break; case VT_BSTR: str = vtFld.bstrVal; break; case VT_I2: case VT_UI1: str = IntToStr(vtFld.iVal); break; case VT_INT: str = IntToStr(vtFld.intVal); break; case VT_I4: str = LongToStr(vtFld.lVal); break; case VT_UI4: str = ULongToStr(vtFld.ulVal); break; case VT_DECIMAL: { //Corrected by José Carlos Martínez Galán double val = vtFld.decVal.Lo32; val *= (vtFld.decVal.sign == 128)? -1 : 1; val /= pow(10, vtFld.decVal.scale); str = DblToStr(val); } break; case VT_DATE: { COleDateTime dt(vtFld); if(strDateFormat.IsEmpty()) strDateFormat = _T("%Y-%m-%d %H:%M:%S"); str = dt.Format(strDateFormat); } break; case VT_EMPTY: case VT_NULL: str.Empty(); break; case VT_BOOL: str = vtFld.boolVal == VARIANT_TRUE? 'T':'F'; break; default: str.Empty(); return FALSE; } strValue = str; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, CString& strValue, CString strDateFormat) { CString str = _T(""); _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; switch(vtFld.vt) { case VT_R4: str = DblToStr(vtFld.fltVal); break; case VT_R8: str = DblToStr(vtFld.dblVal); break; case VT_BSTR: str = vtFld.bstrVal; break; case VT_I2: case VT_UI1: str = IntToStr(vtFld.iVal); break; case VT_INT: str = IntToStr(vtFld.intVal); break; case VT_I4: str = LongToStr(vtFld.lVal); break; case VT_UI4: str = ULongToStr(vtFld.ulVal); break; case VT_DECIMAL: { //Corrected by José Carlos Martínez Galán double val = vtFld.decVal.Lo32; val *= (vtFld.decVal.sign == 128)? -1 : 1; val /= pow(10, vtFld.decVal.scale); str = DblToStr(val); } break; case VT_DATE: { COleDateTime dt(vtFld); if(strDateFormat.IsEmpty()) strDateFormat = _T("%Y-%m-%d %H:%M:%S"); str = dt.Format(strDateFormat); } break; case VT_BOOL: str = vtFld.boolVal == VARIANT_TRUE? 'T':'F'; break; case VT_EMPTY: case VT_NULL: str.Empty(); break; default: str.Empty(); return FALSE; } strValue = str; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, COleDateTime& time) { _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; switch(vtFld.vt) { case VT_DATE: { COleDateTime dt(vtFld); time = dt; } break; case VT_EMPTY: case VT_NULL: time.SetStatus(COleDateTime::null); break; default: return FALSE; } return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, COleDateTime& time) { _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; switch(vtFld.vt) { case VT_DATE: { COleDateTime dt(vtFld); time = dt; } break; case VT_EMPTY: case VT_NULL: time.SetStatus(COleDateTime::null); break; default: return FALSE; } return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, bool& bValue) { _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; switch(vtFld.vt) { case VT_BOOL: bValue = vtFld.boolVal == VARIANT_TRUE? true: false; break; case VT_EMPTY: case VT_NULL: bValue = false; break; default: return FALSE; } return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, bool& bValue) { _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; switch(vtFld.vt) { case VT_BOOL: bValue = vtFld.boolVal == VARIANT_TRUE? true: false; break; case VT_EMPTY: case VT_NULL: bValue = false; break; default: return FALSE; } return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, COleCurrency& cyValue) { _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; switch(vtFld.vt) { case VT_CY: cyValue = (CURRENCY)vtFld.cyVal; break; case VT_EMPTY: case VT_NULL: { cyValue = COleCurrency(); cyValue.m_status = COleCurrency::null; } break; default: return FALSE; } return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, COleCurrency& cyValue) { _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; switch(vtFld.vt) { case VT_CY: cyValue = (CURRENCY)vtFld.cyVal; break; case VT_EMPTY: case VT_NULL: { cyValue = COleCurrency(); cyValue.m_status = COleCurrency::null; } break; default: return FALSE; } return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, _variant_t& vtValue) { try { vtValue = m_pRecordset->Fields->GetItem(lpFieldName)->Value; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::GetFieldValue(int nIndex, _variant_t& vtValue) { _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtValue = m_pRecordset->Fields->GetItem(vtIndex)->Value; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::IsFieldNull(LPCTSTR lpFieldName) { _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; return vtFld.vt == VT_NULL; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::IsFieldNull(int nIndex) { _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; return vtFld.vt == VT_NULL; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::IsFieldEmpty(LPCTSTR lpFieldName) { _variant_t vtFld; try { vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; return vtFld.vt == VT_EMPTY || vtFld.vt == VT_NULL; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::IsFieldEmpty(int nIndex) { _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; try { vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value; return vtFld.vt == VT_EMPTY || vtFld.vt == VT_NULL; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::SetFieldEmpty(LPCTSTR lpFieldName) { _variant_t vtFld; vtFld.vt = VT_EMPTY; return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldEmpty(int nIndex) { _variant_t vtFld; vtFld.vt = VT_EMPTY; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtFld); } DWORD CADORecordset::GetRecordCount() { DWORD nRows = 0; nRows = m_pRecordset->GetRecordCount(); if(nRows == -1) { nRows = 0; if(m_pRecordset->EndOfFile != VARIANT_TRUE) m_pRecordset->MoveFirst(); while(m_pRecordset->EndOfFile != VARIANT_TRUE) { nRows++; m_pRecordset->MoveNext(); } if(nRows > 0) m_pRecordset->MoveFirst(); } return nRows; } BOOL CADORecordset::IsOpen() { if(m_pRecordset != NULL && IsConnectionOpen()) return m_pRecordset->GetState() != adStateClosed; return FALSE; } void CADORecordset::Close() { if(IsOpen()) { if (m_nEditStatus != dbEditNone) CancelUpdate(); m_pRecordset->PutSort(_T("")); m_pRecordset->Close(); } } BOOL CADODatabase::Execute(LPCTSTR lpstrExec) { ASSERT(m_pConnection != NULL); ASSERT(strcmp(lpstrExec, _T("")) != 0); _variant_t vRecords; m_nRecordsAffected = 0; try { m_pConnection->CursorLocation = adUseClient; m_pConnection->Execute(_bstr_t(lpstrExec), &vRecords, adExecuteNoRecords); m_nRecordsAffected = vRecords.iVal; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::RecordBinding(CADORecordBinding &pAdoRecordBinding) { HRESULT hr; m_pRecBinding = NULL; //Open the binding interface. if(FAILED(hr = m_pRecordset->QueryInterface(__uuidof(IADORecordBinding), (LPVOID*)&m_pRecBinding ))) { _com_issue_error(hr); return FALSE; } //Bind the recordset to class if(FAILED(hr = m_pRecBinding->BindToRecordset(&pAdoRecordBinding))) { _com_issue_error(hr); return FALSE; } return TRUE; } BOOL CADORecordset::GetFieldInfo(LPCTSTR lpFieldName, CADOFieldInfo* fldInfo) { FieldPtr pField = m_pRecordset->Fields->GetItem(lpFieldName); return GetFieldInfo(pField, fldInfo); } BOOL CADORecordset::GetFieldInfo(int nIndex, CADOFieldInfo* fldInfo) { _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; FieldPtr pField = m_pRecordset->Fields->GetItem(vtIndex); return GetFieldInfo(pField, fldInfo); } BOOL CADORecordset::GetFieldInfo(FieldPtr pField, CADOFieldInfo* fldInfo) { memset(fldInfo, 0, sizeof(CADOFieldInfo)); strcpy(fldInfo->m_strName, (LPCTSTR)pField->GetName()); fldInfo->m_lDefinedSize = pField->GetDefinedSize(); fldInfo->m_nType = pField->GetType(); fldInfo->m_lAttributes = pField->GetAttributes(); if(!IsEof()) fldInfo->m_lSize = pField->GetActualSize(); return TRUE; } BOOL CADORecordset::GetChunk(LPCTSTR lpFieldName, CString& strValue) { FieldPtr pField = m_pRecordset->Fields->GetItem(lpFieldName); return GetChunk(pField, strValue); } BOOL CADORecordset::GetChunk(int nIndex, CString& strValue) { _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; FieldPtr pField = m_pRecordset->Fields->GetItem(vtIndex); return GetChunk(pField, strValue); } BOOL CADORecordset::GetChunk(FieldPtr pField, CString& strValue) { CString str = _T(""); long lngSize, lngOffSet = 0; _variant_t varChunk; lngSize = pField->ActualSize; str.Empty(); while(lngOffSet < lngSize) { try { varChunk = pField->GetChunk(ChunkSize); str += varChunk.bstrVal; lngOffSet += ChunkSize; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } lngOffSet = 0; strValue = str; return TRUE; } BOOL CADORecordset::GetChunk(LPCTSTR lpFieldName, LPVOID lpData) { FieldPtr pField = m_pRecordset->Fields->GetItem(lpFieldName); return GetChunk(pField, lpData); } BOOL CADORecordset::GetChunk(int nIndex, LPVOID lpData) { _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; FieldPtr pField = m_pRecordset->Fields->GetItem(vtIndex); return GetChunk(pField, lpData); } BOOL CADORecordset::GetChunk(FieldPtr pField, LPVOID lpData) { long lngSize, lngOffSet = 0; _variant_t varChunk; UCHAR chData; HRESULT hr; long lBytesCopied = 0; lngSize = pField->ActualSize; while(lngOffSet < lngSize) { try { varChunk = pField->GetChunk(ChunkSize); //Copy the data only upto the Actual Size of Field. for(long lIndex = 0; lIndex <= (ChunkSize - 1); lIndex++) { hr= SafeArrayGetElement(varChunk.parray, &lIndex, &chData); if(SUCCEEDED(hr)) { //Take BYTE by BYTE and advance Memory Location //hr = SafeArrayPutElement((SAFEARRAY FAR*)lpData, &lBytesCopied ,&chData); ((UCHAR*)lpData)[lBytesCopied] = chData; lBytesCopied++; } else break; } lngOffSet += ChunkSize; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } lngOffSet = 0; return TRUE; } BOOL CADORecordset::AppendChunk(LPCTSTR lpFieldName, LPVOID lpData, UINT nBytes) { FieldPtr pField = m_pRecordset->Fields->GetItem(lpFieldName); return AppendChunk(pField, lpData, nBytes); } BOOL CADORecordset::AppendChunk(int nIndex, LPVOID lpData, UINT nBytes) { _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; FieldPtr pField = m_pRecordset->Fields->GetItem(vtIndex); return AppendChunk(pField, lpData, nBytes); } BOOL CADORecordset::AppendChunk(FieldPtr pField, LPVOID lpData, UINT nBytes) { HRESULT hr; _variant_t varChunk; long lngOffset = 0; UCHAR chData; SAFEARRAY FAR *psa = NULL; SAFEARRAYBOUND rgsabound[1]; try { //Create a safe array to store the array of BYTES rgsabound[0].lLbound = 0; rgsabound[0].cElements = nBytes; psa = SafeArrayCreate(VT_UI1,1,rgsabound); while(lngOffset < (long)nBytes) { chData = ((UCHAR*)lpData)[lngOffset]; hr = SafeArrayPutElement(psa, &lngOffset, &chData); if(FAILED(hr)) return FALSE; lngOffset++; } lngOffset = 0; //Assign the Safe array to a variant. varChunk.vt = VT_ARRAY|VT_UI1; varChunk.parray = psa; hr = pField->AppendChunk(varChunk); if(SUCCEEDED(hr)) return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } return FALSE; } CString CADORecordset::GetString(LPCTSTR lpCols, LPCTSTR lpRows, LPCTSTR lpNull, long numRows) { _bstr_t varOutput; _bstr_t varNull(""); _bstr_t varCols("\t"); _bstr_t varRows("\r"); if(strlen(lpCols) != 0) varCols = _bstr_t(lpCols); if(strlen(lpRows) != 0) varRows = _bstr_t(lpRows); if(numRows == 0) numRows =(long)GetRecordCount(); varOutput = m_pRecordset->GetString(adClipString, numRows, varCols, varRows, varNull); return (LPCTSTR)varOutput; } CString IntToStr(int nVal) { CString strRet; char buff[10]; itoa(nVal, buff, 10); strRet = buff; return strRet; } CString LongToStr(long lVal) { CString strRet; char buff[20]; ltoa(lVal, buff, 10); strRet = buff; return strRet; } CString ULongToStr(unsigned long ulVal) { CString strRet; char buff[20]; ultoa(ulVal, buff, 10); strRet = buff; return strRet; } CString DblToStr(double dblVal, int ndigits) { CString strRet; char buff[50]; _gcvt(dblVal, ndigits, buff); strRet = buff; return strRet; } CString DblToStr(float fltVal) { CString strRet = _T(""); char buff[50]; _gcvt(fltVal, 10, buff); strRet = buff; return strRet; } void CADORecordset::Edit() { m_nEditStatus = dbEdit; } BOOL CADORecordset::AddNew() { m_nEditStatus = dbEditNone; if(m_pRecordset->AddNew() != S_OK) return FALSE; m_nEditStatus = dbEditNew; return TRUE; } BOOL CADORecordset::AddNew(CADORecordBinding &pAdoRecordBinding) { try { if(m_pRecBinding->AddNew(&pAdoRecordBinding) != S_OK) { return FALSE; } else { m_pRecBinding->Update(&pAdoRecordBinding); return TRUE; } } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::Update() { BOOL bret = TRUE; if(m_nEditStatus != dbEditNone) { try { if(m_pRecordset->Update() != S_OK) bret = FALSE; } catch(_com_error &e) { dump_com_error(e); bret = FALSE; } if(!bret) m_pRecordset->CancelUpdate(); m_nEditStatus = dbEditNone; } return bret; } void CADORecordset::CancelUpdate() { m_pRecordset->CancelUpdate(); m_nEditStatus = dbEditNone; } BOOL CADORecordset::SetFieldValue(int nIndex, CString strValue) { _variant_t vtFld; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; if(!strValue.IsEmpty()) vtFld.vt = VT_BSTR; else vtFld.vt = VT_NULL; //Corrected by Giles Forster 10/03/2001 vtFld.bstrVal = strValue.AllocSysString(); return PutFieldValue(vtIndex, vtFld); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, CString strValue) { _variant_t vtFld; if(!strValue.IsEmpty()) vtFld.vt = VT_BSTR; else vtFld.vt = VT_NULL; //Corrected by Giles Forster 10/03/2001 vtFld.bstrVal = strValue.AllocSysString(); return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldValue(int nIndex, int nValue) { _variant_t vtFld; vtFld.vt = VT_I2; vtFld.iVal = nValue; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtFld); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, int nValue) { _variant_t vtFld; vtFld.vt = VT_I2; vtFld.iVal = nValue; return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldValue(int nIndex, long lValue) { _variant_t vtFld; vtFld.vt = VT_I4; vtFld.lVal = lValue; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtFld); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, long lValue) { _variant_t vtFld; vtFld.vt = VT_I4; vtFld.lVal = lValue; return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldValue(int nIndex, unsigned long ulValue) { _variant_t vtFld; vtFld.vt = VT_UI4; vtFld.ulVal = ulValue; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtFld); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, unsigned long ulValue) { _variant_t vtFld; vtFld.vt = VT_UI4; vtFld.ulVal = ulValue; return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldValue(int nIndex, double dblValue) { _variant_t vtFld; vtFld.vt = VT_R8; vtFld.dblVal = dblValue; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtFld); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, double dblValue) { _variant_t vtFld; vtFld.vt = VT_R8; vtFld.dblVal = dblValue; return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldValue(int nIndex, COleDateTime time) { _variant_t vtFld; vtFld.vt = VT_DATE; vtFld.date = time; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtFld); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, COleDateTime time) { _variant_t vtFld; vtFld.vt = VT_DATE; vtFld.date = time; return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldValue(int nIndex, bool bValue) { _variant_t vtFld; vtFld.vt = VT_BOOL; vtFld.boolVal = bValue; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtFld); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, bool bValue) { _variant_t vtFld; vtFld.vt = VT_BOOL; vtFld.boolVal = bValue; return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldValue(int nIndex, COleCurrency cyValue) { if(cyValue.m_status == COleCurrency::invalid) return FALSE; _variant_t vtFld; vtFld.vt = VT_CY; vtFld.cyVal = cyValue.m_cur; _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtFld); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, COleCurrency cyValue) { if(cyValue.m_status == COleCurrency::invalid) return FALSE; _variant_t vtFld; vtFld.vt = VT_CY; vtFld.cyVal = cyValue.m_cur; return PutFieldValue(lpFieldName, vtFld); } BOOL CADORecordset::SetFieldValue(int nIndex, _variant_t vtValue) { _variant_t vtIndex; vtIndex.vt = VT_I2; vtIndex.iVal = nIndex; return PutFieldValue(vtIndex, vtValue); } BOOL CADORecordset::SetFieldValue(LPCTSTR lpFieldName, _variant_t vtValue) { return PutFieldValue(lpFieldName, vtValue); } BOOL CADORecordset::SetBookmark() { if(m_varBookmark.vt != VT_EMPTY) { m_pRecordset->Bookmark = m_varBookmark; return TRUE; } return FALSE; } BOOL CADORecordset::Delete() { if(m_pRecordset->Delete(adAffectCurrent) != S_OK) return FALSE; if(m_pRecordset->Update() != S_OK) return FALSE; m_nEditStatus = dbEditNone; return TRUE; } BOOL CADORecordset::Find(LPCTSTR lpFind, int nSearchDirection) { m_strFind = lpFind; m_nSearchDirection = nSearchDirection; ASSERT(!m_strFind.IsEmpty()); if(m_nSearchDirection == searchForward) { m_pRecordset->Find(_bstr_t(m_strFind), 0, adSearchForward, ""); if(!IsEof()) { m_varBookFind = m_pRecordset->Bookmark; return TRUE; } } else if(m_nSearchDirection == searchBackward) { m_pRecordset->Find(_bstr_t(m_strFind), 0, adSearchBackward, ""); if(!IsBof()) { m_varBookFind = m_pRecordset->Bookmark; return TRUE; } } else { TRACE("Unknown parameter. %d", nSearchDirection); m_nSearchDirection = searchForward; } return FALSE; } BOOL CADORecordset::FindFirst(LPCTSTR lpFind) { m_pRecordset->MoveFirst(); return Find(lpFind); } BOOL CADORecordset::FindNext() { if(m_nSearchDirection == searchForward) { m_pRecordset->Find(_bstr_t(m_strFind), 1, adSearchForward, m_varBookFind); if(!IsEof()) { m_varBookFind = m_pRecordset->Bookmark; return TRUE; } } else { m_pRecordset->Find(_bstr_t(m_strFind), 1, adSearchBackward, m_varBookFind); if(!IsBof()) { m_varBookFind = m_pRecordset->Bookmark; return TRUE; } } return FALSE; } BOOL CADORecordset::PutFieldValue(LPCTSTR lpFieldName, _variant_t vtFld) { if(m_nEditStatus == dbEditNone) return FALSE; try { m_pRecordset->Fields->GetItem(lpFieldName)->Value = vtFld; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::PutFieldValue(_variant_t vtIndex, _variant_t vtFld) { if(m_nEditStatus == dbEditNone) return FALSE; try { m_pRecordset->Fields->GetItem(vtIndex)->Value = vtFld; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::Clone(CADORecordset &pRs) { try { pRs.m_pRecordset = m_pRecordset->Clone(adLockUnspecified); return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::SetFilter(LPCTSTR strFilter) { ASSERT(IsOpen()); try { m_pRecordset->PutFilter(strFilter); return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::SetSort(LPCTSTR strCriteria) { ASSERT(IsOpen()); try { m_pRecordset->PutSort(strCriteria); return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::SaveAsXML(LPCTSTR lpstrXMLFile) { HRESULT hr; ASSERT(IsOpen()); try { hr = m_pRecordset->Save(lpstrXMLFile, adPersistXML); return hr == S_OK; } catch(_com_error &e) { dump_com_error(e); return FALSE; } return TRUE; } BOOL CADORecordset::OpenXML(LPCTSTR lpstrXMLFile) { HRESULT hr = S_OK; if(IsOpen()) Close(); try { hr = m_pRecordset->Open(lpstrXMLFile, "Provider=MSPersist;", adOpenForwardOnly, adLockOptimistic, adCmdFile); return hr == S_OK; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADORecordset::Execute(CADOCommand* pAdoCommand) { if(IsOpen()) Close(); ASSERT(!pAdoCommand->GetText().IsEmpty()); try { m_pConnection->CursorLocation = adUseClient; m_pRecordset = pAdoCommand->GetCommand()->Execute(NULL, NULL, pAdoCommand->GetType()); return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } void CADORecordset::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format( "CADORecordset Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n", e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription ); m_strLastError = _T("Query = " + GetQuery() + '\n' + ErrorStr); m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox( ErrorStr, MB_OK | MB_ICONERROR ); #endif } /////////////////////////////////////////////////////// // // CADOCommad Class // CADOCommand::CADOCommand(CADODatabase* pAdoDatabase, CString strCommandText, int nCommandType) { m_pCommand = NULL; m_pCommand.CreateInstance(__uuidof(Command)); m_strCommandText = strCommandText; m_pCommand->CommandText = m_strCommandText.AllocSysString(); m_nCommandType = nCommandType; m_pCommand->CommandType = (CommandTypeEnum)m_nCommandType; m_pCommand->ActiveConnection = pAdoDatabase->GetActiveConnection(); m_nRecordsAffected = 0; } BOOL CADOCommand::AddParameter(CADOParameter* pAdoParameter) { ASSERT(pAdoParameter->GetParameter() != NULL); try { m_pCommand->Parameters->Append(pAdoParameter->GetParameter()); return TRUE; } catch(_com_error& e) { dump_com_error(e); return FALSE; } } BOOL CADOCommand::AddParameter(CString strName, int nType, int nDirection, long lSize, int nValue) { _variant_t vtValue; vtValue.vt = VT_I2; vtValue.iVal = nValue; return AddParameter(strName, nType, nDirection, lSize, vtValue); } BOOL CADOCommand::AddParameter(CString strName, int nType, int nDirection, long lSize, long lValue) { _variant_t vtValue; vtValue.vt = VT_I4; vtValue.lVal = lValue; return AddParameter(strName, nType, nDirection, lSize, vtValue); } BOOL CADOCommand::AddParameter(CString strName, int nType, int nDirection, long lSize, double dblValue, int nPrecision, int nScale) { _variant_t vtValue; vtValue.vt = VT_R8; vtValue.dblVal = dblValue; return AddParameter(strName, nType, nDirection, lSize, vtValue, nPrecision, nScale); } BOOL CADOCommand::AddParameter(CString strName, int nType, int nDirection, long lSize, CString strValue) { _variant_t vtValue; vtValue.vt = VT_BSTR; vtValue.bstrVal = strValue.AllocSysString(); return AddParameter(strName, nType, nDirection, lSize, vtValue); } BOOL CADOCommand::AddParameter(CString strName, int nType, int nDirection, long lSize, COleDateTime time) { _variant_t vtValue; vtValue.vt = VT_DATE; vtValue.date = time; return AddParameter(strName, nType, nDirection, lSize, vtValue); } BOOL CADOCommand::AddParameter(CString strName, int nType, int nDirection, long lSize, _variant_t vtValue, int nPrecision, int nScale) { try { _ParameterPtr pParam = m_pCommand->CreateParameter(strName.AllocSysString(), (DataTypeEnum)nType, (ParameterDirectionEnum)nDirection, lSize, vtValue); pParam->PutPrecision(nPrecision); pParam->PutNumericScale(nScale); m_pCommand->Parameters->Append(pParam); return TRUE; } catch(_com_error& e) { dump_com_error(e); return FALSE; } } void CADOCommand::SetText(CString strCommandText) { ASSERT(!strCommandText.IsEmpty()); m_strCommandText = strCommandText; m_pCommand->CommandText = m_strCommandText.AllocSysString(); } void CADOCommand::SetType(int nCommandType) { m_nCommandType = nCommandType; m_pCommand->CommandType = (CommandTypeEnum)m_nCommandType; } BOOL CADOCommand::Execute() { _variant_t vRecords; m_nRecordsAffected = 0; try { m_pCommand->Execute(&vRecords, NULL, adCmdStoredProc); m_nRecordsAffected = vRecords.iVal; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } void CADOCommand::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format( "CADOCommand Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n", e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription ); m_strLastError = ErrorStr; m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox(ErrorStr, MB_OK | MB_ICONERROR); #endif } /////////////////////////////////////////////////////// // // CADOParameter Class // CADOParameter::CADOParameter(int nType, long lSize, int nDirection, CString strName) { m_pParameter = NULL; m_pParameter.CreateInstance(__uuidof(Parameter)); m_strName = _T(""); m_pParameter->Direction = (ParameterDirectionEnum)nDirection; m_strName = strName; m_pParameter->Name = m_strName.AllocSysString(); m_pParameter->Type = (DataTypeEnum)nType; m_pParameter->Size = lSize; m_nType = nType; } BOOL CADOParameter::SetValue(int nValue) { _variant_t vtVal; ASSERT(m_pParameter != NULL); vtVal.vt = VT_I2; vtVal.iVal = nValue; try { if(m_pParameter->Size == 0) m_pParameter->Size = sizeof(int); m_pParameter->Value = vtVal; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::SetValue(long lValue) { _variant_t vtVal; ASSERT(m_pParameter != NULL); vtVal.vt = VT_I4; vtVal.lVal = lValue; try { if(m_pParameter->Size == 0) m_pParameter->Size = sizeof(long); m_pParameter->Value = vtVal; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::SetValue(double dblValue) { _variant_t vtVal; ASSERT(m_pParameter != NULL); vtVal.vt = VT_R8; vtVal.dblVal = dblValue; try { if(m_pParameter->Size == 0) m_pParameter->Size = sizeof(double); m_pParameter->Value = vtVal; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::SetValue(CString strValue) { _variant_t vtVal; ASSERT(m_pParameter != NULL); if(!strValue.IsEmpty()) vtVal.vt = VT_BSTR; else vtVal.vt = VT_NULL; //Corrected by Giles Forster 10/03/2001 vtVal.bstrVal = strValue.AllocSysString(); try { if(m_pParameter->Size == 0) m_pParameter->Size = sizeof(char) * strValue.GetLength(); m_pParameter->Value = vtVal; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::SetValue(COleDateTime time) { _variant_t vtVal; ASSERT(m_pParameter != NULL); vtVal.vt = VT_DATE; vtVal.date = time; try { if(m_pParameter->Size == 0) m_pParameter->Size = sizeof(DATE); m_pParameter->Value = vtVal; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::SetValue(_variant_t vtValue) { ASSERT(m_pParameter != NULL); try { if(m_pParameter->Size == 0) m_pParameter->Size = sizeof(VARIANT); m_pParameter->Value = vtValue; return TRUE; } catch(_com_error &e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::GetValue(int& nValue) { _variant_t vtVal; int nVal = 0; try { vtVal = m_pParameter->Value; switch(vtVal.vt) { case VT_BOOL: nVal = vtVal.boolVal; break; case VT_I2: case VT_UI1: nVal = vtVal.iVal; break; case VT_INT: nVal = vtVal.intVal; break; case VT_NULL: case VT_EMPTY: nVal = 0; break; default: nVal = vtVal.iVal; } nValue = nVal; return TRUE; } catch(_com_error& e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::GetValue(long& lValue) { _variant_t vtVal; long lVal = 0; try { vtVal = m_pParameter->Value; if(vtVal.vt != VT_NULL && vtVal.vt != VT_EMPTY) lVal = vtVal.lVal; lValue = lVal; return TRUE; } catch(_com_error& e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::GetValue(double& dbValue) { _variant_t vtVal; double dblVal; try { vtVal = m_pParameter->Value; switch(vtVal.vt) { case VT_R4: dblVal = vtVal.fltVal; break; case VT_R8: dblVal = vtVal.dblVal; break; case VT_DECIMAL: //Corrected by José Carlos Martínez Galán dblVal = vtVal.decVal.Lo32; dblVal *= (vtVal.decVal.sign == 128)? -1 : 1; dblVal /= pow(10, vtVal.decVal.scale); break; case VT_UI1: dblVal = vtVal.iVal; break; case VT_I2: case VT_I4: dblVal = vtVal.lVal; break; case VT_INT: dblVal = vtVal.intVal; break; case VT_NULL: case VT_EMPTY: dblVal = 0; break; default: dblVal = 0; } dbValue = dblVal; return TRUE; } catch(_com_error& e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::GetValue(CString& strValue, CString strDateFormat) { _variant_t vtVal; CString strVal = _T(""); try { vtVal = m_pParameter->Value; switch(vtVal.vt) { case VT_R4: strVal = DblToStr(vtVal.fltVal); break; case VT_R8: strVal = DblToStr(vtVal.dblVal); break; case VT_BSTR: strVal = vtVal.bstrVal; break; case VT_I2: case VT_UI1: strVal = IntToStr(vtVal.iVal); break; case VT_INT: strVal = IntToStr(vtVal.intVal); break; case VT_I4: strVal = LongToStr(vtVal.lVal); break; case VT_DECIMAL: { //Corrected by José Carlos Martínez Galán double val = vtVal.decVal.Lo32; val *= (vtVal.decVal.sign == 128)? -1 : 1; val /= pow(10, vtVal.decVal.scale); strVal = DblToStr(val); } break; case VT_DATE: { COleDateTime dt(vtVal); if(strDateFormat.IsEmpty()) strDateFormat = _T("%Y-%m-%d %H:%M:%S"); strVal = dt.Format(strDateFormat); } break; case VT_EMPTY: case VT_NULL: strVal.Empty(); break; default: strVal.Empty(); return FALSE; } strValue = strVal; return TRUE; } catch(_com_error& e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::GetValue(COleDateTime& time) { _variant_t vtVal; try { vtVal = m_pParameter->Value; switch(vtVal.vt) { case VT_DATE: { COleDateTime dt(vtVal); time = dt; } break; case VT_EMPTY: case VT_NULL: time.SetStatus(COleDateTime::null); break; default: return FALSE; } return TRUE; } catch(_com_error& e) { dump_com_error(e); return FALSE; } } BOOL CADOParameter::GetValue(_variant_t& vtValue) { try { vtValue = m_pParameter->Value; return TRUE; } catch(_com_error& e) { dump_com_error(e); return FALSE; } } void CADOParameter::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format( "CADOParameter Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n", e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription ); m_strLastError = ErrorStr; m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox(ErrorStr, MB_OK | MB_ICONERROR); #endif } IMPLEMENT_DYNAMIC(CADOException, CException) CADOException::CADOException(int nCause, CString strErrorString) : CException(TRUE) { m_nCause = nCause; m_strErrorString = strErrorString; } CADOException::~CADOException() { } int CADOException::GetError(int nADOError) { switch (nADOError) { case noError: return CADOException::noError; break; default: return CADOException::Unknown; } } void AfxThrowADOException(int nADOError, CString strErrorString) { throw new CADOException(nADOError, strErrorString); } ; void CADORecordset::Move(long lWhere) { m_pRecordset->Move(lWhere); }
[ "mohammadi.hr@gmail.com" ]
mohammadi.hr@gmail.com
52cf5bd80c49e706728ed85a50dca41d0b108f8e
0505bb3c35c3ed915a4703f39828a1993abfb68d
/Robotica/src/Thanos_Neon1/Thanos_Neon/Thanos_Neon.ino
58b23375aa25290541df5da6eaac7327cafca733
[]
no_license
InfinityLoopA-Z/Portfolio
10436da38ca805303262af7af5bec0d37b148ba5
40f0f5abae95d6a7fa731055d7fa0d0c37fb927d
refs/heads/master
2023-06-02T23:04:42.754939
2021-06-10T15:39:19
2021-06-10T15:39:19
375,551,303
0
0
null
null
null
null
UTF-8
C++
false
false
23,567
ino
//Bibliotecas //#include <NewPing.h> //#include <Servo.h> // incluimos la biblioteca Servo #include <SoftwareSerial.h> #include "IRremote.h" //pin de recepcion de mandos del control remoto IR int receiver = 11; IRrecv irrecv(receiver); decode_results results; #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif //pines de led rgb Neo #define PIN 4 #define NUMPIXELS 8 Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); //led de la placa #define LedF A4 #define LedD 7 #define LedI A5 //Servo //#define ServoPala 11 //MOTORES #define MotorAdelanteD 9//9 #define MotorAtrasD 10//10 #define MotorAdelanteI 5//6 #define MotorAtrasI 6//5 //PWM #define PWM_adelante 200//255 #define PWM_giro 110//178 #define PWM_giro_lento 128//70 #define PWM_atras 128//90//255 #define vel_compensatoria 150 #define velofsetderecho 0 //aumentar un numero para mermar la velocidad del motor izquierdo #define velofsetizquierdo 0 //aumentar un numero para mermar la velocidad del motor derecho //Sensor de linea #define si 2 //8 //Sensor de linea adelante izquierdo #define sd 3 //4 //Sensor de linea adelante derecho #define sai 4 //2 //Sensor de linea atras izquierda #define sad 8 //3 //Sensor de linea atrasd derecha //Detección POR INFRARROJOS #define IadelanteI A3//A2//(IR-Adelante Izquierdo) #define IadelanteD A1//A0//(IR-Adelante Derecho) #define IRderecha A0//A1//(IR-Derecho) #define IRizquierda A2//A3//(IR- Izquierdo) #define IRfrontal A6// //Ultrasonido #define Trigger 13 //FRONTAL #define MaxD 200 // Maxima distancia que detecta el ultrasonido(En Cm) #define Alcance 60 //Alcance para los ultrasonidos //Start #define Pulsador 12 //-VARIABLES--- int blanco = 0; int negro = 1; //Variables Linea byte Aizquierdo = negro; byte Aderecho = negro; byte AtrasI = negro; byte AtrasD = negro; //Variables IR int Izquierda = 0; int Derecha = 0; int AdelanteI = 0; int AdelanteD = 0; int Frontal =0; byte estrategia=1; // byte alcance=50; const long referenceMv = 5000;//variable usada para calculo de la distancia Sharp //variables usadas para cambiar los movimientos del robot aleatoriamente unsigned long tiempoAnterior = 0; //guarda tiempo de referencia para comparar int periodo = 2000; // TIEMPO QUE DURA UN MOVIMIENTO ALEATORIO DEL ROBOT long randNumber; //--BLUETOOTH--- int DATA_CONTROL=0; SoftwareSerial blueToothSerial(0,1); //Objetos de Funciones //Servo Miservo; // Objeto para controlar el servo //-------voids----------- void MEDIR_DISTANCIA(void); void lecturaUS(void); void lecturaIR(void); void lecturaSharp(void); void logica(void); void adelante(void); void atras(void); void izquierda(void); void derecha(void); void parar(void); void sensoreslinea(void); void Pala(void); void Start(void); void setup() { Serial.begin(9600); irrecv.enableIRIn(); pixels.begin(); // This initializes the NeoPixel library. pinMode(si, INPUT); pinMode(sd, INPUT); pinMode(sai, INPUT); pinMode(sad, INPUT); pinMode(Pulsador, INPUT); pinMode(MotorAdelanteD, OUTPUT); pinMode(MotorAdelanteI, OUTPUT); pinMode(MotorAtrasD, OUTPUT); pinMode(MotorAtrasI, OUTPUT); pinMode(IadelanteI, INPUT); pinMode(IadelanteD, INPUT); pinMode(IRizquierda, INPUT); pinMode(IRderecha, INPUT); pinMode(IRfrontal, INPUT); pinMode(Trigger, OUTPUT); pinMode(LedF, OUTPUT); pinMode(LedD, OUTPUT); pinMode(LedI, OUTPUT); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } ir_control(); delay (5000); BEGIN: MEDIR_DISTANCIA(); if(Frontal == HIGH || AdelanteI == HIGH || AdelanteD == HIGH || Derecha == HIGH || Izquierda == HIGH) { goto comenzar; } else { switch(estrategia) { case 1: derecha(); //Calibrar con nuevas ruedas delay(80); adelante(); delay(300); Serial.println("estrategia 1"); break; case 2: derecha(); //Calibrar con nuevas ruedas delay(10); adelante(); delay(300); Serial.println("estrategia 2"); break; case 3: adelante(); //Calibrar con nuevas ruedas delay(500); Serial.println("estrategia 3"); break; case 4: derecha(); //Calibrar con nuevas ruedas delay(100); adelante(); delay(50); Serial.println("estrategia 4"); break; case 5: izquierda(); //Calibrar con nuevas ruedas delay(50); adelante(); delay(50); } } comenzar: ; } void ir_control() { volver_1: if (irrecv.decode(&results)) //recibio datos del control? { switch(results.value)//que datos recibi? { case 0x00FF629D: Serial.println("Tecla: Arriba"); estrategia=1; pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(0, pixels.Color(150,0,0)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. break; case 0x00FF22DD: Serial.println("Tecla: Izquierda"); estrategia=2; pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(3, pixels.Color(0,150,0)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. break; case 0x00FF02FD: Serial.println("Tecla: OK"); pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(0, pixels.Color(255,255,255)); // Moderately bright green color. pixels.setPixelColor(1, pixels.Color(0,0,150)); // Moderately bright green color. pixels.setPixelColor(2, pixels.Color(255,0,0)); // Moderately bright green color. pixels.setPixelColor(3, pixels.Color(87,35,100)); // Moderately bright green color. pixels.setPixelColor(4, pixels.Color(255,255,0)); // Moderately bright green color. pixels.setPixelColor(5, pixels.Color(127,255,212)); // Moderately bright green color. pixels.setPixelColor(6, pixels.Color(255,126,0)); // Moderately bright green color. pixels.setPixelColor(7, pixels.Color(255,255,255)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. goto regresar; break; case 0x00FFC23D: Serial.println("Tecla: Derecha"); estrategia=4; pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(1, pixels.Color(0,0,150)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. break; case 0x00FFA857: Serial.println("Tecla: Abajo"); estrategia=3; pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(2, pixels.Color(150,150,0)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. break; case 0x00FF6897: Serial.println("Tecla: 1"); estrategia=5; pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++){ pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show; } pixels.setPixelColor(3, pixels.Color(0,0,0)); pixels.show(); break; case 0x00FF9867: Serial.println("Tecla: 2"); goto regresar; break; case 0x0FFB04F: Serial.println("Tecla: 3"); MEDIR_DISTANCIA(); if(Frontal == HIGH) { pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(3, pixels.Color(150,0,0)); // Moderately bright green color. pixels.setPixelColor(4, pixels.Color(150,0,0)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. delay (500); } break; } irrecv.resume(); } //* /* if(AdelanteD == HIGH) { pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(1, pixels.Color(150,0,0)); // Moderately bright green color. pixels.setPixelColor(2, pixels.Color(150,0,0)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. goto volver_1; } else{ for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show();} goto volver_1; } } if(AdelanteI == HIGH) { pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(5, pixels.Color(150,0,0)); // Moderately bright green color. pixels.setPixelColor(6, pixels.Color(150,0,0)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. goto volver_1; } else{ for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show();} goto volver_1; } if(Derecha == HIGH) { pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(0, pixels.Color(150,0,0)); // Moderately bright green color pixels.show(); // This sends the updated pixel color to the hardware. goto volver_1; } else{ for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show();} goto volver_1; } if(Izquierda == HIGH) { pixels.begin(); for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show(); } pixels.setPixelColor(7, pixels.Color(150,0,0)); // Moderately bright green color pixels.show(); // This sends the updated pixel color to the hardware. goto volver_1; } else{ for(uint16_t i=0; i<NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(0,0,0)); pixels.show();} goto volver_1; } //*/ goto volver_1; regresar: ; } void loop() { prueba_motores(); //sensoreslinea (); //MEDIR_DISTANCIA(); //logica (); } void prueba_motores() { adelante(); delay(2000); atras(); delay(2000); derecha(); delay(2000); izquierda(); delay(2000); /* izquierda_lento(); delay(3000); derecha_lento(); delay(3000); //*/ } void logica () { if (Frontal == HIGH || AdelanteI == HIGH || AdelanteD == HIGH || Derecha == HIGH || Izquierda == HIGH) { //*atacar si detecto con los 2 frontales if (Frontal == HIGH ) { adelante();//atacar delay(10); jmp_10:sensoreslinea(); MEDIR_DISTANCIA(); if (Frontal == HIGH )//detecto con los frontales? { //Serial.println("Atacar"); goto jmp_10; } else { //atras(); delay(10); goto salir_1; } } //* //---------------FASE DE PERSECUCION------------------------------------------ if (AdelanteI == LOW && AdelanteD == HIGH) { //detecte al oponente con el frontal derecho fase de busqueda //Serial.println("detecte con el frontal DERECHO"); derecha_lento(); jmp_20: sensoreslinea (); MEDIR_DISTANCIA(); if (Frontal == HIGH ) { //VOY A ATACAR AL OPONENTE //delay(300); adelante(); goto jmp_10; } else {//DETECTO CON EL FRONTAL izquierdo? if (AdelanteI == HIGH && AdelanteD == LOW ) { //Serial.println("detecte con el frontal IZQUIERDO"); izquierda_lento(); goto jmp_21; } else { if(Izquierda == HIGH && AdelanteD == LOW ) { //Serial.println("LO DETECTE A LA IZQUIERDA"); izquierda(); goto jmp_11; } else { //MEDIR_DISTANCIA(); if(Derecha == HIGH && AdelanteD == LOW ) {//Serial.println("LO DETECTE A LA DERECHA"); derecha(); goto jmp_12; } } } } derecha_lento();//VER SI ESTA BIEN goto jmp_20; } //-------------------FASE DE PERSECUCION------------------------------------------------- if (AdelanteI == HIGH && AdelanteD == LOW) {//detecte al oponente con el frontal izquierdo FASE DE BUSQUEDA //Serial.println("DETECTE CON EL FRONTAL A LA IZQUIERDA"); izquierda_lento(); jmp_21: sensoreslinea(); MEDIR_DISTANCIA(); if (Frontal == HIGH ) { //Serial.println("Atacar"); //delay(300); adelante(); goto jmp_10; } else { if (AdelanteI == LOW && AdelanteD == HIGH) { //Serial.println("DETECTE CON EL FRONTAL DERECHO"); derecha_lento(); goto jmp_20; } else { //MEDIR_DISTANCIA(); if(Derecha == HIGH) { //Serial.println("detecte al oponente a la derecha"); derecha(); goto jmp_12; } else { if(Izquierda == HIGH) { //Serial.println("detecte al oponente a la izquierdo"); izquierda(); goto jmp_11 ; } } }//--------- } izquierda_lento(); goto jmp_21; } //*/ //++++++++++busco si lo detecto a la izquierda++++++++++++++++++++++++ if (Izquierda ==HIGH )//es por que estoy detectando a la izquierda { //Serial.println("detecte al oponente a la izquierda"); izquierda(); delay(10); jmp_11: sensoreslinea (); MEDIR_DISTANCIA(); if (Frontal == HIGH ) { //Serial.println("Atacar"); adelante(); goto jmp_10; } else { //atras(); if (Derecha == HIGH)//OPONENTE A LA DERECHA { //Serial.println("detecte al oponente a la derecha"); derecha(); goto jmp_12; } else { if(AdelanteI == HIGH && Izquierda == LOW ) { //Serial.println("detecte con el frontal izquierdo"); izquierda_lento(); goto jmp_21 ; } else { if(AdelanteD == HIGH && Derecha == LOW ) { //Serial.println("detecte con el frontal derecho"); derecha_lento(); goto jmp_20 ; } } izquierda(); goto jmp_11; } } izquierda(); } //* //####################################################################### if (Derecha == HIGH)//OPONENTE A LA DERECHA { //Serial.println("detecte al oponente a la derecha"); derecha(); delay(10); jmp_12:sensoreslinea (); MEDIR_DISTANCIA(); if (Frontal == HIGH ) { //Serial.println("Atacar"); adelante(); goto jmp_10; } else { if (Izquierda == HIGH )//es por que estoy detectando a la izquierda { //Serial.println("detecte a la izquierda"); izquierda(); goto jmp_11; } else { if(AdelanteI == HIGH && Izquierda == LOW ) { //Serial.println("detecte con el frontal izquierdo"); izquierda_lento(); goto jmp_21 ; } else { if(AdelanteD == HIGH && Derecha == LOW ) { //Serial.println("detecte con el frontal derecho"); derecha_lento(); goto jmp_20 ; } } derecha(); goto jmp_12; } } derecha(); } //*/ } else {//movimientos aleatorios cada un tiempo prefijado MEJORAR salir_1: derecha_lento(); //Serial.println("perdi al oponente"); } } void MEDIR_DISTANCIA(){ lecturaIR(); //lecturaUS(); //lecturaSharp(); } void lecturaIR() { AdelanteI = digitalRead(IadelanteI); AdelanteD = digitalRead(IadelanteD); Derecha= digitalRead(IRderecha); Izquierda= digitalRead(IRizquierda); Frontal= analogRead(IRfrontal); //INVIERTO LA LOGICA DE DETECCION DE LOS IR if (Frontal > 100) { Frontal = LOW; } else { Frontal = HIGH; } if (AdelanteI == HIGH) { AdelanteI = LOW; } else { AdelanteI = HIGH; } if (AdelanteD == HIGH) { AdelanteD = LOW; } else { AdelanteD = HIGH; } //* if (Derecha == HIGH) { Derecha = LOW; } else { Derecha = HIGH; } if (Izquierda == HIGH) { Izquierda = LOW; } else { Izquierda = HIGH; } //*/ //ENCIENDO LOS LEDS DE LA PLACA //* if (AdelanteI ==HIGH || AdelanteD == HIGH || Frontal == HIGH) { digitalWrite(LedF, HIGH); } else { digitalWrite(LedF, LOW); } //* if (Derecha == HIGH) { digitalWrite(LedD, HIGH); } else { digitalWrite(LedD, LOW); } if (Izquierda == HIGH) { digitalWrite(LedI, HIGH); } else { digitalWrite(LedI, LOW); } //*/ //Serial.println("AdelanteI"); //Serial.println("AdelanteD"); } void lecturaUS(){ //Midiendo distancia //UltrasonidoI = Ultra1.ping_cm(); //Ultrasonido Izquierdo delay (5); //UltrasonidoD = Ultra2.ping_cm(); //Ultrasonido Derecho delay (5); // Serial.print("UltrasonidoI="); // Serial.print(UltrasonidoI); // Serial.print("UltrasonidoD="); // Serial.println(UltrasonidoD); } void lecturaSharp() { int val=0; int mV =0; /* val= analogRead(IadelanteI); mV = (val * referenceMv) / 1023; AdelanteI = getDistance(mV);//mido distancia con sensor frontal izquierdo val = analogRead(IadelanteD); mV = (val * referenceMv) / 1023; AdelanteD = getDistance(mV);//mido distancia con sensor frontal derecho */ val = analogRead(IRderecha); mV = (val * referenceMv) / 1023; Derecha = getDistance(mV);//mido distancia con sensor derecho val = analogRead(IRizquierda); mV = (val * referenceMv) / 1023; Izquierda = getDistance(mV);//mido distancia con sensor izquierdo //--------------------------------------------------------------- //digitalizo los valores analogicos /* if (AdelanteI < alcance) { AdelanteI = HIGH; } else { AdelanteI = LOW; } if (AdelanteD < alcance) { AdelanteD = HIGH; } else { AdelanteD = LOW; } */ if (Derecha < alcance) { Derecha = HIGH; } else { Derecha = LOW; } if (Izquierda < alcance) { Izquierda = HIGH; } else { Izquierda = LOW; } //ENCIENDO LOS LEDS DE LA PLACA /* if (AdelanteI ==HIGH || AdelanteD == HIGH) { digitalWrite(LedF, HIGH); } else { digitalWrite(LedF, LOW); } */ if (Derecha == HIGH) { digitalWrite(LedD, HIGH); } else { digitalWrite(LedD, LOW); } if (Izquierda == HIGH) { digitalWrite(LedI, HIGH); } else { digitalWrite(LedI, LOW); } //Serial.println("AdelanteI"); //Serial.println("AdelanteD"); } //interpolación de la distancia a intervalos de 250mV const int TABLE_ENTRIES = 12; const int INTERVAL = 250; static int distance[TABLE_ENTRIES] = {150,140,130,100,60,50,40,35,30,25,20,15}; int getDistance(int mV) { if (mV > INTERVAL * TABLE_ENTRIES - 1) return distance[TABLE_ENTRIES - 1]; else { int index = mV / INTERVAL; float frac = (mV % 250) / (float)INTERVAL; return distance[index] - ((distance[index] - distance[index + 1]) * frac); } } void sensoreslinea () { //Lectura de sensores de detección Aizquierdo = digitalRead(si); Aderecho = digitalRead(sd); //AtrasI = digitalRead(sai); //AtrasD = digitalRead(sad); /* Serial.print(Aizquierdo); Serial.print(" "); Serial.print(Aderecho); Serial.print(" "); Serial.print(AtrasI); Serial.print(" "); Serial.println(AtrasD); ;//*/ if (AtrasD == negro && AtrasI == negro && Aizquierdo == negro && Aderecho == negro) { goto salir_1; } if (Aderecho == blanco || Aizquierdo == blanco ) { atras(); delay(300); // Serial.print("ATRAS "); } /* if (AtrasI == blanco || AtrasD == blanco) { adelante(); delay(300); } //*/ salir_1: ; } //---FUNCIONES-------------- void atras() { analogWrite(MotorAdelanteD, 0); analogWrite(MotorAdelanteI, 0); analogWrite(MotorAtrasD, PWM_atras); analogWrite(MotorAtrasI, PWM_atras); } void adelante() { analogWrite(MotorAdelanteD, PWM_adelante); analogWrite(MotorAdelanteI, PWM_adelante); analogWrite(MotorAtrasD, 0); analogWrite(MotorAtrasI, 0); } void derecha() { analogWrite(MotorAdelanteD, PWM_giro ); analogWrite(MotorAdelanteI, 0); analogWrite(MotorAtrasD, 0); analogWrite(MotorAtrasI, PWM_giro + vel_compensatoria); } void derecha_lento() { analogWrite(MotorAdelanteD, PWM_giro_lento ); analogWrite(MotorAtrasD, 0); analogWrite(MotorAdelanteI, 0); analogWrite(MotorAtrasI, 0); } void izquierda() { analogWrite(MotorAdelanteD, 0); analogWrite(MotorAdelanteI, PWM_giro ); analogWrite(MotorAtrasD, PWM_giro ); analogWrite(MotorAtrasI, 0); } void izquierda_lento() { analogWrite(MotorAdelanteD, 0); analogWrite(MotorAtrasD, 0); analogWrite(MotorAdelanteI, PWM_giro_lento - velofsetizquierdo); analogWrite(MotorAtrasI, 0); } void parar() { analogWrite(MotorAdelanteD, 0); analogWrite(MotorAdelanteI, 0); analogWrite(MotorAtrasD, 0); analogWrite(MotorAtrasI, 0); } void Pala() { //Miservo.write(0); delay(250); // Posiciona al servo //Miservo.detach() ; }
[ "felixhumbertocarabajal5@gmail.com" ]
felixhumbertocarabajal5@gmail.com
392c1d569b3e0fb58bd0cd75f1a700743a226490
16cb1efe697b372d4a36341570ff7ed7cc00f81c
/samples/gl-420-texture-conversion.cpp
8521ec54765f3d15d74ec30d1662ce30f7e898a9
[ "MIT" ]
permissive
bitzhuwei/ogl-samples4.3
170677e58660ba5bd84d13b67f4127b0e1bbb46e
808aeae83b28d15e79e9972c0366628282d2b3a3
refs/heads/master
2020-12-24T15:31:13.904707
2015-08-14T19:40:05
2015-08-14T19:40:05
40,731,592
0
1
null
null
null
null
UTF-8
C++
false
false
10,132
cpp
//********************************** // OpenGL Texture Conversion // 26/02/2012 - 26/02/2012 //********************************** // Christophe Riccio // ogl-samples@g-truc.net //********************************** // G-Truc Creation // www.g-truc.net //********************************** #include <glf/glf.hpp> namespace { std::string const SAMPLE_NAME("OpenGL Texture Conversion"); std::string const VERT_SHADER_SOURCE(glf::DATA_DIRECTORY + "gl-420/texture-conversion.vert"); std::string const FRAG_SHADER_SOURCE[2] = { glf::DATA_DIRECTORY + "gl-420/texture-conversion-normalized.frag", glf::DATA_DIRECTORY + "gl-420/texture-conversion-uint.frag" }; std::string const TEXTURE_DIFFUSE(glf::DATA_DIRECTORY + "kueken2-bgra8.dds"); int const SAMPLE_SIZE_WIDTH(640); int const SAMPLE_SIZE_HEIGHT(480); int const SAMPLE_MAJOR_VERSION(4); int const SAMPLE_MINOR_VERSION(2); glf::window Window(glm::ivec2(SAMPLE_SIZE_WIDTH, SAMPLE_SIZE_HEIGHT)); GLsizei const VertexCount(4); GLsizeiptr const VertexSize = VertexCount * sizeof(glf::vertex_v2fv2f); glf::vertex_v2fv2f const VertexData[VertexCount] = { glf::vertex_v2fv2f(glm::vec2(-1.0f,-1.0f), glm::vec2(0.0f, 1.0f)), glf::vertex_v2fv2f(glm::vec2( 1.0f,-1.0f), glm::vec2(1.0f, 1.0f)), glf::vertex_v2fv2f(glm::vec2( 1.0f, 1.0f), glm::vec2(1.0f, 0.0f)), glf::vertex_v2fv2f(glm::vec2(-1.0f, 1.0f), glm::vec2(0.0f, 0.0f)) }; GLsizei const ElementCount(6); GLsizeiptr const ElementSize = ElementCount * sizeof(GLushort); GLushort const ElementData[ElementCount] = { 0, 1, 2, 2, 3, 0 }; namespace texture { enum type { RGBA8, // GL_RGBA8 RGBA8UI, // GL_RGBA8UI RGBA32F, // GL_RGBA32F RGBA8_SNORM, MAX }; }//namespace texture namespace program { enum type { NORM, UINT, MAX }; }//namespace program namespace buffer { enum type { VERTEX, ELEMENT, TRANSFORM, MAX }; }//namespace buffer GLenum TextureInternalFormat[texture::MAX] = { GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RGBA8UI, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_RGBA8_SNORM }; GLenum TextureFormat[texture::MAX] = { GL_BGRA, GL_BGRA_INTEGER, GL_BGRA, GL_BGRA }; GLuint VertexArrayName(0); GLuint PipelineName[program::MAX] = {0, 0}; GLuint ProgramName[program::MAX] = {0, 0}; GLuint BufferName[buffer::MAX] = {0, 0, 0}; GLuint TextureName[texture::MAX] = {0, 0}; glm::ivec4 Viewport[texture::MAX] = { glm::ivec4( 0, 0, 320, 240), glm::ivec4(320, 0, 320, 240), glm::ivec4(320, 240, 320, 240), glm::ivec4( 0, 240, 320, 240) }; }//namespace bool initDebugOutput() { bool Validated(true); glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB); glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE); glDebugMessageCallbackARB(&glf::debugOutput, NULL); return Validated; } bool initProgram() { bool Validated(true); glGenProgramPipelines(program::MAX, PipelineName); for(std::size_t i = 0; (i < program::MAX) && Validated; ++i) { GLuint VertShaderName = glf::createShader(GL_VERTEX_SHADER, VERT_SHADER_SOURCE); GLuint FragShaderNameNorm = glf::createShader(GL_FRAGMENT_SHADER, FRAG_SHADER_SOURCE[program::NORM]); GLuint FragShaderNameUint = glf::createShader(GL_FRAGMENT_SHADER, FRAG_SHADER_SOURCE[program::UINT]); ProgramName[program::NORM] = glCreateProgram(); glProgramParameteri(ProgramName[program::NORM], GL_PROGRAM_SEPARABLE, GL_TRUE); glAttachShader(ProgramName[program::NORM], VertShaderName); glAttachShader(ProgramName[program::NORM], FragShaderNameNorm); glLinkProgram(ProgramName[program::NORM]); Validated = Validated && glf::checkProgram(ProgramName[program::NORM]); ProgramName[program::UINT] = glCreateProgram(); glProgramParameteri(ProgramName[program::UINT], GL_PROGRAM_SEPARABLE, GL_TRUE); glAttachShader(ProgramName[program::UINT], VertShaderName); glAttachShader(ProgramName[program::UINT], FragShaderNameUint); glLinkProgram(ProgramName[program::UINT]); Validated = Validated && glf::checkProgram(ProgramName[program::UINT]); glDeleteShader(VertShaderName); glDeleteShader(FragShaderNameNorm); glDeleteShader(FragShaderNameUint); } if(Validated) { glUseProgramStages(PipelineName[program::NORM], GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, ProgramName[program::NORM]); glUseProgramStages(PipelineName[program::UINT], GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, ProgramName[program::UINT]); } return Validated; } bool initBuffer() { bool Validated(true); glGenBuffers(buffer::MAX, BufferName); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, BufferName[buffer::ELEMENT]); glBufferData(GL_ELEMENT_ARRAY_BUFFER, ElementSize, ElementData, GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, BufferName[buffer::VERTEX]); glBufferData(GL_ARRAY_BUFFER, VertexSize, VertexData, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); GLint UniformBufferOffset(0); glGetIntegerv( GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &UniformBufferOffset); GLint UniformBlockSize = glm::max(GLint(sizeof(glm::mat4)), UniformBufferOffset); glBindBuffer(GL_UNIFORM_BUFFER, BufferName[buffer::TRANSFORM]); glBufferData(GL_UNIFORM_BUFFER, UniformBlockSize, NULL, GL_DYNAMIC_DRAW); glBindBuffer(GL_UNIFORM_BUFFER, 0); return Validated; } bool initTexture() { gli::texture2D Texture = gli::load(TEXTURE_DIFFUSE); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glGenTextures(texture::MAX, TextureName); glActiveTexture(GL_TEXTURE0); for(std::size_t i = 0; i < texture::MAX; ++i) { glBindTexture(GL_TEXTURE_2D, TextureName[i]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexStorage2D(GL_TEXTURE_2D, GLint(Texture.levels()), TextureInternalFormat[i], GLsizei(Texture[0].dimensions().x), GLsizei(Texture[0].dimensions().y)); for(std::size_t Level = 0; Level < Texture.levels(); ++Level) { glTexSubImage2D( GL_TEXTURE_2D, GLint(Level), 0, 0, GLsizei(Texture[Level].dimensions().x), GLsizei(Texture[Level].dimensions().y), TextureFormat[i], GL_UNSIGNED_BYTE, Texture[Level].data()); } } glBindTexture(GL_TEXTURE_2D, 0); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); return true; } bool initVertexArray() { glGenVertexArrays(1, &VertexArrayName); glBindVertexArray(VertexArrayName); glBindBuffer(GL_ARRAY_BUFFER, BufferName[buffer::VERTEX]); glVertexAttribPointer(glf::semantic::attr::POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(glf::vertex_v2fv2f), GLF_BUFFER_OFFSET(0)); glVertexAttribPointer(glf::semantic::attr::TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(glf::vertex_v2fv2f), GLF_BUFFER_OFFSET(sizeof(glm::vec2))); glBindBuffer(GL_ARRAY_BUFFER, 0); glEnableVertexAttribArray(glf::semantic::attr::POSITION); glEnableVertexAttribArray(glf::semantic::attr::TEXCOORD); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, BufferName[buffer::ELEMENT]); glBindVertexArray(0); return true; } bool begin() { bool Validated(glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION)); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initTexture(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); return Validated; } bool end() { bool Validated(true); glDeleteBuffers(buffer::MAX, BufferName); for(std::size_t i = 0; i < program::MAX; ++i) glDeleteProgram(ProgramName[i]); glDeleteTextures(texture::MAX, TextureName); glDeleteVertexArrays(1, &VertexArrayName); return Validated; } void display() { glClearBufferfv(GL_COLOR, 0, &glm::vec4(1.0f, 0.5f, 0.0f, 1.0f)[0]); // Update of the uniform buffer { glBindBuffer(GL_UNIFORM_BUFFER, BufferName[buffer::TRANSFORM]); glm::mat4* Pointer = (glm::mat4*)glMapBufferRange( GL_UNIFORM_BUFFER, 0, sizeof(glm::mat4), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.0f); glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Window.TranlationCurrent.y)); glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Window.RotationCurrent.y, glm::vec3(1.f, 0.f, 0.f)); glm::mat4 View = glm::rotate(ViewRotateX, Window.RotationCurrent.x, glm::vec3(0.f, 1.f, 0.f)); glm::mat4 Model = glm::mat4(1.0f); *Pointer = Projection * View * Model; // Make sure the uniform buffer is uploaded glUnmapBuffer(GL_UNIFORM_BUFFER); } glBindBufferBase(GL_UNIFORM_BUFFER, glf::semantic::uniform::TRANSFORM0, BufferName[buffer::TRANSFORM]); glBindVertexArray(VertexArrayName); glActiveTexture(GL_TEXTURE0); glBindProgramPipeline(PipelineName[program::UINT]); { glViewportIndexedfv(0, &glm::vec4(Viewport[texture::RGBA8UI])[0]); glBindTexture(GL_TEXTURE_2D, TextureName[texture::RGBA8UI]); glDrawElementsInstancedBaseVertexBaseInstance( GL_TRIANGLES, ElementCount, GL_UNSIGNED_SHORT, 0, 1, 0, 0); } glBindProgramPipeline(PipelineName[program::NORM]); { glViewportIndexedfv(0, &glm::vec4(Viewport[texture::RGBA32F])[0]); glBindTexture(GL_TEXTURE_2D, TextureName[texture::RGBA32F]); glDrawElementsInstancedBaseVertexBaseInstance( GL_TRIANGLES, ElementCount, GL_UNSIGNED_SHORT, 0, 1, 0, 0); glViewportIndexedfv(0, &glm::vec4(Viewport[texture::RGBA8])[0]); glBindTexture(GL_TEXTURE_2D, TextureName[texture::RGBA8]); glDrawElementsInstancedBaseVertexBaseInstance( GL_TRIANGLES, ElementCount, GL_UNSIGNED_SHORT, 0, 1, 0, 0); glViewportIndexedfv(0, &glm::vec4(Viewport[texture::RGBA8_SNORM])[0]); glBindTexture(GL_TEXTURE_2D, TextureName[texture::RGBA8_SNORM]); glDrawElementsInstancedBaseVertexBaseInstance( GL_TRIANGLES, ElementCount, GL_UNSIGNED_SHORT, 0, 1, 0, 0); } glf::swapBuffers(); } int main(int argc, char* argv[]) { return glf::run( argc, argv, glm::ivec2(::SAMPLE_SIZE_WIDTH, ::SAMPLE_SIZE_HEIGHT), WGL_CONTEXT_CORE_PROFILE_BIT_ARB, ::SAMPLE_MAJOR_VERSION, ::SAMPLE_MINOR_VERSION); }
[ "bitzhuwei.cnblogs@qq.com" ]
bitzhuwei.cnblogs@qq.com
4da03b3299379dd54ba6d7c1d339862bd8f49142
0e40a0486826825c2c8adba9a538e16ad3efafaf
/S3DWrapper10/Commands/ShaderResourceViewReadAfterWriteHazard.h
dd96df753ade8329129e733aad3758ea5e8cc53b
[ "MIT" ]
permissive
iraqigeek/iZ3D
4c45e69a6e476ad434d5477f21f5b5eb48336727
ced8b3a4b0a152d0177f2e94008918efc76935d5
refs/heads/master
2023-05-25T19:04:06.082744
2020-12-28T03:27:55
2020-12-28T03:27:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,332
h
#pragma once #include "Command.h" namespace Commands { class ShaderResourceViewReadAfterWriteHazard : public CommandWithAllocator<ShaderResourceViewReadAfterWriteHazard> { public: EMPTY_OUTPUT(); ShaderResourceViewReadAfterWriteHazard() { CommandId = idShaderResourceViewReadAfterWriteHazard; State_ = COMMAND_MAY_USE_STEREO_RESOURCES; } ShaderResourceViewReadAfterWriteHazard( D3D10DDI_HSHADERRESOURCEVIEW hShaderResourceView, D3D10DDI_HRESOURCE hResource ) { CommandId = idShaderResourceViewReadAfterWriteHazard; State_ = COMMAND_MAY_USE_STEREO_RESOURCES; hShaderResourceView_ = hShaderResourceView; hResource_ = hResource; } virtual void Execute ( D3DDeviceWrapper *pWrapper ); virtual bool WriteToFile ( D3DDeviceWrapper *pWrapper ) const; virtual bool ReadFromFile (); virtual bool IsUsedStereoResources( D3DDeviceWrapper* /*pWrapper*/ ) const; virtual void SetDestResourceType( TextureType type ); virtual void GetDestResources(DestResourcesSet &res); public: D3D10DDI_HSHADERRESOURCEVIEW hShaderResourceView_; D3D10DDI_HRESOURCE hResource_; }; } VOID ( APIENTRY ShaderResourceViewReadAfterWriteHazard )( D3D10DDI_HDEVICE hDevice, D3D10DDI_HSHADERRESOURCEVIEW hShaderResourceView, D3D10DDI_HRESOURCE hResource );
[ "github@bo3b.net" ]
github@bo3b.net
de0720a8350e78def22ab4e62aa4f37ecfcb48f5
cea6a02d0dfcd9e14ec75fa5d70e594a6b7876bf
/src/rpcdump.cpp
25523c9d78690784f9e3d34b69039641d8356817
[ "MIT" ]
permissive
Netchaincoin/Netchain-coin
fb4d15fbf0a6d6edd7ae7b07f535e1b89fdc6aa1
081608ccf1b3d522ccd617ce2c25838af299e3c1
refs/heads/master
2021-01-21T07:19:53.543825
2017-05-17T18:56:56
2017-05-17T18:56:56
91,609,565
0
1
null
null
null
null
UTF-8
C++
false
false
11,271
cpp
// Copyright (c) 2009-2012 Bitcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <iostream> #include <fstream> #include "init.h" // for pwalletMain #include "bitcoinrpc.h" #include "ui_interface.h" #include "base58.h" #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/variant/get.hpp> #include <boost/algorithm/string.hpp> #define printf OutputDebugStringF using namespace json_spirit; using namespace std; void EnsureWalletIsUnlocked(); namespace bt = boost::posix_time; // Extended DecodeDumpTime implementation, see this page for details: // http://stackoverflow.com/questions/3786201/parsing-of-date-time-from-string-boost const std::locale formats[] = { std::locale(std::locale::classic(),new bt::time_input_facet("%Y-%m-%dT%H:%M:%SZ")), std::locale(std::locale::classic(),new bt::time_input_facet("%Y-%m-%d %H:%M:%S")), std::locale(std::locale::classic(),new bt::time_input_facet("%Y/%m/%d %H:%M:%S")), std::locale(std::locale::classic(),new bt::time_input_facet("%d.%m.%Y %H:%M:%S")), std::locale(std::locale::classic(),new bt::time_input_facet("%Y-%m-%d")) }; const size_t formats_n = sizeof(formats)/sizeof(formats[0]); std::time_t pt_to_time_t(const bt::ptime& pt) { bt::ptime timet_start(boost::gregorian::date(1970,1,1)); bt::time_duration diff = pt - timet_start; return diff.ticks()/bt::time_duration::rep_type::ticks_per_second; } int64_t DecodeDumpTime(const std::string& s) { bt::ptime pt; for(size_t i=0; i<formats_n; ++i) { std::istringstream is(s); is.imbue(formats[i]); is >> pt; if(pt != bt::ptime()) break; } return pt_to_time_t(pt); } std::string static EncodeDumpTime(int64_t nTime) { return DateTimeStrFormat("%Y-%m-%dT%H:%M:%SZ", nTime); } std::string static EncodeDumpString(const std::string &str) { std::stringstream ret; BOOST_FOREACH(unsigned char c, str) { if (c <= 32 || c >= 128 || c == '%') { ret << '%' << HexStr(&c, &c + 1); } else { ret << c; } } return ret.str(); } std::string DecodeDumpString(const std::string &str) { std::stringstream ret; for (unsigned int pos = 0; pos < str.length(); pos++) { unsigned char c = str[pos]; if (c == '%' && pos+2 < str.length()) { c = (((str[pos+1]>>6)*9+((str[pos+1]-'0')&15)) << 4) | ((str[pos+2]>>6)*9+((str[pos+2]-'0')&15)); pos += 2; } ret << c; } return ret.str(); } class CTxDump { public: CBlockIndex *pindex; int64_t nValue; bool fSpent; CWalletTx* ptx; int nOut; CTxDump(CWalletTx* ptx = NULL, int nOut = -1) { pindex = NULL; nValue = 0; fSpent = false; this->ptx = ptx; this->nOut = nOut; } }; Value importprivkey(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "importprivkey <netchainprivkey> [label]\n" "Adds a private key (as returned by dumpprivkey) to your wallet."); string strSecret = params[0].get_str(); string strLabel = ""; if (params.size() > 1) strLabel = params[1].get_str(); CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(strSecret); if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); if (fWalletUnlockStakingOnly) throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Wallet is unlocked for staking only."); CKey key; bool fCompressed; CSecret secret = vchSecret.GetSecret(fCompressed); key.SetSecret(secret, fCompressed); CKeyID vchAddress = key.GetPubKey().GetID(); { LOCK2(cs_main, pwalletMain->cs_wallet); pwalletMain->MarkDirty(); pwalletMain->SetAddressBookName(vchAddress, strLabel); // Don't throw error in case a key is already there if (pwalletMain->HaveKey(vchAddress)) return Value::null; pwalletMain->mapKeyMetadata[vchAddress].nCreateTime = 1; if (!pwalletMain->AddKey(key)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); // whenever a key is imported, we need to scan the whole chain pwalletMain->nTimeFirstKey = 1; // 0 would be considered 'no value' pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true); pwalletMain->ReacceptWalletTransactions(); } return Value::null; } Value importwallet(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "importwallet <filename>\n" "Imports keys from a wallet dump file (see dumpwallet)."); EnsureWalletIsUnlocked(); ifstream file; file.open(params[0].get_str().c_str()); if (!file.is_open()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file"); int64_t nTimeBegin = pindexBest->nTime; bool fGood = true; while (file.good()) { std::string line; std::getline(file, line); if (line.empty() || line[0] == '#') continue; std::vector<std::string> vstr; boost::split(vstr, line, boost::is_any_of(" ")); if (vstr.size() < 2) continue; CBitcoinSecret vchSecret; if (!vchSecret.SetString(vstr[0])) continue; bool fCompressed; CKey key; CSecret secret = vchSecret.GetSecret(fCompressed); key.SetSecret(secret, fCompressed); CKeyID keyid = key.GetPubKey().GetID(); if (pwalletMain->HaveKey(keyid)) { printf("Skipping import of %s (key already present)\n", CBitcoinAddress(keyid).ToString().c_str()); continue; } int64_t nTime = DecodeDumpTime(vstr[1]); std::string strLabel; bool fLabel = true; for (unsigned int nStr = 2; nStr < vstr.size(); nStr++) { if (boost::algorithm::starts_with(vstr[nStr], "#")) break; if (vstr[nStr] == "change=1") fLabel = false; if (vstr[nStr] == "reserve=1") fLabel = false; if (boost::algorithm::starts_with(vstr[nStr], "label=")) { strLabel = DecodeDumpString(vstr[nStr].substr(6)); fLabel = true; } } printf("Importing %s...\n", CBitcoinAddress(keyid).ToString().c_str()); if (!pwalletMain->AddKey(key)) { fGood = false; continue; } pwalletMain->mapKeyMetadata[keyid].nCreateTime = nTime; if (fLabel) pwalletMain->SetAddressBookName(keyid, strLabel); nTimeBegin = std::min(nTimeBegin, nTime); } file.close(); CBlockIndex *pindex = pindexBest; while (pindex && pindex->pprev && pindex->nTime > nTimeBegin - 7200) pindex = pindex->pprev; if (!pwalletMain->nTimeFirstKey || nTimeBegin < pwalletMain->nTimeFirstKey) pwalletMain->nTimeFirstKey = nTimeBegin; printf("Rescanning last %i blocks\n", pindexBest->nHeight - pindex->nHeight + 1); pwalletMain->ScanForWalletTransactions(pindex); pwalletMain->ReacceptWalletTransactions(); pwalletMain->MarkDirty(); if (!fGood) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding some keys to wallet"); return Value::null; } Value dumpprivkey(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "dumpprivkey <netchainaddress>\n" "Reveals the private key corresponding to <netchainaddress>."); EnsureWalletIsUnlocked(); string strAddress = params[0].get_str(); CBitcoinAddress address; if (!address.SetString(strAddress)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Netchain address"); if (fWalletUnlockStakingOnly) throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Wallet is unlocked for staking only."); CKeyID keyID; if (!address.GetKeyID(keyID)) throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key"); CSecret vchSecret; bool fCompressed; if (!pwalletMain->GetSecret(keyID, vchSecret, fCompressed)) throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known"); return CBitcoinSecret(vchSecret, fCompressed).ToString(); } Value dumpwallet(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "dumpwallet <filename>\n" "Dumps all wallet keys in a human-readable format."); EnsureWalletIsUnlocked(); ofstream file; file.open(params[0].get_str().c_str()); if (!file.is_open()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file"); std::map<CKeyID, int64_t> mapKeyBirth; std::set<CKeyID> setKeyPool; pwalletMain->GetKeyBirthTimes(mapKeyBirth); pwalletMain->GetAllReserveKeys(setKeyPool); // sort time/key pairs std::vector<std::pair<int64_t, CKeyID> > vKeyBirth; for (std::map<CKeyID, int64_t>::const_iterator it = mapKeyBirth.begin(); it != mapKeyBirth.end(); it++) { vKeyBirth.push_back(std::make_pair(it->second, it->first)); } mapKeyBirth.clear(); std::sort(vKeyBirth.begin(), vKeyBirth.end()); // produce output file << strprintf("# Wallet dump created by Netchain %s (%s)\n", CLIENT_BUILD.c_str(), CLIENT_DATE.c_str()); file << strprintf("# * Created on %s\n", EncodeDumpTime(GetTime()).c_str()); file << strprintf("# * Best block at time of backup was %i (%s),\n", nBestHeight, hashBestChain.ToString().c_str()); file << strprintf("# mined on %s\n", EncodeDumpTime(pindexBest->nTime).c_str()); file << "\n"; for (std::vector<std::pair<int64_t, CKeyID> >::const_iterator it = vKeyBirth.begin(); it != vKeyBirth.end(); it++) { const CKeyID &keyid = it->second; std::string strTime = EncodeDumpTime(it->first); std::string strAddr = CBitcoinAddress(keyid).ToString(); bool IsCompressed; CKey key; if (pwalletMain->GetKey(keyid, key)) { if (pwalletMain->mapAddressBook.count(keyid)) { CSecret secret = key.GetSecret(IsCompressed); file << strprintf("%s %s label=%s # addr=%s\n", CBitcoinSecret(secret, IsCompressed).ToString().c_str(), strTime.c_str(), EncodeDumpString(pwalletMain->mapAddressBook[keyid]).c_str(), strAddr.c_str()); } else if (setKeyPool.count(keyid)) { CSecret secret = key.GetSecret(IsCompressed); file << strprintf("%s %s reserve=1 # addr=%s\n", CBitcoinSecret(secret, IsCompressed).ToString().c_str(), strTime.c_str(), strAddr.c_str()); } else { CSecret secret = key.GetSecret(IsCompressed); file << strprintf("%s %s change=1 # addr=%s\n", CBitcoinSecret(secret, IsCompressed).ToString().c_str(), strTime.c_str(), strAddr.c_str()); } } } file << "\n"; file << "# End of dump\n"; file.close(); return Value::null; }
[ "netchaincoin@gmail.com" ]
netchaincoin@gmail.com
38e54c4ce283537fde32fdd9fb27e81826ab2b3a
9016e3870e9e06957f25e127b3f50225db4d65b4
/src/net/third_party/quiche/src/http2/tools/random_util.h
6e7218906502b095b9361b3d551f09813b10b360
[ "BSD-3-Clause" ]
permissive
bylond/naiveproxy
f0a30493e0662251247a87c73a1b73388ef16d1b
a04a8330a8bb0d0892259cf6d795271fbe6e6d0e
refs/heads/master
2021-02-02T00:46:35.836722
2020-03-11T03:43:22
2020-03-11T03:43:22
243,525,007
1
0
BSD-3-Clause
2020-03-11T03:43:23
2020-02-27T13:23:59
null
UTF-8
C++
false
false
943
h
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef QUICHE_HTTP2_TOOLS_RANDOM_UTIL_H_ #define QUICHE_HTTP2_TOOLS_RANDOM_UTIL_H_ #include <stddef.h> #include <string> #include "net/third_party/quiche/src/http2/test_tools/http2_random.h" namespace http2 { namespace test { // Generate a string with the allowed character set for HTTP/2 / HPACK header // names. std::string GenerateHttp2HeaderName(size_t len, Http2Random* rng); // Generate a string with the web-safe string character set of specified len. std::string GenerateWebSafeString(size_t len, Http2Random* rng); // Generate a string with the web-safe string character set of length [lo, hi). std::string GenerateWebSafeString(size_t lo, size_t hi, Http2Random* rng); } // namespace test } // namespace http2 #endif // QUICHE_HTTP2_TOOLS_RANDOM_UTIL_H_
[ "kizdiv@gmail.com" ]
kizdiv@gmail.com
ac0cac387ab4e74cf7a112f7d17c8c375a3ec279
c51fcb873c88c54a125ef210d5d3942a2e26330b
/engine/debug.h
e2675ab7ead62c2becbeb52aac320c1626ae9f12
[]
no_license
eskerda/nbgf
41791b1f37f9a583d944bd02db96d038c83035b9
f1fedae4c333b2d62e713b916a2c00760593d78c
refs/heads/main
2023-06-06T11:49:12.393075
2021-06-29T17:28:19
2021-06-29T17:28:19
381,488,982
1
0
null
2021-06-29T20:28:39
2021-06-29T20:28:39
null
UTF-8
C++
false
false
1,140
h
#pragma once #include <iosfwd> #include <ostream> namespace Debug { #ifdef _DEBUG inline bool Draw = false; inline bool FrameByFrame = false; inline bool FastForward = false; #else static const bool Draw = false; static const bool FrameByFrame = false; #endif extern std::ostream& _forwarded_out; }; extern int lastTicks; // Delegate from: https://stackoverflow.com/questions/49332013/adding-a-new-line-after-stdostream-output-without-explicitly-calling-it struct DebugStreamDelegate { DebugStreamDelegate() = default; ~DebugStreamDelegate(); template <typename T> DebugStreamDelegate& operator<<(T&& val) { Debug::_forwarded_out << std::forward<T>(val); return *this; } DebugStreamDelegate& operator=(const DebugStreamDelegate&) = delete; DebugStreamDelegate(const DebugStreamDelegate&) = delete; }; struct DebugStream { template <typename T> DebugStreamDelegate operator<<(T&& val) { Debug::_forwarded_out << lastTicks << ": " << std::forward<T>(val); return DebugStreamDelegate(); } }; namespace Debug { extern DebugStream out; };
[ "albertvaka@gmail.com" ]
albertvaka@gmail.com
5c7dd0a3ef1c0eaa50c7ca2378484cfc97fb49e8
2d1f04f87b80faa8613b4cf3c75a313c8d1e36eb
/CSCE 313/MP1/main.cpp
19ec9ab984bf86fd3dd1229027314f5ac8149677
[]
no_license
dqharris6/School
2a6a48dcaa51ec49ddf51acdde7b09fcd4e2bed7
13df91be8579ce1ae080ed7fe53e6295a7c6397a
refs/heads/master
2021-01-15T08:37:24.300111
2016-08-10T21:43:30
2016-08-10T21:43:30
64,666,217
0
0
null
null
null
null
UTF-8
C++
false
false
1,290
cpp
#include <stdlib.h> #include <string.h> #include <string.h> #include <stdio.h> #include <iostream> #include <getopt.h> #include "linked_list2.h" int main(int argc, char ** argv) { const char* b; const char* s; const char* t; int bflag = 0; int sflag = 0; int tflag = 0; int temp; while((temp = getopt(argc,argv, "b:s:t:")) != -1) { switch(temp) { case 'b': b = optarg; ++bflag; break; case 's': s = optarg; ++sflag; break; case 't': t = optarg; ++tflag; break; default: abort(); } } if(bflag == 0) {b = "128";} if(sflag == 0) {s = "512000";} if(tflag == 0) {t = "4";} char buf [1024]; memset (buf, 1, 1024); // set each byte to 1 const char * msg = "a sample message"; Init(atoi(s), atoi(b), atoi(t)); // initialize // test operations // int testnums [] = {100,5,200,7,39,25,400,50,200,300}; int testnums [] = {0, 1<<29 , (1<<29) + 5 , 50, (1<<30) + 5, (1<<30) - 500}; int i = 0; // some sample insertions for (i=0; i< 6; i ++) { Insert(testnums [i], buf, 50); // insert 50 bytes from the buffer as value for each of the insertions } PrintList(); Delete(50); Delete(5); Delete(1073741829); std::cout << "\n---- AFTER DELETION ----\n"; PrintList(); // end test operations Destroy(); }
[ "dqharris@tamu.edu" ]
dqharris@tamu.edu
00964fc7966c63a099265141ad5f440eadc5d979
6a9c9988b3f0299381961be7d677dca9b6aa4e20
/Code/Array Partition I.cpp
8a114eb73f895201e0e71331337ade0805d9cad7
[]
no_license
siddiqui-zeeshan/Leetcode
d703d551a509339b3d952bb51bae9f73dd31f891
94cdfff5fa67f98e915d36aa0bc1db500d589dd3
refs/heads/master
2022-12-17T19:34:08.094485
2020-09-16T10:43:10
2020-09-16T10:43:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
253
cpp
class Solution { public: int arrayPairSum(vector<int>& nums) { sort(nums.begin(), nums.end()); int sum = 0; for(int i = 0; i < nums.size(); i += 2) { sum += nums[i]; } return sum; } };
[ "ZeeshanSi@users.noreply.github.com" ]
ZeeshanSi@users.noreply.github.com
30f229493032a3208f6d0b4ff056a5cba8966954
6865ec14ac0493b1805e76b5a283d1c59a39bec1
/2017/ИОИП 18_02/C/C.cpp
bd12fca5f50f54e6d98d94f530d1d6d098505b85
[]
no_license
ksercs/school_olympiads
a5736b02ef01ae5a7ee821e6f55c69f4131356f3
e9cdb8e33e38aff98a9fd3ecff502a21bdf360aa
refs/heads/master
2023-06-25T10:36:31.495443
2021-07-25T14:05:58
2021-07-25T14:05:58
389,353,366
0
0
null
null
null
null
UTF-8
C++
false
false
2,492
cpp
#include <iostream> #include <fstream> #include <algorithm> #include <string> #include <cmath> #include <vector> #include <iomanip> #include <set> #include <map> #include <utility> #include <queue> #include <string.h> #define SZ size() #define VEC vector #define PB push_back #define MP make_pair #define SS second #define FF first #define PII pair <int,int> #define LL long long using namespace std; const int MAXN = int(1e5)+5; int n, m, q, L, R, c, fl=1; map < PII, int> col; VEC <VEC <int> > ans; VEC <int> way; int u[MAXN]; void DFS(int v) { u[v] = 1; way.PB(v); if (way.SZ > 100){ fl = 0; return; } for (int i = L; i <= R; ++i){ if (v == way[0]) c = -1; if (i == v || (c != -1 && col[MP(v,i)] != c)) continue; //cout << v << " " << i << " " << c << "\n"; //system("PAUSE"); if (u[i]){ if (i != way[way.SZ-2] && i == way[0]){ //cout << "END!\n"; fl = 2; return; } } else{ //cout << "new\n"; u[i] = 1; c = col[MP(v,i)]; u[i] = 1; DFS(i); u[i] = 0; if (!fl || fl == 2) return; } } u[v] = 0; way.erase(--way.end()); } void in() { ifstream cin("loopquery.in"); cin >> n >> m; for (int i = 0; i < m; ++i){ int a, b; cin >> a >> b; col[MP(a,b)] = 1; col[MP(b,a)] = 1; } cin >> q; ans.resize(q); for (int i = 0; i < q; ++i){ cin >> L >> R; for (int j = L; j <= R; ++j){ //u[j] = 1; c = -1; // cout << "\nHEY!\n"; DFS(j); if (fl == 2){ ans[i] = way; fill(u, u+n+1, 0); way.clear(); fl = 1; break; } fill(u, u+n+1, 0); way.clear(); fl = 1; } } } void out() { ofstream cout("loopquery.out"); for (int i = 0; i < q; ++i){ if (ans[i].SZ == 0) cout << "-1\n"; else{ cout << ans[i].SZ << " "; for (int j = 0; j < ans[i].SZ-1; ++j) cout << ans[i][j] << " "; cout << ans[i][ans[i].SZ-1] << "\n"; } } } int main() { in(); out(); return 0; }
[ "ksercs0@gmail.com" ]
ksercs0@gmail.com
30c913f66d13803045804cfae2bcfed48313dfc6
32febb846ea0d8587af360fe98409a8cdcbf8bca
/072-Queue_Stack.cpp
4a971f4aa9d55190fb29cd4fee4b650cc0300265
[]
no_license
Shakti-chaudhary/C-Apna-College-
a6266c7c2490c30128609b58dacb689de8dffa64
9afa054a651a52057870ee70870ad1259c9efc12
refs/heads/master
2023-07-03T03:24:55.356712
2021-08-10T16:47:49
2021-08-10T16:47:49
320,209,569
0
0
null
null
null
null
UTF-8
C++
false
false
1,690
cpp
#include <iostream> #include <stack> using namespace std; // === Using two stack =========================================== class queue { stack<int> s1; stack<int> s2; public: void push(int x) { s1.push(x); } int pop() { if (s1.empty() and s2.empty()) { cout << "Queue is empty " << endl; return -1; } if (s2.empty()) { while (!s1.empty()) { s2.push(s1.top()); s1.pop(); } } int ans = s2.top(); s2.pop(); return ans; } bool empty() { if (s1.empty() and s2.empty()) { return true; } return false; } }; // ==== Using Function stack ======================================= class que { stack<int> s1; public: void push(int x) { s1.push(x); } int pop() { if (s1.empty()) { cout << "Queue is empty " << endl; return -1; } int ans = s1.top(); s1.pop(); if (s1.empty()) { return ans; } int item=pop(); s1.push(ans); return item; } bool empty() { if (s1.empty()) { return true; } return false; } }; int main() { // queue q; que q; q.push(1); q.push(2); q.push(3); q.push(4); cout << q.pop() << endl; q.push(5); cout << q.pop() << endl; cout << q.pop() << endl; cout << q.pop() << endl; cout << q.pop() << endl; cout << q.pop() << endl; return 0; }
[ "shaktichaudhary4321@gmail.com" ]
shaktichaudhary4321@gmail.com
d271231d14ecbe7c07eb6fc5d624acec8f5de4bf
6252107b144381e0898eb290c62e7d19413b2827
/leetcode008.cpp
4b8ef34a91cf7194ff61baf6c1a2789c8941a2a7
[]
no_license
luhaiya/leetcode
c7f4d9f262537d39faff5db865b4ff4e0ac07e78
c4f585898caab452a399c0e5a8790b90c2c359ee
refs/heads/master
2021-06-25T04:41:58.009696
2017-09-08T08:43:01
2017-09-08T08:43:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
760
cpp
class Solution {   public:       int myAtoi(string str) {           int sign = 1, base = 0, i = 0;           while(str[i] == ' ') ++i;           if(str[i] == '+' || str[i] == '-'){               sign = (str[i++] == '-')?-1:1;           }           while(str[i] >= '0' && str[i] <= '9'){               if(base > INT_MAX/10 || (base == INT_MAX/10 && str[i] - '0' > 7)){                   return (sign == 1)?INT_MAX:INT_MIN;               }               base = 10*base + (str[i++] - '0');           }           return base*sign;       }   };  
[ "noreply@github.com" ]
noreply@github.com
f12bbd31dc146e63067da6e853886b91fd8f8b15
f28c4b045cd9d7974ba5ac4a9359a54ad162c6c0
/GLSLChapter2/GLSLChapter2/SceneADS.cpp
848a7207a585cd9f60d189e2bedaf7f7a15f197a
[]
no_license
hiro425/OpenGL
8e56d2a1ffe6952bd70a6579c2370246ff4799f5
110f6c5c25e89f415491d84c4a4d3b394748d193
refs/heads/master
2021-05-29T00:33:17.155560
2014-08-05T04:57:37
2014-08-05T04:57:37
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,984
cpp
// // SceneADS.cpp // GLSLChapter2 // // Created by 川口大志 on 2014/08/01. // Copyright (c) 2014年 川口大志. All rights reserved. // #include "SceneADS.h" SceneADS::SceneADS() : angle(0.0f) { } void SceneADS::initScene() { compileAndLinkShader(); glClearColor(0.0,0.0,0.0,1.0); glEnable(GL_DEPTH_TEST); torus = new VBOTorus(0.7f, 0.3f, 50, 50); model = mat4(1.0f); model = glm::rotate(model, -35.0f, vec3(1.0f,0.0f,0.0f)); model = glm::rotate(model, 35.0f, vec3(0.0f,1.0f,0.0f)); view = glm::lookAt(vec3(0.0f,0.0f,2.0f), vec3(0.0f,0.0f,0.0f), vec3(0.0f,1.0f,0.0f)); //projection = mat4(1.0f); projection = glm::perspective(90.0f, 800.0f/600.0f, 0.1f, 100.0f); vec4 worldLight = vec4(5.0f,5.0f,2.0f,1.0f); prog.setUniform("Material.Kd", 0.9f, 0.5f, 0.3f); prog.setUniform("Light.Ld", 1.0f, 1.0f, 1.0f); prog.setUniform("Light.Position", view * worldLight ); prog.setUniform("Material.Ka", 0.9f, 0.5f, 0.3f); prog.setUniform("Light.La", 0.4f, 0.4f, 0.4f); prog.setUniform("Material.Ks", 0.8f, 0.8f, 0.8f); prog.setUniform("Light.Ls", 1.0f, 1.0f, 1.0f); prog.setUniform("Material.Shininess", 100.0f); } void SceneADS::update( float t ) { //angle += 1.0f; //if( angle > 360.0 ) angle -= 360.0; } void SceneADS::render() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //model = mat4(1.0f); //model *= glm::rotate(model, angle, vec3(0.0f,1.0f,0.0f)); //model *= glm::rotate(model, -35.0f, vec3(1.0f,0.0f,0.0f)); //model *= glm::rotate(model, 35.0f, vec3(0.0f,1.0f,0.0f)); setMatrices(); torus->render(); } void SceneADS::setMatrices() { mat4 mv = view * model; prog.setUniform("ModelViewMatrix", mv); prog.setUniform("NormalMatrix", mat3( vec3(mv[0]), vec3(mv[1]), vec3(mv[2]) )); prog.setUniform("MVP", projection * mv); } void SceneADS::resize(int w, int h) { glViewport(0,0,w,h); width = w; height = h; projection = glm::perspective(70.0f, (float)w/h, 0.3f, 100.0f); } void SceneADS::compileAndLinkShader() { if( ! prog.compileShaderFromFile("/Users/kawaguchihiroshi/Developer/practice/OpenGL/GLSLChapter2/GLSLChapter2/phong.vert",GLSLShader::VERTEX) ) { printf("Vertex shader failed to compile!\n%s", prog.log().c_str()); exit(1); } if( ! prog.compileShaderFromFile("/Users/kawaguchihiroshi/Developer/practice/OpenGL/GLSLChapter2/GLSLChapter2/phong.frag",GLSLShader::FRAGMENT)) { printf("Fragment shader failed to compile!\n%s", prog.log().c_str()); exit(1); } if( ! prog.link() ) { printf("Shader program failed to link!\n%s", prog.log().c_str()); exit(1); } /* if( ! prog.validate() ) { printf("Program failed to validate!\n%s", prog.log().c_str()); exit(1); } */ prog.use(); }
[ "hi.kwgc@gmail.com" ]
hi.kwgc@gmail.com
cac7fde40f6f91b09252d455b7ff7458a70d4e3f
8a5f8dfdd038590a579d14a84558cce2bb930b22
/AICamera/app/src/main/cpp/caffe2/contrib/script/lexer.h
b576b4ec6ea9b0075232683b2b64fb3885ea4fa9
[ "MIT" ]
permissive
blackxer/AICamera
ebc94c663e6f2ea6e8c81290a64bce4e7d369ed9
4f0a6a09a2288da2ec7140744b5c2862df114c78
refs/heads/master
2020-08-11T19:53:42.388828
2019-10-16T01:19:59
2019-10-16T01:19:59
214,616,987
1
1
null
null
null
null
UTF-8
C++
false
false
15,902
h
#pragma once #include <assert.h> #include <algorithm> #include <iostream> #include <memory> #include <sstream> #include <string> #include <unordered_map> #include <vector> #include "caffe2/core/common.h" namespace caffe2 { namespace script { // single character tokens are just the character itself '+' // multi-character tokens need an entry here // if the third entry is not the empty string, it is used // in the lexer to match this token. // These kinds are also used in Tree.h as the kind of the AST node. // Some kinds TK_APPLY, TK_LIST are only used in the AST and are not seen in the // lexer. #define TC_FORALL_TOKEN_KINDS(_) \ _(TK_EOF, "eof", "") \ _(TK_WHITESPACE, "whitespace", "") \ _(TK_NUMBER, "number", "") \ _(TK_NEWLINE, "newline", "") \ _(TK_INDENT, "indent", "") \ _(TK_DEDENT, "dedent", "") \ _(TK_WHERE, "where", "where") \ _(TK_FLOAT, "float", "float") \ _(TK_DOUBLE, "double", "double") \ _(TK_LONG, "long", "long") \ _(TK_INT, "int", "int") \ _(TK_DEF, "def", "def") \ _(TK_ARROW, "arrow", "->") \ _(TK_EQUIVALENT, "equivalent", "<=>") \ _(TK_IDENT, "ident", "") \ _(TK_STRING, "string", "") \ _(TK_CONST, "const", "") \ _(TK_LIST, "list", "") \ _(TK_OPTION, "option", "") \ _(TK_APPLY, "apply", "") \ _(TK_COMPREHENSION, "comprehension", "") \ _(TK_TENSOR_TYPE, "tensor_type", "") \ _(TK_RANGE_CONSTRAINT, "range_constraint", "") \ _(TK_PARAM, "param", "") \ _(TK_INFERRED, "inferred", "") \ _(TK_BOOL, "bool", "") \ _(TK_ACCESS, "access", "") \ _(TK_ASSIGN, "assign", "") \ _(TK_ATTRIBUTE, "attribute", "") \ _(TK_IF, "if", "if") \ _(TK_ELSE, "else", "else") \ _(TK_ELIF, "elif", "elif") \ _(TK_WHILE, "while", "while") \ _(TK_NE, "ne", "!=") \ _(TK_EQ, "eq", "==") \ _(TK_LE, "le", "<=") \ _(TK_GE, "ge", ">=") \ _(TK_IF_EXPR, "if", "") \ _(TK_TRUE, "True", "True") \ _(TK_FALSE, "False", "False") \ _(TK_AND, "and", "and") \ _(TK_OR, "or", "or") \ _(TK_NOT, "not", "not") \ _(TK_CAST, "cast", "") \ _(TK_PLUS_EQ, "+=", "+=") \ _(TK_MINUS_EQ, "-=", "-=") \ _(TK_TIMES_EQ, "*=", "*=") \ _(TK_DIV_EQ, "/=", "/=") \ _(TK_GLOBAL, "global", "global") \ _(TK_BUILT_IN, "built-in", "") \ _(TK_SLICE, "slice", "") \ _(TK_GATHER, "gather", "") static const char* valid_single_char_tokens = "+-*/()[]:,={}><."; enum TokenKind { // we use characters to represent themselves so skip all valid characters // before // assigning enum values to multi-char tokens. TK_DUMMY_START = 256, #define DEFINE_TOKEN(tok, _, _2) tok, TC_FORALL_TOKEN_KINDS(DEFINE_TOKEN) #undef DEFINE_TOKEN }; std::string kindToString(int kind); // nested hash tables that indicate char-by-char what is a valid token. struct TokenTrie; using TokenTrieRef = std::unique_ptr<TokenTrie>; struct TokenTrie { TokenTrie() : kind(0) {} void insert(const char* str, int tok) { if (*str == '\0') { assert(kind == 0); kind = tok; return; } auto& entry = children[*str]; if (entry == nullptr) { entry.reset(new TokenTrie()); } entry->insert(str + 1, tok); } int kind; // 0 == invalid token std::unordered_map<char, TokenTrieRef> children; }; // stuff that is shared against all TC lexers/parsers and is initialized only // once. struct SharedParserData { SharedParserData() : head(new TokenTrie()) { // listed in increasing order of precedence std::vector<std::vector<int>> binary_ops = { {TK_IF}, {TK_AND, TK_OR}, {}, // reserve a level for unary not {'<', '>', TK_EQ, TK_LE, TK_GE, TK_NE}, {'+', '-'}, {'*', '/'}, }; std::vector<std::vector<int>> unary_ops = { {'-'}, }; std::stringstream ss; for (const char* c = valid_single_char_tokens; *c; c++) { const char str[] = {*c, '\0'}; head->insert(str, *c); } #define ADD_CASE(tok, _, tokstring) \ if (*tokstring != '\0') { \ head->insert(tokstring, tok); \ } TC_FORALL_TOKEN_KINDS(ADD_CASE) #undef ADD_CASE // precedence starts at 1 so that there is always a 0 precedence // less than any other precedence int prec = 1; for (auto& group : binary_ops) { for (auto& element : group) { binary_prec[element] = prec; } prec++; } // unary ops for (auto& group : unary_ops) { for (auto& element : group) { unary_prec[element] = prec; } prec++; } // add unary not separately because it slots into the precedence of // binary operators unary_prec[TK_NOT] = binary_prec[TK_AND] + 1; } // 1. skip whitespace // 2. handle comment or newline // bool isNumber(const std::string& str, size_t start, size_t* len) { char first = str[start]; // strtod allows numbers to start with + or - or nan or inf // http://en.cppreference.com/w/cpp/string/byte/strtof // but we want only the number part, otherwise 1+3 will turn into two // adjacent numbers in the lexer if (first == '-' || first == '+' || isalpha(first)) return false; const char* startptr = str.c_str() + start; char* endptr; std::strtod(startptr, &endptr); *len = endptr - startptr; return *len > 0; } bool isblank(int n) { return isspace(n) && n != '\n'; } // find the longest match of str.substring(pos) against a token, return true // if successful // filling in kind, start,and len bool match( const std::string& str, size_t pos, bool continuation, // are we inside a scope where newlines don't count // (e.g. inside parens) bool whitespace_token, // should we treat whitespace as a token int* kind, size_t* start, size_t* len) { *start = pos; // skip whitespace while (pos < str.size() && isblank(str[pos])) pos++; // special handling if (pos < str.size()) { if (str[pos] == '#') { // skip comments while (pos < str.size() && str[pos] != '\n') pos++; // tail call, handle whitespace and more comments return match( str, pos, continuation, whitespace_token, kind, start, len); } if (str[pos] == '\\' && pos + 1 < str.size() && str[pos + 1] == '\n' && !whitespace_token) { return match(str, pos + 2, continuation, false, kind, start, len); } if (str[pos] == '\n') { return match( str, pos + 1, continuation, !continuation, kind, start, len); } } if (pos == str.size()) { *kind = TK_EOF; *start = pos; *len = 0; return true; } // invariant: the next token is not whitespace or newline if (whitespace_token) { *kind = TK_WHITESPACE; *len = pos - *start; return true; } *start = pos; // check for a valid number if (isNumber(str, pos, len)) { *kind = TK_NUMBER; return true; } // check for either an ident or a token // ident tracks whether what we have scanned so far could be an identifier // matched indicates if we have found any match. bool matched = false; bool ident = true; TokenTrie* cur = head.get(); for (size_t i = 0; pos + i < str.size() && (ident || cur != nullptr); i++) { ident = ident && validIdent(i, str[pos + i]); if (ident) { matched = true; *len = i + 1; *kind = TK_IDENT; } // check for token second, so that e.g. 'max' matches the token TK_MAX // rather the // identifier 'max' if (cur) { auto it = cur->children.find(str[pos + i]); cur = (it == cur->children.end()) ? nullptr : it->second.get(); if (cur && cur->kind != 0) { matched = true; *len = i + 1; *kind = cur->kind; } } } return matched; } bool isUnary(int kind, int* prec) { auto it = unary_prec.find(kind); if (it != unary_prec.end()) { *prec = it->second; return true; } return false; } bool isBinary(int kind, int* prec) { auto it = binary_prec.find(kind); if (it != binary_prec.end()) { *prec = it->second; return true; } return false; } bool isRightAssociative(int kind) { switch (kind) { case '?': return true; default: return false; } } private: bool validIdent(size_t i, char n) { return isalpha(n) || n == '_' || (i > 0 && isdigit(n)); } TokenTrieRef head; std::unordered_map<int, int> unary_prec; // map from token to its unary precedence std::unordered_map<int, int> binary_prec; // map from token to its binary precedence }; SharedParserData& sharedParserData(); // a range of a shared string 'file_' with functions to help debug by highlight // that // range. struct SourceRange { SourceRange( const std::shared_ptr<std::string>& file_, size_t start_, size_t end_) : file_(file_), start_(start_), end_(end_) {} const std::string text() const { return file().substr(start(), end() - start()); } size_t size() const { return end() - start(); } void highlight(std::ostream& out) const { const std::string& str = file(); size_t begin = start(); size_t end = start(); while (begin > 0 && str[begin - 1] != '\n') --begin; while (end < str.size() && str[end] != '\n') ++end; out << str.substr(0, end) << "\n"; out << std::string(start() - begin, ' '); size_t len = std::min(size(), end - start()); out << std::string(len, '~') << (len < size() ? "... <--- HERE" : " <--- HERE"); out << str.substr(end); if (str.size() > 0 && str.back() != '\n') out << "\n"; } const std::string& file() const { return *file_; } const std::shared_ptr<std::string>& file_ptr() const { return file_; } size_t start() const { return start_; } size_t end() const { return end_; } private: std::shared_ptr<std::string> file_; size_t start_; size_t end_; }; struct Token { int kind; SourceRange range; Token(int kind, const SourceRange& range) : kind(kind), range(range) {} double doubleValue() { assert(TK_NUMBER == kind); size_t idx; double r = ::c10::stod(text(), &idx); assert(idx == range.size()); return r; } std::string text() { return range.text(); } std::string kindString() const { return kindToString(kind); } }; struct Lookahead { Lookahead(const Token& t) : t(t) {} Token t; bool valid = false; size_t repeat = 0; }; struct Lexer { std::shared_ptr<std::string> file; explicit Lexer(const std::string& str) : file(std::make_shared<std::string>(str)), pos(0), cur_(TK_EOF, SourceRange(file, 0, 0)), lookahead_(cur_), repeat(0), nesting(0), shared(sharedParserData()) { auto first_indent = lexRaw(true); indent_stack.push_back(first_indent.range.size()); next(); } Token next() { Token r = cur_; if (repeat > 0) { repeat--; } else if (lookahead_.valid) { lookahead_.valid = false; repeat = lookahead_.repeat; cur_ = lookahead_.t; } else { std::tie(cur_, repeat) = lex(); } return r; } bool nextIf(int kind) { if (cur_.kind != kind) return false; next(); return true; } [[noreturn]] void reportError(const std::string& what) { reportError(what, cur_); } [[noreturn]] void reportError(const std::string& what, const Token& t) { std::stringstream ss; ss << what << ":\n"; t.range.highlight(ss); throw std::runtime_error(ss.str()); } [[noreturn]] void expected(const std::string& what, const Token& t) { std::stringstream ss; ss << "expected " << what << " but found '" << t.kindString() << "' here:\n"; t.range.highlight(ss); throw std::runtime_error(ss.str()); } [[noreturn]] void expected(const std::string& what) { expected(what, cur_); } Token expect(int kind) { if (cur_.kind != kind) { expected(kindToString(kind)); } return next(); } Token& lookahead() { if (!lookahead_.valid) { lookahead_.valid = true; std::tie(lookahead_.t, lookahead_.repeat) = lex(); } return lookahead_.t; } Token& cur() { return cur_; } private: // token, number of times to repeat it std::pair<Token, int> lex() { auto r = lexRaw(); int repeat = 0; switch (r.kind) { case '(': case '[': case '{': nesting++; break; case ')': case ']': case '}': nesting--; break; case TK_WHITESPACE: { size_t depth = r.range.size(); if (depth > indent_stack.back()) { indent_stack.push_back(depth); r.kind = TK_INDENT; } else if (depth == indent_stack.back()) { r.kind = TK_NEWLINE; } else { while (indent_stack.back() != depth) { indent_stack.pop_back(); repeat++; if (indent_stack.size() == 0) { reportError("invalid ident level", r); } } repeat--; // first repeat is this return r.kind = TK_DEDENT; } } break; case TK_EOF: if (indent_stack.size() > 1) { r.kind = TK_DEDENT; indent_stack.pop_back(); } break; default: break; } return std::make_pair(r, repeat); } Token lexRaw(bool whitespace_token = false) { int kind; size_t start; size_t length; assert(file); if (!shared.match( *file, pos, nesting > 0, whitespace_token, &kind, &start, &length)) { expected( "a valid token", Token((*file)[start], SourceRange(file, start, start + 1))); } auto t = Token(kind, SourceRange(file, start, start + length)); pos = start + length; return t; } size_t pos; Token cur_; Lookahead lookahead_; size_t repeat; // how many times to repeat the current token until we continue size_t nesting; // depth of ( [ { nesting... std::vector<int> indent_stack; // stack of identation level of blocks SharedParserData& shared; }; } // namespace script } // namespace caffe2
[ "zhangwei@egova.com.cn" ]
zhangwei@egova.com.cn
187399b8daa8f2666340052b49e013cb2a9d06b7
508510d10ddcb009fc4fb53a26d897bc462039c0
/PUBG/SDK/PUBG_VehicleSeatInfoWidget_classes.hpp
279bea9b74c7193fdb7b9dcb34363c15f7e1b195
[]
no_license
Avatarchik/PUBG-SDK
ed6e0aa27eac646e557272bbf1607b7351905c8c
07639ddf96bc0f57fb4b1be0a9b29d5446fcc5da
refs/heads/master
2021-06-21T07:51:37.309095
2017-08-10T08:15:56
2017-08-10T08:15:56
100,607,141
1
1
null
2017-08-17T13:36:40
2017-08-17T13:36:40
null
UTF-8
C++
false
false
3,449
hpp
#pragma once // PLAYERUNKNOWN BattleGrounds () SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace Classes { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // WidgetBlueprintGeneratedClass VehicleSeatInfoWidget.VehicleSeatInfoWidget_C // 0x0030 (0x0290 - 0x0260) class UVehicleSeatInfoWidget_C : public UTslUserWidget { public: struct FPointerToUberGraphFrame UberGraphFrame; // 0x0260(0x0008) (CPF_ZeroConstructor, CPF_Transient, CPF_DuplicateTransient) class UImage* Image_3; // 0x0268(0x0008) (CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_Transient, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate) class UImage* Seat; // 0x0270(0x0008) (CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_Transient, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate) int SeatIndex; // 0x0278(0x0004) (CPF_Edit, CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_IsPlainOldData) unsigned char UnknownData00[0x4]; // 0x027C(0x0004) MISSED OFFSET class APawn* LastDrivedVehicle; // 0x0280(0x0008) (CPF_Edit, CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_DisableEditOnTemplate, CPF_DisableEditOnInstance, CPF_IsPlainOldData) class UVehicleSeatInteractionComponent* SeatActor; // 0x0288(0x0008) (CPF_Edit, CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_DisableEditOnInstance, CPF_IsPlainOldData) static UClass* StaticClass() { static auto ptr = UObject::FindClass("WidgetBlueprintGeneratedClass VehicleSeatInfoWidget.VehicleSeatInfoWidget_C"); return ptr; } void GetPlayerStateNum(class ATslCharacter* ShooterCharacter, int* TeamNum); TEnumAsByte<ESlateVisibility> IsVisibleHandle(); struct FSlateBrush GetSeatColor(); void Tick(struct FGeometry* MyGeometry, float* InDeltaTime); void ExecuteUbergraph_VehicleSeatInfoWidget(int EntryPoint); }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "jl2378@cornell.edu" ]
jl2378@cornell.edu
b7609cf72874c64d76d8b5d6b24bd41c726458d3
95a3bc643487bb011161ce24ba9a7b8ba87ae641
/Private/Characters/SpellCasterCharacter.cpp
44c07b80e581193cd0e43290c88556f2fcdf341a
[]
no_license
dimitroffangel/ProjectDefence-Game-engines-and-architectures
4ff07f035c17f20ba4c8422c6092edbb8d6bc284
6b92ac8be85ed85754d97755d83c074ceac1bea6
refs/heads/master
2022-04-09T23:10:38.900904
2020-02-08T06:40:53
2020-02-08T06:40:53
235,121,789
0
0
null
null
null
null
UTF-8
C++
false
false
1,258
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "SpellCasterCharacter.h" #include "SpellCastingSystem.h" // Sets default values ASpellCasterCharacter::ASpellCasterCharacter() { // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; OnTakeAnyDamage.AddDynamic(this, &ASpellCasterCharacter::TakeAnyDamage); } // Called when the game starts or when spawned void ASpellCasterCharacter::BeginPlay() { Super::BeginPlay(); Health = MaximumHealth; } // Called every frame void ASpellCasterCharacter::Tick(float DeltaTime) { Super::Tick(DeltaTime); } // Called to bind functionality to input void ASpellCasterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) { Super::SetupPlayerInputComponent(PlayerInputComponent); } void ASpellCasterCharacter::TakeAnyDamage(AActor* DamagedActor, float Damage, const class UDamageType* DamageType, class AController* InstigateBy, AActor* DamageCauser) { UE_LOG(SpellCastingSystemLog, Display, TEXT("ASpellCasterCharacter::TakeAnyDamage current health = %f"), (Health - Damage)); Health -= Damage; if (Health <= 0.0f) { //Death(); } }
[ "angeldimitrov05@gmail.com" ]
angeldimitrov05@gmail.com
8a1d38e4dd98cf6d01a0b33702c88613026e4aca
5fe9fb23e5df770cd15ead80cb48808288d6da75
/ps3_bioshock.cpp
0fe32fa4cd5e436bd03d94cce8ed719a885a0b8e
[]
no_license
DennisStanistan/stevens
bd3788f2ae74815036794a53e15e92edbacbe54b
caf92c4bf3cfce0f5461e3f22f60753593cec410
refs/heads/master
2022-04-06T21:27:03.051608
2020-02-26T09:55:46
2020-02-26T09:55:46
null
0
0
null
null
null
null
UTF-8
C++
false
false
12,284
cpp
#include "xentax.h" #include "x_file.h" #include "x_findfile.h" #include "x_stream.h" #include "x_zlib.h" #include "x_dds.h" #include "x_amc.h" #include "ps3_bioshock.h" using namespace std; #define X_SYSTEM PS3 #define X_GAME BIOSHOCK // // ARCHIVES // namespace X_SYSTEM { namespace X_GAME { bool process0x010000(const string& filename) { // filename properties string pathname = GetPathnameFromFilename(filename); string shrtname = GetShortFilenameWithoutExtension(filename); // open file ifstream ifile(filename.c_str(), ios::binary); if(!ifile) return error("Failed to open file."); // get filesize ifile.seekg(0, ios::end); uint32 filesize = (uint32)ifile.tellg(); ifile.seekg(0, ios::beg); if(ifile.fail()) return error("Seek failure."); if(filesize == 0) return error("Empty file."); // loop compressed chunks uint32 index = 0; for(;;) { // read signature number uint32 h01 = BE_read_uint32(ifile); if(ifile.eof()) break; if(ifile.fail()) return error("Read failure."); if(h01 == 0x00000000) break; // done if(h01 != 0x9E2A83C1) { stringstream ss; ss << "Invalid signature at offset 0x" << hex << ((uint32)ifile.tellg() - 4) << dec << "."; return error(ss); } // read unknown uint32 h02 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read compressed size uint32 h03 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read uncompressed size uint32 h04 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read sizes deque<pair<uint32, uint32>> sizes; uint32 total_bytes = 0; while(total_bytes < h03) { // read compressed/uncompressed size uint32 p01 = BE_read_uint32(ifile); uint32 p02 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); total_bytes += p01; sizes.push_back(pair<uint32, uint32>(p01, p02)); } // create folder to save data stringstream ss1; ss1 << pathname; ss1 << shrtname << "\\"; CreateDirectoryA(ss1.str().c_str(), NULL); /// create filename stringstream ss2; ss2 << pathname; ss2 << shrtname << "\\"; ss2 << setfill('0') << setw(3) << index; ss2 << ".out"; // create file ofstream ofile(ss2.str().c_str(), ios::binary); if(!ofile) return error("Failed to create output file."); // read zlib data for(uint32 i = 0; i < sizes.size(); i++) { // decompress and save if(!DecompressZLIB(ifile, sizes[i].first, ofile, 0)) return error("Failed to decompress data."); } // test for EOF if(ifile.eof()) break; index++; } return true; } bool processTFC(const string& filename) { // filename properties string pathname = GetPathnameFromFilename(filename); string shrtname = GetShortFilenameWithoutExtension(filename); // open file ifstream ifile(filename.c_str(), ios::binary); if(!ifile) return error("Failed to open TFC file."); // get filesize ifile.seekg(0, ios::end); uint32 filesize = (uint32)ifile.tellg(); ifile.seekg(0, ios::beg); if(ifile.fail()) return error("Seek failure."); if(filesize == 0) return error("Empty TFC file."); // create file stringstream ss; ss << pathname << shrtname << ".TEX"; ofstream ofile(ss.str().c_str(), ios::binary); if(!ofile) return error("Failed to create output file."); // loop compressed chunks uint32 index = 0; for(;;) { // read signature number uint32 h01 = BE_read_uint32(ifile); if(ifile.eof()) break; if(ifile.fail()) return error("Read failure."); if(h01 != 0x9E2A83C1) { stringstream ss; ss << "Invalid TFC signature at offset 0x" << hex << ((uint32)ifile.tellg() - 4) << dec << "."; return error(ss); } // read unknown uint32 h02 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure 2."); // read compressed size uint32 h03 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure 3."); // read uncompressed size uint32 h04 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure 4."); // read sizes deque<pair<uint32, uint32>> sizes; uint32 total_bytes = 0; while(total_bytes < h03) { // read compressed/uncompressed size uint32 p01 = BE_read_uint32(ifile); uint32 p02 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure 5."); total_bytes += p01; sizes.push_back(pair<uint32, uint32>(p01, p02)); } // create folder to save data // stringstream ss1; // ss1 << pathname; // ss1 << shrtname << "\\"; // CreateDirectoryA(ss1.str().c_str(), NULL); // create filename // stringstream ss2; // ss2 << pathname; // ss2 << shrtname << "\\"; // ss2 << setfill('0') << setw(3) << index; // ss2 << ".out"; // // // create file // ofstream ofile(ss2.str().c_str(), ios::binary); // if(!ofile) return error("Failed to create output file."); // read zlib data for(uint32 i = 0; i < sizes.size(); i++) { // decompress and save if(!DecompressZLIB(ifile, sizes[i].first, ofile, 0)) return error("Failed to decompress data."); } // test for EOF if(ifile.eof()) break; index++; } return true; } bool processXXX(const string& filename) { // filename properties string pathname = GetPathnameFromFilename(filename); string shrtname = GetShortFilenameWithoutExtension(filename); // open file ifstream ifile(filename.c_str(), ios::binary); if(!ifile) return error("Failed to open XXX file."); // get filesize ifile.seekg(0, ios::end); uint32 filesize = (uint32)ifile.tellg(); ifile.seekg(0, ios::beg); if(ifile.fail()) return error("Seek failure."); if(filesize == 0) return error("Empty XXX file."); // read signature uint32 h01 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); if(h01 != 0x9E2A83C1) return error("Unexpected XXX signature."); // read unknown (0x004B02D7?) uint32 h02 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); if(h02 == 0x4B02D7) { // offset to first compressed data uint32 h03 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read unknown uint32 h04 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read string length uint32 h05 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read string char h06[1024]; if(h05 && (h05 < 1024)) { if(!read_string(ifile, &h06[0], h05, '\0')) return error("Read failure."); cout << " " << h06 << endl; } // unc size offset datasize // 0000022F 00021AAB 000002BF 00007470 // 00021CDA 0003FF07 0000772F 0001690F // 00061BE1 0003DA20 0001E03E 00030DD3 // 0009F601 0003C220 0004EE11 00033623 // 000DB821 0003FFF2 00082434 0000FB5D // 0011B813 00034462 00091F91 0000C53C // 0014FC75 0003E9D8 0009E4CD 0002848B // 0018E64D 0003FDCB 000C6958 00023240 // 001CE418 00013D7C 000E9B98 0000127A // skip past 0x50 bytes ifile.seekg(0x50, ios::cur); if(ifile.fail()) return error("Seek failure."); // read number of entries uint32 n_entries = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); struct XXXENTRY { uint32 p01; uint32 p02; uint32 p03; uint32 p04; }; deque<XXXENTRY> elist; for(uint32 i = 0; i < n_entries; i++) { XXXENTRY item; item.p01 = BE_read_uint32(ifile); // base offset item.p02 = BE_read_uint32(ifile); // uncompressed size item.p03 = BE_read_uint32(ifile); // offset item.p04 = BE_read_uint32(ifile); // compressed size elist.push_back(item); } // create folder to save data stringstream ss; ss << pathname; ss << shrtname << "\\"; CreateDirectoryA(ss.str().c_str(), NULL); // process entries for(uint32 i = 0; i < n_entries; i++) { // move to entry ifile.seekg(elist[i].p03); if(ifile.fail()) return error("Seek failure."); // read signature number uint32 h01 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); if(h01 != 0x9E2A83C1) { stringstream ss; ss << "Invalid signature at offset 0x" << hex << ((uint32)ifile.tellg() - 4) << dec << "."; return error(ss); } // read type (should be 0x00010000) uint32 h02 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read compressed size uint32 h03 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read uncompressed size uint32 h04 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); // read sizes deque<pair<uint32, uint32>> sizes; uint32 total_bytes = 0; while(total_bytes < h03) { // read compressed/uncompressed size uint32 p01 = BE_read_uint32(ifile); uint32 p02 = BE_read_uint32(ifile); if(ifile.fail()) return error("Read failure."); total_bytes += p01; sizes.push_back(pair<uint32, uint32>(p01, p02)); } // create filename stringstream ss; ss << pathname; ss << shrtname << "\\"; ss << setfill('0') << setw(3) << i; ss << ".out"; // create file ofstream ofile(ss.str().c_str(), ios::binary); if(!ofile) return error("Failed to create output file."); // decompress and save for(uint32 j = 0; j < sizes.size(); j++) { if(!DecompressZLIB(ifile, sizes[j].first, ofile, 0)) return error("Failed to decompress data."); } } } else if(h02 == 0x10000) { ifile.close(); return process0x010000(filename); } else return error("Unknown XXX file type."); return true; } };}; // // TEXTURES // namespace X_SYSTEM { namespace X_GAME { };}; // // MODELS // namespace X_SYSTEM { namespace X_GAME { };}; // // FUNCTIONS // namespace X_SYSTEM { namespace X_GAME { bool extract(void) { std::string pathname = GetModulePathname(); return extract(pathname.c_str()); } bool extract(const char* pname) { // set pathname using namespace std; std::string pathname(pname); if(!pathname.length()) pathname = GetModulePathname(); // variables bool doTFC = false; bool doXXX = true; // process archive cout << "STAGE 1" << endl; if(doTFC) { cout << "Processing .TFC files..." << endl; deque<string> filelist; BuildFilenameList(filelist, ".TFC", pathname.c_str()); for(size_t i = 0; i < filelist.size(); i++) { cout << "Processing file " << (i + 1) << " of " << filelist.size() << ": " << filelist[i] << "." << endl; if(!processTFC(filelist[i])) return false; } cout << endl; } // process archive cout << "STAGE 2" << endl; if(doXXX) { cout << "Processing .XXX files..." << endl; deque<string> filelist; BuildFilenameList(filelist, ".XXX", pathname.c_str()); for(size_t i = 0; i < filelist.size(); i++) { cout << "Processing file " << (i + 1) << " of " << filelist.size() << ": " << filelist[i] << "." << endl; if(!processXXX(filelist[i])) return false; } cout << endl; } return true; } }};
[ "contact@the3096.com" ]
contact@the3096.com
d6bf22b4ac6b0ba433bd56479fb64d932a0c66e0
f4a966283e1923f3160349d1090c972920aea200
/Flood/TrainingAlgorithm/GradientDescent.h
d0cc6e4e245f22c78442b29d13890ca4fdfd4e7d
[]
no_license
sachinsurendran/neural-network-classes
326bce86546d96b5ddc6b10ca000beb6337a0c20
bee9cb92da5b69878194f8f1547bc15d69e68627
refs/heads/master
2021-01-18T23:47:28.294669
2011-11-03T22:11:10
2011-11-03T22:11:10
32,112,281
0
0
null
null
null
null
UTF-8
C++
false
false
6,315
h
/****************************************************************************************************************/ /* */ /* Flood: An Open Source Neural Networks C++ Library */ /* www.cimne.com/flood */ /* */ /* G R A D I E N T D E S C E N T C L A S S H E A D E R */ /* */ /* Roberto Lopez */ /* International Center for Numerical Methods in Engineering (CIMNE) */ /* Technical University of Catalonia (UPC) */ /* Barcelona, Spain */ /* E-mail: rlopez@cimne.upc.edu */ /* */ /****************************************************************************************************************/ #ifndef __GRADIENTDESCENT_H__ #define __GRADIENTDESCENT_H__ #include "TrainingAlgorithm.h" #include "../ObjectiveFunctional/ObjectiveFunctional.h" namespace Flood { /// This concrete class represents the gradient descent training algorithm for an objective functional of a /// multilayer perceptron. /// /// @see TrainingAlgorithm. class GradientDescent : public TrainingAlgorithm { public: // ENUMERATIONS /// Available training operators for obtaining the train rate. enum TrainRateMethod{Fixed, GoldenSection, BrentMethod}; private: /// Initial train rate in line minimization. double firstTrainRate; /// Increase factor when bracketing a minimum. double bracketingFactor; /// Tolerance for the train rate. double trainRateTolerance; /// Train rate value at wich a warning message is written to the screen. double warningTrainRate; // Error train rate /// Train rate at wich the line minimization algorithm is assumed to be /// unable to bracket a minimum. double errorTrainRate; /// True if the training direction history matrix is to be reserved, false otherwise. bool reserveTrainingDirectionHistory; /// True if the training direction norm history vector is to be reserved, false otherwise. bool reserveTrainingDirectionNormHistory; /// True if the training rate history vector is to be reserved, false otherwise. bool reserveTrainingRateHistory; /// Matrix containing the training direction history over the epochs. Matrix<double> trainingDirectionHistory; /// Vector containing the training direction norm history over the epochs. Vector<double> trainingDirectionNormHistory; /// Vector containing the training rate history over the epochs. Vector<double> trainingRateHistory; /// Variable containing the actual method used to obtain a suitable train rate. TrainRateMethod trainRateMethod; // METHODS // Train rate methods double calculateGoldenSectionTrainRate(double, double, Vector<double>, Vector<double>); double calculateBrentMethodTrainRate(double, double, Vector<double>, Vector<double>); public: // GENERAL CONSTRUCTOR GradientDescent(ObjectiveFunctional*); // DEFAULT CONSTRUCTOR GradientDescent(void); // DESTRUCTOR virtual ~GradientDescent(void); // METHODS // Get methods TrainRateMethod getTrainRateMethod(void); double getFirstTrainRate(void); double getBracketingFactor(void); double getTrainRateTolerance(void); double getWarningTrainRate(void); double getErrorTrainRate(void); bool getReserveTrainingDirectionHistory(void); bool getReserveTrainingDirectionNormHistory(void); bool getReserveTrainingRateHistory(void); Matrix<double> getTrainingDirectionHistory(void); Vector<double> getTrainingDirectionNormHistory(void); Vector<double> getTrainingRateHistory(void); // Set methods void setTrainRateMethod(TrainRateMethod); void setFirstTrainRate(double); void setBracketingFactor(double); void setTrainRateTolerance(double); void setWarningTrainRate(double); void setErrorTrainRate(double); void setReserveTrainingDirectionHistory(bool); void setReserveTrainingDirectionNormHistory(bool); void setReserveTrainingRateHistory(bool); void setTrainingDirectionHistory(Matrix<double>); void setTrainingDirectionNormHistory(Vector<double>); void setTrainingRateHistory(Vector<double>); // Train methods void train(void); // Utility methods void print(void); void load(char*); void save(char*); void resizeTrainingHistory(int); // void saveTrainingDirectionHistory(char*); // void saveTrainingDirectionNormHistory(char*); // void saveTrainingRateHistory(char*); void setReserveAllTrainingHistory(bool); void saveTrainingHistory(char*); }; } #endif // Flood: An Open Source Neural Networks C++ Library. // Copyright (C) 2005-2008 Roberto Lopez // // This library is free software; you can redistribute it and/or // modify it under the s of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or 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 // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
[ "sachin.surendran@gmail.com@676a24c8-2324-11df-bcc3-9d5e0fc24faa" ]
sachin.surendran@gmail.com@676a24c8-2324-11df-bcc3-9d5e0fc24faa
7d4e000a66d86503ab4b29d76492457ac1ce8a8b
75d303983f1789b3b26b433117d9360001cd37d9
/BIL 105E - Intr to Sci&Eng Comp (C)/Uygulamalar/Uygulama 1/2.cpp
6df2e547b01730c9c2cd870802da48f84d4fbf27
[]
no_license
tugrulyatagan/itu_comp_eng_lectures
22452ef2af569bbc89de68809595bac5f992d89a
c6f62e142a7df5aaef68e3345833f2092b2f2364
refs/heads/master
2022-12-15T21:18:18.519189
2020-09-20T22:21:46
2020-09-20T22:21:46
297,064,338
14
2
null
null
null
null
UTF-8
C++
false
false
407
cpp
/********************************************* * ornek : 1-2 * * aciklama: toplama ornegi * * derleme : g++ -o program_ismi 2.cpp * *********************************************/ #include <iostream> using namespace std; int main() { int x = 5, y = 2, z; z = x + y; //toplama islemi bu satirda cout << "x + y = " << z << "\n"; return 0; }
[ "tugrulyatagan@gmail.com" ]
tugrulyatagan@gmail.com
e663eeecee439cd1e52614b046e9c0722953f529
455997dfce160f05e5862fbaee74bf699d1e9139
/bigflow_python/objectors/tuple_serde.cpp
5b742af7d15b0819cd3be5b8a1d9ab9c0d6b8706
[ "Apache-2.0" ]
permissive
xiaomj/bigflow
bf7f21ddfe844891f4037a931e8761be939be9eb
fae5bc3c812cec605847b8e24bae1d03ad1fa777
refs/heads/master
2021-08-30T19:29:31.964868
2017-12-18T11:19:21
2017-12-19T06:07:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,372
cpp
/*************************************************************************** * * Copyright (c) 2015 Baidu, Inc. 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. * **************************************************************************/ // Author: Pan Yunhong <panyunhong@baidu.com> // #include "bigflow_python/objectors/tuple_serde.h" #include <iostream> namespace baidu { namespace bigflow { namespace python { void TupleSerde::setup(const std::string& config) { boost::python::object real_tuple_obj = get_origin_serde(CPickleSerde().loads(config)); boost::python::object tuple_args = real_tuple_obj.attr("get_args")(); int64_t args_len = list_len(tuple_args); for (int64_t i = 0; i < args_len; ++i) { boost::python::object item = list_get_item(tuple_args, i); SerdeImplWrapper serde_element = create_serde_impl_wrapper(item); _tuple_element_serde.push_back(serde_element); } } uint32_t TupleSerde::serialize(void* object, char* buffer, uint32_t buffer_size) { boost::python::object* py_obj = static_cast<boost::python::object*>(object); CHECK_EQ((int64_t)_tuple_element_serde.size(), tuple_len(*py_obj)); char* current = buffer; char* buffer_end = buffer + buffer_size; for (size_t i = 0; i < _tuple_element_serde.size(); ++i) { boost::python::object tuple_ele = tuple_get_item(*py_obj, i); char* content = current + sizeof(int32_t); uint32_t left = buffer_end > content ? buffer_end - content : 0; uint32_t elem_size = _tuple_element_serde[i].serialize(&tuple_ele, content, left); if (content + elem_size <= buffer_end) { memcpy(current, &elem_size, sizeof(uint32_t)); } current = content + elem_size; } return current - buffer; } void* TupleSerde::deserialize(const char* buffer, uint32_t buffer_size) { CHECK_GT(buffer_size, 0); size_t tuple_size = _tuple_element_serde.size(); boost::python::tuple* result_tuple = new boost::python::tuple((boost::python::handle<>(PyTuple_New(tuple_size)))); uint32_t current_start = 0; for (size_t i = 0; i < tuple_size; ++i) { uint32_t element_size = 0; memcpy(&element_size, buffer+current_start, sizeof(uint32_t)); current_start += sizeof(uint32_t); void* element = _tuple_element_serde[i].deserialize(buffer+current_start, element_size); tuple_set_item(*result_tuple, i, *static_cast<boost::python::object*>(element)); current_start += element_size; _tuple_element_serde[i].release_object(element); } CHECK_EQ(buffer_size, current_start); return result_tuple; } void TupleSerde::release(void* object) { delete static_cast<boost::python::tuple*>(object); } } // namespace python } // namespace bigflow } // namespace baidu
[ "zhangyuncong@baidu.com" ]
zhangyuncong@baidu.com
770599bb4af0afe9b5da9c6980f3da0bef4074f5
4367853a6433bcf52bf8501849d444380b3fc3d4
/10171/main.cpp
d2d38455d70b38af7aa325166782b682620f481c
[]
no_license
ywh3589/BOJ
df21332f9db6df979d5859ab45973390e763f3e7
3e7cb25857d038b89c3109b6c7cadd1035863c4a
refs/heads/master
2021-05-07T09:04:38.779603
2017-10-20T09:44:26
2017-10-20T09:44:26
null
0
0
null
null
null
null
UTF-8
C++
false
false
107
cpp
#include <cstdio> using namespace std; int main() { printf("\\ /\\\n ) ( ')\n( / )\n \\(__)|"); }
[ "schezwan.daum.net" ]
schezwan.daum.net
6b2854f9551b19f606132447c59a621a08d7e82e
0ed99fc1715b17980b6dce9bf715fec37e2ec5c0
/mainwindow.cpp
c30f25aca4b7e968ea8f28e0409ec2efa8a0381a
[]
no_license
KnsRoo/Diplom
2ac58478fb9742ee5490617e0b504643aeed4e2c
6503c40419454bc6efd209ca51b7095731fab868
refs/heads/master
2020-05-29T15:34:03.063235
2019-06-11T10:36:25
2019-06-11T10:36:25
189,226,059
0
0
null
null
null
null
UTF-8
C++
false
false
1,043
cpp
#include "mainwindow.h" #include "ui_mainwindow.h" #include <vector> #include "algo.cpp" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(pb_clicked())); } void MainWindow::pb_clicked(){ std::vector<int> vec; for (int i = 0; i < ui->tableWidget->rowCount(); i++){ for (int j = 0; j < ui->tableWidget->columnCount(); j++){ vec.push_back(ui->tableWidget->item(i,j)->text().toInt()); } } vec = run(ui->lineEdit_2->text().toInt(), ui->lineEdit_3->text().toInt(),vec, ui->tableWidget->rowCount(), ui->tableWidget->columnCount(), ui->lineEdit); for (int i = 0; i < ui->tableWidget_2->rowCount(); i++){ for (int j = 0; j < ui->tableWidget_2->columnCount(); j++){ ui->tableWidget_2->item(i,j)->setText(QString::number(vec[i*ui->tableWidget_2->rowCount()+j])); } } } MainWindow::~MainWindow() { delete ui; }
[ "noreply@github.com" ]
noreply@github.com
46930af5074cb99e4d2c835ba6bfeb486f677ff0
4c25432a6d82aaebd82fd48e927317b15a6bf6ab
/data/dataset_2017/dataset_2017_8/aman.chandna/8294486_5654117850546176_aman.chandna.cpp
5cc0ec73010bb74154c2657d3ac1d41898730148
[]
no_license
wzj1988tv/code-imitator
dca9fb7c2e7559007e5dbadbbc0d0f2deeb52933
07a461d43e5c440931b6519c8a3f62e771da2fc2
refs/heads/master
2020-12-09T05:33:21.473300
2020-01-09T15:29:24
2020-01-09T15:29:24
231,937,335
1
0
null
2020-01-05T15:28:38
2020-01-05T15:28:37
null
UTF-8
C++
false
false
1,567
cpp
#define boost ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define mod 1000000007 #define INF LLONG_MAX #include <unordered_set> #include<bits/stdc++.h> #include<unordered_map> using namespace std; #define ll long long int main() { boost; freopen("inp2.txt", "r", stdin); freopen("out2.txt", "w", stdout); ll t; cin >> t; for (ll ccr = 1; ccr <= t; ++ccr) { ll n, r, o, y, g, b, v; cin >> n >> r>> o>> y>> g>> b>> v; string ans(n,'a'); if (r >= b && r >= y) { ans[0] = 'R'; --r; } else if (b >= r && b >= y) { ans[0] = 'B'; --b; } else { ans[0] = 'Y'; --y; } for (int i = 1; i < n; ++i) { if (ans[i - 1] == 'R') { if (b > y||(b==y && ans[0]=='B' && b>0)) { ans[i] = 'B'; --b; } else { if (y <= 0) { ans = "IMPOSSIBLE"; break; } ans[i] = 'Y'; --y; } } else if (ans[i - 1] == 'B') { if (r > y || (r == y && ans[0] == 'R' && r>0)) { ans[i] = 'R'; --r; } else { if (y <= 0) { ans = "IMPOSSIBLE"; break; } ans[i] = 'Y'; --y; } } else { if (r > b || (b == r && ans[0] == 'R' && r>0)) { ans[i] = 'R'; --r; } else { if (b <= 0) { ans = "IMPOSSIBLE"; break; } ans[i] = 'B'; --b; } } } if (ans!="IMPOSSIBLE" && ans[n - 1] == ans[0]) { ans = "IMPOSSIBLE"; } cout << "Case #" << ccr << ": " << ans << "\n"; } return 0; }
[ "e.quiring@tu-bs.de" ]
e.quiring@tu-bs.de
ed14ab1b2454fd7699a37c75442b7a82e85c5d18
2ee540793f0a390d3f418986aa7e124083760535
/Online Judges/TLX/Training Gate/Kelas Belajar/CP Dasar/Struktur Data/penghancuranBatu.cpp
554b83c5b19d0b43d2ace29df121c38ff46b5a4f
[]
no_license
dickynovanto1103/CP
6323d27c3aed4ffa638939f26f257530993401b7
f1e5606904f22bb556b1d4dda4e574b409abc17c
refs/heads/master
2023-08-18T10:06:45.241453
2023-08-06T23:58:54
2023-08-06T23:58:54
97,298,343
0
0
null
null
null
null
UTF-8
C++
false
false
1,268
cpp
#include <bits/stdc++.h> using namespace std; #define inf 1000000000 #define unvisited -1 #define visited 1 #define eps 1e-9 #define mp make_pair #define pb push_back #define pi acos(-1.0) #define uint64 unsigned long long #define FastSlowInput ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define debug if(true) typedef long long ll; // typedef __int128_t lll; typedef vector<int> vi; typedef pair<int,int> ii; typedef vector<ii> vii; const int maxn = 1e5 + 5; vector<vi> adj(maxn); int main(){ int n,i,j; scanf("%d",&n); int a[maxn]; int pref[maxn]; int next[maxn]; for(i=0;i<n;i++){ scanf("%d",&a[i]); if(i == 0){pref[i] = -1; next[i] = i+1;} else if(i == n-1){next[i] = -1; pref[i] = i-1;} else{ next[i] = i+1; pref[i] = i-1; } adj[a[i]].pb(i); } int tot = 0; for(i=1;i<=10000;i++){ for(j=0;j<adj[i].size();j++){ int idx = adj[i][j]; int minim = inf; if(pref[idx] != -1) { minim = min(minim, a[pref[idx]]); } if(next[idx] != -1) { minim = min(minim, a[next[idx]]); } if(minim != inf){ tot += minim; // printf("idx: %d minim: %d tot: %d\n", idx, minim, tot); } next[pref[idx]] = next[idx]; pref[next[idx]] = pref[idx]; } } printf("%d\n", tot); return 0; };
[ "dickynovanto1103@gmail.com" ]
dickynovanto1103@gmail.com
d7303a9080b6a38ee4aaaa14fa309f8d4279bc04
3537428a70066ee8b6bb6fc7b8737f93687e1ea2
/src/Commands/CmdShooterBlingSolid.cpp
88cc474e14833f061153e212bd40c8042b0c11be
[]
no_license
jakeyoung22/SkyFire2.0
ee4408f04f029da291ad83696781e4749e32ba38
8b2967a571dd4ff6fba156484d84db9063f7dd7a
refs/heads/master
2020-03-07T01:24:33.297566
2018-04-04T22:06:10
2018-04-04T22:06:10
127,182,956
0
0
null
null
null
null
UTF-8
C++
false
false
776
cpp
#include "CmdShooterBlingSolid.h" CmdShooterBlingSolid::CmdShooterBlingSolid() { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); } // Called just before this Command runs the first time void CmdShooterBlingSolid::Initialize() { } // Called repeatedly when this Command is scheduled to run void CmdShooterBlingSolid::Execute() { shooter->SetFlashBling(false); } // Make this return true when this Command no longer needs to run execute() bool CmdShooterBlingSolid::IsFinished() { return true; } // Called once after isFinished returns true void CmdShooterBlingSolid::End() { } // Called when another command which requires one or more of the same // subsystems is scheduled to run void CmdShooterBlingSolid::Interrupted() { }
[ "jakey@192.168.5.137" ]
jakey@192.168.5.137
434a70a818909d7f7685908cfe0888cf247f8e07
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/mutt/gumtree/mutt_repos_function_348_mutt-1.6.2.cpp
55c54c8e93eb6149d76be13b79a0227a24fe5cb2
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
317
cpp
int mutt_parse_push (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { int r = 0; mutt_extract_token (buf, s, M_TOKEN_CONDENSE); if (MoreArgs (s)) { strfcpy (err->data, _("push: too many arguments"), err->dsize); r = -1; } else tokenize_push_macro_string (buf->data); return (r); }
[ "993273596@qq.com" ]
993273596@qq.com
36c49d1dd8affbc9cc0d6f07f9928a91f9a5977b
0ad1e75df68fb14976c79c8921249dcd6e74f967
/Prime Factorization.cpp
9ad0eaa2c37040f311076da5a0aa95151e8dfc8c
[]
no_license
variablemayank/competetive-programming-codes
9010d215832f4937735d6b35b1df35df0f8a59e6
71bbc70049089fcc24444471dd4504b1d29c371f
refs/heads/master
2021-09-06T04:17:29.052221
2018-02-02T08:57:56
2018-02-02T08:57:56
119,955,414
1
1
null
null
null
null
UTF-8
C++
false
false
395
cpp
#include<bits/stdc++.h> using namespace std; int factor(int N) { vector<int> primes; primes = eratosthenes(static_cast<int>(sqrt(N+1))); map<int, int> factors; for(int i = 0; i < primes.size(); ++i){ int prime = primes[i], power = 0; while(N % prime == 0){ power++; N /= prime; } if(power > 0){ factors[prime] = power; } } return factors; } int main() { int t; cin>>t; cout<<factor(t); }
[ "mayank202020@rediffmail.com" ]
mayank202020@rediffmail.com
af85a2d339e49deb290367302498a6d18593ca2d
421d4545349169eddfbe6d8dbca9974a5edb46eb
/myopenglwidget.h
6d3a05d0cc10e25447f9480b9096972ffecd1a8a
[]
no_license
LIETIAN183/GraduationProject
960e596e01a27ad7cc536118a7f7d059225c8f70
2429871df4616ad5eb423af634bf7f9f2c67455f
refs/heads/master
2020-05-01T03:53:16.534314
2019-05-11T07:18:36
2019-05-11T07:18:36
177,257,855
0
0
null
null
null
null
UTF-8
C++
false
false
1,253
h
#ifndef MYOPENGLWIDGET_H #define MYOPENGLWIDGET_H #include <QOpenGLWidget> #include <QOpenGLFunctions> #include <QOpenGLShaderProgram> #include <QOpenGLVertexArrayObject> #include <QOpenGLBuffer> #include <QOpenGLTexture> #include <vector> #include <QTime> using namespace std; class MyOpenGLWidget : public QOpenGLWidget, protected QOpenGLFunctions { Q_OBJECT public: explicit MyOpenGLWidget(QWidget *parent = nullptr); void Draw(vector<GLfloat> x, vector<GLfloat> tex, QImage texture); void keyPressEvent(QKeyEvent *event); void Clear(); //备份数据 vector<GLfloat> control_points; vector<GLfloat> texCoord; QImage texture; protected: void initializeGL(); void paintGL(); void resizeGL(int width, int height); signals: public slots: private: QOpenGLShaderProgram program; //GLuint vertex_array_object; QOpenGLVertexArrayObject vao; QOpenGLBuffer vbo; int size;//控制glDrawArrays点数量自动更新 QVector3D cameraPos, cameraFront, cameraUp; QMatrix4x4 model; GLenum mode; //判断是否添加纹理 bool Add_tex; QOpenGLTexture *textures[2]; //判断是否开启光照 bool Light; bool Texture; }; #endif // MYOPENGLWIDGET_H
[ "yifanchu183@gmail.com" ]
yifanchu183@gmail.com
eadf2578a977b73583b577e724f8a82d48d7385f
236d33902b9d4ea23ce6c064d7677ccc5c94a8b7
/computer-graphics-meshes/include/write_obj.h
6bc1c84304bbf3f2db3006abf896b5cdcfc182cb
[]
no_license
robertwyb/Computer-graphic-assignments
30e460d8ac9242e1ceb22f9e1d9136f5a78c5277
ec8411d187e23b4d8137ca91b967b691097e15d7
refs/heads/master
2020-05-18T13:52:49.397150
2019-05-01T18:06:34
2019-05-01T18:06:34
184,454,095
4
0
null
null
null
null
UTF-8
C++
false
false
740
h
#ifndef WRITE_OBJ_H #define WRITE_OBJ_H #include <Eigen/Core> #include <string> // Write a triangle or quad mesh to a .obj file // // Inputs: // filename path to .obj file // V #V by 3 list of vertex positions // F #F by poly=(3 or 4) list of mesh face indices into V // UV #UV by 2 list of UV positions // UF #F by poly list of mesh face indices into UV // NV #NV by 3 list of normal vectors // NF #F by poly list of mesh face indices into NV // Returns true if write was successful bool write_obj( const std::string & filename, const Eigen::MatrixXd & V, const Eigen::MatrixXi & F, const Eigen::MatrixXd & UV, const Eigen::MatrixXi & UF, const Eigen::MatrixXd & NV, const Eigen::MatrixXi & NF); #endif
[ "robertwangyb@outlook.com" ]
robertwangyb@outlook.com
d8d6f5951e7eb15102d94826c4624bd706a46162
c9cdb8772eb74c832b703624f6395f1e8b84c09e
/CCore/src/ddl/DDLParserTable.cpp
15ca1ddd64fc237bce2af3e6a196cca41a0a93ef
[ "BSL-1.0" ]
permissive
SergeyStrukov/CCore
70799f40d0ecfec75ab9298f60e7396413931800
509bd439ae5621603f9fbe8e8b3ca03721ac283b
refs/heads/master
2021-01-17T17:01:19.899215
2015-08-12T18:41:25
2015-08-12T18:41:25
3,891,233
6
1
null
null
null
null
UTF-8
C++
false
false
205,689
cpp
/* DDLParserTable.cpp */ //---------------------------------------------------------------------------------------- // // Project: CCore 1.02 // // Tag: General // // License: Boost Software License - Version 1.0 - August 17th, 2003 // // see http://www.boost.org/LICENSE_1_0.txt or the local copy // // Copyright (c) 2011 Sergey Strukov. All rights reserved. // //---------------------------------------------------------------------------------------- #include <CCore/inc/ddl/DDLParser.h> namespace CCore { namespace DDL { /* struct Action */ static const uint8 RuleTable[462][44]= { { 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 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,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0,124, 0,}, { 0, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 0, 0,}, { 0,144,145, 0,143,142, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,146, 0, 0, 0,254, 0,141, 0, 0, 0,255,140,253,138, 0, 0,139, 0, 0, 0,147, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,163, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,164, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,304,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 0, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 0, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 0, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 0, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 75, 0,}, { 0, 0, 0, 0,313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0, 0, 0,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,338,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,339,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,341,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0, 0, 0,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0, 0, 0,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0, 0, 0,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0, 0, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 75, 0,}, { 0, 0, 0, 0,350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,144,145, 0,143,142, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,146, 0, 0, 0,254, 0,141, 0, 0, 0,255,140,253,138, 0, 0,139, 0, 0, 0,147, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,353, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,354, 0, 0,265, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,144,145, 0,143,142, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,146, 0, 0, 0,254, 0,141, 0, 0, 0,255,140,253,138, 0, 0,139, 0, 0, 0, 0, 0,}, { 0,144,145, 0,143,142, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,146, 0, 0, 0,254, 0,141, 0, 0, 0,255,140,253,138, 0, 0,139, 0, 0, 0, 0, 0,}, { 0,144,145, 0,143,142, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,146, 0, 0, 0,254, 0,141, 0, 0, 0,255,140,253,138, 0, 0,139, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,146, 0, 0, 0,254, 0,141, 0, 0, 0,255,140,253,138, 0, 0,139, 0, 0, 0, 0, 0,}, { 0,144,145, 0,143,142, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,146, 0, 0, 0,254, 0,141, 0, 0, 0,255,140,253,138, 0, 0,139, 0, 0, 0, 0, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 75, 0,}, { 0, 0, 0, 0,369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,370, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,144,145, 0,143,142, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,146, 0, 0, 0,254, 0,141, 0, 0, 0,255,140,253,138, 0, 0,139, 0, 0, 0,147, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,372, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,372, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,378,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,379,}, { 0,171,172, 0,170,169, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,173, 0, 0, 0,285, 0,279, 0, 0, 0,283,278,277,166, 0, 0,167, 0, 0, 0, 0, 0,}, { 0,171,172, 0,170,169, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,173, 0, 0, 0,285, 0,279, 0, 0, 0,283,278,277,166, 0, 0,167, 0, 0, 0, 0, 0,}, { 0, 59, 60, 0, 58, 57, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0, 63, 0, 0, 0,309, 0, 56, 0, 0, 0, 55,159, 53, 52, 0, 0, 54, 0, 0, 0, 75, 0,}, { 0, 0, 0, 0,389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,171,172, 0,170,169, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,173, 0, 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}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 94, 93, 95, 97,104,109,101, 98, 99,100,108,105,106,107,103, 96,102, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0,124, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,435, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,436, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 94, 93, 95, 97,104,109,101, 98, 99,100,108,105,106,107,103, 96,102, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0,124, 0,}, { 0, 0, 0, 0, 5, 4, 7, 10, 18, 23, 14, 11, 12, 13, 22, 19, 20, 21, 16, 8, 15,211, 0, 0, 0,210, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,439,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,121,122, 0,120,119, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,123, 0, 0, 0,231, 0,118, 0, 0, 0,345,228,230,116, 0, 0,117, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0,380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,443, 0,}, { 0,444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0,171,172, 0,170,169, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,173, 0, 0, 0,285, 0,279, 0, 0, 0,283,278,277,166, 0, 0,167, 0, 0, 0, 0, 0,}, { 0,171,172, 0,170,169, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,173, 0, 0, 0,285, 0,279, 0, 0, 0,283,278,277,166, 0, 0,167, 0, 0, 0, 0, 0,}, { 0,171,172, 0,170,169, 62, 64, 69, 74, 68, 65, 66, 67, 73, 70, 71, 72, 0, 0, 0, 0,173, 0, 0, 0,285, 0,279, 0, 0, 0,283,278,277,166, 0, 0,167, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, }; Action::Action(ulen state,AtomClass ac) { rule=Rule( RuleTable[state][ac] ); if( rule==Shift ) { new_state=AtomStateTable[state][ac]; } else { new_state=0; } } /* Element_...::NextState() */ /* Element_BODY::NextState() */ ulen Element_BODY::NextState(ulen state) { static const uint16 Table[]= { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_RNAME::NextState() */ ulen Element_RNAME::NextState(ulen state) { static const uint16 Table[]= { 0, 28, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 46, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0,110, 0,125,136, 76,148, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 28,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,148, 0, 0, 0, 0, 0, 0,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,249,148, 148, 0, 0, 0, 0, 0, 0,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0,273,274, 0,276,148, 0, 0, 0, 0, 0, 0,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 76, 76, 76, 76, 0, 0,148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0,328,329, 0, 0, 0, 0, 76, 0, 0, 0, 0,125, 0, 125,125, 0,335,336, 0, 0, 0, 0, 0, 0,125,125,125,125, 76, 0, 0,148, 0, 0, 0, 0,148,148,148, 0, 0,355,356, 0, 0, 0, 0, 0, 0,148,148,148, 76, 0, 0,148, 0, 0, 0, 0,176,176, 0, 0, 0, 0,176, 0,176, 0,375,376, 0, 0, 0, 0,176,176, 76, 0, 0,176, 0, 0, 0,148, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 110,125, 0, 0,110, 0,125, 28, 0, 0, 0, 0,125, 0, 0, 0, 0,148,148, 0, 0, 0, 0, 0, 0, 0,176,176,176, 0, 0, 0, 28, 0, 0, 0,125, 0, 0, 0, 0, 0, 0, 0, 0,176, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_NAME::NextState() */ ulen Element_NAME::NextState(ulen state) { static const uint16 Table[]= { 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0,111, 0,126, 0, 77,149, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0,177,177,177, 0, 0, 0, 29, 0, 0, 0,126, 0, 0, 0, 0, 0, 0, 0, 0,177, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_INAME::NextState() */ ulen Element_INAME::NextState(ulen state) { static const uint16 Table[]= { 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0,112, 0, 78, 0, 78, 78, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 78, 78, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 78, 0, 78, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 78, 78, 0, 0, 78, 0, 0, 0, 0, 78, 78, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 78, 0, 0, 78, 0, 0, 0, 0, 78, 78, 0, 0, 0, 0, 78, 0, 78, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 0, 0, 78, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 112, 78, 0, 0,112, 0, 78, 30, 0, 0, 0, 0, 78, 0, 0, 0, 0, 78, 78, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 0, 0, 0, 30, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_TNAME::NextState() */ ulen Element_TNAME::NextState(ulen state) { static const uint16 Table[]= { 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_EXPR::NextState() */ ulen Element_EXPR::NextState(ulen state) { static const uint16 Table[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0,127, 0, 0,150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,226, 0, 0, 0, 0, 0, 0,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,251, 0, 0, 0, 0, 0, 0, 0,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,281, 0, 0, 0, 0, 0, 0,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,312, 0, 0,315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,349, 0, 0,352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,368, 0, 0,371, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129, 0, 0, 0, 0,129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129, 0, 0, 0, 0, 0, 0, 0, 0,180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_EXPR_UN::NextState() */ ulen Element_EXPR_UN::NextState(ulen state) { static const uint16 Table[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0,130, 0,137,153,161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153, 0, 0, 0, 0, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153, 257, 0, 0, 0, 0, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0,153, 0, 0, 0, 0, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 82,308,310, 82, 0, 0,153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 0,232, 0, 225,227, 0, 0, 0, 0, 0, 0, 0, 0, 0,130,130,347,348, 82, 0, 0,153, 0, 0, 0, 0,250,252,256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153,153,365, 82, 0, 0,153, 0, 0, 0, 0,280,286, 0, 0, 0, 0,284, 0,282, 0, 0, 0, 0, 0, 0, 0,181,181, 82, 0, 0,181, 0, 0, 0,153, 0, 0, 0, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,311, 0, 0, 0, 0,130, 0, 0, 0, 0,130, 0, 0, 0, 0, 0,346, 0, 0, 0, 0,366,367, 0, 0, 0, 0, 0, 0, 0,385,387,386, 0, 0, 0, 0, 0, 0, 0,130, 0, 0, 0, 0, 0, 0, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_EXPR_POST::NextState() */ ulen Element_EXPR_POST::NextState(ulen state) { static const uint16 Table[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0,131, 0, 83,154, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 0, 0, 0, 0, 0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, 0,131, 0, 0, 0, 0, 0, 0, 0, 0,182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_EXPR_NNPOST::NextState() */ ulen Element_EXPR_NNPOST::NextState(ulen state) { static const uint16 Table[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0,132, 0, 84,155, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,155, 0, 0, 0, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,155, 155, 0, 0, 0, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0,155, 0, 0, 0, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 84, 84, 84, 84, 0, 0,155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0,132, 0, 132,132, 0, 0, 0, 0, 0, 0, 0, 0, 0,132,132,132,132, 84, 0, 0,155, 0, 0, 0, 0,155,155,155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,155,155,155, 84, 0, 0,155, 0, 0, 0, 0,183,183, 0, 0, 0, 0,183, 0,183, 0, 0, 0, 0, 0, 0, 0,183,183, 84, 0, 0,183, 0, 0, 0,155, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0,132, 0, 0, 0, 0,132, 0, 0, 0, 0, 0,132, 0, 0, 0, 0,155,155, 0, 0, 0, 0, 0, 0, 0,183,183,183, 0, 0, 0, 0, 0, 0, 0,132, 0, 0, 0, 0, 0, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_EXPR_NNPRIM::NextState() */ ulen Element_EXPR_NNPRIM::NextState(ulen state) { static const uint16 Table[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0,133, 0, 85,156, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,156, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,156, 156, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0,156, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 85, 85, 85, 85, 0, 0,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0,133, 0, 133,133, 0, 0, 0, 0, 0, 0, 0, 0, 0,133,133,133,133, 85, 0, 0,156, 0, 0, 0, 0,156,156,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,156,156,156, 85, 0, 0,156, 0, 0, 0, 0,184,184, 0, 0, 0, 0,184, 0,184, 0, 0, 0, 0, 0, 0, 0,184,184, 85, 0, 0,184, 0, 0, 0,156, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0,133, 0, 0, 0, 0,133, 0, 0, 0, 0, 0,133, 0, 0, 0, 0,156,156, 0, 0, 0, 0, 0, 0, 0,184,184,184, 0, 0, 0, 0, 0, 0, 0,133, 0, 0, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_ELIST::NextState() */ ulen Element_ELIST::NextState(ulen state) { static const uint16 Table[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0,382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_ITYPE::NextState() */ ulen Element_ITYPE::NextState(ulen state) { static const uint16 Table[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0,134, 0, 86,157, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,157, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,157, 157, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0,157, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 86, 86, 86, 86, 0, 0,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0,134, 0, 134,134, 0, 0, 0, 0, 0, 0, 0, 0, 0,134,134,134,134, 86, 0, 0,157, 0, 0, 0, 0,157,157,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,157,157,157, 86, 0, 0,157, 0, 0, 0, 0,188,188, 0, 0, 0, 0,188, 0,188, 0, 0, 0, 0, 0, 0, 0,188,188, 86, 0, 0,188, 0, 0, 0,157, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0,134, 0, 0, 0, 0,134, 0, 0, 0, 0, 0,134, 0, 0, 0, 0,157,157, 0, 0, 0, 0, 0, 0, 0,188,188,188, 0, 0, 0, 0, 0, 0, 0,134, 0, 0, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } /* Element_NNLIT::NextState() */ ulen Element_NNLIT::NextState(ulen state) { static const uint16 Table[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0,135, 0, 87,158, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158, 0, 0, 0, 0, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158, 158, 0, 0, 0, 0, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0,158, 0, 0, 0, 0, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 87, 87, 87, 87, 0, 0,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0,135, 0, 135,135, 0, 0, 0, 0, 0, 0, 0, 0, 0,135,135,135,135, 87, 0, 0,158, 0, 0, 0, 0,158,158,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158, 87, 0, 0,158, 0, 0, 0, 0,189,189, 0, 0, 0, 0,189, 0,189, 0, 0, 0, 0, 0, 0, 0,189,189, 87, 0, 0,189, 0, 0, 0,158, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0,135, 0, 0, 0, 0,135, 0, 0, 0, 0, 0,135, 0, 0, 0, 0,158,158, 0, 0, 0, 0, 0, 0, 0,189,189,189, 0, 0, 0, 0, 0, 0, 0,135, 0, 0, 0, 0, 0, 0, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; return Table[state]; } } // namespace DDL } // namespace CCore
[ "sshimnick@hotmail.com" ]
sshimnick@hotmail.com
4519755b687ac229e5ef6b74f310efe440be465d
c13c121d96fdd8682982854f43e50be011863aa1
/Code/Include/core-Physics/PhysicsWorld.h
22411d5bf5aa25455e708cc0d08547fb48c9c428
[]
no_license
paksas/Tamy
14fe8e2ff5633ced9b24c855c6e06776bf221c10
6e4bd2f14d54cc718ed12734a3ae0ad52337cf40
refs/heads/master
2020-06-03T08:06:09.511028
2015-03-21T20:37:03
2015-03-21T20:37:03
25,319,755
0
1
null
null
null
null
UTF-8
C++
false
false
3,205
h
/// @file core-Physics\PhysicsWorld.h /// @brief a physics world where all physical bodies are simulated #pragma once #include "core\MemoryRouter.h" #include "core-MVC\ModelView.h" #include "core\List.h" #include "core\Array.h" /////////////////////////////////////////////////////////////////////////////// namespace physx { class PxScene; class PxControllerManager; class PxDefaultCpuDispatcher; class PxRigidActor; }; struct Vector; class PhysicsObject; enum PhysicsCollisionGroup { Collision_Static, Collision_Dynamic, Collision_Ragdoll, Collision_Count }; /////////////////////////////////////////////////////////////////////////////// class PhysicsWorld : public ModelView { DECLARE_ALLOCATOR( PhysicsWorld, AM_DEFAULT ); private: struct CollisionGroup { DECLARE_ALLOCATOR( CollisionGroup, AM_DEFAULT ); uint m_collisionMask; CollisionGroup() : m_collisionMask( 0xffffffff ) {} }; public: physx::PxScene* m_scene; physx::PxControllerManager* m_characterControllersManager; physx::PxDefaultCpuDispatcher* m_cpuDispatcher; private: List< PhysicsObject* > m_objects; bool m_simulationEnabled; Array< CollisionGroup > m_collisionGroups; uint m_nextFreePhysicsSystemId; public: /** * Constructor. * * @param gravity */ PhysicsWorld( const Vector& gravity ); ~PhysicsWorld(); /** * Ticks the physics simulation in this world. * * @param deltaTime */ void tick( float deltaTime ); /** * Toggles the simulation on/off. * * @param enable */ void enableSimulation( bool enable ); // ------------------------------------------------------------------------- // Collision filtering // ------------------------------------------------------------------------- /** * Assigns the specified actor to the specified collision group. * * NOTE: Call this method AFTER assigning the actor a shape, because the method sets a flag on the said shape. * * @param actor * @param collisionGroup * @param systemId bodies assigned to the same system don't collide, unless the assigned system has ID 0 ( the default ID ) , * in which case it will collide with everything */ void assignCollisionGroup( physx::PxRigidActor* actor, PhysicsCollisionGroup collisionGroup, uint systemId = 0 ); /** * Allocates a new physics system ID. */ uint allocatePhysicsSystemId(); // ------------------------------------------------------------------------- // ModelView implementation // ------------------------------------------------------------------------- void onAttachedToModel( Model& model ); void onDetachedFromModel( Model& model ); void onNodeAdded( SceneNode* node ); void onNodeRemoved( SceneNode* node ); void onNodeChanged( SceneNode* node ); void resetContents( Model& model ); }; ///////////////////////////////////////////////////////////////////////////////
[ "ptrochim@gmail.com" ]
ptrochim@gmail.com
4fd968cf4e821c4aa154a682e76f616d4118bccd
11a05f50a3f66ba487f909d204061bcc03b5fcc3
/003. Third Unit/SoundTutoriral/SoundTutoriral/SoundProgramming.h
12c219603853c11c91bbcea7b8008724bda7e724
[]
no_license
Veanoid/SecondYearAIE
af2603c2d9af2a717b58c0fcb498d83e61511f26
7e617d478e39ef1f887c33e3c8d35ceb924358b8
refs/heads/master
2020-04-21T14:52:15.379116
2019-07-04T04:44:12
2019-07-04T04:44:12
169,649,281
0
0
null
null
null
null
UTF-8
C++
false
false
205
h
#pragma once #include <fmod.h> #include <fmod.hpp> class SoundProgramming { public: SoundProgramming(); ~SoundProgramming(); bool startup(); private: FMOD::System *m_pfmodSystem; }
[ "36467761+Veanoid@users.noreply.github.com" ]
36467761+Veanoid@users.noreply.github.com
d128e32c06991885672d7e3a9666dae0f3616212
c9965d13442fc4a0c6f95d0edb93fd6943fc41d2
/_Роксана Пейчева_794442_assignsubmission_file_3_test/3_zad3.cpp
0072dc33f5553f1d9fde088b29f1be67f72a0f2c
[]
no_license
HarisonP/-Introduction-to-Programming-Exam-One
8a5064014cbf0bcd1ad2c9f384076d933cfcdca7
6f11b3a418c5679d515fc222090eb6be6955c322
refs/heads/master
2021-01-15T21:07:26.501711
2015-01-21T11:51:35
2015-01-21T11:51:35
27,239,927
0
0
null
null
null
null
UTF-8
C++
false
false
927
cpp
#include <iostream> using namespace std; int main() { double arrayA[3]; double arrayB[3]; int countB,countEqual; int sizeA = 3, sizeB = 3 ; for (int i = 0; i < sizeA; i++) { cin >> arrayA[i]; } cout << endl; for (int j = 0; j < sizeB; j++) { cin >> arrayB[j]; } cout << endl; for (int i = 0 ; i < sizeA ; i++) { for (int j = 0; j < sizeB; j++) { while (arrayA[i] == arrayB[j]) { // you don't really need countEqual countEqual = arrayA[i]; cout << "Equal" << " " << countEqual << endl; } cout << endl; for (int i = 0; i < sizeA; i++) { for (int j = 0; j < sizeB; j++) { // not exactly // -0.3 while (arrayA[i] != arrayB[j]) { countB = arrayB[i]; cout << " array B only" << " " << countB << endl; } cout << endl; } } system("PAUSE"); return 0; } //score 1.2 / 1.5 + 0.5
[ "harito92@abv.bg" ]
harito92@abv.bg
d1a14d549e0aab9133cf8b80ea3e39be5c7d3c32
a41fa0428171a86f4176ddd35413906e5ab31167
/Generic Tree/test.cxx
0ff738f4e41e4bc280017ca49bf2f5aedaa886a5
[]
no_license
iSergioMejia/Trees
4b9fbb92f7ddbc2225db754954d31306ac6f9315
1b11d64137a6e280ebcb550ac4f69aef7a8de93b
refs/heads/master
2021-01-16T06:22:41.944628
2020-08-20T14:44:02
2020-08-20T14:44:02
243,006,830
1
0
null
null
null
null
UTF-8
C++
false
false
7,438
cxx
/*┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ **│Code made by Leonardo Florez Valencia │ **│ │ **│Modified and completed by Sergio Mejía, Laura Jiménez and Sebastián Gutierrez │ **│for the Data Structures lesson 1830 │ **│ │ **│All the methods of the Generic Tree are implemented completely. However, due to some unknown │ **│errors with the TTreeList, the methods AreIsomorphic and IsContained cannot be tested. │ **│ │ **│Also, the commented section after the main for statemente can be used to check some of the Generic Tree methods. However in the│ **│current status of the main function (with the tree list declaration inside the for statement) this code section will not work. │ **└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ */ #include <cstdlib> #include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> #include "GenericTree.h" // ------------------------------------------------------------------------- typedef int TData; typedef PUJ::GenericTree< TData > TTree; typedef std::vector< TTree > TTreeList; // ------------------------------------------------------------------------- int main( int argc, char* argv[] ) { if( argc < 2 ) { std::cerr << "Usage: " << argv[ 0 ] << " input_tree" << std::endl; return( 1 ); } // fi std::string input_tree_filename = argv[ 1 ]; // Read file into a buffer std::ifstream input_tree_file( input_tree_filename.c_str( ), std::ios::in | std::ios::binary | std::ios::ate ); if( !( input_tree_file.is_open( ) ) ) { std::cerr << "Unable to open file \"" << input_tree_filename << "\"" << std::endl; return( 1 ); } // fi std::streampos size = input_tree_file.tellg( ); char* buffer = new char [ size ]; input_tree_file.seekg( 0, std::ios::beg ); input_tree_file.read( buffer, size ); input_tree_file.close( ); // Put buffer into a string stream std::stringstream input_tree_stream( buffer, std::ios_base::in ); // Read trees unsigned int nTrees = 0; input_tree_stream >> nTrees; //std::cout << nTrees; for( unsigned int tId = 0; tId < nTrees; ++tId ) { TTreeList tree_list; tree_list.push_back( TTree( ) ); tree_list.rbegin( )->BuildFromPreorder( input_tree_stream ); std::string pngFile = "test"; pngFile += std::to_string((int)tId); pngFile += ".png"; std::cout << "Weight: " << tree_list.rbegin( )->Weight() << std::endl; std::cout << "Height: " << tree_list.rbegin( )->Height() << std::endl; std::cout << "Global Order: " << tree_list.rbegin( )->GlobalOrder() << std::endl; std::cout << "Width: " << tree_list.rbegin( )->Width() << std::endl; std::cout << std::endl; std::cout << "PreOrder: "; tree_list.rbegin( )->PrintPreOrder(); std::cout << std::endl; std::cout << "PosOrder: "; tree_list.rbegin( )->PrintPostOrder(); std::cout << std::endl; std::cout << "InOrder: "; tree_list.rbegin( )->PrintInOrder(); std::cout << std::endl; std::cout << "Levels: "; tree_list.rbegin( )->PrintLevels(); std::cout << std::endl; unsigned int height = tree_list.rbegin()->Height(); for(unsigned int j = 1; j <= height; j++) { std::cout << "(L->R) Nodes in level " << j << ": "; tree_list.rbegin()->LevelValues(j,true); std::cout << std::endl; std::cout << "(R->L) Nodes in level " << j << ": "; tree_list.rbegin()->LevelValues(j,false); std::cout << std::endl; } std::cout << std::endl; std::cout << "Is AVL?: " << ((tree_list.rbegin()->IsAVL())? "Yes\n" : "No\n"); std::cout << "Is Heap?: " << ((tree_list.rbegin()->IsHeap())? "Yes\n" : "No\n"); tree_list.rbegin()->PrintAsPNG(pngFile); } // rof /*┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ **│This code section can be used to test some methods. However, in the current status of the main, it will not work. │ **│Some methods calls can be moved to the for statement to use it like the other ones, although they were intented to │ **│use it with a certain tree (in_mine.txt, with the tree of -4900 as root) │ **└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ */ /* int a = -2001; int b = -1202; int c = -1; std::vector<int> resultado; std::cout << "Common Ancestor between " << a << " and " << b << ": "; const int* result = tree_list.rbegin( )->CommonAncestor(a,b); if(result != NULL) std::cout << *result; else std::cout << "Uno de los valores no existe"; std::cout << std::endl; std::cout << "Road between " << a << " and " << b << ": "; resultado = tree_list.rbegin( )->PathBetweenTwoNodes(a,b); if(resultado.size() > 0) for (std::vector<int>::iterator it = resultado.begin(); it != resultado.end(); it++) { std::cout << *it << "->"; } else std::cout << "Uno de los valores no existe"; std::cout << std::endl; std::cout << c << " is: " << tree_list.rbegin()->countRepeated(c) << " times.\n"; std::cout << "The repeated values in the tree are: "; resultado = tree_list.rbegin()->getRepeatedValues(); for (std::vector<int>::iterator it = resultado.begin(); it != resultado.end(); it++) { std::cout << *it << ", "; } std::cout << std::endl; std::cout << "\nEnd\n";*/ // Free buffer delete[] buffer; // TODO return( 0 ); } // eof - test.cxx
[ "sergio.mejia@javeriana.edu.co" ]
sergio.mejia@javeriana.edu.co
d469f46a91bd88add3c70ef60ebb5068d2105050
97e7b546213d5c9ea4ecf20327a4829fcd004350
/Robot_Server/ui_snprescandialog.h
792cb1e504b7c3e6bab77662face678eac947469
[]
no_license
wayneliu0512/Robot
7cb1b0e2b14d57877ab66ff90ab114bb421366bc
895684a0effab3becff024c25d3e5d46e2bf9786
refs/heads/master
2021-01-23T22:54:12.903820
2017-10-26T10:01:08
2017-10-26T10:01:08
102,946,419
0
0
null
null
null
null
UTF-8
C++
false
false
15,895
h
/******************************************************************************** ** Form generated from reading UI file 'snprescandialog.ui' ** ** Created by: Qt User Interface Compiler version 5.7.1 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_SNPRESCANDIALOG_H #define UI_SNPRESCANDIALOG_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QDialog> #include <QtWidgets/QGroupBox> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QLineEdit> QT_BEGIN_NAMESPACE class Ui_SNpreScanDialog { public: QGroupBox *groupBox; QLabel *label; QLabel *label_2; QLabel *label_3; QLabel *label_4; QLineEdit *lineEdit_Tooling_1; QLineEdit *lineEdit_Base_1; QLineEdit *lineEdit_ModuleBase_1; QLineEdit *lineEdit_Module_1; QGroupBox *groupBox_2; QLabel *label_5; QLabel *label_6; QLabel *label_7; QLabel *label_8; QLineEdit *lineEdit_Tooling_2; QLineEdit *lineEdit_Base_2; QLineEdit *lineEdit_ModuleBase_2; QLineEdit *lineEdit_Module_2; QGroupBox *groupBox_3; QLabel *label_9; QLabel *label_10; QLabel *label_11; QLabel *label_12; QLineEdit *lineEdit_Tooling_3; QLineEdit *lineEdit_Base_3; QLineEdit *lineEdit_ModuleBase_3; QLineEdit *lineEdit_Module_3; void setupUi(QDialog *SNpreScanDialog) { if (SNpreScanDialog->objectName().isEmpty()) SNpreScanDialog->setObjectName(QStringLiteral("SNpreScanDialog")); SNpreScanDialog->resize(721, 216); groupBox = new QGroupBox(SNpreScanDialog); groupBox->setObjectName(QStringLiteral("groupBox")); groupBox->setGeometry(QRect(20, 30, 221, 151)); QFont font; font.setPointSize(12); groupBox->setFont(font); label = new QLabel(groupBox); label->setObjectName(QStringLiteral("label")); label->setGeometry(QRect(10, 30, 81, 16)); label_2 = new QLabel(groupBox); label_2->setObjectName(QStringLiteral("label_2")); label_2->setGeometry(QRect(10, 60, 81, 16)); label_3 = new QLabel(groupBox); label_3->setObjectName(QStringLiteral("label_3")); label_3->setGeometry(QRect(10, 90, 81, 16)); label_4 = new QLabel(groupBox); label_4->setObjectName(QStringLiteral("label_4")); label_4->setGeometry(QRect(10, 120, 81, 16)); lineEdit_Tooling_1 = new QLineEdit(groupBox); lineEdit_Tooling_1->setObjectName(QStringLiteral("lineEdit_Tooling_1")); lineEdit_Tooling_1->setGeometry(QRect(102, 30, 111, 21)); lineEdit_Base_1 = new QLineEdit(groupBox); lineEdit_Base_1->setObjectName(QStringLiteral("lineEdit_Base_1")); lineEdit_Base_1->setGeometry(QRect(100, 60, 113, 21)); lineEdit_ModuleBase_1 = new QLineEdit(groupBox); lineEdit_ModuleBase_1->setObjectName(QStringLiteral("lineEdit_ModuleBase_1")); lineEdit_ModuleBase_1->setGeometry(QRect(100, 90, 113, 21)); lineEdit_Module_1 = new QLineEdit(groupBox); lineEdit_Module_1->setObjectName(QStringLiteral("lineEdit_Module_1")); lineEdit_Module_1->setGeometry(QRect(100, 120, 113, 21)); groupBox_2 = new QGroupBox(SNpreScanDialog); groupBox_2->setObjectName(QStringLiteral("groupBox_2")); groupBox_2->setEnabled(false); groupBox_2->setGeometry(QRect(250, 30, 221, 151)); groupBox_2->setFont(font); label_5 = new QLabel(groupBox_2); label_5->setObjectName(QStringLiteral("label_5")); label_5->setGeometry(QRect(10, 30, 81, 16)); label_6 = new QLabel(groupBox_2); label_6->setObjectName(QStringLiteral("label_6")); label_6->setGeometry(QRect(10, 60, 81, 16)); label_7 = new QLabel(groupBox_2); label_7->setObjectName(QStringLiteral("label_7")); label_7->setGeometry(QRect(10, 90, 81, 16)); label_8 = new QLabel(groupBox_2); label_8->setObjectName(QStringLiteral("label_8")); label_8->setGeometry(QRect(10, 120, 81, 16)); lineEdit_Tooling_2 = new QLineEdit(groupBox_2); lineEdit_Tooling_2->setObjectName(QStringLiteral("lineEdit_Tooling_2")); lineEdit_Tooling_2->setGeometry(QRect(100, 30, 113, 21)); lineEdit_Base_2 = new QLineEdit(groupBox_2); lineEdit_Base_2->setObjectName(QStringLiteral("lineEdit_Base_2")); lineEdit_Base_2->setGeometry(QRect(100, 60, 113, 21)); lineEdit_ModuleBase_2 = new QLineEdit(groupBox_2); lineEdit_ModuleBase_2->setObjectName(QStringLiteral("lineEdit_ModuleBase_2")); lineEdit_ModuleBase_2->setGeometry(QRect(100, 90, 113, 21)); lineEdit_Module_2 = new QLineEdit(groupBox_2); lineEdit_Module_2->setObjectName(QStringLiteral("lineEdit_Module_2")); lineEdit_Module_2->setGeometry(QRect(100, 120, 113, 21)); groupBox_3 = new QGroupBox(SNpreScanDialog); groupBox_3->setObjectName(QStringLiteral("groupBox_3")); groupBox_3->setEnabled(false); groupBox_3->setGeometry(QRect(480, 30, 221, 151)); groupBox_3->setFont(font); label_9 = new QLabel(groupBox_3); label_9->setObjectName(QStringLiteral("label_9")); label_9->setGeometry(QRect(10, 30, 81, 16)); label_10 = new QLabel(groupBox_3); label_10->setObjectName(QStringLiteral("label_10")); label_10->setGeometry(QRect(10, 60, 81, 16)); label_11 = new QLabel(groupBox_3); label_11->setObjectName(QStringLiteral("label_11")); label_11->setGeometry(QRect(10, 90, 81, 16)); label_12 = new QLabel(groupBox_3); label_12->setObjectName(QStringLiteral("label_12")); label_12->setGeometry(QRect(10, 120, 81, 16)); lineEdit_Tooling_3 = new QLineEdit(groupBox_3); lineEdit_Tooling_3->setObjectName(QStringLiteral("lineEdit_Tooling_3")); lineEdit_Tooling_3->setGeometry(QRect(100, 30, 113, 21)); lineEdit_Base_3 = new QLineEdit(groupBox_3); lineEdit_Base_3->setObjectName(QStringLiteral("lineEdit_Base_3")); lineEdit_Base_3->setGeometry(QRect(100, 60, 113, 21)); lineEdit_ModuleBase_3 = new QLineEdit(groupBox_3); lineEdit_ModuleBase_3->setObjectName(QStringLiteral("lineEdit_ModuleBase_3")); lineEdit_ModuleBase_3->setGeometry(QRect(100, 90, 113, 21)); lineEdit_Module_3 = new QLineEdit(groupBox_3); lineEdit_Module_3->setObjectName(QStringLiteral("lineEdit_Module_3")); lineEdit_Module_3->setGeometry(QRect(100, 120, 113, 21)); QWidget::setTabOrder(lineEdit_Tooling_1, lineEdit_Base_1); QWidget::setTabOrder(lineEdit_Base_1, lineEdit_ModuleBase_1); QWidget::setTabOrder(lineEdit_ModuleBase_1, lineEdit_Module_1); QWidget::setTabOrder(lineEdit_Module_1, lineEdit_Tooling_2); QWidget::setTabOrder(lineEdit_Tooling_2, lineEdit_Base_2); QWidget::setTabOrder(lineEdit_Base_2, lineEdit_ModuleBase_2); QWidget::setTabOrder(lineEdit_ModuleBase_2, lineEdit_Module_2); QWidget::setTabOrder(lineEdit_Module_2, lineEdit_Tooling_3); QWidget::setTabOrder(lineEdit_Tooling_3, lineEdit_Base_3); QWidget::setTabOrder(lineEdit_Base_3, lineEdit_ModuleBase_3); QWidget::setTabOrder(lineEdit_ModuleBase_3, lineEdit_Module_3); retranslateUi(SNpreScanDialog); QMetaObject::connectSlotsByName(SNpreScanDialog); } // setupUi void retranslateUi(QDialog *SNpreScanDialog) { SNpreScanDialog->setWindowTitle(QApplication::translate("SNpreScanDialog", "Pre Scan Dialog", Q_NULLPTR)); #ifndef QT_NO_TOOLTIP SNpreScanDialog->setToolTip(QString()); #endif // QT_NO_TOOLTIP groupBox->setTitle(QApplication::translate("SNpreScanDialog", "Tooling1", Q_NULLPTR)); label->setText(QApplication::translate("SNpreScanDialog", "Tooling", Q_NULLPTR)); label_2->setText(QApplication::translate("SNpreScanDialog", "Base", Q_NULLPTR)); label_3->setText(QApplication::translate("SNpreScanDialog", "Module base", Q_NULLPTR)); label_4->setText(QApplication::translate("SNpreScanDialog", "Module", Q_NULLPTR)); #ifndef QT_NO_WHATSTHIS lineEdit_Tooling_1->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\251\237\347\256\261\345\272\217\350\231\237:</p><p>FX-[\347\224\242\345\223\201\345\236\213\350\231\237]-[1~3\344\275\215\346\225\270\345\255\227,\346\265\201\346\260\264\350\231\237]</p><p>PS: \346\255\244\345\272\217\350\231\237\346\234\203\350\267\237Base_Setting.ini\350\243\241\346\257\224\345\260\215,\346\211\276\344\270\215\345\210\260\346\234\203\351\214\257\350\252\244</p><p><br/></p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_Base_1->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\251\237\347\256\261\345\256\232\344\275\215\345\272\247\345\272\217\350\231\237</p><p>1~3\344\275\215\346\225\270\345\255\227</p><p>PS:\351\234\200\350\246\201\350\267\237Module base \347\233\270\345\220\214</p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_ModuleBase_1->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\250\241\347\265\204\345\272\247\345\272\217\350\231\237:</p><p>1~3\344\275\215\346\225\270\345\255\227</p><p>PS:\351\234\200\350\246\201\350\267\237base \347\233\270\345\220\214</p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_Module_1->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\250\241\347\265\204\345\272\217\350\231\237:</p><p>FX-[\347\224\242\345\223\201\345\236\213\350\231\237+M]-[1~3\344\275\215\346\225\270\345\255\227,\346\265\201\346\260\264\350\231\237]</p><p>PS: \346\255\244\345\272\217\350\231\237\346\234\203\347\224\250\347\224\242\345\223\201\345\236\213\350\231\237\350\267\237\346\251\237\347\256\261\347\224\242\345\223\201\345\236\213\350\231\237\344\275\234\346\257\224\345\260\215,\344\270\215\347\233\270\345\220\214\346\234\203\351\214\257\350\252\244</p><p><br/></p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS groupBox_2->setTitle(QApplication::translate("SNpreScanDialog", "Tooling2", Q_NULLPTR)); label_5->setText(QApplication::translate("SNpreScanDialog", "Tooling", Q_NULLPTR)); label_6->setText(QApplication::translate("SNpreScanDialog", "Base", Q_NULLPTR)); label_7->setText(QApplication::translate("SNpreScanDialog", "Module base", Q_NULLPTR)); label_8->setText(QApplication::translate("SNpreScanDialog", "Module", Q_NULLPTR)); #ifndef QT_NO_WHATSTHIS lineEdit_Tooling_2->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\251\237\347\256\261\345\272\217\350\231\237:</p><p>FX-[\347\224\242\345\223\201\345\236\213\350\231\237]-[1~3\344\275\215\346\225\270\345\255\227,\346\265\201\346\260\264\350\231\237]</p><p>PS: \346\255\244\345\272\217\350\231\237\346\234\203\350\267\237Base_Setting.ini\350\243\241\346\257\224\345\260\215,\346\211\276\344\270\215\345\210\260\346\234\203\351\214\257\350\252\244</p><p><br/></p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_Base_2->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\251\237\347\256\261\345\256\232\344\275\215\345\272\247\345\272\217\350\231\237</p><p>1~3\344\275\215\346\225\270\345\255\227</p><p>PS:\351\234\200\350\246\201\350\267\237Module base \347\233\270\345\220\214</p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_ModuleBase_2->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\250\241\347\265\204\345\272\247\345\272\217\350\231\237:</p><p>1~3\344\275\215\346\225\270\345\255\227</p><p>PS:\351\234\200\350\246\201\350\267\237base \347\233\270\345\220\214</p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_Module_2->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\250\241\347\265\204\345\272\217\350\231\237:</p><p>FX-[\347\224\242\345\223\201\345\236\213\350\231\237+M]-[1~3\344\275\215\346\225\270\345\255\227,\346\265\201\346\260\264\350\231\237]</p><p>PS: \346\255\244\345\272\217\350\231\237\346\234\203\347\224\250\347\224\242\345\223\201\345\236\213\350\231\237\350\267\237\346\251\237\347\256\261\347\224\242\345\223\201\345\236\213\350\231\237\344\275\234\346\257\224\345\260\215,\344\270\215\347\233\270\345\220\214\346\234\203\351\214\257\350\252\244</p><p><br/></p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS groupBox_3->setTitle(QApplication::translate("SNpreScanDialog", "Tooling3", Q_NULLPTR)); label_9->setText(QApplication::translate("SNpreScanDialog", "Tooling", Q_NULLPTR)); label_10->setText(QApplication::translate("SNpreScanDialog", "Base", Q_NULLPTR)); label_11->setText(QApplication::translate("SNpreScanDialog", "Module base", Q_NULLPTR)); label_12->setText(QApplication::translate("SNpreScanDialog", "Module", Q_NULLPTR)); #ifndef QT_NO_WHATSTHIS lineEdit_Tooling_3->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\251\237\347\256\261\345\272\217\350\231\237:</p><p>FX-[\347\224\242\345\223\201\345\236\213\350\231\237]-[1~3\344\275\215\346\225\270\345\255\227,\346\265\201\346\260\264\350\231\237]</p><p>PS: \346\255\244\345\272\217\350\231\237\346\234\203\350\267\237Base_Setting.ini\350\243\241\346\257\224\345\260\215,\346\211\276\344\270\215\345\210\260\346\234\203\351\214\257\350\252\244</p><p><br/></p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_Base_3->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\251\237\347\256\261\345\256\232\344\275\215\345\272\247\345\272\217\350\231\237</p><p>1~3\344\275\215\346\225\270\345\255\227</p><p>PS:\351\234\200\350\246\201\350\267\237Module base \347\233\270\345\220\214</p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_ModuleBase_3->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\250\241\347\265\204\345\272\247\345\272\217\350\231\237:</p><p>1~3\344\275\215\346\225\270\345\255\227</p><p>PS:\351\234\200\350\246\201\350\267\237base \347\233\270\345\220\214</p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS #ifndef QT_NO_WHATSTHIS lineEdit_Module_3->setWhatsThis(QApplication::translate("SNpreScanDialog", "<html><head/><body><p>\346\250\241\347\265\204\345\272\217\350\231\237:</p><p>FX-[\347\224\242\345\223\201\345\236\213\350\231\237+M]-[1~3\344\275\215\346\225\270\345\255\227,\346\265\201\346\260\264\350\231\237]</p><p>PS: \346\255\244\345\272\217\350\231\237\346\234\203\347\224\250\347\224\242\345\223\201\345\236\213\350\231\237\350\267\237\346\251\237\347\256\261\347\224\242\345\223\201\345\236\213\350\231\237\344\275\234\346\257\224\345\260\215,\344\270\215\347\233\270\345\220\214\346\234\203\351\214\257\350\252\244</p><p><br/></p></body></html>", Q_NULLPTR)); #endif // QT_NO_WHATSTHIS } // retranslateUi }; namespace Ui { class SNpreScanDialog: public Ui_SNpreScanDialog {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_SNPRESCANDIALOG_H
[ "wayneliu0512@gmail.com" ]
wayneliu0512@gmail.com
3ad716721dd8f995f6d67a7aa35e1fb6f582efe0
c7be051ed3892bac16226d9bd275a4de7954eca3
/Bamf/SynchronousGameLoop.h
c8a76bce119a09a33e80cb962c38980f84bb1ef7
[]
no_license
mikehershey/bamf
516693e3b0ad16086f99dcfc5ae4915118b93db7
d905d80e4702f4cb3c15ad58529b3a904c9d9905
refs/heads/master
2021-01-24T02:16:02.511957
2013-02-06T00:54:05
2013-02-06T00:54:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,096
h
// // SynchronousGameLoop.h // Bamf // // Created by Matthew Hinkle on 2/1/13. // // #ifndef __Bamf__SynchronousGameLoop__ #define __Bamf__SynchronousGameLoop__ #include <SDL2/SDL.h> #include "GameLoop.h" namespace bamf { /** The instructions in a SynchronousGameLoop will execute each subsystem in order. This does not guarentee that the current subsystem is the only running subsystem as previous subsystems may have spawned childen which are still running. */ class SynchronousGameLoop : public GameLoop { public: /** Default Constructor @brief create a new gameloop in a non-running state */ explicit SynchronousGameLoop(); virtual ~SynchronousGameLoop(); inline bool isSuspended() const { return this->suspended; } /* GameLoop interface */ virtual void restart(); virtual void start(); virtual void stop(); virtual void suspend(); private: static int run(void * loop); int run(); bool running; bool suspended; SDL_Thread * thread; SDL_cond * suspendCond; SDL_mutex * suspendMutex; }; } #endif /* defined(__Bamf__SynchronousGameLoop__) */
[ "=" ]
=
e235229ef7979ec26af9277448746ddcb6d1920e
6c621d565f92068934b5be73b472e2a13c37bc99
/20150708/prime.cpp
6ed4e14ccf091b2073e0fc608464466e6fc8d66c
[]
no_license
tangodown1934/Algorithm-judge
4e6ac9d1f0efa26cc19d564383cdba290bfcdc38
3712ea9a26d05cfa8bc941d0876917a0f2fb5a3c
refs/heads/master
2021-01-10T02:50:28.577942
2015-08-20T03:11:21
2015-08-20T03:11:21
46,277,735
0
0
null
null
null
null
UTF-8
C++
false
false
367
cpp
#include <stdio.h> int main(){ int size, min, i; int arr[100]; scanf("%d", &size); for(i=0;i<size;i++){ scanf("%d", &arr[i]); } min = arr[0]; for(i=0;i<size;i++){ if(arr[i]<min){ min = arr[i]; } } for(i=0;i<size;i++){ if(arr[i]==min){ printf("%d ", i+1); } } }
[ "tangodown1934@gmail.com" ]
tangodown1934@gmail.com
d8caba68454fc264bc5730ff7e3b51306abf99ee
ad8271700e52ec93bc62a6fa3ee52ef080e320f2
/CatalystRichPresence/CatalystSDK/VisualEnvironmentReferenceObjectData.h
d110b95cc96c7adf5bed0d56a2d347695e4bbfba
[]
no_license
RubberDuckShobe/CatalystRPC
6b0cd4482d514a8be3b992b55ec143273b3ada7b
92d0e2723e600d03c33f9f027c3980d0f087c6bf
refs/heads/master
2022-07-29T20:50:50.640653
2021-03-25T06:21:35
2021-03-25T06:21:35
351,097,185
2
0
null
null
null
null
UTF-8
C++
false
false
659
h
// // Generated with FrostbiteGen by Chod // File: SDK\VisualEnvironmentReferenceObjectData.h // Created: Wed Mar 10 18:59:12 2021 // #ifndef FBGEN_VisualEnvironmentReferenceObjectData_H #define FBGEN_VisualEnvironmentReferenceObjectData_H #include "LogicReferenceObjectData.h" class VisualEnvironmentReferenceObjectData : public LogicReferenceObjectData // size = 0xa0 { public: static void* GetTypeInfo() { return (void*)0x0000000142821DE0; } int m_Priority; // 0xa0 bool m_OverrideVisibility; // 0xa4 bool m_OwnedByLightingContextPad; // 0xa5 unsigned char _0xa6[0xa]; }; // size = 0xb0 #endif // FBGEN_VisualEnvironmentReferenceObjectData_H
[ "dog@dog.dog" ]
dog@dog.dog
80c2f1d94784f599d05ae8315728b405e3fa63dc
877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a
/app/src/main/cpp/dir35435/dir35536/dir35859/dir37014/file37844.cpp
f6f653bc6628b0780fbcb4dd70602c682fe6ef59
[]
no_license
tgeng/HugeProject
829c3bdfb7cbaf57727c41263212d4a67e3eb93d
4488d3b765e8827636ce5e878baacdf388710ef2
refs/heads/master
2022-08-21T16:58:54.161627
2020-05-28T01:54:03
2020-05-28T01:54:03
267,468,475
0
0
null
null
null
null
UTF-8
C++
false
false
115
cpp
#ifndef file37844 #error "macro file37844 must be defined" #endif static const char* file37844String = "file37844";
[ "tgeng@google.com" ]
tgeng@google.com
c62c7352970b2c1807bf969a1291b37582fe3b8f
9e919419c25c5e771efc3055213ffa7eadf81da0
/lib/src/Vip.cpp
8cb1b1bb83ca0e19a2895771eb2c102e3d406477
[]
no_license
krzysztof-gancarz/vm-renting
4d95e6fc0799591097c3ae1297ebaad3bc4578c8
c5bb020ac09950dbe3e1287484c9abc27c9470ac
refs/heads/master
2020-12-15T00:37:36.023314
2020-01-27T04:20:54
2020-01-27T04:20:54
234,767,842
1
0
null
null
null
null
UTF-8
C++
false
false
202
cpp
#include "Vip.h" Vip::Vip() { this->maxReservations = 4; } Vip::~Vip() { } int Vip::getMaxReservations() { return maxReservations; } std::string Vip::getInfo() { return "Klient Vip"; }
[ "student@student-iit" ]
student@student-iit
0f53da6155b76203c9cb07327b716e5ccbc33793
b9a9bba84be9fa106e06d64dcdc32661c4f88c5d
/Potato Engine/Engine/TextRenderer.cpp
054d9d46794ec9cc121f1617390733a4c304c0c7
[ "MIT" ]
permissive
BrunoAOR/Potato-Engine
79bee4e789043b20be08f570b90fe1f172902fcb
7395f7b10c6a7537c7880194c4b61ee001dc8372
refs/heads/master
2021-05-14T00:59:19.109330
2018-01-08T21:10:19
2018-01-08T21:10:19
116,555,191
1
0
null
null
null
null
UTF-8
C++
false
false
6,267
cpp
#include "TextRenderer.h" #include "SDL2_image/include/SDL_image.h" #include "globals.h" #include "gameConfig.h" #include "PixelPosition.h" TextRenderer::TextRenderer() : m_text("") , m_shouldReloadTexture(true) { } TextRenderer::~TextRenderer() { freeFontTexture(); } void TextRenderer::render() { if (m_shouldReloadTexture) { rebuildTexture(); m_shouldReloadTexture = false; } renderMain(&m_clipRect); } bool TextRenderer::loadFont(const Font& font) { // Get rid of previous font texture if (m_texture == nullptr) { getBlankTexture(); } freeFontTexture(); // Load image at specified path as surface SDL_Surface* loadedSurface = IMG_Load(font.path.c_str()); if (loadedSurface == nullptr) { OutputLog("ERROR: Unable to load font image at path %s! SDL_image Error: %s", font.path.c_str(), IMG_GetError()); } else { if (!validateFont(font, loadedSurface->w, loadedSurface->h)) { SDL_FreeSurface(loadedSurface); OutputLog("ERROR: The Font provided is not valid!"); return false; } m_font = font; // Create texture from surface m_fontTexture = SDL_CreateTextureFromSurface(m_renderer, loadedSurface); if (m_fontTexture == nullptr) { OutputLog("ERROR: Unable to create font texture for font image at path %s! SDL Error: %s", font.path.c_str(), SDL_GetError()); } // Free the loaded surface SDL_FreeSurface(loadedSurface); } return m_fontTexture != nullptr; } int TextRenderer::getCharacterSpacing() const { return m_characterSpacing; } void TextRenderer::setCharacterSpacing(int charSpacing) { if (charSpacing < 0) { OutputLog("WARNING: The requested character spacing (%i) is a negative number. The character spacing will be set to zero.", charSpacing); m_characterSpacing = 0; } else { m_characterSpacing = charSpacing; } } int TextRenderer::getLineSpacing() const { return m_lineSpacing; } void TextRenderer::setLineSpacing(int lineSpacing) { if (lineSpacing < 0) { OutputLog("WARNING: The requested line spacing (%i) is a negative number. The line spacing will be set to zero.", lineSpacing); m_lineSpacing = 0; } else { m_lineSpacing = lineSpacing; } } std::string TextRenderer::getText() const { return m_text; } void TextRenderer::setText(const std::string& text) { if (m_text != text) { m_text = text; m_shouldReloadTexture = true; } } bool TextRenderer::rebuildTexture() { if (m_fontTexture == nullptr) { OutputLog("ERROR: No font texture has been loaded for a TextRenderer with text '%s'!", m_text.c_str()); return false; } if (m_texture == nullptr && !getBlankTexture()) { return false; } // Change the renderer's render target to the text texture (keeping a reference to the original target) SDL_Texture* originalTarget = SDL_GetRenderTarget(m_renderer); SDL_SetRenderTarget(m_renderer, m_texture); // Set Render Color to black transparent and clear the texture SDL_SetRenderDrawColor(m_renderer, 0, 0, 0, 0); SDL_RenderClear(m_renderer); // Reset the clip width and height to zero m_clipRect.w = 0; m_clipRect.h = 0; // For an empty text, nothing further needs to be done if (m_text.length() > 0) { // Current draw position int x = 0; int y = 0; int lineWidth = 0; // Account for the first line m_clipRect.h += m_font.characterHeight; // Now we loop through the whole string for (char c : m_text) { // New line case if (c == '\n') { m_clipRect.h += m_font.characterHeight; if (lineWidth > m_clipRect.w) { m_clipRect.w = lineWidth; } lineWidth = 0; x = 0; y += m_font.characterHeight; } // Space case else if (c == ' ') { lineWidth += m_font.characterWidth; x += m_font.characterWidth; } // Other characters else { // If a character is not found in the font info, we leave a space and log a message if (m_font.charsTopLeftCorners.count(c) == 0) { lineWidth += m_font.characterWidth; x += m_font.characterWidth; OutputLog("WARNING: Character %c could not be found in the font information!", c); } // But if the character is available, draw it to m_texture else { PixelPosition& tlCorner = m_font.charsTopLeftCorners[c]; SDL_Rect sourceRect{ tlCorner.x, tlCorner.y, m_font.characterWidth, m_font.characterHeight }; SDL_Rect destinationRect{ x, y, m_font.characterWidth, m_font.characterHeight }; SDL_RenderCopy(m_renderer, m_fontTexture, &sourceRect, &destinationRect); // Account for the bigger image lineWidth += m_font.characterWidth; x += m_font.characterWidth; } } } if (lineWidth > m_clipRect.w) { m_clipRect.w = lineWidth; } } // Change the renderer's render target back to the original target SDL_SetRenderTarget(m_renderer, originalTarget); return m_texture != nullptr; } bool TextRenderer::getBlankTexture() { // Just in case something goes wrong, we ensure there is no previous texture stored in m_texture free(); //Create uninitialized texture m_texture = SDL_CreateTexture(m_renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, SCREEN_WIDTH, SCREEN_HEIGHT); if (m_texture == nullptr) { OutputLog("ERROR: Unable to create blank texture! SDL Error: %s", SDL_GetError()); } else { // Enable alpha blending SDL_SetTextureBlendMode(m_texture, SDL_BLENDMODE_BLEND); // Reset internal dimensions m_width = SCREEN_WIDTH; m_height = SCREEN_HEIGHT; } return m_texture != nullptr; } void TextRenderer::freeFontTexture() { if (m_fontTexture != nullptr) { SDL_DestroyTexture(m_fontTexture); m_fontTexture = nullptr; } } bool TextRenderer::validateFont(const Font& font, int width, int height) const { if (font.path.length() == 0 || font.characterWidth <= 0 || font.characterHeight <= 0) { return false; } for (auto it : font.charsTopLeftCorners) { PixelPosition& tlCorner = it.second; if (tlCorner.x < 0 || tlCorner.y < 0 || tlCorner.x + font.characterWidth > width || tlCorner.y + font.characterHeight > height) { OutputLog("ERROR: Font information for character %c falls outside of the loaded texture (path: %s)", it.first, font.path.c_str()); return false; } } return true; }
[ "bruno.ortiz.r@gmail.com" ]
bruno.ortiz.r@gmail.com
95836f82e1def597b0e112dfaafa205cea84ce93
2a089691dd6d06764fcb282bfe40bc2771559c7f
/USRLocFinder.cpp
10602c606df3b64c79828ef10c387fcae1a66f16
[]
no_license
greye/clang-rename
dd830618a4d057a3ec70cdf51270f39341fa16f5
68e46dd031b3d2865d86f3c6c3f84c5abfeafcf7
refs/heads/master
2016-08-05T00:32:12.467699
2015-02-16T17:25:04
2015-02-16T17:25:27
30,731,993
0
0
null
null
null
null
UTF-8
C++
false
false
4,809
cpp
//===--- tools/extra/clang-rename/USRLocFinder.cpp - Clang rename tool ----===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// \file /// \brief Mehtods for finding all instances of a USR. Our strategy is very /// simple; we just compare the USR at every relevant AST node with the one /// provided. /// //===----------------------------------------------------------------------===// #include "USRLocFinder.h" #include "USRFinder.h" #include "clang/AST/ASTContext.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/Basic/SourceLocation.h" #include "clang/Index/USRGeneration.h" #include "llvm/ADT/SmallVector.h" using namespace llvm; namespace clang { namespace rename { namespace { // \brief This visitor recursively searches for all instances of a USR in a // translation unit and stores them for later usage. class USRLocFindingASTVisitor : public clang::RecursiveASTVisitor<USRLocFindingASTVisitor> { public: explicit USRLocFindingASTVisitor(const std::string USR) : USR(USR) { } // Declaration visitors: bool VisitNamedDecl(const NamedDecl *Decl) { if (getUSRForDecl(Decl) == USR) { LocationsFound.push_back(Decl->getLocation()); } return true; } // Expression visitors: bool VisitDeclRefExpr(const DeclRefExpr *Expr) { const auto *Decl = Expr->getFoundDecl(); checkNestedNameSpecifierLoc(Expr->getQualifierLoc()); if (getUSRForDecl(Decl) == USR) { LocationsFound.push_back(Expr->getLocation()); } return true; } bool VisitMemberExpr(const MemberExpr *Expr) { const auto *Decl = Expr->getFoundDecl().getDecl(); if (getUSRForDecl(Decl) == USR) { LocationsFound.push_back(Expr->getMemberLoc()); } return true; } bool VisitTypeLoc(TypeLoc TL) { switch(TL.getTypeLocClass()) { // TODO case TypeLoc::ObjCObject: case TypeLoc::InjectedClassName: { if (auto TSTL = TL.getAs<InjectedClassNameTypeLoc>()) { if (getUSRForDecl(TSTL.getDecl()) == USR) { LocationsFound.push_back(TL.getBeginLoc()); } } break; } case TypeLoc::TemplateSpecialization: { if (auto TSTL = TL.getAs<TemplateSpecializationTypeLoc>()) { if (auto TT = dyn_cast<TemplateSpecializationType>(TL.getTypePtr())) { if (auto TD = TT->getTemplateName().getAsTemplateDecl()) { if (getUSRForDecl(TD->getTemplatedDecl()) == USR) { LocationsFound.push_back(TL.getBeginLoc()); } } } } break; } // typedef is tricky case TypeLoc::Typedef: { if (auto TDT = dyn_cast<TypedefType>(TL.getTypePtr())) { if (getUSRForDecl(TDT->getDecl()) == USR) { LocationsFound.push_back(TL.getBeginLoc()); } } break; } // leaf types // TODO: verify correctness, need test cases for each // TODO: Check if Builtin works case TypeLoc::Builtin: case TypeLoc::Enum: case TypeLoc::Record: case TypeLoc::ObjCInterface: case TypeLoc::TemplateTypeParm: { // skip if it's an anonymous type // read Clang`s definition (in RecordDecl) -- not exactly what you think // so we use the length of name if (auto TT = dyn_cast<TagType>(TL.getTypePtr())) { if (getUSRForDecl(TT->getDecl()) == USR) { LocationsFound.push_back(TL.getBeginLoc()); } } break; } default: break; } return true; } // Non-visitors: // \brief Returns a list of unique locations. Duplicate or overlapping // locations are erroneous and should be reported! const std::vector<clang::SourceLocation> &getLocationsFound() const { return LocationsFound; } private: // Namespace traversal: void checkNestedNameSpecifierLoc(NestedNameSpecifierLoc NameLoc) { while (NameLoc) { const auto *Decl = NameLoc.getNestedNameSpecifier()->getAsNamespace(); if (Decl && getUSRForDecl(Decl) == USR) LocationsFound.push_back(NameLoc.getLocalBeginLoc()); NameLoc = NameLoc.getPrefix(); } } // All the locations of the USR were found. const std::string USR; std::vector<clang::SourceLocation> LocationsFound; }; } // namespace std::vector<SourceLocation> getLocationsOfUSR(const std::string USR, Decl *Decl) { USRLocFindingASTVisitor visitor(USR); visitor.TraverseDecl(Decl); return visitor.getLocationsFound(); } } // namespace rename } // namespace clang
[ "greye@null.net" ]
greye@null.net
1de2c7b8bccf02b617bc6c3b8a2c702cabdac939
559f3dec0964d2e0f86c6c871371fe779cf3726c
/deploy/fastdeploy/semantic_segmentation/kunlunxin/cpp/infer.cc
c695cd7324ab2e85c3aaae5e86cf44894dbb7294
[ "Apache-2.0" ]
permissive
PaddlePaddle/PaddleSeg
319ab26665ea492527a1949671650135123ffc39
2c8c35a8949fef74599f5ec557d340a14415f20d
refs/heads/release/2.8
2023-08-31T09:08:06.724717
2023-08-18T01:59:56
2023-08-18T01:59:56
204,380,779
8,531
1,866
Apache-2.0
2023-09-12T02:30:42
2019-08-26T02:32:22
Python
UTF-8
C++
false
false
1,995
cc
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "fastdeploy/vision.h" #ifdef WIN32 const char sep = '\\'; #else const char sep = '/'; #endif void KunlunXinInfer(const std::string& model_dir, const std::string& image_file) { auto model_file = model_dir + sep + "model.pdmodel"; auto params_file = model_dir + sep + "model.pdiparams"; auto config_file = model_dir + sep + "deploy.yaml"; auto option = fastdeploy::RuntimeOption(); option.UseKunlunXin(); auto model = fastdeploy::vision::segmentation::PaddleSegModel( model_file, params_file, config_file, option); if (!model.Initialized()) { std::cerr << "Failed to initialize." << std::endl; return; } auto im = cv::imread(image_file); fastdeploy::vision::SegmentationResult res; if (!model.Predict(im, &res)) { std::cerr << "Failed to predict." << std::endl; return; } std::cout << res.Str() << std::endl; auto vis_im = fastdeploy::vision::VisSegmentation(im, res, 0.5); cv::imwrite("vis_result.jpg", vis_im); std::cout << "Visualized result saved in ./vis_result.jpg" << std::endl; } int main(int argc, char* argv[]) { if (argc < 3) { std::cout << "Usage: infer_demo path/to/model_dir path/to/image run_option, " "e.g ./infer_model ./ppseg_model_dir ./test.jpeg" << std::endl; return -1; } KunlunXinInfer(argv[1], argv[2]); return 0; }
[ "noreply@github.com" ]
noreply@github.com
46462e73d2e27f38609dd00fa11f0843d0362a35
5234e7ddb066514dc6c007a7c501f5d661d7d931
/src/TileManager.cpp
640a8a0a261a21e1e29ed86f7196d8d7719a2b5a
[ "MIT" ]
permissive
Tastyep/SFML-GameResources
b2f337748468bb164a806e5569238bbc3bb2cfb5
398dee2e44a5136a100c3878b7bc973c6f704ac6
refs/heads/master
2020-12-03T00:21:07.241508
2017-07-05T21:19:26
2017-07-05T21:19:26
96,019,356
0
0
null
null
null
null
UTF-8
C++
false
false
925
cpp
#include "TileManager.hpp" #include <SFML/Graphics/Texture.hpp> namespace Ressources { size_t TileManager::parseTexture(const sf::Texture& texture, size_t tileSize) { const auto textureSize = texture.getSize(); _tiles.clear(); for (size_t y = 0; y + tileSize <= textureSize.y; y += tileSize) { for (size_t x = 0; x + tileSize <= textureSize.x; x += tileSize) { _tiles.emplace_back(texture, sf::IntRect{ static_cast<int>(x), // static_cast<int>(y), // static_cast<int>(tileSize), // static_cast<int>(tileSize) }); } } return _tiles.size(); } const std::vector<sf::Sprite>& TileManager::tiles() const { return _tiles; } const sf::Sprite& TileManager::tile(size_t index) const { return _tiles.at(index); } } /* namespace Ressources */
[ "luc.sinet@etixgroup.com" ]
luc.sinet@etixgroup.com
91f2415d9f130905a4431479d482d0097cead43b
7c71410d765d366a388d940c7859538c3b916198
/PTIT018D.cpp
db6cfbf85df87636ba3458a8de95125efaa52799
[]
no_license
dinhtai1104/SPOJ_PTIT
790f8474682e7c8d1a90f01bdd55aa697000897d
e7aef29eda3b0dea6ae5a833810f0a70d4ea4423
refs/heads/master
2022-12-03T22:27:23.397741
2020-08-26T16:00:07
2020-08-26T16:00:07
290,542,452
1
0
null
null
null
null
UTF-8
C++
false
false
826
cpp
#include<iostream> #include<algorithm> #include<string> using namespace std; typedef long long ll; ll giatri(string s){ ll t=0; for(int i=0;i<s.length();i++) t+= s[i]-'A'; //t%=26; return t; } void chuyen(string &s, ll t){ for(int i=0;i<s.length();i++){ s[i]-='A'; t%=26; s[i]+=t; if(s[i]>=26){ s[i]%=26; } s[i]+='A'; } } void chuyen1(char &x, ll t){ x-='A'; t%=26; x+=t; if(x>=26){ x%=26; } x+='A'; } int main() { int t; cin>>t; while(t--){ string s; cin>>s; int len=s.length(); string s1=s.substr(0,len/2), s2=s.substr(len/2, len); //cout<<s1<<'\n'<<s2<<endl; //cout<<giatri(s1)<<'\n'<<giatri(s2)<<endl; chuyen(s1,giatri(s1)); chuyen(s2,giatri(s2)); //cout<<s1<<'\n'<<s2<<endl; for(int i=0;i<s1.length();i++) chuyen1(s1[i], s2[i]-'A'); cout<<s1<<'\n'; } }
[ "51129122+dinhtai1104@users.noreply.github.com" ]
51129122+dinhtai1104@users.noreply.github.com
f325197a826150d24f21759595854cf403deacb5
2485ffe62134cd39d4c5cf12f8e73ca9ef781dd1
/contrib/boost/type_index/examples/demangled_names.cpp
8ddc2115e354ea81bb8aceadb24b097f6b411f1a
[ "MIT", "BSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
alesapin/XMorphy
1aed0c8e0f8e74efac9523f4d6e585e5223105ee
aaf1d5561cc9227691331a515ca3bc94ed6cc0f1
refs/heads/master
2023-04-16T09:27:58.731844
2023-04-08T17:15:26
2023-04-08T17:15:26
97,373,549
37
5
MIT
2023-04-08T17:15:27
2017-07-16T09:35:41
C++
UTF-8
C++
false
false
2,464
cpp
// Copyright 2013-2023 Antony Polukhin // Distributed under the Boost Software License, Version 1.0. // (See the accompanying file LICENSE_1_0.txt // or a copy at <http://www.boost.org/LICENSE_1_0.txt>.) //[type_index_names_example /*` The following example shows how short (mangled) and human readable type names could be obtained from a type. Works with and without RTTI. */ #include <boost/type_index.hpp> #include <iostream> template <class T> void foo(T) { std::cout << "\n Short name: " << boost::typeindex::type_id<T>().raw_name(); std::cout << "\n Readable name: " << boost::typeindex::type_id<T>().pretty_name(); } struct user_defined_type{}; namespace ns1 { namespace ns2 { struct user_defined_type{}; }} // namespace ns1::ns2 namespace { struct in_anon_type{}; } // anonymous namespace int main() { // Call to foo(1); // will output something like this: // // (RTTI on) (RTTI off) // Short name: i Short name: int] // Readable name: int Readable name: int user_defined_type t; foo(t); // Will output: // // (RTTI on) (RTTI off) // Short name: 17user_defined_type user_defined_type] // Readable name: user_defined_type user_defined_type ns1::ns2::user_defined_type t_in_ns; foo(t_in_ns); // Will output: // // (RTTI on) (RTTI off) // Short name: N3ns13ns217user_defined_typeE ns1::ns2::user_defined_type] // Readable name: ns1::ns2::user_defined_type ns1::ns2::user_defined_type in_anon_type anon_t; foo(anon_t); // Will output: // // (RTTI on) (RTTI off) // Short name: N12_GLOBAL__N_112in_anon_typeE {anonymous}::in_anon_type] // Readable name: (anonymous namespace)::in_anon_type {anonymous}::in_anon_type } /*` Short names are very compiler dependant: some compiler will output `.H`, others `i`. Readable names may also differ between compilers: `struct user_defined_type`, `user_defined_type`. [warning With RTTI off different classes with same names in anonymous namespace may collapse. See 'RTTI emulation limitations'. ] */ //] [/type_index_names_example]
[ "alesapin@gmail.com" ]
alesapin@gmail.com
8b3e188065337839c13ad03f0990dba5c40b3428
81d92eb17bf73a8627f91b7d670fd0de327aeb1c
/cpp-tutorial/stage1/main/singleton.h
265873da50e7db02f65f833e1ac0df65b6907d5a
[]
no_license
buaa-wuhao/Wu-Hao-Repo
6d18326210c61ab64f57c6f46e3b398d454a703a
0b1185242a31f30c65ccd6552e9bc04035e4316a
refs/heads/master
2022-05-12T06:26:49.079467
2022-04-27T03:57:54
2022-04-27T03:57:54
130,005,132
0
0
null
null
null
null
UTF-8
C++
false
false
434
h
class mySingleton{ private: static mySingleton* singleton_; protected: mySingleton()=default; public: static mySingleton* instance(); mySingleton(const mySingleton& other) = delete; mySingleton& operator=(const mySingleton& other) = delete; }; mySingleton* mySingleton::singleton_ = nullptr; mySingleton* mySingleton::instance() { if(singleton_==nullptr) { singleton_ = new mySingleton(); } return singleton_; }
[ "hao.wu@stellantis.com" ]
hao.wu@stellantis.com
d4149b3485c72c213febbccf3d6e4f42da5d355c
b67444bdd6425e8475dc0ce9cbe088b24ccf310d
/A_star_to_goal.cpp
a428923b2457e94f5a805b2e67c2f07253a156dd
[]
no_license
lucianoporchet/AIBootcamp
7a9a7c6525d7cc618ad255ea4742d0558a8a8ed3
88954d7138fc8bb231c76d9d0b55ce002566354e
refs/heads/master
2023-08-29T19:44:51.425641
2021-10-21T14:16:32
2021-10-21T14:16:32
411,840,974
0
0
null
null
null
null
UTF-8
C++
false
false
950
cpp
#include "A_star_to_goal.h" status A_star_to_goal::run(std::list<SOrder>&, int index, const STurnData& turnInfo, Logger& l) { l.Log("A to goal"); Tile pos{ turnInfo.npcInfoArray[index].q, turnInfo.npcInfoArray[index].r }; Grid& grid = Grid::get(); std::sort(begin(grid.goals), end(grid.goals), [&](const Tile& a, const Tile& b) { return heuristic(a, pos) < heuristic(b, pos); }); //auto listPos = grid.List_of_paths.begin() + index; for (auto g : grid.goals) { a_star_search(grid, pos, g, grid.came_from, grid.cost_so_far); if (grid.came_from.find(g) != grid.came_from.end()) { grid.List_of_paths[index] = reconstruct_path(pos, g, grid.came_from); grid.came_from.clear(); grid.cost_so_far.clear(); grid.reserveGoal(g); grid.goals.erase(std::remove(grid.goals.begin(), grid.goals.end(), g), grid.goals.end()); //grid.reserved_goals.push_back(goal); return status::SUCCESS; break; } } return status::FAILURE; }
[ "porl2001@usherbrooke.ca" ]
porl2001@usherbrooke.ca
bb12fbce36ee86a28048386a4ad1dcb83e9b6f4a
f23bf2d9dfa65281dafa74cd22de796c03d575f2
/AOJ/CGL/CGL7_E_CrossPointsOfCircle.cpp
821eadaef01425e963acb6b7feb73c28379bbb38
[]
no_license
trmr/code
81181c1a5fde757f081ecc377765c81e48d547bd
201a761063cd79a5887733964c015f60cd971601
refs/heads/master
2023-03-23T11:27:48.105310
2021-03-09T01:33:08
2021-03-09T01:33:08
237,609,489
0
0
null
null
null
null
UTF-8
C++
false
false
6,049
cpp
#include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <csignal> #include <cstddef> #include <cstdio> #include <cstdlib> #include <ctime> #include <cinttypes> #include <cstdint> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #include <array> #include <chrono> #include <forward_list> #include <initializer_list> #include <random> #include <regex> #include <tuple> #include <type_traits> #include <unordered_map> #include <unordered_set> using namespace std; using ll = long long; using Field = vector<vector<ll>>; using Graph = vector<vector<ll>>; using VI = vector<int>; using VL = vector<ll>; using VVL = vector<vector<ll>>; using VC = vector<char>; using PI = pair<int, int>; #define FOR(i, s, n) for (int i = s; i < (n); i++) #define REP(i, n) for (int i = 0; i < (n); i++) #define ALL(x) x.begin(), x.end() const long long INF = 1LL<<60; const int MOD = 1000000007; template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } struct Vector { double x, y; Vector(double x = 0, double y = 0): x(x), y(y) {} Vector operator + (Vector v) {return Vector(x + v.x, y + v.y);} Vector operator - (Vector v) {return Vector(x - v.x, y - v.y);} Vector operator * (double a) {return Vector(a * x, a * y);} Vector operator / (double a) {return Vector(x / a, y / a);} double abs() { return sqrt(norm());} double norm() { return x * x + y * y;} bool operator < (const Vector &v) const { return x != v.x ? x < v.x : y < v.y; } bool operator == (const Vector &v) const { return fabs(x - v.x) < 0.00000000001 && fabs(y - v.y) < 0.00000000001; } }; typedef Vector Point; struct Segment { Vector v1, v2; Segment(Vector v1 = Vector(), Vector v2 = Vector()): v1(v1), v2(v2) {} }; typedef Segment Line; struct Circle { Point c; double r; Circle(Point c = Point(), double r = 0.0): c(c) , r(r) {} }; typedef vector<Point> Polygon; double dot(Vector a, Vector b) { return a.x * b.x + a.y * b.y; } double cross(Vector a, Vector b) { return a.x * b.y - a.y * b.x; } Point project(Segment s, Point p) { Vector base = s.v2 - s.v1; double r = dot(p - s.v1, base) / base.norm(); return s.v1 + base * r; } double getDistance(Point a, Point b) { return (a - b).abs(); } double getDistanceLP(Line l, Point p) { return abs(cross(l.v2 - l.v1, p - l.v1) / (l.v2 - l.v1).abs()); } double getDistanceSP(Segment s, Point p) { if ( dot(s.v2 - s.v1, p - s.v1) < 0.0) return (p - s.v1).abs(); if ( dot(s.v1 - s.v2, p - s.v2) < 0.0) return (p - s.v2).abs(); return getDistanceLP(s, p); } static const int COUNTER_CLOCKWISE = 1; static const int CLOCKWISE = -1; static const int ONLINE_BACK = 2; static const int ONLINE_FRONT = -2; static const int ON_SEGMENT = 0; int ccw(Point p0, Point p1, Point p2) { Vector a = p1 - p0; Vector b = p2 - p0; if ( cross(a, b) > 0.00000000001) return COUNTER_CLOCKWISE; if ( cross(a, b) < -0.00000000001) return CLOCKWISE; if ( dot(a, b) < -0.000000000001) return ONLINE_BACK; if ( (a.norm() < b.norm())) return ONLINE_FRONT; return ON_SEGMENT; } bool intersect(Point p1, Point p2, Point p3, Point p4) { return ( ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 && ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0); } bool intersect(Segment s1, Segment s2) { return intersect(s1.v1, s1.v2, s2.v1, s2.v2); } double getDistance(Segment s1, Segment s2) { if ( intersect(s1, s2)) return 0.0; return min(min(getDistanceSP(s1, s2.v1), getDistanceSP(s1, s2.v2)), min(getDistanceSP(s2, s1.v1), getDistanceSP(s2, s1.v2))); } Point getCrossPoint(Segment s1, Segment s2) { Vector base = s2.v2 - s2.v1; double d1 = abs(cross(base, s1.v1 - s2.v1)); double d2 = abs(cross(base, s1.v2 - s2.v1)); double t = d1 / (d1 + d2); return s1.v1 + (s1.v2 - s1.v1) * t; } bool intersect(Circle c1, Circle c2) { double d = getDistance(c1.c, c2.c); return c1.r + c2.r >= d; } pair<Point, Point> getCrossPoint(Circle c, Line l) { //assert(intersect(c, l)); Vector pr = project(l, c.c); Vector e = (l.v2 - l.v1) / (l.v2 - l.v1).abs(); double base = sqrt(c.r * c.r - (pr - c.c).norm()); return make_pair(pr + e * base, pr - e * base); } double arg(Vector p) {return atan2(p.y, p.x);} Vector polar(double a, double r) { return Point(cos(r) * a, sin(r) * a);} pair<Point, Point> getCrossPoints(Circle c1, Circle c2) { assert(intersect(c1, c2)); double d = (c1.c -c2.c).abs(); double a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d)); double t = arg(c2.c - c1.c); return make_pair(c1.c + polar(c1.r, t + a), c1.c + polar(c1.r, t - a)); } int main() { cin.tie(0); ios_base::sync_with_stdio(false); double c1x, c1y, c1r, c2x, c2y, c2r; cin >> c1x >> c1y >> c1r; cin >> c2x >> c2y >> c2r; Circle c1(Point(c1x, c1y), c1r); Circle c2(Point(c2x, c2y), c2r); pair<Point, Point> p = getCrossPoints(c1, c2); if (p.first.x < p.second.x) { cout << fixed << setprecision(10) << p.first.x << " " << p.first.y << " " << p.second.x << " " << p.second.y << endl; } else if (p.first.x == p.second.x && p.first.y < p.second.y) { cout << fixed << setprecision(10) << p.first.x << " " << p.first.y << " " << p.second.x << " " << p.second.y << endl; } else { cout << fixed << setprecision(10) << p.second.x << " " << p.second.y << " " << p.first.x << " " << p.first.y << endl; } return 0; }
[ "chalitourist@gmail.com" ]
chalitourist@gmail.com
aac2760ebd37b10ab4804c1a740f8cfbb745a870
e2c9473d55c8383f8866e1a1515ca69fda1db6f3
/Hadmen/Hadmen/Item.cpp
50dd9a0bb9312bac1296f7897ab0366d307c5c50
[]
no_license
LudvigWiesner/UD1452Hadmen
f8427645c3eb9f7bbe65738d8df391ff377ceb71
04abf4005a09cf85f1a56f7b23f7c2ea87f03337
refs/heads/master
2021-01-04T01:02:11.887672
2020-03-10T15:06:34
2020-03-10T15:06:34
240,254,422
0
0
null
null
null
null
UTF-8
C++
false
false
177
cpp
#include "Item.h" Item::Item() { this->name = ""; } Item::Item(std::string name) { this->name = name; } std::string Item::getName() { return this->name; }
[ "noreply@github.com" ]
noreply@github.com
3e94a8873f3a60a8bd68cada72f3c33eb74e768a
902e56e5eb4dcf96da2b8c926c63e9a0cc30bf96
/LibsExternes/Includes/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp
1c95de5f6d51392e93f2ff0cf49114ab9850c2d6
[ "BSD-3-Clause" ]
permissive
benkaraban/anima-games-engine
d4e26c80f1025dcef05418a071c0c9cbd18a5670
8aa7a5368933f1b82c90f24814f1447119346c3b
refs/heads/master
2016-08-04T18:31:46.790039
2015-03-22T08:13:55
2015-03-22T08:13:55
32,633,432
2
0
null
null
null
null
UTF-8
C++
false
false
17,821
hpp
/*============================================================================= Copyright (c) 2001-2010 Joel de Guzman Copyright (c) 2001-2010 Hartmut Kaiser Copyright (c) 2006 Stephen Nutt 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) =============================================================================*/ #if !defined(SPIRIT_NUMERIC_UTILS_APRIL_17_2006_0816AM) #define SPIRIT_NUMERIC_UTILS_APRIL_17_2006_0816AM #if defined(_MSC_VER) #pragma once #endif #include <boost/detail/iterator.hpp> #include <boost/spirit/home/support/unused.hpp> #include <boost/spirit/home/qi/detail/attributes.hpp> #include <boost/spirit/home/support/char_encoding/ascii.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/utility/enable_if.hpp> #include <boost/type_traits/is_integral.hpp> #include <boost/type_traits/is_signed.hpp> #include <boost/mpl/bool.hpp> #include <boost/mpl/and.hpp> #include <limits> #include <boost/limits.hpp> #if !defined(SPIRIT_NUMERICS_LOOP_UNROLL) # define SPIRIT_NUMERICS_LOOP_UNROLL 3 #endif namespace boost { namespace spirit { namespace qi { namespace detail { /////////////////////////////////////////////////////////////////////////// // // Traits class for radix specific number conversion // // Test the validity of a single character: // // template<typename Char> static bool is_valid(Char ch); // // Convert a digit from character representation to binary // representation: // // template<typename Char> static int digit(Char ch); // // The maximum radix digits that can be represented without // overflow: // // template<typename T> struct digits::value; // /////////////////////////////////////////////////////////////////////////// template <unsigned Radix> struct radix_traits; // Binary template <> struct radix_traits<2> { template<typename Char> static bool is_valid(Char ch) { return ('0' == ch || '1' == ch); } template<typename Char> static unsigned digit(Char ch) { return ch - '0'; } template<typename T> struct digits { typedef std::numeric_limits<T> numeric_limits_; BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits); }; }; // Octal template <> struct radix_traits<8> { template<typename Char> static bool is_valid(Char ch) { return ch >= '0' && ch <= '7'; } template<typename Char> static unsigned digit(Char ch) { return ch - '0'; } template<typename T> struct digits { typedef std::numeric_limits<T> numeric_limits_; BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits / 3); }; }; // Decimal template <> struct radix_traits<10> { template<typename Char> static bool is_valid(Char ch) { return ch >= '0' && ch <= '9'; } template<typename Char> static unsigned digit(Char ch) { return ch - '0'; } template<typename T> struct digits { typedef std::numeric_limits<T> numeric_limits_; BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits10); }; }; // Hexadecimal template <> struct radix_traits<16> { template<typename Char> static bool is_valid(Char ch) { return (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'); } template<typename Char> static unsigned digit(Char ch) { if (ch >= '0' && ch <= '9') return ch - '0'; return spirit::char_encoding::ascii::tolower(ch) - 'a' + 10; } template<typename T> struct digits { typedef std::numeric_limits<T> numeric_limits_; BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits / 4); }; }; /////////////////////////////////////////////////////////////////////////// // positive_accumulator/negative_accumulator: Accumulator policies for // extracting integers. Use positive_accumulator if number is positive. // Use negative_accumulator if number is negative. /////////////////////////////////////////////////////////////////////////// template <unsigned Radix> struct positive_accumulator { template <typename T, typename Char> static void add(T& n, Char ch, mpl::false_) // unchecked add { const int digit = radix_traits<Radix>::digit(ch); n = n * T(Radix) + T(digit); } template <typename T, typename Char> static bool add(T& n, Char ch, mpl::true_) // checked add { // Ensure n *= Radix will not overflow static T const max = (std::numeric_limits<T>::max)(); static T const val = (max - 1) / Radix; if (n > val) return false; n *= Radix; // Ensure n += digit will not overflow const int digit = radix_traits<Radix>::digit(ch); if (n > max - digit) return false; n += static_cast<T>(digit); return true; } }; template <unsigned Radix> struct negative_accumulator { template <typename T, typename Char> static void add(T& n, Char ch, mpl::false_) // unchecked subtract { const int digit = radix_traits<Radix>::digit(ch); n = n * T(Radix) - T(digit); } template <typename T, typename Char> static bool add(T& n, Char ch, mpl::true_) // checked subtract { // Ensure n *= Radix will not underflow static T const min = (std::numeric_limits<T>::min)(); static T const val = (min + 1) / T(Radix); if (n < val) return false; n *= Radix; // Ensure n -= digit will not underflow int const digit = radix_traits<Radix>::digit(ch); if (n < min + digit) return false; n -= static_cast<T>(digit); return true; } }; /////////////////////////////////////////////////////////////////////////// // Common code for extract_int::parse specializations /////////////////////////////////////////////////////////////////////////// template <unsigned Radix, typename Accumulator, int MaxDigits> struct int_extractor { template <typename Char, typename T> static bool call(Char ch, std::size_t count, T& n, mpl::true_) { static std::size_t const overflow_free = radix_traits<Radix>::template digits<T>::value - 1; if (count < overflow_free) { Accumulator::add(n, ch, mpl::false_()); } else { if (!Accumulator::add(n, ch, mpl::true_())) return false; // over/underflow! } return true; } template <typename Char, typename T> static bool call(Char ch, std::size_t /*count*/, T& n, mpl::false_) { // no need to check for overflow Accumulator::add(n, ch, mpl::false_()); return true; } template <typename Char> static bool call(Char /*ch*/, std::size_t /*count*/, unused_type, mpl::false_) { return true; } template <typename Char, typename T> static bool call(Char ch, std::size_t count, T& n) { return call(ch, count, n , mpl::bool_< ( (MaxDigits < 0) || (MaxDigits > radix_traits<Radix>::template digits<T>::value) ) && std::numeric_limits<T>::is_modulo >() ); } }; /////////////////////////////////////////////////////////////////////////// // End of loop checking: check if the number of digits // being parsed exceeds MaxDigits. Note: if MaxDigits == -1 // we don't do any checking. /////////////////////////////////////////////////////////////////////////// template <int MaxDigits> struct check_max_digits { static bool call(std::size_t count) { return count < MaxDigits; // bounded } }; template <> struct check_max_digits<-1> { static bool call(std::size_t /*count*/) { return true; // unbounded } }; /////////////////////////////////////////////////////////////////////////// // extract_int: main code for extracting integers /////////////////////////////////////////////////////////////////////////// #define SPIRIT_NUMERIC_INNER_LOOP(z, x, data) \ if (!check_max_digits<MaxDigits>::call(count + leading_zeros) \ || it == last) \ break; \ ch = *it; \ if (!radix_check::is_valid(ch) || !extractor::call(ch, count, val)) \ break; \ ++it; \ ++count; \ /**/ template < typename T, unsigned Radix, unsigned MinDigits, int MaxDigits , typename Accumulator = positive_accumulator<Radix> , bool Accumulate = false > struct extract_int { #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) # pragma warning(push) # pragma warning(disable: 4127) // conditional expression is constant #endif template <typename Iterator, typename Attribute> static bool parse_main( Iterator& first , Iterator const& last , Attribute& attr) { typedef radix_traits<Radix> radix_check; typedef int_extractor<Radix, Accumulator, MaxDigits> extractor; typedef typename boost::detail::iterator_traits<Iterator>::value_type char_type; Iterator it = first; std::size_t leading_zeros = 0; if (!Accumulate) { // skip leading zeros while (it != last && *it == '0' && leading_zeros < MaxDigits) { ++it; ++leading_zeros; } } typedef typename traits::attribute_type<Attribute>::type attribute_type; attribute_type val = Accumulate ? attr : attribute_type(0); std::size_t count = 0; char_type ch; while (true) { BOOST_PP_REPEAT( SPIRIT_NUMERICS_LOOP_UNROLL , SPIRIT_NUMERIC_INNER_LOOP, _) } if (count + leading_zeros >= MinDigits) { traits::assign_to(val, attr); first = it; return true; } return false; } #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) # pragma warning(pop) #endif template <typename Iterator> static bool parse( Iterator& first , Iterator const& last , unused_type) { T n = 0; // must calculate value to detect over/underflow return parse_main(first, last, n); } template <typename Iterator, typename Attribute> static bool parse( Iterator& first , Iterator const& last , Attribute& attr) { return parse_main(first, last, attr); } }; #undef SPIRIT_NUMERIC_INNER_LOOP /////////////////////////////////////////////////////////////////////////// // extract_int: main code for extracting integers // common case where MinDigits == 1 and MaxDigits = -1 /////////////////////////////////////////////////////////////////////////// #define SPIRIT_NUMERIC_INNER_LOOP(z, x, data) \ if (it == last) \ break; \ ch = *it; \ if (!radix_check::is_valid(ch)) \ break; \ if (!extractor::call(ch, count, val)) \ return false; \ ++it; \ ++count; \ /**/ template <typename T, unsigned Radix, typename Accumulator, bool Accumulate> struct extract_int<T, Radix, 1, -1, Accumulator, Accumulate> { #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) # pragma warning(push) # pragma warning(disable: 4127) // conditional expression is constant #endif template <typename Iterator, typename Attribute> static bool parse_main( Iterator& first , Iterator const& last , Attribute& attr) { typedef radix_traits<Radix> radix_check; typedef int_extractor<Radix, Accumulator, -1> extractor; typedef typename boost::detail::iterator_traits<Iterator>::value_type char_type; Iterator it = first; std::size_t count = 0; if (!Accumulate) { // skip leading zeros while (it != last && *it == '0') { ++it; ++count; } if (it == last) { if (count == 0) // must have at least one digit return false; traits::assign_to(0, attr); first = it; return true; } } typedef typename traits::attribute_type<Attribute>::type attribute_type; attribute_type val = Accumulate ? attr : attribute_type(0); char_type ch = *it; if (!radix_check::is_valid(ch) || !extractor::call(ch, 0, val)) { if (count == 0) // must have at least one digit return false; traits::assign_to(val, attr); first = it; return true; } count = 0; ++it; while (true) { BOOST_PP_REPEAT( SPIRIT_NUMERICS_LOOP_UNROLL , SPIRIT_NUMERIC_INNER_LOOP, _) } traits::assign_to(val, attr); first = it; return true; } #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) # pragma warning(pop) #endif template <typename Iterator> static bool parse( Iterator& first , Iterator const& last , unused_type) { T n = 0; // must calculate value to detect over/underflow return parse_main(first, last, n); } template <typename Iterator, typename Attribute> static bool parse( Iterator& first , Iterator const& last , Attribute& attr) { return parse_main(first, last, attr); } }; #undef SPIRIT_NUMERIC_INNER_LOOP /////////////////////////////////////////////////////////////////////////// // Cast an signed integer to an unsigned integer /////////////////////////////////////////////////////////////////////////// template <typename T, bool force_unsigned = mpl::and_<is_integral<T>, is_signed<T> >::value> struct cast_unsigned; template <typename T> struct cast_unsigned<T, true> { typedef typename make_unsigned<T>::type unsigned_type; typedef typename make_unsigned<T>::type& unsigned_type_ref; static unsigned_type_ref call(T& n) { return unsigned_type_ref(n); } }; template <typename T> struct cast_unsigned<T, false> { static T& call(T& n) { return n; } }; }}}} #endif
[ "contact@anima-games.com@bd273c4a-bd8d-77bb-0e36-6aa87360798c" ]
contact@anima-games.com@bd273c4a-bd8d-77bb-0e36-6aa87360798c
dc24c264ac3eabfcc45528d8c14717f9143b5248
4fdb147d72b0298dff9c5dfe7fca71bcab969704
/abc/bumpy.cpp
f219db0a26bd93107276af11abf5855d73f61d19
[]
no_license
marubontan/at_coder_codes_with_c_plus_plus
bb4ab309e06ea41a1ca7e7c3144c286ff3bb6d45
24adccb001317a00cb9e7a79472da6dc880abbd7
refs/heads/master
2023-05-31T22:15:42.849010
2023-05-18T09:28:48
2023-05-18T09:28:48
189,867,176
0
0
null
null
null
null
UTF-8
C++
false
false
2,206
cpp
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; vector<pair<int, int>> most_common(vector<int> nums){ map<int, int> frequency; for (auto n : nums){ frequency[n]++; } vector<pair<int, int>> freq_key; for (auto item: frequency){ freq_key.push_back(make_pair(item.second, item.first)); } sort(freq_key.begin(), freq_key.end(), greater<pair<int, int>>()); vector<pair<int, int>> output; if (freq_key.size() == 1){ output.push_back(freq_key[0]); } else { output.push_back(freq_key[0]); output.push_back(freq_key[1]); } return output; } int main(){ int n;cin>>n; vector<int> even; vector<int> odd; for (int i=0;i<n;i++){ int temp;cin>>temp; if (i % 2 == 0){ even.push_back(temp); } else { odd.push_back(temp); } } auto most_common_even_pair = most_common(even); auto most_common_odd_pair = most_common(odd); if (most_common_even_pair[0].second == most_common_odd_pair[0].second){ if (most_common_even_pair.size() == 2 && most_common_odd_pair.size() == 2){ if (most_common_even_pair[0].first + most_common_odd_pair[1].first < most_common_even_pair[1].first + most_common_odd_pair[0].first){ cout << n - most_common_even_pair[1].first - most_common_odd_pair[0].first << endl; } else { cout << n - most_common_even_pair[0].first - most_common_odd_pair[1].first << endl; } } else { if (most_common_even_pair.size() == 1 && most_common_odd_pair.size() == 2){ cout << n - most_common_even_pair[0].first - most_common_odd_pair[1].first << endl; } else if (most_common_even_pair.size() == 2 && most_common_odd_pair.size() == 1){ cout << n - most_common_even_pair[1].first - most_common_odd_pair[0].first << endl; } else { cout << n - most_common_even_pair[0].first << endl; } } } else { cout << n - most_common_even_pair[0].first - most_common_odd_pair[0].first << endl; } return 0; }
[ "marubontan@gmail.com" ]
marubontan@gmail.com
2a433f6bb7b5230b797aee94e0f5e5e74213a292
a6bfdf4d2dd1ea4ae285215c651c2b64479b6b6a
/bench/function/simd/atan2.regular.cpp
40448f93d6e950d7ef01a7c17056f52a8178076c
[ "BSL-1.0" ]
permissive
jeffamstutz/boost.simd
fb62210c30680c3cb2ffcc8ed80f8a0050f675fd
8afe9673c2a806976a77bc8bbca4cb1116a710cb
refs/heads/develop
2021-01-13T04:06:02.762442
2017-01-05T02:56:52
2017-01-06T16:11:47
77,879,665
6
1
null
2017-01-03T03:08:57
2017-01-03T03:08:57
null
UTF-8
C++
false
false
782
cpp
// ------------------------------------------------------------------------------------------------- // Copyright 2016 - NumScale SAS // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // ------------------------------------------------------------------------------------------------- #include <simd_bench.hpp> #include <boost/simd/function/simd/atan2.hpp> #include <boost/simd/pack.hpp> namespace nsb = ns::bench; namespace bs = boost::simd; DEFINE_SIMD_BENCH(simd_atan2, bs::atan2); DEFINE_BENCH_MAIN() { nsb::for_each<simd_atan2, NS_BENCH_IEEE_TYPES>(-10, 10, -10, 10); }
[ "joel.falcou@lri.fr" ]
joel.falcou@lri.fr
e989bc3097fb71f685a46f2ab4574703433f1f58
b88a115fdd1d7034e20ce46a26febd71d121cfed
/Source/BattleTank/Private/TankAIController.cpp
c4cca27ecbf60e77dc044fc1fece5ab20578ab5c
[]
no_license
ricardodiasc/BattleTank
bcfca1c9c5ae5937edea220667f4eb08cfcf3c79
047515a6c73c34dc033972d98d6920259210f725
refs/heads/master
2021-01-17T23:02:38.038524
2016-11-20T21:10:14
2016-11-20T21:10:14
66,278,805
0
0
null
null
null
null
UTF-8
C++
false
false
621
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "BattleTank.h" #include "Tank.h" #include "TankAIController.h" ATankAIController::ATankAIController() { } void ATankAIController::BeginPlay() { Super::BeginPlay(); PrimaryActorTick.bCanEverTick = true; } void ATankAIController::Tick(float DeltaTime) { Super::Tick(DeltaTime); auto PlayerTank = Cast<ATank>(GetWorld()->GetFirstPlayerController()->GetPawn()); auto ControlledTank = Cast<ATank>(GetPawn()); if (PlayerTank) { ControlledTank->AimAt(PlayerTank->GetActorLocation()); ControlledTank->Fire(); } }
[ "ricardodc@gmail.com" ]
ricardodc@gmail.com
ec619d96a36ba7042e835cbc014156862babdf05
7d8d3f888d48a7de2b5851b7b133b065c2ceb00e
/quiz6/IntegerArray.hpp
1be791551975656d3b1d3aaeae3cfb4f25e7894b
[]
no_license
Ventura-CS-V13-Spring2021/assignments-elee91
2bbb6864852155e027336e9384eb18311ebf00cc
ffa0714530059f10eee683371c8f5fe900950d7e
refs/heads/main
2023-04-23T05:35:39.161202
2021-05-14T23:30:33
2021-05-14T23:30:33
333,192,096
0
0
null
null
null
null
UTF-8
C++
false
false
291
hpp
#ifndef INTEGERARRAY_H #define INTEGERARRAY_H class IntegerArray { private: static const int N = 10; int numbers[N]; int length = 0; public: int getLength(void) const; void fillUp(void); void printAll(void) const; void sortArray(int flag); int getPrimenumbers(void) const; }; #endif
[ "" ]
f418f25bc4c227645f1d13dc16cbaf7bddf61ec9
22b40ee3ec85cfd74d868f64efbb8a3feb62cc9d
/Interview_bit/Hashing/Points_on_the_Straigth_Line.cpp
eae6a3fa5809ecc88793909695e2c5a3b7ed55a7
[]
no_license
prashant280920/DSA
67e113a10884dcb6e59a77338e789e0808ee9c2e
e7fa447366afeefe98b81071addbd62935fef5cc
refs/heads/main
2023-08-19T15:25:43.165031
2021-10-31T11:31:41
2021-10-31T11:31:41
378,179,781
1
1
null
2021-10-31T11:31:42
2021-06-18T14:40:47
C++
UTF-8
C++
false
false
791
cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n,t; cin >> n; vector<int> A,B; for(int i=0; i<n; i++){ cin >> t; A.push_back(t); } for(int i=0; i<n; i++){ cin >> t; B.push_back(t); } n = A.size(); int max_count=0; for(int i=0; i<n; i++){ unordered_map<double,int> m; int max_size = 0, overlap=1; for(int j=i+1; j<n; j++){ if(A[i]==A[j] && B[i]==B[j]) overlap++; else{ double slope = A[i]!=A[j] ? (1.0*B[j]-B[i])/(A[j]-A[i]) : 1e9; m[slope]++; max_size = max(max_size,m[slope]); } } max_count = max(max_count,max_size+overlap); } cout << max_count << endl; return 0; }
[ "b19101@students.iitmandi.ac.in" ]
b19101@students.iitmandi.ac.in
2cb4b20473c18c6e728784bf3631271a75ae1d91
ec16da3c9d58ae2be90a9f257678d781986723c1
/language/C++/operator_overloading.cpp
8f64b9029e27ca79494d927cf0d9a573a7bd87ef
[]
no_license
cheetah0216/CodeRepository
14f846a4439443b1d1c33ed79fe938cef9ea2534
f76dc78f83b22a1477ddc2663b1d2b95b8a2f9a1
refs/heads/master
2016-08-04T12:03:33.137506
2015-07-24T03:08:22
2015-07-24T03:08:22
4,897,956
0
0
null
2012-10-04T16:33:35
2012-07-05T04:39:15
C
UTF-8
C++
false
false
2,443
cpp
#include <iostream> using namespace std; class Sales_item { friend istream& operator>> (istream&, Sales_item&); friend ostream& operator<< (ostream&, const Sales_item&); friend inline bool operator== (const Sales_item&,const Sales_item&); public: Sales_item(): units_sold(0), revenue(0.0) {} ~Sales_item() {} double avg_price() const; bool same_isbn(const Sales_item &rhs) const; Sales_item& operator+=(const Sales_item&); Sales_item& operator=(const Sales_item&); private: string isbn; unsigned units_sold; double revenue; }; double Sales_item::avg_price() const { if(units_sold) return revenue/units_sold; else return 0; } bool Sales_item::same_isbn(const Sales_item &rhs) const { return isbn == rhs.isbn; } Sales_item& Sales_item::operator+=(const Sales_item& rhs) { units_sold += rhs.units_sold; revenue += rhs.revenue; return *this; } Sales_item& Sales_item::operator=(const Sales_item& rhs) { isbn = rhs.isbn; units_sold = rhs.units_sold; revenue = rhs.revenue; return *this; } Sales_item operator+(const Sales_item& lhs, const Sales_item& rhs) { Sales_item ret(lhs); ret += rhs; return ret; } inline bool operator== (const Sales_item& lhs, const Sales_item& rhs) { return lhs.units_sold == rhs.units_sold && lhs.revenue == rhs.revenue && lhs.same_isbn(rhs); } inline bool operator!= (const Sales_item& lhs, const Sales_item& rhs) { return !(lhs == rhs); } ostream& operator<< (ostream& out, const Sales_item& s) { out << s.isbn << "\t" << s.units_sold << "\t" << s.revenue << "\t" << s.avg_price(); return out; } istream& operator>> (istream& in, Sales_item& s) { double price = 0.0; in >> s.isbn >> s.units_sold >> price; if (in) s.revenue = s.units_sold * price; else s = Sales_item(); return in; } void test_add() { //input: 0-021-78345-X 3 20.00 //input: 0-021-78345-X 2 25.00 //output: 0-021-78345-X 5 110 22 Sales_item item1, item2; cin >> item1 >> item2; cout << item1 + item2 << endl; } void test() { Sales_item total, trans; if( cin >> total ) { while( cin >> trans ) { if (total.same_isbn(trans)) total = total + trans; else { cout << total << endl; total = trans; } } cout << total << endl; } else { cout << "No date?!" << endl; } } int main() { //test_add(); test(); return 0; }
[ "flying0216@gmail.com" ]
flying0216@gmail.com
df931cab2dc2425b4fb41196b2032bb67c59ae92
67f61e55d4d74a76deef5b826e9cb6c1d9e53c58
/externals/skia/src/sksl/ast/SkSLASTIndexSuffix.h
2b7cd484175c450d0ef799fee5144da547a826d5
[ "BSD-3-Clause", "MIT" ]
permissive
mono/linux-packaging-skiasharp
e7d0478b0c34c80f341e0224041e3dc076e13d41
47dbb2ff9ae01305b190f409ccea00b3b4f0bc79
refs/heads/master
2023-08-23T10:22:57.751473
2017-04-25T14:28:46
2017-04-25T14:28:46
89,267,865
1
5
MIT
2020-04-08T02:40:44
2017-04-24T17:23:42
C++
UTF-8
C++
false
false
1,131
h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SKSL_ASTINDEXSUFFIX #define SKSL_ASTINDEXSUFFIX #include "SkSLASTExpression.h" #include "SkSLASTSuffix.h" namespace SkSL { /** * A bracketed expression, as in '[0]', indicating an array access. Empty brackets (as occur in * 'float[](5, 6)' are represented with a null fExpression. */ struct ASTIndexSuffix : public ASTSuffix { ASTIndexSuffix(Position position) : INHERITED(position, ASTSuffix::kIndex_Kind) , fExpression(nullptr) {} ASTIndexSuffix(std::unique_ptr<ASTExpression> expression) : INHERITED(expression ? expression->fPosition : Position(), ASTSuffix::kIndex_Kind) , fExpression(std::move(expression)) {} SkString description() const override { if (fExpression) { return "[" + fExpression->description() + "]"; } else { return SkString("[]"); } } // may be null std::unique_ptr<ASTExpression> fExpression; typedef ASTSuffix INHERITED; }; } // namespace #endif
[ "joshield@microsoft.com" ]
joshield@microsoft.com
eb4904b5f8c0bd6060fe73de3b176093e1263513
c356febb62c74b9ef21b17b9c2b8c3ca2edb6120
/testing.cpp
e0a0bbd16c1a01f3350a1fb215597f227374ce73
[]
no_license
abhiseksinha23/programs
9093192be03a2e60655f242d2e4de21694bfadb4
a97c4dcc995ba3f1546b900ab75d20321235e2d0
refs/heads/master
2022-11-18T01:25:12.647461
2020-07-12T14:11:38
2020-07-12T14:11:38
279,076,544
2
0
null
null
null
null
UTF-8
C++
false
false
368
cpp
#include<bits/stdc++.h> using namespace std; int main(){ long t; cin>>t; while(t--){ int n,x; cin>>n; x = 2*n; vector<long>arr(x); vector<long>ans(n); for(int i=0; i<n; i++){ cin>>arr[i]; } sort(arr.begin(),arr.end()); if(arr[x-1]!=arr[x-2]){ cout<<"0\n"; continue; } long a = pow(2,n-1)%1000000007; cout<<a<<"\n"; } return 0; }
[ "42487773+abhiseksinha23@users.noreply.github.com" ]
42487773+abhiseksinha23@users.noreply.github.com
f8419ec6db61cb3c26d4f41f7a20e69e95d98441
068bbc24f87caf24465946841b964b232402ea08
/nnclassification/src/distances/dtw/lowerbounds/lb_keogh.hpp
5930ea79dc84f01aad9b05fb2eb9e8ace7109671
[ "BSD-3-Clause" ]
permissive
HerrmannM/paper-2021-EAPElasticDist
d64e1223f1e4993624edadc2bf86bc9a180f5187
a3dfbc73399ddecdf677b353937a4a6215f0a8a1
refs/heads/master
2023-07-31T22:56:39.060671
2021-09-16T02:17:53
2021-09-16T02:17:53
328,804,771
1
0
null
null
null
null
UTF-8
C++
false
false
1,266
hpp
#pragma once #include "../../../utils.hpp" /** Lb Keogh, early stopping if above ub * @param query The time series being queried * @param length_query It's length * @param upper Upper envelope from the query from the database * @param lower Lower envelope from the query from the database * @param ub Current upper bound (best so far) * @return A lower bound on the DTW alignment */ [[nodiscard]] double lb_Keogh( const double *query, size_t length_query, const double *upper, const double *lower, double ub ) { double lb{0}; for (size_t i = 0; i < length_query && lb < ub; i++) { double qi{query[i]}; if (const auto ui{upper[i]}; qi > ui) { lb += square_dist(qi, ui); } else if (const auto li{lower[i]}; qi < li) { lb += square_dist(qi, li); } } return lb; } [[nodiscard]] inline double lb_Keogh( const std::vector<double> &query, const std::vector<double> &upper, const std::vector<double> &lower, double ub ) { // lb_Keogh requires same size series assert(query.size() == upper.size()); assert(query.size() == lower.size()); return lb_Keogh(query.data(), query.size(), upper.data(), lower.data(), ub); }
[ "HerrmannM@users.noreply.github.com" ]
HerrmannM@users.noreply.github.com
86ac13f0892a854327f025e25aa24048164197bf
7cda445ab7001ffca7a6d9b73a7c70d92480cbd5
/Problem_Solving__Bill_Division.cpp
321d75ea05c148d0b75d24d3a594789af510a9f7
[]
no_license
sumi1pandey/Hackerrank-Solutions
a1ff44199f7a95ba9c3a69041c3161a1cfcad59b
6bdd05f9acf67a88598e9f783a874d5e3885d08b
refs/heads/main
2023-08-27T10:07:06.513652
2021-11-11T09:43:57
2021-11-11T09:43:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
678
cpp
//Bill Division - Hackerrank/ProblemSolving/Algorithm/Implementation #include <iostream> #include <stdio.h> using namespace std; /* 4 1 3 10 2 9 7 Bon Appetit ------------ 4 1 3 10 2 9 12 5 */ int main() { int n; cin >> n; //n=4 int p; cin >> p; //p=1 int arr[100000]; for(int i=0; i<n; i++) { cin >> arr[i]; } int r; cin >> r; //r=12 int sum = 0; for(int i=0; i<n; i++) { sum = sum + arr[i]; //24 } sum = sum - arr[p]; //sum = 24 - 10 = 14 if( sum/2 == r ) cout << "Bon Appetit"; else cout << r - (sum/2); return 0; }
[ "noreply@github.com" ]
noreply@github.com
3d7746e136e51ebc34ca54929cabc2cf4b99b998
9a06d10aec27551ed1e62c81a3eb4b55f9dae410
/practica4/p1_1203.cpp
c5c1f56249d5bc5ce8f88a27157ec2b1dd3d45b8
[]
no_license
AngelaSucso/PC_B
7a094b89429b73427a289ea5b5070fe68b66ca1b
2cd678a36c90d36def91049e71259396a30e2009
refs/heads/main
2023-08-27T21:33:41.876948
2021-10-17T06:02:48
2021-10-17T06:02:48
410,692,665
0
0
null
null
null
null
UTF-8
C++
false
false
1,834
cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int mcd(vector<pair<int,int>> datos) { int a = datos[0].second; for(int i = 1; i < datos.size(); i++) a = __gcd(a, datos[i].second); return a; } void swap(int *xp, int *yp) { int temp = *xp; *xp = *yp; *yp = temp; } void selectionSort(vector<pair<int,int>> &num, int n) { int i, j, min_idx; for (i = 0; i < n-1; i++) { min_idx = i; for (j = i+1; j < n; j++){ if (num[j].first < num[min_idx].first) min_idx = j; } swap(&num[min_idx].first, &num[i].first); } } int main() { vector<pair<int, int>> pares; string registro; int q_num, periodo; while (true) { cin >> registro; if (registro == "#") { break; } cin >> q_num >> periodo; pares.push_back(make_pair(q_num, periodo)); } int K; cin >> K; int salto = mcd(pares); int cont = salto; vector<pair<int,int>> rpta; vector<pair<int,int>> tmp; while(true){ for(int i=0; i<pares.size(); i++){ int div = pares[i].second%cont; if(div==0){ tmp.push_back(pares[i]); } } if(tmp.size()>1){ selectionSort(tmp,tmp.size()); for(int i=0; i<tmp.size(); i++){ rpta.push_back(tmp[i]); } } else if(tmp.size()==1){ rpta.push_back(tmp[0]); } if(rpta.size()==K){ break; } cont+=salto; } for (int i = 0; i < pares.size(); i++) { cout << pares[i].first << endl; } return 0; }
[ "noreply@github.com" ]
noreply@github.com
50834a1c93171b9a9ec1e9ec83a5b0fda008c533
ed9df5ace16e7ecbeb87ed1cf06ba71468155a2d
/plugins/PluginScan/scannerdialog.h
e8e4c73642713d8f856e23cd413fe47522b241d8
[]
no_license
lingnanxiaocai666/charface2
5b87920635d5c646c7a524329c0b3d6147accd65
b623b8a78d0d231498cdaab97d0f101a0038be10
refs/heads/master
2021-06-09T12:29:35.715185
2016-11-12T03:46:25
2016-11-12T03:46:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,085
h
#ifndef SCANNERDIALOG_H #define SCANNERDIALOG_H #include <QtWidgets/QDialog> #include <QProcess> #include <QStringList> namespace Ui { class ScannerDialog; } class ScannerDialog : public QDialog { Q_OBJECT public: explicit ScannerDialog(QWidget *parent = 0); ~ScannerDialog(); void setTempDirectory(const QString &tempDir); int exec(); QStringList files() { return mFiles; } private slots: void readyReadStandardOutput(); void readyReadStandardError(); void processFinished(int exitCode, QProcess::ExitStatus exitStatus); void onScan(); void onCancel(); private: void refreshDevicesList(const QStringList &list); void refreshPagesCounter(); Ui::ScannerDialog *ui; QProcess *mProcess; QByteArray mProcessOutput; QByteArray mProcessOutputError; QStringList mDevices; QStringList mFiles; QString mTempPath; enum DialogStatus { DS_Inactive = 0, DS_GetDevicesList, DS_Scan }; DialogStatus mDialogStatus; int mPagesCount; }; #endif // SCANNERDIALOG_H
[ "offnormal@gmail.com" ]
offnormal@gmail.com
57ddcbc5669783ed91e8043afd49e6513bcf9f87
c2bddc9fa4b9880a928b9dfa0be82460a3181a43
/211/p7/bst.cpp
1544c4413f1ae88cd388bbf218e3e4e04a0bfe95
[]
no_license
Mitchell707/211
bc75885758a756ac773832c9ba90e2caac1a50ce
0b1523afea0417d55b317a4da30a465d91053e48
refs/heads/master
2020-03-27T12:20:55.128215
2018-12-17T04:01:25
2018-12-17T04:01:25
146,541,472
0
0
null
null
null
null
UTF-8
C++
false
false
3,403
cpp
//bst.cpp //Beck, Mitchell //mbeck16 #include <iostream> #include <string> #include <vector> #include "bst.h" using namespace std; Bst::Bst() { m_root = new Node; } Bst::~Bst() { } bool Bst::insert(string str, Node *cur) { if(m_root->m_value.empty()) //Will initialize a Node with two Null children if the tree is empty { m_root->m_value = str; m_root->right = NULL; m_root->left = NULL; length++; } else if(str < cur->m_value) //handles the left insertion { if(cur->left != NULL) { insert(str, cur->left); } else { cur->left = new Node; cur->left->m_value = str; cur->left->left = NULL; cur->left->right = NULL; length++; } } else if(str > cur->m_value) //handles the right insertion { if(cur->right != NULL) { insert(str, cur->right); } else { cur->right = new Node; cur->right->m_value = str; cur->right->left = NULL; cur->right->right = NULL; length++; } } else if(str == cur->m_value) //returns false when a string is already in the tree { return false; } return true; } bool Bst::find(string str, Node *cur) //traverses whole tree while comparing values { if(!cur) { return false; } if(str == cur->m_value) { return true; } else if(str > cur->m_value) { return find(str, cur->right); } else if(str < cur->m_value) { return find(str, cur->left); } } void Bst::print(vector <string> &str, Node *cur, int pos) { if(!cur) { return; } print(str, cur->left, pos); str.push_back(cur->m_value); print(str, cur->right, pos); } void Bst::printLevel(vector <string> &str, Node *cur, int pos) //used by breadth search function { if(!cur) { return; } if(pos == 1) //traverses down tree until it gets to the correct level(pos == 1) then prints left to right. { str.push_back(cur->m_value); } else if(pos > 1) { printLevel(str, cur->left, pos - 1); printLevel(str, cur->right, pos - 1); } } void Bst::breadth(vector <string> &str, Node *cur, int pos) { int l = size(); for(int i = 1; i <= l; i++) { printLevel(str, cur, i); } } double Bst::distance() { distance(m_root, dist); return total / length; } void Bst::distance(Node *cur, int dist) //gets cumulative distance from root to leafs { if(!cur) { return; } total += dist; distance(cur->right, dist + 1); distance(cur->left, dist + 1); } int Bst::height(Node* cur) { if(!cur) { return 0; } return 1 + max(height(cur->left), height(cur->right)); } bool Bst::balanced(Node *cur) //checks the bottom leaf size each and returns true or false if the size is within one { int leftH = 0; int rightH = 0; if(!cur) { return true; } leftH = height(cur->left); rightH = height(cur->right); bool l = balanced(cur->left); bool r = balanced(cur->right); if(abs(leftH - rightH) <= 1 && l && r) { return 1; } return 0; } void Bst::rebalance() { }
[ "mbeck16@ecc-jaguar.csuchico.edu" ]
mbeck16@ecc-jaguar.csuchico.edu
ef2c7894f861ee2716deda8067277bab2468ac3a
d47bca0b96f96a97ca78bed00755d2dca0d99ae7
/loadOBJ/include/CommonInterfaces/CommonGraphicsAppInterface.h
f04c1efac79c67d40ab13dfd63fdcaf11e02b6a9
[ "MIT" ]
permissive
udexon/btosg
87487ef8bfcb7e4ccd4a67d0ad7725ed8ccb0c10
6d4a383be383830886a54992b33f470445f4caa5
refs/heads/master
2022-12-04T23:28:40.550924
2020-08-14T09:07:44
2020-08-14T09:07:44
287,159,870
2
0
MIT
2020-08-13T02:16:49
2020-08-13T02:16:48
null
UTF-8
C++
false
false
6,881
h
#ifndef COMMON_GRAPHICS_APP_H #define COMMON_GRAPHICS_APP_H #include "Bullet3Common/b3Vector3.h" #include "CommonRenderInterface.h" #include "CommonWindowInterface.h" #include "CommonCameraInterface.h" struct DrawGridData { int gridSize; float upOffset; int upAxis; float gridColor[4]; DrawGridData() :gridSize(10), upOffset(0.001f), upAxis(1) { gridColor[0] = 0.6f; gridColor[1] = 0.6f; gridColor[2] = 0.6f; gridColor[3] = 1.f; } }; enum EnumSphereLevelOfDetail { SPHERE_LOD_POINT_SPRITE=0, SPHERE_LOD_LOW, SPHERE_LOD_MEDIUM, SPHERE_LOD_HIGH, }; struct CommonGraphicsApp { class CommonWindowInterface* m_window; struct CommonRenderInterface* m_renderer; struct CommonParameterInterface* m_parameterInterface; struct Common2dCanvasInterface* m_2dCanvasInterface; bool m_leftMouseButton; bool m_middleMouseButton; bool m_rightMouseButton; float m_wheelMultiplier; float m_mouseMoveMultiplier; float m_mouseXpos; float m_mouseYpos; bool m_mouseInitialized; float m_backgroundColorRGB[3]; CommonGraphicsApp() :m_window(0), m_renderer(0), m_parameterInterface(0), m_2dCanvasInterface(0), m_leftMouseButton(false), m_middleMouseButton(false), m_rightMouseButton(false), m_wheelMultiplier(0.01f), m_mouseMoveMultiplier(0.4f), m_mouseXpos(0.f), m_mouseYpos(0.f), m_mouseInitialized(false) { m_backgroundColorRGB[0] = 0.9; m_backgroundColorRGB[1] = 0.9; m_backgroundColorRGB[2] = 1; } virtual ~CommonGraphicsApp() { } virtual void dumpNextFrameToPng(const char* pngFilename){} virtual void dumpFramesToVideo(const char* mp4Filename){} virtual void getBackgroundColor(float* red, float* green, float* blue) const { if (red) *red = m_backgroundColorRGB[0]; if (green) *green = m_backgroundColorRGB[1]; if (blue) *blue = m_backgroundColorRGB[2]; } virtual void setBackgroundColor(float red, float green, float blue) { m_backgroundColorRGB[0] = red; m_backgroundColorRGB[1] = green; m_backgroundColorRGB[2] = blue; } virtual void setMouseWheelMultiplier(float mult) { m_wheelMultiplier = mult; } virtual float getMouseWheelMultiplier() const { return m_wheelMultiplier; } virtual void setMouseMoveMultiplier(float mult) { m_mouseMoveMultiplier = mult; } virtual float getMouseMoveMultiplier() const { return m_mouseMoveMultiplier; } virtual void drawGrid(DrawGridData data=DrawGridData()) = 0; virtual void setUpAxis(int axis) = 0; virtual int getUpAxis() const = 0; virtual void swapBuffer() = 0; virtual void drawText( const char* txt, int posX, int posY) = 0; virtual void drawText3D( const char* txt, float posX, float posZY, float posZ, float size)=0; virtual int registerCubeShape(float halfExtentsX,float halfExtentsY, float halfExtentsZ, int textureIndex = -1)=0; virtual int registerGraphicsUnitSphereShape(EnumSphereLevelOfDetail lod, int textureId=-1) = 0; virtual void registerGrid(int xres, int yres, float color0[4], float color1[4])=0; void defaultMouseButtonCallback( int button, int state, float x, float y) { if (button==0) m_leftMouseButton= (state==1); if (button==1) m_middleMouseButton= (state==1); if (button==2) m_rightMouseButton= (state==1); m_mouseXpos = x; m_mouseYpos = y; m_mouseInitialized = true; } void defaultMouseMoveCallback( float x, float y) { if (m_window && m_renderer) { CommonCameraInterface* camera = m_renderer->getActiveCamera(); bool isAltPressed = m_window->isModifierKeyPressed(B3G_ALT); bool isControlPressed = m_window->isModifierKeyPressed(B3G_CONTROL); if (isAltPressed || isControlPressed) { float xDelta = x-m_mouseXpos; float yDelta = y-m_mouseYpos; float cameraDistance = camera->getCameraDistance(); float pitch = camera->getCameraPitch(); float yaw = camera->getCameraYaw(); float targPos[3]; float camPos[3]; camera->getCameraTargetPosition(targPos); camera->getCameraPosition(camPos); b3Vector3 cameraPosition = b3MakeVector3(b3Scalar(camPos[0]), b3Scalar(camPos[1]), b3Scalar(camPos[2])); b3Vector3 cameraTargetPosition = b3MakeVector3( b3Scalar(targPos[0]), b3Scalar(targPos[1]), b3Scalar(targPos[2])); b3Vector3 cameraUp = b3MakeVector3(0,0,0); cameraUp[camera->getCameraUpAxis()] = 1.f; if (m_leftMouseButton) { // if (b3Fabs(xDelta)>b3Fabs(yDelta)) // { pitch -= xDelta*m_mouseMoveMultiplier; // } else // { yaw += yDelta*m_mouseMoveMultiplier; // } } if (m_middleMouseButton) { cameraTargetPosition += cameraUp * yDelta*0.01; b3Vector3 fwd = cameraTargetPosition-cameraPosition; b3Vector3 side = cameraUp.cross(fwd); side.normalize(); cameraTargetPosition += side * xDelta*0.01; } if (m_rightMouseButton) { cameraDistance -= xDelta*0.01f; cameraDistance -= yDelta*0.01f; if (cameraDistance<1) cameraDistance=1; if (cameraDistance>1000) cameraDistance=1000; } camera->setCameraDistance(cameraDistance); camera->setCameraPitch(pitch); camera->setCameraYaw(yaw); camera->setCameraTargetPosition(cameraTargetPosition[0],cameraTargetPosition[1],cameraTargetPosition[2]); } }//m_window && m_renderer m_mouseXpos = x; m_mouseYpos = y; m_mouseInitialized = true; } // void defaultKeyboardCallback(int key, int state) // { // } void defaultWheelCallback( float deltax, float deltay) { if (m_renderer) { b3Vector3 cameraTargetPosition, cameraPosition, cameraUp = b3MakeVector3(0,0,0); cameraUp[getUpAxis()] = 1; CommonCameraInterface* camera = m_renderer->getActiveCamera(); camera->getCameraPosition(cameraPosition); camera->getCameraTargetPosition(cameraTargetPosition); if (!m_leftMouseButton) { float cameraDistance = camera->getCameraDistance(); if (deltay<0 || cameraDistance>1) { cameraDistance -= deltay*0.01f; if (cameraDistance<1) cameraDistance=1; camera->setCameraDistance(cameraDistance); } else { b3Vector3 fwd = cameraTargetPosition-cameraPosition; fwd.normalize(); cameraTargetPosition += fwd*deltay*m_wheelMultiplier;//todo: expose it in the GUI? } } else { if (b3Fabs(deltax)>b3Fabs(deltay)) { b3Vector3 fwd = cameraTargetPosition-cameraPosition; b3Vector3 side = cameraUp.cross(fwd); side.normalize(); cameraTargetPosition += side * deltax*m_wheelMultiplier; } else { cameraTargetPosition -= cameraUp * deltay*m_wheelMultiplier; } } camera->setCameraTargetPosition(cameraTargetPosition[0],cameraTargetPosition[1],cameraTargetPosition[2]); } } }; #endif //COMMON_GRAPHICS_APP_H
[ "jml@isep.ipp.pt" ]
jml@isep.ipp.pt
778835c9acf7f47d131d193e1e327746f44b16cc
9da899bf6541c6a0514219377fea97df9907f0ae
/Runtime/Apple/AudioMixerCoreAudio/Private/AudioMixerPlatformCoreAudio.h
1dc95818d41afbc29ffd831905f0bfc0356fbbe6
[]
no_license
peichangliang123/UE4
1aa4df3418c077dd8f82439ecc808cd2e6de4551
20e38f42edc251ee96905ed8e96e1be667bc14a5
refs/heads/master
2023-08-17T11:31:53.304431
2021-09-15T00:31:03
2021-09-15T00:31:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,997
h
// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "AudioMixer.h" #include <AudioToolbox/AudioToolbox.h> #include <AudioUnit/AudioUnit.h> // Any platform defines namespace Audio { class FMixerPlatformCoreAudio : public IAudioMixerPlatformInterface { public: FMixerPlatformCoreAudio(); ~FMixerPlatformCoreAudio(); //~ Begin IAudioMixerPlatformInterface virtual EAudioMixerPlatformApi::Type GetPlatformApi() const override { return EAudioMixerPlatformApi::CoreAudio; } virtual bool InitializeHardware() override; virtual bool CheckAudioDeviceChange() override; virtual bool TeardownHardware() override; virtual bool IsInitialized() const override; virtual bool GetNumOutputDevices(uint32& OutNumOutputDevices) override; virtual bool GetOutputDeviceInfo(const uint32 InDeviceIndex, FAudioPlatformDeviceInfo& OutInfo) override; virtual bool GetDefaultOutputDeviceIndex(uint32& OutDefaultDeviceIndex) const override; virtual bool OpenAudioStream(const FAudioMixerOpenStreamParams& Params) override; virtual bool CloseAudioStream() override; virtual bool StartAudioStream() override; virtual bool StopAudioStream() override; virtual bool MoveAudioStreamToNewAudioDevice(const FString& InNewDeviceId) override; virtual FAudioPlatformDeviceInfo GetPlatformDeviceInfo() const override; virtual void SubmitBuffer(const uint8* Buffer) override; virtual FName GetRuntimeFormat(USoundWave* InSoundWave) override; virtual bool HasCompressedAudioInfoClass(USoundWave* InSoundWave) override; virtual ICompressedAudioInfo* CreateCompressedAudioInfo(USoundWave* InSoundWave) override; virtual ICompressedAudioInfo* CreateCompressedAudioInfo(const FSoundWaveProxyPtr& InSoundWave) override; virtual FString GetDefaultDeviceName() override; virtual FAudioPlatformSettings GetPlatformSettings() const override; virtual int32 GetNumFrames(const int32 InNumReqestedFrames) override; virtual void ResumeContext() override; virtual void SuspendContext() override; //~ End IAudioMixerPlatformInterface private: AudioStreamBasicDescription OutputFormat; bool bSuspended; /** True if the connection to the device has been initialized */ bool bInitialized; /** True if execution is in the callback */ bool bInCallback; AUGraph AudioUnitGraph; AUNode OutputNode; AudioUnit OutputUnit; uint8* SubmittedBufferPtr; int32 SubmittedBytes = 0; int32 RemainingBytesInCurrentSubmittedBuffer; int32 BytesPerSubmittedBuffer; double GraphSampleRate; bool PerformCallback(AudioBufferList* OutputBufferData); void HandleError(const TCHAR* InLogOutput, bool bTeardown = true); static OSStatus AudioRenderCallback(void* RefCon, AudioUnitRenderActionFlags* ActionFlags, const AudioTimeStamp* TimeStamp, UInt32 BusNumber, UInt32 NumFrames, AudioBufferList* IOData); }; }
[ "ouczbs@qq.com" ]
ouczbs@qq.com
3739363fc42cbc37383421ee9f10a857d9f8a73a
33d634b050655097ba63787f0c058a727f49dc0a
/2. Basics2/Ćw2_4.cpp
70539552bdf10ba32491190cb8ee42b48dc4d874
[]
no_license
LucasJezap/WDI
5a8e571a9d7eb9066fe0f9bae2ea3fe2d824139c
624d342a5a58b072732354e5b45d6f5b9709a8b6
refs/heads/master
2020-09-04T04:43:47.143962
2019-11-07T14:12:59
2019-11-07T14:12:59
219,660,159
0
0
null
null
null
null
UTF-8
C++
false
false
495
cpp
#include <iostream> using namespace std; int main() { int n; cout << "Podaj pewna liczbe naturalna: " << endl; cin >> n; int a=n; int c=1; int i=1; int x=0; while(a>c) { x=i; while(i%2==0) { i/=2; } while(i%3==0) { i/=3; } while(i%5==0) { i/=5; } if(i==1) { cout << "Liczba " << x << " jest liczba dwu-trzy-piatkowa " << endl; } i=1; i=i+c; c++; } system("pause"); return 0; }
[ "noreply@github.com" ]
noreply@github.com
eeb8b7c87626154b911f0dea3fa7d85de010ded8
35701a648c65aab3011a523fd35cc10b1e753b6a
/综合实验之三/综合实验之三/综合实验之三.cpp
1e1752726bbef4e0011a25c6ace6b638df7aa42d
[]
no_license
Mutiyu/YML
9fe15d809021796c34a59446caf011b73eef12f7
24991754e212a9580a6b817fc00a092fd63d02a4
refs/heads/master
2022-11-11T18:09:07.096657
2020-07-03T15:34:02
2020-07-03T15:34:02
268,554,710
0
0
null
null
null
null
GB18030
C++
false
false
4,594
cpp
// 综合实验之三.cpp : 定义应用程序的类行为。 // #include "stdafx.h" #include "afxwinappex.h" #include "afxdialogex.h" #include "综合实验之三.h" #include "MainFrm.h" #include "综合实验之三Set.h" #include "综合实验之三Doc.h" #include "综合实验之三View.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // C综合实验之三App BEGIN_MESSAGE_MAP(C综合实验之三App, CWinApp) ON_COMMAND(ID_APP_ABOUT, &C综合实验之三App::OnAppAbout) END_MESSAGE_MAP() // C综合实验之三App 构造 C综合实验之三App::C综合实验之三App() { // 支持重新启动管理器 m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS; #ifdef _MANAGED // 如果应用程序是利用公共语言运行时支持(/clr)构建的,则: // 1) 必须有此附加设置,“重新启动管理器”支持才能正常工作。 // 2) 在您的项目中,您必须按照生成顺序向 System.Windows.Forms 添加引用。 System::Windows::Forms::Application::SetUnhandledExceptionMode(System::Windows::Forms::UnhandledExceptionMode::ThrowException); #endif // TODO: 将以下应用程序 ID 字符串替换为唯一的 ID 字符串;建议的字符串格式 //为 CompanyName.ProductName.SubProduct.VersionInformation SetAppID(_T("综合实验之三.AppID.NoVersion")); // TODO: 在此处添加构造代码, // 将所有重要的初始化放置在 InitInstance 中 } // 唯一的一个 C综合实验之三App 对象 C综合实验之三App theApp; // C综合实验之三App 初始化 BOOL C综合实验之三App::InitInstance() { // 如果一个运行在 Windows XP 上的应用程序清单指定要 // 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式, //则需要 InitCommonControlsEx()。 否则,将无法创建窗口。 INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // 将它设置为包括所有要在应用程序中使用的 // 公共控件类。 InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); // 初始化 OLE 库 if (!AfxOleInit()) { AfxMessageBox(IDP_OLE_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); EnableTaskbarInteraction(FALSE); // 使用 RichEdit 控件需要 AfxInitRichEdit2() // AfxInitRichEdit2(); // 标准初始化 // 如果未使用这些功能并希望减小 // 最终可执行文件的大小,则应移除下列 // 不需要的特定初始化例程 // 更改用于存储设置的注册表项 // TODO: 应适当修改该字符串, // 例如修改为公司或组织名 SetRegistryKey(_T("应用程序向导生成的本地应用程序")); LoadStdProfileSettings(4); // 加载标准 INI 文件选项(包括 MRU) // 注册应用程序的文档模板。 文档模板 // 将用作文档、框架窗口和视图之间的连接 CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(C综合实验之三Doc), RUNTIME_CLASS(CMainFrame), // 主 SDI 框架窗口 RUNTIME_CLASS(C综合实验之三View)); if (!pDocTemplate) return FALSE; AddDocTemplate(pDocTemplate); // 分析标准 shell 命令、DDE、打开文件操作的命令行 CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // 调度在命令行中指定的命令。 如果 // 用 /RegServer、/Register、/Unregserver 或 /Unregister 启动应用程序,则返回 FALSE。 if (!ProcessShellCommand(cmdInfo)) return FALSE; // 唯一的一个窗口已初始化,因此显示它并对其进行更新 m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); return TRUE; } int C综合实验之三App::ExitInstance() { //TODO: 处理可能已添加的附加资源 AfxOleTerm(FALSE); return CWinApp::ExitInstance(); } // C综合实验之三App 消息处理程序 // 用于应用程序“关于”菜单项的 CAboutDlg 对话框 class CAboutDlg : public CDialogEx { public: CAboutDlg(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_ABOUTBOX }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 // 实现 protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) END_MESSAGE_MAP() // 用于运行对话框的应用程序命令 void C综合实验之三App::OnAppAbout() { CAboutDlg aboutDlg; aboutDlg.DoModal(); } // C综合实验之三App 消息处理程序
[ "eiyk66@163.com" ]
eiyk66@163.com
c9b9f3029fbdb80ca4c18cc8d8e6f9fae10ef238
8e847a5cb7b6395b3dfb627f55934d23f13d6047
/Image.cpp
be54cd07de9e0209a0527246ee6e7f2c0fe84b1b
[]
no_license
jovanovic16942/Drincpp
67f718cae57ee10176bb4d654a0f18a7d1be5e70
b001f764e76f95942856e3d240384da8f3e521ae
refs/heads/master
2020-04-02T04:22:38.684803
2018-10-21T14:00:51
2018-10-21T14:00:51
154,013,941
0
0
null
null
null
null
UTF-8
C++
false
false
2,897
cpp
/*KOD PREUZET SA VEZBI BEZ VELIKIH IZMENA*/ #include <assert.h> #include <stdlib.h> #include <stdio.h> #include "Image.h" Image *image_init(int width, int height) { Image *image; assert(width >= 0 && height >= 0); /// Allocate space image = (Image *) malloc(sizeof(Image)); assert(image != nullptr); // Init data image->width = width; image->height = height; if (width == 0 || height == 0) image->pixels = nullptr; else { image->pixels = (char *)malloc(3 * width * height * sizeof(char)); assert(image->pixels != nullptr); } // Return pointer to Image struct return image; } void image_done(Image *image) { // Free allocated memory free(image->pixels); free(image); } void image_read(Image *image, char *filename) { FILE *file; BITMAPFILEHEADER bfh; BITMAPINFOHEADER bih; unsigned int i; unsigned char r, g, b, a; // Overwrite previous content free(image->pixels); image->pixels = nullptr; // Open bmp file assert((file = fopen(filename, "rb")) != nullptr); // First header fread(&bfh.type, 2, 1, file); fread(&bfh.size, 4, 1, file); fread(&bfh.reserved1, 2, 1, file); fread(&bfh.reserved2, 2, 1, file); fread(&bfh.offsetbits, 4, 1, file); // Second header fread(&bih.size, 4, 1, file); fread(&bih.width, 4, 1, file); fread(&bih.height, 4, 1, file); fread(&bih.planes, 2, 1, file); fread(&bih.bitcount, 2, 1, file); fread(&bih.compression, 4, 1, file); fread(&bih.sizeimage, 4, 1, file); fread(&bih.xpelspermeter, 4, 1, file); fread(&bih.ypelspermeter, 4, 1, file); fread(&bih.colorsused, 4, 1, file); fread(&bih.colorsimportant, 4, 1, file); // Take width and height of the image image->width = bih.width; image->height = bih.height; // Allocate pixel array if (bih.bitcount == 24) image->pixels = (char *)malloc(3 * bih.width * bih.height * sizeof(char)); else if (bih.bitcount == 32) image->pixels = (char *)malloc(4 * bih.width * bih.height * sizeof(char)); else { fprintf(stderr, "image_read(): 24 or 32 bit per pixel images supported.\n"); exit(1); } assert(image->pixels != nullptr); if (bih.bitcount == 24) // RGB for (i = 0; i < bih.width * bih.height; i++) { fread(&b, sizeof(char), 1, file); fread(&g, sizeof(char), 1, file); fread(&r, sizeof(char), 1, file); image->pixels[3 * i] = r; image->pixels[3 * i + 1] = g; image->pixels[3 * i + 2] = b; } else if (bih.bitcount == 32) //RGBA for (i = 0; i < bih.width * bih.height; i++) { fread(&b, sizeof(char), 1, file); fread(&g, sizeof(char), 1, file); fread(&r, sizeof(char), 1, file); fread(&a, sizeof(char), 1, file); image->pixels[4 * i] = r; image->pixels[4 * i + 1] = g; image->pixels[4 * i + 2] = b; image->pixels[4 * i + 3] = a; } // Close file fclose(file); }
[ "jovanovic16942@gmail.com" ]
jovanovic16942@gmail.com
e7965649595ec629cec087df8281d852780de791
7fbb25e0647190585df7b3527df4dd27c5ddf9e3
/LoginImageUsingResources/mainwindow.h
beeab92e3a2de5058f45234c9d9322bcebe75626
[]
no_license
Neeraj1942/Qt-Tool
6c7cdf73a4fe0467c0c42a1cd73e1087e0a151bc
460d330832747548698253232622453f83878765
refs/heads/main
2023-08-21T20:12:34.053658
2021-09-28T07:31:35
2021-09-28T07:31:35
411,181,426
0
0
null
null
null
null
UTF-8
C++
false
false
416
h
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <dialog.h> QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); private slots: void on_pushButton_login_clicked(); private: Ui::MainWindow *ui; Dialog *t; }; #endif // MAINWINDOW_H
[ "neeraj.dhulipala@gmail.com" ]
neeraj.dhulipala@gmail.com
7d97ad8c74a1d74a4e5618ff39ce68d684051092
c96ae11059bef7c62a3e7509708c9807e5b7384a
/tinyXML/tinyxml.cpp
e3229af087d184bb1fb006b67348afda8c5cf729
[]
no_license
liuchunlin/BehaviourEditor
40a195fa3455402a585152431219a4411119357a
9ce3217f2bfc5490680e8df414286b95b27382ce
refs/heads/master
2020-12-25T14:13:16.775271
2016-08-25T15:45:49
2016-08-25T15:45:49
65,906,631
0
0
null
null
null
null
UTF-8
C++
false
false
38,571
cpp
/* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include <ctype.h> #ifdef TIXML_USE_STL #include <sstream> #include <iostream> #endif #include "tinyxml.h" bool TiXmlBase::condenseWhiteSpace = true; void TiXmlBase::PutString( const TIXML_STRING& str, TIXML_STRING* outString ) { int i=0; while( i<(int)str.length() ) { unsigned char c = (unsigned char) str[i]; if ( c == '&' && i < ( (int)str.length() - 2 ) && str[i+1] == '#' && str[i+2] == 'x' ) { // Hexadecimal character reference. // Pass through unchanged. // &#xA9; -- copyright symbol, for example. // // The -1 is a bug fix from Rob Laveaux. It keeps // an overflow from happening if there is no ';'. // There are actually 2 ways to exit this loop - // while fails (error case) and break (semicolon found). // However, there is no mechanism (currently) for // this function to return an error. while ( i<(int)str.length()-1 ) { outString->append( str.c_str() + i, 1 ); ++i; if ( str[i] == ';' ) break; } } else if ( c == '&' ) { outString->append( entity[0].str, entity[0].strLength ); ++i; } else if ( c == '<' ) { outString->append( entity[1].str, entity[1].strLength ); ++i; } else if ( c == '>' ) { outString->append( entity[2].str, entity[2].strLength ); ++i; } else if ( c == '\"' ) { outString->append( entity[3].str, entity[3].strLength ); ++i; } else if ( c == '\'' ) { outString->append( entity[4].str, entity[4].strLength ); ++i; } else if ( c < 32 ) { // Easy pass at non-alpha/numeric/symbol // Below 32 is symbolic. char buf[ 32 ]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) ); #else sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); #endif //*ME: warning C4267: convert 'size_t' to 'int' //*ME: Int-Cast to make compiler happy ... outString->append( buf, (int)strlen( buf ) ); ++i; } else { //char realc = (char) c; //outString->append( &realc, 1 ); *outString += (char) c; // somewhat more efficient function call. ++i; } } } TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase() { parent = 0; type = _type; firstChild = 0; lastChild = 0; prev = 0; next = 0; } TiXmlNode::~TiXmlNode() { TiXmlNode* node = firstChild; TiXmlNode* temp = 0; while ( node ) { temp = node; node = node->next; delete temp; } } void TiXmlNode::CopyTo( TiXmlNode* target ) const { target->SetValue (value.c_str() ); target->userData = userData; } void TiXmlNode::Clear() { TiXmlNode* node = firstChild; TiXmlNode* temp = 0; while ( node ) { temp = node; node = node->next; delete temp; } firstChild = 0; lastChild = 0; } TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) { assert( node->parent == 0 || node->parent == this ); assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); if ( node->Type() == TiXmlNode::DOCUMENT ) { delete node; if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } node->parent = this; node->prev = lastChild; node->next = 0; if ( lastChild ) lastChild->next = node; else firstChild = node; // it was an empty list. lastChild = node; return node; } TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) { if ( addThis.Type() == TiXmlNode::DOCUMENT ) { if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } TiXmlNode* node = addThis.Clone(); if ( !node ) return 0; return LinkEndChild( node ); } TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ) { if ( !beforeThis || beforeThis->parent != this ) { return 0; } if ( addThis.Type() == TiXmlNode::DOCUMENT ) { if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } TiXmlNode* node = addThis.Clone(); if ( !node ) return 0; node->parent = this; node->next = beforeThis; node->prev = beforeThis->prev; if ( beforeThis->prev ) { beforeThis->prev->next = node; } else { assert( firstChild == beforeThis ); firstChild = node; } beforeThis->prev = node; return node; } TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ) { if ( !afterThis || afterThis->parent != this ) { return 0; } if ( addThis.Type() == TiXmlNode::DOCUMENT ) { if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } TiXmlNode* node = addThis.Clone(); if ( !node ) return 0; node->parent = this; node->prev = afterThis; node->next = afterThis->next; if ( afterThis->next ) { afterThis->next->prev = node; } else { assert( lastChild == afterThis ); lastChild = node; } afterThis->next = node; return node; } TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ) { if ( replaceThis->parent != this ) return 0; TiXmlNode* node = withThis.Clone(); if ( !node ) return 0; node->next = replaceThis->next; node->prev = replaceThis->prev; if ( replaceThis->next ) replaceThis->next->prev = node; else lastChild = node; if ( replaceThis->prev ) replaceThis->prev->next = node; else firstChild = node; delete replaceThis; node->parent = this; return node; } bool TiXmlNode::RemoveChild( TiXmlNode* removeThis ) { if ( removeThis->parent != this ) { assert( 0 ); return false; } if ( removeThis->next ) removeThis->next->prev = removeThis->prev; else lastChild = removeThis->prev; if ( removeThis->prev ) removeThis->prev->next = removeThis->next; else firstChild = removeThis->next; delete removeThis; return true; } const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const { const TiXmlNode* node; for ( node = firstChild; node; node = node->next ) { if ( strcmp( node->Value(), _value ) == 0 ) return node; } return 0; } const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const { const TiXmlNode* node; for ( node = lastChild; node; node = node->prev ) { if ( strcmp( node->Value(), _value ) == 0 ) return node; } return 0; } const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const { if ( !previous ) { return FirstChild(); } else { assert( previous->parent == this ); return previous->NextSibling(); } } const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const { if ( !previous ) { return FirstChild( val ); } else { assert( previous->parent == this ); return previous->NextSibling( val ); } } const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const { const TiXmlNode* node; for ( node = next; node; node = node->next ) { if ( strcmp( node->Value(), _value ) == 0 ) return node; } return 0; } const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const { const TiXmlNode* node; for ( node = prev; node; node = node->prev ) { if ( strcmp( node->Value(), _value ) == 0 ) return node; } return 0; } void TiXmlElement::RemoveAttribute( const char * name ) { #ifdef TIXML_USE_STL TIXML_STRING str( name ); TiXmlAttribute* node = attributeSet.Find( str ); #else TiXmlAttribute* node = attributeSet.Find( name ); #endif if ( node ) { attributeSet.Remove( node ); delete node; } } const TiXmlElement* TiXmlNode::FirstChildElement() const { const TiXmlNode* node; for ( node = FirstChild(); node; node = node->NextSibling() ) { if ( node->ToElement() ) return node->ToElement(); } return 0; } const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const { const TiXmlNode* node; for ( node = FirstChild( _value ); node; node = node->NextSibling( _value ) ) { if ( node->ToElement() ) return node->ToElement(); } return 0; } const TiXmlElement* TiXmlNode::NextSiblingElement() const { const TiXmlNode* node; for ( node = NextSibling(); node; node = node->NextSibling() ) { if ( node->ToElement() ) return node->ToElement(); } return 0; } const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const { const TiXmlNode* node; for ( node = NextSibling( _value ); node; node = node->NextSibling( _value ) ) { if ( node->ToElement() ) return node->ToElement(); } return 0; } const TiXmlDocument* TiXmlNode::GetDocument() const { const TiXmlNode* node; for( node = this; node; node = node->parent ) { if ( node->ToDocument() ) return node->ToDocument(); } return 0; } TiXmlElement::TiXmlElement (const char * _value) : TiXmlNode( TiXmlNode::ELEMENT ) { firstChild = lastChild = 0; value = _value; } #ifdef TIXML_USE_STL TiXmlElement::TiXmlElement( const std::string& _value ) : TiXmlNode( TiXmlNode::ELEMENT ) { firstChild = lastChild = 0; value = _value; } #endif TiXmlElement::TiXmlElement( const TiXmlElement& copy) : TiXmlNode( TiXmlNode::ELEMENT ) { firstChild = lastChild = 0; copy.CopyTo( this ); } void TiXmlElement::operator=( const TiXmlElement& base ) { ClearThis(); base.CopyTo( this ); } TiXmlElement::~TiXmlElement() { ClearThis(); } void TiXmlElement::ClearThis() { Clear(); while( attributeSet.First() ) { TiXmlAttribute* node = attributeSet.First(); attributeSet.Remove( node ); delete node; } } const char* TiXmlElement::Attribute( const char* name ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( node ) return node->Value(); return 0; } #ifdef TIXML_USE_STL const std::string* TiXmlElement::Attribute( const std::string& name ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( node ) return &node->ValueStr(); return 0; } #endif const char* TiXmlElement::Attribute( const char* name, int* i ) const { const char* s = Attribute( name ); if ( i ) { if ( s ) { *i = atoi( s ); } else { *i = 0; } } return s; } #ifdef TIXML_USE_STL const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const { const std::string* s = Attribute( name ); if ( i ) { if ( s ) { *i = atoi( s->c_str() ); } else { *i = 0; } } return s; } #endif const char* TiXmlElement::Attribute( const char* name, double* d ) const { const char* s = Attribute( name ); if ( d ) { if ( s ) { *d = atof( s ); } else { *d = 0; } } return s; } #ifdef TIXML_USE_STL const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const { const std::string* s = Attribute( name ); if ( d ) { if ( s ) { *d = atof( s->c_str() ); } else { *d = 0; } } return s; } #endif int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; return node->QueryIntValue( ival ); } #ifdef TIXML_USE_STL int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; return node->QueryIntValue( ival ); } #endif int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; return node->QueryDoubleValue( dval ); } #ifdef TIXML_USE_STL int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; return node->QueryDoubleValue( dval ); } #endif void TiXmlElement::SetAttribute( const char * name, int val ) { char buf[64]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF( buf, sizeof(buf), "%d", val ); #else sprintf( buf, "%d", val ); #endif SetAttribute( name, buf ); } #ifdef TIXML_USE_STL void TiXmlElement::SetAttribute( const std::string& name, int val ) { std::ostringstream oss; oss << val; SetAttribute( name, oss.str() ); } #endif void TiXmlElement::SetDoubleAttribute( const char * name, double val ) { char buf[256]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF( buf, sizeof(buf), "%f", val ); #else sprintf( buf, "%f", val ); #endif SetAttribute( name, buf ); } void TiXmlElement::SetAttribute( const char * cname, const char * cvalue ) { #ifdef TIXML_USE_STL TIXML_STRING _name( cname ); TIXML_STRING _value( cvalue ); #else const char* _name = cname; const char* _value = cvalue; #endif TiXmlAttribute* node = attributeSet.Find( _name ); if ( node ) { node->SetValue( _value ); return; } TiXmlAttribute* attrib = new TiXmlAttribute( cname, cvalue ); if ( attrib ) { attributeSet.Add( attrib ); } else { TiXmlDocument* document = GetDocument(); if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); } } #ifdef TIXML_USE_STL void TiXmlElement::SetAttribute( const std::string& name, const std::string& _value ) { TiXmlAttribute* node = attributeSet.Find( name ); if ( node ) { node->SetValue( _value ); return; } TiXmlAttribute* attrib = new TiXmlAttribute( name, _value ); if ( attrib ) { attributeSet.Add( attrib ); } else { TiXmlDocument* document = GetDocument(); if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); } } #endif void TiXmlElement::Print( FILE* cfile, int depth ) const { int i; assert( cfile ); for ( i=0; i<depth; i++ ) { fprintf( cfile, " " ); } fprintf( cfile, "<%s", value.c_str() ); const TiXmlAttribute* attrib; for ( attrib = attributeSet.First(); attrib; attrib = attrib->Next() ) { fprintf( cfile, " " ); attrib->Print( cfile, depth ); } // There are 3 different formatting approaches: // 1) An element without children is printed as a <foo /> node // 2) An element with only a text child is printed as <foo> text </foo> // 3) An element with children is printed on multiple lines. TiXmlNode* node; if ( !firstChild ) { fprintf( cfile, " />" ); } else if ( firstChild == lastChild && firstChild->ToText() ) { fprintf( cfile, ">" ); firstChild->Print( cfile, depth + 1 ); fprintf( cfile, "</%s>", value.c_str() ); } else { fprintf( cfile, ">" ); for ( node = firstChild; node; node=node->NextSibling() ) { if ( !node->ToText() ) { fprintf( cfile, "\n" ); } node->Print( cfile, depth+1 ); } fprintf( cfile, "\n" ); for( i=0; i<depth; ++i ) { fprintf( cfile, " " ); } fprintf( cfile, "</%s>", value.c_str() ); } } void TiXmlElement::CopyTo( TiXmlElement* target ) const { // superclass: TiXmlNode::CopyTo( target ); // Element class: // Clone the attributes, then clone the children. const TiXmlAttribute* attribute = 0; for( attribute = attributeSet.First(); attribute; attribute = attribute->Next() ) { target->SetAttribute( attribute->Name(), attribute->Value() ); } TiXmlNode* node = 0; for ( node = firstChild; node; node = node->NextSibling() ) { target->LinkEndChild( node->Clone() ); } } bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const { if ( visitor->VisitEnter( *this, attributeSet.First() ) ) { for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) { if ( !node->Accept( visitor ) ) break; } } return visitor->VisitExit( *this ); } TiXmlNode* TiXmlElement::Clone() const { TiXmlElement* clone = new TiXmlElement( Value() ); if ( !clone ) return 0; CopyTo( clone ); return clone; } const char* TiXmlElement::GetText() const { const TiXmlNode* child = this->FirstChild(); if ( child ) { const TiXmlText* childText = child->ToText(); if ( childText ) { return childText->Value(); } } return 0; } TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::DOCUMENT ) { tabsize = 4; useMicrosoftBOM = false; ClearError(); } TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) { tabsize = 4; useMicrosoftBOM = false; value = documentName; ClearError(); } #ifdef TIXML_USE_STL TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) { tabsize = 4; useMicrosoftBOM = false; value = documentName; ClearError(); } #endif TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::DOCUMENT ) { copy.CopyTo( this ); } void TiXmlDocument::operator=( const TiXmlDocument& copy ) { Clear(); copy.CopyTo( this ); } bool TiXmlDocument::LoadFile( TiXmlEncoding encoding ) { // See STL_STRING_BUG below. //StringToBuffer buf( value ); return LoadFile( Value(), encoding ); } bool TiXmlDocument::SaveFile() const { // See STL_STRING_BUG below. // StringToBuffer buf( value ); // // if ( buf.buffer && SaveFile( buf.buffer ) ) // return true; // // return false; return SaveFile( Value() ); } bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding ) { // There was a really terrifying little bug here. The code: // value = filename // in the STL case, cause the assignment method of the std::string to // be called. What is strange, is that the std::string had the same // address as it's c_str() method, and so bad things happen. Looks // like a bug in the Microsoft STL implementation. // Add an extra string to avoid the crash. TIXML_STRING filename( _filename ); value = filename; // reading in binary mode so that tinyxml can normalize the EOL //FILE* file = fopen( value.c_str (), "rb" ); FILE* file = NULL; errno_t err = fopen_s( &file, value.c_str (), "rb" ); if ( file && err == 0 ) { bool result = LoadFile( file, encoding ); fclose( file ); return result; } else { SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); return false; } } bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding ) { if ( !file ) { SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); return false; } // Delete the existing data: Clear(); location.Clear(); // Get the file size, so we can pre-allocate the string. HUGE speed impact. long length = 0; fseek( file, 0, SEEK_END ); length = ftell( file ); fseek( file, 0, SEEK_SET ); // Strange case, but good to handle up front. if ( length == 0 ) { SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); return false; } // If we have a file, assume it is all one big XML file, and read it in. // The document parser may decide the document ends sooner than the entire file, however. TIXML_STRING data; data.reserve( length ); // Subtle bug here. TinyXml did use fgets. But from the XML spec: // 2.11 End-of-Line Handling // <snip> // <quote> // ...the XML processor MUST behave as if it normalized all line breaks in external // parsed entities (including the document entity) on input, before parsing, by translating // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to // a single #xA character. // </quote> // // It is not clear fgets does that, and certainly isn't clear it works cross platform. // Generally, you expect fgets to translate from the convention of the OS to the c/unix // convention, and not work generally. /* while( fgets( buf, sizeof(buf), file ) ) { data += buf; } */ char* buf = new char[ length+1 ]; buf[0] = 0; if ( fread( buf, length, 1, file ) != 1 ) { delete [] buf; SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); return false; } const char* lastPos = buf; const char* p = buf; buf[length] = 0; while( *p ) { assert( p < (buf+length) ); if ( *p == 0xa ) { // Newline character. No special rules for this. Append all the characters // since the last string, and include the newline. data.append( lastPos, (p-lastPos+1) ); // append, include the newline ++p; // move past the newline lastPos = p; // and point to the new buffer (may be 0) assert( p <= (buf+length) ); } else if ( *p == 0xd ) { // Carriage return. Append what we have so far, then // handle moving forward in the buffer. if ( (p-lastPos) > 0 ) { data.append( lastPos, p-lastPos ); // do not add the CR } data += (char)0xa; // a proper newline if ( *(p+1) == 0xa ) { // Carriage return - new line sequence p += 2; lastPos = p; assert( p <= (buf+length) ); } else { // it was followed by something else...that is presumably characters again. ++p; lastPos = p; assert( p <= (buf+length) ); } } else { ++p; } } // Handle any left over characters. if ( p-lastPos ) { data.append( lastPos, p-lastPos ); } delete [] buf; buf = 0; Parse( data.c_str(), 0, encoding ); if ( Error() ) return false; else return true; } bool TiXmlDocument::SaveFile( const char * filename ) const { // The old c stuff lives on... //FILE* fp = fopen( filename, "w" ); FILE* fp = NULL; errno_t err = fopen_s( &fp, filename, "w" ); if ( fp && err == 0 ) { bool result = SaveFile( fp ); fclose( fp ); return result; } return false; } bool TiXmlDocument::SaveFile( FILE* fp ) const { if ( useMicrosoftBOM ) { const unsigned char TIXML_UTF_LEAD_0 = 0xefU; const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; fputc( TIXML_UTF_LEAD_0, fp ); fputc( TIXML_UTF_LEAD_1, fp ); fputc( TIXML_UTF_LEAD_2, fp ); } Print( fp, 0 ); return (ferror(fp) == 0); } void TiXmlDocument::CopyTo( TiXmlDocument* target ) const { TiXmlNode::CopyTo( target ); target->error = error; target->errorDesc = errorDesc.c_str (); TiXmlNode* node = 0; for ( node = firstChild; node; node = node->NextSibling() ) { target->LinkEndChild( node->Clone() ); } } TiXmlNode* TiXmlDocument::Clone() const { TiXmlDocument* clone = new TiXmlDocument(); if ( !clone ) return 0; CopyTo( clone ); return clone; } void TiXmlDocument::Print( FILE* cfile, int depth ) const { assert( cfile ); for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) { node->Print( cfile, depth ); fprintf( cfile, "\n" ); } } bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const { if ( visitor->VisitEnter( *this ) ) { for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) { if ( !node->Accept( visitor ) ) break; } } return visitor->VisitExit( *this ); } const TiXmlAttribute* TiXmlAttribute::Next() const { // We are using knowledge of the sentinel. The sentinel // have a value or name. if ( next->value.empty() && next->name.empty() ) return 0; return next; } /* TiXmlAttribute* TiXmlAttribute::Next() { // We are using knowledge of the sentinel. The sentinel // have a value or name. if ( next->value.empty() && next->name.empty() ) return 0; return next; } */ const TiXmlAttribute* TiXmlAttribute::Previous() const { // We are using knowledge of the sentinel. The sentinel // have a value or name. if ( prev->value.empty() && prev->name.empty() ) return 0; return prev; } /* TiXmlAttribute* TiXmlAttribute::Previous() { // We are using knowledge of the sentinel. The sentinel // have a value or name. if ( prev->value.empty() && prev->name.empty() ) return 0; return prev; } */ void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const { TIXML_STRING n, v; PutString( name, &n ); PutString( value, &v ); if (value.find ('\"') == TIXML_STRING::npos) { if ( cfile ) { fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() ); } if ( str ) { (*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\""; } } else { if ( cfile ) { fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() ); } if ( str ) { (*str) += n; (*str) += "='"; (*str) += v; (*str) += "'"; } } } int TiXmlAttribute::QueryIntValue( int* ival ) const { //if ( sscanf( value.c_str(), "%d", ival ) == 1 ) // return TIXML_SUCCESS; if ( sscanf_s( value.c_str(), "%d", ival ) == 1 ) return TIXML_SUCCESS; return TIXML_WRONG_TYPE; } int TiXmlAttribute::QueryDoubleValue( double* dval ) const { //if ( sscanf( value.c_str(), "%lf", dval ) == 1 ) // return TIXML_SUCCESS; if ( sscanf_s( value.c_str(), "%lf", dval ) == 1 ) return TIXML_SUCCESS; return TIXML_WRONG_TYPE; } void TiXmlAttribute::SetIntValue( int _value ) { char buf [64]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value); #else sprintf (buf, "%d", _value); #endif SetValue (buf); } void TiXmlAttribute::SetDoubleValue( double _value ) { char buf [256]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value); #else sprintf (buf, "%lf", _value); #endif SetValue (buf); } int TiXmlAttribute::IntValue() const { return atoi (value.c_str ()); } double TiXmlAttribute::DoubleValue() const { return atof (value.c_str ()); } TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::COMMENT ) { copy.CopyTo( this ); } void TiXmlComment::operator=( const TiXmlComment& base ) { Clear(); base.CopyTo( this ); } void TiXmlComment::Print( FILE* cfile, int depth ) const { assert( cfile ); for ( int i=0; i<depth; i++ ) { fprintf( cfile, " " ); } fprintf( cfile, "<!--%s-->", value.c_str() ); } void TiXmlComment::CopyTo( TiXmlComment* target ) const { TiXmlNode::CopyTo( target ); } bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlComment::Clone() const { TiXmlComment* clone = new TiXmlComment(); if ( !clone ) return 0; CopyTo( clone ); return clone; } void TiXmlText::Print( FILE* cfile, int depth ) const { assert( cfile ); if ( cdata ) { int i; fprintf( cfile, "\n" ); for ( i=0; i<depth; i++ ) { fprintf( cfile, " " ); } fprintf( cfile, "<![CDATA[%s]]>\n", value.c_str() ); // unformatted output } else { TIXML_STRING buffer; PutString( value, &buffer ); fprintf( cfile, "%s", buffer.c_str() ); } } void TiXmlText::CopyTo( TiXmlText* target ) const { TiXmlNode::CopyTo( target ); target->cdata = cdata; } bool TiXmlText::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlText::Clone() const { TiXmlText* clone = 0; clone = new TiXmlText( "" ); if ( !clone ) return 0; CopyTo( clone ); return clone; } TiXmlDeclaration::TiXmlDeclaration( const char * _version, const char * _encoding, const char * _standalone ) : TiXmlNode( TiXmlNode::DECLARATION ) { version = _version; encoding = _encoding; standalone = _standalone; } #ifdef TIXML_USE_STL TiXmlDeclaration::TiXmlDeclaration( const std::string& _version, const std::string& _encoding, const std::string& _standalone ) : TiXmlNode( TiXmlNode::DECLARATION ) { version = _version; encoding = _encoding; standalone = _standalone; } #endif TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy ) : TiXmlNode( TiXmlNode::DECLARATION ) { copy.CopyTo( this ); } void TiXmlDeclaration::operator=( const TiXmlDeclaration& copy ) { Clear(); copy.CopyTo( this ); } void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const { if ( cfile ) fprintf( cfile, "<?xml " ); if ( str ) (*str) += "<?xml "; if ( !version.empty() ) { if ( cfile ) fprintf (cfile, "version=\"%s\" ", version.c_str ()); if ( str ) { (*str) += "version=\""; (*str) += version; (*str) += "\" "; } } if ( !encoding.empty() ) { if ( cfile ) fprintf (cfile, "encoding=\"%s\" ", encoding.c_str ()); if ( str ) { (*str) += "encoding=\""; (*str) += encoding; (*str) += "\" "; } } if ( !standalone.empty() ) { if ( cfile ) fprintf (cfile, "standalone=\"%s\" ", standalone.c_str ()); if ( str ) { (*str) += "standalone=\""; (*str) += standalone; (*str) += "\" "; } } if ( cfile ) fprintf( cfile, "?>" ); if ( str ) (*str) += "?>"; } void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const { TiXmlNode::CopyTo( target ); target->version = version; target->encoding = encoding; target->standalone = standalone; } bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlDeclaration::Clone() const { TiXmlDeclaration* clone = new TiXmlDeclaration(); if ( !clone ) return 0; CopyTo( clone ); return clone; } void TiXmlUnknown::Print( FILE* cfile, int depth ) const { for ( int i=0; i<depth; i++ ) fprintf( cfile, " " ); fprintf( cfile, "<%s>", value.c_str() ); } void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const { TiXmlNode::CopyTo( target ); } bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlUnknown::Clone() const { TiXmlUnknown* clone = new TiXmlUnknown(); if ( !clone ) return 0; CopyTo( clone ); return clone; } TiXmlAttributeSet::TiXmlAttributeSet() { sentinel.next = &sentinel; sentinel.prev = &sentinel; } TiXmlAttributeSet::~TiXmlAttributeSet() { assert( sentinel.next == &sentinel ); assert( sentinel.prev == &sentinel ); } void TiXmlAttributeSet::Add( TiXmlAttribute* addMe ) { #ifdef TIXML_USE_STL assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set. #else assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set. #endif addMe->next = &sentinel; addMe->prev = sentinel.prev; sentinel.prev->next = addMe; sentinel.prev = addMe; } void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe ) { TiXmlAttribute* node; for( node = sentinel.next; node != &sentinel; node = node->next ) { if ( node == removeMe ) { node->prev->next = node->next; node->next->prev = node->prev; node->next = 0; node->prev = 0; return; } } assert( 0 ); // we tried to remove a non-linked attribute. } #ifdef TIXML_USE_STL const TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const { for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) { if ( node->name == name ) return node; } return 0; } /* TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) { for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) { if ( node->name == name ) return node; } return 0; } */ #endif const TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const { for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) { if ( strcmp( node->name.c_str(), name ) == 0 ) return node; } return 0; } /* TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) { for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) { if ( strcmp( node->name.c_str(), name ) == 0 ) return node; } return 0; } */ #ifdef TIXML_USE_STL std::istream& operator>> (std::istream & in, TiXmlNode & base) { TIXML_STRING tag; tag.reserve( 8 * 1000 ); base.StreamIn( &in, &tag ); base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING ); return in; } #endif #ifdef TIXML_USE_STL std::ostream& operator<< (std::ostream & out, const TiXmlNode & base) { TiXmlPrinter printer; printer.SetStreamPrinting(); base.Accept( &printer ); out << printer.Str(); return out; } std::string& operator<< (std::string& out, const TiXmlNode& base ) { TiXmlPrinter printer; printer.SetStreamPrinting(); base.Accept( &printer ); out.append( printer.Str() ); return out; } #endif TiXmlHandle TiXmlHandle::FirstChild() const { if ( node ) { TiXmlNode* child = node->FirstChild(); if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const { if ( node ) { TiXmlNode* child = node->FirstChild( value ); if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::FirstChildElement() const { if ( node ) { TiXmlElement* child = node->FirstChildElement(); if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const { if ( node ) { TiXmlElement* child = node->FirstChildElement( value ); if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::Child( int count ) const { if ( node ) { int i; TiXmlNode* child = node->FirstChild(); for ( i=0; child && i<count; child = child->NextSibling(), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const { if ( node ) { int i; TiXmlNode* child = node->FirstChild( value ); for ( i=0; child && i<count; child = child->NextSibling( value ), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::ChildElement( int count ) const { if ( node ) { int i; TiXmlElement* child = node->FirstChildElement(); for ( i=0; child && i<count; child = child->NextSiblingElement(), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const { if ( node ) { int i; TiXmlElement* child = node->FirstChildElement( value ); for ( i=0; child && i<count; child = child->NextSiblingElement( value ), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } bool TiXmlPrinter::VisitEnter( const TiXmlDocument& ) { return true; } bool TiXmlPrinter::VisitExit( const TiXmlDocument& ) { return true; } bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) { DoIndent(); buffer += "<"; buffer += element.Value(); for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() ) { buffer += " "; attrib->Print( 0, 0, &buffer ); } if ( !element.FirstChild() ) { buffer += " />"; DoLineBreak(); } else { buffer += ">"; if ( element.FirstChild()->ToText() && element.LastChild() == element.FirstChild() && element.FirstChild()->ToText()->CDATA() == false ) { simpleTextPrint = true; // no DoLineBreak()! } else { DoLineBreak(); } } ++depth; return true; } bool TiXmlPrinter::VisitExit( const TiXmlElement& element ) { --depth; if ( !element.FirstChild() ) { // nothing. } else { if ( simpleTextPrint ) { simpleTextPrint = false; } else { DoIndent(); } buffer += "</"; buffer += element.Value(); buffer += ">"; DoLineBreak(); } return true; } bool TiXmlPrinter::Visit( const TiXmlText& text ) { if ( text.CDATA() ) { DoIndent(); buffer += "<![CDATA["; buffer += text.Value(); buffer += "]]>"; DoLineBreak(); } else if ( simpleTextPrint ) { buffer += text.Value(); } else { DoIndent(); buffer += text.Value(); DoLineBreak(); } return true; } bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration ) { DoIndent(); declaration.Print( 0, 0, &buffer ); DoLineBreak(); return true; } bool TiXmlPrinter::Visit( const TiXmlComment& comment ) { DoIndent(); buffer += "<!--"; buffer += comment.Value(); buffer += "-->"; DoLineBreak(); return true; } bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown ) { DoIndent(); buffer += "<"; buffer += unknown.Value(); buffer += ">"; DoLineBreak(); return true; }
[ "408354802@qq.com" ]
408354802@qq.com
69e30f64fe2d15b3daabd7a890ec8caf2e1c39c6
d3be1a604511e1c5646f8a92a8b42ec65c94949b
/src/jnc_ct/jnc_ct_VariableMgr/jnc_ct_Variable.h
b3d3b8123e21709b2c60493034a7ea2752154dc3
[ "MIT" ]
permissive
kauktus/jancy
11c7da8d5bd40ea2d83af17b50f777caab72998f
a26219ace844d6bba1de8351635dcb01f0f0ef49
refs/heads/master
2020-08-22T21:45:31.335924
2019-10-14T14:49:30
2019-10-14T14:49:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,762
h
//.............................................................................. // // This file is part of the Jancy toolkit. // // Jancy is distributed under the MIT license. // For details see accompanying license.txt file, // the public copy of which is also available at: // http://tibbo.com/downloads/archive/jancy/license.txt // //.............................................................................. #pragma once #include "jnc_ct_ModuleItem.h" #include "jnc_ct_LlvmIrInsertPoint.h" namespace jnc { namespace ct { class Scope; class Field; class LeanDataPtrValidator; //.............................................................................. enum StdVariable { StdVariable_SjljFrame, StdVariable_GcShadowStackTop, StdVariable_GcSafePointTrigger, StdVariable_NullPtrCheckSink, StdVariable_AsyncScheduler, StdVariable__Count, }; // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . class Variable: public ModuleItem, public ModuleItemDecl, public ModuleItemInitializer { friend class VariableMgr; friend class FunctionMgr; friend class MemberBlock; friend class Property; friend class Type; friend class Parser; friend class Module; protected: Type* m_type; uint_t m_ptrTypeFlags; sl::BoxList<Token> m_constructor; Scope* m_scope; Field* m_tlsField; void* m_staticData; ref::Ptr<LeanDataPtrValidator> m_leanDataPtrValidator; sl::String m_llvmGlobalVariableName; llvm::GlobalVariable* m_llvmGlobalVariable; // for classes this is different from m_llvmValue llvm::Value* m_llvmValue; // GlobalVariable* / AllocaInst* / GEPInst* / CallInst* llvm::DIVariable_vn m_llvmDiDescriptor; // DIVariable / DIGlobalVariable llvm::AllocaInst* m_llvmPreLiftValue; // we have to keep original allocas until the very end public: LlvmIrInsertPoint m_liftInsertPoint; public: Variable(); Type* getType() { return m_type; } uint_t getPtrTypeFlags() { return m_ptrTypeFlags; } sl::ConstBoxList<Token> getConstructor() { return m_constructor; } Scope* getScope() { return m_scope; } Field* getTlsField() { ASSERT(m_storageKind == StorageKind_Tls); return m_tlsField; } void* getStaticData(); LeanDataPtrValidator* getLeanDataPtrValidator(); llvm::GlobalVariable* getLlvmGlobalVariable() { ASSERT(m_llvmGlobalVariable); return m_llvmGlobalVariable; } llvm::Value* getLlvmValue(); llvm::DIVariable_vn getLlvmDiDescriptor() { return m_llvmDiDescriptor; } virtual bool generateDocumentation( const sl::StringRef& outputDir, sl::String* itemXml, sl::String* indexXml ); protected: void prepareLlvmValue(); void prepareLeanDataPtrValidator(); void prepareStaticData(); }; // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . inline llvm::Value* Variable::getLlvmValue() { if (!m_llvmValue) prepareLlvmValue(); return m_llvmValue; } inline void* Variable::getStaticData() { if (!m_staticData) prepareStaticData(); return m_staticData; } inline LeanDataPtrValidator* Variable::getLeanDataPtrValidator() { if (!m_leanDataPtrValidator) prepareLeanDataPtrValidator(); return m_leanDataPtrValidator; } //.............................................................................. // after compiling and generating LLVM IR, we need to calc layout of TLS struct type // then we can insert instructions to get TLS block in every function and then replace // all alloca's temporarily representing TLS variables with GEPs into this TLS block struct TlsVariable { Variable* m_variable; llvm::AllocaInst* m_llvmAlloca; }; //.............................................................................. } // namespace ct } // namespace jnc
[ "vovkos@gmail.com" ]
vovkos@gmail.com
5554adcb243b8054878a4caced7b9b98189bd324
267ecfb3442568477fac416ddb6bd17c27b20bc7
/NM_Aitken_process/NM_Aitken_process/main.cpp
6abf5d68ced7c559c72831dcd0db32a9352215ae
[]
no_license
b0dah/Numerical_Methods
2978b48e5babde345f80326d3b8c889c384468cf
a92be01af539b8f1afbd7e412d62015748a28e05
refs/heads/master
2020-04-04T06:44:17.966947
2020-01-21T10:33:32
2020-01-21T10:33:32
155,755,199
0
0
null
null
null
null
UTF-8
C++
false
false
2,050
cpp
// // main.cpp // NM_Aitken_process // #include <iostream> #include <math.h> #include <iomanip> using namespace std; int it =1; const double pi = 3.1415; double sourceFunction(double x) { /*+*///return cos(pi*x); //return log(x); /*+*///return 3*x - 1; /*+*///return x*x - 1; /*+*///return x*x*x - 1;21567 /*+*///return sqrt(x)-1; /*+*/return sin(x); } double Derivative(double x0, double accuracy){ double h = accuracy; return (sourceFunction(x0 + h) - sourceFunction(x0 - h))/(2*h); } double transformatedFunction(double x, double x0){ // works with tranformation: fi = x - lambda*f(x); //return log(x); //return cos(pi*x); /*+*///return x - log(x); //return x - cos(pi*x/10); /*+*///return x-x+2; /*+*///return x - sqrt(x)+1; double res = sourceFunction(x); //cout << endl << Derivative(x0, 0.01)<<endl; res *= -1/Derivative(0.1, 0.01); res +=x; return res; } double AitkenProcessResult(double x0, double q, double eps) { double x1, x2, x_accelerated, x3; /* 1 */ x1 = transformatedFunction(x0, x0); x2 = transformatedFunction(x1, x0); while (true) { it++; /* 2 */ x_accelerated = ( x0*x2 - x1*x1 ) / (x2 - 2*x1 + x0); /* 3 */ x3 = transformatedFunction(x_accelerated, x0); /* 4 Checking */ if (fabs(x3 - x_accelerated) > (1-q)*eps/q ) { x0 = x_accelerated; x1 = x3; x2 = transformatedFunction(x1, x0); } else break; } return x3; // ret ksi } int main(int argc, const char * argv[]) { double a = 0.1, b = 7, delta_x = 0.05; //cout << "\n Answer is "<<AitkenProcessResult(3.9, 0.8, 0.001)<<endl; for (double x=a;x<b;x+=delta_x) if ( sourceFunction(x) * sourceFunction(x+delta_x) <= 0 ) { //cout << x << " "; cout << "\n Answer is "<< setprecision(15) << AitkenProcessResult(x, 0.9, 1e-8)<<endl; } cout << it << endl; return 0; }
[ "ries8898@gmail.com" ]
ries8898@gmail.com
8031b8c94704e058010e27c40eba037139d54cb8
8b7fdf5100ebd616eb5ac9f2b14d1c8d6c4c0d8e
/frameworks/bridge/common/inspector/inspect_canvas.h
2bf1581f568a060302923248dcb559c94906b259
[ "Apache-2.0" ]
permissive
openharmony-sig-ci/ace_ace_engine
13f2728bce323b67ac94a34d2e9c0a941227c402
05ebe2d6d2674777f5dc64fd735088dcf1a42cd9
refs/heads/master
2023-07-25T02:26:10.854405
2021-09-10T01:48:59
2021-09-10T01:48:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,216
h
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FOUNDATION_ACE_FRAMEWORKS_BRIDGE_COMMON_INSPECTOR_INSPECT_CANVAS_H #define FOUNDATION_ACE_FRAMEWORKS_BRIDGE_COMMON_INSPECTOR_INSPECT_CANVAS_H #include "frameworks/bridge/common/inspector/inspect_node.h" namespace OHOS::Ace::Framework { class InspectCanvas : public InspectNode { DECLARE_ACE_TYPE(InspectCanvas, InspectNode); public: InspectCanvas(NodeId nodeId, const std::string& nodeName); ~InspectCanvas() override = default; void PackAttrAndStyle() override; }; } // namespace OHOS::Ace::Framework #endif // FOUNDATION_ACE_FRAMEWORKS_BRIDGE_COMMON_INSPECTOR_INSPECT_CANVAS_H
[ "mamingshuai1@huawei.com" ]
mamingshuai1@huawei.com
14c30e641490d935ce2950a5d8d0f6ce75facd18
d85b1f3ce9a3c24ba158ca4a51ea902d152ef7b9
/testcases/CWE78_OS_Command_Injection/s07/CWE78_OS_Command_Injection__wchar_t_file_execlp_81a.cpp
b0a0c1df338cf260036f6a599dead51bb86ccbed
[]
no_license
arichardson/juliet-test-suite-c
cb71a729716c6aa8f4b987752272b66b1916fdaa
e2e8cf80cd7d52f824e9a938bbb3aa658d23d6c9
refs/heads/master
2022-12-10T12:05:51.179384
2022-11-17T15:41:30
2022-12-01T15:25:16
179,281,349
34
34
null
2022-12-01T15:25:18
2019-04-03T12:03:21
null
UTF-8
C++
false
false
3,201
cpp
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__wchar_t_file_execlp_81a.cpp Label Definition File: CWE78_OS_Command_Injection.strings.label.xml Template File: sources-sink-81a.tmpl.cpp */ /* * @description * CWE: 78 OS Command Injection * BadSource: file Read input from a file * GoodSource: Fixed string * Sinks: execlp * BadSink : execute command with wexeclp * Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference * * */ #include "std_testcase.h" #include "CWE78_OS_Command_Injection__wchar_t_file_execlp_81.h" #ifdef _WIN32 #define FILENAME "C:\\temp\\file.txt" #else #define FILENAME "/tmp/file.txt" #endif namespace CWE78_OS_Command_Injection__wchar_t_file_execlp_81 { #ifndef OMITBAD void bad() { wchar_t * data; wchar_t dataBuffer[100] = COMMAND_ARG2; data = dataBuffer; { /* Read input from a file */ size_t dataLen = wcslen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgetws(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgetws() failed"); /* Restore NUL terminator if fgetws fails */ data[dataLen] = L'\0'; } fclose(pFile); } } } const CWE78_OS_Command_Injection__wchar_t_file_execlp_81_base& baseObject = CWE78_OS_Command_Injection__wchar_t_file_execlp_81_bad(); baseObject.action(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ static void goodG2B() { wchar_t * data; wchar_t dataBuffer[100] = COMMAND_ARG2; data = dataBuffer; /* FIX: Append a fixed string to data (not user / external input) */ wcscat(data, L"*.*"); const CWE78_OS_Command_Injection__wchar_t_file_execlp_81_base& baseObject = CWE78_OS_Command_Injection__wchar_t_file_execlp_81_goodG2B(); baseObject.action(data); } void good() { goodG2B(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE78_OS_Command_Injection__wchar_t_file_execlp_81; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
[ "Alexander.Richardson@cl.cam.ac.uk" ]
Alexander.Richardson@cl.cam.ac.uk
6375db9b5981014196d6bc3bcec4af0587306538
b39a908104187846d93ccadc1bf979124d989fd4
/sources/lib_fdr.cc
d0a4b777b8029fe153f940587887483a9cea1c1f
[ "MIT" ]
permissive
divvany/AMCCP_CasperFDR
cf3114d81d000add6eac34cec2a08a4c43b0bcfa
becc026bea245ef6a19c4546668b0c58a3235f93
refs/heads/master
2020-03-22T00:38:02.970402
2019-05-16T07:43:00
2019-05-16T07:43:00
139,256,193
2
0
null
null
null
null
UTF-8
C++
false
false
6,731
cc
#include <iostream> #include <fdr/fdr.h> static void describe_behaviour( const FDR::Session& session, const FDR::Assertions::DebugContext& debug_context, const FDR::Assertions::Behaviour& behaviour, unsigned int indent, const bool recurse) { std::cout << "behaviour_type:"; indent += 2; if (dynamic_cast<const FDR::Assertions::ExplicitDivergenceBehaviour*>(&behaviour)) std::cout << "explicit divergence after trace"; else if (dynamic_cast<const FDR::Assertions::IrrelevantBehaviour*>(&behaviour)) std::cout << "irrelevant"; else if (auto loop = dynamic_cast<const FDR::Assertions::LoopBehaviour*>(&behaviour)) std::cout << "loops after index" << loop->loop_index(); else if (auto min_acceptance = dynamic_cast<const FDR::Assertions::MinAcceptanceBehaviour*>(&behaviour)) { std::cout << "minimal acceptance refusing {"; for (const FDR::LTS::CompiledEvent event : min_acceptance->min_acceptance()) std::cout << session.uncompile_event(event)->to_string() << "*"; std::cout << "}"; } else if (auto segmented = dynamic_cast<const FDR::Assertions::SegmentedBehaviour*>(&behaviour)) { std::cout << "Segmented behaviour consisting of:\n"; for (const std::shared_ptr<FDR::Assertions::Behaviour>& child : segmented->prior_sections()) describe_behaviour(session, debug_context, *child, indent + 2, false); describe_behaviour(session, debug_context, *segmented->last(), indent + 2, false); } else if (auto trace = dynamic_cast<const FDR::Assertions::TraceBehaviour*>(&behaviour)) std::cout << "performs event " << session.uncompile_event(trace->error_event())->to_string(); std::cout << std::endl; std::cout << std::string(indent, ' ') << "Trace:"; for (const FDR::LTS::CompiledEvent event : behaviour.trace()) { if ((event != FDR::LTS::INVALID_EVENT) && (event != FDR::LTS::TAU)) std::cout << session.uncompile_event(event)->to_string() << "*"; } std::cout << std::endl; std::cout << std::string(indent, ' ') << "End"; std::cout << std::endl; if (recurse) { for (const std::shared_ptr<FDR::Assertions::Behaviour>& child : debug_context.behaviour_children(behaviour)) { if(indent > 9) { break; } describe_behaviour(session, debug_context, *child, indent + 2, true); } } } static void describe_counterexample( const FDR::Session& session, const FDR::Assertions::Counterexample& counterexample) { std::cout << "Counterexample_type:"; if (dynamic_cast<const FDR::Assertions::DeadlockCounterexample*>( &counterexample)) std::cout << "deadlock"; else if (dynamic_cast<const FDR::Assertions::DeterminismCounterexample*>( &counterexample)) std::cout << "determinism"; else if (dynamic_cast<const FDR::Assertions::DivergenceCounterexample*>( &counterexample)) std::cout << "divergence"; else if (auto min_acceptance = dynamic_cast<const FDR::Assertions::MinAcceptanceCounterexample*>( &counterexample)) { std::cout << "minimal acceptance refusing {"; for (const FDR::LTS::CompiledEvent event : min_acceptance->min_acceptance()) std::cout << session.uncompile_event(event)->to_string() << "*"; std::cout << "}"; } else if (auto trace = dynamic_cast<const FDR::Assertions::TraceCounterexample*>( &counterexample)) std::cout << "trace with event " << session.uncompile_event( trace->error_event())->to_string(); else std::cout << "unknown"; std::cout << std::endl; if (auto refinement_counterexample = dynamic_cast<const FDR::Assertions::RefinementCounterexample*>( &counterexample)) { FDR::Assertions::DebugContext debug_context(*refinement_counterexample, false); debug_context.initialise(nullptr); describe_behaviour(session, debug_context, *debug_context.root_behaviours()[0], 2, true); describe_behaviour(session, debug_context, *debug_context.root_behaviours()[1], 2, true); } else if (auto property_counterexample = dynamic_cast<const FDR::Assertions::PropertyCounterexample*>( &counterexample)) { FDR::Assertions::DebugContext debug_context(*property_counterexample, false); debug_context.initialise(nullptr); describe_behaviour(session, debug_context, *debug_context.root_behaviours()[0], 2, true); } } static int main_function(int& argc, char**& argv) { if (!FDR::has_valid_license()) { std::cout << "Please run refines or FDR4 to obtain a valid license before running this." << std::endl; return EXIT_FAILURE; } std::cout << "Using " << FDR::version() << std::endl; if (argc != 2) { std::cerr << "Expected exactly one argument." << std::endl; return EXIT_FAILURE; } const std::string file_name = argv[1]; std::cout << "Loading " << file_name << std::endl; FDR::Session session; try { session.load_file(file_name); } catch (const FDR::FileLoadError& error) { std::cout << "Could not load. Error: " << error.what() << std::endl; return EXIT_FAILURE; } for (const std::shared_ptr<FDR::Assertions::Assertion>& assertion : session.assertions()) { std::cout << "Checking:" << assertion->to_string() << std::endl; try { assertion->execute(nullptr); std::cout << "Result:"; std::cout << (assertion->passed() ? "Passed" : "Failed") << ", found " << assertion->counterexamples().size() << " counterexamples" << std::endl; for (const std::shared_ptr<FDR::Assertions::Counterexample>& counterexample : assertion->counterexamples()) { describe_counterexample(session, *counterexample); } } catch (const FDR::InputFileError& error) { std::cout << "Could not compile: " << error.what() << std::endl; return EXIT_FAILURE; } } return EXIT_SUCCESS; } int main(int argc, char** argv) { FDR::library_init(&argc, &argv); int return_code = main_function(argc, argv); FDR::library_exit(); return return_code; }
[ "andreeascurtu@rocketmail.com" ]
andreeascurtu@rocketmail.com