hexsha stringlengths 40 40 | size int64 7 1.05M | ext stringclasses 13
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 269 | max_stars_repo_name stringlengths 5 108 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 269 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 9 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 269 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 9 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 7 1.05M | avg_line_length float64 1.21 330k | max_line_length int64 6 990k | alphanum_fraction float64 0.01 0.99 | author_id stringlengths 2 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e4743715c23329c9093f27627c9886744d797f27 | 661 | cc | C++ | friend-exceptions.cc | waybeforenow/modular-friend | 12e35a49a2a3cd2d6482293788ee5223d981f8cf | [
"MIT"
] | null | null | null | friend-exceptions.cc | waybeforenow/modular-friend | 12e35a49a2a3cd2d6482293788ee5223d981f8cf | [
"MIT"
] | null | null | null | friend-exceptions.cc | waybeforenow/modular-friend | 12e35a49a2a3cd2d6482293788ee5223d981f8cf | [
"MIT"
] | null | null | null | #include "friend-exceptions.h"
#include <exception>
namespace Friend {
runtime_error::runtime_error(const char* file, const size_t line)
: what_str(new std::string(file)) {
what_str->push_back(':');
what_str->append(std::to_string(line));
}
runtime_error::runtime_error(const char* what, const char* file,
const size_t line)
: what_str(new std::string(file)) {
what_str->push_back(':');
what_str->append(std::to_string(line));
what_str->append(" (");
what_str->append(what);
what_str->push_back(')');
}
const char* runtime_error::what() const noexcept { return what_str->c_str(); }
} // namespace Friend
| 26.44 | 78 | 0.665658 | waybeforenow |
e474596427aeb62785795d119a336d2c45e0b672 | 3,487 | cpp | C++ | mysql-server/storage/ndb/src/common/util/ndb_az31.cpp | silenc3502/MYSQL-Arch-Doc-Summary | fcc6bb65f72a385b9f56debc9b2c00cee5914bae | [
"MIT"
] | null | null | null | mysql-server/storage/ndb/src/common/util/ndb_az31.cpp | silenc3502/MYSQL-Arch-Doc-Summary | fcc6bb65f72a385b9f56debc9b2c00cee5914bae | [
"MIT"
] | null | null | null | mysql-server/storage/ndb/src/common/util/ndb_az31.cpp | silenc3502/MYSQL-Arch-Doc-Summary | fcc6bb65f72a385b9f56debc9b2c00cee5914bae | [
"MIT"
] | null | null | null | /* Copyright (c) 2020, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "util/ndb_az31.h"
const ndb_az31::byte ndb_az31::header[512] = {
254, 3, 1, 16, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
};
int ndb_az31::write_header(output_iterator* out)
{
if (out->size() < sizeof(header))
return 1; // Need more space
memcpy(out->begin(), header, sizeof(header));
out->advance(sizeof(header));
return 0;
}
int ndb_az31::write_trailer(output_iterator* out, int pad_len) const
{
if (!m_have_data_size)
return -1;
if (!m_have_data_crc32)
return -1;
if (out->size() < 12)
return 1; // Need more space
byte* p = out->begin();
//
p[0] = m_data_crc32 & 0xff;
p[1] = (m_data_crc32 & 0xff00) >> 8;
p[2] = (m_data_crc32 & 0xff0000) >> 16;
p[3] = (m_data_crc32 & 0xff000000) >> 24;
//
p[4] = m_data_size & 0xff;
p[5] = (m_data_size & 0xff00) >> 8;
p[6] = (m_data_size & 0xff0000) >> 16;
p[7] = (m_data_size & 0xff000000) >> 24;
//
memcpy(p + 8, "DBDN", 4);
memset(p + 12, 0, pad_len);
out->advance(12 + pad_len);
out->set_last();
return 0;
}
int ndb_az31::detect_header(input_iterator* in)
{
if (in->size() < 3)
return in->last() ? -1 : 1;
if (memcmp(in->cbegin(), header, 3) != 0)
return -1;
return 0;
}
int ndb_az31::read_header(input_iterator* in)
{
if (in->size() < sizeof(header))
return in->last() ? -1 : 1;
if (memcmp(in->cbegin(), header, sizeof(header)) != 0)
return -1;
in->advance(sizeof(header));
return 0;
}
int ndb_az31::read_trailer(input_reverse_iterator* in)
{
const byte* pbeg = in->cend();
const byte* pend = in->cbegin();
while (pbeg < pend && pend[-1] == 0) pend--;
if (pend - pbeg < 12)
return -1;
pend -= 12;
if (memcmp(pend + 8, "DBDN", 4) != 0)
return -1;
m_data_size = Uint32(pend[4]) |
(Uint32(pend[5]) << 8) |
(Uint32(pend[6]) << 16) |
(Uint32(pend[7]) << 24);
m_data_crc32 = Uint32(pend[0]) |
(Uint32(pend[1]) << 8) |
(Uint32(pend[2]) << 16) |
(Uint32(pend[3]) << 24);
in->advance(in->cbegin() - pend);
return 0;
}
| 31.7 | 78 | 0.60195 | silenc3502 |
e4772c060b481e349a963de360f6565102585ce0 | 7,379 | cpp | C++ | dynamic_vino_lib/src/inferences/object_segmentation.cpp | pqLee/ros2_openvino_toolkit | 6ba38446bf9778567be2df14d1141c3669e7ac92 | [
"Apache-2.0"
] | 120 | 2018-09-30T05:36:25.000Z | 2022-01-28T17:52:47.000Z | dynamic_vino_lib/src/inferences/object_segmentation.cpp | sammysun0711/ros2_openvino_toolkit | f6ed1d367e452c8672d41d739243bdf59ea6f578 | [
"Apache-2.0"
] | 151 | 2018-10-16T17:46:24.000Z | 2022-03-11T14:38:54.000Z | dynamic_vino_lib/src/inferences/object_segmentation.cpp | sammysun0711/ros2_openvino_toolkit | f6ed1d367e452c8672d41d739243bdf59ea6f578 | [
"Apache-2.0"
] | 83 | 2018-09-30T05:09:35.000Z | 2022-01-26T04:56:09.000Z | // Copyright (c) 2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @brief a header file with declaration of ObjectSegmentation class and
* ObjectSegmentationResult class
* @file object_segmentation.cpp
*/
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <random>
#include "dynamic_vino_lib/inferences/object_segmentation.hpp"
#include "dynamic_vino_lib/outputs/base_output.hpp"
#include "dynamic_vino_lib/slog.hpp"
// ObjectSegmentationResult
dynamic_vino_lib::ObjectSegmentationResult::ObjectSegmentationResult(const cv::Rect &location)
: Result(location)
{
}
// ObjectSegmentation
dynamic_vino_lib::ObjectSegmentation::ObjectSegmentation(double show_output_thresh)
: show_output_thresh_(show_output_thresh), dynamic_vino_lib::BaseInference()
{
}
dynamic_vino_lib::ObjectSegmentation::~ObjectSegmentation() = default;
void dynamic_vino_lib::ObjectSegmentation::loadNetwork(
const std::shared_ptr<Models::ObjectSegmentationModel> network)
{
slog::info << "Loading Network: " << network->getModelCategory() << slog::endl;
valid_model_ = network;
setMaxBatchSize(network->getMaxBatchSize());
}
/**
* Deprecated!
* This function only support OpenVINO version <=2018R5
*/
bool dynamic_vino_lib::ObjectSegmentation::enqueue_for_one_input(
const cv::Mat &frame,
const cv::Rect &input_frame_loc)
{
if (width_ == 0 && height_ == 0)
{
width_ = frame.cols;
height_ = frame.rows;
}
if (!dynamic_vino_lib::BaseInference::enqueue<u_int8_t>(frame, input_frame_loc, 1, 0,
valid_model_->getInputName()))
{
return false;
}
Result r(input_frame_loc);
results_.clear();
results_.emplace_back(r);
return true;
}
bool dynamic_vino_lib::ObjectSegmentation::enqueue(
const cv::Mat &frame,
const cv::Rect &input_frame_loc)
{
if (width_ == 0 && height_ == 0)
{
width_ = frame.cols;
height_ = frame.rows;
}
if (valid_model_ == nullptr || getEngine() == nullptr)
{
throw std::logic_error("Model or Engine is not set correctly!");
return false;
}
if (enqueued_frames_ >= valid_model_->getMaxBatchSize())
{
slog::warn << "Number of " << getName() << "input more than maximum(" <<
max_batch_size_ << ") processed by inference" << slog::endl;
return false;
}
if (!valid_model_->enqueue(getEngine(), frame, input_frame_loc))
{
return false;
}
enqueued_frames_ += 1;
return true;
}
bool dynamic_vino_lib::ObjectSegmentation::submitRequest()
{
return dynamic_vino_lib::BaseInference::submitRequest();
}
bool dynamic_vino_lib::ObjectSegmentation::fetchResults()
{
bool can_fetch = dynamic_vino_lib::BaseInference::fetchResults();
if (!can_fetch)
{
return false;
}
bool found_result = false;
results_.clear();
InferenceEngine::InferRequest::Ptr request = getEngine()->getRequest();
slog::debug << "Analyzing Detection results..." << slog::endl;
std::string detection_output = valid_model_->getOutputName("detection");
std::string mask_output = valid_model_->getOutputName("masks");
const InferenceEngine::Blob::Ptr do_blob = request->GetBlob(detection_output.c_str());
const auto do_data = do_blob->buffer().as<float *>();
const auto masks_blob = request->GetBlob(mask_output.c_str());
const auto masks_data = masks_blob->buffer().as<float *>();
const size_t output_w = masks_blob->getTensorDesc().getDims().at(3);
const size_t output_h = masks_blob->getTensorDesc().getDims().at(2);
const size_t output_des = masks_blob-> getTensorDesc().getDims().at(1);
const size_t output_extra = masks_blob-> getTensorDesc().getDims().at(0);
slog::debug << "output w " << output_w<< slog::endl;
slog::debug << "output h " << output_h << slog::endl;
slog::debug << "output description " << output_des << slog::endl;
slog::debug << "output extra " << output_extra << slog::endl;
const float * detections = request->GetBlob(detection_output)->buffer().as<float *>();
std::vector<std::string> &labels = valid_model_->getLabels();
slog::debug << "label size " <<labels.size() << slog::endl;
cv::Mat inImg, resImg, maskImg(output_h, output_w, CV_8UC3);
cv::Mat colored_mask(output_h, output_w, CV_8UC3);
cv::Rect roi = cv::Rect(0, 0, output_w, output_h);
for (int rowId = 0; rowId < output_h; ++rowId)
{
for (int colId = 0; colId < output_w; ++colId)
{
std::size_t classId = 0;
float maxProb = -1.0f;
if (output_des < 2) { // assume the output is already ArgMax'ed
classId = static_cast<std::size_t>(detections[rowId * output_w + colId]);
for (int ch = 0; ch < colored_mask.channels();++ch){
colored_mask.at<cv::Vec3b>(rowId, colId)[ch] = colors_[classId][ch];
}
//classId = static_cast<std::size_t>(predictions[rowId * output_w + colId]);
} else {
for (int chId = 0; chId < output_des; ++chId)
{
float prob = detections[chId * output_h * output_w + rowId * output_w+ colId];
//float prob = predictions[chId * output_h * output_w + rowId * output_w+ colId];
if (prob > maxProb)
{
classId = chId;
maxProb = prob;
}
}
while (classId >= colors_.size())
{
static std::mt19937 rng(classId);
std::uniform_int_distribution<int> distr(0, 255);
cv::Vec3b color(distr(rng), distr(rng), distr(rng));
colors_.push_back(color);
}
if(maxProb > 0.5){
for (int ch = 0; ch < colored_mask.channels();++ch){
colored_mask.at<cv::Vec3b>(rowId, colId)[ch] = colors_[classId][ch];
}
}
}
}
}
const float alpha = 0.7f;
Result result(roi);
result.mask_ = colored_mask;
found_result = true;
results_.emplace_back(result);
return true;
}
int dynamic_vino_lib::ObjectSegmentation::getResultsLength() const
{
return static_cast<int>(results_.size());
}
const dynamic_vino_lib::Result *
dynamic_vino_lib::ObjectSegmentation::getLocationResult(int idx) const
{
return &(results_[idx]);
}
const std::string dynamic_vino_lib::ObjectSegmentation::getName() const
{
return valid_model_->getModelCategory();
}
void dynamic_vino_lib::ObjectSegmentation::observeOutput(
const std::shared_ptr<Outputs::BaseOutput> &output)
{
if (output != nullptr)
{
output->accept(results_);
}
}
const std::vector<cv::Rect> dynamic_vino_lib::ObjectSegmentation::getFilteredROIs(
const std::string filter_conditions) const
{
if (!filter_conditions.empty())
{
slog::err << "Object segmentation does not support filtering now! "
<< "Filter conditions: " << filter_conditions << slog::endl;
}
std::vector<cv::Rect> filtered_rois;
for (auto res : results_)
{
filtered_rois.push_back(res.getLocation());
}
return filtered_rois;
}
| 31.4 | 94 | 0.681122 | pqLee |
e4783050ca55769bc19dd05305c9fbbc1033f357 | 37,343 | cxx | C++ | opal-3.16.2/plugins/video/VP8-WebM/vp8_webm.cxx | wwl33695/myopal | d302113c8ad8156b3392ce514cde491cf42d51af | [
"MIT"
] | null | null | null | opal-3.16.2/plugins/video/VP8-WebM/vp8_webm.cxx | wwl33695/myopal | d302113c8ad8156b3392ce514cde491cf42d51af | [
"MIT"
] | null | null | null | opal-3.16.2/plugins/video/VP8-WebM/vp8_webm.cxx | wwl33695/myopal | d302113c8ad8156b3392ce514cde491cf42d51af | [
"MIT"
] | null | null | null | /*
* VP8 (WebM) video codec Plugin codec for OPAL
*
* Copyright (C) 2012 Vox Lucida Pty Ltd, All Rights Reserved
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is OPAL Library.
*
* The Initial Developer of the Original Code is Vox Lucida Pty Ltd
*
* Added with funding from Requestec, Inc.
*
* Contributor(s): Robert Jongbloed (robertj@voxlucida.com.au)
*
* $Revision: 33861 $
* $Author: rjongbloed $
* $Date: 2015-08-09 18:58:22 +0100 (Sun, 09 Aug 2015) $
*/
#include "../common/platform.h"
#define MY_CODEC VP8 // Name of codec (use C variable characters)
#define OPAL_SIP 1
#include "../../../src/codec/vp8mf_inc.cxx.in"
#include <codec/opalplugin.hpp>
#include "../common/critsect.h"
#ifdef _MSC_VER
#pragma warning(disable:4505)
#define snprintf _snprintf
#endif
/* Building notes for Windows.
As of v1.3.0, no prebuilt libraries seem to be available, you must build it
from scratch, and to do that you must have Cygwin installed.
After unpacking the source into opal/plugins/video/VP8-WebM/vpx-vp8, run
cygwin and go to that directory. Then, depending on the Visual Studio
version you with to compile against, XX=10, XX=11 or XX=12
mkdir vsXX_32
cd vsXX_32
../configure --target=x86-win32-vsXX
make
./vpx.sln
And finally, batch build vpx Debug and Release.
And if desired (XX=11 or XX=12 only) again for 64-bit:
cd ..
mkdir vsXX_64
cd vsXX_64
../configure --target=x86_64-win64-vsXX
make
*/
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
#include "vpx/vpx_decoder.h"
#include "vpx/vp8dx.h"
#include <vector>
#include <stdio.h>
/* Error concelment (handling missing data) does not appear to work. Or we are
not using it right. Either way disable it or we eventually get a Error 5 in
vpx_codec_decode - Bitstream not supported by this decoder.
*/
#ifdef VPX_CODEC_USE_ERROR_CONCEALMENT
#undef VPX_CODEC_USE_ERROR_CONCEALMENT
#endif
#define HAS_OUTPUT_PARTITION (defined(VPX_CODEC_CAP_OUTPUT_PARTITION) && defined(VPX_CODEC_USE_OUTPUT_PARTITION))
#define INCLUDE_OM_CUSTOM_PACKETIZATION 1
class VP8_CODEC { };
PLUGINCODEC_CONTROL_LOG_FUNCTION_DEF
PLUGINCODEC_LICENSE(
"Robert Jongbloed, Vox Lucida Pty.Ltd.", // source code author
"1.0", // source code version
"robertj@voxlucida.com.au", // source code email
"http://www.voxlucida.com.au", // source code URL
"Copyright (C) 2011 by Vox Lucida Pt.Ltd., All Rights Reserved", // source code copyright
"MPL 1.0", // source code license
PluginCodec_License_MPL, // source code license
"VP8 Video Codec", // codec description
"James Bankoski, John Koleszar, Lou Quillio, Janne Salonen, "
"Paul Wilkins, Yaowu Xu, all from Google Inc.", // codec author
"8", // codec version
"jimbankoski@google.com, jkoleszar@google.com, "
"louquillio@google.com, jsalonen@google.com, "
"paulwilkins@google.com, yaowu@google.com", // codec email
"http://google.com", // codec URL
"Copyright (c) 2010, 2011, Google Inc.", // codec copyright information
"Copyright (c) 2010, 2011, Google Inc.", // codec license
PluginCodec_License_BSD // codec license code
);
///////////////////////////////////////////////////////////////////////////////
static struct PluginCodec_Option const MaxFR =
{
PluginCodec_IntegerOption, // Option type
MaxFrameRateName, // User visible name
false, // User Read/Only flag
PluginCodec_MinMerge, // Merge mode
STRINGIZE(MAX_FR_SDP), // Initial value
MaxFrameRateSDP, // FMTP option name
STRINGIZE(MAX_FR_SDP), // FMTP default value
0, // H.245 generic capability code and bit mask
STRINGIZE(MIN_FR_SDP), // Minimum value
STRINGIZE(MAX_FR_SDP) // Maximum value
};
static struct PluginCodec_Option const MaxFS =
{
PluginCodec_IntegerOption, // Option type
MaxFrameSizeName, // User visible name
false, // User Read/Only flag
PluginCodec_MinMerge, // Merge mode
STRINGIZE(MAX_FS_SDP), // Initial value
MaxFrameSizeSDP, // FMTP option name
STRINGIZE(MAX_FS_SDP), // FMTP default value
0, // H.245 generic capability code and bit mask
STRINGIZE(MIN_FS_SDP), // Minimum value
STRINGIZE(MAX_FS_SDP) // Maximum value
};
#if INCLUDE_OM_CUSTOM_PACKETIZATION
static struct PluginCodec_Option const MaxFrameSizeOM =
{
PluginCodec_StringOption, // Option type
"SIP/SDP Max Frame Size", // User visible name
true, // User Read/Only flag
PluginCodec_NoMerge, // Merge mode
"", // Initial value
"x-mx-max-size", // FMTP option name
"" // FMTP default value (as per RFC)
};
#endif
static struct PluginCodec_Option const TemporalSpatialTradeOff =
{
PluginCodec_IntegerOption, // Option type
PLUGINCODEC_OPTION_TEMPORAL_SPATIAL_TRADE_OFF, // User visible name
false, // User Read/Only flag
PluginCodec_AlwaysMerge, // Merge mode
"31", // Initial value
NULL, // FMTP option name
NULL, // FMTP default value
0, // H.245 generic capability code and bit mask
"1", // Minimum value
"31" // Maximum value
};
static struct PluginCodec_Option const SpatialResampling =
{
PluginCodec_BoolOption, // Option type
SpatialResamplingsName, // User visible name
false, // User Read/Only flag
PluginCodec_AndMerge, // Merge mode
"0", // Initial value
SpatialResamplingsSDP, // FMTP option name
"0", // FMTP default value
0 // H.245 generic capability code and bit mask
};
static struct PluginCodec_Option const SpatialResamplingUp =
{
PluginCodec_IntegerOption, // Option type
SpatialResamplingUpName, // User visible name
false, // User Read/Only flag
PluginCodec_AlwaysMerge, // Merge mode
"100", // Initial value
NULL, // FMTP option name
NULL, // FMTP default value
0, // H.245 generic capability code and bit mask
"0", // Minimum value
"100" // Maximum value
};
static struct PluginCodec_Option const SpatialResamplingDown =
{
PluginCodec_IntegerOption, // Option type
SpatialResamplingDownName, // User visible name
false, // User Read/Only flag
PluginCodec_AlwaysMerge, // Merge mode
"0", // Initial value
NULL, // FMTP option name
NULL, // FMTP default value
0, // H.245 generic capability code and bit mask
"0", // Minimum value
"100" // Maximum value
};
static struct PluginCodec_Option const PictureIDSize =
{
PluginCodec_EnumOption, // Option type
PictureIDSizeName, // User visible name
false, // User Read/Only flag
PluginCodec_AlwaysMerge, // Merge mode
"None", // Initial value
NULL, // FMTP option name
NULL, // FMTP default value
0, // H.245 generic capability code and bit mask
"None:Byte:Word" // Enumeration
};
#if HAS_OUTPUT_PARTITION
static struct PluginCodec_Option const OutputPartition =
{
PluginCodec_BoolOption, // Option type
"Output Partition", // User visible name
false, // User Read/Only flag
PluginCodec_AndMerge, // Merge mode
"0", // Initial value
NULL, // FMTP option name
NULL, // FMTP default value
0 // H.245 generic capability code and bit mask
};
#endif
static struct PluginCodec_Option const * OptionTableRFC[] = {
&MaxFR,
&MaxFS,
&PictureIDSize,
#if HAS_OUTPUT_PARTITION
&OutputPartition,
#endif
&TemporalSpatialTradeOff,
&SpatialResampling,
&SpatialResamplingUp,
&SpatialResamplingDown,
NULL
};
#if INCLUDE_OM_CUSTOM_PACKETIZATION
static struct PluginCodec_Option const * OptionTableOM[] = {
&MaxFrameSizeOM,
&TemporalSpatialTradeOff,
&SpatialResampling,
&SpatialResamplingUp,
&SpatialResamplingDown,
NULL
};
#endif
///////////////////////////////////////////////////////////////////////////////
class VP8Format : public PluginCodec_VideoFormat<VP8_CODEC>
{
private:
typedef PluginCodec_VideoFormat<VP8_CODEC> BaseClass;
public:
VP8Format(const char * formatName, const char * payloadName, const char * description, OptionsTable options)
: BaseClass(formatName, payloadName, description, MaxBitRate, options)
{
#ifdef VPX_CODEC_USE_ERROR_CONCEALMENT
if ((vpx_codec_get_caps(vpx_codec_vp8_dx()) & VPX_CODEC_CAP_ERROR_CONCEALMENT) != 0)
m_flags |= PluginCodec_ErrorConcealment; // Prevent video update request on packet loss
#endif
}
};
class VP8FormatRFC : public VP8Format
{
public:
VP8FormatRFC()
: VP8Format(VP8FormatName, VP8EncodingName, "VP8 Video Codec (RFC)", OptionTableRFC)
{
}
virtual bool IsValidForProtocol(const char * protocol) const
{
return strcasecmp(protocol, PLUGINCODEC_OPTION_PROTOCOL_SIP) == 0;
}
virtual bool ToNormalised(OptionMap & original, OptionMap & changed) const
{
return MyToNormalised(original, changed);
}
virtual bool ToCustomised(OptionMap & original, OptionMap & changed) const
{
return MyToCustomised(original, changed);
}
};
static VP8FormatRFC const VP8MediaFormatInfoRFC;
///////////////////////////////////////////////////////////////////////////////
#if INCLUDE_OM_CUSTOM_PACKETIZATION
class VP8FormatOM : public VP8Format
{
public:
VP8FormatOM()
: VP8Format("VP8-OM", "X-MX-VP8", "VP8 Video Codec (Open Market)", OptionTableOM)
{
}
virtual bool IsValidForProtocol(const char * protocol) const
{
return strcasecmp(protocol, PLUGINCODEC_OPTION_PROTOCOL_SIP) == 0;
}
virtual bool ToNormalised(OptionMap & original, OptionMap & changed) const
{
OptionMap::iterator it = original.find(MaxFrameSizeOM.m_name);
if (it != original.end() && !it->second.empty()) {
std::stringstream strm(it->second);
unsigned maxWidth, maxHeight;
char x;
strm >> maxWidth >> x >> maxHeight;
if (maxWidth < 32 || maxHeight < 32) {
PTRACE(1, MY_CODEC_LOG, "Invalid " << MaxFrameSizeOM.m_name << ", was \"" << it->second << '"');
return false;
}
ClampMax(maxWidth, original, changed, PLUGINCODEC_OPTION_MAX_RX_FRAME_WIDTH);
ClampMax(maxHeight, original, changed, PLUGINCODEC_OPTION_MAX_RX_FRAME_HEIGHT);
ClampMax(maxWidth, original, changed, PLUGINCODEC_OPTION_MIN_RX_FRAME_WIDTH);
ClampMax(maxHeight, original, changed, PLUGINCODEC_OPTION_MIN_RX_FRAME_HEIGHT);
}
return true;
}
virtual bool ToCustomised(OptionMap & original, OptionMap & changed) const
{
unsigned maxWidth = original.GetUnsigned(PLUGINCODEC_OPTION_MAX_RX_FRAME_WIDTH);
unsigned maxHeight = original.GetUnsigned(PLUGINCODEC_OPTION_MAX_RX_FRAME_HEIGHT);
std::stringstream strm;
strm << maxWidth << 'x' << maxHeight;
Change(strm.str().c_str(), original, changed, MaxFrameSizeOM.m_name);
return true;
}
};
static VP8FormatOM const VP8MediaFormatInfoOM;
#endif // INCLUDE_OM_CUSTOM_PACKETIZATION
///////////////////////////////////////////////////////////////////////////////
static bool IsError(vpx_codec_err_t err, const char * fn)
{
if (err == VPX_CODEC_OK)
return false;
PTRACE(1, MY_CODEC_LOG, "Error " << err << " in " << fn << " - " << vpx_codec_err_to_string(err));
return true;
}
#define IS_ERROR(fn, args) IsError(fn args, #fn)
enum Orientation {
PortraitLeft,
LandscapeUp,
PortraitRight,
LandscapeDown,
OrientationMask = 3,
OrientationExtHdrShift = 4,
OrientationPktHdrShift = 5
};
///////////////////////////////////////////////////////////////////////////////
class VP8Encoder : public PluginVideoEncoder<VP8_CODEC>
{
private:
typedef PluginVideoEncoder<VP8_CODEC> BaseClass;
protected:
vpx_codec_enc_cfg_t m_config;
unsigned m_initFlags;
vpx_codec_ctx_t m_codec;
vpx_codec_iter_t m_iterator;
const vpx_codec_cx_pkt_t * m_packet;
size_t m_offset;
CriticalSection m_mutex;
public:
VP8Encoder(const PluginCodec_Definition * defn)
: BaseClass(defn)
, m_initFlags(0)
, m_iterator(NULL)
, m_packet(NULL)
, m_offset(0)
{
memset(&m_codec, 0, sizeof(m_codec));
}
~VP8Encoder()
{
vpx_codec_destroy(&m_codec);
}
virtual bool Construct()
{
if (IS_ERROR(vpx_codec_enc_config_default, (vpx_codec_vp8_cx(), &m_config, 0)))
return false;
m_maxBitRate = m_config.rc_target_bitrate*1000;
m_config.g_w = 0; // Forces OnChangedOptions to initialise encoder
m_config.g_h = 0;
m_config.g_error_resilient = 1;
m_config.g_pass = VPX_RC_ONE_PASS;
m_config.g_lag_in_frames = 0;
m_config.rc_end_usage = VPX_CBR;
m_config.g_timebase.num = 1;
m_config.g_timebase.den = PLUGINCODEC_VIDEO_CLOCK;
if (!OnChangedOptions())
return false;
PTRACE(4, MY_CODEC_LOG, "Encoder opened: " << vpx_codec_version_str() << ", revision $Revision: 33861 $");
return true;
}
virtual bool SetOption(const char * optionName, const char * optionValue)
{
if (strcasecmp(optionName, SpatialResampling.m_name) == 0)
return SetOptionBoolean(m_config.rc_resize_allowed, optionValue);
if (strcasecmp(optionName, SpatialResamplingUp.m_name) == 0)
return SetOptionUnsigned(m_config.rc_resize_up_thresh, optionValue, 0, 100);
if (strcasecmp(optionName, SpatialResamplingDown.m_name) == 0)
return SetOptionUnsigned(m_config.rc_resize_down_thresh, optionValue, 0, 100);
return BaseClass::SetOption(optionName, optionValue);
}
virtual bool OnChangedOptions()
{
WaitAndSignal lock(m_mutex);
m_config.kf_mode = VPX_KF_AUTO;
if (m_keyFramePeriod != 0)
m_config.kf_min_dist = m_config.kf_max_dist = m_keyFramePeriod;
else {
m_config.kf_min_dist = 0;
m_config.kf_max_dist = 10*PLUGINCODEC_VIDEO_CLOCK/m_frameTime; // No slower than once every 10 seconds
}
m_config.rc_target_bitrate = m_maxBitRate/1000;
// Take simple temporal/spatial trade off and set multiple variables
m_config.rc_dropframe_thresh = (31-m_tsto)*2; // m_tsto==31 is maintain frame rate, so threshold is zero
m_config.rc_resize_allowed = m_tsto < 16;
m_config.rc_max_quantizer = 32 + m_tsto;
if (m_config.g_w == m_width && m_config.g_h == m_height)
return !IS_ERROR(vpx_codec_enc_config_set, (&m_codec, &m_config));
if (((m_width|m_height) & 1) != 0) {
PTRACE(1, MY_CODEC_LOG, "Odd width or height provided: " << m_width << 'x' << m_height);
return false;
}
m_config.g_w = m_width;
m_config.g_h = m_height;
vpx_codec_destroy(&m_codec);
return !IS_ERROR(vpx_codec_enc_init, (&m_codec, vpx_codec_vp8_cx(), &m_config, m_initFlags));
}
bool NeedEncode()
{
if (m_packet != NULL)
return false;
WaitAndSignal lock(m_mutex);
while ((m_packet = vpx_codec_get_cx_data(&m_codec, &m_iterator)) != NULL) {
if (m_packet->kind == VPX_CODEC_CX_FRAME_PKT)
return false;
}
m_iterator = NULL;
return true;
}
virtual int GetStatistics(char * bufferPtr, unsigned bufferSize)
{
size_t len = BaseClass::GetStatistics(bufferPtr, bufferSize);
WaitAndSignal lock(m_mutex);
int quality = -1;
IS_ERROR(vpx_codec_control_VP8E_GET_LAST_QUANTIZER_64,(&m_codec, VP8E_GET_LAST_QUANTIZER_64, &quality));
if (quality >= 0 && len < bufferSize)
len += snprintf(bufferPtr+len, bufferSize-len, "Quality=%u\n", quality);
return len;
}
virtual bool Transcode(const void * fromPtr,
unsigned & fromLen,
void * toPtr,
unsigned & toLen,
unsigned & flags)
{
while (NeedEncode()) {
PluginCodec_RTP srcRTP(fromPtr, fromLen);
PluginCodec_Video_FrameHeader * video = srcRTP.GetVideoHeader();
if (m_width != video->width || m_height != video->height) {
PTRACE(4, MY_CODEC_LOG, "Changing resolution from " <<
m_width << 'x' << m_height << " to " << video->width << 'x' << video->height);
m_width = video->width;
m_height = video->height;
if (!OnChangedOptions())
return false;
}
vpx_image_t image;
vpx_img_wrap(&image, VPX_IMG_FMT_I420, video->width, video->height, 2, srcRTP.GetVideoFrameData());
WaitAndSignal lock(m_mutex);
if (IS_ERROR(vpx_codec_encode, (&m_codec, &image,
srcRTP.GetTimestamp(), m_frameTime,
(flags&PluginCodec_CoderForceIFrame) != 0 ? VPX_EFLAG_FORCE_KF : 0,
VPX_DL_REALTIME)))
return false;
}
flags = 0;
if ((m_packet->data.frame.flags&VPX_FRAME_IS_KEY) != 0)
flags |= PluginCodec_ReturnCoderIFrame;
PluginCodec_RTP dstRTP(toPtr, toLen);
Packetise(dstRTP);
toLen = (unsigned)dstRTP.GetPacketSize();
if (m_offset >= m_packet->data.frame.sz) {
flags |= PluginCodec_ReturnCoderLastFrame;
dstRTP.SetMarker(true);
m_packet = NULL;
m_offset = 0;
}
return true;
}
virtual void Packetise(PluginCodec_RTP & rtp) = 0;
};
class VP8EncoderRFC : public VP8Encoder
{
protected:
unsigned m_pictureId;
unsigned m_pictureIdSize;
public:
VP8EncoderRFC(const PluginCodec_Definition * defn)
: VP8Encoder(defn)
, m_pictureId(rand()&0x7fff)
, m_pictureIdSize(0)
{
}
virtual bool SetOption(const char * optionName, const char * optionValue)
{
if (strcasecmp(optionName, PictureIDSize.m_name) == 0) {
if (strcasecmp(optionValue, "Byte") == 0) {
if (m_pictureIdSize != 0x80) {
m_pictureIdSize = 0x80;
m_optionsSame = false;
}
return true;
}
if (strcasecmp(optionValue, "Word") == 0) {
if (m_pictureIdSize != 0x8000) {
m_pictureIdSize = 0x8000;
m_optionsSame = false;
}
return true;
}
if (strcasecmp(optionValue, "None") == 0) {
if (m_pictureIdSize != 0) {
m_pictureIdSize = 0;
m_optionsSame = false;
}
return true;
}
PTRACE(2, MY_CODEC_LOG, "Unknown picture ID size: \"" << optionValue << '"');
return false;
}
#if HAS_OUTPUT_PARTITION
if (strcasecmp(optionName, OutputPartition.m_name) == 0 &&
(vpx_codec_get_caps(vpx_codec_vp8_dx()) & VPX_CODEC_CAP_OUTPUT_PARTITION) != 0)
return SetOptionBit(m_initFlags, VPX_CODEC_USE_OUTPUT_PARTITION, optionValue);
#endif
return VP8Encoder::SetOption(optionName, optionValue);
}
virtual void Packetise(PluginCodec_RTP & rtp)
{
size_t headerSize = 1;
rtp[0] = 0;
if (m_offset == 0)
rtp[0] |= 0x10; // Add S bit if start of partition
#if HAS_OUTPUT_PARTITION
if (m_packet->data.frame.partition_id > 0 && m_packet->data.frame.partition_id <= 8)
rtp[0] |= (uint8_t)m_packet->data.frame.partition_id;
#endif
if ((m_packet->data.frame.flags&VPX_FRAME_IS_DROPPABLE) != 0)
rtp[0] |= 0x20; // Add N bit for non-reference frame
if (m_pictureIdSize > 0) {
headerSize += 2;
rtp[0] |= 0x80; // Add X bit for X (extension) bit mask byte
rtp[1] |= 0x80; // Add I bit for picture ID
if (m_pictureId < 128)
rtp[2] = (uint8_t)m_pictureId;
else {
++headerSize;
rtp[2] = (uint8_t)(0x80 | (m_pictureId >> 8));
rtp[3] = (uint8_t)m_pictureId;
}
if (m_offset == 0 && ++m_pictureId >= m_pictureIdSize)
m_pictureId = 0;
}
size_t fragmentSize = GetPacketSpace(rtp, m_packet->data.frame.sz - m_offset + headerSize) - headerSize;
rtp.CopyPayload((char *)m_packet->data.frame.buf+m_offset, fragmentSize, headerSize);
m_offset += fragmentSize;
}
};
#if INCLUDE_OM_CUSTOM_PACKETIZATION
class VP8EncoderOM : public VP8Encoder
{
protected:
unsigned m_currentGID;
public:
VP8EncoderOM(const PluginCodec_Definition * defn)
: VP8Encoder(defn)
, m_currentGID(0)
{
}
virtual void Packetise(PluginCodec_RTP & rtp)
{
size_t headerSize;
if (m_offset != 0) {
headerSize = 1;
rtp[0] = (uint8_t)m_currentGID; // No start bit or header extension bit
}
else {
headerSize = 2;
rtp[0] = 0x40; // Start bit
unsigned type = UINT_MAX;
size_t len;
unsigned char * ext = rtp.GetExtendedHeader(type, len);
Orientation orientation = type == 0x10001 ? (Orientation)(*ext >> OrientationExtHdrShift) : LandscapeUp;
rtp[1] = (unsigned char)(orientation << OrientationPktHdrShift);
if ((m_packet->data.frame.flags&VPX_FRAME_IS_KEY) != 0) {
rtp[1] |= 0x80; // Indicate is golden frame
m_currentGID = (m_currentGID+1)&0x3f;
}
rtp[0] |= m_currentGID;
}
size_t fragmentSize = GetPacketSpace(rtp, m_packet->data.frame.sz - m_offset + headerSize) - headerSize;
rtp.CopyPayload((char *)m_packet->data.frame.buf+m_offset, fragmentSize, headerSize);
m_offset += fragmentSize;
}
};
#endif //INCLUDE_OM_CUSTOM_PACKETIZATION
///////////////////////////////////////////////////////////////////////////////
class VP8Decoder : public PluginVideoDecoder<VP8_CODEC>
{
private:
typedef PluginVideoDecoder<VP8_CODEC> BaseClass;
protected:
vpx_codec_iface_t * m_iface;
vpx_codec_ctx_t m_codec;
vpx_codec_flags_t m_flags;
vpx_codec_iter_t m_iterator;
std::vector<uint8_t> m_fullFrame;
bool m_firstFrame;
bool m_intraFrame;
bool m_ignoreTillKeyFrame;
unsigned m_consecutiveErrors;
public:
VP8Decoder(const PluginCodec_Definition * defn)
: BaseClass(defn)
, m_iface(vpx_codec_vp8_dx())
, m_flags(0)
, m_iterator(NULL)
, m_firstFrame(true)
, m_intraFrame(false)
, m_ignoreTillKeyFrame(false)
, m_consecutiveErrors(0)
{
memset(&m_codec, 0, sizeof(m_codec));
m_fullFrame.reserve(10000);
#ifdef VPX_CODEC_USE_ERROR_CONCEALMENT
if ((vpx_codec_get_caps(m_iface) & VPX_CODEC_CAP_ERROR_CONCEALMENT) != 0)
m_flags |= VPX_CODEC_USE_ERROR_CONCEALMENT;
#endif
}
~VP8Decoder()
{
vpx_codec_destroy(&m_codec);
}
virtual bool Construct()
{
if (IS_ERROR(vpx_codec_dec_init, (&m_codec, m_iface, NULL, m_flags)))
return false;
PTRACE(4, MY_CODEC_LOG, "Decoder opened: " << vpx_codec_version_str() << ", revision $Revision: 33861 $");
return true;
}
bool BadDecode(unsigned & flags, bool ok)
{
if (ok)
return false;
flags = PluginCodec_ReturnCoderRequestIFrame;
m_ignoreTillKeyFrame = true;
m_fullFrame.clear();
return true;
}
virtual bool Transcode(const void * fromPtr,
unsigned & fromLen,
void * toPtr,
unsigned & toLen,
unsigned & flags)
{
vpx_image_t * image;
bool noLostPackets = (flags & PluginCodec_CoderPacketLoss) == 0;
flags = m_intraFrame ? PluginCodec_ReturnCoderIFrame : 0;
if (m_firstFrame || (image = vpx_codec_get_frame(&m_codec, &m_iterator)) == NULL) {
/* Unless error concealment implemented, decoder has a problems with
missing data in the frame and can gets it's knickers thorougly
twisted, so just ignore everything till next I-Frame. */
if (BadDecode(flags,
#ifdef VPX_CODEC_USE_ERROR_CONCEALMENT
(m_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) != 0 ||
#endif
noLostPackets))
return true;
PluginCodec_RTP srcRTP(fromPtr, fromLen);
if (BadDecode(flags, Unpacketise(srcRTP)))
return true;
if (!srcRTP.GetMarker() || m_fullFrame.empty())
return true;
vpx_codec_err_t err = vpx_codec_decode(&m_codec, &m_fullFrame[0], (unsigned)m_fullFrame.size(), NULL, 0);
switch (err) {
case VPX_CODEC_OK :
m_consecutiveErrors = 0;
break;
case VPX_CODEC_UNSUP_BITSTREAM :
if (m_consecutiveErrors++ > 10) {
IsError(err, "vpx_codec_decode");
return false;
}
// Non fatal errors
case VPX_CODEC_UNSUP_FEATURE :
case VPX_CODEC_CORRUPT_FRAME :
PTRACE(3, MY_CODEC_LOG, "Decoder reported non-fatal error: " << vpx_codec_err_to_string(err));
BadDecode(flags, false);
return true;
default:
IsError(err, "vpx_codec_decode");
return false;
}
#if 1
/* Prefer to use vpx_codec_get_stream_info() here, but it doesn't
work, it always returns key frame! The vpx_codec_peek_stream_info()
function is also useless, it return VPX_CODEC_UNSUP_FEATURE for
anything that isn't an I-Frame. Luckily it appears that the low bit
of the first byte is the I-Frame indicator.
*/
if ((m_fullFrame[0]&1) == 0)
m_intraFrame = true;
#else
vpx_codec_stream_info_t info;
info.sz = sizeof(info);
if (IS_ERROR(vpx_codec_get_stream_info, (&m_codec, &info)))
flags |= PluginCodec_ReturnCoderRequestIFrame;
if (info.is_kf)
m_intraFrame = true;
#endif
if (m_intraFrame)
flags |= PluginCodec_ReturnCoderIFrame;
m_fullFrame.clear();
m_iterator = NULL;
if ((image = vpx_codec_get_frame(&m_codec, &m_iterator)) == NULL)
return true;
m_firstFrame = false;
}
if (image->fmt != VPX_IMG_FMT_I420) {
PTRACE(1, MY_CODEC_LOG, "Unsupported image format from decoder.");
return false;
}
PluginCodec_RTP dstRTP(toPtr, toLen);
toLen = OutputImage(image->planes, image->stride, image->d_w, image->d_h, dstRTP, flags);
if ((flags & PluginCodec_ReturnCoderLastFrame) != 0)
m_intraFrame = false;
return true;
}
void Accumulate(const unsigned char * fragmentPtr, size_t fragmentLen)
{
if (fragmentLen == 0)
return;
size_t size = m_fullFrame.size();
m_fullFrame.reserve(size+fragmentLen*2);
m_fullFrame.resize(size+fragmentLen);
memcpy(&m_fullFrame[size], fragmentPtr, fragmentLen);
}
virtual bool Unpacketise(const PluginCodec_RTP & rtp) = 0;
};
class VP8DecoderRFC : public VP8Decoder
{
protected:
unsigned m_partitionID;
public:
VP8DecoderRFC(const PluginCodec_Definition * defn)
: VP8Decoder(defn)
, m_partitionID(0)
{
}
virtual bool Unpacketise(const PluginCodec_RTP & rtp)
{
if (rtp.GetPayloadSize() == 0)
return true;
if (rtp.GetPayloadSize() < 2) {
PTRACE(3, MY_CODEC_LOG, "RTP packet far too small.");
return false;
}
size_t headerSize = 1;
if ((rtp[0]&0x80) != 0) { // Check X bit
++headerSize; // Allow for X byte
if ((rtp[1]&0x80) != 0) { // Check I bit
++headerSize; // Allow for I field
if ((rtp[2]&0x80) != 0) // > 7 bit picture ID
++headerSize; // Allow for extra bits of I field
}
if ((rtp[1]&0x40) != 0) // Check L bit
++headerSize; // Allow for L byte
if ((rtp[1]&0x30) != 0) // Check T or K bit
++headerSize; // Allow for T/K byte
}
if (rtp.GetPayloadSize() <= headerSize) {
PTRACE(3, MY_CODEC_LOG, "RTP packet too small.");
return false;
}
if (m_ignoreTillKeyFrame) {
// Key frame is S bit == 1, partID == 0 and P bit == 0
if ((rtp[0]&0x1f) != 0x10 || (rtp[headerSize]&0x01) != 0)
return false;
m_ignoreTillKeyFrame = false;
PTRACE(3, MY_CODEC_LOG, "Found next start of key frame.");
}
if ((rtp[0]&0x10) != 0) { // Check S bit
unsigned partitionID = rtp[0] & 0xf;
if (partitionID != 0) {
++m_partitionID;
if (m_partitionID != partitionID) {
PTRACE(3, MY_CODEC_LOG, "Missing partition "
"(expected " << m_partitionID << " , got " << partitionID << "),"
" ignoring till next key frame.");
return false;
}
}
else {
m_partitionID = 0;
if (!m_fullFrame.empty()) {
if ((rtp[headerSize] & 0x01) != 0) {
PTRACE(3, MY_CODEC_LOG, "Start bit seen, but not completed previous frame, ignoring till next key frame.");
return false;
}
PTRACE(3, MY_CODEC_LOG, "Start bit seen, but not completed previous frame, restarting key frame.");
m_fullFrame.clear();
}
}
}
Accumulate(rtp.GetPayloadPtr()+headerSize, rtp.GetPayloadSize()-headerSize);
return true;
}
};
#if INCLUDE_OM_CUSTOM_PACKETIZATION
class VP8DecoderOM : public VP8Decoder
{
protected:
unsigned m_expectedGID;
Orientation m_orientation;
public:
VP8DecoderOM(const PluginCodec_Definition * defn)
: VP8Decoder(defn)
, m_expectedGID(UINT_MAX)
, m_orientation(LandscapeUp)
{
}
struct RotatePlaneInfo : public OutputImagePlaneInfo
{
RotatePlaneInfo(unsigned width, unsigned height, int raster, unsigned char * src, unsigned char * dst)
{
m_width = width;
m_height = height;
m_raster = raster;
m_source = src;
m_destination = dst;
}
void CopyPortraitLeft()
{
for (int y = m_height-1; y >= 0; --y) {
unsigned char * src = m_source;
unsigned char * dst = m_destination + y;
for (int x = m_width; x > 0; --x) {
*dst = *src++;
dst += m_height;
}
m_source += m_raster;
}
}
void CopyPortraitRight()
{
m_destination += m_width*m_height;
for (int y = m_height; y > 0; --y) {
unsigned char * src = m_source;
unsigned char * dst = m_destination - y;
for (int x = m_width; x > 0; --x) {
*dst = *src++;
dst -= m_height;
}
m_source += m_raster;
}
}
void CopyLandscapeDown()
{
m_destination += m_width*(m_height-1);
for (int y = m_height; y > 0; --y) {
memcpy(m_destination, m_source, m_width);
m_source += m_raster;
m_destination -= m_width;
}
}
};
virtual unsigned OutputImage(unsigned char * planes[3], int raster[3],
unsigned width, unsigned height, PluginCodec_RTP & rtp, unsigned & flags)
{
unsigned type;
size_t len;
unsigned char * ext = rtp.GetExtendedHeader(type, len);
if (ext != NULL && type == 0x10001) {
*ext = (unsigned char)(m_orientation << OrientationExtHdrShift);
return VP8Decoder::OutputImage(planes, raster, width, height, rtp, flags);
}
switch (m_orientation) {
case PortraitLeft :
case PortraitRight :
if (CanOutputImage(height, width, rtp, flags))
break;
return 0;
case LandscapeUp :
case LandscapeDown :
if (CanOutputImage(width, height, rtp, flags))
break;
return 0;
default :
return 0;
}
RotatePlaneInfo planeInfo[3] = {
RotatePlaneInfo(width, height, raster[0], planes[0], rtp.GetVideoFrameData()),
RotatePlaneInfo(width/2, height/2, raster[1], planes[1], planeInfo[0].m_destination + width*height),
RotatePlaneInfo(width/2, height/2, raster[2], planes[2], planeInfo[1].m_destination + width*height/4)
};
for (unsigned p = 0; p < 3; ++p) {
switch (m_orientation) {
case PortraitLeft :
planeInfo[p].CopyPortraitLeft();
break;
case LandscapeUp :
planeInfo[p].Copy();
break;
case PortraitRight :
planeInfo[p].CopyPortraitRight();
break;
case LandscapeDown :
planeInfo[p].CopyLandscapeDown();
break;
default :
return 0;
}
}
return (unsigned)rtp.GetPacketSize();
}
virtual bool Unpacketise(const PluginCodec_RTP & rtp)
{
size_t payloadSize = rtp.GetPayloadSize();
if (payloadSize < 2) {
if (payloadSize == 0)
return true;
PTRACE(3, MY_CODEC_LOG, "RTP packet too small.");
return false;
}
bool first = (rtp[0]&0x40) != 0;
if (first)
m_orientation = (Orientation)((rtp[1] >> OrientationPktHdrShift) & OrientationMask);
size_t headerSize = first ? 2 : 1;
if ((rtp[0]&0x80) != 0) {
while ((rtp[headerSize]&0x80) != 0)
++headerSize;
++headerSize;
}
if (m_ignoreTillKeyFrame) {
if (!first || (rtp[headerSize]&1) != 0)
return false;
m_ignoreTillKeyFrame = false;
PTRACE(3, MY_CODEC_LOG, "Found next start of key frame.");
}
else {
if (!first && m_fullFrame.empty()) {
PTRACE(3, MY_CODEC_LOG, "Missing start to frame, ignoring till next key frame.");
return false;
}
}
Accumulate(rtp.GetPayloadPtr()+headerSize, payloadSize-headerSize);
unsigned gid = rtp[0]&0x3f;
bool expected = m_expectedGID == UINT_MAX || m_expectedGID == gid;
m_expectedGID = gid;
if (expected || first)
return true;
PTRACE(3, MY_CODEC_LOG, "Unexpected GID " << gid);
return false;
}
};
#endif //INCLUDE_OM_CUSTOM_PACKETIZATION
///////////////////////////////////////////////////////////////////////////////
static struct PluginCodec_Definition VP8CodecDefinition[] =
{
PLUGINCODEC_VIDEO_CODEC_CXX(VP8MediaFormatInfoRFC, VP8EncoderRFC, VP8DecoderRFC),
#if INCLUDE_OM_CUSTOM_PACKETIZATION
PLUGINCODEC_VIDEO_CODEC_CXX(VP8MediaFormatInfoOM, VP8EncoderOM, VP8DecoderOM)
#endif
};
PLUGIN_CODEC_IMPLEMENT_CXX(VP8_CODEC, VP8CodecDefinition);
/////////////////////////////////////////////////////////////////////////////
| 31.145121 | 121 | 0.581474 | wwl33695 |
e47b4ca64593f882aaeaca2b7a52de6482a4136f | 449 | cpp | C++ | SGE/src/Platform/Vulkan/VulkanRendererAPI.cpp | Stealthhyy/SGE | e56560a93a4d7c9aac2a525240be6d4d9ba3d4e7 | [
"Apache-2.0"
] | 1 | 2021-04-25T05:45:28.000Z | 2021-04-25T05:45:28.000Z | SGE/src/Platform/Vulkan/VulkanRendererAPI.cpp | Stealthhyy/SGE | e56560a93a4d7c9aac2a525240be6d4d9ba3d4e7 | [
"Apache-2.0"
] | null | null | null | SGE/src/Platform/Vulkan/VulkanRendererAPI.cpp | Stealthhyy/SGE | e56560a93a4d7c9aac2a525240be6d4d9ba3d4e7 | [
"Apache-2.0"
] | null | null | null | #include "sgepch.h"
#include "VulkanRendererAPI.h"
#include <glad/glad.h>
namespace SGE
{
void VulkanRendererAPI::Init()
{
}
void VulkanRendererAPI::SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
{
}
void VulkanRendererAPI::SetClearColor(const glm::vec4& color)
{
}
void VulkanRendererAPI::Clear()
{
}
void VulkanRendererAPI::DrawIndexed(const Ref<VertexArray>& vertexArray, uint32_t indexCount)
{
}
} | 14.966667 | 94 | 0.726058 | Stealthhyy |
e47d069bb3a266c8454fa442b094041188ba2741 | 2,326 | hpp | C++ | src/CGPCircuit.hpp | xkraut03/evococo | 602461bea72a9f2b81e6e8c289f91030266a08ae | [
"Apache-2.0"
] | null | null | null | src/CGPCircuit.hpp | xkraut03/evococo | 602461bea72a9f2b81e6e8c289f91030266a08ae | [
"Apache-2.0"
] | null | null | null | src/CGPCircuit.hpp | xkraut03/evococo | 602461bea72a9f2b81e6e8c289f91030266a08ae | [
"Apache-2.0"
] | null | null | null | // CGPCircuit.hpp
// author: Daniel Kraut
// creation date: 10th of September, 2017
//
// Copyright © 2017 Daniel Kraut
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#pragma once
#include <array>
#include <vector>
// CGP parameters
const int circuit_num_rows = 5;
const int circuit_num_columns = 9;
// const int circuit_lback_value = 1; lback is max for now
const int circuit_num_inputs = 25;
const int circuit_num_outputs = 1;
const int circuit_num_functions = 16;
struct CGPComponent
{
int input1;
int input2;
int function;
uint8_t output;
};
class CGPCircuit
{
private:
template<const size_t MatrixRows, const size_t MatrixColumns>
using ComponentsMatrix =
std::array<std::array<CGPComponent, MatrixColumns>, MatrixRows>;
ComponentsMatrix<circuit_num_rows, circuit_num_columns> circuit_matrix_;
int output_unit_;
int tmp_output_;
std::array<uint8_t, circuit_num_inputs> input_;
std::vector<int> out_candidates;
public:
using CGPInputArray = std::array<uint8_t, circuit_num_inputs>;
void initRandomly();
void mutateRandomly();
void setInput(const CGPInputArray& input);
uint8_t getOutput();
bool saveToFile(std::string_view) const;
bool loadFromFile(std::string_view);
void printBackwards() const;
bool switchToLessPower();
int getCircuitLength() const;
private:
int column_size = circuit_num_rows;
// int row_size = circuit_num_columns;
void printBackwards(int) const;
uint8_t doSpecificOperation(const uint8_t x, const uint8_t y,
const int function) const;
uint8_t getComponentOutput(const CGPComponent& unit) const;
int indexToRow(const int index) const;
int indexToColumn(const int index) const;
int setLback1(int target, int curr_column);
};
| 30.605263 | 76 | 0.726569 | xkraut03 |
e47f66c6b9df1644d9eaf8c12fa96aa243a0c8c5 | 19,328 | hpp | C++ | include/http_frame.hpp | jonathonl/IPSuite | 76dfd7913388851c6714645252b2caa3c5596dcc | [
"MIT"
] | 1 | 2016-03-01T15:23:13.000Z | 2016-03-01T15:23:13.000Z | include/http_frame.hpp | jonathonl/IPSuite | 76dfd7913388851c6714645252b2caa3c5596dcc | [
"MIT"
] | null | null | null | include/http_frame.hpp | jonathonl/IPSuite | 76dfd7913388851c6714645252b2caa3c5596dcc | [
"MIT"
] | null | null | null | #pragma once
#ifndef MANIFOLD_HTTP_FRAME_HPP
#define MANIFOLD_HTTP_FRAME_HPP
#include <vector>
#include <list>
#include <cstdint>
#include "socket.hpp"
#include "http_error_category.hpp"
#ifndef MANIFOLD_DISABLE_HTTP2
namespace manifold
{
namespace http
{
//================================================================//
// enum class errc : std::uint32_t // TODO: Make error_condition
// {
// no_error = 0x0,
// protocol_error = 0x1,
// internal_error = 0x2,
// flow_control_error = 0x3,
// settings_timeout = 0x4,
// stream_closed = 0x5,
// frame_size_error = 0x6,
// refused_stream = 0x7,
// cancel = 0x8,
// compression_error = 0x9,
// connect_error = 0xa,
// enhance_your_calm = 0xb,
// inadequate_security = 0xc,
// http_1_1_required = 0xd
// };
//================================================================//
//================================================================//
class frame_flag
{
public:
static const std::uint8_t end_stream = 0x01;
static const std::uint8_t end_headers = 0x04;
static const std::uint8_t padded = 0x08;
static const std::uint8_t priority = 0x20;
};
//================================================================//
//================================================================//
class frame_payload_base
{
protected:
std::vector<char> buf_;
std::uint8_t flags_;
public:
frame_payload_base(frame_payload_base&& source)
: buf_(std::move(source.buf_)), flags_(source.flags_) {}
frame_payload_base(std::uint8_t flags) : flags_(flags) {}
virtual ~frame_payload_base() {}
frame_payload_base& operator=(frame_payload_base&& source)
{
if (&source != this)
{
this->buf_ = std::move(source.buf_);
this->flags_ = source.flags_;
}
return *this;
}
std::uint8_t flags() const;
std::uint32_t serialized_length() const;
static void recv_frame_payload(socket& sock, frame_payload_base& destination, std::uint32_t payload_size, std::uint8_t flags, const std::function<void(const std::error_code& ec)>& cb);
static void send_frame_payload(socket& sock, const frame_payload_base& source, const std::function<void(const std::error_code& ec)>& cb);
};
//================================================================//
//================================================================//
class data_frame : public frame_payload_base
{
public:
data_frame(const char*const data, std::uint32_t datasz, bool end_stream = false, const char*const padding = nullptr, std::uint8_t paddingsz = 0);
data_frame(data_frame&& source) : frame_payload_base(std::move(source)) {}
data_frame& operator=(data_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~data_frame() {}
data_frame split(std::uint32_t num_bytes);
const char*const data() const;
std::uint32_t data_length() const;
const char*const padding() const;
std::uint8_t pad_length() const;
bool has_end_stream_flag() const { return this->flags_ & frame_flag::end_stream; }
bool has_padded_flag() const { return this->flags_ & frame_flag::padded; }
private:
data_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
struct priority_options
{
std::uint32_t stream_dependency_id;
std::uint8_t weight;
bool exclusive;
priority_options(std::uint32_t dependency_id, std::uint8_t priority_weight, bool dependency_is_exclusive)
{
this->stream_dependency_id = dependency_id;
this->weight = priority_weight;
this->exclusive = dependency_is_exclusive;
}
};
//================================================================//
//================================================================//
class headers_frame : public frame_payload_base
{
private:
std::uint8_t bytes_needed_for_pad_length() const;
std::uint8_t bytes_needed_for_dependency_id_and_exclusive_flag() const;
std::uint8_t bytes_needed_for_weight() const;
public:
headers_frame(const char*const header_block, std::uint32_t header_block_sz, bool end_headers, bool end_stream, const char*const padding = nullptr, std::uint8_t paddingsz = 0);
headers_frame(const char*const header_block, std::uint32_t header_block_sz, bool end_headers, bool end_stream, priority_options priority_ops, const char*const padding = nullptr, std::uint8_t paddingsz = 0);
headers_frame(headers_frame&& source) : frame_payload_base(std::move(source)) {}
headers_frame& operator=(headers_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~headers_frame() {}
const char*const header_block_fragment() const;
std::uint32_t header_block_fragment_length() const;
const char*const padding() const;
std::uint8_t pad_length() const;
std::uint8_t weight() const;
std::uint32_t stream_dependency_id() const;
bool exclusive_stream_dependency() const;
bool has_end_stream_flag() const { return this->flags_ & frame_flag::end_stream; }
bool has_end_headers_flag() const { return this->flags_ & frame_flag::end_headers; }
bool has_padded_flag() const { return this->flags_ & frame_flag::padded; }
bool has_priority_flag() const { return this->flags_ & frame_flag::priority; }
private:
headers_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
class priority_frame : public frame_payload_base
{
public:
priority_frame(priority_options options);
priority_frame(priority_frame&& source) : frame_payload_base(std::move(source)) {}
priority_frame& operator=(priority_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~priority_frame() {}
std::uint8_t weight() const;
std::uint32_t stream_dependency_id() const;
bool exclusive_stream_dependency() const;
private:
priority_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
class rst_stream_frame : public frame_payload_base
{
public:
rst_stream_frame(http::v2_errc error_code);
rst_stream_frame(rst_stream_frame&& source) : frame_payload_base(std::move(source)) {}
rst_stream_frame& operator=(rst_stream_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~rst_stream_frame() {}
std::uint32_t error_code() const;
private:
rst_stream_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
class ack_flag { };
//================================================================//
class settings_frame : public frame_payload_base
{
public:
settings_frame(ack_flag) : frame_payload_base(0x1) {}
settings_frame(std::list<std::pair<std::uint16_t,std::uint32_t>>::const_iterator beg, std::list<std::pair<std::uint16_t,std::uint32_t>>::const_iterator end);
settings_frame(settings_frame&& source) : frame_payload_base(std::move(source)) {}
settings_frame& operator=(settings_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~settings_frame() {}
bool has_ack_flag() const { return (bool)(this->flags_ & 0x1); }
std::list<std::pair<std::uint16_t,std::uint32_t>> settings() const;
private:
settings_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
class push_promise_frame : public frame_payload_base // TODO: Impl optional padding. Also flags need to looked at!!
{
public:
push_promise_frame(const char*const header_block, std::uint32_t header_block_sz, std::uint32_t promise_stream_id, bool end_headers, const char*const padding = nullptr, std::uint8_t paddingsz = 0);
push_promise_frame(push_promise_frame&& source) : frame_payload_base(std::move(source)) {}
push_promise_frame& operator=(push_promise_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~push_promise_frame() {}
const char*const header_block_fragment() const;
std::uint32_t header_block_fragment_length() const;
const char*const padding() const;
std::uint8_t pad_length() const;
std::uint32_t promised_stream_id() const;
bool has_end_headers_flag() const { return this->flags_ & frame_flag::end_headers; }
private:
push_promise_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
class ping_frame : public frame_payload_base
{
public:
ping_frame(std::uint64_t ping_data, bool ack = false);
ping_frame(ping_frame&& source) : frame_payload_base(std::move(source)) {}
ping_frame& operator=(ping_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~ping_frame() {}
bool is_ack() const { return (bool)(this->flags_ & 0x1); }
std::uint64_t data() const;
private:
ping_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
class goaway_frame : public frame_payload_base
{
public:
goaway_frame(std::uint32_t last_stream_id, http::v2_errc error_code, const char*const addl_error_data, std::uint32_t addl_error_data_sz);
goaway_frame(goaway_frame&& source) : frame_payload_base(std::move(source)) {}
goaway_frame& operator=(goaway_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~goaway_frame() {}
std::uint32_t last_stream_id() const;
http::v2_errc error_code() const;
const char*const additional_debug_data() const;
std::uint32_t additional_debug_data_length() const;
private:
goaway_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
class window_update_frame : public frame_payload_base
{
public:
window_update_frame(std::uint32_t window_size_increment);
window_update_frame(window_update_frame&& source) : frame_payload_base(std::move(source)) {}
window_update_frame& operator=(window_update_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~window_update_frame() {}
std::uint32_t window_size_increment() const;
private:
window_update_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
class continuation_frame : public frame_payload_base
{
public:
continuation_frame(const char*const header_data, std::uint32_t header_data_sz, bool end_headers);
continuation_frame(continuation_frame&& source) : frame_payload_base(std::move(source)) {}
continuation_frame& operator=(continuation_frame&& source)
{
frame_payload_base::operator=(std::move(source));
return *this;
}
~continuation_frame() {}
const char*const header_block_fragment() const;
std::uint32_t header_block_fragment_length() const;
bool has_end_headers_flag() const { return this->flags_ & frame_flag::end_headers; }
private:
continuation_frame() : frame_payload_base(0) {}
friend class frame;
};
//================================================================//
//================================================================//
enum class frame_type : std::uint8_t
{
data = 0x0,
headers,
priority,
rst_stream,
settings,
push_promise,
ping,
goaway,
window_update,
continuation,
invalid_type = 0xFF
};
//================================================================//
//================================================================//
class frame
{
public:
//----------------------------------------------------------------//
static const http::data_frame default_data_frame_ ;
static const http::headers_frame default_headers_frame_ ;
static const http::priority_frame default_priority_frame_ ;
static const http::rst_stream_frame default_rst_stream_frame_ ;
static const http::settings_frame default_settings_frame_ ;
static const http::push_promise_frame default_push_promise_frame_ ;
static const http::ping_frame default_ping_frame_ ;
static const http::goaway_frame default_goaway_frame_ ;
static const http::window_update_frame default_window_update_frame_;
static const http::continuation_frame default_continuation_frame_ ;
//----------------------------------------------------------------//
//----------------------------------------------------------------//
static void recv_frame(manifold::socket& sock, frame& destination, const std::function<void(const std::error_code& ec)>& cb);
static void send_frame(manifold::socket& sock, const frame& source, const std::function<void(const std::error_code& ec)>& cb);
//----------------------------------------------------------------//
private:
//----------------------------------------------------------------//
union payload_union
{
//----------------------------------------------------------------//
http::data_frame data_frame_;
http::headers_frame headers_frame_;
http::priority_frame priority_frame_;
http::rst_stream_frame rst_stream_frame_;
http::settings_frame settings_frame_;
http::push_promise_frame push_promise_frame_;
http::ping_frame ping_frame_;
http::goaway_frame goaway_frame_;
http::window_update_frame window_update_frame_;
http::continuation_frame continuation_frame_;
//----------------------------------------------------------------//
//----------------------------------------------------------------//
payload_union(){}
~payload_union(){}
//----------------------------------------------------------------//
};
//----------------------------------------------------------------//
private:
//----------------------------------------------------------------//
payload_union payload_;
std::array<char, 9> metadata_;
//----------------------------------------------------------------//
//----------------------------------------------------------------//
void destroy_union();
void init_meta(frame_type t, std::uint32_t payload_length, std::uint32_t stream_id, std::uint8_t flags);
std::uint8_t flags() const;
frame(const frame&) = delete;
frame& operator=(const frame&) = delete;
//----------------------------------------------------------------//
public:
//----------------------------------------------------------------//
frame();
frame(http::data_frame&& payload, std::uint32_t stream_id);
frame(http::headers_frame&& payload, std::uint32_t stream_id);
frame(http::priority_frame&& payload, std::uint32_t stream_id);
frame(http::rst_stream_frame&& payload, std::uint32_t stream_id);
frame(http::settings_frame&& payload, std::uint32_t stream_id);
frame(http::push_promise_frame&& payload, std::uint32_t stream_id);
frame(http::ping_frame&& payload, std::uint32_t stream_id);
frame(http::goaway_frame&& payload, std::uint32_t stream_id);
frame(http::window_update_frame&& payload, std::uint32_t stream_id);
frame(http::continuation_frame&& payload, std::uint32_t stream_id);
frame(frame&& source);
~frame();
frame& operator=(frame&& source);
//----------------------------------------------------------------//
//----------------------------------------------------------------//
template <typename T>
bool is() const;
std::uint32_t payload_length() const;
frame_type type() const;
std::uint32_t stream_id() const;
//----------------------------------------------------------------//
//----------------------------------------------------------------//
http::data_frame& data_frame() ;
http::headers_frame& headers_frame() ;
http::priority_frame& priority_frame() ;
http::rst_stream_frame& rst_stream_frame() ;
http::settings_frame& settings_frame() ;
http::push_promise_frame& push_promise_frame() ;
http::ping_frame& ping_frame() ;
http::goaway_frame& goaway_frame() ;
http::window_update_frame& window_update_frame();
http::continuation_frame& continuation_frame() ;
const http::data_frame& data_frame() const;
const http::headers_frame& headers_frame() const;
const http::priority_frame& priority_frame() const;
const http::rst_stream_frame& rst_stream_frame() const;
const http::settings_frame& settings_frame() const;
const http::push_promise_frame& push_promise_frame() const;
const http::ping_frame& ping_frame() const;
const http::goaway_frame& goaway_frame() const;
const http::window_update_frame& window_update_frame() const;
const http::continuation_frame& continuation_frame() const;
//----------------------------------------------------------------//
};
//================================================================//
}
}
#endif //MANIFOLD_DISABLE_HTTP2
#endif //MANIFOLD_HTTP_FRAME_HPP | 41.036093 | 212 | 0.527318 | jonathonl |
6b00c0e9e77f92465f60759944c1f0b4effce707 | 2,194 | hpp | C++ | src/polybench/POLYBENCH_FLOYD_WARSHALL.hpp | woodard/RAJAPerf | 14a64c4fd124868018735d7bed5ffb5269b519c9 | [
"BSD-3-Clause"
] | null | null | null | src/polybench/POLYBENCH_FLOYD_WARSHALL.hpp | woodard/RAJAPerf | 14a64c4fd124868018735d7bed5ffb5269b519c9 | [
"BSD-3-Clause"
] | null | null | null | src/polybench/POLYBENCH_FLOYD_WARSHALL.hpp | woodard/RAJAPerf | 14a64c4fd124868018735d7bed5ffb5269b519c9 | [
"BSD-3-Clause"
] | 1 | 2019-06-11T13:43:36.000Z | 2019-06-11T13:43:36.000Z | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2017-19, Lawrence Livermore National Security, LLC
// and RAJA Performance Suite project contributors.
// See the RAJAPerf/COPYRIGHT file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
///
/// POLYBENCH_FLOYD_WARSHALL kernel reference implementation:
///
/// Note: kernel is altered to enable parallelism (original did not have
/// separate input and output arrays).
///
/// for (Index_type k = 0; k < N; k++) {
/// for (Index_type i = 0; i < N; i++) {
/// for (Index_type j = 0; j < N; j++) {
/// pout[i][j] = pin[i][j] < pin[i][k] + pin[k][j] ?
/// pin[i][j] : pin[i][k] + pin[k][j];
/// }
/// }
/// }
#ifndef RAJAPerf_POLYBENCH_FLOYD_WARSHALL_HPP
#define RAJAPerf_POLYBENCH_FLOYD_WARSHALL_HPP
#define POLYBENCH_FLOYD_WARSHALL_BODY \
pout[j + i*N] = pin[j + i*N] < pin[k + i*N] + pin[j + k*N] ? \
pin[j + i*N] : pin[k + i*N] + pin[j + k*N];
#define POLYBENCH_FLOYD_WARSHALL_BODY_RAJA \
poutview(i, j) = pinview(i, j) < pinview(i, k) + pinview(k, j) ? \
pinview(i, j) : pinview(i, k) + pinview(k, j);
#define POLYBENCH_FLOYD_WARSHALL_VIEWS_RAJA \
using VIEW_TYPE = RAJA::View<Real_type, \
RAJA::Layout<2, Index_type, 1>>; \
\
VIEW_TYPE pinview(pin, RAJA::Layout<2>(N, N)); \
VIEW_TYPE poutview(pout, RAJA::Layout<2>(N, N));
#include "common/KernelBase.hpp"
namespace rajaperf
{
class RunParams;
namespace polybench
{
class POLYBENCH_FLOYD_WARSHALL : public KernelBase
{
public:
POLYBENCH_FLOYD_WARSHALL(const RunParams& params);
~POLYBENCH_FLOYD_WARSHALL();
void setUp(VariantID vid);
void runKernel(VariantID vid);
void updateChecksum(VariantID vid);
void tearDown(VariantID vid);
void runCudaVariant(VariantID vid);
void runOpenMPTargetVariant(VariantID vid);
private:
Index_type m_N;
Real_ptr m_pin;
Real_ptr m_pout;
};
} // end namespace polybench
} // end namespace rajaperf
#endif // closing endif for header file include guard
| 26.433735 | 79 | 0.596627 | woodard |
6b01bb3f25456bcf86ee4a198f7e9291d1b90d51 | 752 | cpp | C++ | text file.cpp | lazarevtill/mirealabs | fcd57fd036ad987bc8b0545cb7b3f7bdd29fc215 | [
"MIT"
] | 1 | 2020-04-30T14:09:21.000Z | 2020-04-30T14:09:21.000Z | text file.cpp | lazarevtill/mirealabs | fcd57fd036ad987bc8b0545cb7b3f7bdd29fc215 | [
"MIT"
] | null | null | null | text file.cpp | lazarevtill/mirealabs | fcd57fd036ad987bc8b0545cb7b3f7bdd29fc215 | [
"MIT"
] | null | null | null | #include <iostream>
#include <string>
#include <fstream>
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
//const std::string source;//где ищем
const std::string lexeme = "g";//что ищем
std::string source;
std::ifstream inf;
inf.open("myfile.txt");//if (!inf)cerr
//-------------------------
getline(inf, source, '\0');
//-------------------------
inf.close();
unsigned lexeme_count = 0;
for (std::size_t pos = 0; pos < source.size(); pos += lexeme.size())
{
pos = source.find(lexeme, pos);
if (pos != std::string::npos)
{
++lexeme_count;
}
else
{
break;
}
}
std::cout << "Result: " << lexeme_count << std::endl;//сколько вхождений
} | 20.324324 | 74 | 0.551862 | lazarevtill |
6b01fe71f63d426286c9570f7eb1854ac4b50882 | 241,811 | cpp | C++ | Source/tests/functional/general/openpgp_pka_rsa_test.cpp | ProtonMail/cpp-openpgp | b47316c51357b8d15eb3bcc376ea5e59a6a9a108 | [
"MIT"
] | 5 | 2019-10-30T06:10:10.000Z | 2020-04-25T16:52:06.000Z | Source/tests/functional/general/openpgp_pka_rsa_test.cpp | ProtonMail/cpp-openpgp | b47316c51357b8d15eb3bcc376ea5e59a6a9a108 | [
"MIT"
] | null | null | null | Source/tests/functional/general/openpgp_pka_rsa_test.cpp | ProtonMail/cpp-openpgp | b47316c51357b8d15eb3bcc376ea5e59a6a9a108 | [
"MIT"
] | 2 | 2019-11-27T23:47:54.000Z | 2020-01-13T16:36:03.000Z | //
// openpgp_pka_verify_test.cpp
// OpenPGP
//
// Created by Yanfeng Zhang on 8/28/17.
//
// The MIT License
//
// Copyright (c) 2019 Proton Technologies AG
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "utils_test.h"
#include <openpgp/PGPKey.h>
#include <openpgp/openpgp.h>
#include <openpgp/PGPCleartextSignature.h>
#include <openpgp/PGPMessage.h>
#include <openpgp/encrypt.h>
#include <openpgp/decrypt.h>
#include <openpgp/verify.h>
#include <algorithm>
#include <string>
#include <openpgp/pgptime.h>
#include <openpgp/sign.h>
#include "bridge_impl/open_pgp_impl.hpp"
#include "bridge/open_pgp_key.hpp"
#include <openpgp/private_key.h>
#include <openpgp/pgptime.h>
using namespace ProtonMail::pgp;
namespace tests {
namespace open_pgp_tests {
const std::string RSA_SIGGEN_E = "10001";
// const uint8_t PKA_RSA_TYPE = 1;
const std::vector<std::string> RSA_SIGGEN_N = {
"c8a2069182394a2ab7c3f4190c15589c56a2d4bc42dca675b34cc950e24663048441e8aa593b2bc59e198b8c257e882120c62336e5cc745012c7ffb063eebe53f3c6504cba6cfe51baa3b6d1074b2f398171f4b1982f4d65caf882ea4d56f32ab57d0c44e6ad4e9cf57a4339eb6962406e350c1b15397183fbf1f0353c9fc991",
"a2fbfe82fccf847724640571bd393ca2dbe4e9a3ad85cbdad9151faf27b7127d37147cb7fdd3508d68b9a8b5b914cacc863b3e180665bad32c0c1ec8f9d87740fa5891de8f54085eb0424d2589f53adb20ac92eec98d9ce5378e9875ee7890f99b3828662471b24ba2caad362487030169dd127c8e6e7bf3c8f01f7ff5e09d3e91189ac6e37355dda7526dd5b63c6b32cc9f5b86251fdc9db8ba9e676f848a44e59c095550d4f4480295ae327ac7fb877a2835a216cc06c3786682d31b6dff19",
"e0b14b99cd61cd3db9c2076668841324fa3174f33ce66ffd514394d34178d29a49493276b6777233e7d46a3e68bc7ca7e899e901d54f6dee0749c3e48ddf68685867ee2ae66df88eb563f6db137a9f6b175a112e0eda8368e88e45efe1ce14bc6016d52639627066af1872c72f60b9161c1d237eeb34b0f841b3f0896f9fe0e16b0f74352d101292cc464a7e7861bbeb86f6df6151cb265417c66c565ed8974bd8fc984d5ddfd4eb91a3d5234ce1b5467f3ade375f802ec07293f1236efa3068bc91b158551c875c5dc0a9d6fa321bf9421f08deac910e35c1c28549ee8eed8330cf70595ff70b94b49907e27698a9d911f7ac0706afcb1a4a39feb38b0a8049",
"c755df3cd383466596520290b6f7afbe8b949eb5f9e449ef4e34e397b4d0a93257ad93a83b2d177ea37eeeab1ae175ccd81156ec1381072b30473f613f1b918d1b39653ba6cdd832e4429acba2fa05e44cb296981ff7161f17a5535b2adfe0fa8a56b092f35dce1fbd4365e13970befed80b8d9f413297db07bcf491e5fe236dae0172e05147f7a85a3ec11a074a91aabda90e94949eecea765444ae30ef629ac682efcaa1272ee17a2116019910323f00c95842cabb019cb0948bbb362ea57efa99a78b9785658edcda6c29884a10f3cf289197d022aceb2cdbe681ff5c436ddea48a380b6b79fe2bb88f43c1922b3cc13df4baf7e6761f29d35b47c1adaea89594c4c7fde4eba855e8be1fee172af4b35cb732e39af61e582ddd60d93e06c74b0d560d015a02e5c4d4c33cd68b50cf69089fec3e19ebcdb45828e96f5d176584fd3827adf87c5b9174583a2373243c24d99ba202e0d4849e7ba073a6081330eb5b50254113fe3e4207a355c371f24607276eb7a884f2ccdfa8313d293d5e1d",
"d25c8f8c97b7e5a6a98de78f19ef18077cf952e64622e4142e6ba5c8ee265ea9b34b9e5cb2c1ac0307547faa70126229b32085988c0974a03198c89f8305be4bdc445ee577c60b7a7fdfd5cf7283f0a1d0f2d65b1ba2fbfb76c5039ee06a944d40ae3843c9a4d60571db4cd16e28ce5b9fb9fa83fa3cf8cfc1e87103612568ecdb1a5c50fbd0911b645983b629ba72bc2d228207b49e00bdae1b906aa15ea2d23f8c0e124c9e7de1b3cd3b9bc6a017c4de3f1d6548dacad6d4abd5f4e179a2a5e782fb8f818cf8f307f84f7f3bcd81059e73192036aca02f805070eded8b5de01037f2b34b41e86bb8c44760492cde4bc3b080d5b0624bfa1002bd6a75d0513b07c354e8edf8a6f57dc14290eb8850659788098b9971fc0492c3ced7c3478689444e771c9434fb624eb4243f740c3ef9c3f3f084bfb59f44a46a1d3b1438e661ba3ba08d525255224816348b4d696475ccac3871fc7836385f7078412cc58e36747d248bb1ab123fa33256c10d1102f77a60643f4247ac1cdfdf4d8d51deea80795964f801f97c4f955eb181136bb39abecd3549541ccc9d29e34a63241a4548e836c4d2159968596130a222608ae0b09d9ed30cbf04d83083457f60e8a686a452baa2b08c177ade1a3cbe7bc0d6ed846c24c4ad5bcaff3817fdf3381e64c39c18dd4f54eb82fc23d3139843228489399c156565df75f3808cbdfaa53594bac5",
};
const std::vector<std::string> RSA_SIGGEN_D = {
"5dfcb111072d29565ba1db3ec48f57645d9d8804ed598a4d470268a89067a2c921dff24ba2e37a3ce834555000dc868ee6588b7493303528b1b3a94f0b71730cf1e86fca5aeedc3afa16f65c0189d810ddcd81049ebbd0391868c50edec958b3a2aaeff6a575897e2f20a3ab5455c1bfa55010ac51a7799b1ff8483644a3d425",
"068b7f86339042c5c50a963461d0a35877e39aa545c1d674989c924be698a1afb10f4bcdd8adcc718d47cd5854d11aaeb9623625615662f8f96f182a626c18a7dd95c26fd14a22d6e895950301a5fd21d10f550c2d40585155188f13474b04a94cee8df7e6b889c4e9b68145886eba209577ff4ad3072c72219b72b0803b308fb2e4d9a8bbd370088c4de857827136612f6e7731d56900318c433eda485a4798ef7be50a530f1f3f173fc251ee7192c3bceb598c109872fca098b9f9d5cc0001",
"1dbca92e4245c2d57bfba76210cc06029b502753b7c821a32b799fbd33c98b49db10226b1eac0143c8574ef652833b96374d034ef84daa5559c693f3f028d49716b82e87a3f682f25424563bd9409dcf9d08110500f73f74076f28e75e0199b1f29fa2f70b9a31190dec54e872a740e7a1b1e38c3d11bca8267deb842cef4262237ac875725068f32563b478aca8d6a99f34cb8876b97145b2e8529ec8adea83ead4ec63e3ff2d17a2ffefb05c902ca7a92168378c89f75c928fc4f0707e43487a4f47df70cae87e24272c136d3e98cf59066d41a3d038857d073d8b4d2c27b8f0ea6bfa50d263091a4a18c63f446bc9a61e8c4a688347b2435ec8e72eddaea7",
"222a4af8a935151e08d1761c992ba34ce8ae18b4ce87ad0f6deb5d3ded911d0ae2a1becee513a1b5042f57976ea449954a4c508666826538e70db324871541d17a62d041d4e16fa6ab5e6a1b308c2371e19e7376cff5c0ee23d6a38e9aeee3e7f5498dfaa5e94450c6d6f43191ef8be0f0a52c49293ad371c865ffd238e621eae4d9dd376adf07a8ec8cd87a8e58ded631ab35f34bf4e05d005a89aa047ba73e297b9c3f71f71e0f29e85d55f946e021d1cff0c783e961099aef5ef2bfc2e77cea58902d910279228addd532dc417e7c64f394419a3d70dae19bae780bf932c502ed817dd7bf3c9dae31c9f4156f8029643a20054393c849b32dac3931695ceeb700c006caa8caf201cfeaeeafb0f4bac89416c50f14c93aac5e3efcdc9409e491450bc3ffbaae46b5647b7a9718ef0b32d52403e26679515ae70a5a9ac35851344602d8d424b6c556b64eddb9111df66e6d8c82c4b9734eb986403957ffe415af0d13d3aea4734ec77b03e359bca2cfebc3e6cc96e46b3cb80bbc04205af3e1",
"28a6fc92c5eb22f54f44fe1fd87a2d219d542d6214e1bf43eb28a0743119b727825fb5ade259ad1d34b86ea7885af51f6bdf7811dfd61ff4a941065c551cb206c4fd6d7d58e52be8b37795412eb732b482c5bb0906513bf2ffa3d92c45e032e2af023c1b55878658ad051d5647bc990c79d49e060d40e530791fab5f64d1aef23ef15c2fc64a2b10a916e76e37a8316e0e26e20c0d2a8fa81852795931f030f50294d54f52013b007817cc52315354e495b28ac2bd0e932e6b10fe1b01cbd8d3c8e6b628a8778ed0a094ab004295573eb7bd3478d6380c08c1fa49a8a1445292ef6f707697af97f3e154051b256907588aebbc2a0f991f67a6da70b2772c17d63fd8d12b94ab4e0faf9330a4b4bfdcc6d9137262cff60ec003e61182f201bd07c7d3acad67cf2e780e29a11238785d4802ffa8136bfb4d3558b48e8cb77bd63ffd9bbeac0f51d297f009a7b603a388603c59d7d68a02e2e027bc7249177b185e567b7a092986e8008101d4f58e917c5e9ecef56d5acc00767e0d74b49c2d3bd29ca290e8de04f6e161d5e48af3253a1710d1f5b7a50f888a1417b12c221ff25d9b106128829894cb16eed84333a96abb2ac310b4a72bd207ead3dc2560939307a74f3ba3b8aea576cd846ca963cf337fb41b506bd2320036e3b469af5a1db5a2d7419dfc762441da11275c8825d96d4ce2703a4e183fd20d4a9fb85da6a07b8d",
};
const int ALG_SHA1 = 2;
const int ALG_SHA256 = 8;
const int ALG_SHA384 = 9;
const int ALG_SHA512 = 10;
const int ALG_SHA224 = 11;
const std::vector<std::vector<std::tuple<int, std::string> > > RSA_SIGGEN_MSG = {
{
{
std::make_tuple(ALG_SHA1, "e8312742ae23c456ef28a23142c4490895832765dadce02afe5be5d31b0048fbeee2cf218b1747ad4fd81a2e17e124e6af17c3888e6d2d40c00807f423a233cad62ce9eaefb709856c94af166dba08e7a06965d7fc0d8e5cb26559c460e47bc088589d2242c9b3e62da4896fab199e144ec136db8d84ab84bcba04ca3b90c8e5"),
std::make_tuple(ALG_SHA1, "4c95073dac19d0256eaadff3505910e431dd50018136afeaf690b7d18069fcc980f6f54135c30acb769bee23a7a72f6ce6d90cbc858c86dbbd64ba48a07c6d7d50c0e9746f97086ad6c68ee38a91bbeeeb2221aa2f2fb4090fd820d4c0ce5ff025ba8adf43ddef89f5f3653de15edcf3aa8038d4686960fc55b2917ec8a8f9a8"),
std::make_tuple(ALG_SHA1, "e075ad4b0f9b5b20376e467a1a35e308793ba38ed983d03887b8b82eda630e68b8618dc45b93de5555d7bcfed23756401e61f5516757de6ec3687a71755fb4a66cfaa3db0c9e69b631485b4c71c762eea229a0469c7357a440950792ba9cd7ae022a36b9a923c2ebd2aa69897f4cceba0e7aee97033d03810725a9b731833f27"),
std::make_tuple(ALG_SHA1, "18500155d2e0587d152698c07ba44d4f04aa9a900b77ce6678a137b238b73b1aea24a409db563cf635209aea735d3b3c18d7d59fa167e760b85d95e8aa21b3881b1b2076f9d15512ae4f3d6e9acc480ec08abbecbffe4abf0531e87d3f66de1f13fd1aa41297ca58e87b2a56d6399a4c638df47e4e851c0ec6e6d97addcde366"),
std::make_tuple(ALG_SHA1, "f7f79f9df2760fc83c73c7ccea7eae482dcfa5e02acf05e105db48283f440640439a24ca3b2a482228c58f3f32c383db3c4847d4bcc615d3cac3eb2b77dd80045f0b7db88225ea7d4fa7e64502b29ce23053726ea00883ea5d80502509a3b2df74d2142f6e70de22d9a134a50251e1a531798e747e9d386fe79ae1dea09e851b"),
std::make_tuple(ALG_SHA1, "099bf17f16bcfd4c19b34fecb4b3233c9f9f98718f67b3065d95a5f8642351362b9009534433987f73ce86b513669736b65295350c934fd40663e24f3a1037778a0bcd63003cb962fd99eb3393f7b2792f2083697b25f6c682f6110f162fc9f76e35c615148267ddff3d06cffb0e7dee5230e874a5c8adc41b75baa0be280e9c"),
std::make_tuple(ALG_SHA1, "fb40a73dc82f167f9c2bf98a991ea82fdb0141dbad44871afd70f05a0e0bf9f26dbcbd6226afc6dc373b230445c2baf58ed9e0841fa927c8479577da4b1e61d95b03af31c5ac401d69c8136b6d36a1803221709b8670e55e1b5d5a8a3763700aae5ea6330eee2b4a191cf146784003d8ad2218a94a5f68e3600ebef23ba4cf8c"),
std::make_tuple(ALG_SHA1, "97e74960dbd981d46aadc021a6cf181ddde6e4cfcb4b638260c0a519c45faba299d0ca2e80bf50dfde8d6a42e04645dfbcd4740f3a72920e74632851d9e3d01a785e9b497ce0b175f2cd373bd3d276d63e1b39f005c676b86b9831352cef9edabef8865ad722ebbe2fd3efb48759f22aea23fb1b333159a9cfc98a6dc46c5b0b"),
std::make_tuple(ALG_SHA1, "95d04624b998938dd0a5ba6d7042aa88a2674dad438a0d31abb7979d8de3dea41e7e63587a47b59d436433dd8bb219fdf45abb9015a50b4b201161b9c2a47c304b80c4040fb8d1fa0c623100cded661b8eb52fa0a0d509a70f3cf4bd83047ad964ffee924192f28e73c63b3efd9c99c8b7a13145acc30d2dc063d80f96abe286"),
std::make_tuple(ALG_SHA1, "207102f598ec280045be67592f5bba25ba2e2b56e0d2397cbe857cde52da8cca83ae1e29615c7056af35e8319f2af86fdccc4434cd7707e319c9b2356659d78867a6467a154e76b73c81260f3ab443cc039a0d42695076a79bd8ca25ebc8952ed443c2103b2900c9f58b6a1c8a6266e43880cda93bc64d714c980cd8688e8e63"),
std::make_tuple(ALG_SHA224, "e567a39ae4e5ef9b6801ea0561b72a5d4b5f385f0532fc9fe10a7570f869ae05c0bdedd6e0e22d4542e9ce826a188cac0731ae39c8f87f9771ef02132e64e2fb27ada8ff54b330dd93ad5e3ef82e0dda646248e35994bda10cf46e5abc98aa7443c03cddeb5ee2ab82d60100b1029631897970275f119d05daa2220a4a0defba"),
std::make_tuple(ALG_SHA224, "db9eae66bcacb01ba8029fbac5fef13156aa1a768c3dff259ee5ae6b1cc34c2280374e3d065fed67bddad3e7ded21bc75d397835bf52b4292b745d48c30bbb0935df04168c99d3f54d83d7e7bf8fc8108a9ba0d983f30793c7170f5d07bf2147221d38b7f9624c0c7f8312820f3de2550357f82a8227e0aa99572c708de96825"),
std::make_tuple(ALG_SHA224, "2e22656e48856240b0f655d2022d69ac731a1c63151ba36e57728a35cbf69c6b2d08029ea0c9af0c3a8bfbb9c3858dbebaca7fe4997cbd715b3cae423ae6171abd7b3c3af25f4832f8c5eef6c1675134167a21e5dce1072395a1443a2a959501e763596bc7aef559f28d78b2843c7bb690124c8f65b34b290f879344216bddc8"),
std::make_tuple(ALG_SHA224, "cf785002292f1ef9645f2f2cdc0455b29d0ba1efc91fde0a3ac05fa16995fbbc8e03550009fe6126011f23ab4bf7bac88da49ea4a3a126c941e34dd4da21b571c173ec878f1eefb0c4aeececb1464c969535f19706c9bcd9926853ffa7dc2153b0ef9eff8138d081f5341259d5991404fce6232eb93faa247578f98896704648"),
std::make_tuple(ALG_SHA224, "302219bc6c07e628f352a45091719bb0e655875fb97691388f187e377ccd27253a3c29787820dd7574948b97cc8dda3492a88b5e9e26670828347669967072a692aa7bab60e70c596eac2ee72d79ec82209306373306ea134debdf8928e7841361f4791ccb645c1e0923f7085c3cb7e2b99e60b31f2100a327c4225ddd3843b7"),
std::make_tuple(ALG_SHA224, "1fd68998e4c34ded43d2e51b1680a6b3fdfdd576033b6a0d7f4413fb39d27ccfce19ce9e56e876b043f0277a8c6322cc0cc2b54c25f00123a88a01f6f97bc8186eca0afef9b7def30707c20ca79ce05fef4890709be31decf89bcc9a018c1a8ec79146a016590f1c55bdbfbbae5068d26f386ecab03d45d037207ccd982efb99"),
std::make_tuple(ALG_SHA224, "90d0d6a410f8aa868b64128c039cc698a3b2e36700744969a0e741d0b9f164e73a56b8a60fe61b83a1f4e58a9d09c9b0f7dafc652e789968d1c745df42310fa7ba9b99e98d987deeb0ddea3478f68ec1a437b9b79ef4bf29fef59e2d5024e0321789c3941278986ebd0969b01bc9de71b3af6186d85281532e5894e16a32a131"),
std::make_tuple(ALG_SHA224, "644a3de6100dd8a36c841446b9376b345d478a329450a66f629313c5cc55133c4782ecd071963d74ffbd9156f63935651f054711b4b8105160ab94eb675e66f02018c185acced5e9e2465fb4897d7c5dca45bfffe432815d22b778230b8d8c6fd854e58f2b7d490dfd67a5e8d8c8e925474f19868c88a19a90ffeaf620a82ac1"),
std::make_tuple(ALG_SHA224, "29e9cb3482e9eda5e6d714a2dc730d91bdfb2d42b14fe82ed953a0fcce95bb4a4b30f8a926f003e985b647984e1e03c5df60a009007442c9157a9db599580a94c7a5d9449ac6e9fcf85677d52acc348990579a7a930d7ff6da45ebb9c14127b30711160cc6b3c866a97f4d6259c3c76538aac39c5262ca3d917d321030983a2f"),
std::make_tuple(ALG_SHA224, "467e8ea634f7995dc46c11b8ab0b7508894681e81c3502c3b335e897e6d69df885f49557ce232784e3519b727ba6843bd7af5063f8bc1d610f86ce5b35155e325ce175be8538395b34df67a421fca27e31330b59a41011b290a58bdc8e740401b38f5564c2fd7ae89f609ed607d578db7f1cda508af987be1fd946a25ab9346d"),
std::make_tuple(ALG_SHA256, "e567a39ae4e5ef9b6801ea0561b72a5d4b5f385f0532fc9fe10a7570f869ae05c0bdedd6e0e22d4542e9ce826a188cac0731ae39c8f87f9771ef02132e64e2fb27ada8ff54b330dd93ad5e3ef82e0dda646248e35994bda10cf46e5abc98aa7443c03cddeb5ee2ab82d60100b1029631897970275f119d05daa2220a4a0defba"),
std::make_tuple(ALG_SHA256, "db9eae66bcacb01ba8029fbac5fef13156aa1a768c3dff259ee5ae6b1cc34c2280374e3d065fed67bddad3e7ded21bc75d397835bf52b4292b745d48c30bbb0935df04168c99d3f54d83d7e7bf8fc8108a9ba0d983f30793c7170f5d07bf2147221d38b7f9624c0c7f8312820f3de2550357f82a8227e0aa99572c708de96825"),
std::make_tuple(ALG_SHA256, "2e22656e48856240b0f655d2022d69ac731a1c63151ba36e57728a35cbf69c6b2d08029ea0c9af0c3a8bfbb9c3858dbebaca7fe4997cbd715b3cae423ae6171abd7b3c3af25f4832f8c5eef6c1675134167a21e5dce1072395a1443a2a959501e763596bc7aef559f28d78b2843c7bb690124c8f65b34b290f879344216bddc8"),
std::make_tuple(ALG_SHA256, "cf785002292f1ef9645f2f2cdc0455b29d0ba1efc91fde0a3ac05fa16995fbbc8e03550009fe6126011f23ab4bf7bac88da49ea4a3a126c941e34dd4da21b571c173ec878f1eefb0c4aeececb1464c969535f19706c9bcd9926853ffa7dc2153b0ef9eff8138d081f5341259d5991404fce6232eb93faa247578f98896704648"),
std::make_tuple(ALG_SHA256, "302219bc6c07e628f352a45091719bb0e655875fb97691388f187e377ccd27253a3c29787820dd7574948b97cc8dda3492a88b5e9e26670828347669967072a692aa7bab60e70c596eac2ee72d79ec82209306373306ea134debdf8928e7841361f4791ccb645c1e0923f7085c3cb7e2b99e60b31f2100a327c4225ddd3843b7"),
std::make_tuple(ALG_SHA256, "1fd68998e4c34ded43d2e51b1680a6b3fdfdd576033b6a0d7f4413fb39d27ccfce19ce9e56e876b043f0277a8c6322cc0cc2b54c25f00123a88a01f6f97bc8186eca0afef9b7def30707c20ca79ce05fef4890709be31decf89bcc9a018c1a8ec79146a016590f1c55bdbfbbae5068d26f386ecab03d45d037207ccd982efb99"),
std::make_tuple(ALG_SHA256, "90d0d6a410f8aa868b64128c039cc698a3b2e36700744969a0e741d0b9f164e73a56b8a60fe61b83a1f4e58a9d09c9b0f7dafc652e789968d1c745df42310fa7ba9b99e98d987deeb0ddea3478f68ec1a437b9b79ef4bf29fef59e2d5024e0321789c3941278986ebd0969b01bc9de71b3af6186d85281532e5894e16a32a131"),
std::make_tuple(ALG_SHA256, "644a3de6100dd8a36c841446b9376b345d478a329450a66f629313c5cc55133c4782ecd071963d74ffbd9156f63935651f054711b4b8105160ab94eb675e66f02018c185acced5e9e2465fb4897d7c5dca45bfffe432815d22b778230b8d8c6fd854e58f2b7d490dfd67a5e8d8c8e925474f19868c88a19a90ffeaf620a82ac1"),
std::make_tuple(ALG_SHA256, "29e9cb3482e9eda5e6d714a2dc730d91bdfb2d42b14fe82ed953a0fcce95bb4a4b30f8a926f003e985b647984e1e03c5df60a009007442c9157a9db599580a94c7a5d9449ac6e9fcf85677d52acc348990579a7a930d7ff6da45ebb9c14127b30711160cc6b3c866a97f4d6259c3c76538aac39c5262ca3d917d321030983a2f"),
std::make_tuple(ALG_SHA256, "467e8ea634f7995dc46c11b8ab0b7508894681e81c3502c3b335e897e6d69df885f49557ce232784e3519b727ba6843bd7af5063f8bc1d610f86ce5b35155e325ce175be8538395b34df67a421fca27e31330b59a41011b290a58bdc8e740401b38f5564c2fd7ae89f609ed607d578db7f1cda508af987be1fd946a25ab9346d"),
std::make_tuple(ALG_SHA384, "e567a39ae4e5ef9b6801ea0561b72a5d4b5f385f0532fc9fe10a7570f869ae05c0bdedd6e0e22d4542e9ce826a188cac0731ae39c8f87f9771ef02132e64e2fb27ada8ff54b330dd93ad5e3ef82e0dda646248e35994bda10cf46e5abc98aa7443c03cddeb5ee2ab82d60100b1029631897970275f119d05daa2220a4a0defba"),
std::make_tuple(ALG_SHA384, "db9eae66bcacb01ba8029fbac5fef13156aa1a768c3dff259ee5ae6b1cc34c2280374e3d065fed67bddad3e7ded21bc75d397835bf52b4292b745d48c30bbb0935df04168c99d3f54d83d7e7bf8fc8108a9ba0d983f30793c7170f5d07bf2147221d38b7f9624c0c7f8312820f3de2550357f82a8227e0aa99572c708de96825"),
std::make_tuple(ALG_SHA384, "2e22656e48856240b0f655d2022d69ac731a1c63151ba36e57728a35cbf69c6b2d08029ea0c9af0c3a8bfbb9c3858dbebaca7fe4997cbd715b3cae423ae6171abd7b3c3af25f4832f8c5eef6c1675134167a21e5dce1072395a1443a2a959501e763596bc7aef559f28d78b2843c7bb690124c8f65b34b290f879344216bddc8"),
std::make_tuple(ALG_SHA384, "cf785002292f1ef9645f2f2cdc0455b29d0ba1efc91fde0a3ac05fa16995fbbc8e03550009fe6126011f23ab4bf7bac88da49ea4a3a126c941e34dd4da21b571c173ec878f1eefb0c4aeececb1464c969535f19706c9bcd9926853ffa7dc2153b0ef9eff8138d081f5341259d5991404fce6232eb93faa247578f98896704648"),
std::make_tuple(ALG_SHA384, "302219bc6c07e628f352a45091719bb0e655875fb97691388f187e377ccd27253a3c29787820dd7574948b97cc8dda3492a88b5e9e26670828347669967072a692aa7bab60e70c596eac2ee72d79ec82209306373306ea134debdf8928e7841361f4791ccb645c1e0923f7085c3cb7e2b99e60b31f2100a327c4225ddd3843b7"),
std::make_tuple(ALG_SHA384, "1fd68998e4c34ded43d2e51b1680a6b3fdfdd576033b6a0d7f4413fb39d27ccfce19ce9e56e876b043f0277a8c6322cc0cc2b54c25f00123a88a01f6f97bc8186eca0afef9b7def30707c20ca79ce05fef4890709be31decf89bcc9a018c1a8ec79146a016590f1c55bdbfbbae5068d26f386ecab03d45d037207ccd982efb99"),
std::make_tuple(ALG_SHA384, "90d0d6a410f8aa868b64128c039cc698a3b2e36700744969a0e741d0b9f164e73a56b8a60fe61b83a1f4e58a9d09c9b0f7dafc652e789968d1c745df42310fa7ba9b99e98d987deeb0ddea3478f68ec1a437b9b79ef4bf29fef59e2d5024e0321789c3941278986ebd0969b01bc9de71b3af6186d85281532e5894e16a32a131"),
std::make_tuple(ALG_SHA384, "644a3de6100dd8a36c841446b9376b345d478a329450a66f629313c5cc55133c4782ecd071963d74ffbd9156f63935651f054711b4b8105160ab94eb675e66f02018c185acced5e9e2465fb4897d7c5dca45bfffe432815d22b778230b8d8c6fd854e58f2b7d490dfd67a5e8d8c8e925474f19868c88a19a90ffeaf620a82ac1"),
std::make_tuple(ALG_SHA384, "29e9cb3482e9eda5e6d714a2dc730d91bdfb2d42b14fe82ed953a0fcce95bb4a4b30f8a926f003e985b647984e1e03c5df60a009007442c9157a9db599580a94c7a5d9449ac6e9fcf85677d52acc348990579a7a930d7ff6da45ebb9c14127b30711160cc6b3c866a97f4d6259c3c76538aac39c5262ca3d917d321030983a2f"),
std::make_tuple(ALG_SHA384, "467e8ea634f7995dc46c11b8ab0b7508894681e81c3502c3b335e897e6d69df885f49557ce232784e3519b727ba6843bd7af5063f8bc1d610f86ce5b35155e325ce175be8538395b34df67a421fca27e31330b59a41011b290a58bdc8e740401b38f5564c2fd7ae89f609ed607d578db7f1cda508af987be1fd946a25ab9346d"),
std::make_tuple(ALG_SHA512, "e567a39ae4e5ef9b6801ea0561b72a5d4b5f385f0532fc9fe10a7570f869ae05c0bdedd6e0e22d4542e9ce826a188cac0731ae39c8f87f9771ef02132e64e2fb27ada8ff54b330dd93ad5e3ef82e0dda646248e35994bda10cf46e5abc98aa7443c03cddeb5ee2ab82d60100b1029631897970275f119d05daa2220a4a0defba"),
std::make_tuple(ALG_SHA512, "db9eae66bcacb01ba8029fbac5fef13156aa1a768c3dff259ee5ae6b1cc34c2280374e3d065fed67bddad3e7ded21bc75d397835bf52b4292b745d48c30bbb0935df04168c99d3f54d83d7e7bf8fc8108a9ba0d983f30793c7170f5d07bf2147221d38b7f9624c0c7f8312820f3de2550357f82a8227e0aa99572c708de96825"),
std::make_tuple(ALG_SHA512, "2e22656e48856240b0f655d2022d69ac731a1c63151ba36e57728a35cbf69c6b2d08029ea0c9af0c3a8bfbb9c3858dbebaca7fe4997cbd715b3cae423ae6171abd7b3c3af25f4832f8c5eef6c1675134167a21e5dce1072395a1443a2a959501e763596bc7aef559f28d78b2843c7bb690124c8f65b34b290f879344216bddc8"),
std::make_tuple(ALG_SHA512, "cf785002292f1ef9645f2f2cdc0455b29d0ba1efc91fde0a3ac05fa16995fbbc8e03550009fe6126011f23ab4bf7bac88da49ea4a3a126c941e34dd4da21b571c173ec878f1eefb0c4aeececb1464c969535f19706c9bcd9926853ffa7dc2153b0ef9eff8138d081f5341259d5991404fce6232eb93faa247578f98896704648"),
std::make_tuple(ALG_SHA512, "302219bc6c07e628f352a45091719bb0e655875fb97691388f187e377ccd27253a3c29787820dd7574948b97cc8dda3492a88b5e9e26670828347669967072a692aa7bab60e70c596eac2ee72d79ec82209306373306ea134debdf8928e7841361f4791ccb645c1e0923f7085c3cb7e2b99e60b31f2100a327c4225ddd3843b7"),
std::make_tuple(ALG_SHA512, "1fd68998e4c34ded43d2e51b1680a6b3fdfdd576033b6a0d7f4413fb39d27ccfce19ce9e56e876b043f0277a8c6322cc0cc2b54c25f00123a88a01f6f97bc8186eca0afef9b7def30707c20ca79ce05fef4890709be31decf89bcc9a018c1a8ec79146a016590f1c55bdbfbbae5068d26f386ecab03d45d037207ccd982efb99"),
std::make_tuple(ALG_SHA512, "90d0d6a410f8aa868b64128c039cc698a3b2e36700744969a0e741d0b9f164e73a56b8a60fe61b83a1f4e58a9d09c9b0f7dafc652e789968d1c745df42310fa7ba9b99e98d987deeb0ddea3478f68ec1a437b9b79ef4bf29fef59e2d5024e0321789c3941278986ebd0969b01bc9de71b3af6186d85281532e5894e16a32a131"),
std::make_tuple(ALG_SHA512, "644a3de6100dd8a36c841446b9376b345d478a329450a66f629313c5cc55133c4782ecd071963d74ffbd9156f63935651f054711b4b8105160ab94eb675e66f02018c185acced5e9e2465fb4897d7c5dca45bfffe432815d22b778230b8d8c6fd854e58f2b7d490dfd67a5e8d8c8e925474f19868c88a19a90ffeaf620a82ac1"),
std::make_tuple(ALG_SHA512, "29e9cb3482e9eda5e6d714a2dc730d91bdfb2d42b14fe82ed953a0fcce95bb4a4b30f8a926f003e985b647984e1e03c5df60a009007442c9157a9db599580a94c7a5d9449ac6e9fcf85677d52acc348990579a7a930d7ff6da45ebb9c14127b30711160cc6b3c866a97f4d6259c3c76538aac39c5262ca3d917d321030983a2f"),
std::make_tuple(ALG_SHA512, "467e8ea634f7995dc46c11b8ab0b7508894681e81c3502c3b335e897e6d69df885f49557ce232784e3519b727ba6843bd7af5063f8bc1d610f86ce5b35155e325ce175be8538395b34df67a421fca27e31330b59a41011b290a58bdc8e740401b38f5564c2fd7ae89f609ed607d578db7f1cda508af987be1fd946a25ab9346d"),
},
{
std::make_tuple(ALG_SHA1, "f4461d25951ea6965bbe2b16f1f9c7a2714e875f7ab12281838fe46b6f0cec17618f97b9d1803c9fe0501a5ce8ba8e2558498a7bbf1b420b26e428d2a3351b842bffdb2fa853c11b4b6badf624ee3f2df0704a9d3238856b854784303096e75afb9ed2cf411d9dd34718cc2bcc1c4182e1cab00dfb93546b47bfe0cf3db4b960"),
std::make_tuple(ALG_SHA1, "460a92b19bb8c0bdf66aa46547df517eddb733d22d2af772cffaa54ec9a60f0210e16ff34c424c9bdc3d9d211a52312de0844efa4b0d99adbe5035e52a0f2f938dde1a0cb9d8f65c579057dd2b4bc3099a6c5b8d692fbd9ec79a2a908eb1e4a5c6eada236be087a96f4b18c20330cdbb1355a1b20ff82df0f1c0ca797cf4f6e0"),
std::make_tuple(ALG_SHA1, "a737ccb2c336163e224d776dde7ef3033a510b4fd82e8fb12c0ab4593046665159d3dfbeca9b7963c91cc0666f56cc57a3e8ce6e4976e814b64d42a5674a5a75f3f89b113ff832c7f1a61d6827f9844c68ab4d97db9aebbbb66f763efa7d01be5eec28328816e8728331b4fa6e2fc4ea71e2b152f6643fad15b679ab4fa70434"),
std::make_tuple(ALG_SHA1, "d14aae46a4c4a9617145adfce65478f147b21824b68e505cb1f83d51dc98390601a0005855ff12d7fdd858d6d03209be5ff1cfa83205262a55e10570142ec18f02c12e1740cb07e7fb50904637db792fcb6f06ebadc06de670a380bb0bc48b91dc9780aaed91513975979e74a2b790eb95160518af29ed370b28f3584bc061b2"),
std::make_tuple(ALG_SHA1, "88836b5a0a3200f8571635f5d0991e20d826cb5d93de28f8ed8d2239dfdc0b39eec840f3f452099e2278c03b4665366a4ae55281fd1bfbdf1776387e77e196c8ae3acbacc10698f02b63f4c9223d66a91bc5b358901fb946015b9b2039a71ea1d2c353abfbb5779679bd17c8ec8b778554b03509d3532ad4b5259146ad976b6b"),
std::make_tuple(ALG_SHA1, "fd31e83f7af727138a634e96505cbc803be96bb03697c5b71f1cb99a7b390dd468e5f69bd2a7e664ea44a5a9d49aa3eaa0cc8df27c9f1e5b28243854aa9833a2428875e5a038421d5546d66c888bb11eea4233e6ec6c686a2f7325023b0d54bd75638ca64b73e545b2b20a68d2f68f23ff948515ecc54ced1b4fa92d9861182e"),
std::make_tuple(ALG_SHA1, "f15cb6c5705a8d0e6f1092cd09ffd12ec8574888bbbd9c3ec84b0be344d8a2a1c17ab0db274a7a11076730042b3e201b72082a06db9374a1df465f1b0460b957af803492396a16474608334f52af184d8da48a49e9df2f9b710e8a0bdcdd2d3662752934ce42ca77d5fa81f6a6db228bc2344f9a0e2634f426ac76fbf5d96506"),
std::make_tuple(ALG_SHA1, "ad354218cf73e07d261929339a4556da534509e317a33badd35e76ee777b455507bcea6eefb04ec598ec3e4e3897d304ee2c32d10e7b76aebaf1eb0bb21a7d716c64706668265191bee02c1ef9c5ff6427766fc53111bad6696aedc0629857e704b43dc9dfddcf28c07f5b6b82d5c14227ad2789286ced6f0851e3d72ffebafe"),
std::make_tuple(ALG_SHA1, "89de252d69eb32a94b80ffdc2bbb04e8f0f015e996419c2b8c6e269a5bee2179893ee357bd79ef3f23297430125c17ccedfbf2544758ddd44a06ec9b59ed39eef49de3fedce35617789acd1978c4162cb8da95b067608c7368bb9a27f847811392a52c080f52f097127e1281a31b896f1a3406e33f80326faf3736258224814e"),
std::make_tuple(ALG_SHA1, "14581fc3d8c6ea6a14c9fb216c86bb412d218744341bb0c20cdfc6a0569716846e44718b4b0e2f3fa7d874c36018b2511fe66fe73753493cd0fb37f944de1126c96b53e251de1e58aecc7feefafcf4bf36792c4c31e50f6eab10fe90bbca5c1a6ef54d30b1debd9d71cda50a00da8974bb0346ddea7c0a41e746a4cb8303fe49"),
std::make_tuple(ALG_SHA224, "f4461d25951ea6965bbe2b16f1f9c7a2714e875f7ab12281838fe46b6f0cec17618f97b9d1803c9fe0501a5ce8ba8e2558498a7bbf1b420b26e428d2a3351b842bffdb2fa853c11b4b6badf624ee3f2df0704a9d3238856b854784303096e75afb9ed2cf411d9dd34718cc2bcc1c4182e1cab00dfb93546b47bfe0cf3db4b960"),
std::make_tuple(ALG_SHA224, "460a92b19bb8c0bdf66aa46547df517eddb733d22d2af772cffaa54ec9a60f0210e16ff34c424c9bdc3d9d211a52312de0844efa4b0d99adbe5035e52a0f2f938dde1a0cb9d8f65c579057dd2b4bc3099a6c5b8d692fbd9ec79a2a908eb1e4a5c6eada236be087a96f4b18c20330cdbb1355a1b20ff82df0f1c0ca797cf4f6e0"),
std::make_tuple(ALG_SHA224, "b12c24b0a33a8ff0a141bbf14f650331803c7ffd9e9983e54da2696c4b2991049a39a539e2ee222c118a144344c6211fea66c8ce2610eb42765e8b029332d420984a596b6514a0e546c3e178d0a20be40ca808fcd84d4212899d66b0d58b6889f187c7aef65312058912abf8bba2cb6a2e2bc6ef7af8903cce8680dcdbdb5525"),
std::make_tuple(ALG_SHA224, "662ffccab13472140db866fa562f49ba20f0e976584339e429bb55481dc6c19f8582f11d1ad20fdae4b2f8c95bc788e9cd3a17bfffc743031711f09ab9398ec471ae9b97514768acdb8f1f182160059d2ab3fd2298b64e61881fa5e0bac05e22f25cff1e9dba05f0b8f7e4cfee20493f0001a2876a37e066448d7b026685b721"),
std::make_tuple(ALG_SHA224, "fb91d32d2cbd4ffb4046a36de1bc73a6777bfa09a622aa4f174612d67c67053cce22f92dd9a9ad79fb710f6a292a5c5432f4896d48d0e2dfbc54f11c09a4a172149da3dfb25311266bbe51227eb03d5b240a80d71930433359ba0af2276dd81454699aeabea3c22a1796333fe8365de2d526a9ee222a177076df25fedfaaf44b"),
std::make_tuple(ALG_SHA224, "a70a6fc8945a7ce5a81892f9b16d809faeece60ad67d5598dc99b2a972bddbb10c188d8ce687861248c4e6ec09dbdba652dd7d04a4d7f79a1c05e897f64409e251c60f683109d3b4ca0ab0c0fcb62c0a1aa1dbebeffa812403bf77ba1a2d5005fe7bbb037ec7abf2b751b61d92e7bbf68ea0c865c0cd3b60182d27bce560f942"),
std::make_tuple(ALG_SHA224, "e84488e1d4b6d35f82767514d46d044eae850f73b260014d4e4b48a6f96db715b9442917e953686139144d75f63428748cff6133491a60906370ab073d6e4e80e673806be282830f2e3bcc1f7e09648fc99c8ea5079aaa533a9159c4ab31e23576b8d50648adee1168d13b3af45381476e43ddf37749a73dd9979b06cb1c3bdb"),
std::make_tuple(ALG_SHA224, "cc8cf669edf786837bfbb48dea4743c4d22527e4504eff9caa03e03f315954bc6cd5a2d07238507a989ce7b04cc0f65041a15959cd4abb5b8fec5a2c54310add3bce7dec1858c1bb17580a41a2a1b20084e17e374e772358f98409bcce454e9683a00e26a7fce22f4056a6aab29180bce20e1de69c7d3e7c32f37458663c27cf"),
std::make_tuple(ALG_SHA224, "9cf9206031fb19bd87fc50aa4d3b1bf3b86e66a331aa060f4b824a16f773d3a8fb80a685a0198047ab416aa38ff08cece1b646d80ca27d87466233c1c3ab5b8028dcebae42de322ff84e6c227ede9464ccf879564fa514e1deae19b7ef01ccdb0b5516637f11d87d556a7fb082ccd964617c27a5607b7324faad237ee53acfc1"),
std::make_tuple(ALG_SHA224, "41fbaee4805d64635b050113023350daccb08964cf0d837dad2f25bfb00c1e6e1aafd5a0b682a3a1b3cc4195b2797c5f1e1a30c2bc2c73c6839d115ead8c39470e517533a5bddf2771a29322859660ff5ff5c39c7625153c121e032a60293fa0c6e775e6749681be3c90df00a31462823849293a2480d0a703bae36cf26a983f"),
std::make_tuple(ALG_SHA256, "37d7fee3d31934912167e1ffb35b4b2f159e84bd02513d65d8abdbc44ae3cd6355501cf175cf43d0186542d45325ee47d4548b3018cc9cd4de9efa7edbfb247caf55d66a18c1ddb365a029542e7e24e3433a42d0e267d9ec2df33427da06e39e2d2d54d523b8a840f161bf09ac2e950d4a98d228c9ec9cb2aef2b049b1cdb1d1"),
std::make_tuple(ALG_SHA256, "15750e411ed6b1487e9bfae96aaf758f6c059ce1668af84fd45889eb512c687b5d1aabcc5d7f8949e338bfcb301131b3f780d5376494cdf95d28d3de085cda1d8d46f2961de46d66335540b81949acddafb71da068ce52d3952dbe2ee6562e5a2d60ad4866eda4c7f55c46562e402b361a103bc47820ce0603cf1284f302ac59"),
std::make_tuple(ALG_SHA256, "369d20e16d4a6574d4f9ee511106bc494268f7b5eed982b73b38d3c2622b025c61081f22f0f6c90db54ffcf5bb492b5321d68f4b0fc8beeaee397facd92add414e6a7a902aba26fdd42eb0e7b8d6fc75f79e56935c73063793a725e99597af82678bd93404dda4ca985eb231eef558382c89f694be218327904a6c8280ba9fa8"),
std::make_tuple(ALG_SHA256, "1f75ef4371178356081e4bab44fc3c706a706f6eecb580e0ebf93485fa105ef4256a03303242bc7c26195c700b63d34df180528e33edb0bffbbc0d920841b530af0f46cd2023167feb5ecf50c3395c9281b409726c8fe5d0b7bd6b4e4b1662a7c74c0243c520580860d5ec72f3e5a0e622f4db431f02e7bb26e498e14af52f02"),
std::make_tuple(ALG_SHA256, "7f07b5c76d5b9e9d77d3b03b69de2f21cea9228b06e5075098cac60ac95ce4776dedf91ffde36437eabb3dc6314e8b063053b70db72641ac63c8b2982726d2c72c9e1a1ddbbf6c48385002e97194a5f4b6cd1f594cfff2e4ddf64a61138a31056522020930772098099be7eb5239e3b30b1e40b7ebf882beaf5e77afb31169f7"),
std::make_tuple(ALG_SHA256, "57678a5baa2b4a39f8c33f62a3977fa9f9516116b64a27f4ca41e1265d538eba112783c1876a115d247b621b1567a483901769ee5dc84e9896bcdbf6ab2fab4aa88dcd74bbe2690bf192a7ac404acc92ca36a76760752b5a45ca5d7235947122a6002f1d4e7d9c6be570d7bd2c2941fe2e16e02ac637066361d22d420568266b"),
std::make_tuple(ALG_SHA256, "15b1e07d9a1bfe53c7becfed15c721ef602b641d33dd0c29464437c845ec900bd37c73edcfe85229d6e7574e09a84a1410c0b6f15f6847e8b7e577a2f04769bff756156e13caa63b6cba2029cd574601a9dabbe95cbb6738b4241c89b0a57a0f87291028ec29c334911f74a7ea3edd5d3360bc2eb44034c344e970a70c6e89a1"),
std::make_tuple(ALG_SHA256, "50b0b8dab5921fbb12b835222008164e6de95b04ff58e03d3a39cb1c04eac922261e9ba5f5e9d27e3317d60330c22d353424fa3a21a9c40d55487974ce14b332910e397e4c3ec9b53a02154c47a50b08753359717e8c3184bbb849a8447a27e359289b4e00b98dc6f020f8e5aed93730f6c180925c2aae0a332f43a0ae45ad9d"),
std::make_tuple(ALG_SHA256, "5511c2b0d2dfd25992ad78735f326382ff2b2a5359f48e32da55005e179e63bab4f612c584f025ccf15ff05f9f6ccd014ce51c23fbd8875451618bb23fc033a4e1ae27cba6f2e635b22f50d48000672fcc465658b0c1b31e0dde01832cd07971a5e20aa8800c9efb9bc49fbc4b16b97546f7e2d8c1d798f9d5756abb27f7ba88"),
std::make_tuple(ALG_SHA256, "67567351452fd3aefce4671f63c1d5036dc1c0bffb0c3f62f4be8e8598ea047611df45954ba9b9fd06db3d672a8c184c5aa0304acb497ec957ccbfdecd896c708c36ed99506b0a4e4b63a24378019f092c112979eed11a5688afb22e5e558d81ffe3d126fa7bace9f303fe79f52652820a9c131609acfd51b0efd13df2564df3"),
std::make_tuple(ALG_SHA384, "37d7fee3d31934912167e1ffb35b4b2f159e84bd02513d65d8abdbc44ae3cd6355501cf175cf43d0186542d45325ee47d4548b3018cc9cd4de9efa7edbfb247caf55d66a18c1ddb365a029542e7e24e3433a42d0e267d9ec2df33427da06e39e2d2d54d523b8a840f161bf09ac2e950d4a98d228c9ec9cb2aef2b049b1cdb1d1"),
std::make_tuple(ALG_SHA384, "15750e411ed6b1487e9bfae96aaf758f6c059ce1668af84fd45889eb512c687b5d1aabcc5d7f8949e338bfcb301131b3f780d5376494cdf95d28d3de085cda1d8d46f2961de46d66335540b81949acddafb71da068ce52d3952dbe2ee6562e5a2d60ad4866eda4c7f55c46562e402b361a103bc47820ce0603cf1284f302ac59"),
std::make_tuple(ALG_SHA384, "369d20e16d4a6574d4f9ee511106bc494268f7b5eed982b73b38d3c2622b025c61081f22f0f6c90db54ffcf5bb492b5321d68f4b0fc8beeaee397facd92add414e6a7a902aba26fdd42eb0e7b8d6fc75f79e56935c73063793a725e99597af82678bd93404dda4ca985eb231eef558382c89f694be218327904a6c8280ba9fa8"),
std::make_tuple(ALG_SHA384, "1f75ef4371178356081e4bab44fc3c706a706f6eecb580e0ebf93485fa105ef4256a03303242bc7c26195c700b63d34df180528e33edb0bffbbc0d920841b530af0f46cd2023167feb5ecf50c3395c9281b409726c8fe5d0b7bd6b4e4b1662a7c74c0243c520580860d5ec72f3e5a0e622f4db431f02e7bb26e498e14af52f02"),
std::make_tuple(ALG_SHA384, "82037ec6b8b2c72ef7cf1c67e480dfdb90a2496f9d5eaeb7a3fd0265d1fd9d08d8643bf30454477aace05965cd1efd9ef27db62d575942664dcd2061e0c950abb8645a3b3d7391a8ff5a99995422277c43cc087ba0e565ab795b4587b18f539eebabe288a9362e1eb5e6e4ebc1b5e5dd4a364740c22a9deded4f79bf8c782f47"),
std::make_tuple(ALG_SHA384, "06a21cb4062d114a1ca2d0f79cd174b4a82749f100303b371a5a8e0c76fccf172c960a84c75b3daa55ec0debbf67b8dc57a04ba6b0ae15adb2aa5b6fedb34dae2e3539d1506bff885523c5afb6c2eb75f68741bd7d1478c4a42ad7040db42f59350711634c683e2b44ce5f0928eaf7c5af6595fc11694ec519626a957b065e60"),
std::make_tuple(ALG_SHA384, "a9c872524df7da7de23b47cb7735677f5bd00a7fe7c68efa9f679a4d7a9610287d143cec8e015258889f17658b5ade6e9605b6945767e26141f689ace0e2afbc695564b096fa3b1db0bcfefaedd0a0b9fdf573b7e0fa9bd6fa81c36869040f50961551630aea7f1584186551489f97a8b927aaae2a89a3a1f291b04cbe03162b"),
std::make_tuple(ALG_SHA384, "e33f32f8b487703a3860f3c5a2451efb19cdf5625fc8df56b18ba9fbef88cf76fd22f75d69bfbf6b4e1eb87978ebb2a9c8903be5da4f6288e68dc15ae471bac2f4ae0037fc9d59f8938fa3fd1e61152d3851c8d1580f7649ad1881fd4d3f37978f8c5470b54ac847cf5cbb39dcd0cfed31b7a5101f33a201d0d1f3cd7219ce5d"),
std::make_tuple(ALG_SHA384, "95622ab710f99332c2b812c2297a24c2c8097ee2193ea26fc969b1d524f28062cf41ed4cb5dc74f643cffd6fd851f83b77a4ac57c03dcc771e254c92419f72a0cf0b30a3560ab1e486e3327f9d261321228f2e11d62c676de8c284b7686e4090fe889ac2dccc7384f1bc58fa5f409dfc3090ab1844539ada8e09034a81a60fb7"),
std::make_tuple(ALG_SHA384, "243c80bcda3b5ce186260bbf694b75313f81e9dd6ab85f664cd400e4f5bce891fead2ac4b4d514247a1db51568469d773837e49063956e4687956c920c0e263107d3f99d5e3f9b3b2e11a7d6697a554cc4758887d0570faf66a7249e492f39950753f52d20a279906aabe7e8b4122518aae3deabf925ca09b3b330f1f447a923"),
std::make_tuple(ALG_SHA512, "281573d668f14475977c9fb6204369392d944a5abf405f10fe9f2f15ced5e148a254ac4f95a28e80b75d4102a47c6b2f5cd7153d4eea5e1eb6d570a429a8b4e96ede42ee90279c82316b9b66210ba9ae306a316a40ac54869ebddeef929578f734bb1ffb8208d443b0ae9529bf798d7e51548829bc0ea9115d5e5f3e2f25953b"),
std::make_tuple(ALG_SHA512, "c4095a74b43fec6a10af4a84630d6caa89143016646daa58d0d3bb9dd875e5302a9b5d41c88d62e601b1ce5fa0f3eb9e63698707ae374b7481b1487ca8c0d3f5318793b72346d8a36d7e2ee41d563375d23da5e374d1bf5522ffc6c96c6cdfa0c314235d2d32f5aa3e5f939c43fdec37c0d6b2351d01af039c065c0d8e41b03b"),
std::make_tuple(ALG_SHA512, "4e0ea4cd4106880242667f17586ae8bdffe94c2c1f7def683fe4a5c3f6a6e7a3a3f826855ee15f422f9bf0917d3caacec99627fa9c5b5e02bd857444a8f4d64f3c5984eab454b059d8d987db74d84f770a1db2f8c4755937ac12bd981f303ad77ff9660529a6a0cda7e8ecfc2686fe412a4794308012098d755427c845a23ec4"),
std::make_tuple(ALG_SHA512, "2de2a6e5f415badfa2749d7b42743b01cfb3100f3ce64831b71225b12f00a2b114eb56765e7b9a07d0f7eef77eb6997f8dd690d03a3199a61d8db021af13aad10b03180ff1a56e941083654485d59d4b9f3d876be5b482945ac444b6fff97cd39a92b558b67b7eadeb80c80b5fbb8f8e8d4ebd8b45584b23f421a918269860e0"),
std::make_tuple(ALG_SHA512, "66614022324dc6ea068c1afaefc4dac998c520541b11fcc0179c224103d0df3ac1d452a6760ed8b69ae7c8bb4bce6147e77f008fd9859614b3fd5a837e9ebbd94df699ca19f6b464c8b165f08f618c197aabc9504924ef6e7e13b59bb479af6f324e7d58c00e433cba74595f628543867ad1e35d13f6ed16a0659c534e69a346"),
std::make_tuple(ALG_SHA512, "32a73e45bfd575a2df076774b6e3f3aabf031dccb64910ecb5725fd99dee9095b7efdb099bc12ff851597632b7301a0a2252c80948b174e45ec09dac7d3dd2454a4e7519d6d0bf0dc3ec04b5a9eb38c3b74bb3c69e123111aa621df8324e0f4333ec93dc38ab2ccb7de7986453bb56bfc61766697e125059e381672685c84f77"),
std::make_tuple(ALG_SHA512, "78e2c1f94635d3eb3f1be98bf869dc62a3121c2ed9e397359770ddda864e826e7f82c4484e3a6e18b6bbfd78b69b00c40b30c52cf64831073f1af06a7a7dcffa895865fe625af9b913eba0f60362a6e47a782f2463fc1e2151c936a0c1f67f989f4cec430bfd3a755c921b2d65269469f8d2a43fa968262ad464f8a2e21f5def"),
std::make_tuple(ALG_SHA512, "c63e4c2d1b90a18f14894fff97c3958f0276dcd51d9d48364d548d650a85042692c3fe58df765832d7394fcdc48096e2037ea6d6004656f36230abf9827ef1d5223f0ab05c74072bd872f5e94287f94ffbe0a0870faa70cb6878c3e041e5d5e0dd7a1b3d78d2d6037efbe95dfb20e75b526571f23313bf45c7f57c222d02d7d0"),
std::make_tuple(ALG_SHA512, "21e9a566b5c780b65e3a1c42df89f79d4c0b5900cadf379b96dc572d49cbb5d35ad4261de4373b67a93d6867586d65020b02d564149d264ff938b8b3bd5b4180619270b8ab1ed0c826ebf0186ac2c1e19dc03f3f3a07538711b3f8da90109efa400acb5d92e40880dc2dfb7e9ff0d1e10b2cdfb8c58388eae73661c9495193ea"),
std::make_tuple(ALG_SHA512, "a19edcee04d171ec1c94426a08dd7cba642bb7dcbc211445467488e0d0087753f75685839a11a95a8e0983c8934fef07879ada24dae954bb426ae702b09b270882af8b3ffa337b39eff1aaafc215a6c7948eae96b6b7c3e461370130a82630f4aa71972b0c7f100fa71462277d76ca81f2cfdb3d39d3894b0ca28074a0f0ba9f"),
},
{
std::make_tuple(ALG_SHA1, "544be0a4044edcdc1240f2182109f826d784ea613486dfd5221d3ba44d1525a934c13c5a81f885f3955da8d168e35d1b909121a89f832d1db232a85647f51c084fc727a4854a737efd0ce72e00091f3617721ae666ad337d3b9d5391e72364b1cde50948b84e8cc472d618f8928328bf95af3fe3300dda3de5e7a21dd5a9e7ec"),
std::make_tuple(ALG_SHA1, "8a66370970925dda75609a710ad1fa75d04e523c508f8cd6ecbd3f4d15d3832bbf4a033d12f55397632a84d86222f6af95a26e9e05db68fe3790af445d762a82cee0f931b49bc12d04174301b4c8346528cc4805edce9184a92a07c1525268599f70426dbc4d4da54271ff74668c5b9e71140af87030ac6f2cd5704c5c2ee2b7"),
std::make_tuple(ALG_SHA1, "a8f41af433ff314d93e0d1e0bc05c427cb682697f6b705ddc3b32a6779d63526d438f092fdb3ddefb94511cfe1b745d9127c2bc8a5dcfeb7e2525d9b70325911108ecd5a8c5beea3e9d0228ae40f16df9d070aa78d997067bdf9b69f3a586094c4c05952c63f8bf28b47ad19ae555cc1d2d16e3c94358375be72dc7abd907137"),
std::make_tuple(ALG_SHA1, "9044d199a837832558657fdf67c8ea224f41317eef7f54ba84228519d620f1ddaf68de0a91c6f66ca807e2dbfe5d1bbeee05fdcedb261e1d22fddd564c373e46899ef59b5af8c0ec8d2cfafa6ea76e363cfe6983dad5133cc7fffe7950e7008e042e3ed569958aaeed1eefc31f6e89911f769a245352db215c71100a49f7dfbe"),
std::make_tuple(ALG_SHA1, "b796c34f1d4e1dfb3010282bee33eb9da90e73f7ff186b0c0d4eed5be0d598d82ce1e3f041d5b0c73aac25c47897b74f4fe787d9fe2ef21de5a163a6f2c16c925d3b1695950c75417ae87f84ccdd1e72e3348344a198bea1a67a8b1dc2b36f00b06b0448013a91f1568ede73d24d478dcfbb0e41d09df620b79f0dc739f3c9aa"),
std::make_tuple(ALG_SHA1, "4b6308be5b3d99ee6785bcce2566047ad96adf7680e26b364e878be45b613b5d9ae8207d0a6a639c30acc058c4d4da95ab86d2c3254e1760483e80bdadd89804692e397a3e475c0213c52fe3a2c568ca7107d913034f45444f0a73da71358049a07b793e609d2a27f81730f52701562013331eec82ac9dec4c358cc411419d32"),
std::make_tuple(ALG_SHA1, "693b3235e6576d1f9d17b9d200b9b289306a1f03c0ffd2d7bce5d008e95bb2d94fde4be2f5e58b64eccfa3da8e1a6ad008d500f81658b17b0e321c8d20639444dcccc6aaf4e39c1144ab62a60fe428498c7e679ca154e75aee17dfeb0d885f3518ebebb46cb868cdad933d5f0b7eb29cc34e9b17e85b3b1d637c63493933da53"),
std::make_tuple(ALG_SHA1, "c7960decb793f6d8414918eae60716868bee1c7dcdf9ce30943b7ff9eb68a4c60f978807c54641cbf19fe22565faf2d5f7a21d24d6dc2a101e252da9a9bcfebb2960e9ad735ba7a91ebf8dfe4df004c2c96239bb53a41680389e70db251782723d7a9aa669d912bcef32823a47f134942ab7d808eb5a79c70a2db05507811832"),
std::make_tuple(ALG_SHA1, "6278d8bc32dc6b039f138c9260c8c90d98607fafaa824cea4fd7c74de60e6fab0b24e27a6ae25079d5a72e9695672f0efef470d6477cf23a98534ec463f3a45ff842d5bc5413f2f53aeef4708614ad07bdbefe65e8a64bb3a3c82c75716a65ae525a194b98773abef67244eadad62b3ffc46912637063d9f99bec928b67a9ae2"),
std::make_tuple(ALG_SHA1, "e823b2f062bb10a41f3ab2a0c4bd110b2dc2846f0f3a066adbe039a6e5c8ab0ac53b5832fdc2711ddd815c26a4c6fc36e8e232373838a4ccff93bd3fabbdf5bb0f4d52bb06c02ec25acb3c4de4f0c605f450383af3c0e28d461efaec76e6e0c48e00a671c5dcd0fa5dc158fbcb62f6e218b39e5e87fa49157829f8968c6bf68e"),
std::make_tuple(ALG_SHA224, "79bcffbfd6bcf638934b38e47a1b821dc97cafe1da757f820313989ebc01ca52ff5997abf5baf35dce9b48b8f0debdd755a8b81b2e71a1d8cd57ea4dc1b84cda43ff536dd1be1c3e18fe5ebc17d3a7c68233e81f6407341c0983c5a01bb3404a0b5739edb2f1fa41391c80d8361fc75317c248d5c461bfb8803e317f101b2e0c"),
std::make_tuple(ALG_SHA224, "8f27e8fbea155d20335395dd11bc9572d42e4c6009d5cace4bacae2b5c40dd1574b87a79d81212fcafaf169a11128f8d62e50d71de3ce0a5741e8bf4d8427675d416e3afdf052301f0fa0a429420a0a43fed19dedf5e088ab784cfcb6b3f5a34574a0de52577faf79f3c581bc16f307d134e5aef36c2a843bce561f83dc1f11a"),
std::make_tuple(ALG_SHA224, "cfd6f7246114ab011c28dc654ac7bec465172e92d86499a006141aa88ddde227cc35dd6aa30a93ec79b44cdf84287709446e4cd15155b19a57655a4f5f15353f503e052cb5d04c9ec0c46f7d8f5115dfaf63d01fdf49ff2f16adf32fc7ca503e63d9b69020cca1c0f93f8e68f5ac60f0adde01a308a84c084ad62b6f4d64fcca"),
std::make_tuple(ALG_SHA224, "d737bd2d037ec4be9e03781a6755bde384d3fd2bd2b91d947a5bb0b5c5ab6bc03101d962c41c50eba06424afd8711aac82d1206d0d063b2ed5cfc040f5a9c7af5c94dd23241af9041f8eb2e1b292ae13e6db5e9dbc39e857c1d1654ce3ad4d6083782f36cb82a650420b88789dbd605fd97a1f8586580e5866ea07a036c2e51a"),
std::make_tuple(ALG_SHA224, "05320d0d47199301120046f64d46d274acda40f21d087749639202690003134b5940c8271560aee6c6bd84dacb4b41ad7529589768763ad444661c568595fbb7a89bde7190e05c5127b25d29489425c6ddd98e21447294d9f80517e16d3fdd763b6ad7557f42a52a7e045b4b8cc986a62d126af979a48e41c5967b747fa8c072"),
std::make_tuple(ALG_SHA224, "a032ba951de84ef9d6519bbbcdf35bc4181ff2f5e5db96bbbb20b3e403468eb1c6bc282cb8fc65bb76be6df60c6c53b6bad7f56ef82823bfb7190346ea65b3b9457c3132447c78ca705dec6ade6bf8def8faf62b7f554f23d1f7e33668feab8ba4dc9c50ca50cf4e4c95e0c04bd994655af0bed4854a631092221c5c86f9bc50"),
std::make_tuple(ALG_SHA224, "e871e6cb03936cb8fcab5a87027e77b23aea33b9b4123b679ebb4a56b7f642b507007b49ce665bb2ba6c27f05cb01825dd0bb29cedb8510bfdb80515ae749f1389a50c14f071e22254d639c8a94cbcd117a60051f33a14eaed4159488b8193eed629413553fc2a9134b13917d09a8a3c5185c5e0ace0ab8bd720eef6366346cd"),
std::make_tuple(ALG_SHA224, "af9a8bcf29570b646bd2141e06ea57f3e85fe3cc258a00ddf74b5b320342648bdd42f56acf02346ad616bad2ee1ef56a8f3eca8e78ce7f80ab52d903b9ac81253f90ac5cb139fbd4565aa0089458c3906eb624394bd1015bf9cd3a67f1cfb3c0dd6cfacc57622a4af4860fe681fe8a0a8cb037f827fa4e16e8a4c7883413c204"),
std::make_tuple(ALG_SHA224, "7d56334f1003356b971e13847159487b1228040a56c724ef157e624df824c94f8be26d0e933958b5a146c7e3e74597504b55fab4ba7a6ee4bfe8f03e547f6c48f892799401ec43e73415c89993d1483f76eaf688dd2ff46505bd7e6d397d667febeec0a90325de4877127f711c044390bc6f624f68ee9eba0f8476a050279d3c"),
std::make_tuple(ALG_SHA224, "f96c50dfae376c4f4dd0849edded04d74b995ef3bc35fefc22bc7f730d4b1ff0c5e070089561517369e11d6e9c20225f0b5055b86e1f431de8f14bc9dc6d0b2e033c18dbbb0df2a3a2dd37fc647516a5d134078c330eb9eeded54cc008b7c14edb09af22c9433727204b390edef6c8f1c6ccdc36b30b47b72defeb1f3a312997"),
std::make_tuple(ALG_SHA256, "6504921a97cd57aa8f3863dc32e1f2d0b57aff63106e59f6afc3f9726b459388bae16b3e224f6aa7f4f471f13606eda6e1f1ac2b4df9ef8de921c07c2f4c8598d7a3d6ec4b368cb85ce61a74338221118a303e821c0f277b591af6795f50c40226127a2efacce4662fd7076c109eb59b18005e7165f6294a6976436ee397774e"),
std::make_tuple(ALG_SHA256, "1a53a9d6312918f3db6bd5766da981854166ddf2b613ebc8793f50230308fd4563d50ee73e47f2cd146ccd9dc4361af1532c95abe96058891ca144f971f1a22e203a0a73183c84bf43caee8a0b369ee01d0a48b46df821767a1444e8d341552ddae96522c8f216f2f1ed00e54a9053792866bdb44ac58eb81a011a9830df5e6a"),
std::make_tuple(ALG_SHA256, "ddf5750aba4be69c944d71896361f210f961ee6b38f96e5481500ec76fea510ac6cd37eba6e21249059f95d55ce32e1a9f2196bb73c1a6fc9cc36c84b4a67e6223888e4d4b8e3f30038637e647cb75412d69e5521b8232e438f1dc4a202c8a5bdc6fa1ba1117155b774c80428de2718e8c8106b79904bd143e2087a01b461efd"),
std::make_tuple(ALG_SHA256, "f866ae4a8c37ce71c0e047ecdf0b6bd07f8b11adbd92f363ca245536a7cbe8242c8ded754f1b9d95a34bc91f1fc8be3a21086b28b27fc61c0c136b4c5acf8648bedbf48a98aca54e067845a4a7ed1bc3a52231a0f2ceb5bfd1b89f49996e9460b53a0aaff052ae45f04f02a3ffe04b1312c0aa3c03e589f422fb3855ec10d813"),
std::make_tuple(ALG_SHA256, "d737bd2729d1835f243983fbc152a19a2e659a5d211ff3006dd92f4ad31d45a81a65511561258a3cb50c74e1df87577d7f88ef285f8565bc01c37e387ad41362835fc1b1ce1fe169962eba087a84f6e18bba5307a4149b6cfabfd64af357bec23cad73c416c6702ef027be383b4f670f7a862ec098d57d587f569f49e6ae2f10"),
std::make_tuple(ALG_SHA256, "10e3b453719469227b51da0c41b5cf0fd94b32b6b3960b3c2855aff5560433ea2ca627c3c1c281ebeaacd8ee0b05d3262d85e09651f829160487c4b13439294b42baea86585a9ee7fd581e35e761f5221054112e0c48bfc799d0d6b5787e31b57ba56364e063a75fdddf16a97cd01d4da93f2d44898db4980eb74dcac9d93372"),
std::make_tuple(ALG_SHA256, "d130b2fd9a7a1f118a5d9b6c4bebc0d4d44fdbec8c613766b2779f74fc7d1e7f7e48091cce273f3c66bbb0a249091c9beace1de9491268005f005075bcf58cb36fd739f026a8235f965b40a71de67d95a698bd0dcead1f474520803876c0424d6a864b5fe92650e4e3e453620fa96a2ad256c3426258e5a32b7d38a47205c8b7"),
std::make_tuple(ALG_SHA256, "811fb8028f9c8ce411dcb6ee9f6b9db60928b9ad8da65da14dd3d48600d7b075e73f5ff5025bff7a85e4732b86e2b7e8f8cd708cdcf3c86fb61978303e6526b1597cf26247e74cc31ebb08247779b4af673329a9b1f060f5395287dabc765406bf1c9ad2c5081ac7c5a89b61dbf63d143ea00a8d7266ce3abfc4280ce1d2e27c"),
std::make_tuple(ALG_SHA256, "cedfd1c0126a62aea3e7a30a7309c258c69ab7c2f028276760fb88f5dd4a877a10aea67743d62a37687d345e5d992ec56ed568851c4203521c490f0ba3e5f08ee10f06d1cb798d2f1e7ec1ffa159466baa96c880e3c7df814e7835818765ea304aea37f634ba523eced49215c7b3d4f381c51dd8d01f819bfe6f437f12323d08"),
std::make_tuple(ALG_SHA256, "7ad20fc0e2886691319e5c41a6e4d438e30b0bcfa95a7ba8e3a20040e6743ac7f791322f0da24083d92a2c7a04b8934cb8618cc4616d8c96b55187f4f2de585c66b763b4350879985775fcf3e05143cc84113f635a005f7de034b2fc40c04cb2d12bea77e121d979b26913d4c217ac634f036cd51b79be036d32c8805883dc72"),
std::make_tuple(ALG_SHA384, "db2e9fbefd9832d29e6015b976734ff15a5c1177a9153b38e61d22c8a6ca9056ade10de054645da32eab4ad6eab6a4977bc28526771ad951bd301e2f5bec6911af44aab6cc0d30be1e1170615261026170edec3d4a5123a81af24f39674acf642880fda92c3cb30bb9b90ec4741c71378004cd26ea622025458b3c4f918bca37"),
std::make_tuple(ALG_SHA384, "6574a1c157e1d5f399daeddd816c9410b0c80862f3961ee4678b8514e13e4e548c37ac9bd449f96b8323fa032a2164d5c3689f3a9431c9655765fe95976bd78f5d3d304c0cc22fef8a5882faa0afe7c0a4def21e55b00b66063fb69cffc517e520aeb53cc7f27e67f4a10b29abc026ba9a538974fcbbe9cfbd42338fdff5163c"),
std::make_tuple(ALG_SHA384, "9767cc530ca77270c9734593cd5fd811ea852df6c97bd79d2e825c7d7d00dd467e31f92d5d19ee83f5bd018d4d9221906336c72b295e20e9ce106e173e12acd3eca27066cf6716d4aaa81bb191bcc735a9c10f932f91b987bcf2c12ec70dfc1b6b22fba76a793288739c59a6a0c3132a4390ced7e2fcea9d80921d6b1edb1646"),
std::make_tuple(ALG_SHA384, "974cd6e98a4c88f9274b47c8da1483923bf4213dea137c47bd03aafe1e9a00efaefdd8a02ffe9182a0a8d821a917269e3a8e8a5f70c3a905b87d039e3661781c68090a070657e46e2d099c23bd8db528001668648cefa39a6a10539c77efdfbc0b98f484d90088a716961936de1c3617d3b541b4073f73f01ce2205fa9e93db6"),
std::make_tuple(ALG_SHA384, "cde7aa5cc4c1185b2aa569af9c4cc6ed261e3ff108ecb52ebae1f7422db62bcd54267084e3a2c18157451cdd360ae481983d8539e62f560be22ec3c6e7b4abdd72df0776e221cdbf7c391481b26278f7a5cac0e0e845bed3874377d34800842330fab85b49a803bca36996c199bb48f655ad390d9797b52fb1085b90d7007e46"),
std::make_tuple(ALG_SHA384, "a48b30a2dd6d2629476cb424ac7b0fc014d29d9939930b7f3bad9a7a9500b90b50c3d9b576237dbcca2d902db6eefc1e85d97837d269a17240074d1e6c2d1c2a20cc50a0caebde702c91c46f54e69e9fcf9574b11a74d7c859672c804b82472f7e6d3c6bbf0d71ccd560f8f26fa91cca5ace3a0ef7fed30bed96dea71b4663a2"),
std::make_tuple(ALG_SHA384, "e25879fb75fbb80255b7abf6536cc05c71642a6c9635341586e8d541105a855a8ae3500d7a36294e9688809ceff51786691f116e6e184c8de382f0375bf448608ba0d160ff3391f30bfdaa8403522fabae3036f4f9212fe2e9637433d3472166cfd7257b6abb99fa9b5e5136f94cb1d32adfc2869f1a851c7ed588bee01ab673"),
std::make_tuple(ALG_SHA384, "648de8c418551dbbb731a50e33943671085e3d6c2a0273a33be8b15a0210053819f9054be5c1634dcb8dc226a12bc8b163f675c328fab36a54592e720eee652ef52f02750e5866ea01c6898086a0013e1abd6040f6c2c3ff418ba8d285cd00b460f986477c634e19c0a3a126c83b089f937ba7ea7ca2ccea6c46c8804df6fe52"),
std::make_tuple(ALG_SHA384, "bb70b663d157c330c79bc603ff28c35d41b371a6a4054122b2979b22c7606b77baebdc2cbfac63758c9400e2bbe3c1d8703e87423b010c8440d625b0958745fdeb10437571f95dedf5e27c3a4c60baa2f5072191f9c8b58d157eb56c1bc31fc5960872a4ade5b7824aadc2747b46b6a21837c7fba60344277bb6d4bd23bd00b7"),
std::make_tuple(ALG_SHA384, "627accf64851e9f19bc86ee8698ae687b950b9e2635ea61525506d27f216cc358d3eadcc57719e9666418139d622857c64b555ac384d8f3e03ac77b54a0dedc602689cba5cf17515e2e15c75c37a20bc6b45b171579f8d6428737c91f6497d47e680008affd755b539336564d79ca090f78836fc685c8ad0bb30e4849dd26500"),
std::make_tuple(ALG_SHA512, "e4dba4692a6628b501f776fec7fe973d655154268f669bfd47c624aba3be5311d158619c588ab71aa0ac9accb52f0dbc488df350f77c7520ce67a3050d1e5e722bcd75081c2b0e64d0f3483cfc981eaa1c358fc7b9c2fb7ce78ed19513e96717fb2129d4feb1f63c96b4c77623a092b0ea306eb35da2f7ba9d23f4843d8837a8"),
std::make_tuple(ALG_SHA512, "0ff815e8e1ccf66c1a09c3b1875953c44571542729e5d8395e4110f2505556d3c9d0711d5a111542fd39aa99f8854e5505db1db8afa2b084ffd7e3b3585ddc67a0954924a02fe83dae404d8c8994e066844525cee78c40e992d8b8b3e31d7befda6f22647bcf7746744534f3002f0ee00bd8f2d2974c8f515e6b1459b93d3b54"),
std::make_tuple(ALG_SHA512, "646919bee4a47d978d4be19f1806de5ef849a98433d68a877183908e523d848e054d1bb217da6f0188afb03b243f170310e61c43a472e9cd78e20e3ec26e7628dfc79a702f9ff4f4266cb771a069bda575dec1b04ea2cec0b7def7ed75134962195ffebed5fcf3ba8f095d0b348db78a4fb9ff92da6d21a953feb4631337e484"),
std::make_tuple(ALG_SHA512, "32d9829c40eec978d8db1b744f7784b937d955ab7817d3c8a3532cd282f9af30f4423b92f7fdf8d4078e4625a737f3683d96b1da226fc7f5faac069541a2ff5a2796734d9e800bc6b10e498d17ecbf3f08437ff34f80d21ea1562db42d06609074de11165bff69177e640df4c820500741e7a73e26d05d093f5987776dac3b9c"),
std::make_tuple(ALG_SHA512, "049b80ff6c1c1445d472a70b470c404ca0ea2e2a4c52ef3e51c5502c8f31d67a46685da2d9d1ff65d25d376325bd46e9b9d3d60a2466def1b719c575ba9ecaeef827a3477f1d6455a115a3673e00da1f46a10c807945ac4771aeba7fe3502f5022c09b18e4690dbd49813341193bc2964d3e18b4d25721ea896a777192afcd47"),
std::make_tuple(ALG_SHA512, "d0431397e560edbba3e0792f37915fd296e3602cb34a2ef6f5e481dce85c6781330edbc4ca6c9a4264a0321b30735cfac36d8b4f553dc5df2e5cb27f5beef31ca5e9b4ffc478854fcfa265d8f727200a75aadc45c115ee54053af237d1b61a25101bc6d13b4e55edcc2d3becf675540d93e379955e9a505b62c5688ab27d85a3"),
std::make_tuple(ALG_SHA512, "293bf13d84db45e8cc67b4a0d6f259213e365323adcd232f58a555b0c9ae634de2d5d6761f36ae3d1b8d046856eeeec435b7a3bc4ac2df29d6df896c8c8194bb98b723b8e05ef0488a96eea2be722da6adf4fe71d238592e77ef7b2e7c0fd33c54c91f2a50bcd3b02068ba7797e5df70aed4ae6acc9757e444bd731f1fc0ea78"),
std::make_tuple(ALG_SHA512, "91a914707b2c0e33585e56042b50889b1f8ad9e8b2a15b49190c7d00e033d1e4d2c91356185c6677a52ae099d13749f3439c20981522dfaa330f81ca044040d44d78a3c952f8b80d3e509ed3c47447d507127c48b723220f7dc1bb2f9a383083cb5fcdb16f298d5ceb77989b4e300aaa3194f6e0e2cdabe1c1c73515e9422759"),
std::make_tuple(ALG_SHA512, "76ee8ec93353c62749c49c66846ce128cf177cc3f9e85494b94e7196f0345e322f78d159799f8dd14ac788ccd7dc49bf980f957104844a539c4b8b0f2a921d634b1911302be6a4ce903963a31ac293f4c912cffabf50f339472d390d1719a286d2b89875d18fd1c723047612d285856e68077486b2b217efc4dac3b83d32b442"),
std::make_tuple(ALG_SHA512, "d9eb32d99c9e6a8001a30107c29ba5bb0bd6f31189192f8cc59e39e1b05dbc5a7e8aa978b85fe4dc8d1b3d676a4ba1a1ca4891574e01d48910fa69833595c049c1912a38afd08deb425d5c5c96adc64b7a252ee482dddc9c57a4f25c5244a1e149079c63a979cd74c570482c6e4a7d83c476b1fe4b36af8e42a2bab530f1c7ea"),
},
{
std::make_tuple(ALG_SHA1, "05287f294cee9accc2b125f23bc3b723308aaf951283254cde872185f24d0a551f31618eff33afe28843bb4be2bc01aa762e60ae486013f78695e27b610f99291bd2bacd61aa6f34dc6fc2900388101d33aebb0501f22082cf02c9429da8e30f2293f2af1b5ac309e4bea28a4530cec78e932a64e6423534e0553ca14f20cf4f"),
std::make_tuple(ALG_SHA1, "8cd701d80169be848d529297ebba170fac3994e8713dd19a5dac2ae4cacae1c83b5cb9d7920ec0ae84126cc1490ae9579828b2d6d2935f417e0dbdfff5d424de5ec50557ddc7c3140867c4af9bc0c7bd6c9e780ba1e341272029642247a84795de5a0ee2495e6fbc029bc2ea47a5584710e40e0e44f322542c4645d62810f1f5"),
std::make_tuple(ALG_SHA1, "b055da1d4e7ba932d0fb59cf30745fa82554c4b0a548cb30a8f7d41630ef809086df16dac60825559dee6bd85253f64a0365897132374105806e7809b73dea5b0e931689a992e8e6604494ddc189c5865854f7772e1721dd8f7c98cb105630d1d1d7a4d10003380e9e649c8686001482ab88d66ba1d2b3df5f89fa0443249a1c"),
std::make_tuple(ALG_SHA1, "0c75e97351b4445af5fe02896dc5609bfb15c79f7f1946bd90e1401dcb6262046bbfd8401bc7c1c708bee09b396094f023230a9178bdb18041e6eedc2c5f12082733890a2d3d533160eab9fb59403835bc1fc2640fc72664cc9bcc4fb425a5a167596299321ee4e2280af472746d35b3ed9256e0eb418cb25988403d0cbc0514"),
std::make_tuple(ALG_SHA1, "71e0a316b65c8994f0d5f02ff0a1619da3d03e079f6cf86bfcff833f655607576e85d908282ba98ef4f7fdab946bde9188e0d00297cb08b6ac3edafde3b271a5e403c21e70bcc2dc3995d7fdf73a8d2cb84e8bc577b0c539f1fdf3b5b45641fe796348a0b3973d4768b6686d4095d835dc22569768a397be7443b6aeffcae12a"),
std::make_tuple(ALG_SHA1, "ed16a259d569c3e791424d47bd20d879e5a685f23f89499d99ad8820908be66003d65a47c75e84c59c344014600f7b4183ee45e8bbff283ff9c0b8559b646c9ce378aca6a8c62b2c4b7a7754ed83cf33df3c34915a4cc2ed71cb41c143a6f8087544c1fce0696324865b1b8ecb447c5ae2d87a788537c1b1e9154becf11831aa"),
std::make_tuple(ALG_SHA1, "8670556cc21c6d08816d1294afae31d54de9795318ff190b65f7cb64509711641531be24bec0b981ff34fe155e09e566961ea75c3ec51ef9a616cc44028a1f86cac5f3b960b2593ef4d597cea5dd70b3e879a5382e6dbb5ec1e5ffd0ef09c8196bd1fc15f01bd5a527fbe5a7cb5258260ba27acd302079a27f0b6bf1613d9285"),
std::make_tuple(ALG_SHA1, "ad847bce1d8c9b0bce7ff0c0d92005d7ced087de56a404b717bbf391d8cff517e6095ae6b61ae745cb87d610da441ff62d85f6e545d195c1c3583b5c898675a31cd89c154cef9f7a18e302d1ccd9278a6cd8cdf555d8d6fb221c4d0ccdc2a7581699494229324b117b3a7ce9f506a6fb547013f8d0e24fcbfbb03087edab149e"),
std::make_tuple(ALG_SHA1, "438d4da5823088c9d634bcacf3cc60b8295e571493e1c426928a1f5679a789158acb5c1e222b07fc304819cdebce9b45c5bca3f69ac626ce2ef80ee1d69b8c68755cb00aaaab375b4862a4a307a792e07913480e3f148ea57c8fbf648aca204dec8a70f18478c0ed06c985b5ad1eec902da96de4e892a3b464995b67fdfcebcb"),
std::make_tuple(ALG_SHA1, "a4db6371c8ea007f2f4771cd9d373ed6741d88467c35eb55e385a95483110485644feb3082dad9f3d06afb5a7c0491b0756e96142be6a3cf961311e4793c5ee9e8b8d11608a6619c16ded437aa2724073daa269ce9a66d5071666dd98170dc1e37005e4ae1b4601f0989448eaf06bf84d5b7800641dd13807e64045a241547cd"),
std::make_tuple(ALG_SHA224, "8cca7fc0ca7689c0ba19855c7676fb8d65682c255e77510510a92491a19aa16195cf0e39f248393ca154015c18aa171536b4065b6e2e71d128f09c3b64082f36a10c3627fdaf6b719d91b8eb4f5cf8916e0cfe79078ed809398d5468e289c4327829ff7034d2a8c77678b3ef65b42467d5171a676fbf0d170b2754fe6143eabd"),
std::make_tuple(ALG_SHA224, "de5029fd9216787444f727ab156674394d5a0777f09624e5922e25ca6b47281bae1e059e174c834fc348cb03452d1c4bf6bdc19b8ca640acef05d51e48291e625a9918d715584a3368674025588c3b394f5227fbb651cd5fc5af4a609ae7c0e889c94bf0b4c337e8db5e7059750b39c9ff2021df941e33c7be356ed88c0a7574"),
std::make_tuple(ALG_SHA224, "ee3e12fa06c74248c2e344877c92e5db1738c8efe5f366e6c82c5495986cc5efc5714fc03e82f29f91ff561d533c5443c28fb83ca9a8454e8421fa0fe55694d51677546e00dc02114b983295c750c6e10b4eb4a45cd10a46d0a72f1eb2fe6be52978a96a157d7c883ad56155a076449d399a458fc515bbb5f3e6792ac90c5107"),
std::make_tuple(ALG_SHA224, "680060fa6a12201453f4e4ce55a106293b4557c7f2abbefd49f9222bf59b8a48d87d83c1837dc384f9200b57b583526fef951f3e1c84378cb47578c9377805a272bba3d2fffe633b0b4682355bd68d26915bc853ac67d1f5cf208190433a1380be2288d4e67c496011d00f0e4f800075aafe1badac3bd5612263042520c7fd0a"),
std::make_tuple(ALG_SHA224, "c0efa9d7abc69dd36ca1f456935e66404d082513e54a79058b2aa75355f418d78373b7dd07679b334534e67f17d8edd5141f9989121a0d42e9cd88507a288d40f03942ad469f17590a42a77c6041e35b492c6d1d257442da771f9cf6e9c017ad90a712ee7055586d433300f4768391f975966a76283f61f5bd89abeaa9a5fc46"),
std::make_tuple(ALG_SHA224, "7a596c55a05a4e3991ed9c779db9b309a79d40f470e8a81c18cda75ce11137d63707b388edbe3c21ca795c12445fe9e78b742cd8c9c8439ba8efc47d16b0a3b1450156e8f5343622f56b29c3e7517ee9450c18fda16dcf88316a13488acfd284ac309c9c3f2206e41cab4cb20ff63ab6db4b4c8a7f3f148ab828dce6c7d48df6"),
std::make_tuple(ALG_SHA224, "38214b5023b4d5287f39ba5a8498942b3656216fe70be99ffd16212cf58fd013a87d30b2cd4957d9c0731625828422890044712e982ce77dd91e327a8a54f353ee971e3847b1a36e99244e9fb01ceb7564a3af671c14d3d291d2824bd539f53493d5dd8d98d2010d92b4287118493915ebdba1c17ca9f5c5ae99d848dc2720dd"),
std::make_tuple(ALG_SHA224, "e3c2a239be80bc2d5b855b89dd765f39d7af83a169da9ad3acc018065060d344843e0b6216fea835dc31c403526f693884a69c5a2fb19a3f232d617eeb887223b05ad6a75bf95f1ffa4830b365cf7f5221119aa4841928401a57b22048aa62512fbe0aefd39867517d6fa8815ebe2aef74978666b23acd3e5be612d4afef2937"),
std::make_tuple(ALG_SHA224, "7b411e6d7c492539b50bdb619c7192c134c7779c3d1d6a29a7ec0d4e4dfc1babe084fcda219496f554b06559f1bdceaa9c22b01857273de0f7a00815d4d05ea0c588da864c8f34690d465a52858cc2adf8e0fe95abc59152546b0120cf8b2d321293e1f76303a89cc917e1d2c0a615d1304a889da0c10e88a79320f8a4f52f6a"),
std::make_tuple(ALG_SHA224, "a6114f4aa84d14cbee61628328cf031b29ae0286eaa0cb93d2048ebe346de44c1a52b597410759a664ebfd00bde449c2ca0840f04d9d6709964429de04717aa3ca1ebb47efc1dd01997bca2c8a920054eb217f91480ee613dd3dd9ff1003a57a3ede2702ba63ea0513778fac96c272f814618a11e6db91db2d5765c95e0caff6"),
std::make_tuple(ALG_SHA256, "5dc2b5a9d8d72492b8a4bd0bc45e2e18ba62b21a4c27355b6871b9e8bcc8f89f7a294a8858fbca69dc44b494d61d12042e6498a8dfb0ccff448a6ae593da06ada79ff36f02e364a312efd1efb3bb9c3ef6a8f5122071fb1bf65f230838bdde9d6c8c7606dc78396be20adac4631e14ef9a9890ff175309d8075aaef9b55bc898"),
std::make_tuple(ALG_SHA256, "8c89c71dd8a2c2976c21d6ea05dd4dcadb40b31f81a1defd0ccd2cd677e70cee4673c0106aad6180651f2330ae72da365785bd7eedbc6abca09b2ba5a393785fd61bbd36a3035d902505f623909ee765cd1c0f4464f7d8189f6474d6ed28678684aa46f74a4dbeb1f6fcd72b72077a3e842d32daaefa2ff8535390cf1a4fe24b"),
std::make_tuple(ALG_SHA256, "96cf462a9446d4ec4a70af8c1644c5d0f8d5b07cf42437c5b83918087f7205bc351aeca6dc3d7b4b2ebbe4ab849cdd2cf6a3ebd5c426e1bcf51da3c23d78307d24b6e07665b3ea9594c128d904fb1f4ce8d63a37b8f95692d74f83be725a0977abcaaa04f74e27b0c4aa067e600a91191695220a9a469e2da7f74066e6bf9890"),
std::make_tuple(ALG_SHA256, "9a126e437b5e015eea141ca1a88020f2d5d6cc2cb3db196faee262ba99fac8bb3b66d5e50a4d60c436b3b08de9a8e4facebf9154d0c2aed124a4ad2189b7eb44ce1f4a9e95871c4d581344baa995976ebe0389282c29052cf39b9cddbbeee28e5d271596a57400a2571a1f506faf04f9ad89f9cd5176e72624ad7716b7057642"),
std::make_tuple(ALG_SHA256, "06c2f886ff1775dfc39ea830559ecc96ecbb0574ee1bf4bb1cc889690a551950d3c5b1190aa8a988f4877c02f482d74c4638ef95f0e718b7f6d494baceeea89913aef5497e4106f811e9269395a1748a470039d7cf5f783d713ec7cd87e45eaf2f466e1f412ab4b6848c4deb2141ccd957da8a4371cb3dd5f5cdccac1f806219"),
std::make_tuple(ALG_SHA256, "d5b58bd311ca3173ba6ead0effa14ad21f38dc552c8ea4e410777318cd7512a9092fe287c91ec0277d8a2b1b3db5a9e65256660ef8481f7362843edeff4d47ddfcaa72cf0a199a3b61825566046a652447694fee8fde49355ae159f67f79bc8fb60f85d15a2386566e3e7314df284533085add1c7bb6ead3ff760c86d5633a66"),
std::make_tuple(ALG_SHA256, "4835f68708de7caea9f587dd69125f12daca4f33dbd54353c7709632ec0125023ffaa8714dff42e3754b56ff55509d6e829d75df7c057c4fe1fe5e87e047ebe6f1ce6d60c3d038c7764282490b70753b19e48315c189fabde310d8089293e07ec678ed5d519987e115a1b4c373b910ff076520db92a8e425376fabbceb2d2b52"),
std::make_tuple(ALG_SHA256, "da338b0dd6c48d2862bff80b8a14d13c0b9e558fb5f7829b1390d96e4e0163804f9df2e6244aa9c8a590be1557ef7f7590769380dc91832da023798dfdd447b9f7adaa09d7e2d086cdee19a2dae51b27ed06e86e4d9093d136d8f062c7979cde1c883ddcb7330b4a2403901adc9fab396b77dbc1ce9dba6f1fd7c85774f26ad6"),
std::make_tuple(ALG_SHA256, "0de4f920eb750402796b81a963521d234cd1336c13dc353e552a4d2a33ea44e855b2a2ec2eb817398244197a2665cf4f08e42ee56f7662c983356ffe0f51184d860300dc44c30f0217bb175afe7bb71630ee8096608d573a40d21a7444f08721a8c15919b400b3043fb8c27072fc9f21ced972a87089dd3894e998b4592e580c"),
std::make_tuple(ALG_SHA256, "21682959e6957153bd00a1b40719b79059aba326c80eabb6649f0e92026de7763f35551cc191d90cc06cffb2c5b941b2b26428800389b42b53e5fe79228a1c39d5d645d5fea53527dec6d38d29ac1240086615e164d29655620d88d32a2dfb3bed3341aa263b4f4b20f66570b85af2e16498b273744f19dd98fff4c8a3c04e25"),
std::make_tuple(ALG_SHA384, "c530d8dbcf28eddd459b5f6f19bc5c929ab639df51fb6d7629d8e138d44e6736691d8768522182a365e191c551666e333c491585aa10cc7fa1bb61430b99b3c65b607381737d2c69c5a98120b9bdb76d4fc773ea065dc4fcfc31630856e63ae4e222248cfbe5f417ae19b8e91b6a3f291d57d8762d895dd5836470ee7fdd0579"),
std::make_tuple(ALG_SHA384, "20c328fe9add7f432a4f075829da07b53b695037dc51737d3cd731934df333cd1a53fcf65aa31baa450ca501a6fae26e322347e618c5a444d92e9fec5a8261ae38b98fee5be77c02cec09ddccd5b3de920367138a87b4fdf38815b9ba69642b621fccb2ec4310a136c73d731c7847eefaeabb877b5fbda1700d74de758b63ead"),
std::make_tuple(ALG_SHA384, "4052ba56f8de36c5456a7a7fc2349fcde3ed5f0fdb0f1caebd702351e1183354894f3976c4fb5ed1932943104bea8bdc3a609b978d189d4d719acbe7793feaa2404314c04f1bbb7e4109eb4525edcf24235e777e63f9d8002af915d64609fd1fad56d49e61e756b29631f98817e6738fe60f7c2c225ad5b02eb58987101b73b1"),
std::make_tuple(ALG_SHA384, "4a7956ab59fc034dbd327204ccaf400ba1ae0b9b6448d3bdcceaa65ee1057ca107076079388bd07691cc67df1060b9029c237fc84571f48cce987e2d688c9162c1ddd04e3de776558349f52d3c98dd381754fe11111ad165f31c14041ccfb53780e3f155f178bd919e8f6516d9be73561d29d29e4fad33ee445eb0098434afc8"),
std::make_tuple(ALG_SHA384, "694ba0a1cf223f98ad7b9f7e2fa16b9e7deb2eac8f41c46343dd0f6cad4feb82aec463d4c88725aa30c8334c259ddc208146eb128eb51e381a4ed9b6ceeb1ce0bb23b39f36ccac16e6be0e851bdac86d614be8f5560c0d8cb8aa1fd0c24c3daeb9f0f7cbc2f7be23f6e498f1b86119ce46838e1c8f4e7ba5457c4880327a3735"),
std::make_tuple(ALG_SHA384, "a4c802d77e0432d516c59309b1919fd8b2890307554bf4c5a018c6ec9732bb84b088198986957fedd18678e1969b51519bcf28ad1ebb46efc6b8afdada44f67fb1a756066ad6ffabdd97ae07d0e680916f970864f63e9f43b14cfbda267a0446916be2d8908c5b1620405c03c83ad5a11429cab3459ba8c7471bd574e39d8ae1"),
std::make_tuple(ALG_SHA384, "18a02d44366d91f9b94142a4c34319c69f2453be0355f09b92775a2fa51347644b8be0d48f502393f956864f57c5dd9cbcf27d89ca8da2772d1c0e2b68a7f321d4b51323e578261bb0457c26aa47e3e9b373cb2853bea894438e98e52f6f4629ba080e5cc34d6238e6f66c4e462ff4568a9185c42651cb9cdcb7408682d20825"),
std::make_tuple(ALG_SHA384, "d7e5971e27df2b1c3fa8e3fcc7d4550bad2a757c25a1b9ffee887a96d7049ea483bf744769dfdfe81e35b711d7b76c7e2a31ec761437c75c405e918186ac893cb34c773d8886db1e05ef433be7ddfdc46f1eee1065eac2345d1546d53989113aeff46aa58cbe66e4793e5123fd2d4f04045b43f21fa0f0b2cb165f3af68580c7"),
std::make_tuple(ALG_SHA384, "6efdd76650fc2cb2d18b8bb3b7698449aba8b729e2ba958dfdcf662b2e5f90649d0216bf0a885f95b346390e78ae1d4c3d23b5e5900b9b978b256437fc1cddebc45d94997d269a9f60e088c565afc06fab47f5181b01eefb492e86139aabf846acb659def2ff66389f0280c0c695f51dbfbd81a8ccc61523fc93d6a8503269df"),
std::make_tuple(ALG_SHA384, "ce9f1236befbba4c9664eab4b45094ae2133aa6e17f2cc2ac09b237241538dc0f790fa5000881631fee9289d17ca398641e17a71bcf7e087df9a11e9181283452f96e2a7cabfb391363c384d64c8938232592d06ec9a59f3139c35fd5dc8d102fc1994e32388db93c7c7e26da331e8cb7e028ed4b0c38195e3095854175fc020"),
std::make_tuple(ALG_SHA512, "50c2197ada262ec4a5050804b3b0d19585ec4212d7dc01608a282eefe258383cf181f69b5324f3331c53094a0f1531c3110c99e4dd55f75df8b01e86e8e1cee9a156d10040094340fba8325658f467b09e67823f89194d7b42e44aa88ec68e584688d232079dc8f12a4dabb0f7131a64154326aa45efaac3510cdbdc3ed11f93"),
std::make_tuple(ALG_SHA512, "ad97dd6e421faa1461cdc3a36bc8c01ee7d26eec2e2925db67aa5664b63c6431b16cb5dc145508fab5c30958ba982284096e958f007dc81267bfdf6fa25390592b20339740ba1904d9891fdbdd288331950bf6c36165f2f2aa484d0c170e0fcd04f981263016863cb5672eb43e40892e74f2b90fb9a74b84198dc8c47d378695"),
std::make_tuple(ALG_SHA512, "8728b76733676e20a76c7fd31e959cf7842db351db407266ddae0b36e37f34270576724083e9989764d08a0d5c1b4738f34927a1e4366130c334cfe4e35ef6c777294122f73c8dedc682ea89117da0b2fadd71aff6511ecb739d2d09bfede8142568a9755909550816aa27b10562af4be1111ae1d939b3213510aa0d3dd314f4"),
std::make_tuple(ALG_SHA512, "bc7c3781e2f83a53149fc95c1a6efa27def23d376866ec4b0c1c23e0e21ed1f677140f17c268b1965aa91b15e62d5749d4fb64024ee7d06569ff897ca026f0f282ff2f17a70dcc2ae8187fd8cfd241004dbaa6b9ab416c96c32b5429703930c543053e88782db49928b39cafc0a4e2d3b1f8ac6669bae96583692dec3a9dbcf9"),
std::make_tuple(ALG_SHA512, "f73951605d5b351846ab6279b2faf86df326ed67bce1b9497bb35386e8425d83ded29b446b08aa4423f3efa4b94dcd88d0fd1bbf0ee1d5a272cb113ee8c935b51baa68e18bbd463bdfdcd8fb7ca9c3815618bff4062e4b291e08a0c6b91ee3a756c99e80e60371c4236e05c62499421f2e7ec24fce4f85a72472e66682cacd22"),
std::make_tuple(ALG_SHA512, "58d1b97a7b9eef3e425004bad5be8324236debcad4b44b537f1d0f481e0d1ad3bfa815c67cef06deac2b244a5b8fea67f8196ace4eb9e490b6b597c08a4cd732dc9a608368bbea59c833fdece78d07c6b843acc728de5d6b515e2c50f0dcdef2196e42b9294bc237fd3038aa610203c9cbb459bd4a6bde6db9e076fe3806589a"),
std::make_tuple(ALG_SHA512, "529477c33067fa8b2db77cf463020f1d86011c1675e59d450ee28d0947ea9d9e7abb2941011b6a940362ed438d3a44e8e5a3fb2c1b3ace2fe0ba182b9bc38f54bada2f0246b27411bba9cc8816964c7a2fc2a22a49344b72e8320666e3048834b9fb714f28b27fccfc94010c269e8f9b0d66f958295d7dd6cd513d034436f007"),
std::make_tuple(ALG_SHA512, "bbf033767a3714f3e2a037af7e9a1fb189818a4e5770f79cf1576629004d5fecec27357b44498c7f61bc19654681a957cb25656bfb96541aba3521f3ab2c1f9050028aca736d1029c5678f9ec6832175e4825685e721c0aa8c36b57570fb502130aab9c9cf4aa6d958c822c3c4498ef31dbfe504e4ba4434b182a9151962fa86"),
std::make_tuple(ALG_SHA512, "eb8e907ccfc298b66863b2b1dd0ae3ec054848a0853b59f2395e6f6cd6a584aecdca3a6172e11f6d5d33306c10499c5edb47ca9efd7c9c150c36f6ad97db7a0809359673d00ec115bffd016cb17fb1fb7049813cd5ddbedc305cd427e99b11c26878ab98336f051656682e9b08d3aa2a8bf77663548746b16c7711c4160dcf42"),
std::make_tuple(ALG_SHA512, "373a8c725c3a7c1658d05dc68ea2d2edc91b25f9d3b381bd4370611496ac48c8811ab3b286044b22c6d6608116e093345458d2c4fc9e8a3cf6c417d3b24e80cb77366199f8342846293c841550471b665f567cda81b454b8f37ce490155cb21ec1987f70db527a4b2908b3cc655ed24b911e09848b7d47f9e1a0af92e65e4887"),
},
{
std::make_tuple(ALG_SHA1, "80f161f9e7ae9465dc66e5401a778ef14194c5e6d7bae1288c65bf33c20364044ca9e373760581c3469418780214b968f23d951567ac1e3afd2069a41ce8d743c59cf4818b0c9fd2df766c8d91fc46fa945459ac02c22f115f431847220bd03171325ccb2dab35ba2e75a828d0157dceae43d752ade45bd43d3894c4db5596f6"),
std::make_tuple(ALG_SHA1, "9f993b53072492ae16d9109965f9c86b41ae08c80ce4df18e15bdd3777fa1a6e486779a3f2d42eccdd1c7eaa1e0ec6b39b08bf5070c900489280c57cb228eed665184b7c81d61649ca2dc17dce7ff3b30d5ccd145d5271cb8d07c5b8498674693dd736467ed2520b2534617c3df35454dfcfb87e9b2a39871a19655402bbb310"),
std::make_tuple(ALG_SHA1, "fa4787c0dc22ae64e275ca1310802bab56c45d58c267fd15f3dbcc6fd1bb028c7bf5e56d812e997054623a19facb28110605a26fc86f9737c1d4b820594bd29bd55b5b1083634b6b37392dd7fb1275c903a21441df844a4df4dbbbce2d3ac67eeec112324a89695d7543cad67c1bb9db33e3da556f6dbe5d7638fd00b44f853f"),
std::make_tuple(ALG_SHA1, "c82118dd81f0fe7132d2b47cd1fa71e3fa9f63b3da4eab144b84aa78407c7b186446c0a1fe19a22a18ea136ae03d56284e3cc2f20706c312824921be6913858f42e539354e0a2f68b1264521d412c70b08e735346c59470910472f815a8f1e98a92709ff396aad1247afd10a7520cb746fca45e2cff041e03ea55b29dc9a4e1b"),
std::make_tuple(ALG_SHA1, "430dcab25161982d766e3839cc3da0c41bbe0ded95b1500cc4c768f2c0055672a56a2d2044d16958191981827e82c0951d5a50daabda98f3d44bc81b716cb1af0118dbee5724d1fd9087c02d48bd40810e6d726b14494bd72b352f6aefacc20c3f60fba4f1217a22c3001bc394b4cb90d43d9a2939c712c0b3d0c768a38d3090"),
std::make_tuple(ALG_SHA1, "edd8d609976e9973817577460629c749612eb3d21e30488bcfc7c976009d492f6dd27872729fbedcc23a86f65cfadd6fbbbc3ba94d85a0782769e326f7ab47ba3a255079afead5ae0b2b55a7ee578f0016864c24d3188010ba99915a9ee8f772bc9905293697066fc30e8c61a4880583da568f4996310eddf1217b1cdd9e7fe1"),
std::make_tuple(ALG_SHA1, "827686813a7c22dfc81ca7643feae6eb1b425b53d38c60dcb2bf9fd4e224cd74ca5d96059aa5d34623590312edb8f93e83e7d2c112372a1732ab90e704b536e37d41edef01f4518634b6415a0d6e933b2c0c053a6dcd760ebdba56b72c735b61442a758a99f20567a23a4a84c7941bacbbbcdc080cd5ab8af9f5da8d83e4a2b5"),
std::make_tuple(ALG_SHA1, "f08ffa1716c6a085ee1951aefc9147f5e9be1d99ccf13586a9ab577137549a23e730881521907d3ed1455029225a354a8903e29206d0f141a72686fc4df0311fb2921654ab1e4b65abcb814e89a3e797837b4be0822882bea0f00bc5e73fefe65b9bebfc3bdad1a185932c46b8d22383dd10a0abc862b1a49cf02ef58da99c21"),
std::make_tuple(ALG_SHA1, "e12929d730aaa1bbdfcde32c1d98307ec40fcaf3dca8a0d161fe2db745c99e30b90e3389a993e7e08596537e47bed067b252dc2ed7a9bf0edee26e3703d5af66df487eb8e967afc03c6ed6d79ba964b3b29e123c9e89839ab00824936e185814db40d20df90c41828bbd33e01f3f338d4c5b35c2392e359d5eda1a728f7be063"),
std::make_tuple(ALG_SHA1, "766e0bd60285d58beaff18f45cdc2135c177329cfbb8e07aeb8cba3137922b8f4a18a25a9c45ef2c3397f1816a916e0ff1ad42561598bc77419e4549c56342aad7d53c13d75e3e70d85e7f2e5bd841955d6cf9589585b06af7d3a9147cfc4445258e22293e398afce03b0c21b91b646e0f9aa1cb03e786fb131230b9e3c3f907"),
std::make_tuple(ALG_SHA224, "bda79b564e1ef644c729add43ca108bbdb0558991611382c059213c30578e7f6a62d4895c425a7def3b7d4f3212bc28b76148be77fe0b3088cadb11f565eab45e5ee826cb1050e9508c9ab44aff7f431cc32ce41039ba9b4e0a102a0751b2c9e449451c35fe5b4d2cd0a38af302e2617a5082b8fec6aa09ac9170e2fa9d6f26a"),
std::make_tuple(ALG_SHA224, "6a25de6760a962e601aaeed7b1521159a355c25e91d4acafb080c931e30232662e9b36366e07a9f048a87e8c60e09933cbbfde01c6de8e09a88ad399152599c075caa00ea430cf9bebd1cc4a304bc94f6906a1ef571723877064add01d09fe6125fb457669eb7defd36efd9c895a4bb7667332b2aa471434f056815e61760752"),
std::make_tuple(ALG_SHA224, "7310ae61cc71833c740f261db8d36bd631c2d72e987e0d86da108abd6fe49252e8156ac8c8ecc84f95a388a02f6ea02960bc566ab3b9b19f8a182d9f6b11b2049ba5c78cee2904bfdd02c5d2d9ae26ccdf042be74dbc3e39f431df936e6697aab1472d74e5321dd573b6467b5f9be307d722bc6d0c8d9e9d40e2086320ed278b"),
std::make_tuple(ALG_SHA224, "a526a9fe9096013c48593662c6562332d003f379152bdaee79ee035eae09c9060457294182987763357251e4c8b5d2c155e3071f7bf0a731b146fe5dd90c2b9a19a88b1de6827534610b2872e7ff010ce3e7f283e7e12f83fca32a0c36bec2cf8b20b7dbe4dd6278752fa3534abb1adc23159aed8287daac020e6eb2eaa6f66d"),
std::make_tuple(ALG_SHA224, "9e7f3f09fdda085e2ef1fe08ca900f4ecd4bcb90e3b7c622e2da3e5b97dffee8c50e82666bfc5c3146ffd77697e5d99026e60e9187d6421e9ca00f815befb9f9d12e565467b332c0653771dfb48af619e88484367e3f232c6183c635b3822a25cbc601fb7a6750b69381166aaae52e921b0f76a84f5931f33a6eaaa128001b15"),
std::make_tuple(ALG_SHA224, "4d3179b3fea6c9ffb10c574c1b15a56fd3cf1294616e9624984cb2ed272ea77d6ac9e7ce8685c929b4808044ddd64eae6820f56c503a6fe5794adefb44fdc67b61147ab7e420d4719b8929fb9fd57c9d2a27f237a80686271160fe6d75cf1e0dd91a1bb541ff53a00e303aba8a9b9805c2eef23b945b45b50899fb8be42b17fd"),
std::make_tuple(ALG_SHA224, "25388d8e792160b27e0713a7ac8d9048cb6e744613115a62915e5ce0ccd1d738a9cc6f0e8c325364c031c20f195fcf67d7096143cec77d25c454c8b11b9d4764b0186a820257495097dd2d849b3052facb30eba891a667d47020f384a3fd403701c486d224bac9ddcab35bef7b28a2676d8a1b5da4d69fd95d6ae542ad174919"),
std::make_tuple(ALG_SHA224, "24c68bada498647a77b0a751533fd08eaf312f14770d3c4a031d2a634ad0bfe3535c625eeda77683a068e65ae38901ca8fd1895e94bf0649ebb960a7cc66ad052058482439ee23fac1785efaf09d189502fa8501e90c40393f50e3457ea8d6bb73016486f03314e6c22836b8e241bcf8f0f54b84dcbc9222e72bdbc5ca60df0c"),
std::make_tuple(ALG_SHA224, "83b158c3906eb04a8c0a71879004ae9465d6865d527a9e49312dcf1dc8731b1d575be6746e0462d501604c63be38d6ce9e70e4bfbb8d7a77617475b367747ad2c0872d394dd5a3f7f57a19a5f889e6908051ae1b7adfd95ea3c44313e61835b3e5be95dcd6ea59f690e14116e500c62233004e373678a14720a3a007ec643508"),
std::make_tuple(ALG_SHA224, "b1fbda789a339b4163acf22b0db30e83449616a091050368d0beb016e56a343aabc16f002df5e3b6194ec5897111548f84a76a0b1dfb51ecfa24d7967f44a5e5acb0cc6f4d51a10a704acb8f1cda9add40849b20ea6e6953b908c50395ede9569d0e1a4d610d7d4652e72bc577d687736176d0676026f2a5f7b1a2e48e2ea995"),
std::make_tuple(ALG_SHA256, "8b90a79fec955a7db26ba6737d3ed0455603d09b95c454f8013808eb3a97158954ace71ac52c341381463a45637b4853cfb07f699682da2b19d96cecb2c0e9214f74681560ba67def476108f1e7abbaf9e9cb3eabd0b3d0779e3d61ae2febdfbc40eb1f686e8fcc45223b0ba77e231410beef386d4088573697dcfdd94fa98ff"),
std::make_tuple(ALG_SHA256, "7c5b1ab78792af899cf3edf237da4adea82ab4d4664a831ea76dac2b2d17373163ddf316a86c6891ebcc0d8d78e6bbce114462d64119fb0aed81bd112c09947d5972cfad66b218f1723caaf09e81be471db746738bd9def180ef00a3648f777685a41642666ea9f25bca2ce452b43b93f40aca73ed92161c873fdbab7eb0c865"),
std::make_tuple(ALG_SHA256, "6a41d3cb08570bfd2a07f683fd9c4b8ffc786b49bfa1dc71137dfa4550dae9a5e731ce753b2c3f43b265f8290b71cff5f21dea88d1f72f7cea11fc0aa301182a202ceafb1745e966e01054fecc6c232bb8903d88e295eb89fb358d617dd28c233eb98f2746a9f2afdd8f74cae9942f797759ce119881fae06e71151386532bd7"),
std::make_tuple(ALG_SHA256, "15c24ee3a9398f6e5e57c07a9eadbfbc583e11f85285d421c1baf4c21752a29c1cc50290409324c02f8936f2a740f83586e870c62843de34eff4f2c323fa3d0efd78e6f1feb79ea6856dd52ea1402ef3248631abf94f417fb7a5cd6d7512caebe16360cd8cace368888c06f835b24b3f58a0be6f6dafe34a3f54ed88b5a13079"),
std::make_tuple(ALG_SHA256, "d10062df2fd6492a8e3ec9c1bb1a4b3e7d69de41826eceb59a0f7855237b5c6ec40f74e65f7bc57d402033539bbd99ab354b19ee6125b1f32e6c0f7ddfaaa7059bb502ba66d759c7502b62d4ec4a6acf0427a4ec8b38c1ead3d7c09901e70899bdbab4642e322e8e2527ff4c9809e53453c72643eaef2524f21633af707aa7b1"),
std::make_tuple(ALG_SHA256, "be8d5a3415984f55ee920a683297caf84840540e2a69a10dbf38d4db655b6f41cc90c5950b6bb396ed548b978ccf51e022002a511b6e11486f07ccc52e641ecc5d4f3f0b008289bd78b274ce0fccc440d27f01cd9ffa28ce7ef7a05b34f86fb416d0aedf1c663a9336b6ad55e3188de1ffc5c3cbdc974e66951038e59f9ec9c0"),
std::make_tuple(ALG_SHA256, "d7d91606f1ecf5576c6fd5c1528f398866590cb912da386aa1857443aed55d3edc33c9aac81958763c784caca6579a3cc8bd40fbb0d2daebeb4170bdf6e09394f593a80ca76e837b9a1938779b792d98718c747ecb955816767a361ad36a8fd789c25a3377329feeed1c41281b3c1c24c98e4f4b496cdb74aaf76e622fb9798e"),
std::make_tuple(ALG_SHA256, "5e8e725d0c19527bb365f34977cdd39aee693fd8eb8dc7a79493eec5bbdb26346b0ffb9cc0ac8eebfcbe453ed8ebc10418b2106062f524d050b5840dc41e42327cc32d1fe62a4720358b7acab4d586265af23e129f4cf4e38f90324f1db2ab8bb93170b0259c67638455fab5b4950c48ddb031b44a9a1e2878aa5e556d9f4787"),
std::make_tuple(ALG_SHA256, "10130471dc383f0a7871acb6d18743a430312f61bc8974ed41bdd5142f07f5fbe6dfbcfa306ffca90f47553eba525616e208e49139e6e023351b04a811850ef816db21bc182c68804388fc0918fd08e8b2c52b4f4ebd1d240a199654ed566b6a2871fa609b57c9b49b9c6abff36fa24328ceca4302f67417471e52bfca645478"),
std::make_tuple(ALG_SHA256, "eec08f01fb4c104de953caf6ae000a9fb42a1bfa3629c839eee81cc5ed3c6c33ca749874fe328d4b8f790e04ec06b56418e434dc0b3be10156697241055304cec9fd63df575985180b5d5746d158bd504586d36b19e27a8cb73b1023288a7e06358378abcc6a009ba5282c23249e2a4d8239810f28c799c15b897ed41e89e1c2"),
std::make_tuple(ALG_SHA384, "7247df014b08f109b778c850bf0763e7026bf056b595ed32e8e38df20b975dfeb0882709931716a1d7651c0492c391368c6a1d50446dd71b34ebaedd56890973e71faaa06bb2d8a5f1a3bd1298250ddb52f4e8aee84502843ff80177d91526d39e76306fddc17d3e8e9a7321da161effdd721a18aa05b4968f734c659b24fe45"),
std::make_tuple(ALG_SHA384, "3f1ad56f3073857039717eecd2bf9000f5773db9cb3879cb8479ae86861c0305cb46dea9846fa7c603b5d09bd7761288391df97ba73ca2accedcc48aad11edf4f8d10eadba053a0a3fe1abee317106f80175dffb886f80afeffae6a6cc5d0d818d606e631a5fc5a6b69c17cd26d9f4ba1627fa22b8f99a3dae7c1fc22a2beb12"),
std::make_tuple(ALG_SHA384, "6e5f71b6e9fbb5ea92743004e2ebd344e8c6ba6349a654278599c5367b928828301659dfcc37521be5c6544900c5a89c551be65fd38b168a64e7169372813c86aae33b5800c04b79f32a84a812048b0bbfbb717f3331d82dc2fa585e60cb2190652fe1c88d7ce82b43068ac81f92c4b9ad0e236a707fe238263a523e4e577f6b"),
std::make_tuple(ALG_SHA384, "413973543769eefd2713c24e100cfd6c8c562905a4a2c6eee813f80bc0457c70fd8ee0c5b384f4ef4bbf7cedd4e027ff9ad1c50efa4fb44874a69b0b02bc5b04a85143984d858482c99be4be3ffcb6a6ad7f095cc1e72067efae22a1c00113506d0b0393ac768500ca2f638bfa6a90a9ede75eb6a273f19480b1f496a21a8a9c"),
std::make_tuple(ALG_SHA384, "cb72fa190800bbd41a49acdda9dc6f5e085487de7687bc139d00c0f75fb0121ed2e02346896ab83016298faeccae45feca34775635d628c0c4006228822420b3cfae6c53a839c5992903c3ca509efe3404e92bc2563f88cf06ee7b3849eb75b5c9c41d69eed5abb75cbf9158bd1661aac05aeb4b6129a5e76cb2514e3c6dd9ca"),
std::make_tuple(ALG_SHA384, "cc2962fadce79e25ffd2230167e359685ad755293528fda3b13b6d9265db9a288ce635600946d38fa8234a3ba7575e3175239dd2b92087ae9678f2542d55ad67649a64f5e6d2c3056c65de6f3a12d1f1ec99a37e72b871d95a59c8634d0a5232ddadb5627e71b8b0d101a84429fbfacf48a331d669d9024e8448b668cde1d1ae"),
std::make_tuple(ALG_SHA384, "3fba35335b2bd9a14032da98b11ba7d548ab4363b753a66a54a86148d51880e257d5b43ca616b248b87fd6fc7add0ca7d017f085d66234916db3429af37a2399518da0423b62a7d9b382f047cf3adf6dbd94adb80486c3f60c686668e1ab991834c93f6ca37881fc3a236fa1399aeace1709c124c8271a403caf14d82814aa06"),
std::make_tuple(ALG_SHA384, "c16d33b03f3070a88af282ad090ea51b75e70387dfd9d553f570cc7f81d8afc2329545da9f74752089c2ac5f60bb7fe6094592dcdfdfb8d4f8d45ba1a9b41f6c4c04c2044035477432d353db9bffd7788a1fef05a4d40a46692d4ce1b91a3070962372d52b592ccd0d8d3fc9c2c1f4f980dce3a936a214d0d1e265e6b8f12bf7"),
std::make_tuple(ALG_SHA384, "b2d61258c81edc56f85138a0404635574ec0160596380280a1ddfd12a8da17d661d7e36519c22bb203cfe233d0bd5a427f5cb8c2774ca405d30745edfd216c527ecf0fa414a7fad205a6c16ab477f90172f2a7d596e4f9b1d00e3411ba70ee87b0c77d5de254af7ca7dfbc8c15fc785dce8dcd861c88694c41fab4c5084c053d"),
std::make_tuple(ALG_SHA384, "fbb1affe25a7b28fe7427aa69a89cb87bc0fb68c940d63d319b30e3411c050767651a0c21df619579a0b7e805e467bc3228c2d5c8909e5ea007f2967e9defc5dfa166057df2918962784b2065d8fc571758378f16b7c43ab26cffabaa29d076a4ea8f6a7b36638b557542021e18d32f77d9b9d35828d0680534987168324f804"),
std::make_tuple(ALG_SHA512, "0aa7729d265c746f66b75246cff95b073cdf630253c85d2eb7192db67fe1b7b5e8b93c3e46efe6a041e3a1e83db02da71a0f71f51e7913b52f8c451b46b0e26c20fab9053751299ff0cfeed116693ad687d307912d9eacce30a4afcb6aa5dbf71c3292f9dfca64f4dd44e00a406ca91febf1cddf687f5302222813ced508cbde"),
std::make_tuple(ALG_SHA512, "e853030dcd5fe68b1c59844a548f85a184a8801a182d6f1af34860c5becb6d1c7f73ed686d6fecdc031cd97653137f269d65373220255bd93027fd378908d968e36e89f0c691f85aa0fb1920158cd9cb96c0525b353541e9b767ba8bebbe1a783bcc3e6d81cff24f1c7eac1142027bd897423a5dff630993b18ffe8b8ef61794"),
std::make_tuple(ALG_SHA512, "56b11c9474a886b054aec059977116b88d8eff7efb49fe301b82c6c2e5e5a1688d6012a94ddab9b5642278f85f25d4ef97659e3bfba6d2f40feabf3f35a068232c192b98d63ba0e13e79c41cd90357180c398266ef66bdb351abf055fc39d82339c3ad8a973402dde99deced8e7166daf5f4f4285ff18715e7aba12ac017b911"),
std::make_tuple(ALG_SHA512, "6e5e789c4b97962250ff3ae8310b522b03064eb145053d5c201e32feeed5ed6ffad7b7dd86eb8e64132582dedc5c5ffda4df8c97b16433401941a21e3cdff2f9926be692a7ce153663e04c928fd82ec995081dc487c75eca63ae77509607dc12be82cb62b42a75c0ca985eac516606b85fe7c9e1cf15041f88cb793b0335f5e1"),
std::make_tuple(ALG_SHA512, "806363d4e2894f3d68f35c78cdc332630763a64ac223d5ad0c246f44527656418b7d68d5b39998f57b05445e3f00c3d7382b3db6f333bfa501af8ea6f14cbc557b27fa6dfe7aad8e2d7b443e0481c82d0269b4bd923808c1ca019985570aab10b82ac1a5ab75b490e51c031f068e6aeecce3b667877bd78acde237ea6ef74af8"),
std::make_tuple(ALG_SHA512, "1c8b88e34c5469ce1c6fb2625b0247fcc07930972cc0fa9d30b55afccfdd147d85551b52880cfaed4d3072194ee665430b3ef3184e66e256b41e43db696b520333909f30b23a6baae6fb55aaf1f936b11ee8491e23358f00a3847129f75da8842e225aa8524585acedb7a13dcca481ef035d7bd13296c84406d12d0d021adba8"),
std::make_tuple(ALG_SHA512, "f708072854534169081799b3714803beb67f8409ae4d39cdfed09a2f828300b9ef5a650bb60f6bce2bb6a0eae69801f9693ebdfb04cc3b4bf6915dd2d5db077a3010dbe572fa47600963c212c8e252798af45218194e72694e72ff19798165740250f21f51bddc05ec448693dfcdff2861c8cbc7b47ce7104d9c076e351c2291"),
std::make_tuple(ALG_SHA512, "c810b157fac10e2fe1fad7b4f03337b5c75de758066ba2bc5f11d9dcf0cba7b7cf2207aee62b452d0150b28d25529c39248f7d106e81730b2a88f02085e9b3664a16f779b430ea2080ca602d45f0c9a5086760210b37a674e7670f8eda08fba16275e7820bd8e55185f0495cf912a6419d6ef9538794233fbf379df0973067af"),
std::make_tuple(ALG_SHA512, "431f3238d891886ec8471401ad04daf24e00884969955963b03b398e11b62ad33a8ee6135dc0c65630b3e25f396d7a84480795bc455ee7fa2b0cf8b9559783d8f9e71ca9f2fe1645c2e3a422d7df3ee70dec477e756bec6b55154f5d6f34e50386131c211fb342e385bfa2710fc2f0c3a598e7b781233061333f86a2e8f718fc"),
std::make_tuple(ALG_SHA512, "c2d662d5ea51560c4e4a3c25e137c4dff571f009aede2445b7cd7c0d332161f3f7b25f2df6f03150fcca1e5ca0ce89f97491c3007e51233decd9597403a5ffa1594771844409df5d92d4a0f57a50c9ddd34dfffa846289423cd3a9c063b82dde505c41e3bce487bb76316af75907af147c6e4c00a8587eda0f8516f93aa41331"),
}
}
};
const std::vector<std::vector<std::string> > RSA_SIGGEN_SIG = {
{
{
"28928e19eb86f9c00070a59edf6bf8433a45df495cd1c73613c2129840f48c4a2c24f11df79bc5c0782bcedde97dbbb2acc6e512d19f085027cd575038453d04905413e947e6e1dddbeb3535cdb3d8971fe0200506941056f21243503c83eadde053ed866c0e0250beddd927a08212aa8ac0efd61631ef89d8d049efb36bb35f",
"53ab600a41c71393a271b0f32f521963087e56ebd7ad040e4ee8aa7c450ad18ac3c6a05d4ae8913e763cfe9623bd9cb1eb4bed1a38200500fa7df3d95dea485f032a0ab0c6589678f9e8391b5c2b1392997ac9f82f1d168878916aace9ac7455808056af8155231a29f42904b7ab87a5d71ed6395ee0a9d024b0ca3d01fd7150",
"642609ce084f479271df596480252e2f892b3e7982dff95994c3eeda787f80f3f6198bbce33ec5515378d4b571d7186078b75b43aed11d342547386c5696eb3799a0b28475e54cd4ca7d036dcd8a11f5e10806f7d3b8cc4fcb3e93e857be958344a34e126809c15b3d33661cf57bf5c338f07acced60f14019335c152d86b3b2",
"42f3c3c75f65ad42057bfac13103837bf9f8427c6ebc22a3adf7b8e47a6857f1cb17d2a533c0a913dd9a8bdc1786222360cbd7e64b45fcf54f5da2f34230ab4806a087f8be47f35c4e8fee2e6aa2919a56679ce2a528a44bf818620d5b00b9ab0e1c8d2d722b53d3a8cca35a990ed25536ea65335e8253a54a68a64a373e0ed7",
"ac2ae66bca1ec12a66a2909fe2148a1d492d1edd00063b8b33af74760dc4056718fd5041d4dfee12bec7081ab1bab2d0eb2712f334509f6889b19d75d1fd0fc61bf12976109c3614c46051e2a401b20880d6e64ad6a47f23939803d138aa0a44bc41ba63030746622248771431dff97e8a856f0b61d114f813911ee229655155",
"3a2b7571619272b81d3562a11c644502894421583e02879f5a7759fb64ec2ab8105f7d11947c8e4bfca87219e52987aad3b81cbd483166ed78152af24460c908879f34c870573127e3448c8fbf43028350c975bbc3a999196a3e9961228a2bb15b4985e95bba970ac4ad2ac5b42ac51dbc6509effc13396693980fc89ba44c7b",
"b10322602c284f4079e509faf3f40a3d2af3abef9f09171fdd16469d679bb9adc7e2acb1addb0bd5b38b5c4d986b43c79b9724f61e99b5b303630b62d0d8d5f76577fe7ea387710b43789ee1b35b614b691f0a27b73baf6bc3f28ec210b9d3e4c5a2729cc1203b74ef70e315cfe5d06e040aee6b3d22d91d6e229f690a966dd9",
"60ebc9e4e2e2b4fa6d31c57d0b86835e8d201d21c274cf5452cdd7ef2857dc780dde3526f3658c4f2c8710eaae4870d275997e5cbb268e3bd251f543b8828feb85c211c858e47a74cb122dc17f26fe92b4afeecbf1e20bea75c794c0482aa6532e87955dba249f0fa6562bdf8f4ccd8a63da69d1f337523f65206fb8eb163173",
"859cc4fcd1b88ccda695b12311cf8bdca3b4c135faa11f9053dc10f4bf12e5f2179be6ab5ad90f8d115f5df795a77340e20662809fa732b92560adcffdb0ddb72d33811e94f854330680f2b238300995a9113a469afd9e756f649208d2942febffb22e832279063ec5b57ab542d9bbc56e82cdc6a03b00d10d45801575e949e1",
"77f0f2a04848fe90a8eb35ab5d94cae843db61024d0167289eea92e5d1e10a526e420f2d334f1bf2aa7ea4e14a93a68dba60fd2ede58b794dcbd37dcb1967877d6b67da3fdf2c0c7433e47134dde00c9c4d4072e43361a767a527675d8bda7d5921bd483c9551950739e9b2be027df3015b61f751ac1d9f37bea3214d3c8dc96",
"5aa5033381bdd0acce332dd314daf008acaa9e835f832979891d1bda2b55d5eae35c479c06cac5bf33f432c8c0a5549d1d1b29c5e2589024d27800a0c235a61532c203cbc406ac6ecf63f52ae771b97c08e4b108ec916900e5a11b1d48cca86ca5a5a799ed32e99c815cef04cf8eb55223bfd4d9c3449264b60061bc3684bc82",
"1ee03bd2a0440ef89c0f19fa03c855074e16f6ed426ca35bb763138878969a814be2f16f3dbbf73d2fad78d42a8ff8aaa342f5fcb08d2dde74525ba5b2c65ef4e33d61774545886f7f217eb681a54b42ef7df66ce943227021c1b5709b7a554a64141c1fa3609ad25fa8317068369b8990b843946881044066746c1203b57acb",
"c3a66796c87319c01a8355102562029797d695de50b46bfa39c6d9a4c0642b6de80272481b8785b0ff3ba4571bb45cd6aad9c5fc1383c79f6b7a13c4e67f594f81a81157de6247b896345de1aec94adcccf126599132846ea1398585499be4e759a1f7757d318ccf41378b374275ad4cbcd1077476cbb06ea42b36289b0f80bc",
"59ed09ae9cb743146781a1aa58c608fe107e2f6a1767d774a84eeb00f84586e4bd0efe7f201be1cfc4c67b73441fde816b91530270c62a34d86e5c8cdad4f0d0b90b53aed9bd31c7b43e1d7517f413c8b10232ab7d7a270f250f09817721611f6cc96137e8067e8cf77a7ac25bfa8f8f157c4eddf051da69be6284e877aa435d",
"4415ec9cc208f5c981528821637bcb0ebbbfa08418ff935667efcfc088c3941b978280bb1c246762883559461334b0ef26eca0e5d4ab72059fb5dd59aff3ce5d0b4913e19797561116ce3934bf5f362b88fae1bc9ebda447ec32ff31d26eec3951eb87f08412bd3c3b7a23b44d73c6c2eb816859f67becf8df118c382c917d42",
"63b946b4f8e61f3d5d09ccf379cc8b6e4b65070a96144e13f1f68c17f91645ddd70b32a976a5288f7484573c46687a82eba49bc4216c9328d6ce8afeddff5b123ec0f495d95be89a695d0378241b005302fb85a32429121d200997d759c47f9fdd4e29c86dea2a7f2dda2aec22ad48f67f6f3fdd3791ba841fc971403d86ced7",
"bca2b39e5621f6f20073775067b0b7fcdf3bac402416f2c335b7296ebff514ff21e896e8aeaa4701ce131db5d932a16dc0ceae235d819b379a42c91d9f9e9db2e8650701f2e6961035a89b3394a65fc2826a30e7cafd0d8726b189102e9a9c8e1aae152808aa2d1a6b8740b6ffd862366cd07174513929d8b65702046447977f",
"481157d65c91a09b871bc9f704ac2c31b1e6b097e0d49e291e037c11e707f48ac166558e9e8c114ee444c4d649e7e2cf7374269b036fea99bb3566d134d7ae5dd4141f7326884746d396be3207da2d9f56862585993db42ce282aa2f048d12bccff12f14b9d1ac4e33d371fd4c0de1563c978826468e6a3799f64d3985d4689e",
"3c23c9e5ab29b8102e03932934616481013789e19dbe6604ee9bf0a64ccb5e3b73fe747ce8b8f1efce2a9907e04199eb211ceb90be284ba71374a94223a07ea9a739ca72faa7ca4da29bc1c044af61e4c563b6663af2050e2a0004fe9e883951300a25a45ffc3bab8884d9f0f2279a26cce7142dd6776862ab63ad636c9acc95",
"7fb485a62f837a4765308ed005a61fb821a9ddfa6bab4e76548342e8c2a853ba1ab720cc37e3e3661408a36bead4ae0207c505b8cd9fa67f0e73ce29bf66d1873c98f9b4849e4ed98727b206eabb9fa4cbcac1eb52e20c3d9b12443dd1e746a755babeb340870e660112f2ce186539e943ee7fb335adbee045d66a3016e8c439",
"0e7cdd121e40323ca6115d1ec6d1f9561738455f0e9e1cd858e8b566ae2da5e8ee63d8f15c3cdd88027e13406db609369c88ca99b34fa156c7ee62bc5a3923bb5a1edabd45c1a422aafcbb47e0947f35cfef87970b4b713162b21916cafb8c864a3e5b9ffc989401d4eae992312a32c5bc88abbb45f99ac885b54d6b8e61b6ec",
"5a616faeb00680f5c4ef633205040b497b5e5e226e4a8f493b1ec2a26fe7a0971fed4e1b8f188eba8161266fe558eab539f903c0cd8ed18d21af77e30cb264c6214a175588ed542b5fbdaae99e924094e8c8a22366441d866126433aa45cd37773b9dc3dc179ec8cf51efb8bbdedcd229cd2dc2334f5bf2b0b00374350e6147d",
"c24dd39dc4306bb0b06d548091714820f14a3938437ee76d5302f7006213d388041b79db6125c337ce41d2086f2536026f0fffd20aa9dacffe4e601dfe51310729ad050c4f396b0223492a63d9a011f70cebf8850f61f0ca2ea94800f51e35bbb077e99beaf12fc2caf1744700eb1e027bbb450308e167437272433ee7a765fb",
"b34c8e11cbfd2927bcbf442a6afbbd6ea5c20f5e47cf56c57dca93e10bdabb20b958997b216b92d09fb92cfc3445346cc9e63721b73db06dc9e36727b8daa5f16fa4959c977f6eefcd2fc9790c5e01f31f8190360d380f4332526472e32b25e54781bdde98016bc25ef8697d5d73a6b7bba06fd3d8b9ebe3c657b86f07028ced",
"68edf786f166f9aa932816d70b7786e1d88128da0ce1212bba5b56fc8f8dc21d54b5bd44401af2119c4a4f03cdbf75615cf08f3764fba03aed856ecd01caa15ffd6a3604a612c81218f3c395b931fd5fe78031b674369e49b185de6c00b6effdd8d10aab7bfc6671900c58c6882850de5a37b87c15caab18b8cd6bf8e5132020",
"0687bca5c51bbddddb68d21a912b7d3f89a54517b7f3c6ea5da386b5fb6be8c7a172d6528b2dfe9cdbcb3f4cca1099a1003a69176eb3292a1571b8451693e1554c6ec5e9d336771378718a9e822f02f783b9cee3c0f8ff2654539c495478ba68cca6a6683303a104230e4dde1c35e194eba1ea50e7fe690cb19d2b1118a87be8",
"13049092c675809b386459eccbe1c540a1a8e9cb674da9d11349f2c50e559387f019154216370752c8ae0a7c4b6e031f414f7a32a8ebf6f4f87d4692caa44e535565e0c0deb9471411126f6dfed6dd860edd1e97468b7e144f8ea6e0b5063d3ebea598b47ef9d6292ab0c05f5621d20bcb389d550bee84d190d79c7d8820a97d",
"43e64b245e65eada15e66dbcf12332ae80637917e65a68f9f9de45be6ce1854a582634c139892d5aa29187801c7ca47af5ded85e5b0a32e825d706f6eb0b2dffa2f80f69fecaf87aad0919765cc2cb2042e124eda7cd157bedd321cc12100f8ceb3b90b68da13e5aa65c2c3ec184c6abbbf86dcbffdf1ce36f1b5563e8b56044",
"57b17157b4eaaf0a9bdcb9abe4b299a728e6df5f8e03d688037d5e1ed5c9a66c20ac739e1c3516a4cf78155f52ed7d054b5c5fed534b80dd3fc92fc0920eae695f2fb9626cada584d572927a00d612aa690b7f6051dd581cce4748eab9b4d886addaa32c4ed7d7221862354556eb68197b05bebda90c3e01e00e27c5ef547c83",
"2b1ffb370d518a82646d86828db1fc7e8bfe73ee878da120fa92737c9174688995f2255b29e83b28c244cc563c9b33efd3f9f9e1638e2c16e24f2eae19435696b2f4d1cf73064fc1cfccb2278c01f0979e7de7463bf8417bd6986fbf1d34d382a978ce799582442afcc92b4fe743216b6f151f6a561d979cf683cab6af2ff4c5",
"1689a8523919ac77cc997ebc59cb908872d88b2855a309ead2779b888b22b4232da9b93bb19b32c1db77ad738c6e43361e9eb6b1a37c49a8f3c7c7ae7e784d19a62138741293e49b1831c0c3617eb43c56706d83314953470636441086419ab9e6fd1ec4f9d5cc6544815d1e02ed96a3ae64c6998b2cf238e79a12164352d12a",
"7b286c61b67110e232533fd9d1ac890b52ced71c9029d355c3f34c90c5fce068807e424fe948554ec3946f8d4453596acd29e2d44b45e3460239c4cd92426bbce7d1b0f8f93141fd9f2f80a506947bf5018650fa0babdbb2dc1939622ea8790a1d165b01c92ad91541e2aceb8a775b5ca4bf225b8b03d99a2405bdb7b2fdbdbe",
"98a7f89db0932e94cb1d38bb72a85ce4143757c449f85cf891826c74307248aa6a0a32c45a10ce4d21bd889b6716d8b323d191952571707eb73313d0af7324a5aa497b3d045d44877d4d8ace8bf1cdf0345dba34d0c1a79935ef94dcc60dfa980a4b1e40b6d30113d557789118fc1eea5f5c3f9f49acc1619643685e6dde5827",
"584abd1f5e146b2b01b12f1c6ebbbd5873980282c63c90385c2f7040b34464353bce9ddd9b573d334f7666098e7a7220a4539f4b4eea2fe0320f97cdcbd6b3dbdf76c396a88e8bc73c37a832a86bc1453ad9f9fb7de135442d27080bb2203917a8cef60bc3a55ef73e2ad8ce880bb5e5ba6365a7b354b3e638ee095d22197ecd",
"766e1aa607e79968eec237369b4c9140aa6bfb8714b3d97d058a5464482ded41f5036f852112242a3ef9e97e5c31b02622c72f7f37dd47b7eca8b947ef55d3375bec1618b09fcd982e488486a885165f189aa02715100bf4e09feadfc6c2767145131ca87ea0a20f475d6d44b6298443e9dc49fc70b318f04188daf5ec487ecc",
"84f034124c8280ccc4f97e9a326d57e03ab28fbd84562a5f4bc0ae66a888b64c4c9aa272ef567240dfd633560a79c83974f628444df337de9d4e26d10964c78322de3053f00543c0b135cf952bdb23c3bf02c8c6b8d3acc9033fb5ccf266394f4c8cdc4a44824d7dd38697600dcb62247f6a1b69ac14de062d7c66f18fe62d7b",
"787b005e95f9642ba27e5f4d365275bbbbac72bd1cfe292ea78016700aae7af3c9e0e20bcfa54dc008c65a3b91c6e17c67d6229086c5a6f677e6ded96b88f6e8541c63f664a38f4cba641aa177176f9a3e45a67ffc7608d24f4b44065e09c2744b7be4d349afb0e8f2e7c5106816a46c745e61a572bbd5e98cb6b8d34c6c682f",
"599b511fc8bfcae44054a16c299b5f3c64b74c760fd182292b31f52204c627c853f6fa2a753216026d312574f6adde4ae829680d28dc1c3253ffa96f56d81e1c4b5dafce91e809d9f58da72a94e29dcad52e6759a16a06304e75e641cce626154edeef364c62aea5284ba40270e9050e81cf5a7dfda67a7022fb4dd5514e3143",
"798638df8cc53062b8a312e906527ce8e3a6b2b6456992c599e82cafcf1ddfe6671674202aa61fcb9e83dc1f6bf93d2edb7651dcf869fed987477c26d0a2a7a2c94dce4fe29849c26d477f782a40f2ce1f4050b5bf3fe3e70d00efd284dcb9f52990149ec8c5b7d229db841e32741a74fd36e105e67c1814c08ea9aa44f2ab26",
"c700283557dafd1f8834ec0b7a7ec733719cb0be6edb19f1064ee94c75b8d9d49458fa184f7d6dfa5a6da2d2ebeef0650d8af35447823c83a7737824509a7425339caf99101cd1fe3db883fb98d172127e30e38d1d6f9e3654937cd68cbb4ea228c816064fa8ca0950c7e7b6ad25045574a6a4063b63f07466b2cb5d7311b7cf",
"bf3ff2c69675f1b8ed421021801fb4ce29a757f7f8869ce436d0d75ab749efc8b903d9f9cb214686147f12f3335fa936689c192f310ae3c5d75493f44b24bc1cd3501584aaa5004b65a8716d1eda7240ad8a529d5a0cf169f4054b450e076ee0d41a0011c557aa69a84a8104c909201d60fe39c79e684347ef4d144ea18f7a4e",
"398cbaa07bc4b3432f0ad0ef54b2402c2d25c0c46f7229fbfcba4c141cd0db76aea42c2436757b16f7397c570e891cd4e6f0a052d0a910c8537d4effb2d07f06890581dde8bad7f77f8781bdc052c0caa50d94d95897508d6848f5e26e5975f1a63c03f45bd5479bac0a40a3e4a1adfef847c3e9e9f7612d5034cc688f019b86",
"4af9876c2a520a79282226d953505b166a67f361545a65a980abfe43e8d09bce6d89892e556313351cc3312e214517ea6d62c80c734eb276074e64675e53289ca41840b4d7c9b225183b8162a6f0761bf1a71341b9482cc15ad516bda050da93382567998f844529131b1b560294060b36171a4e7118a5569beff9bea078385a",
"5a9b01a6d3e08d45d4c359502ec613489b733cd5a9c385e2d3e77594996341bfe3475e1594e6161c12378ff2e2928373e247ab4c0aafecff220339b0f063473195edf91725ae5e114714dd75de8d2f6eb7865912394c849d04fcdbf97921ac1ca79c7859849e1ba09f396c2b291f9b1f11a5864baa11f09f5c24164ee2422768",
"5b5a22bf6be45cf311c78cbce08d9c499b239985e3ce980da04974c97d16a21c0c38666460546a9ef141cbbe06e48d1ae8931f9247fa42114220be91acf8d86e21ee3f36bed644b1c9c4e967099bfd190676e0b12978e9b0c996afa07065b07701bdca9e6c0ca278b88894542457f0fc02b938525ad6b5300fb52c9cfc5b8dfb",
"85ae6a4f4f6d0b8deabcb65fe319a51403512b745abef4fd306a2fbe008580da8a1e976713713bcce3b2a56ca2910743adee058fd6e3dd0cc0174c15ed1d8e1355161e920493621daef96c3f74105e2b65b9621ce7a1924a649c13083ebdff4cd20ca1f72596c763d03bb539cfe45a48bd161574882ef60854a60ce4cf38d1fd",
"4895d5bddaf911a9ff22731726e4d68a4d544721baeb82bea8444797aabd45f99f9a72471737a5f6db09c93ed07728f45fde8110e1f93d4b63d08d4a87398f469ca5aea8267afe9fc571b7eacac0425166b9a0464cfc64d7fee87aed80f7c2bb825a03799106070533a97344c8cd63d5bb8f6707198fe99655a589272a0e5af8",
"9000dea9922c03ffd3a1ca689dd4b98c368a128f5153b2895ce995f1771a0816a09fd8b493c460f29e49e1ab6a3867eec293f5d1fbb77fbb77c4a28bb5b9e5d5fa06550edf365b94ed4daa3ab981a33d7c0015bbed2572f3c5b09f4f1922e5626732c8e6b5d31e5fef75d5a9026ca5784dba571ab72e3cf70df4ebfa6ad7b69c",
"6244f168e5f8efceb00f33e5f4eaa8212b1b416ba7f1f95948e476755d532ddeed5bb84902df7750f775dc53a151737b39923dbfed374616f944b5f73d63e02d9007ca1e9d3333e77f200d8b021912af9122f861740d0bdd130075d9f112c99fd613f9a2036762dd6237b5c91b33fecc366324536195acf5552147add0ec1c8a",
"5d5cf180bdac8ae14a50c4e8b57b88ba68b1c3527d34a63fd390f33b8b025a75f7ce824f1e20de814991364a97c2ab9e6c88cd196abf6c4a0ac66013a73db9e94a988a4665a31cd4e0731808c88ec1457c481047f3e32b08bff6560cbe85cec212239dc8b25467debe536a8ab1a951afcdcb2cfc411afd5c189f4b0eabeec3f7"
},
{
"0b23b64dc869d805a910eb63f4cddb682232c007b2e35d98f34a0a4d3ea8806723921920835b06792fe015925f7a8fef1fc4447ee4ab4a74fadccf4b9f24c1948aab43715824a0e28e61c20fc630e07d123fd3448825dddcd719baf06e54f481b133412a29a921a68ddb2ec2a9f4a5e61c7298eb1b183db926a13920045a4df086d6d612abb39ed32c39aeee1daeb352df547b9fc3ba2ffe3f3e053459469f846c11679e505f07c020e505953ff518b2e7eee015c7c50cb877ab827c4b8b0609",
"9aefedbd779aca14709410c5bad0ffeb1b7d94627042c096d33f114a12428a49431cc19c9ac32f28cf1b2dc441c090d3ec215a428a107d743200f2d255fc362cd9937fed7f526e520af21935d174a1516ba33533bf8de2986095d37d684ad42f440cc57b3a8b794bed5638a577a60bfe8c1cfa96d73f155c7d039712f4daf3679e658f61437dfeb69be2586c6aa7cf7aa62838f670ad3b2aa375a49807357582d3eb52c959721ba6792a38e237cb3e47904aad3691bac8ca8d1be95f42429e79",
"374359025e79a451956e52de8cac9c2b246e97962e5eefcfd3d93dc7fa88bf3fb70e2c3fa6d102558f5e2737cb0c2ba438ce852acf9d2fa98606630d0825cf1bfdacd39abeb6a687840e5f988d5c8658e8fe22d474c7a5c196897ba4005e7b9500863714cdae8e54a3dc75b0adb802278eab96a76c14ce0ae302129c8b6f7827820afb94f3abe9d2f84f03731f05a24a03330f84755d99bd3df6a46fc67c4db4728d036c6d44089c12c00e2b330dcdf350ffbcaba7dd8297ca1cefa6946b3c3b",
"158c1a3c66dd1f18aee57f857f693f69b7a44cd446fe7515939740def8c94abf1f803d41b838871908abf271e12ad7c0734f789c449778088a6798683846fdda8344de2c1565e160eca2bba476b4d59001b506afe5bc8b28a319a5902898a64d0e23eefabe3258be86d2994d64b02584f0bac1a52fed2da6335899d24eee2d02b84d68bffc3de9bccd2ce0239f95f7aff05c154968ff2322ec2d3151f10f77e870443435c16d6cada073d59722aff392927de28dad315cd0a5102b5147dcd855",
"1af30b7601793c480e7ab8833f2c0220392c8a967506fd68c841670cb60513b01e119429a111d702a90f46478255d0095bf191f76665b4eafaf2efffd21b0dd36d0f0fe7a1d8b2abb9925be63a0d30ccc5b93e1c8cf64bb15b33571b4af04f751e79650e525723eb7f6d24f2e574e991a40582e24ef62a6ae87a860b4910aa5fd56551caaf7b5c9525ba1d00370e7fd34dfcd2c50beef90be5606b0eee7a6fe3c929da9f8a7dd1337454758a4a70d1045101d2573950309d4eb115e8a086ff21",
"9b99a6e43c58b8336d357706c0bcf8b6aa65c9b1d806f93297aa0811b0535632fdb544086211a83040e5db9f8b75270044d8aa6dd68373c6848d5bad3ac7c6dbe00b62f1be8188b2d107b637537e76a9166e9f1cdd27c6f0bd919ef12ae2b36a8f9ac55eec950d2de819db689ed6cc624e850ffdcfc2811a59ce75c27ba1178ebb2867a3a0d82546b4841350bd758177f08636de24d053ac3cbb249793203be65dfb49ce4cc54ae972cac77fad725828853ed5f39a898ecf2b4828c2b09707ee",
"86c9998ebef634c24205306608a50eaf0078eae3df0662c9897b2893333599c5b0185a86a21afc932cf66b8f7fea28719548095b2c76f12ab92451842e5f5afc32666364b5ec0a974bebbf1a1ef8655a5ab150023c355c3b6aecfd995fbefd657196e56c6e354df9180ea673a47789188c71eeaa04a391226d641be62a08799cbe86c5cb3a6184e69d1d97c8de1dfaa07c5a1d224e26c3b0b5cd2d2277271a45ff38201c3cad98c7ee89151eb2f27801ce4e9adb9ab07b24999da423174d4575",
"72d7ba63e6b42de149413f08c7d49b5ce52c52447a31ced6c8766cf5a2b889ee826464591036e992207bf0ed0912fab8263f9a2727b66ba28226df526f369e6747995b9deb46ae1200b349e4b090a62458e03e432d4ea1abde5f6839a94776fd7311094a209ccf2d284ff95421930627d6f4a3b5bfe2deb7425ceb4a3efe8e82a184d137cd0a8db22d12f2621e1b33e0c13f46d85c4f3fc8a9138a69b1a9f137947fa68915ae3ceb842fd54615ec1e0224069fdf9443b224744c31ed1fdc9b1b",
"784f31890d7da137ba05ebc0d092e86ed6b40a96a0d24264f0a5ca6a8d863145acfcdfad099e0ca523e008bbffbceb8abae26046937e796e0e73b4ccaa07d9da317f1923912b2380a0966c347f942eb412e4103700975c9b3705120b9fac11305f29d514955d40b7c94bde537bf9e6963a74a7770ae353265e9f72614eafa4df3ff91223c27e83709c15ec425fe897f6220c21b6127ab9cc8870bd9aaea9ae001b6422b7d6140899f2c5ef6e08c83ed3d62b0b4c310d2bdf6f9ab0168bb24dd0",
"3aa8c0a814b9c7925f52f7e71bef180ffe91edfa68ec9957102ab94e51d7c3a07dbb69de143c89998e2183d935db37bcf72fed636196d749977228b613d4043bb5cf59011981a1e8bdaab5e3a2dd46e6932a5f78ae4191e032b3e11e5826ad13fec05ad982f45d1652e1960d77ad27bf9c469142790f64ef95d2088c0acfc7bb3fd34098359e11a890cd8ff5084c7e0426e4c099f41ce9b2f509940c81d9abcf56aa144b88bf875d92b8ccda731925b02fc76775c5f41c557295e93e1390792e",
"7772129848c4967906da15a7b0044f07f150655e133983113851cf4d3cf5f0259b67988d3819a51475067929e146f0c31b3ca55b82715e6d18c06c78e13aebcd3c1be5e9f428f3aae7626c9b81881e559112e0e4a4084a3367ee285bed9155179b1eaef032aa2e01e79624b808adbf248f71673458a5a44eedb5816bc3d12e5d3cb6bdc1f7f7fea8c8a9d077db8896ed51a342a67e5200701acb7aac81f7de33d4234b88144fb0dac3e8a357b2fa55e11e70171019c0661344b72f93d73bdbbd",
"31a60196e3a4668d34a588e45042eec590105337f32fab966631c1beda84f1aa3439ee87d3a237e7e2c456dda48199afc0107e66ccb7c409a848b9ec3949be87d3fef92d0da5ecb0492457b21d598cd1c2db6a0419dacb7eee384c85eafcc9f28e04bf18c19bfbafb6fec7a5c3c3b557872895223620785893d9d2533c769ba4cd36347b8701ab599da6f4322532c70f77fa01b80f2201c836b067ef4c8f766c5eb12c57cc30d4afce8bed30734a1b028db9d26de529b399bdf4baf22e078df9",
"52d07eb734ff3191ae0239e0938349b0249ed4de2aad93aa26bd065d1fd6932f7da689529929b02b329fe2f5ef7298189327636200c7eaf27aefd6916f597234322a255e086a772b7b26e269284d4205af6b90bdff0ae940138abed68fa4bce217d385059577384fb009b11e195e355ec25b81d1b8496f6443b4f8dc26edd95b99ec3e2abb3797a6d398fe8739646fcda33c81437349d49809036c2064f4d89739fb97e4bea45172ce64a4f8392ce4f530b1f4522a10c8dfc8f7d6e1b91cdcfb",
"03f94f4852da9e297bc4f343e7e03f5a1227e6c05f223359afc3cbd2eddfd4877429f4046571ce669bc7022187c5fcb8126cdcdcc1e25801f12898ab75c8891e4893f1d8d589747884359762bc7d96724f33799a8c774674a1d677a4c22df214e3db25fa1f09d486dcc0bf217d410a86f238f45fc80a0f5fc3370e01ca51655e68ba14b88469a90c2b71db2291cc409fda548d2741fde484797e3790228e9fa5e84cb240b7059452cbe7dab64d638f9d589498019086f7c3a27e2f1f235774f3",
"11e023512d47599449fe547a6d92f11c40cf0fdb59535d44746e4cdd666ebdaa87dff752a0a744638a5df8f6b2a4a02789927ed87c5577bbb935678b1c034fbb569bf3f30e66c9a794a68499266e73ce1645c275a067a0d6db010a6d987c0174137e080374b193f98d34335bcba133d27df21fdf0303e28cb8e2863427e7edb651a9df5200cf354c00d369d9ce1804f7b304b5997d6e587e71cc3f9f83963e1d54a9b0089ddaaa8990077cb509a55c89270c4dc17112f7738f1ef62198d014bd",
"8c14cd62325c489d3bd29fcfdecf1dff118d6247cf65c5e4c37523c77e1fcfb3c665b51c3b7c6e79b05cf1cb31854cf427d5991341701ac594abad6290ba127b93aaf05d9ea05ad8b816bfb28333826c4a302959c1ba5a093cc0319b3c71c4430263bc249d5572a6f93f5d12d6556a27aec1374d13634684d62f819fdc3a8b7bd3a9585b38a63ac46ba9fd460d83c80acb75ade91346bce396300e6a7ce6ad18161c0a1439e558e09a513b839293541a0bbbd4b63b4a381eed075cb88d959d95",
"5127c85058dc71a4a07592c85a86f3fead0c49d6f61b16cfa7ff17017b877453a75baeac9a9e83efa2e1f649eedc8e32414db78dcf39414d7f4a4537a476d3948adc047c3776ecf3166a8a1a65daff3f56df7866abfc5a6735ad755589032eab3216853fd69c3337694ff1e5a5737e3d73fe5d8fccb91d9aedbca20c4833914667be4371cbc99442560a08b97816fc087aa5ec155205b4410721d0038e2ebc4808a215fa000c308fec9f2a84259eb3189f33f7afb262e734b13267740451d8b1",
"6772d4802912fdd4d321da4c15c3b75ad4220a88353549880010ebf43e3d35f671ef38173e9d4fbc2904d2fdae527817c9310b94ebefdc75929f602bcc188b039ce3d966eb844717496949664d1fcdd18b810481ecfaab6540b25aa571a342b9f5824d5f4d946893381e22a55f82b855a764c11dd780f6532d376e23163cde9e1ba2594f5e1b602b1a69ada4edeb0c0a94a064d93b73018909fee5a3d21dbde8917e4803ddd18f0f80ea6497fb73d17124615a7a8920a66b854c270e0ef23bcf",
"42a5d83fa6dcf0aefa64c3d651c39a088f4339952a6f4a32ce192a8dd6e34736936b025eb9e9ff35cdce3a4d6994b0d1e0a74649c612776dcadff5fe3d73c174f492cde03d16292abf082cb7b795795ff927e2b4c8cd89f43f24eab746c825a615b154b5c5ffb30d86ffb1c3d3b8b207bc1d29d312307529b9634783c1ec59c07f45af4d5b5accde4a7c51a90488b3930d7c3c84ade6c5e1a875e2f384ccc9c85c9c847b6b53e34779562039d7e3ddb8338d19494609361dc36c6caf6b48c726",
"5f9e4625c58b861fddcc558f3de7d85c3643fc312e8d04d0e19ac4ea1305dea1b2b015e8cd5b8ae6c348f9e88dd51e569d9f0b8a365bfeb3d493102fb7a530f9cb69ce3385ab5cd0470fde3d451db82eb1f5f226d39f9cc5cae5e3ac6c7075b7170b1f2f3ddf49877511ee178e46ba5de75108a0c9f8bad1488823873d4949c70fdfa1dffc4444401fdbd134d7a326edf0d0b11b41b217f7c388263f50237008e0d78fa022a14953acced92f1dc5d2475c958d81a5c1653b255fb566f8449f00",
"092a257b50a4e4c8c7914e0d19c0088778e5cb4a815fd3a4eb59ccf3e71233934f9bcba2e03465f2c12d2100e722c703acc6bdb8626cac09f964f9f4ba527d9c49a6d6a2136873666bdcba0a297a3c38fe48731fce5a7276015c4d750de6fc550718544767c86df16b048cbd8ab8a878b6bab25ad642dd57102f323471e2fecb84f40be00c79f75db6bf01ab070fb2874cf11a3d4e81e15f878b0797b534743e9666c93f782f0a11539c0154f406c710f1f5e24b490d7f468691ca28730a4802",
"45f6202a029a0b5751ca6aa81f8712da94646b05a44901f8f972834fbd8745e0716888e26fa9319eaf30951387bf9370a3e005c970dae2958e8c3aef1e4bba802af877140b39c467595147215f44a5726ffe4be17004d61d05f39505023a2942cd8c9bc0a2a8ef8b8abcc4bf02c694b5b2d90cc5f27aeff2f3078eb7dad4d0c292d43801cdaeb8c59c5e97a6beb5fe03e320f9ffd5cddea1448d3d308b6d8bde90fefc1083c50f78e8f2e27c7c2a1b54d5dfd89d9a76a40b6dbe118d57336a31",
"2352b15d1c536146660f89d7a6b54adc9d68c0d9444fa527321e19f5444f4118c32b8345339bb6ba35c852dd575db7e3695fbfefd42aaca046b6ce657137c9ed4d010a15faef7f60bd4e6befcabb4139964af96f6be6a9911dce31cac26b9ec7eb21be01b9068c8b03483b47874a6a3c15f08534ada689a9b4bb641b9dd8a12592b8b10c7f437c6ce714c3097ee4049ce19203dcf5e0eef76c0f933bed0e624f8c4a2d357d2379c4e3a1d382def0dfbec85d48c6314bbd6918a583c4c0dc37eb",
"643a46e16763ecbcd7287b66a93c897d2e84d3e4eda24f2e518f04814d3d9d5aac3365d9541f5edcd165049b22a9066fdc9525ae6dd5e542830253f00864ce8b40c9389aa2857453f36996957e0ba5ec2618d47a6f514e2e0451684289baa89704a33f35f242c6f94ed286d0ac7301c35f4361e7b6df1232e787d081dab1ad98bbbdcfacde5996138d52ad8c98843d3ad2458c1cb0143de60585e666c8a82843c750e8d28c41b001ae73c842527e60d54f1dc20320f90a663c701f2bab8696e9",
"8814eb974e33027b3ed47ca9cbe7135e4aab75547be3b661bec48dd15e13bf3797681e9a96c83a409d46796decfa3155255af5d534d660596066f87611408c93c90a403e048f0ffc44d4b079a96000684c998fdc82f662e82df711b057ec7de01b5f42f348c0fb445d3fa8d8373d0ad9a5371804d999e77b6a6977fba65a6eca76c4a84af4ff3805020d6ed3dc5f75e1ae88972dd70c1c00956f39cd8b22e5fc2a613aa364ce45cdfcdf02cee909ab0c54ea0eb1997a8bc97d399fa36243a162",
"5658d6bace6f80ae25ff1cddd8643bfe197b7699edb35a2035fe325d01e97cffa894a2e93c22b77de799531f0812b4931224a7a5fbde302b11397fd8804ff48471beb3c50ff90abf95d80c3b138d5ab3a79108fe5ff7c89d1abe4bb94cd4875feaf4384f5c3c32ff3118b20048d2473368bcfa5b3075606dca2e54ff6e27f00457d6bc5b8f7c6c86675d47fa032e7c395eda977b841cf2e72067d1285113c5081f8d6b14659ee1bf49c78214efdfd866ed4d2c0f72ca661a59844a9f83c3966f",
"4a5b9af9c12d4041775070e6f2b1d8b5a3c7b4966ece2cdf6031e9af8a8607ad5d3a7903263c9467a3e099d2d937f8111164ee8ad3b0b8d4b7862b2678df2bb765dd03375591d90265d136edab69518b33bbed389c7746869e598f82965851d16b3d8b7c4f83d073c58ef3360112e5a775dfd0a3433ffe72df030145969acaf07ffb9874304c1ff20e4df02b9436cc03dbb485955eeb7b6a02665f61edcc22fd908a0ea8fa61b9ae52a346a691828c9ccbe8d12f389f6aff37bbd9cd0ffb8c1b",
"2cd9c7f555f84e77aaa544ab5fce57a019519e094d1c762832fbf940259833f126531f4758278d3b24cb438816cc9c0c1b803d90533914c20e7329d92c0cbbb87bd4c16d1f1f0b9abee539b7aff350c1a4d65d29e80f7765ba09f20d8fabdd1f7ad7feaf4191157dc7617b17b0325b1d9fd51d2b7e0be5d0c00b1578710794907689cad46bfa7be95bc7ad92de5eadd5d9716898cdc309c26e8ec7967b7137de73a5742c1a4b55ada7700d470ecf8727b27d3be9d6c06ef44f6a19671b53d0fb",
"117b987b4c79fe569bb0031cb63ec610b9fc4da8ae05b20ca2fd0608c6c8967baf7fd34fc45ef9e4532013a0a3502e608544a63a5e218109e58568ccc2bedce3b48c0fdf4748b0ba4b4bf569d8e9c50231bcb0caba31e32b2cf8d57edda8bf9770705fa072cfcbf0355979080d8e7291179246f1be59a4d7786e8dbc548598d8fcb3ab293c95b9c897d4fe285ce6863f1eb90e953fea9a36d6a5b359f08d35a8854925940aa06fec66176549e79dc99054be00f0bd9211782de7a3392740684d",
"2bc0a09493a57b56a5ec1e3b4733450e06bc64644b3a9c3af86b30866022702f1d018b4f56254e74fd997877db8a8683b2fe1571f494ace3a7648fd940b957b0b7e98383b9d42fa5b48528df653489ecbf7f92af7385da03af27475db872c6273f2cc79762b05ee0ab2aefbb682a0d415614de31370aaa2634480f5ca7ba0e503b45d44c31f56402fd58bacf34440a26bcb0f8dc187d7761e4cfcc17c78adcaf0c54a10ff6977def477befeb9a85aac64555369c11319b0c97cbfc5e4741dd0f",
"7fbe7bf0b9eef0dc7634606cedf55fdac9e6d654d6e7e1e83a776d8e4f585f59fad12ddfb1d0805679497ddddb834b248cbbf760a352ae53453bc3026fe7694bf153c4e12ba07eb5bc0f9c65038bb5d72368bbaf23ddd4c1da6a9203cb51cb7e2b9efb5b5bafa927885b49f479708aae9f770eea2e5f8ad4050edd686cab35569d27c00d45c21b5aecf2d946484044318c8909115c233c9af8527a9d9db40b8dcba3281877751845b4c2775968b04ed813a7a03d99d90fc1408078bd60aab480",
"3832d9372ccbc0e70c203e46ebc7df8b47de57a539a34490d101279b99017754e973d92d07359c3d8694704b6614e97291be4ebe74db19a96749261f5bb0ab7f9ac42b0418ba8d2418f498f9266e5afd43255f55e04ff713de11f4a43028a2ca1275c7c78bf4d36e224de0c5501848fa08efcbc7488018efec4a492892cddfd33b960386f1f856253a11a0e526ceba417ffade4abddb4e5479e623bd3fa247d98d2001b5518f756545d0690ec91304deb0e1f3b854e3e1273200bf67735cca15",
"0e296e4821f1ba34981000bc92e5dac9bb0c9b5854352adb8b3f5b2ce79d31ec16b56a9bd1e1f33850a3100bec1dfa5871c2c18a833499c7346b526ca79f8f5512745989d086314438d466ec57b407bcf6e9d708e7858f1416195912a44c661f4da3569ad855d749bdcf35de353b10c05e13894387d04c7c241f0e5eee579bb1564e19ba61d8ba69c0058e637f719fc867c514685270272e73e6d7862f888b974ea9d5f252142c9205375c9a375d731f100c187847b290e9b25bb6f882b11114",
"4bc782031a3288672715669846984e87428e2262c066c4510237491fa35f7ca5c900f1bb5c0e5391489c51a140d9d2a13b297ceaf14b1b4b04aba0f6943801976d66370334dce54d08df0813a5d9eb5ecea6e9cfd7b229c10a4440b7ad29b1a4e96148fb60fa0117c703a76b9bc484af00a28989f840a24b8ef28d5bf4c98d0b8e00ef56ef5f574fae05da3dd7a447061121d804448e3e7dad8ef95a4f2d7174f54048a2b42add71eb9130de8f83d7d8f49b6d8029cd13b2e6658918ca50fe49",
"8ad5ada53357fb45e8202adf818eeb8d65507670b037307c94e98f4e66caa2ea4d7c6679cd4a3575af81c334da1b340c99f6473e4d5984eda3ff0768c2233d8a4b11a7b4b0101368bd50f6e01c5fd8a0fd6261a4eda88c9a7201cc55aae7019047eb89cf446a1a2221be64bdaa9a0ec1d78c52f88e9a01f3f510d10874c02db74b73e0cf542ebdc32326ae61e0db599434d2e2391dc33bad2abc66dbbef2e26c83e25f144c373f3e23c7fac8ce898c62c0b1607ccdd731c31d8e298c137fa382",
"82da9373d2e50e49e91d56e376af44e44d0028344cf6ed03af1b68c745b7e424106cd0e0057f42988b834db9ef82c6081cfe0cc3b4ba3bb4375f4d17780b7f988d56a82784772cf63a561ed4e80902440a8534590fa569eec3fd7afc13adb28a8b111c177fc6f54011ca8d00cead4e24c1ed7c8e7c41c32c6b6fcc1797cb1c61e7e8ed25658c7f6f32ca95ba0844dea6846ed4deb08c0d8ac5b570d52bfe0f8bb110a588e5bf1ed9506d68553a621625aae2e48f2021cb35e7c385d435516f21",
"09935b301ccc3849efac6d00373190026e53c07c514a91df1b8541843562024393c9a60b965139e640c3ebca7dcb7a862aabc1c296e7a1697821ac17c4dc719cb72931ab1381511e80b9bba3c5d639049842621bb7889fd7fa87e52af360bfa0cb5ca385425ed3f9a6975efd8bd725560e07b2231730e6b9ee1b9c873df9820e0229776aa6ddbca030f3f96a60c7c09dbbb8b334711eeb07e3de9a6f409639468ed1ea71dda850262e6917a2eb9c7ffc991721898d7209717ec1e5950a7b65d2",
"7bcdfe9f7add3841b717954f7d95ee90de9881b8cd86dc7c15528d2539b194fbf2a2e41995864935c396380961e0200e3f8c532d81ea269aeae763036be53d6be992d5bcf307e79af39f518fb689472e2dd56d71ed9703033465c0d6d8514f56ad58ca3747d88a84d9ec3e5e27f1083e66dbac7e7e1817c55d88e8eb59b9ea4740ead9ae0c7aaa6f3105887938be675b3c64787c9b12e97f2a67f9368ae2746ecb13041271ff11024b2d3effd9aa50603f4b9530bbeac8953e74f640afa9ece4",
"4b4681480ecb8ee514a28b08609026e10e73c7795341a5860229111f5eb4e6e343a0cc335c4fc16c56d3dd104b62b8a9527769659f0593fe795c1a63b1e942517f6ac5b0c93ecc071a88671ec5310d0eeef8e735ca3788886099827658ecda30506722be056da09a1a1bd66c7f6cd0dba7a6427750c33d301c497eb61fae99050992cc30aba5b8159a44cd8be36d738c0a6fd464d733af37b9915398a13c6769490bf32e1ed2b3e7d085eadb8b6b59532e85dfa53d679d3ed64ea7bb71cda3a0",
"5b2695b38d1ab396c73dc2517e4a80b1b961eb58f9097aa969b5f55bbe6ef105879c5226d4305b113be48f333e04ef03fedfd2f311bda7495ba478d0ad62543aed3f00c29e419ab572b889e8894e7fbd2b4f34ff8b77590ea6c287bed27e58f807eff8be4ed66011d50c85d1d2b6a7babe5323c9a1a4fe53f7e968c11941713d54b2a97c2145bc585e1de14e6753b40127642a0d08c29f4fa07b16e2d6eecf87343430c68bab4da1f948fb307287eb6d59db67ae295204ed8deaf5bab03b0620",
"4dccb5f51c588328ad02fe48c30c5c9b4d8705e0a4ee15e63fb9441b74ae28f618da184e7d278c088bf62d2dcf6ad1dfb601e55ffbf2d9210e8df3fae104c8e6aff88196d3395706a346754c91104a609046069e5b23a3a58c2d2dd1158d75d91c7f482f8e8eaefcc93bb72688d8d5d6e8ac6794fb56cd3c499e1d2b30664d6bbde84a65fbbe5e2bad5a569a047102b7299f42883a85c146e221e8993ab929b2339bdf21dbadbd5bba92ea9765628c81173fc42abe207aa956c01771b1685d92",
"50dfbeb36cd26a3f2568326b99d9ca4c7bdefc58579a2ddce9d780389932930134041f43571f7644b5c761bebac9613ce5c78ec79114a733ab8d8781fe3c892600090a294e3c9ed9915ded2518eb64d79a488ea636626fea4a23d90d56752ed42094886e1780a46c8fd838fda557bdbcaa2ba3f60d9102fae05b611d91f746ec05bca5237a88ee1da970d2c9cd9457cace65f69d646eb7b64219e25da839cd048d5f65c7a08af468c83b53c2c9fd2e9ad7f710c009718670ec22670a65d4a054",
"208c20d4e21709016862d7f9fde9966aa1888626b1baef877e56ad28921fd41f4f5345996af0a0eb26097c54c1924b536b232312b65b3a61a0b25ffe852128d048d4939447ce495c5a6d344ca847b6190187768245a25b5447581c4fb2d897411e6b8fc73fdc0a7c7d0326cd41cee8b590b7ff7ff77336726351ebe5e0aa64f1a2200acd27afe9bcf9d9ce3aa66856a57fb8de6006a36f7d0eff0627af3fc8ca9a7aeb4439883280bcbe070a0578a651a06a44816c9907045f7e2d7d88939c5d",
"33a76bdf4cb67dbe60a385e5203d3d38a70bf11042d958d8f03fca072b158503c2e4d19dfbd7608a5a1aaaa93f292fee637697e6243510b0363ddba3d4c1f877c230bad3832efdce6a87f65a897e636698a9f1c8f464e5db0b5e87ee0ea42c0421933b213985de4e357363fc3af52c34a29bb8d5f12ad7c767d4d95bda4e33ea4ffa3f041f3e73496dc4f466e9a123ef2cbd907d181036bf7f10d442f3ea781aa12ef24aa85af4e5283940a7349401eb984fe1ae11b9ffd54986a4a8a05a31ad",
"10d9924ec0584a45429b136f70e49667c0debec0a0c3d3efe282bdc8e7d43d3c1669ac97f3a97d9f3d89bc81dc42e3057f40ea2916b1bc1a6011cf633ba2dedefc6068d5cc7e02afdcbe52ef0eaadbdeeadecaf45b86c4639c8aa90e2b854a8f244572f482dfbf4474aa17895dcee685fac68252d8c164f053a5581d377728ca5b52351b9f11ecdf5a1af3861f862ba0afd6fdb341bba6d65da55fdd6d887ffa7c238159230f846221f2c3247c0df50e5c123af2b83fba89f73ca67740ffb643",
"1246dd0d02b896b6b2adf65b5b12c0333abe6048d5b62c116bbcb0d0974cdd303860b64516f99903f92dbeb368db19e92ed24dfa1ed23362a8ade55239ddb13fe98e09919bad116e5c95269c62b198672f27f52969e254edb27e9e3bea0cbb18cf98abfe11d8be73e2a210436be7d2eb1b6a14c0fb28c5677b9d4cc2229affcec99d09daf983c0f96c402e3924fdd2a26c5e5b274f181da4e43b574181609fea05a627384f5a1614a7618c6b54d59b218468e10c3ddad17cbff0bc3e53fc042a",
"1866aee1787699e0f5188007e67e2db923cba09635d295fb72d0a19cf07fb8735e90f7967750627569120bbba482ea7aebe052b99e9968605b971c5121fc54cc9b19cb578831aefc8e9227b61cf8c1bbf123a6a19f855bc4964220b838be527c72cceac357eb8a902efde32268ba1fa7946b7b2ae8d460da6b85f40a216edd43c603a2c7d670dc81dae728ba45764382c4db1d073f8acb0d7ed0e87f237053378f4ca36953b588eb58c638a051671dee3bf1338895ef61776f88c3eabcf7e581",
"9302513e38915438f6282db46cefdf35d87a0de59ac4d4963c2178100440873dfedf38604320b862d41d93f2d1cb41e067944d48c2fc865dd9a6777ee28c16169148676d7dec190ed1c1b5a28aa3af3f0c64f3d5c1643d13488baf244ff97437055a7ac17257423404e31edc927162e6d0874fa1b661527887e56ec479817ceef9d77c7f4995ff63e9c36befc17eba8906dfcd564495106d62226d644c8c3b01535201f5aca8872bcb7bb22fa5738cbe2df5bcd08ce25982485facf67d316090",
"8471e6b45db165c41bc9dd6fc6fc9febce68b53774df1078118097436eb3227c9d3d02a54ab6e140e6bfaca1dbbfb2aafa791b922a41d7d13a7c3a6f7a6429d0012a036b0d99e9560347d43be0ca8cad62c4c942d753d548ab138d66b7a64484cc6409ac02c91a8ade51bc135236c0a483370192fa1f08ae2b3fb1d9f7978f7552a941f18cd59eb5f3115871787a3dd6d59cec465721c8812a9c9602fa0a7416d5d80909f14233868784395471bc99839458e9a03e54d4a710cc3bfdaa275b14",
"89f174835086d4096ee4bd71d5afc2a893751385d833577cc3b9aecddec1058c5ed7612e1a117f197d82ff1bae9a4d2bf238dae5c27c1bdcee9e3023e30ca9feaf12b302514b2e5748edf349a4a97429c48fba8cf5ab5e4d2b9d10b89882f74017166c9c09a78d4001c8279038eb64b5aef6473b459e3f321d49067eb487f13438f86248c39c89b8371a4c4cce59da132995e81c0a84f4954b467c183f31d140d8ac7db72a08cae7e11722a6e63e0e0dee9bc9da00179026840d3fc7ad3f131a"
},
{
"d0d03ccb3b30b7c9c4d6eeee2ec26d069246e019fb8fa2f3a9b72c9bbe231d93ce053df805a045e2ef6bd8d08bfb0c36922e5a6f10b947b2607f596b6cbd3c9eefef56f5396805e8b28b1ca182c78c0b12b9796aa856af69c35504f8acc7afa74bc0f77a1d61da94944057a9ee72d2f0a96cbaa2f64676f5318b71e56f519d0da1ce8f42db0ebe5045fcc726e39fb0032f2287918f9190f3fb3d4de542030441f6736c6205a2bcd2450eb411085311c7320baa4268fd2fd8bcc8ebfddbb60740cff0b3b00f618777ebcfb3468f309d923c957c8170727a5458ac2c9070f93cfc37d31cf9f1a35d0cc3abf25af8dc9e1590ce59ab39d01cf0c154ab8d0635c5e9",
"16da730c7ee6f3f9750aa3120f734f7800f2cbf7247c180f1a490eeef5dc637dd2da577cb2f41464adeadabcbc7324779a2b118c0c61c2829b55797de6a3b092aeea444d2b4080f15614e9da6eea17552a8e955fcec1873cd20bfed8ed2d63a950b159a0ac109df370ddea773a7149f1893cda82d84ace35b65b3fa9f7e4cebec8e219ba9a12fac5cf5b2449cb6d563d8a646f1d649dc9abeac829a3ce8f9823cb70877193690855389557adbdbede90df0c274986f09796abc2a2b16f7c8c6eb5b3a42b0958c3da16bc363ed45de4ff4357dd8c20421e4c3007f9b98c86a80e7ad0106aea059acb71ed2d81eb6f0dd758bdd9d508cc465e23404aeb08e4ddc5",
"2d69d08bb9b99a173a69a3221c28958161f5defd5592e3ef5cf0ef21f04ef7e199344457b363206bc2785197489aa83d0b330618b5d58edc9ffca4268a1058c4b1d1fdb39ea2a1afcf2024da3c9e1f9820e65721db4a0accc77254291239c83b46fd3af6ab14aa2e8c4e140f751744bfa731d2bebc33d30388f140e8111ce1f7a090005d78b48feaedc0059897e3384a3a31270eecaabf455f60b8377619cdd79484c292562a461ea96774e9883253d611dd4e7b26af83d19d740cd41f26d28eae5d20a85d16b374b991b03141ba87c75da6d23818f509a2547f2c3499eeb48dd48363f3f80bf15f2e2328116940a0c3f4d4ca6726c92814bbfd94ebade849ba",
"176fbaea69c599caf946fc657b1fc958565ef3195931843dcfe5031b15d4c7a96c005da15f6f6550e5c426ec91c871b1c8dd0868cfd1de3b7901ce6c16fa2d39b1caeb3a479741893e8165910b46f07a9acb29d3a7b82ee6a1e06bf44155a8fc025480fe495eabce19e6728c5f3d812b32a7a14dfe79925351082406e14c7f591d931f1c514980e964691a51e2044ebb82c40eaace62ff74eb66b2dbfc15a08ea48c7a2a110fc402b7a68cf039c8eaaf437d5642a3511d36bc12f96cb5b6cff47c5614ef7cc2be1f139047a7c5dbfb1d7018fb8857216662d3f5af3f7e1cc696e9b1ec958295218448e19625a1e65ae92be6d60fde3d2e6a0b3093efcc7754c9",
"9e324f827ca17e50fb0cd17b8f714d7da1928e1c586a83d437e9891c786644638af225e92841ca1df6d94e6eed65b5f076cae3aeb97ac96f003adddef6cebe80de99c584849a1c1832813cbb63fc619079252ad4d8881ef72e630ea06fb3b0e1b51bfa379b1decfb92e964cdc68809afb9d53b3c43dad119ba67b5ec1ace1093fe2e144d498b81125fa69b51814fa3c1230f0b42f9d7763b1447ec57bd0d93a96a8928bb7f4560be95fc100dc6430674107511f7f466a18fe102a7bb0c3536ee9d3a7c45631153cccf774fa65f20d07a5255a0902d4dd3c91cda03c0778dd7278beeab6afb93cbce0c9fd6b202d57d811dd7ee50331f7243168df107597d25a6",
"ac402ca58c3a5e42bafb2135503a176174cf1bb86d5bc4a5d7f6b3e41251c0a6179df8696bf418ac2ebb52682a8b5f3cd23f0e1afb58c8b1996d486b90bfdf6d7c1e5e25575ae5b370ea3437d54a2f98f96d99ac601fbb93dc81c731fa10a6158baaf040fe57184fa79af7a4ea3606b08b329ca455f35cdf5cae9a9791e8d70f03ed8226031d7de352ec4b999e113c23e9ec16cce9ab1baf49ca090abf009389561d25013963f93d182c1b8e3ab6d8c563e6f8ebba125281e93a1f5b84f370ebb51b03e36212697b32b7c272f6e4dc0be86364020b659b1dcb3604322af2d5122e3b6b68cb26ec8abb4ead01f9b13d8a1a7db29331b1ce9b560158b4d89bb961",
"54b78bec4855765b4c51925778abcc0275b6e9f55419bb54ad66f0d8e7f3cf68cd3d5b299e634b2b26bb78fe9eaeb6f8826cece71562f9760554c9b2dade54922a367a937dd9c99e60df11a5daf4b10f6e756961f2bbff96d5ca3933b3bab13c338a46469c8b5118e8e2b06b57f0487c23a5d145c3308989d8e469690ebfb1401989b5677d1b9262f0a62d38753041ca6eb09069d4a679eb68d4d9ee7b64fc1e1c8260fcbaeeaa83c88ea603109e76c885e8ba1ee99ba1fdf37a7932398341f59771efca036bd9921957ec7b972125eecf2319f0ce39d4de21fd78e98574794deadd8f55bb8c03f47592d6877a1fa0b66d6d8009ecfe58a71fc07e021505e8ad",
"de64be44ee64131b4efcc32982ed33b52e58f3169139d002f9b61160dfed8cff955acdcf28165a997959491d9b20d03e4e297289a68efb1e9ec3476ae7253ffce743ba4abe64c1c71310d6a812b75eaf2c18e6745da146da87e85280ed8cc01f4330d51b1e77231e25021b7712793f6e875eb7233b11c9c003da5978f6af3dc51cce8249ec53bcaefb3a52c9b9ef9392a89051bb0bfa67cf3275318d35ca44dd71a5d67809be05c054ac97c5a6f65f73b7fe142495260c882cf9f5d5b455b22612021b036e1197803dfb1b45c522b69156dc549974b865c2d66d3871cdb7cbb12ab5bb30931a9710b2ffef326b3954872a56eb4e6274ba4bc40a1c19ca154cd0",
"98ff167b985e030585d170aa38a1f85fbfdede90cb57f5240876aa8ae669177b917dbf8fc00852bf85116cbb9002f465dc09b340d3bf1a7f96f87fe7843d78e3224af76108d238260598b2eee93055593b714b0f3f422779155668ddcc2078c74cf935a298619c661a9fd313bdd5a65ac4edde4625142905029402a3bfbc111e16cf403552abf2af3bd11554e50d5809cc13af82ae894113dd04c65605de2216bbf66a08400566451f4254eeb02294f8f86be0600f35349d919a26272471c25943b53147cdd102d268ffc7b3cf98738d837823831109adb4593aa38650622ce8b64e94db3ed35000fe3c8c6cd068009fd707d23b5f94d0b3382e207a98e255b2",
"86f4b5c9b7db9cf7d09caae1ad6ab3043ce39d14c56c6e4fd8701a8eefd66a1792c89cc105f3657298b293894e999fb30e30079aebb1d4fa0f5c6fcd5096f50574592696a559d0f228d18d4ae8f75b508b714ffb3393a4e560b0d004bc4a0129387babee466e0c9b1a223f3a87450de0e4200733af92745c880a155f6d9cabba816181078fe4cd360ba25a45954f4b52356435964789f9503f889799e55a3f3c46fa32c5195c84956e56913cad423dc4c8a6ed7f17f1825bbdc53dd33d3c3b2612da4ce5e89622d62aa0205ee667a9dee276b91dc7bc67a8c1b379930aea8c8d26c4773fde955e4afc371197dcd8cfd6c619c2f0f57c0b2fa08ea73cc18c156e",
"5cbc1d2c696e7c5c0a538db35a793959008564c43d9aa8ed20816b66ef77124eca7584631308d0fd7383be62eaf799b5e67e8874cc9d88d507e1bd4fb9fd7517adebe5d583b075040ce3db2affcf77ee0162be2e575413f455841cb6ea4a30595daee45e3042b0b9d8f9ee700df3f1898219777c21ef3695af95628ae64260dd2cb7ee6270fb06f52ea1aea72e1a26a26f2e7cee560ae0cb8be323113c3f19c97cb5a3e61b998a68432aa2d1f8c8c00ac92b0f35344710ae1d6d79f379fbb3dba41b46b9c814eb3a25ca64a3ff86af613d163f941a897676652e7c3f6769fd964b862dc58cc2e652d0a404e94853fb83937c862c1df2df9fd297f058bf660d15",
"9a61223b98303c51dccc54d5fc837c6fec1720fa22ff69c277be46c388430272e3c8030d61b1c4946d329fd2aa408749a3ace2a6e1efe58b84edafec5deaa036341b40ac5310d12326fb65631cecb25c13fceecbabd4a87cea8f185751309d707c920ce87a096a1b942182e209f5d7ed55a18a58cd4f2b5249ee723ae7c858fc530e70730f25448fd641a35d314f5c511dca411f8df85b74a9ee8669095f5aebb4687efe052afeedd53eb1e6b1757f71c5622cc03dec368660ed50b11f2870587e277c48e554470769fa496efe5d161ef3e6d04003f2829f7affa6aab9ea54cf9e5bb794bae48fe2f92e1294f01aaef40e1e2a5bc99c14b992c1deb66afa7f5f",
"2c32eed41bf7a1afd0d567063fb253fb8e6b2c9f21689c1c07a1b13c858ea085b932e3ce60bcb7af3eed96523a6d77fb92f996d2eb0357bf7cfc2532a6f584cb8be0b3cb545ce6a0a972ff83137d940100caa4301370c02dfce781079926ca6a38929d618a8dc7e51b4142d6cd335cc08d5c384a9a7de9bc2fa121d901ed342b470ac8407598366bba7e122ba993b3ebf3df5257096c56303eaa9f2fcc4daddbc135b76e2bff1112675982dcfe483fc9b1d6eaf19dbd0e52cfa2bdf58dfffa2b2ed38433a5b947beb40b83433266914a168deba84b4c522b88f6861d406dea78f1212d137ef1d17544de967ac5bbb25dc9d4464cdf2d0bc70c1b280ec83a5bb4",
"bc61e594357a5cccfde0bf6c99fa1402e2222e7f1a416ca365d6715343b481d70ca6f2533af85826bf57f9ab3f173dab433f34868c9a9a7eda30921bf8c9892b7b26f0b64d01b5262f878c4d28af4d0ec0452bd2235ecbc5023ee0ad524fdc691fbd5cbee2750726000156554fb0dcd69358ad01a82636c90299c059b9f15c74ec6c4db2c754742c39ef6dc67eaff256fcd1058c3892e3e4c3fca89323675e9212a86bccfc81c2b6878fb1bdce1d2255d39457a387b5514f2a25099deaaf0413c5304f5dfc6ce163458c7f261cf8cc31244db7fb7646413542c543de6dacfce8b02d95b904046a9417b8dd17688cadb882077d663fea2ec470672f7abfb0d90d",
"ba9944e9574b763dc2e86d2189cb850d1b3fea01e03f615c1c56e0c632d436724861485328d67592c59483bdfd8f1c5887cb51a0660bb81f158b6fc073c363bc31f9fae11c06dc5e5057f5708866e7a486d0083c2a39a2a86982930229d02da7b669edad764f8224a511ed519953f5e22dda9533914352f9eb12f4580c025d94ab520ce80b14c61a4a4bb23a0bb89c092079c14b0399d841a998644f8cb1396ad54792f4e38a6df84d32bec940ff01e117506c0661b08dfb0b53f929f43f286d3ad94f5e47dec5d6c394abd475cf543bf40daf42a6ba493e95241c1efe91503c6eb9ffef95958a1a3f5406e7f22f543ae4726e3fea490f44ca09c8f82aa5e28d",
"bff7b6c06d464ad3e5747641e5d66ddc7e5f623a735d6d0437851fdc0ca710d10c7e138266cf9a4ce95e41838e29678fcb04d7a3fbfa884e540dc7c4db38412eb95c68800910dbf91f13a9e129f8f82ac928cca1102eb625d9ca1f8383e561cfd36348879b0bd79ce6d325872de49aba9d6e84478c11cee47daa3471cf0f1993a838a338b688d05e9aae426a0281cf31ca7b6300251437b0b407057ad84157443384f186cee795677931b21ef34068318431d30b986ac80c75d5c48301455105892f0544288c90ad7bad6ca78acb82a48a9df9c9a6dc986de7dbe29b3c962a0165f0d47d2ca32976cf5e17cd77882385c95c943d5d38b0a6a37d169275ac7bd1",
"71586262d9940bf8a372a64a31df832aae189933ffa5d03b636e89a33fc1cb4388e98158943cd97c678de28d4f9766780b963f112fdd6def391bcc98ee8239d2e8ea4a9812e38456c444dab314b19032c41b20efe647191d74853f0a10daa9a999a2c770db365c4c903cd2e3b2274c0583dacc404a722eb86dc456c475f2a6524affd016b7d7c24d4f8c83e651ea448b3b556aee7a33b35c3549efb961caf462d49db7dc8ed5c71a7d7d655a36a409808be865950aa5bf5d85b4b520356c9c002a1c9398432067b161a51675938bfbb4ded9bc4b32401fe2953593c3a77b7415b2a4ed1945f8417040b97697fb4149e8fced862142cfacdb096b4421ad5afdf0",
"07259c366fda803169ca35c963deba60af14dc1beb87685b3b078b781ad8af7b7b11a3414559d4e6a67e335bbc69ca8edd5ff7e71716d86b1e5bad37ca020d380dcb5e2d9b7040751015a061753230b1550e41fc306056efaa43473dda95d2afb52c45daeba2c25bb446828b7b6215e192f35f775c047430c51f591e2ea77f65dd9438597314677a027c99479f2d2e4175a2eedc1ae481cc9e840dcd62bf46dabd501388245415453adcd57c428c315f6bb210c323df5004dff3fb1f7c8b00eec7416012479177903ada20b1669a13eee4359c12b8d24972aeee73d41593a25fb8a3ad12f8662c1be87f37eef65b9796bcb9fe538f0fd719e886ec9686352a87",
"4681bdfbe70c05f779556f880a293a73e54526ac6f5231f45cbc015e7ca03767a291165e7cfcdfac82955c23a61ed30608a57ec0e1f2e61fb300289c5fe2401be5b08f20a37fa06354a5702ac40011553f16d90a1429c851558d0710313c8236859f882d46100dee4a3091b5742c747b8414e5e2ad6767bd557505e9352af40f187cec49ffbebc34c4ef33e6428dcbf3d4de34c4b782ac016203b7c04604ca5e7dd23bb78cfddbc261b396806444f1f91b1e8a5a397cb477fb510b6170b9bd8cc511e619e4805291232cbc8a0267ad94c26f603ec2f73d3807764a9a114e2042a787d62846f458b76bcb728cc9c9fdf67859718a4e6910acf06b6c222be867bc",
"5ae33e70f8bc701a97ff7391dde8a1b498177330d4ea94c98f4d109dcce74588e9baeb6eec783d68c10be45a9a895253d24b289087c2a901e213a21c88e7987c4a62a5f3b6b6e7c28bd1adb12df175dbdec22f48e45d441cccb1781878e5e531d726e3d8658da8727a2283dd9f7e78a8b46e5653128d95254978f52099e6cb230cc449893041fef63a48e499038574d1fcc3e1e26b6c85f38aa1cb14bec8c7600c0b7f391e006c9d5db224718c548c19c3667c43b5f4ce6514ba41bec0c2d9b270bdd5c911d92e2734fd11d0387a3b6500cb3530d87c2a647b1c7c05a4447a4139707aae7eb37c05fd966ecdca8b4c8d11b141cd16c4d47ba7520bc4d16c1fba",
"335ffadc0b1b8bd2b1eb670dd246e76dcccdc955a1687a15f74aa3e1596ebd43e607c640525f89dda95809cfd065f1be4e4a249477d24f400d4d4c9438a0af95b26b28b416e42aa950e2a52851b52132048f1b1ce944322fc99c1aabb49b7fae4c2f0fef674b50adee3bbb5c6c33822b608e4b9577275ca20c710af9fc41b1c01d9c0ff6f0d8324dc08e1a76e232d8feaa06c73bbf64053bea35f1c528b2722764822ef1ff06246e75a9a22a10da4ea84fc2441bea24b35506f8447fcf69093c5d21ab0305cce2c7ea9ffac357c664b491fc55f2919ec490c38accbab378c252ac2df3845acff575ec7524cd2f586cca1497c74f24b299d6d6254c8cdb1d227d",
"7b17b13a5ce4485ca3b979be3b14d77532fcbac14e460a54515a6aa7d213ef1410cadd009ce60bfec45bf494514338913a2792bb6086a4cc21dbe852c2b57a3ff5931039973cdacbba96e2ee77fb8ec6c87c14ea10762e2aa9279ae5192ca1c87ededbedfb305fb006a51602e6bf4dc43b994f419c979b4f30719827a348948214ee71565361f668dbf81ef6e94297a3ccd68357fccca6dda237911c938d6e71787b3d4085c66c7ca2aad2db16274df23ad19211aa6380be75cf0b19257af4df5af1e62010dffd23b9742f5369e008224ee40331f2387422095f6e5afe0e125f855de220648a845cbde542ff7f99d926868819aad924b3919654483bbc6d8dd8",
"9e32925845931c2baafbaca8df109cccd922ba72e6f4b838a76198b1f3173e9069ccf75d0c96d6e2644ade92b29043f6bdbdcfc8b0b2794b4ee16b1a8ef8eb2dd2fa3da4bacf7659e43e70d69c132bf9cb1ba8584bf3c1e0a7c8803566177742c977e447d357fb0331dd3112e7d3c0f1b5772a7cf5e1e368cb58b1a18889cff9136bd56b5cc3fe6bcfc5a9f26dd60715a807f3c7ca236c89ddb36ebafde62b35a624284121f56d81f5a4d215b7a36976eed2c78a3c44cc864c6a5c01f4ef9f54efc4beb947b96e9aeb50af6221dea96d620baaad235e9ba6a003fdd39f31388a4c3579dddc0a51e879e1286ac142601d2e5725c1ea9d44aa896a12d29047aa3e",
"bd4d7db1d17c3f56062a1dd4307d939ddd403cbf04b0866603541fa8de37ce80bf06d796efdead6963f603d81e376dac20454c4964c1e6fa347c8dd7684215580779be97f94c8279efd0169ea0cfdd282d3538bafe067ff5ad9e624cbb24f42f1811287fda0903afd3b516875a8ebdbc81b4a63286a35bd66156f657f110b9909e983043133cbf0d0fd1cddb4a3e1fe0962e412af91682e44262869524c92557f5d8fb385fa16e87304aaf534e90d256684600381770b77629d1a7e8f4cbc9f956a1e0d2e41bf57207c677abf6f38094ed0e6ad4810d49eb09b51ed29ad6087f72ee019a4f99a816d142c155fe91c93c38f928fb1558e3743d545ec3cf8ff4b8",
"581e5c157c6b960933bafa5d7fee2746596db490a57761ade4aea0f76ef658d832b603e8cb9e03a853be53e02d4deaec2e7764e14415173516935db1b868c8f7952eef47c0cc57f011853b6a77ec99b56a01c0f4a1b083f123e3dee8ee1312949789b3a410908f2afcaf81a18ea6dc685301d471f91b1d730693329616a4aa460c53825c3e24469571de2b55fe7b9e2ff5031b2d3e2aced2432fa85c4ec2ef0356c23ba81dc589a6aaa470d15555636337014cee7c6c76f5ddf35e1aa0aaf342faf80d4674692b902c8465f60a8f55d6b3c2d3ea5a6bcc24ccf3fb3df7eb0e50c845314d26ef5ed8141b73f79ce64d25d0e647d66c875503c921317892d169fb",
"dd2ea03939bc68d1d40835a099aaa3ee57a4f11e30ad4485089074d345e57363bd6d3c17b86cf35d0629ea91730a0c8ee364ac80a016cfddb6875e1bff463ae284b84959e52046945ee916256582facae719c33c6e892a3a7aaaacdbc300c76486633c8720e6207beb6401f1258997a0bd33c752ea4799ec99685ac1fb9066cae45fc861608cd74aadb367fdebd28fcf88f52ce4942f74c8a53e809fe4953434d6484113501a40605a11c460bd9cf290e37efe33b161b96b63c2270dc1c3669100d1085afd738cf8723cc9f232f679ffee07e1d536a7d56bd2248f37610fa582671d6414440caffd10aa3d09b95fad2c2c41bf0ca33699cf0749110f817a4f63",
"2b6c07656b398f3b3387627f51aaa51e8f905ef07d7bd82b355396bf32865227f5bf3e0cd3e8e1aa44841e4028e61c58cbe839fb8b7582652c37f7fbf8b51fab980e76635c38aca98b9927dc1e5f17633339d6e903be5bbc65fd7a7a928ddf459bef84a6370c3258dcc810cfe272274d06a1dbed89bf121be3c1699fc129d55d3deca9d7b10de41bd7f47944e26d0e94be9a708b10b3a729ef9ae59ac986de71fe4522284873a19bc177804ecb9acad651055e7dc4f5d29590ebc6d6f965a51dc5b4589699e01ac42aeb579032d5954f160cdea380b0f3c486124bf8ed8884c6861388ff7afaa2fb0b07cc999048135378a16e006d83a98837d259568e89823d",
"c33f9dd337fc09da689d1be3055719701581c3c1b41ff7e574db6976ff7b9911c5a4382c9fac346b8dd6ef150f5d194853df3be384acb03b681aab5c8844e31d39658f731417ac942b88b2bba674e01eb151f35add8fd0e65c4738b7150e97c20e577bb320d10f872800df2df55095ac67b2fe4b51805a7c6dab3c288eda94c91699a7f85929a3f98ec92008bf884d7037affe0638a91c540c351e2cd41b3b26f38c4ae7033fab2115f840a6df4c08173c7052499ae817052c068c6c34942d47a0adefd40eedbc7cee3f4898c044f05790334be9423c5231eb5696260ab8f7d6fc6e5b1b86a7e362541e20513294b9d5206440eee2198976584b5840fa68e5a1",
"18c454b50814f00da88589f533b87f8ea5195bedbd3e1b2fcce3faca0ab768d71d930a28b29d24044c231c0f24041800e762cd7271c545cdf7f9913f86caa5ea493d1a994902f9ecc1c0daf1c571c2aec78c4ff75e873fef3d6861432f227dd5de635d2315c93e10bbb3cbab1e981ab547b53383143153c0a4a3ce2d7576d89e688327f16636f3ee38f6dbddc0ed42af36b08247d9c91283ee2c52811010fb0a10a3de69b6e42fa11ad44f76f4766b9d6fd0ea179790cd37ee5aa22b62b8010a242ea15c2d0f9cd7564f1645b65cc438093944d60eb0dc42afcd35b16c54c9628070e5eb93826003c84ae66573b84a623a288997bc57a87a3034a392a4e54b80",
"3f48d2f019745b091588182451539c3b1c761016a8d3bf386b3ef046e75c23628be14aeee1db6bb876485a2be2503b39603ed9e07fe35f61cf2051bd8e4ffb281ee960b171efc49f61be17356343aac7d260a1f2b29a77cc81dff36d5d5e75dcb11151501c621e0fa1883ceee2b5befb8b95274f0b3b3f0af0c2282a3527a200346f27c7a6755a5a4f5be9424967e1ed09a312d0d910156dd8df5f6f209ab5bc05b86f02c3d3bd4526bfc0f92e3542399592b5ff47792e3fc8b11e367496d7af6013afff2c433f91f9ae479ec70116e0663d53f8e4de053a0da5c93463271564768a7c0df098d744758630659b84964d61aa940ee0aa3aeda96e8a14dbe0f813",
"211398c068e60ae49ee2b8b7cd96171373f4664cf45b62415d9bcf119184c03274aec2b3f04c598043d1d8642d53edad68d0e0bc33fdc65ed69334ab52303c839cbbaf0586508007dcf4ad5d297f568039dc16a1e6c08108a0050d5dcf47523e4868e4be72f20d789b06bcb92484efa2fcd903ae280f42a509dadbe62dce1c6d3aef6e4ff78a745c8500ff0572748abb1a220495c1c103a72c940206347c16ae6082dd1e4624525aa8ed8f118d09be2b8535d042b29ea3e2c6ab3c990b4b59501c3bb9d602c7813a55f4efc129f4dfd0fabe0cf6b8c8c1d9126c5440cbec5405722927389b3ca80a0872711388b5b099cce6effedfbd9befc9646ea8a258fdd0",
"03f393bf6a20677a92565076e7c628a10490eb41b4509aa6ef99acb0ab889ccaeab98617c59dbe499231396e9daff7a2bbaeb3e3a10258d4f605b80c41d0166c5f0a175a7b42476c03e57f84426f4de98d74829d40c01453999cebb996c41756d47f0b79fbfdff2faab111a5c7f07f8f760e44d9538fd1e3b3c4307a79158e7dff4eb0f0e567bfa0b67d1387310ac4f390674357332e85847c26fdaac1dfe7c95585a604bf70e3d4a33649c6c4861dde05ff11cb5e60ae590657d3f455e6e60ec55d1752493768c92ec954f25b780dac2246a50f87cffc11ce9f78c0c1339d9a7bd9cb7e747ebbfc5b6669f4f46944e897695171727b89550e2f9dff74b3de7b",
"5f2a2b0588373371b1a9b446a2a75a10f2143e7a4d0c0b766e217b7b938eefcf8b1a46ae742f9a390c3b02f627f9287fa7126dc1e571579b87a6beb860a012e73efb7df853bb31dc056f68373a91af044592b2939fd2f4950178bf83de1f0affe6066dff573c3a1ee6d413b8dff77200cad63a29baf63999258a49e55c713281ea71e60ad2078cd4fecf6bcbdf5fb2121a32191543a16e51de7d6bb0ca0c897a8d893f00f642111393148f6acd417bcf702b318dc4c4010ab1e5710a5b94f411bc5cb54ea3bf211588f2b7889cb0c3af9545e9a1d5326062eca6bd015f4fc383db371cf6407eb46b501b19a862ed1ef9e943c9eaa2aebc9b6f203e39a9e692fa",
"9c36a3f2750370dde85811caae4d361a7499f8ee1ead65803fa861100086ee0f5d96cdb33202916c34b7d86128a023003bfb55eb43a19693fb32c17393b77777e34fbec701d6d0daff8f89ec5c336f68e5f680da08bce0e8e567d86601c2ce076c603ab292de50c97857fe34d59f4105c6ced054e5982397cd9cbbf08ceb53bdfb90b6d75f231a601098827186df27980736ce97e40974c91011691c2dde453760467b094bdeaedfb0350c1eff96f236af768dea38c65f520cf0b36512df938b31f9f74351b221405b1cd04efa7634ac7e966029f45f77afb64bd7d2be4e5922a150d3bff36f52a155ba4ad168036a440d5060f2ad6e323914bb475a46a5d35d",
"2dbb212c33cb755b5346a04e428ffcaee7978fcb2a58254d7dd94b6d266ffd3deb9bf587cfb78f902fd5cb1d9bd47bea3759a4d89e00aac35f76ac88f291b71ad7805a7e42d828a999f7ce971697df2e04724a35cf3f5ada29e35dbb4b742c31f3537baf8b6d3bb5068a15d7ee611450c10fba365860dfdf83bf648d48d9af7dcc2f90254b65b50617036a93f7528a1bb848c6b4e5e319a8fb08e602a7373a9dc4b337652a04b548fdb1d3153820c547bb4d3f8ac1b3258ddd89d7d6d3742dc5ad5c6f455e4bb7e8df6b640b27f1e9e42e839bde6033beea394cdaeb576863122d1fd5c5abd6eb367194af71ccae198f2a4677988c5913aa3ec2942fad989590",
"16ecba74f9249efb948dd42bde29cc44e2597ded40a345c5fdf03c485080d2865138e937c090b93794b2187b6d7ecbe5166ab311478ea93fcc7143eae4106154bf2d494652163ccf1b4df00b638cd01b05746f282b1bbcf12d9174330e665676620d40907119299769e8f61e56e714be237ca861197807fde2feaeace31d0fec0b3088542053f7d54e1c30a069b3967ceeb2db7a1f9f6d0b673ad279a185d8730e4ebe402ad20280bd7e7f286ed87a25c6c1cb3c66e5cd048170c9759dba3f49c3adcf68c777f3cc9acb4b17b27ab7a36a4d6b5f1fdf8df91813c6378aee60559d85a6ee7e9fc8afaf3118dade7d7a0a8f7449a098e8293b59359d967310cfb6",
"d3439a1390fa1848a7f9d54078538d3516cf17b535d1c86038362c21f8aa593cfd0ec2e33aa68600e1c03e4bbb8f2fd174b82fb83059fb8836283cf4ba288d1ecd7b48c9c49385aa9d84eb89c304f50ab1d1f65765b7641247a6c21b4d66a3a54cf2af11cbbfc10755eef49c3df81b9b53bca992e88bb98de1e073299b81dfd97e1aaeb24612d5b73c0a97f2d0bb1e2bf7eb452bd2cc51ddfcfe47d6690a001e51405a7e93d8731bef1093dd21d1e320a6aa011e973e7e985e2de59a000939e201b0f1098444f422b97817fc60154ba58a27ec3a82e27d998b9b3ab74cc4f95101635cce10c0a8d4379878183ec7a1b6f6cae94c72e756c415becc2c211b260b",
"34de98ac564092d4adcca85986e83402e65982813aae6d50f2a85af7fd22eaa61d475326bcc6798a5f34b4736c8bc0bf591c1091d86a09bff46199aed1ef78db34e575c1ce4778de14eac3a1392a62c4b0854dcf5b3320856cb34c4237034efa1e551ff26f93a86ac0a474de6dfd70cc49000383992e6557bde5c4468628d7f1cb0ba987ec39cd595757a48c25510461fca56308c161a0a79079fc714f0611e0f3fff11c2b36a8f504ca903d71645c08a9923185353b454e78843e2ae692da656c7cdb45a80668843e9154b88073fa04b947cfdb6f5b97e6742790f8d485750148d3b6d0f7f8d99a7a8cccd21c4c8ef3757b321e3c05109aee90a4c168ef109f",
"a9f9443f14a80195bd6325606d675c4acc6d383777eba9440b9557cdc5d99d221732be50540410714b40343bc908b058aa94db2426afca198b01188fc2ce530e7552b3fa3c1dd90dcfddcb5582303861433a465aac610410e45cf2a699c7b364ac8d72493e538426c454b694ac2dbbdda92fc5ad0b600dbf02166b1e2b21ea470d7df34359925c29d6284922fba05b7b1373dc3ff1a4e8e0e8cd68efeadfe7bf5289a4608aaed23090da391d30fd2dabccb7e938e128bbb37bb4abb468c2c2eae597de1b964c40c691d694d27fbefbbc2876329260d02cc63ee711ef475582ee4de3b079c1805bd8c90130bf13c7e52e955e58878e075d7f2bffc75e9badc882",
"b533cf67e44e2da3c4acd7cd33af394d26ce2effa55d7b82d31f38afa71982217f66420ca77fb94a0f55d5c18c5e0182c3ea64f4fdaa3f62b6e45482532969ddb8a98acba36217f33211567ee84656f2d689440bfcaef4367e7bbb2d7b59b9371786813e6a262d97a6354a5d704d05b26d92f8b53f4404b482b787aabf20ea512f10223fdc97601619aa9629dafbf3d0611431abd82dc904478e119a972a7b4df0497a2e4d40a0565587401e842a319e06f101b2074e3516d07bb78733611adf2105e3ca30d24be1c925af3d377eddd0400c273d673f6b03ccecdb5e32dd894b8544af974ccba58a2124fbb7152add4182b553d66aee70afcb2193d4db48a0f7",
"dfe58c84ec3ee5f11b265e8e7d99b416d8e7b166a38d2b0f9027be73887fad28947994a2bc227dafcb272d2d410af31afe16b96f51c9ddf62b417d03e2af63ea4a58d41e4649712177c85788d837fadd223c4ea7f635237a93b181fe1c0fd3bf2d8a7997cc9bb6ca099a0a36c4b9e91aa780a3d5edbc283cc316a153a101fc8c33d0035e6c1e1aca731ea765a1e5fe1406ef7ba8bb8f335b8d2e6ce0b9fee2f5416e4536b280fdc40860c17e9da6bb361128ee53754bf68f54c2878a4ac4d349703066a6fb96220e15285fcb41b398b4567c0c167762eb6ceb4f0537c7fb7103487c78a98093209771fc4f4a9821cc8eb11f15a0e35c54f6d5d31d8e8646c229",
"19c45bc7c6b4445a2e4eab511de011820ae0a0483e957b922fc303b2b3b94b31205c0eb821a8f33b3ee53d16116c6a7be99595b2c16cbb1162f147e7530e48c60861411b595d4e7d1a1e852389eb98ca6856e99cbf121377db96961b4a55478f54e1cc0ecca349d298dd55b7dbfd9a1e97a1e248ed9c3e4879189925b1846010e567269376a5321476cdb6fa6ba3d358ccf737964457765419245e53bfd006753eb64054e9f83eef419a7cb99ed4bebf31823e3f8b6be81833ae164774b044788b4fdd6170ac499ba60b87e8b1515d4d1fa751fb4f74ea674290a1a8f24c0d769d5d8aa60ed2e4f79fa7e2aedb42e5f18811b90d96041dcaf41e25b7b2e3e998",
"084fcf4ce66c15436dbaf057e9de7dbe99a20fdf1ac491a920580a6e3b304629211577daa07a38888eb65fe9507e91990783e05f0d9820afc37623ecf42241c66a8bc7ad0e0f1f43b321fecf4a9d76106d6040588d13b58aef68037f73500a8d34a97117ea41c0d2ab51425eb62d863a82ed56e7082589cfa3d55facab67590ed603fa8fe89553af279f36bf32d7e7f81f24f17cf066ba66d090130a7ccdc44848a23b691837f51f589ce3076bbd53088e80958681d4868b0f957edaf95e175dae09cecbbdd39e01cae14395690a61af5d7c4ae882092e840204823a0710e80f81c4011f10a6044c79a07374b75f13843ded1f7ee3fd9abb85914f1a25b3dad5",
"92f7509366d0d79e4a350ceac7597481b3c4044a7658f2aa65165fdcfa0ba95c9083156c9b9cbc220fbaa694bc5ddd5405976be45845fe9a2facd2bc1f1a37913541a918ff75a8ef26506654ebfe0501ad46bd57e386926136c38be16d004b1c8c3da23c58632ccba96dd1857405e4712488c2c84db20f82711212222def48ea20efe09e5b476e28a60170cfdb175c7463443f8291e894eebe95df13b0f5ed0d504958813ca990d2e32e969c58543f77ef52dc6f8ea539107a4dee46735cc49903664ca10a902634733f275a0a1f145a9bb912ffb4af550ec08ada902f152164c92e7117f2f2649549f59e1ef5398b515403e3f3748eae0b98a0782e30a9c69a",
"844074eeba279c98b763fbff66f7324bdce04b27acca85e4d5abe514605185bad21207b62a427fce1d9ac2b2f0d0260d45160a2a822abac1da0a966836521ae6564f38e996538b4af300de69c4aa0a5721e8c89f20320e4e09ad1f99b6a0ba3fa2b41330b84a890c30272f6312b2cbad7d38336faf92a8c4234a0814ef662f62ca3ebd492f805457613e04e241ad9516c1641296334228cccf24562d69ab45352d30c68dfc7cb7e1159bcb5c0becbdb3ffcecb446d0ea2507ebebb6d9c8d9388d6afbb67c5f35df343ad4c23e0b65be11e0f8e117fa26a6abdcfe215f8b0466d31d6168611b71dbcb999233b50dee5414e54d444c3d3c423dc8c58813a571058",
"e08879c12338d9eaa5e8648351ba516941fdb52d6578a0ba0cd88e1637d041ece35bb3a4d6c5e899ca3ecc1b74a92354a70940f0f83ffe25a9afca901feb6ed4dcce64faa100ddf043e514426f4f1e6aa9423247bf1e7ce96158ae8f1eb1961ffae1d232c13504e99e09f0da7513a2620e88d05acdfbb9644748df12475d01af7a17f35a6971d4e401f62a903018f29c1b76fb8bf7166e19d774d318c67c834c4e8b0cc0b4d36a54586169f43ddb1f269e62be363222bc1a1d1fe21b488afd539b5f8e87ded67979e6b1f18f8e542587aeead07c91b435c933e5acd33ecbc7da8b2094c50f512fa9ade68c3c40ec9649b0a92c720760e5afb7b6fd94d6c53ace",
"c10f115b8c930964d893552075c50f9c606800f446d4d80226ffb15025e7a0ed9cd329ae7346546647538a1421acd82c0afb345cc59099f30b94f812d5f5d45bc870d6a7a50533dbc97e4488fed26f3061a654559b18a7bafb3b90170020c0967fa5a11d1359b561c0edd562fbeddce8f697abd19cd3f58b9b0a3f5fc131bb523ac2149ce95f3c5ffc2cda3c988069d2675d1ffec29973d5bd7b61c64dcc17367e50afd555ea78738b75491eec3e1f0b78fa323e06bb9518742602f341856d3575f18ce35f4e4298e124e4537a3de4203704be90dcfb841225cd5be4ac694c144e238345c30a3ca23accb7114ffc0bb89a146bf192a6d78b3a324c8a418b7af9",
"77d1c6cf1286cf21350e3d331e8fa58addcf796dc680af1a0d4260a3b4df256bf04870a852129fb4a950c732da2f7bb06b414d52c7c442b3af8eb0a76c3b701efa66d57b2f047de994ee209dffcc6291587f0de4f695da12300d5f74d0dae002114e0be8babe21dbb031ea3c2aabe922fc822bcc973ea1c4b0dc0e4f85f83db4d02cddd238e68785e8a31db70b83e1adfe291eb63d934ec9c7b93d0b369a59215d2421aab831bfd3b9a6b1c518853492d87c577290c446b5a942bd4d2bc76d7e8450eecb0debb5073838a0fd521854cc1127d5ea514938b499d2289c1e891e1cf0bb466e11e310324a566c51b75072323403dfc5eb5bfd0db538fc450ecbc925",
"2689f68d42cbde98b3627fe809380598fb1aea001366c9adf82e7349515ae1889a85d16e2ddfcc51d83699fa2b6da580c1c5f32a53208dc0835ae745dd8add5238a4842413a107bd4a39bfaf546b3c994cf50e29add6db3b5138c34fc7894b910b00a5d5ec5c87db8af03e22997d515d1430ce3b47543a24ad957e192c996bb0bd388fd65823f0cbf40d46776ed647989e7a5d6a6ce4d433054d3c6873aa04a4bd2fc20a92d68b90e412e44c44914a76fd12664034c207622107c51e92987e51ffd381605b246f016fb78452d7bdd73891172d3f88ef2e2da253a5800b469091d9a43a947e85c8da2855630630efa63b418f5345623e3c258f2e93db3d094a52",
"d2b2e8701e9268f050fedd0040ed468d3e5a5a5e20de157608aa70dc7059af94a6dba349545d3b9c65e64e74c555cbc0ec462d496cadf45c4ed240a2a1d6cd021837ee857ceb0e5aa0c52bbd9cd70a495a597a45e5630cae62b6957ee7f95f772fb8821fe781f7a3ec7a41f7db5caaecdad9af8ab3c9b058291d6b9c98d50b2c477afe7baf769c424f60e39a62c4d63a8dd99b7017ae267191561c5e2955764c8932ed9b4b75924d6ea6f8b62272eaefbe0bbccb59a43511abe49e2ab486b7f6171f0db8a8770cfda0d2339be9e78cb741c2dd0de3d6c272c1a61fd5de72fcd8618ed984d891ee5d3002ebcef8af237af441484aa229cfea3ae2d53f22277ce4"
},
{
"0caec9762370ec3ffebdcfa2e7d0d44c0b5ab46845214324910270bac7620982ca236b54ef5179fa6854fa7698515b7c90e3b44f72971be690b876b4636a6a459cd3aa8c15525fac4c2f3a73341d4ace08381b4a9b08f5f67553e23c0893ef556072ae7eae1ff15a2b381861a8f40c281ffb884fd27d78e5b01888958f21972d38fb542c5c0e9764fbb8ae66b88d8eee091b19e723fb9f302b71cf14658ed24a981c53dff9976fdf7663c34d7d579519d97ea2e5c719b79a9336597d922986013404e021be31ae6bd3a295fdd95efdaae201bba0645b86a678b282e1c785fb36f920d81456ab0ffa34a0247065694c43ecd5d90eba1aab268b268ff5d8789ce894a993b606627577534d39c7de7790a1997f749057a3a5bdc69a34575c34cfe6d1ae2ae52d33b1cefa635b694633a2082ca4a2b8617c4313cdcef0b821dde64303767f66393f50bb9af756346a30a44137790a1164863c4960ef61d3249c4585b7f1cda08e8ff9675cd848df40896f413e6b2d4c6303927ec495e9665b3479e0",
"2ba6809b0be2549b8e8ff2da7dbe3912cf5671498b41b49e372bf58fa0d814b0de5f98b1dce703149a6dcb7f409006f9f4c8da6748e50a5dd8cff8db0c54c5cebef4de1b823bcabca3ec3ae78b2050a60b0f813b1a8e7b67bc09fa1cd98dd8436110e15193f17436f2c0a1f81fe94ae2084a38264eae7eb991a4470e86f8fc84e201e0eff0c308404098f37615992f5116f9d7d92c758520c9c8723128a22464bb9b964b3ee93a80a745bce7abf5e97db3f6fbe0cdf57ef9cfef97c1b4b1a432b376c27e3ddfad4b2aa9d2b27d0c1ef23cc27259fbb272e7131d13e0494f6709eb509dba04a8091ba25735844c54b168c65c55e0befa35d6be44ca192855bdfb5a07d7cceca5d85ebfdb38a2ab7c9938d4cbb7d74bb2c29f1d9cece5cfc7a63ae560b7058f3c737234e4538ce057dd13278f1fd1ee27efd9a6c74eba4039dab491ffb6f72548b18d606abcd205f35a457bb2c8c388204d95bbf9d669c1ecd50665dae997e431bef462b9c64fae5fee525b5b150d4dba9ea7cf779b4cc09cc3b7",
"0607adbd2f690a83532d4d63fa4886ce1eb769842a8f29b15c37db6275c8eb7ae9e3fd335718e6bcc1d9cd5b6ff5becfd3f99b4da003e9dc5b1aa4e892910cc3f21a9333f28208a9c774e812774b6b36cb5963728f142ff37cea9a59f75da871a6629e8a1846071bb010cd021225e4186ccefe5b5dff9182143b351de0a5c2cd0f39de75a5df6249488202eef83c4c5a68a092c5f78e67b5dfa67c1268c1e12c6f1860ca54450e028c41f47ab3abed6b36c6895bdc5580cb923d077eb8fee5cae2da0d0942256777bb43a57dcf75c7366a7f7be6adeb2eee9cfa8f7af134f467a155444885d9afdf97e64477ad38c41aa099a993ddf61adc8dca65b44464c16804cda566bb5b3ead7dd65046cbd686ad7dd0a3a60c31f4c2c26aa63cb52eee17b67b423da75b78949515620a534efaac691e662a3d38540bb9351d1f9f98fa160566110df0d6f85ad9b593271bbdab7a2137e7cd67955ee4529f239d2ea544877352d60783a6316bfa1ad1ce04202d6cf6c387f0d365385923cafd32c29aef15",
"4b6c7279346e264a3a2a2e0f175a4e8e47154cc44ddf07133bd193c336cae59ad91fca75a19ad27ff5b7ab2c7a91160d5f0a67be95eae7bd9b333658953277ad7ca90195848562b7a78646827f0e572ccb4f16c86f859255f7a42917a4d93e2f75ff4ec2df8877429238ded1afb8a4e2cad8c86eaeffeaaa13f438d8502eb2fe4535c828d46d852ccbfa83581826d6cefb2412fecba925cc2dd34af55ab79d0740758cb08662c4d80e6f0da3e430aae5bba2bfdfd8c06763b40cf8b4b8c743a90304897a758f36edcfa2da8060a08fea4192aa55dd7640b2c3552142489e3787faca63d586e55a001ea56fd3a4ecdbde46f2bdb56210f3d93eba38e55b8bddf1e30cdf3f18a6ca2ab081bd45b4582e8c30bd2e129100d8def76f6bc572d4d71623cb3a20d760ec2fabb76134c32a2a3c0ab86f8c22e796532774f911f70f554c4eb62d10f3cd3740b3902143e12e430e6a89a30c7f55724f1596c47cab69a66e1175a541418ce5ab4e7808608da589db31ac3e341d1f2ef893c62f7f02152a36",
"1685a8503142af078d38ee62c6b9b2f232a4b01801cae2f7bdf589a220f390276665c58e54ed3a19b662bd6bafb2f24c9798efb56a7534e66a0079b1d95291a8bc922827659367b6baa7b57aa17dbf4daa9a3b2b2f61fc23aebd40765d58000c019f27b25fbd645b020d4bed5f068f47d5d37f911575b6480ca7038b892356e5893ff92f4664c8908aa5ad1439e968b561edbb4e236d338e7354ec909d740cf1625f382fdb91d079a5ebb1e290945d380c8b19da23d39695f817aac5b86a67c54b0391936e6a9cc9920a289f262468420d20ccd002ceebe262c3d947d7b3e35d75573eab92f3ecb4f29d9ca4a4d40366de8fe191de77209372bd3de2540fc88d68d5dabc22ac02891e1737e32a6352a2590d869e9c26d3f84112c674d271071f60df90e7578f1d5dc9628c8a172e07f4c59d4fc37fce1577510114457ca2fec73d9d3aa23dfabaaef60e0f6da42a4c862685296c31a766f6c49af7beba508bf8d1c640b12e70ab63d1ea0c5add9a1a96bf83b1873f3d4a97961d224318a5e0ff",
"5af92406a5a36af9fc49084cd0a94486c4ad8e5c011be3f77db454d612bd4e71325ac8387651c8528607a5f261000aa3cb720b61196e3177ca908d76f84d18fba7355245557bdc22cf54562aa29a5c1400aab781fb3577a19e4193fc139e8676e6b9ff92065722a03bddee85d8c87084a5416b555369fe323ebea53b392abc43223caaa746f2bbd7fd99ed3b4c9b5bfcf5a892e62ee3b8bd21562c3ac0b47c0c0b3783d52c56dbdc96af40b02310c22ece6464a8dad3a0355d34d31fd6753f2dbaf4a95703e302618bd5c90ea46edcf2ae6751d05ac76d4e4dc1ec222bbd969c6f062758638747ba7ff0fa4561a913e3a6f1a9713f65ddeb4fe317e2de2edc2edbd2be0bdf6ea8f3da3c264f82511ad62dece581a4e42c7ebd2613dbf5a80ecc668bb8b5f50a276d56a3e470e8d2dfe95d3ec0056c19d3ee27b55891bf57580e2947707e3188b53ebc743b49483dd37e3dc2582ac94768a1697dd249157ee1a6a0e44431267600e64689063b3e8a4fc5d16673c835919b4e2832132f2e05d474",
"3e5c918b7abc858d646e783f4b3f5b298293164499dd72d116d4dddad3a50ce684b2b566fcd9aa923e9ee80b6288ba4506239aafc1d0d56aea4011df8dead986a13202f7635a48b7ac4bf7770ab842c04e58c8d5655cbb7864578eb76d4f2ac4b371474688a7db50846e669ebdee8f8609f91c26773a7de9a31b096735c50955a1c5926eff5e03c764898e7af476524c622d3afcbbbc1c837c33808258c757fd398f6b0a4e656cad30dc951c426cafbbe11cacea2ec2064b825abfcede83f5f57f42d48d4648e39500a74d8e4cfd6006c4653bdc92312b8b2d656d5821e4f403327235712c936777d09c5e1332f6142711e5af2771b0ba6439b9f495e1fc9b6788e1c28216c20e01e7af15da0d13c7a8bdb278b1d6da5eaa20db00e2c35f32126398cc8b8f266a2492561567a37ccd8e2e02830d04ab25221f3a38e22beff11a049852b469cd2686f9826680ca745ba1dd46811d97b249246a35d9afcc0c9e93ece9f7bbbb260c1a8814242ffee3abb963fcbf5dcebdbbc7de8294b7e9306ec5",
"3ce924a194236d9032e3a8db36da07202c378352a24ea0bf4ae708368304b0c1595b6cc74c2cb35f0697e4b58da6b0e98ea7bda4e584ebcde10665caf0eb47f6547cbe6c4ac26eb14fabaccb686114e8f2a3dd7650a3b28fe3996618d2ed8bcbb7df1e5d2591242ccde7e5010b99ff78ae25cf8c2741d13a558c313d42fd3fcbdf0f5f60a044afcbe5102a062df5a52a0cf6cbcba6965c186af711d2b782c456004b9301b931a8933457aeb89968be7746f4f5fc6b32c832be6f007e00a36ffa6a0e210068be478e2b7a156764bb4c3f4664a4139c6e6ec9e22778f28a331ccb001fd68fc5768fa332ac70551432bcbb88b8ba4741b50256146c83e6fb8f323b7a862ec4e1bd4e11d19f1ad697b69caba10195587afae5e095e20105a5ca9a8eea10653cc19474778599b8755739dc2bb9ffbc0f3054c26591c88312d6168cc9ccae4a7e1c4ef5eda71525ac9189943c7c289c698e7f167fc1f97d9c4b66b52675cbbcb55184c05ab17d38cc5d63eca4399eb6c880a2c51e4ec4670aead99cdd",
"24baa7f4f5a3e7e541c2bfa41924a48e22355618fae7655b1978a911545df542fdebd076916aee40f3ea393664b45217a568e21033e464cb4abb0a52db709c1e605dc5831a7fc45231c074f0f5742947f8bc9121d0d88892d02f55e86cce6c5275f42714766c0baa736d498d028123d0337de4bd27d1f8187658ab89d28d9afaa4c47b64eb79dcef8eb1eb50f357be140a091c448e4153abe5e279fb5afec80244f3f8736aaacd76f41403b8c6a8915be94442bef7b5e2dc9fc77191a0907a02d3270d0ec13c2c3e8b4aac2f050fafadf26844331817e08f18616491e9e96fb4efb6b817ef5e8332053f49c62419ed6fd0f6818904a9388f1173eda8ee48aaf349c35a98c1d0f55d404e641343fb41ee4b18d77a83dc104eb6e75bcfc03f6eaa194c4b95b4a51a6357fe56b36e3d2b1635a33ca1bcc7f2673dfc60d5ebe25c7f147f0fed67a9639247841db91f20d8f33c08e7e6f6771661a33fcf70593e52914b0c468152d35c6c18285dfcc7811291ea6e0a2989ea68803616f6a2043f36f1",
"97768ccffe282bdd63b10ce17b0f78eefb368929fa827e4cbbabe914ed71819630cc16d1261a5486f73f65935e1dc3254f7e03f93890849305c5796105bdc764cc31dd9389ffc328d1cbb4f4154c48ada7525c2d6b9807980241714a0d852aefdc40fe10ba46f89e5b5b4e1deb23ca18cdf732d382cdcfd936bfff05385bab3dee8f6f904915ac418baa4eff5a2626547f5dba29c5209b0abfa378992e4353ff42c0d68f892502a0606158c6f41d565cf8541f19dc75f9c23c57b470f1c05d3ec801b6b524cb9451a678f04b7452026534344b502d8789cf6ba5540f1ec6729ea110eb5cf2d84d5c7979c71585eb8d3c208a33d9ec7589398013678c699019bd01bd3cd5e1dde94c8be4724f23ba0f6c770b56c9a10af046e661209379cbe0cefc4aa6088152f8575ce7fbd84d941e2b1e8d6ee21158c43b411347a46fe9b870b6eac10e16dca2519aaa6d77e861e25c26f071a8312f5eafe6df55666312aaa5f65e5c81bb712d024a0372a74c9ee8f5f4614f1bf85782d6cfe4f810dc913d2c",
"5fb3a33769af2790501d8bf8149d720ae2355e2c19b9250ef3efac5398ab644c0feaf8a51d09fe25ad9e871f36927e129ac23ff70de519937fb2da6371dd617bb9e6f5c0ae8e3399d8ce503515301570950e31849d67985da08c6d088bd7d13074c67f2163e457b66f5f7b5111e848204c78bd3bd3fc04d5462b0efef47915f862c26ca28fa30bc9e791f41630c6f8f484f27acefb14c894df87c52284beff19374a40fbfec8f5979de9ab89f9807840e6f055f7ba495c38bb074cec97664121b9ce8bb4bf8fb3714a728a1b2297625ba2d5afcc79edac68362ef12e86e41be9332171aac36687422b6c5466dfcc599d5d3712608dc8abc41d4660541dfcb66da3ca1887e956775f6af163a0eb2d0e51fa85003e08af58418c8b0f6ea0df765f070c800cf5403a54b74ebe2ef6f101b632680868fd59573801012f79119079a2dc11111f32496f3e28f70f1c4b9dadf0d4dcb1e0d3f1455c8d8a6c24880e55836c38aa89d2f6c225c09a8669078d029a06b82e32425f3299dd8d5ca354327c01",
"36da648a4a59e33b40a3ca62c80fd0dc061d47749421c82d52413f117e8e690579cbe583fc7d893fa338aed419d567628ed27262b54caaaf718c6d83134d428ef8051f8d65c4434777d6363c627753803bcab14e263318b8d72ee2bdbeeb6681e274735aabc0648632b81f05530b799e219f8612ca35ea11990dabe98397694fe5a407316280beb8263a29dd3ddc81355e4d7138b826b8154876265e09affd3c1533d6e33a77718206241c55dbd5c8fa4654cb23bc338128f6e575b72b2c381c36387c21cc04fd9416582a0db994298aed27d213cfdea3f0fa13c75da4f51316806d98c66a8e5c0f6f0c7f41076fdc9790d87929de2bcd2d179805fd48d42ead72ae76c534fcd443e4afe4185d88f1712114f0ca46a6b227fb6dad9d7a8c410515545acec91ecec726df1d3297da780c5b80cb3692390e78ed83af206b48cd452661e9f278a656e8b09e585d87e4187330e83d0e3c30c2468aacf8793c78c57f2885d506033fbe93ad856a4db1ed257cd1614b6ff2e5b11aeb56d42fddd98825",
"0c57bb639a1bcecc84594878c9df7dba1a0cfe13ea6a6f0b48f0a817dd13a47e977a1d21503a469dd905bc35d0022232ef23259542ac860ce30cc5835c196b742911c3d84e90101b9b200b73da4f995da01b7f2d4fc572075859af2c86d0000f376935a0bf183668236bc5d3d2bef74d8ad9a935ab7171929145d1093fbbc03e6b951a37640c4c71f1d2eab81a2c1c6c8bfff0864c1a8d7df64b776da1dee48b8ec843a732e4e5e55481a2a4c1db66188ae585af7dc9b55e1ad834c8d57ecdc5080204319618885792810e8bd79da22e1388cf49bc84cd69cbfb4aedeb9a615644da158c3486aa4a4fd98284096a1e48008dd6aebd5392252615f4b663df30dba393e17d37ae84b9e1f937e60ee8c5e6ca8108c2112a7590f2d32b366523b18b0dc23dcf1d0754b5f569b2c85c49afcc741fef0ece5ecf27035d1b0e32d05f74dba53dd39346e45833135ab7627935164db6f5329094cd319bf27d6e8b84ece2eb7ce96da47ed75ba20a8e5f717086bbc29f3fc41c5e2117702b5948076aeadb",
"bee1202471df2aa417750e9f0111ad6b17e6069dcbe6155aa676812062bd0dc62671302059eaf2b9f7fb1889e750ff2a8119f0a4c72ecc1158f2ffca293cf7fccd4a4a49d8825b75dd3bdec89360e3a4dd01557bc3a4deda139ceb602820ef8a3db0e2b7cbfd2653052aee96fc0028769d6011fb349ac278788c513eb135d510384477dad8ffb2fc547a002c0cdb6a5625635e4424e995288dad1e5f4e9aa4a3fd061821ea7c60f44110f72c92ee753b4e8453009908346db1a3b9dfa16081e57dd1b281a7b7b384ced2389a25645ac7a7cca4f1b7899b02d9c4353316760d79e51cb0237aeca74e533fdf3f5f1df867eaa58e8f61bb46af04dc8afa35dfbf5449428b5fb96c6ebb580688d3f94fe424ba17076be801b5cb99759896ba048fb5af13180c18baa933bbfce5ba493b9d753c2eb1fc6942818116a98acdd94765189f07f50ef8e1b3c60cb0ca4861949624c40933485fc52a61248c05d9aa23840eecae56d3501ef442b97ca66e37c102afe753303aca6586bfde75bc917a31db6e",
"bde6e60ed2758b9715ae15f321eb3badf1a47f043de93e7a913c56b830fde23cf25b7a056af98be57dfcec626feb75cbe369621c442a3548b88b50979a1d70f0bdd6172997adcc5f48062d28f63e08ed8f395a8c579c2ac224ad277adc5ca564d8b9f8a200055458db6f7e9f2f5e8dae8eb8fdad869e104da5b7bfa301624327444e527685a135a01baf7de1fd59c755b32d3347578f784b0ee0ff292c0b7cb6caea3eded7a000d3259a55e010805dfa9d9db65ec082b0d412911a34b482cac50e5adc98e2ff9979869dedbd56f77d62a8407e61c2ba6ba4d60f82b215e090c8983bb5c606c800bee7ff425699bb9ffa549255df4024fc5f3981c483bf0ca19baced8e885ab6ba26c7bf8fce5a998313f76ea6b96cd0d5d2943f934eb77dd49fddb53d5938a1ab80b6f228c7721dfab591650a8f2e0dd571b09fa237f65ce80399849eee339c6b3ec976bab7d6394e9508db0105c18f3108ceb8b3d4a98cb115773d369ce971644ba86efd6e173f8b4a52d1e3f67588a1907e4c76304e33ea7c",
"8bf66f32bb27f14569500055694a9b70938b7e3fa6bfd41d6772e74e4cbe6a7b52327543f2d861f2d39c9cb15a79008e10ff95b60d13fb76ec5e1ae402515f3e830177ca9b359178f729fe133f27df97e164bda5457b3c392f75b5fe38e8178f0b74dd81f2f322055764c76e129dd53eb3ad781dad05b22724fbe86d521f82cc2ab5ada5491b5430cf60c250dacfd7c230c87a5e17762b4d66c8e413dd4b2b6a6c505cba0d954eb483fb8d59e65137adefd7fd4dd7507e89b1fa7c230cf5477e944c46d8b63f9fee270c93ccd8a1ebeb6a267b8d91fa296f8d5d19157f0c7f165171f05581f29a584f8670dbf9b77dc74e77ab9a6f1a3ed3fd8b9795bcab3eba0d049bf36946829b48234ce24b89dc560fca830c0c8d0fd8d46ee5ae179d67f450771c4a282c8b0af305c6e73e64d4e4ccaf2fb8e1a105193e550222eb4af772b893f18097c606b303c6a34b04abe9ca7f30a4e2362c96b2ae1f8179368921ed391a10cf1bb1ea9542d9bc215d36709d3de11cbcf6b41224131dcb7974055967",
"65655169aa2e21d4f8344a31d3ec6f8dfdcaff88e0a50bda626423edefc469928283e2c1d72d77a58ce9c0a1faf37b7d31f9b31d7436932505bb6600e124d5d457352877481989191934f70eb27d929f83f8c8081c9599a6a0d57587e1ee1cbd4e9e60afe8b22047297f9d37418e4eaf8885d33d598177e757c1ced78b8aad0bf9bf5ba4acc71cd1f9abafbe506a231bcc361b6d5e766baede75e2c7b47076574c5b485e5fe0c77ee6c34b48fd8afc3b168b8fe4ce9704f00c41cf7920c197d0223f562f9379f07ea28c2bf82e18f23d648a810fff1ff44c95f2b247cc571b60e329ced3a8736776e60499a91775cc8d889e655250bff9eaea77e71d8c1579cf34e28bb929db9a739f919bca00dbb9881f58d00ad2b85ad4d3b975fe6bea0a74625fe2d497cabeeb8de568f2ad2f56707173860d7701f6994f10604d2d2ece117e45fb52bf4c0b4a91d3480ece56955367a5a348f159254040e2ec95e853e22b4a5a7d1ba905555331c587b10ea50e39f92aa6d6b5fed0361fa23cdb12b4d71a",
"82f364da3f75a3b80a8ea5bb6882090e5fc6628c94a3f08c0ed529d7a7e2990c3e301d9569a15afe212420827976e4559f55564fa6355ee5d54e117b25daed068fe2c0a9a4e3930342765fb1f5423ac2e053bef4d63f599a9178da7ecbc430cefdcc503ce92853ab6c9875654102509960f01238d6b1dc08816085144ebff1fb6a51088ea481428970fc2514d103732e27dc2366ffa6a10cea63263355f3e814e9a31f133a83b678e5483740eabd0219a28e22134b7010f02fd92c7d4fb6949e09d78b2be39b42fa2636ddb176dd9abc6f36e78b2da0207106423fb7e2344d74afbba457f3eaa3002fd4abfdc12e16a555423d8666f92dcfeeae4d3bbc3ea5564f2f850030094e357e4f9a7cee9ddf570bcc9ddfe07cd7f7720bc5c921a70dba0dd5dc38770947acea77c4126d9699af6ace8ca7b9689043f5435352544f458d150393b84c6711e85fbb69faa21c18d96b9e39d60dde929842740c263f05054ccd8b184786bba426dbc1b01823c6fbdddeb7e6bea8cb554e991ea98cd8768b69",
"3e66129baebc98bb8d72ea27e3fed779f0d31731f4dca2a6e0a4f66cb0db7d8cb75b7813476228b331aa5a67496d840ce555fca7fc540ce2a364a6bf9cab3c505a52cc3eda03bf49d3032362c30aae0b058ed3401ac32d84402c3a499f4b4c272d6dd2756208306b809e16dcd204253379cfca6074368d504487dfb503954b75189e3e47ea60b5edc32f28e9043633b3ec965044f3ba6728b73213005c06b5c2311743702149298ac03043dea9ad88b7813e2a981d3ffdcd6c10b1848258e15d76fcc96fc508109931e18698336fcf15837f155b4fea07c37bef4bd9be74c1f9cbb62352d5f42f07d6df782f2078f704b020a75b895d1543d60ddc2aba119a1bd23a8d2bfe9514f939aaa3716a866d6d1303967b8d13c8d23336b0edd2976cbc803d00b4a925866b2d4799c51072066fb04eb0740e749aff725791494f28f38ad9248fe1c62481ef9ab02a8328f3c95db2c963f8c6da71760203cea0315120e65123f03573d4cf1716a951ab8808fea8c0ade4f00078e9c60b8644c166bff193",
"27fcf85727c0d1694bd85c3a637b098cf71d486866c654a469408b50088f208d72b2da92720637ec8807cbb8024e04efe569f6070d7615ea3bbdcd4e088cc31b1eb56be4ce853cfaad3258bb95f352a5805e1a3ccb7219eaf96dbfb362ac1d5c3f523c8644e46c3cdddedf8afefda527c8094932e1299bdfe98dcbef535e26d2034cc66c0ded6cdaa599bdd1bd6890359087ce30c473b589c08670f5611733e09c028be916bbf52064c4630f491a3b383bd0fd5414c35f99e9c8b2a7ebf702632b53368b1a0f6f74dff5637a22d70b7536dec2b1ab1b9084461640afdfdc1ede94749203dc5f899e17f522e63a5f26adbc280d3d4ec8c04a6407f6fbcfc3cd1a060a2a64fd3355c317a6721755838981736f1867c7e0c6cabc828cf2615f62c8d5d7978361051acf13f0a3471919e9cac0801c3f92fb1dd6ce37524e879971e2b69b690d4b95e9120055b8fb06b91c01fb241eb1630b4b0c75f481e249bd7e8b57cc4096aaca11492849c7116ae121495cb37fed86e4b8ddd152952e1ae0f824",
"654ff18089b8778a5f63eb4d743cf5bd0fe68a7575e0043e0007cf0133909eed03ef0472ed3e50d8ed880259aac0a3406314b96ab60ba023576755e56484d550bbb7e02a0fa02e3b6907b6a7dc8e7264cea4e975e1205561796d19611c5c018c3a64bda31e4c8d7839e6da1f57656e44a5428226198b4a52997746a82415e3c8f4ee84d9fa8094149a4e765f525258fab720fecf6dd00550b141029d6e3b9ccdf1bcdbb3622ab97661180f283606377e7dde80c6abb073db6810ee4056d4e0b379394164adef8e22fdb32cb2f42e2bd2031b710c40d2f1e727b9218162468fd773767a9d4821942dd3937a672c03c0beeee7c1400c9e2c204fd86cb862e68e78c18f702e5e10dc9ea1c3833bd209739d47db37036f96ad69380faa26f33e400ff849597c82d3f44b517d04ceab5490436c375409a43fa01624be3a1477a1b33ce984b021c9b3d86f9cb633a7da4e2f7f25467b4daefac4120d59398e4aab6c9ab8a511a853d66c6db91855bc9100017d058387cf68b9e6df390f3ba1a981a231",
"9973a5c2e9dc3ee2f54a94c8c79c5bffd644cacb9607d392b01c4cb157c0a6b8d94fac5045dc47798a2e9ed5b1a4305618b714e4d98e8ee8c16e3b0c4a2aa799ed715a631ddf71d0ad9299b3b56dd7f07e464c28c96559469137727d4e3388d526342a9a926c50416b5e1cd434d80ba4844b76df434ac487cf32519e76f5a3f21349be54000ddd1e1d9d70d14193c1dd0a6be6e493a941cee49263718571cfc012173549f1e91f6c5e90a78e817d69fd7a154e372fd056ef803b294f89d2fbbfe6f42ea911a53ab8902da65397cfb6a1be35f64ca77787f6cbf64257420b581c2dc93fc41d27fa98836a02b30c64c81f1b11c023dfe7a4e7c5d7a1de278067cd4fb5b5bbbf9e0b3d252b4ea63e265644f07c114ca3106f5d4429c61fabeece4688fdc860dd7af7a7d8c4891403ab07f2d6980788dad2c07da2abc63bd5693200c2ddf9e406fe565222c95ac66e0a4fc7de7ec48efb661533201f24301025693731009b4d8e734ea62f5107d77d98f137cbd1c410f2178df4eb65d42a06cb8000",
"9d739577385c3124ad11db386fd1818657af9a0af06eeb54de027000effb4ca87d64d9cdcfe80f9bc4d370a5ad1ff676437f26d100adf719c807396f93bf3b3511e2191cc042584157f08606a07946cf640f1e0b94022ac3b613b63473ca76d4d3c401be1a1b6aef01a1118f0051c2f79353c5afdb01481c98ba9837c9376f94e72cb0030319160f05cb390576bae902f345ded052466285c0398b2834e2ca854e98aaa3ede2ebc569ae6fb11189925b50d93309a989fe1f93decc3e785faaa750d92aad9501a530cf60beb94c6eccd67509978f333fc26c760fdda487dd1549a71454f996dfd36f9317d758f7d359194f005b4fa4754671f55b879be301400a7756bb07ab8d4fa9b7fa3f289473d6740376a3ca0eca54d5c64a492f7110a201c2de5f89ea9d058d2b38621e43ba96d72770b99835e20eea4a6fcd25bee2c5bd03e31169b924df990cb9d1374b9b87afb798d8703073bf570c091a4e1c43a67efb3b81be5b77866f13ada510aebc827514bcd55efa69b3b580e7af5eede53c34",
"70e10e29b7ea17f9e69b8b8d2dfb1afbbde324fe8e64205e260f362d6708838b17302e7d55d83e3d66b87fa81dfd641fd9d41499a1a1de9615362e1207084464eec60251528c0af12e784de39ea5bb3105c203e432d0efe1cc7f5908cfd7cd5780d6511fdd18de339ef6f46d26fc98db604b0e3a8eec6c276cf07bbc65a738e82eb89cc5468c91462d8e40e1ffed9b165abdf308e8a49a3eae289fbbd2d8d52132a0392f5a01bd046622425c8254010dc0240f76ef1458ef456ae76ca3639f608723993213e9c5bd04f0e750fa9fe534ae97dc3fc2e2541d11ab91b626fc726c85f2b519af38a4b75952b05672b4fc0a9357d31c62908f4df63e87c9121f5866f18657b708caceb9af633a8f517673d5512dc3ea5e3d2917e6517c8853d53eca760433f9cdebf3ba210c866d88d02e02ae21567930ec0656c4814c9262a901429d206478b7e2a1f40a3c159f8dce30c305739a32bdf752facd76716d04bcbac983beaf0897798d669f6fa1bfbd29288765230975572e095aa24459ab956d721f",
"ad511de3f429bca205b5c616b9a34c87ba106bd887ed5765dfa00e15f0360cc439c6f825716042e8af57ed1617848477d6b1e06ffeea8fb708cf66d2a978b1150a644b2d685712ddd1e92547092a25adfd05a26fcb8197e73de412fd697aaa9fbfb61a13d96ae1fe0e43d3579d6b18358169c9b038b5302ff67e63b067773d9e71d7b433e2066a8a41541ee7c0084ad127c06d6df52b12546bf25d9dada97208af936299b233f899efd96ec7befe62450bf058e83b948654d172e80bbe66ad2a9125e3b4b27078a5c9dbeae5039d1ccd376a99f27eb01c974756c7f7d00a3aa5eaa111cd11fd452771d015be3ff481815547c472d333cf0a1741893ae46ea714f6cad3770ff9b75977110f2bf2e4006e7533d92b631add30a8ae12a2730aae767be0f34bc2c5cca96bcc3c388ea528c8b2814eafc7a422db194de4547f34d41f207559141628ddc5a2d117252f01bff97e5323732cace93b6e0e6edbd6cb804428c7d0787302684adab40dadf647e62b56ae03c6ab4a6babd1863d2c09a7a5d1",
"baab3a4d1322dc8a11846abb0a360bb8de78fa17b59677543d00de62e661adf86160496fbfba90d7b88439fde23cbeea41d24ca5ee9b3ef39368e03b240e14bbbf13bf1e727fc7ce0b60ef1f05cd2aa4a81e88a046a3ac0400e6f84756aa9016f6b03f1d1ef21e11ca33b5d80e5839c2bf6310863bf5794d4128275e01cdd5388a306ed4d37a5ab84cdd798c0331047ad606518d0f0871e9c45266e4379e6c53d929a025ce8910268c99ce5414d1cd040f69abecdfb12cb4c8cd651d27ebd1b2a3b66ebcd7bdf9fa97e3dae41519d81a23667e302eece8805e0c8a9b0fd6409ffa3b55b9818cc0ad006992844bfa5078375e8711a023d61610836f4cd3ea8bfa6871722e96549864bef6c6d50a62d363e551d9a080a654ded270d6b145b2693c784137903481fec551281d11a835197bc428229c952c844ff80329c7b4469969acfc2c942c39329243173003a38e13dc915cb3a55ad54e79a703417c171a98633d3c463db66b34bb96f7565d7cc20893e7037921f80ebb58856c8d23b3cea7d7",
"c0f823fef8053f76b565df98a37ef1cc9d8413bc806cd9d211d7d32e47db3a43605a3a5d933929a08ff3edb26ba67c89ff03ba9be1bbaa14c3eb50ab84e1a5991a7799e125cead5f361381f4b3be0f299f04b08bd1281fc1e0c8a0975d6908e5d5543320f3b7ed27c07b952b7f0d242bd4a377be28d27e3bc45829915792db51f83b11f5b27f12290d399e86c23dde510d473437368825a4b0c38e6b118e482de54d7147f6be4f1daf8a9b51dde4a3d2d07931f7cb5554b14e0212a33d772fed8d07aedbe16ebd9db4162131b07233762fc0ee345d03c928b5e68bec906ddd603b0d1e2caf7a5ec7db4252a92207b6c098174a2c803437ecd7c8005a0844b2e8680e63f41cb1fb65819aa923f7928f0dcabe04350965ce0f8fae9667d11f651a43a35059264fe630b38161a4706cc3d6f4f5db5790810ad5cf7319124b04b3434d782eec544d5de0e8d2726e51d7e17ecc2c9828b207944756d59ee247d19dd8f34771b03ab9e556f068e6486fa59545436c047756704657faef57243abbbc0b",
"a864050be16b5452f9d45b3dd39fc931f738f9175befd256846a1271f067d83109209afadfb5d82836389555007cddf25e8af7fa5e49f60c0336178550f74559b55fad8160290597fa1d7996bbfb038e107f764ea797d5af7fb1fee34f06a78b25a2e532b9413e011fbfc4552f6d17e2dd4068fccded5125ad3e55ac1c853a8c063010ca1312ac33d3dceb8ef22013ae55c46724f8539fc1bb8fa413d6b993378b6648ba4d52a933712aa3b44ea2ea897f829bc97db63eabf9d7de169b4bc0bc4e67c48035df593bee31b9b047f04d47e5996052dcc78e25bb3f2c7b45e63a05c267ff7671db2a01b145a198326727f0f4b395b1364f54613a32099ee8571d69f715832cea04b36951129f45e3259626b7f54b09fe5520db4e07facd2686f0a8590c6bf6a05e87ab7732e00e161e3d825568f2fcb1cee514f670eb25bbc3a8ec838943e5a1836ec32b2257289b3ab05f99b246ff24cc53c7f5ad8a6021dbee0c36b754b7c005e447f7792872bd602ca1f2c80a9150e54b27d11ddba52ea0a9bd",
"44c175e10abf86836af7ddfadc8af5cf446d61176bd251e4f5c2770bee835e6177c6bde9f51f802d4e92558ab3bda8d3ade34a4c9ea3ac439cf5a5fbac53b4c426a9644567fe6698cc1444ae533197358629557b18a077043087b0133091fff1cf8f00813b8224197174557a9c8c0d15dc408cf371d8ed098b3cc9f5c22fd588ae56bfd1862c3f457d2abd2e9ac8436345fd688adf0f6089693bb0d35661a1127b4a65d8099805f64246a1925f4d0dc6b60193ff10740335d77d5d62fb23e0d7d07520af4b12d224098da47f789167297d191db59da3e3adb185774ed83c6d5924eda40bb62335e3313dec8f5ab3c86f85091976747f8dd824b287b56fce16b4e2507baa5138771a0db95022177b1acdf7377ec8ab2dfbd77e218cb546ee3b82eafa18ca04066b503435e891010001a0fbfd8ed9bdb7f771624a957199998ead0ee6eb7c4f37df5e34ecb7d00d308417dc38a6cf9810668070d6bf2c6e797a6a2e9a7579f491bc9c81d98687228ba7368ca67b5a5a4d3e877c34f98c1b5bb05f",
"46217e7b3ab09e7faebed8b896fca4c136a2bb2c7986b4b6f6e9c1c08aa5c08d500111066cb225e215420694e93cbd11363e3baa0d6dcede40b494fa781d04f4def3c4ea26b54ea8e34a72d0af6ac11e9638790cd3c00b8feadec25a6a16bd39537c46dbf21b68334427b2782db33a361ec6c4208b09cbc8209d7c22664560cb91b2005bc2185371dc6dd47eed011bd2da60e34dd430fc9f32668227905c09bb1f2bf556a60c831098c9fe083e0086499fe75b92c2f81811d1dff29e8dd0a873fcb69641f33767c0f0eb2a9eeb86bd02ec388e7f0c3fa3759d1a58c2192d4fa99065d1544a35912db42b20ae1f6d52d777754e20dfbf0f060a5bae05c1c119d024c9e512f544ed17e3ee600648ca2e5672c38e3f5a66e50de503a7faf9feba3854be609825c33f6b04af1668d1763470b6932d8fc42e0b0659aeedbd9cb2ac16b5a0b164d02ac0e8ccd17d642677fd223dc7c80b28b329dbf507c6f9375331c5be0fd1bcea43d41e3f9fc5415680367b12abe067820fe45db3f6fb55d36c9c7a",
"827d9ef38d99808d1f12d98fe4b45e93d2c9df343ec37e21497715043760789a5854950e292b48aa526244faaad5d894eea3695a1a1c777f85f8455c6bd06e39a7c45d49a3ea1d5122cd114a746d15f525e1344d3e4971a3ea395bd650d5fc3b2b42dbc175cfb651b3cdc39bd572ea50839782e0d1a969b0eea7e7366061c338fb6e3eca00a5bca5d794ea005e7e4ee3c8e90d1df15feba8ddfe20a302995d41c022f8b257e99df2edab7d0f9c01bf9139a18207063a837a79bd4485dd9169b38a218c202d1f19f93b22459a5b3b3d818518d66a2298d821456a798dc7e74366e3cd7c0f4b514eda7ee311a8f32ae6aa088d8e9ab92bfd0bcd96f34bb03caece529131335419db1caa97894374cbbb27a9c0f662764a26a249d56541263135aab39fac9c5d35da0e279b7e0cbdab2bfcaef2d8938c8227352bb2e07f43571c11a489517ad62ce68e374d0d8cfb60e2887c3be9e783354f846081c3a7bf89196459ab02245d890ab0eaa457875aa5208d7f8a7e246b408d3c12f2b150e9f0974f",
"6613f0059d4adbe9161557a9bb69b26ccee0bbda9644c082f25dc427c0ee7ff5e365f144b5bcb3ca856c5a33cde8a448af076bb578d82f436fad1b9332b616dc153346b3febdbcca6d4d626a3215e2eda7d28c99c23ae9b7e54fadfe995afcc58c2c808ea61401bba3d6e04402ac05c97831a590e704c8eb1a0b3dbe69839dfed564e9e6e393e5e8f27aed7a0f4662d6ae6ca8d9b5b303e1aa1414a879d99a02a2245eedacb8a6dd6851ea2608361866f9a65a07b2db08edad620db12d3be0f7ed5cf7aa6b79eb9383e14f0a7a0e7943a57fef64322687fdeb6f46e737f345643bb7f4e15f919332fe2036d3f13f71d72fb3a0b3bb19403d5fa34a5de6c75dc67b5ef663c382607b5a6b2e017a0dcc38f2bd27457355d0331270d05cd0ee21c41ab7419b8a9cf3d2cf400f1bdf4ee28175f55a63aa5d5e48a7482c0b1f671493c3e20a5548484b88c244fb30486c882f2cd2c8343ca1e9acc12abfc6870099d1e61e7501080cb1087ba0f51c050c864f35353e673b8ce801646e0433513c8916",
"695dd776cad9a55228f6ba2bb455d78cab87576a786ca07d008a1456db291de582bd33bd56f5ce35cb506e9867a8e6a389c0ca486bbbf64de833ac48e24650f0a7161142306bf823a0df886cbdd2276e8cb97244c71489dbb61acaf71977ff1ab86caaf8a9fb67bc2a242ce3001696dc45cb9c881c81771233a4f4cccbde0f4c9faf96ff410758c19a740a625a78e54b1194be892d9cdb1e1864888463dec2c266c33a78df8277bf74881916f430f48b1a089140f05425cf450cff2deca4ab418f695ef4c7681d5e0294ee5105e1503a4eb07ed3e331e3bb4cdcce51264697003b4307cbaf2383c30b4a97fe9765c6537f42815deeadd04b694851efbbd2259d3564509bbe5ced1d176102631eec96fc3d9a30b3e5317f2ee98b4f4193c1a1e55993c1975e05120c32988ddb805600f822b463871b82234c09e04181c5b853ccf59659a722fa0de3b2718e5eb676ee80137c9b61700e9f3103e8c7957c3443060ab871752499bc91daa85ca655dcc49fe450eb8480c466bfe7d579707ee74d20",
"3b9316e5b2c81382652f63de8866684b0f9f693d20cd26c2782cf57edffa966a775f7e075be414124b78a74da843427ddb6a04d6a327bc7b3036dbccd1c2b12e635c4627e4a8064c77f1ae06b58881b6144b1d3f2313ade755e31681929f4868e1ba90140bfe28603754ab0c84ebac8d7503ae149224594e38f9410c69770b1c13c53339f5c3577380d8f8759b40a9b559cedafd8977c8d44f9c4f37997a6075d62814d7fc28eefe12fb49193c15fb3124134861f27abda01c09296b038998159c85735326550a214c6b3a5f2f245309170075203d00676a11fb3788b4d665889209894037c6dfcfc3f6232b9ebff516b785945ea012450cad2c396819f09c9bf8cb766fde7d07d426c41b493c19caa1475aac4ad7f6629aea297327c42fb646ba4111477e723e58e789b57929b89cab53b95bb54b22e81f8bd7d3441bb53ee0b22ad122403cec31ca4d4f40fff541b0464cf5d4ec3dfe1e9b071bc4a6a9b11e5cd63c7f4516ed604129e1bd80a962ace74c9e4919c672b81bda0be11f3f2d22",
"2afa4db1e41af844e7ddc5f0ff402f3ea1c676902ca787c376c8952089776fe07f8d62a7b2b10510705663f32e4db0ebd365d169505d5d9bbbc89b37b74c24ae3b9c68112f62420983b5badbb238385f691a6795c926dfa86a259d5b073946f69ee99e683d642690fcd40f5a8e4f647c81f85262d26a2b4593e4c2cc452c3ff8ea9a965eef93e318456b3ff6daf3ae5b10b40ad9a4e54191b395e7ea9c275bc31f92637d6d51117b42b57a94c6d049325ef5b2dffad0eb06f5e3c61b796c55c740ae09cd87bc6301dde55480bba60cd2667e8e564cb56ead71b478e82565380c8aef27b41ed3b826027625264cf042c5497cab09e957bd02464239d29b2ced84f926bc169b1a6917e9076f6597e2a55804620cbbc596c68083ce53985ed7bbf8777d41c70eddc6dc952dd10029797fd081027594340d58625a30fa294c07b40f45df177a6e0d9f505e47ae77e036de3c52471ecb184954572f198b7c9b81956ef0169c8375023e97998b93dcd9340a39997af69b083310cb61eede3b7d7dc9e1",
"3a74cdbe007249e26eb41ab83a180a0be12472b57bd65295b73f8856b3179fd4551807c1e279f60a3868fce219895af9e2dbd71fe96830494a2a6ce263b2b13bffff9c30f332b054d4d2c1381c0bbc05bd21662fd324fb05ca8795fbfe444ccc127058af7313a94547df305b4b502e24e94b35cff919075b295899ada6dca61540d793ea673465db0c1fc10c7ca2eabc253659e9c0f63a53c79cfebde5111b2e6e02a10d04b58f50b098cabc1a17b4badeb25d8fbfa2344555314549ba10bc9a79c456c96d88b2163336d6a5ab25cefbd2af3ecc804bb99f8ce341c214d6ca8bdee3d53c310bf46a6c94d15a74f3379e57b2f416ab552866078c0e6dc3df594cf1724b119dc3705873be61a6574655e3949eaef7bf1c959de5641d07ab3d4b0fddd8a6706a25d32b80744646d3de3875ff9f7639d4bd398b4120fde22b98231957d2ee3351e226919bdf596223f15cc74f1234cd9d18cb682d641d6ffcda6de3d4ab0822ab841af591cd328e7e18b4f0f49c90412405fbf9a93df7384da3eec0",
"2525c6e9e052ba2279e553c525a942a040d7adc8c58fce7521093ec9d8b35ad14cb34abd68c3e544a1df38a6299ea4b0c54ff53799455b65c5bfc17d7d2b519eacf80534e817c96c7ad86fabf634e06ea5f9138a1b958430384f2ecbcffeacc3f5cad2fc951732a45dbfc175ecf48b16c18fe1e856c6214bab33aba7dafe6d71119717450678ea0e68cd213b9c4d6eda077cb79875cf7d5e80a86f905c7278e29376ac658f90754b73e16aa235ca891a9a164988f64d7156731a64171e364b68a5cb2bc9bf42b95c86ba9b971c9551ad315976400df60228c515174eb9c22c5e2309dea7baf60d89049033027e7e31daa52c958f5fe7ee2fc5f4fc17711a641099c0b655f2026db4b4462ea1a533c2f28a525b8c0b1d11a7a411e7f363d391d6cc35e11a5c0f44d11cf1be6e6189ef7e535c2ce18e4a24d483eeffb9308d01b7a874f5df0b9823bb96b35004d044f0681e2614807d5f4c5e44dd3e826297bc5e77f507de35503e1e1fc6a9fad0990e83cc3666e6ad70748a13c0182cd1b79cb1",
"bcad4a658073dda8cd4a8850fc64d4637e2018415c61c684d785812e635920c59d9dacebe7186f10282b8a26d92166c75ade2194cabb0fc1afb2df212a9bce1a3e5ad4a5f735a2eb03c9422232e7aef4d69c3eceb2dfb9e06f336922d02aa45a9de30bb409887968b6a95f797cc6a1da14bfba6805359aacdf5c5c0c66439c2f8689793e054478d260df80d2617658389394601f2ad20cb502e8ebccdc6a6cee597541863f39d1cc480ae5656281b441214bc629402865b2cf62b21a34972c529cb91e1deb331460bd2d1e87bcbb5d1f021a850cd5a166f74ebef6f97a9ebc0b8e709c13e7dd822be44463dcd3cb60b1a34b7f0972a42b545fd9f5e7bc14c7b987902689a63695c5221996129c4ef88d3d346d594055ed76150ad6761742441f98d76f2cc4f6f4afab8da48be18ac2e9770307e55762e47db1be470e21f66d21062d5e3c6875a23ca11ec4c928dd57f9253e766910347c74314c99f17897b59693d55d3130a301353e781895e2482eb9a2865615e3bc0f5f7c223d064acd5cd2",
"51ffd4d03f1c19d234d4cce5c93d6550c051e011f16ab5b2d727963f24b829ca50fc0a5b283b74f25e58be40109eefa5cb6968e9af5ce1f3447da30f636ea8d81c002b90cd4bd40730e968d23b9b6d7b6e9d67f8044361bd4065b520eb392fe7d987b7735faf72cc82431863db43135e5b478ce5b40b0dff81ccf1d9999e3b2c9bc54aa63dc922e2a690df44b4a77b7e0beab27debf700d6691b78e32a4bde4f3be671d0ed2b64b5d39b5f2320dbaea1e95dbe7ee8144801b95bc42e1ce7f983881349bda38f84ceb3e799ffd397c03330cb5eeb6f1c032d73ec0ba9e4e1dbbe7315227115be902a97b774ec3e87a1b1a0f82c1c095cf13650e65ed186e28ef40bedc08be2c0fd46b049cc0c39c7acb2803afff4f46fdbe073386887e9d6615dee8acaa81165de79fdfeff68d945a90b6dc681dd366a24d12af416806d97384ba165657697b29ee4e3edf92fdb7375ab03e485a72073627e5334016b3a7f40f16aa80dde27493a6abcb9cbb91b487ca3dbb21c9f02e28f7e9650f4eb568b3c9c",
"4e1438410023bf9695d471353720e2a700e23687bc0cfb5f76c990319a98e6d58c49aa89bc3a0860ae13eedcb69687bb3a9b4b69cf2f5a1beb06dee4512e4c9c0aec10db12ce34e97e29cf2e9c51ac74440f24f2b83e76000537b7764cc403455838f791d579631823bc9c58d9d99489d2bbe718d80b50356cc5022901e7880f79b60d53911932cf77f47130b234446778b52ad14522c3a1da356d8da46b244cf3ef4ec53dc1d3b7b36527b4a5298732aaa78444ce022271b45c9315e5b4ab4d95170619442f6152cd8329f5dabe61a28e4105582dce523e220eed5977f7ccab3620d6e505be5eac384dbec79146861e9c664ad2982c3509076dc67be9c492046911a33d79663c4cc2ccf2d4c526200eff605217e44cf35c8f9c5569ec3904eff5a528a2ff6e65f4676f8801a8ed77d476aeec8e5fc5dabec33b7befe4f6bbb17dd75a9a6f0e88a0c0667ed0397c52adfe3213f286c3e3bfd9d7af189c8c2b2978b2837b2b7a59bb9b946a98e7cdd771e489e3a6ead1b959959301a2d7119050",
"8c110bdb2869fbe144f9ea82a6a06555378eb5c5ff5473b6d15b54e5c0111442af4dcb429276440299c424fda9fdd8fda7bbd4eeeef66a9c1652c1a68844d691ef91a2a5c7f618af88b8471361aa91a7df89dbefaeeb2e596301c614c358270b397eb94b609c58397bd7ca6348f994df52ec749204dabcbcaf015dead4399df118ccf2fca1e02f20a4f16cb4ef04e2289bf2e906d9b4acae7db719f58a97990db75aa36c5a5d5f522379f7f52c7a999305719eab0c58f8532cdaeabe8349249499901f4777295b655ad0193c8842cfe5b975c1c0cee62fe2e9300bb377fb3b7462e5937f0bd642321596819365379cb6bf51a3f0d3f448859df3921608f80f886cd34e582ad5a947b554abc2d4e25c3250a1922da7063c6fbb69973bffcd538817434679f99ed4ae0a22098621f7906bef15c8560fee31594096849194b18dba3f7fe9fa8902668b3225f11acad8b10f57b0fd5f5dcc6d74cac0a040ea6f5474c7a79fc465e81f853874787d64796240997c85a7ba9646ff995f5accdce85e78",
"8caf3ec11af85cd2a161773e82f3b3e7cc38ea3781227d8dc8049d07ed01e41e9db73966e7c707412bbfcf1c0792614da97ae9c39156b4da1f0c7fc9163dc585596adaded142acdf646f4ed7f27d2b9cd04325efd45cd2d1c86fb26c1e5ca73bbdc8b76e1a5f6465ccfbf9e5e528c9cbb341206834f235b94f97aa70c3a944dc6ffa15db164ea9a114079fcedf38b344a1cf16b20de1bdc97e32674f3116e0c129a8c2ea51bb227ecaeac35e6b100c1f1b7b1fd65b4eba15b629032af21f05c33f1791cca63690e05bd9bd04bf2f87c8ca33cfe5674eec3280dfe0523c90eea83622295a3fa362389135c9b9092bd48d1f3b90ba108d782eaa42c2cd2342e964d649f4c820c23b732b1abf6676252a32f46dbb4410fa8105bd4016f32d2527772d4ab2f0e0e169edf91440b3952dd5cceca0425d877de6a56f0b899f5cd20579b185d6d6642beaaa98f5a715a0556ed9e7c7fe0a19adfc36494e5cdf606b7d856796dfe2035f589c3344c3ec9befd74ed00f2845a36d6e7d7d904c530e379dea",
"56a6d09254c656c35eacd50b69acdafa06935341c59216cbf2eea84a678abcab22fa17109512a46a30e1721c6d02cf103ea31ab154dbea1f9a59385dc415744636f017ee1ee0304f37e034b5f397815d58b386b63882db8d06c1ad5cdbdb834433b5349e5da719f56bc7a9ff58f3d05aedb810704ed34f8aed26546bb9417a89a994532cbc11632fae26593e090f6f9035d4a2df06584175264d6ef004e34b4a98ff81126579b805352aac5e5a6a3574bcf88f2fae077adf7e66a5bb8e8d45d28eecf89ce0253826806f7bd0f27a5591e8482101c244e5d518d0285ae286819576cc00f487582f5fef5045bc17e245f9f13a4e6c6dd7b92554daf948009886132719cd7fe3b39d8020396e98f0b19c2e40cc1e905d306d74217972eee1d37676238f21efa4ce41d1afba1768e3976b909bc5f1b2e218bd36959ca3610795c6e7ad31752587627cb379ce9bff20d9501bf5f1aa5e5c16f101df44a6c8845fd7b3c89879b623a77dd1271b586b0982cd67388c3b1fe4a1a84f5dcc48538e19da03",
"3b07f69f1196cd797249b4de7aa4eba49e0cca5dd79633385740b65acaabee0b164e755ce5dd2a3ae78f017a8e63485c0cf462d2d5dd7ca82bc6412c5ac6f6859aa4482a4a8db4c4922c35d8572eb5946060f16c8b4ceaddcecf9c83c5adf18aea527631bf54671cdd482cde94ea98f3400b452e6beef0637d4451580255388286d940fbcb26592daacf30452b886aae029798fc834a9629e425475a1c3fa74ca5020b126c300ac51e1c1415b6800f9eb9becc83b7d5a561d867fa0afc85ab55e8ffa2ebe1177bb47bb8a2ba38579636843c3f09643a84725c203154183af437b37cde023b89ab2a1ed997263991d13473bcc6dfb02526fdd7f41ccb579d5b76112219607854e63d7b02ceee6c36435eb2bee7ae236caa572f3323450c2dfc15ad9077cd79b47ffb45618e2483f4ab5b970179a28dfc5e1f0a25dbc45f6e2b95d3752cb73c31f60212ee763242b1bee98524630924665a917b84646c0bf773829c204341b17416dbd0281c22d33f2ca9b16ab2946dede71f8b25668c22fc1572",
"a5b9a39ee692971ec6d6bc5dd461c54dd118b5c2e604711caea4b40b258919ba97045c13cd767ec0a94254113e729469201ae2b1bdfb53dd5ebb59e9640a32ecdbcf8ad4729ee7e3efb91592fe3847ff7fcc6176a808db4c7fdbe4318afa7243bf7c9531ecc315c9eab2d4aa30df61e6ba4c1473dbef58b486bf38ac9363a61f660110992829c0b6d87ee25c82210f235194587f96a067c3104026439ff5a7a8f64823d35d76633af2c4c33290133b06c4c1ca4d4db7f090cba1eb30da6a77d4bf35b74738f135a60f0fd6af9848a0d51a868deb6f222cd05cca8007e3deac0a2946c7de43f194a987f643c6dc91fd5ae4672a38014c891d3e67db3219bca8206e77b7d3bd2fd84032e80c280b2e9482b4e6e6c2da9e132732cc47b2b633b2888b6a6f1f96ff3579f0df2c4503d825daff3cd0f516984b2a9269e51549558a8fe766fe816a62b7c462adf265bcef1f89f2e281e363768bba819d22674ad8881fb783cd395f4611a881a1a469b4135560bc694e67445c4984b9fbec9c1e32c6f0",
"6ae883471ac6a97b9d4a99f41e20601529cf4c06cc6a4d746fb3cb791b0d9504efe292e8e1bcd2907225f03f9fe5ceb41974f01802f840e619b1e2c13338b55abbc2417845b02cf5ef1332644272df1fcc0ad97be9fc09dc29f9fe866c1eb2eb2b27147cb647186678cef1429a3b0e67005c4855119c360ded5e4864b4a80f0fea80caf33e4fc27b1abc81963b06139b06f38c089f79f2a1e9dc24970147442a2a1c064ec013d5d5177e8354e1e610282a7513d2d04177a5b9223d300158bedb35d579c91af4150841f7be2184a32813d4b2df0705c7bc0c86b624daa3ca395646745432500919c6f8431eb6eb8f481f949cb2c5be2d9ffc124165afcacb4082f97f518f9834c77b8584fab019e1cc1002d86a8c3b5bcf2bccb3157103fc594326858e10cf8c90df787351fd59e1eb7c31dcfb932cd5deb54e066d86f53107210071d9ce167711a1ae4fccf33bbda60377fc9756f034486d1eae1f2df3ab10c37ad2beae18ed4a89905ff8609a220879145b569f201edf18b02edf67fb8f9fbc",
"649c7c6c5ef860d78eccf523d0c7cfc3dcac9dfa91abf4691e9ba892485bf9df5cf73db22fbe176a1b4e8ebb7aef617f6e32325f927c0a5f44c41304202b70d072306c3648f506a80ee9610692678812a777c305c956f7d73af5c9e1aae19b6b9b5c4b5e7f6a2df4ddafc4da2cea6d0c2143c92d313210b15ffbf20d3cc26a108aa4379ed04cf6b60283b0a0541af1332549122b6c041943a157d7cd3df03a242aa2b4482281cfc272344729a6316c342847554b6a10f7d257c30c0b19f75d7949a754b187cc29a6593ff494274fcec173bf2a187413b296c17fa27ff87fd713ac30dfcb864d07ed2749639382666a41e278c8106dea0797a63c0a185977e86ad72e09afd841d79e4d7ce69f1994b18933632d7eba2cb768a1431b0cf60cb22940d4be6581d26661136ce6db4b14c7860852b3212e0baf8a600add573212d4f7df386d0f86b12209f4cc4ede6742892435b47ff27e98dead1c2d4bcd8ffc93efd1bad3f10e3ddc53c1ea57768b4295520f81c867aa6a5e8e681f705c116bde7b",
"ad8c9bfd4cf25a482ef90ada72a0f0858de561d14c47c25a4693a2176a976c43518f0afffaf16a58b7e190aae5d596cc6350578fcba70ec5bd4977a10b54fc05c3027fa96bc0727294bd67b2ad7c1f965f76c8e85808021c7b24f54165f3dce007b153ad376ad819bd30d90f6035463bdff22eb8c11f80aebb413f78e59bd322d3b9ebb2c13668cd94bfd00ec183c1d1be05ad2faf376b92dd6aef8b151509f5406dc507a817e0a42792fa5af4279294e70effbc7892e8c1bbd614d040cec24dff252495d85b2170206b69eaac65c3d99d4dbdd4bbc584daccdcf2dfe8eef7a0c447115d30270f4afebda47e6479f6095ad3e204a0117143b5901ba809f1a6f73a0a23e9cbb1d7f0826059095b0954c57f18209f223f662286c9b2c098b2baa855e2df4124276b8585132b6f9e902d99a65353b30b9639df2b4a471ea53dcd1d14d4b60df94387089b2e2ab73a686bfe0465c80cc28a3db0f16c1acc5dfd493c6b0d01a3818917a76c210baf2e766d665a6bd155e902ee4fd82c65003b3cbda9",
"2f17b94ee519fa45fcd2e83085f034398cd14c88a0b3514819e059dfaf79a61ee1fb453438c65bbbf923c8fe1860c9d0676102536081eb5aaaf5fb08c8c895fe4d5fa3750f98ef9c1206c76c843e7785e90455adc60718f2d44b2836d1dd8e82381a0bed7d48a71f7ca4d92b4be730364fa6ee861395e17a615aa210597a89802136838f48bd9917ca4b94c6793b3067e22aa746df17311dcc6627cfc5f9b3cfc02829f49502df3559c80555fdcdc96504d8cef19ec6e825bcfa26c38274b7ea69ccc575fe47d5aec12ab45657f458386bee8dea5dc823729c5f4d3fa82d385df98045defdbf6ab984820b039ca1bcf5da955134808190f1ca4dd60e0d4382fee155b86eb680a099c870dac75fbad0310d0743e735c329b4ceb608a448afc1a6139bbde7cf828817f79cbdc08ba871cbbe7073061ca337253bd19e4798541b1fec54032f291045bea57a8aee43cb6694774426f21ebe049d57c4b8be7e1dc395357fa1112ff49df86af49d0a96f6d24f164116f54cd2556497edb26842c4ab1e",
"33353a5e6f8062b183d4ddb18e718f19064b633ff8e3cead3ca6dc9af875110242bc20187b288a4c21d644188398fc3404195bffbda41adec3218b18ea8d68e98406cf6a91c203a48be073fa337b4c0e94f7cb8991d0c0ad047d147b1b662c15bbae49695af8d861d19e573103754d5a5789d7a84c41790b52f816e24b0f52c77ada15deb52b1b463241d734a4cf5d4b031d8473502054f5291d7a867ac0b2d7a086602014da3a14f4d25379823c03344475f18bb17b67326ded6b93b725bbdf7e7f8df5c6e7b865bb26ce989ba75a93873d3075625d882491e7bed188af04232f27d4650375529432d7bf4a79f83e0d0e1b1ebaed4852b8fd317819ae8e871a2facdaae876f6c8927db122e724ae82f17ba571baee771e634f8f9fab80e202bc51d3696f9f8838686e81fe0cbd97b56bd5c0947428a8a248ed2f55fc43940fd80cbe87c4963bd31138c3ca40e07494cef295e285297ea9a3d6d63475d1c8dae9f820e5d6d2d761e248adfb77b6a9ff6d74eba607690cb67fa78a3dbad573774"
},
{
"25c247f99a2ff5d698ed3dbe4dde8eb4913230e13039b2313dcd0cbfa8174f8251e1fb17aeeae360da0cbfcdc708751e8424d47e692e48ea06d4615f7bd8b71cd2ac1dc943d5ec2c35e1585c8b9757026a2e103e22ff6c2bbb70b051e83ac93d810892a38055f03ff90d497278738713aeb671fbb6b21cc23097c5d5d0d49c497ddcec611778d905ea635ecf9c500b351d0c09aed6a59eb33bc461081841ba28e0eac4331e0222a8e8e71b0e5c06addaf46969fb836b872aedba9aff01f2c531b8186edea77367df9c015fdff69edca843ef24a816a0bdd464ebc7f7b20ddec2b74f9e856476e2d9dcf6efa4c352439470b85cb1d4aa21719a035dde4eee22eaf6743874eb7ecd93334edc82957cdb8e1d6f56f731b6b0d5019fcff92cc1db18f6bafff146a9e9bfb5242f63418c716b5081ebf0c819bee15168e47eed4028a20ffaf9a762148384fa76e6c22f1cedc9e182588ee887dfe668c30ac4f6f27c4c3ff3e2dd73bf7ebe1399b5addbc6b5a1ebe2d97134fb26825649128879006fc3dd2067b6c681abb678d186fd97f23231a798afb640721ad9b84fe5f51e712a5155e7a4333458eb145b67ab48a85b5eeee2d1caeb763a37018cd7fd5e7cd41f8965b25bb309908fd7532b5e636a85c7603759c0707ab58de6eb2ec46e9ce1eb5cff0861c1d31236735b01e9d6b83e0a2ad42a47aac91a0d0146db13cd4479c3b0",
"2ae6d937589efc4a871378fbf6463378963b3290002fd961c8fd52faf1909f86469b738a8f644fb3e9cf414486771b6947226123517046d8fff8d9262a99d3ae94012b14349995904677d387e4a12b334bea6bafb0a255588cb764867cdf9fd626b0c42f76e4dd30c52a691209a830fce1434455212053bf6ad91d2c7bf80dc79c1c4b0157e83205867a00048758d7d136d98391ef20748fed0aa98f6b7b88e0db4981f0e9bbca300a50314e1cafb1f26580495a2bb3f0f05860c6dc6e7089c03bb58e29ac61a9084827570b95d90f568670d89e9173a32d4e54dd8047b8bc04d21a6bfbb948a96c64f74dd649bf3c911fab9b02697b3f7475f45ce017c696da06a2e955e28152fea9502c59093704da6d7df963cbd94c42df9ff7fba89e7b113f1e3229887c0b26f7694d1cf694993fa7902caa92f0ec304796488cc93f789ff28f6d122c642a07984a6f71543c8edde6c6122bd1621de349ea2b67be2e87ec0142f13e47266eb5f04dd122c7377bcb6ceff922dd74872f091818070fffef24618b27b12827cebed74103de9b9e0091ff2276ad2b2df0d1906b7228dd4c8b1fb22e75dea87d6cb59ae6eacbad6ddee0de44968e8b2450df327c885767e219601c91702caee6bad1c28ddc47abba7723fead6992432685665dcf8a69c0f5dd2275ff551f13c922f908c9ca647fa985f05c4d890e9bec9821c040d999e9e94d2b",
"87d32441d514098201ab4c4336599292deb59dcc536e35af55032beedfb6dfe9f55fbd1c9eb088cee1dcf2487d355dbf0c392a98541ca3b416ce2ab176b3f7b031a27969f7a45928db902e1b70677a1706e23385cfeca18f1028aba3f084104e4548d1f1c4c42ba2587f59278962364c67da15ec5ed0863c91bff4ef5b6562bc74197befb7a1870e9eadb90002ee274490266f7dd7ee832b818204c2d902cebb03502b3a4b43644bca905519ab789c3b01da27065060afe3945d372878d4e3dd954a7fcf75bc0772133b6c22313b2f38623caf36349e9ab290e95db7810254a0e6aa57db5412b9b10d08850a51cfcffcc3f0013a524d12c5f6d431f5c679fd2f98404d7db8d3f67b65a06d5f57e4aceb8bbb060fd054a79bdbf1142b33a458eabe165e5789f075b698c23abd044eb31f4eeaf29c5f8255a157e81ffcf57bb856173ff93bc51c889da065f14f8308e3587bf01ed3a7289059db19b7ea43d0c69194bb8b40bdfab94dccf80b6fc0903d3ba73d4d6b2ba0d48acb5a7342cc2e14714991632c8faaf2c257f9310fbed2295970365e02dd6b2849ee134f0702b86d350a32029722ccc2c77c76c43793253a2ffa0ac83c07532ba956132c1cf03a6dcaf128e498eb175be1e5a70d1573b1d4cc93bb924cc763a62d5fcb06c3522642433b36e866fb6c62808710ec2dfcdde7d212b31bb53cbc79de49132c60a90d2585",
"6aa3b2eefb2ce0eba604222fcd9306900db019877bf5b0324330fc784fcbbbfe93eb01f5be964dfd2318238850e5197d43a973823fc4b9d596860d4ff4bc4a1f403facf99275062e41c7ca860baef4527944d869a513a06d960f61e272fae7a899f5a133a02cd20f45aa9abb7f372cd69121cb9f3c0c512494d8f97ad3c9cc1d3a1aa3cb29c7d075218a56be1f01516450e41043df5b182a599dddadca1eae1cb2d7aec909840894402e8b6a0b0b56677111688164e8df904c0eb06cc4a379fc0f25fac324dc3d3d4ef6bb2a59b50aeba815e49dd74ee19e79afb15b07cb09151aeae0dec21c052de0ee9d85870bb8e7269478edc83204c3008871821622aee87636018a628bad4e6cd9da74ca2a1bc900c1ad34622e1ddf4d13656b84936692a969759ea95c26daae786c729e90d3ef2a7672fedcb3572a93dfea2735ee38d033fadd375245c0a2cd0b60687a9620aa64105f4131bb067606742b5cf016966ce8079b317225238edbafbcfdee2a82ce19274bc33d0a0bd8b3bfd69987f95a4b4a21edb3d70dbcdd6860355fd62e9876602403eee8acc79cb43a7a58362d648daff05611f97e85f3d351365e28fc4dfb328c4ecf6c0c88613d5bcc21ebdccaad2c0c62d4eabf968b34036617e1925fd908b0bf649bf2f202f7e5fbed6c8f4e9605afaaece19c1ecbde5a5304121fb537debbab9721b0b9b9964d8ab2b8cf989f",
"42681ac1828fc86403b38e24e2022491b8aec6c75c80fb3f6a96d8dc7df5e2a5f8b9bbb3ad6879cd813a71eb2b843b234d5fe76e2085f8d82e085e4cbd1a05a152c806629226f5de8534773c15b566e538c272c8ead0b6adb98623f868f54b765c7b0981ef9136ec14b42d798e1a041b2b8e7ea74b1d4ba56ba64a926419c5c504d6365d7f64f3ce6a3c689f67c4fe1704fe2373903ce63c07aba67562bc2be87a4883e20be5b0a3ccaeb90a97db921ad5e68cc7dd4c9cfb5ea04d895e32a040a841b34b78844f2f6853b3855bf489c10919646a9d79c2c4690ff7e32185c13dcca66e214787dd5806b492aab746f35ea9458d7faabb35ad45ec766d430096a20e5168ede4c636e8df4a2b99bcbed397c476c8db9abb1135f1b95fb022fba03a6bb357ad7c02ee2e6fc3bdec125425185ce4af50c5adb7175eac5f769378bdc95f1f1a06d24199dd7f846588176172e42e331a4186765b2ea9f9c8afd72a95ff35ddfed7f3c80e2e7a2b5b6d5e63ad09fda5759548f78eb1252f3185f023ca3bddff2c12cd52386c4cb0444e2f0bb25c62102e4e4defaf216670f953602435d138d1c2f3e6cea5de735d9d753b1e073659aed8dd292cc15ed56d6169d916d18fe47d31073f38672575eea480e4c6430dc460447dbddea2c08d92a06fa849589563ede7b37e16bad433ebf9e2e5c3c36165732305a27a3a9acd5999c1f0b92507",
"69c816e55d6b3b3bb442adc908a98a0e07500af74f9b63f88f4e3127440a43268b66b6f5284695b9ba22ed1a476f206c29f15539f879bd451ffd40fa465cb8f306e179c63a5e9ddc5c6b715d3ca8cb5cf97fdb0de4a376e0e8553d4e0f865e907606cb1ddd93ef3c39fee31de3e669874494aa6f9c56532d3a7a899c6b6cba958e8602ff27a69bd1d06a819c6e6470f0fafeaa26361e0ea0f60f70b94a15d71f8994a93c65060178b078c144b5363c8f72c22e5073832b35e0857d6a440b3af20d2769459d05e43f820494c8add81b30dfd936a3db8eefdcc3fbf0887608fdde38e9adb300a57b27f9c44764cef49b49cd6da0e9acdfd5d76feaa8acd12db571d537ccbe5dca7aaf73cfdcba93c63913c156d2f3f5a253f7d8baf1c40d9904b4b44b36755442e42c82ba54838d7703bd6256100da463948af5a990fc0680f2dfc7b8741d85afda74445cd1e0e4e319ce7ae6173acb29865e8d94f2e0519ed3826f58714237dbcfac731652a120b900b81017663d3d54f610d493833f482b6bdad2d46b5d11f56c48c205b1c15851f7228f1fca4fb320c0bc4b0a285103079a3337084ac4e14b6ab2fdc39d4b447f5222a80caa33f015fb69f688ce3a6d052b57fedca12dcb176d2a656e6c9b319e399aa55dca9512d09d2b5c0d5fd765081334ed5fe27dad1e04323dd62796bcc6e8ab9eeec1149c20aea04ea39894e1499588",
"9b028d8d6cbd7ebf0e70d06f147943e0b36dfa5ca7c5143f981b1e76ceac8898839f107b5bfcd85cd9af5c27a27cd1d45ebc28dfac534de658b387d8c4ccc5a0d46de36df955bbfb3685b264156be333fff4d8ef8a34bd206f80ccccf6faa55548316938f68ad75fddb552c4b72cf0fb1728090a1ebf2fccc1cb94c3ada65d78dc076b5c78b6bb997bef8cb5cee6b138318881e56286f2b9d51fecf1da448ed9e4b03228e9fbb658d6bddb043eb941431fe0908afb80a90ada63cf92e16cc1af65ba8c4eeb910c32383dbfa140330605035ed1797880c8348cfb613525e0c54f82e6ae83854e0e764dbd1b502f19aa372f0dd481b1423869f1fc21cff325d0c643deb71266c991c175a15a2d3a0c6b04394f9dd9354e921546091995981fb3fbfc1631067c51560f10fec097d27a587432380db3bcb677c0c21a1762260f7fae5f6dcbe55e1dcc5d60f83ab3181100a2834861e2c3e5db2e4faee1a3da48fe94bba52f13835aef2ecfd9be1c3e8f0e8668bc05462d7220465783e25bb1ed20eaacebc427c209d2126d36b6509350f2313f0c2f2478c243555a3197d7fa9fde28b0dfb4341859392ca3cf8fd6ba6f81b579d67713cf9e9fefbf22c60d0b99f71228570b617172c8fd2d02e8b14037a1b6130e7c35126ff5df195033cb22058848bc7893b06d216b30b271a174b8e733d7563cf4b2d1b61f00bfa796d650f28349",
"cae090d065e0378374d9433f4cebaf7bcebca82a0b79ec21313c4906bf0fe1377aa32f49bb671db09607eadfa3c4d302cd4dffb1c14ea2f21fa2cd6b9e8e96a5867dd9dc0a5cf4a01cfda814b13650bab33cd0bf34a3a4b87c89833453f247475a7bad065256267d726fa413faf46d595277e68c70de02b73e9e4abe5894de75132e2398de941f6e051da9eafc66cabcf596e287775ea9b50042dc365304d110ad3311b06e0146096db49b935531c1f132d64ab42a84128d3389b031cfcab154d88e281f27791f17ce181d24cb64549f0a93ee760f19905c4da8095a12cbb01b8162bad9976e0765142654e7581627173bea35d9afd3682f0c2581a37c4720d110e368c558c220ea4ddde558e859bdb53b091baad2de07e101f56adb0a1a240f697358e8fa7b745de43e0f76e5ffd5da1dd3cf63c8136b001d1019034e688a960206e30e04bbeb37e70705504a8e6802cb92407d55ba800f7e935ccf28ede9053dd3ec564609b02b34402b64ecf013b40752a2f28945e37b9339176a6d86495899d4affbecc8d1812d536fc1c48b7f3345241d5d5d18e7f5a2423ff3749790459cb47d71eff579cdaa76d2117b531ccffb481904e711019ba50c044b4b8986571bd5c3e0c9ff2856993c2e59535e5b6cb070bd227dcf50149ae215c2f4290f4318720eb33d50d1a13d961bd1d907851a794d211799a6fcff7dda92abf97b22e8",
"7f08e819e3cdab1a45c3ee5cfd9c302307d79b831c7f4cdf0378ae6ffdf84d8900b8fe8cb89c3536a1219c1214255437da9ac5e2ed679d5677e370f301fd2c0c9f5327ea2494608337595e4e22ed07c8aa4bfc1600a368a3497508911f236c4c1bd7c2d2aefb744215acb2ecaabe6fd0c4bb326fa93775b438a8d5314330c24345fdce856572cf91021b6f75d407c4c4341473470fd84c4587037c59e02eb009287c0e51444e397876e2bf5cda80a01bbdd5c7a60c6020c36f3799c89fd2b6cf5dcb94a33c7e04ed21d6ca38144716bfbd96b9f510c5d701e56a0bc23d555dc5cc53e80806905204d867eed6aceb40bdf663ab2383dfdd1db48d6cbbe0005f69b24f19f9cdc9af34f7e5dc18f9cf0fa34eb4eeb6732cc05c342e33c4cf7995c6478ef2f64f018dfa0f085b1a12b179c3cb5825633189bb4affc0a001a7c6b8bf4e4a047b637a065974adbcac3cefbb4210acd73afde18c79dfdb1fffdf916b30a80b3ff82d39fc4deaecdce05ca4fcbba7d5c71981710ade126986fe48fe4b118f9952015667be3fed473c362d273ec3d3d9d260dc398d892bebe1c13af33cfe323c7b13710e1652fb8ee5cb4c0653ab2f47d1bfdd217e30d082b9a27cc1f1785c9826beb53817b5c763e217aa06c72319bb77b47ab30a0c58d80eec4b4bceea9478ae1a35277c61ac42b0ac4b9700d14e85203708b75680239a6d50bc9aaa7f",
"d17c50b5b0526a1e412d793b364a3cc690d40b5ad0ebf627ad469ee01af986c51fcd10452ebd90a4657aea9f90da2c9a9ca720f082b012a0bd9b7b032e53ff0cdd627586025728227f9894da05d74d381379d3235833fdc028b9b30dc7818ca2720826ea4404f655f10298b62fe5cae187417e9773f2b2ec8af17ba3bc09837dfa7767ae48e57f4ecf07dbe3058d25f8acd4ee784bae85435fed18297996c6a78c9616a6a920e524ae3d61bda1254609ede681b807a7529db1d5d64ab7427a4029d7f8b131ef7072f66a302213ed13ce451da0c5b98f90e276d5cf675c9fefde457df91c897f77426db94633e345f3eac00c823b621ec6eed45a0fcd72470b4cee83909beaae4eb41636ff14822dd74417b0447316ab33d1a4cc7a7bf0253fbf812a17fad5fa63ebd41eaaf7abafb8f41b096831def95ce6eca029114914573b8eebfa96a296b7e6bcc9fad83bdc1d6ecf3e6b22ce9f3dc87a68ae918b7daf98ee9c4e4d7ada2320f19e9637254c72c29df2722cd9f472f421e77419486fce49d5dc7f4e14224e312a28769f853a2b2be73dae99bd4ae4d482af32afacc581a9f349e74fb1729eb4706ac213493e845fc37e03e4f234da3fba03c620b234889a3cada98fe1cc0b5f5e108e5c0364d71913fa7c0b42215788df409250f3cd72e822fd66351ab2d960b6c43bb36a5c8f3e627a3e8062802ee56f8ff7936a52ccf9",
"83acbc8e1f8217b7a2f36b57c62429ed7a31f7934fb19836560a6ba115174c4d587d73564a7d0d49dd40cfc46c52e59e46ded247d9068ad8ede7dc4e7acedd6c22316d5e6c4ef57efc986f75236889e71b958ca5c658a6d1d90be87edfa941816da92533c85db67f4626202b7dd0f5dc9b1793a74186057cba6f277c1897612c13b513905898871e276051ae295a77f708713246f72c7f0afb8ffd39cd37f5a125e0dcd768e30869f838cda6005858e7fbe1dbaad21d575d5c6376b7698a3afd3a52a349b3d88667e0c2974dcd559470fef4777168484c2177239dec43f2c2bd2f5682cd89150515922907160539901090fdb5280f8b1070a56b3bf3266b9f90f6e477b11b3de9c731d77d2ecbdf5a9235d3e5ef0abb44573daa1d24ef96a65ea40f0d2ee5c4118f358662035d0e9f0eaca3c2fd02175a260754910836521d72994ea6d84f35edd7cd0c61de9404fe6b2647ea6e6ecdfcbcddad2879da89b0161d972862bf2c249cda8ef2f36fa5eeaaef14f2d43f29d83a2a6352eede58296baf0505a4ec5f15931ca4df7ebe3d84fd9b6462dc6ece7abf37ec73f404838e296a8829b27d75d2fb43bddc2a4962ce7f057106d77eeddc64d116b0f4964a0c7abe52d517f6e51a99a7a7bcc88ebb420eef2e4123a1f5b678e8657fc00fc7e97ac6dde190c0f14887425c30edc77ba6f7512f41fb3e2c0b0175d7b75573e3d332",
"61c807ee465fd1d825ab5d99724b659bd9583fec75cd164539772e74652bc61e53e4b81021ec44698ae913ea0b6d2370258ff5eb2894e4661c250cf87d81299473a46e8f93014b116c9f7fa0f4b89f56e89b40aae7c41443c28bee1741ce586e6f2bcb91715447af4e7dc64ae843176f3729ac4eedb88c88e46301a082ef656bbad3bae14869715e317ce0ff1e6df00285aebdb5ea2a1d1d564fcc67eadb2364b7b73a948292607a89c821332b19d7a48e0ee29eb23f019159310eb613f33e4a26c33ba66043cb84efead979dc2773fff33c6e2d105b8cc0692bc706a502361dc7918afc5e84393a703880b80eb9424d661e8be14827a67f49c3de2cf006ed260b9cdc5208e623cc3f6e4db25b3e9bfc7be6c0d7f9eb3dddb9183129bb97c339fb759936c97710ca4f5e1cc524d03ff9b03a5045d15d951e739c910efd9ea2edf7e42794faa188bb13797dd4757934b4529524a328957d655a85a3a888e8d05f6d9da9ad454dcfb19da64ad35a73fa7cf8ca827ca8a3086744306eb680acb430d60fff150494ce1b1702c10b53dbe49a2aa501916a82c7ee72c2fff95f063d00cf572bcc94ec0dfc8d38f6cf6437a1802a0b78c45abe654c527dfb97047c9ed1cafa37a9c554997778072475e517f765e71df8af222295dc5515fefee1a283a171333df9cd37c9d3ef697ad61fb421b5a10e368dcb98cacebc9a34a64264fcf3",
"9fd63405dae6a2441ba008461a2085eaf031ee30eb710f9b35fb469c3d2025f79d48f295110f7c34da4aa67459c7732a3e55ada08adb96f679c636a989aac7d5e906776fdf27e86c071f2563ec888c373fd9d36b88c0e10c2b6e17ca4de602ebc076ab6d8545b56b1e34ec7fb3f81293d27aad82c61e52939d41ee0232fb3b554114548fda2badafa6f07191ccec84b60a4c1117557eb45fcb763bbdfacf81b4b9cd980c0fc533f1d1afcd6fa807a26092e87004172492b1f33ba43ccf7d3e17c3f4becc7483da9c7bc0b66e85a3e9ea7334e8bb4e9b37e1cae13fcac8c290f1174524057e56775817368ced1353f1bcfd6ffdfb05ed5ae839d7ce222aa60288899517ed8d3280090eff7b8e8a80b8e64365680576c8e38d3bbfa895aea72de300af919c7bb9fc867fd3122527bc3484c7509b0c889c836e713665362ea5ce7e6259b4edd336a9d1e77c54da3cb22cbb25b4e747b4f37ff1c9896234be8e34d0d2536db4e9b72e7127126e993ff03182afb0f0dbc2b4ff590e5194933a556f4c93866ade236cab405e0b5f75d4c92ccf8f2d0d690bee78321b5d0a813bf382bda32710fe8982f07fd6362c0d47fb623bf5360abd1b1d7f326ff0b65e92a75944c9c55891b5ad039da8c60ae03a584b98f48cafa9bf06ac70dc54b01c05a615e01a6102b2124cf212ae930bf0be4d4bfbad6f24922f0b79d64265763a472592df",
"c76a2cbbc47fb190d4573eaff8ba3015adafc543f96265178048b76e8735f4a478c764e49251958d8686fc4a814ad317e6202e44e365027892db59988aa6b3e700d18dc648a44b01bb267cd3ee637a633ebdb6cda742564def52988d6e23de4f851aa4bca4f23fdf1de705c8588256a8e15e02b855321fd1bbf543f560e0c64f3a297d384fcf6008c75573830a5fd8264d9b8990d7eba392d27fcb41d70f8ba18d48938a899a1a27ce2aa860ca7bff3cc412ba871b05c1461aac8c3abe9c3ee54b44babe0968538c4e324536f159c3a3e16010a9314c747f1ae325f0dfeef5c603012adc0ffc5f718120c229fd462c6cdb9dde8022f274285f86d44bd6eafaae4877274ae417efb1bff6ff781ca1ce8e4ca5e0878565ffe91c2cf217582d75fa66b994615e7fc2eebea6668e2f4b2361c6fc3c14196f76cfe6bbca6678c7bd011ec8bbe1881f553938f0a5a8596a59eee88600b6cebfa2ab9e8fce27208d0a5f528f035fd9eb578dc6a5e4aea2cc6b1b5376cc914273656f7f268b695d02ccca6075b2d95682b78895a4f9967d6a4e0a52a84a74f2d0df95380739187a534e3f7cb9bbd4331636306e83b8c87585987934d4ea7e96ed35df8ced393940b2bf6a31ff1c972409e80078f5dec8a56616e17151c60e5eef2de57a701e41fa0fde22d18fd5ec5d7e771bf9dc123aa847413470d1cf8cf1433fb7f3c7fe90c351bdd1",
"ba3f84960eaa90b68006c74f70dfd6ad8c529399cbc6b4f101b16ab90278962539dc415f62d26c2899e39d34d2770e53747d816e3ffde2c4821737240d73a429e832e0464b05099437704f9c1a50e80c66dfcc0cef4dfc810eb700d559818af80ed6aea540aa917b6a83e163ce461298ad853dc2e6b0127e16b71acb6278511cd17b2c9320dff8e7f3c18e64cabbda7e1bd25dc1aa4972017a24e0cb2c5502f2f5df339a831f3386b54c5c8c8d5ac70e17c32c8a56dc927771e9cfd63413bd8fecc08cd3bb06bfe5233c1dc8640c4c1a22a5918617af4573d079452a4ac053509f763ce3e2d1b1ed3fd37f47a115318c16623869f299ddaa63c132a7b30fe8ffe06045efd70ed825adf3ec8e0a4917949a9b17e41cb1e375678d4be9151262920fdef1d75a95f9e7ca0779025bcd5b4fcc0aaec1b50275ed0ef544adbabc90d3ba774cfde6f5e3b8477fce50130f6352f31e4708bc146655670d3c7a0812b21d8cb79da3461c60f83bb8131ab7c1325cce5484fdf362721fde71ca50452c0f640750093fcfdee46db962e89a5e3b35a9c8a5b533f02ad193de622183a91161e06fd71ddf60ee0798406a19e464ee1f5043e8cad26c7e01be6c65ed3e87d4cd7226dd378bf150fb15869269d5b1d73d29b9683386d77da37a6855a76807e1b32e9a02f3b4cda2c1f88d0cd75c47d9dee84320643e0012aabe8be925f093a5a028",
"26dba345f2b1a20d82a6c19576ec3c2c4811b23234e28d3cc8a7ac0e930c953c23860a57d5f4457de6c7a3293500a11cff78bc86d4ea6c50b7ba00080259527a9d0fefd6048c9d85aea4b861d05c4c28deab10ba2655b1775092c44c8f83f9f58eaadf29e8658df83ab14057e77d31a32cc140d4774940ad11040b4f00f4262af1de68bcde0127737ffec92915a0e50d04af7ecc083862235fcecde903d472c58fcdbb8ac4d50ef34aaa9ecda0772390a2ae47cef24563531d56df485160fd9bc158b1596f47aee8470d9b19e6991de3c1b022f0a9dde7853dc4ec9a816ec5410b5b1acbd220ef9e4424092bf14caac0e271922555b93cb0b0e2ce07f37995f6da0a44cf56da3989b02d94fdee7d0be140b8ed25a9cb3900c501aa5567580e95f2e9ec611c706448bc868bc7cce31449672b8ec13e2d6b2ebb42f1421877ee371248ba220fd76d22a691dc1ebd84a21ff9d538fac9461db5ff404cbe2bc6b27dbda9d0a8b7ccceb6af1421a4d4601f1964cd178ecb212e551bf39c42dac015e596cb3e0a51bfe9652783cd9930aad1309d220e31af6cbb5a15ee9983ef09ced622514508cc5bbf63bfd732e99b1ab23575ebf27f9a6d227758c9ec4881bea44159a53cd4e1420cbf743f648303330332867c10c08c159b68272fd4b1d69967e279c90d0fe19c0702d26617e8ab1447ff60570513aec5e0096082df666cdecd70",
"a19707efc8042dd0cb5d3d2cb862a93bb9799ec03c07d10a1d694bea364b53bb1766e48a1f25a22e9f7cc9b6d103db0dd1560b718710094b69ff61e9433e4ae1039600895f471750925b13e59f9aa394f8fa6a4d7505884ef6028f687cff7ad9d6a5bc9a788a7a43067b829496c54180fe0de8d7ce03edf4d300d07dfa1afe266d20924839ea636651124d5c0ac0aa9bd026d017c7138ebff17b6c9d0b1583aa6943b4e96cf1912ea93693ec9fbcf5cee6edf081bf7a0daa0acd185b645c76ac2c38d26132631ddd2b3ef5326dd4e6298895a0e1d096bf277b25ca739712c166cc4119e29bea72b2e87b5ab0e13b170007a3a440225164ff2fc7d1f0da655ca19c8b088d2f438067992d591d13a35acf9c54fbef1eb45528517d87b76f3b180178ff94368198f02d3a0f210dad5d4c91124ca5f5e7753cf65245016f51e22deca3087b98b00ed3801473d349af290cd93498b2b89ff06f26a9b92f94e2cdeb7643eafd20ffce2c4338515188b73ac2da53ffa4c11eb37205232209f13bd4f0c9f51694c6722eb2fdedd70b4cdd4a469e9a16717fa56f3673da3d408a89dff532dd0e4eefac9707f18a058615e45594e727c25829bc4253f6b627aea39d4fde65a24d40d572bf8d013479d56d67d1cb66fe8b0b73e0e5b3f8fc7e5383ecc5d551eef6e7cece73775cb111ab67861fc11221b08218f772d29ed09aa4b0f3947ed6",
"a60b21235ab86e6afd0a72ab6cc5314c006cf8f08dcfd37ef1f9755848094b63a824b3679caeff188a349b18f251c87f369d7da9f11bb9e19b1edad3e3fceb7d931fdad46f54c42f8c06c17def94f9619a359b01228c8b9018c301ea4d497c42e0a28c413595fe446e6ca241d226187308dbac5c25506dc4c031af3ebc00fa958f697908e41a6260a18c3d19c078a78d80541e545bb3ec67bd0eb45c66dbafb9f4aefe6d8cd991610444f56272325924095f8154bc251c4e6e0673e5f27031543c01df0b39eedf49f1866222785850a350607124dafde1fb94f19613fb0f66df886912994961dd02b41a27f08b67bd37dbd5bdd7ff68e51fb3876ea605c447248072e4b410d977e421dee2c5937d9f09cd1c6c5c688dfc48ce44f3c0bb238650ab5c0a7c4cd852d9d5108ad8497a1cdd083d80797b5ef87af61d8d6ba0db9c1b610b0d863e9dff5a310b6d1fb1f7ef40b18c070fd23c6c7d11b1a6f8729271fc9e9d08ac5f2f7d8863e9c6f51444b99be4d2053ca3aff15a3a6d2b80a8c682ba1ccb9fecf97ddc7ef1993c38d5244f1591700ac15b8586ecf23033a86b90d4c6a086142643cad66b402c54438fc7763c3ab10324f3b513bd53acc217febcdb57a496cffe484ae12f1c59f7ce0e40f80d5f98d1267a8164f570ba0e841e32191e9ddc015d1342bac61101f26aaa2c47dbf9d2d626a1af53bc58665d6e0c5b6285",
"3d2a6a4dfa224779f30b267a78c22ca4bf08ce92e07ad3c1a46ea78bc585af1b2c9c8ad227cd0cb48d483c75500bf14e965cc4b62b1bb00d4b562a8de5404ca07be7e79d29f1489a4bff67530138cddb93333cca6e9c96ce1c6c0da801da3608110140955a96b22b7407067515c8e9a17010e5dff29963b3edad6fca1b1b12a88cfdb8b42fff9c57db14a9e334f5ca2204b16aa79caeb817a7ed2efe306120f799e01448a20fd8e6a8b759708c858d293f0dd23bd94f51f48c1f7edb0f1cfba3704acca4086b7c53c3051f424893f2ea50cc5168460ea8f4e01121a868eab15394e017a223adf68e6dbde880b14770d4bb6a1bb1bb10b901460856f94808e4b42769239ce81e535e4d59db02a64c3e22007b1021f26ace4abeca666f111c8baac1847af881452ae0c20453759195fe663f054fb0b5cf8a3878e3b5f3b563e09386e5b1f7dbec53340b713317759b4ed203be9bb36fefaad13add45570c52afceaebb5556851a59dd04420b39cd87f1879563980104e3b5a25293bf96352c3d182d667afb94d30056a609291efc312ebca1b53208bd648ebd09da08ece61ef50f581dfd4932acc6beef1f6da4687a65920a472371074abbc109d424ce4ef39c0d5304561c766e90420797b00e5a6c57251e6d1f6e93eb99c2079e55a6e4e32d8bde20ed7b0b75b70aee520b72bf667d3ca33ea70c8f82b2358ddd610f798df2a3",
"a277641fc48ab328df9162d39289280bbc0adb4b770e856e3123e970063e2a2ea6c8e1e457c632b21e63dea5439a84b911590ec34cd998b889640a26428e6a02ba2e72d2bc27c2e78ee039f6df22bef638ea1af5a9ccb89be8ada7c12cb5620fef079d24ee84b036be7a5fe3d178bbdd502e3484ab404e31c89e8440a6d92f9fa95dd8b456c19af96b9dd999266217d04bbbe6a170f8faf1f7a384694bc6f664f5bd21d4f40f0c7c329c5ed45e19d5c5445556daa2c96e756f5368eefbd3a39f104e3d2e1fbc72556f0a438c565aaaef93624ffbdcf96c5bd60794c66da15de69aa5024991e35685b20e0aa118fe09418907c792cbdb6793ea9f04bb2a8175674f829baad7a793e0ceca9554c53bcf6a364dca1df3e89bc1b093067e6e7582fcf8aa14e79bcad5182a5ee49efedea4a9e40e0a99602770a2809d284ca803e476af0c34af4d7ac45ba5d38be6aaa161ce0765476187b1566c1d23788cf6df8ef4384781d3bf53c336b2924f8f9a4fea771cf6f0caf4a3b538371c010c12b9db0e075537ff30910310e8d0617b16e40f5a010c269c12c92d160d01b36740780a7514bf75aa31fcf7d7c212cd7efb367d052648582dbfc74bd7b570f26cc462fb8c26d9cc465e87958ca30ff4a916e436cfe61b6900fecf0e1f1b4b342782cabf97479d554ee5fbec96549c8d0a79adec4c33847fef05426fdf45f563fc0c21fa5a",
"d058fc5d239b0f975fe10f3c3a6f36b0e9be32c9bd2e5c81d10d38c6d462bf08d70b1d8ce85cecbefa18f52672c9de7b152c93a89436c0eb5ede1aa78b17d07f3eecb628be117a23b5be3d5bdc48b6d50b864f4899129c3e917201963e063ed6ea428cf92b4ce358dcdde32f18e768edbf40c43caced67cdf97ca1133f8ba158b9b050ebff5bde22752b464e5740c8c6d990c44b291ddf652317a336ccef6e0e8a5f0811319c6d213fbf44ba637f8f32341eac526ea90638378956bbab749d75148d6a408b4f6c8974921bcd2274be693732e1ae3083d17fdc89653e4c22e846d32f9c18853ff03c7f3cc176175ebcccebcb760d995ab3f3c557b2b36b636382235729fc1dfbd88fa9c766daa351e0b0a4ae0d8ed63a01a45640361a0bb4056aae074e8ddf096e50bb2f49b64b20dfd475a1c5fd3860e5283bcf3dfabb952c201c0d7fecf79595267bd455f825b67f597238793b069512b65a5cf79a2fa6d2680e8004af7fbf65efdcf5912fc2d321c7b2bc969548c3da960cecd94631f75456d234ca3812a2ccad439a292dfde9fc98c1bc3e17262fdb0e167130fa8935efc84fab777d757f0dcebc76e85c8a4988bba63348af0c383a37b434ab600f80f295053e07cccc84575f8292645c2dbbf60616efa473767d47086710eb1fc2362e9784d07c314ba2d48a9ec4616e256ccc9dfb66d5444f5d0ede21c7bcf67c514683",
"8f8a6ec7cdf51e4cd4ff008e6e0086ee3925c1d1ccb7d5381f24ed7f5ba0bb466321b4ad6eb0e0e8064a73bc748f811b239228966bc3b6edffcc7ef669a6efaf80bb7391697533caaf68a78b15206747b4c26d76f2ce7d5df098d66ad9346aecfacb13b9e7ea32d5bc78ba9296f9319269ad382e4017960b2e2e448ddcb5964faa51395cd45a0738792861ea78791f36a5f353c6a7ccbf50b8dacdbfabc031806d603545b077b948f5e6a51269d8ced53257fbd2c9522184888f4dca8e45c41ab4c0100e0f0170a7fd52785e8b2d050e70735bfc5816733aea65de86dd4f385a208b8002b0e9463d3439c4424e0c828e66ed98476637d8ed82978770313a7f5b66cba976b9640e2c22805c1132dcfca2df0bfa54679c2d5ec6c5dd28e3438122d6fccb6282b9ee798357d4e3ae6b8398e6f2f067b8095b09f1cab886d8d4b2e34610a6a36cee34b1b0be034bac400f9a3daa6fb43a01a11b16ee98c74c55c37bee765fd5d5095b75b5caded753e3d51873ae74df873d2d837f8fc61a27e2f73413ee262e214ae27e80bab78ae779cf1eb7c71a4634068040fe37d32250aaa0ee061a1b9b095ecb78f57bac7258577a4ed86ef98023e2a88d33fdc07a2d14aee48f9ecf9983eed38b2f11268baf0c7382c3b02a8a2d41729b8598b8ae74eac63530c04420a03df1d973e594af5eb952296ac49ceb4b1a61a5aed094d72c251aa4",
"c232d219f65b663d5f7c64bc0f0f11c5264fdd1e71917bb1b25a37c505c649da3bb8a3a164788a783ab75f0eb1f22ed0f67877faf59d0e89bc731ae4a66b58ff149091066e5015e0c438e98cb5b270949ddba2abdfd3f38b443f0b82a3b4132b8b9ed677a2653b30e0cf381f87b2ae3390a898341b0bf29640a22b04fa94b37ffa6df62c352c8a47b04d35ed0d6f99c0fc9ea340dab3a84e6f653627605867b4b1dbd3d70d6ea218e9dff57020ef44e1afe6b665967de08a447811e98fcfc0b60a513ff18a8e03df63303ed05245d483887da73be1c6325a56a6d0309311ed2efc9c4ae46f6e1bf4ba243bb23b894195480379b20ce0287f4aa578f1e9d8d10ad6cf50de3d6b2e32c60305b4e33fed63fef8b9f03eaa5399e543a2675100a63b7b14b2d1eb3343556f84da005b5671ca09c9cc6b2d1c4928152b3cc67457b9a35beb82f1fe7e9fed1770b343c68a5ba1b6d6c839995a8e6c5da60c6039511467b05a8275eb3d32f39a72e00a17b2b094ffc5994aedbd80f1074e224f84dad99164a44ba911b7d7feb685411088129400f2f10adc606628bdc372b48eb81c4d5ae274fc9fa47427c2171628238edd00f1c897ceb0273e4fd539c8b1b5c43ff20150ae78a27b35992554cd62f88f66fb386514634ff419db192b61d7cde12c2a5a086fbfe4b2e7f49a206093be776e3e7d16d88743fa486f9224d04e5a8e5bc598",
"af4e570f2fd101a04035c61d550b6aae1afd7328ecafa0f73d3a81272e791eaddf0801c50aa2bf18e20323aff9fe8d44d32310586d66f6b88ff85f2a6e2ce84f41979ddf34620d097074d5fc8c5ddbcae26a2a027441ea508edbfe44e9e44d7b101a3600570da7409e0f62570b4d690ba7ae82a9af678d210d4c70b29b6526d35ee1bd528def9f63b2fdc6993dea732b8779cc6a1dda0a89ef30022486571f4b6235743626c99edbfed13b32122dd51ec45bedb2e876599ebca0553853e6ee32a818ff6bac03d4b774ee01d879f22b7f1f308b11e9b9e6e60717ee22bfd406a4005feb488bfd6d24cd18038848b5badf580c9fd1dd8b930823332c5e7ce85ccd1aa12345489d843c325979cf82147daefaae0d7bd5c251057ad0536ca43c2021baa421ea3fee0c0376d55e89136e95c713b182f8893bfc47f0b86a2fda14664c4e3063c05ce43ddd0b83a0ae792e07e3a7ad222f9975be8fc51b610ea3b127b59f7d88f43b45b9aafbae10f038f2ab22bff08b622997d34b12d69f5768352141d5560d915c08e216dbd93614410db1335d7c03ed2383ea467aa37c2161724e2c1d2f96bf082c9feee522edd849f49ce17afdfdaa16d2600d70484c26d17d1eaf1231afef056b650c8ddfafdcc93aba5538d2b032f477ba4043341a4db3b0c6a57aab586590eccaa8c349a68662c30b9ee727429c3ac4164190cf53cdddf78c91",
"74805c6bb30998ca55ea3d61408ae96c4ca87219b22c4d32c653e67d4b96f641ce19f574712e18f17a4ee8c022ab7ede8e0a2e974e5dcf81e82eae3d3e935aad88f3f51a9d7a3136a7baf05cbe3c30cbcba28e7ffccbae8a607799f8efad1abc1ff876f9cb3becc475fd6ac8fddad9037c7cebf5a47b09688f51a51b48f087d6e7dcc6dae5584c535a07ec0022aa316d7e39272544baf17968a9951ea9c22474764d6e7d6a622ef5683f5ee47af6735744fb5908a9cfae7825875afac7686ffab3c42bcef73f850f8749c140c679e809ab1ed407aeff2853b03afd594d8521bdb55dce91f5340077322d81c92e6ebdd8be0ca001b69b444dc54ff4120d7f1f0bf5616061f7e3a99d6ac42a2f5e1b73d03c5ddee04740d793ae35b7fdac52154cd9dd0e78d1bcb5935be84c7104763f00c2b9a8bfee9d7f35ce2e62be17f56f9ac0d3645abfb379edfe4f295f2c5cd56412b895b204329c186f369330cb9645c5c50eaab1523d0296fc8325b3437898f7d3ce6e40a487f78a7e32a77323ea478201e5e1823ab899189e96e0319346f7262b524e0fc2cb949f6a275d69aff5574096c5f81c9c3129b53bb8a9836e7d788b51515913590cf422d7663545d192f03770d9eb9c838ebd6c141765a91135473c8915e2913374bf774d61b1143f10756a0ab61be6c200bf2a7096e7bbb96334b49b8de2544a584ed988e404910c4c059f",
"cec601dd36bbf049cde7b7f2bad094aa17e0bc8858ac383d26412e0e17cf9786641fed6e221064ebdd2ba50fd2016b0b496f29701a6e5f1eaaf7fd2e0c9e7e87b60273bc94523fd8ada4b76f4ca8bc72430af4dee31a32c6f0e8af0d0e3cc5e87000ca77da5992e4edbfc0730055a6519e62ea8b1f1576dad86c389adab82f11d9c99ab68d102552a159181294f69750fdbbabbd95984db70e43a191bc20a35c68a2a613abda5497e4d31eb36638e845f4d4f4c86d119ac0eb870c095449802ed3137cec010df5f9380c2e19016b8bbccd117f6463be57122ce393ef6614f58eac82db37ffe1e7d4713c8cfd0d2b962823207efe73d93b6f5af0121b0e85b62be68ed498d0f574dc4bef93a33315d9a2ab0ea7017f4e95f56fdd89bc85f1cba96618114afbd3a1ffef32159e9fe0272c4e07e01c76fd23159a74ac715816a64531120d3a777e5ba48e303b4721540a55ed98c4f745c4bb1d414c94094e2be21db69a76f3206fd15f730e55be47e06606909b8bd95d63d32273171151630f5f184c767b5bd42c061e461d861a3aa6d028102757bc1136b4694a4216dd8fb6d8740192202e0fcf09d8e703e68278f4f0aafe1996409b787825343e1203946837c9c21fd6837d81e104a1be6034a372d0ded0fe340d26e07ab5633da3c8e12f9b4ed31093198a5511cf5b3c0dea04b564299737bca0b7bb94e7e5a0ab14d1238c14",
"718082723f43869432433c910c2d400adaaaa40b9b3b251480a4f01dd001c31e93166aa8a45476c00c10188a538f8a533a5b601a2880957aed4c4bd69f68c08a3b86524cedb6fcb9bb46509ba39249953671dc6d1f9f04f219802be5c106d519573e16fd596c6734e173c524ab4d2304c73d9fb78f3496e8bb42f0bf0a275552312396b9b893b5fe3b5ef1c9fa8c22d1b9863ff0c0b4221a7ba91c1849ed2d571e68c5e2ebf1fc8942aff57b9fd78b1491c615717f1ec42d9ec0fe84100bbafa54e7d9f0ee48f18c5fe2dec2d02bc789772175d5c6f1fcb56588675f02356e8366cfeffb4e560e1e6d1867e93f02d4e68cdefdaca4e1122fa9c9b52b90286aab9c2d1357257870aa507bb7f94eecc3fb36319c3e7e34620a74c305ff1ab0cafc0198ff4e19f8c8cd5a1c6faded98bc2167ea92a3af157b9cdb4546ee3c2739b8dce011d3da83e9e13652755e79bfc6e28c45906f327b78a7e7ab9d24256cd036280ee4ac8930a36bce28ce8f060510c0d116da8900b6064440f02624ea31376ba87eac1562dbd61d1562448f3e720609ab614b477297a68d19d4f975b44bc402c4d86c53f3dc76052353ab228879be3b25f7acd93e52facdfb7f298886f0205ee8925ed45967dc12cc24677fae8f55f36a7b7715570b3f9e88b30e185fa68268d066075eee9f132526fb2cd50eaa75fbbc3e5660ba031db92dc7c4540020fa54",
"53c551c730cda7be2812bb9e2e13d8c849833b421dbefaf3bc0afb90f0c80cfd45abc383a0f38525b93d4051851e48c6faaeb8a912ce4b07e4d8a9ad374d065f3219aa0af0d9411ffeaa90d55d22194b4be2807eb44f891624b80ca2acf050d00a6dee14cc7653908f5a788441b246b89c7c84453e858191c19531ae674023636728fdcdc005ce72d51fddc954d01b19b9b62a922f2542d81832216efb8b4b0f8d75b38712ca50b29c599ea852a5466a776b47da0f16d509682faab2177ab14c46b0723000c70e45b610ac7625db6da98db2ac596233cca2c2a311f2d4abfc256ec93ff2b90d97fc196f01f1b51274e795962c5dc18818f4e888fe0450f7eab13e329589c7b260a9970711ddc7fd990ab061179480c054fad2433e66009af9fe5b33f2c07217ca031f39235f5c1670881b51c5e335b5c5f79f24833c1e60e6de778502b0ceda9c882d835bb2cc40639303d8be61294bf6752211017e9c26fa6def5b9529a31bcb3473ab3f48bc86b5361c79873bc7173f2bcd726a0babcd5a92dcfb4caacb9a9a5f0707a28b7ea80546f529690115642bd8e60afdd652f145f51ce14bd005de2813d1584850c6ade075284156ecc301541d38aad9303cf9275f3b9efb93736150041b8c7201464af14c9488a2c157a952c858a4512862e106404fe3aef9e61f118942a6f37e1bf119bce0cf364dc99b513017d2111baf77a476",
"636d07a32c64f2e3d3d2e23700206cc4c0e882c4154411f2aa54029fd33ff7bc060db61512a6338736b6c044a200bce79b70ed563811da93786da5b87083b6df7038e0ce49b791e35cc6fe36ffc517f4fce9ce55a2f926d66f8166e56c552faf485f0d0c241681f968d649df926fa83abd1fe017e19a470e562cfdb72551b5bfdf94d3ec07c1cd95963d436a2b4440293d95cd340618a1f5e26abf85980ff46f9112a45fc09bbac286de98ed8206fd52875350b4f57ae764952bcdb0bc22e4263f173a58bed2bf5edab12a80969b7f4d0d3223c9799ecce4d8052a008f483c59f01ec28b34a9f8864375a9d9ab7d1939c1f9baadceac17136c3d54edb316a02d7c8602e69fc35337a24926d9cd3a63b5b460c653c62c803a68d0b7244c8b542c7510203b794ba8b1478aad294c22c1cb82dbc2e1c46dccf1af4c024ec94b395c02d2d371386ae87e9d5cb0a3ef29aa66036216e07c571eb1f1ed5f18a1a4300e9ef7166877163eb49b680be0066ddaeec3477c7462c195c7707e745f9f511341851e812a760099a88590fd0922739018b9c0cfbf413912c7337fc5a5e617b5aec5eb2bfce56b6c040d337d52af7e0c2c34ed020e42c5a2ca802a51f04ec684826686911b0f81580520e397cab9c524d4a650bfb1213de0a425dfbbb27c824a919f9ace8e704c5743afc7f0c063b0407a9c78a2abd413adac3034d34396b2da53",
"946cdfecd27bb3b5447b66089fb08a17e840460fb34dfb55271908f811209193fcbe277f360b0c7f2a430adef93f1b30bd11ed2cca35da0c1444804eb9ef23b5753a52171cb3ab05e00dd853c18036e5dc268f52edb03de49ab9452b7c99f6b3dbb04b0e3292ff739e539885a2053523b83e93326e467c762c26fe4c44d6ea9c092e75130869cfa12f19cf8dd8177359c6caa663f33c43e44c58ae0a1fb7c8fdfa7e58ebe2c7807405022a9a1b7472fda86491e4f5fdcc87d71bf2b8cdcb6df183bf71371df5b3489fbae38d6a697a91dd5425d88555353ca65307ebebf8464d9dcd32fdf88eb29531d5a568edea1792da2d17150954bdeabfb3d0fe8f3b9bb7cafc48d4431526ac6e7d0bed958f2d2ef43a709bec9758398eb53a371f300a45b147680eb492383f44252ddcb62691b159532b3808c90c094c69a9f7130f4ba35e8a7cfb376b2a46012f32b643a3bfb62a696ec955183b4f857dfdbde81ec19c0c9ebd8659629637220b03e108b8c4efe771f0fc8625590d59101049c176dba62032f25115e0557d84d94b343a008e7d4211ad23fbd5d07eb3f58f09ee3f4605fdbc124677c53f4f3c93faa801139aa81a122e2cdd35215efc8046f475a11c51a124c1cce680fbf7d479ccb5236609bdbc45ecea5dc18c285d181a686655e32dd47793d84d7645d89f054e1cd8c1b06504918dbdd469d29a0222aee92cf2d44c",
"7f6726e4edfbc085332e7171c879954e35a34c223fbbda2cab55bd33f8f584e0ee722d294a79a334f33956110f04d8674e9a1f02bfd878ee0383381c8cd8997bb83b604c737220ae56e7875a3e65dca77ad47509b56a00a84058239721d7ca67eb03d2fb538bc37456a585c7491ff67dfc4bed1ac067efb6984246d69837c2b7a34dee6125fb4171b5732a23a9833251884280a3df5e219e6f84169d4b0b16236ebbcd68d3a94ab7378751030a2f0647dd61e0b26f075a5126b92b6029b8757596018e6f390fd9de0371a11c0d7ec3a62e2cf27fb020c1ad9874d7267debd953b90d75c0bc73964653f8ccfb3d80e951e6484d4ecd61a6a8885f4fea130cffc12dd4058c9a8e58600c5fef8458e5f185186ecd0874341b23a1a0d2138b4894ffd2e0e1aac7c0a23023c9f6144256fc88d2028eeb6e5ecc2e6724c789ef59008276e25ff2591a4c7b9d379c1ee3eb452d8e76e9df75bd83404d93343f0777d68ac1b9a29cd6003eece08cf2213fef5669336a1cbb5e17af34e0bb2250971b7d4f845c5a232361abb6acabce07031d8eace9861e8ae6af3b7cf6dad904ab65d288d27b482824cf9262b13527d38e04f302ec16559fdf05e198e9b2fea57cd2bdf8f6767ec138d6ad3fcab0888d4561efe41c2a1949e869a37b25b2e9c0307d7e7d4c822053e81d0a6a925d9cf8f1dee2d4ba78368abb4d8ca5d39164da55b47f5a",
"1ee50009e32b7c4425299952250a26622b39a4e6b09645701025abaac727238a36137f8c719c62f5e54e26cb84533599d7acc86ecc7dc0e730a0fc3523607041e297504ae26a7b9b8457b84c6f47f1f207ac207509784ad70a2961ba1785453ca8628ce900fb26d3c5e81a6208d6947e79b1c07508ee131916af33f05053e4cb7a51c2cdbbd6fd75bada9f1005e56fa85a41ca785db71e0ba0eeda40b5212757a46b84ba497bc6621455640659b5e9e251ff029acff10788b93809142f77210c0e6cbc51f750dfaede151ecbc2cc43a000ff4e7006b677a91d4138ba01acb23ed186f6c047b268854306b5bc7a42878793be830060e1f585329ed00f1ddfe69a56b908e71a24b8a3c4085ecbcb21c0039799264f4d7aac0b1432a02476d7648b2a109fd63424bfe3fb0da4a19c3010bff5230e2846cbd2d51f7f2066728412521f6841f9724d3e66c5e99a767d9f1cd2aa5cb6a6e8eae4b5644e2c169a98239e8c6f4f62b83847024dd61f5a2a3f856d25d35ee0a1baa3311c42a0f501cf3db261af3227f46e75a6bf423d6a57f89b0ebec9c57ae717f02a85578b619275d14669323cf139ca9e8c37d647427fc9a970a5bc533d0b19018f95d8c9186945a827a8470a2bbed9c17e9f8141d64dbd5e8755ffd77f9287a17aa138c9c8b7697e95e3ba8d86cd27a3c989f06321e492d0e7dbd1f9308fab0befca1548be50a22b38",
"47236d742e5305cca31ba94b07cd8f678ff6ba40cfb66d31e5e9305f309f4a5972b70b96694b5b652afbabe898efdebfc87596ea5569134d8a6bec9298e5d2cf71a30f57ac3f1a2155e163bd321fa6739a223ed300d92b177f266098068cfe88a27ded8f410bf9eb620b398e231c9b48b6fe0fd75bea2d80b3e23d54882c2fea63befc699beb404edc29bd6d5a52348a39c98b927cb54afdcca99a27c9205ba3f9256e1678b2e67d3f64f321836947e9098b1f16694b840c2dd7e0973650208a43334541001d072f620d14f3ae76e2d6851b5bbc1b151642b080b9b413a3a7b751617a2e70dd4481ea19c128969771c939eda2de30511794028a484a3b6b193bc03601f35a7a00d64f96f47ab9a84a43f770919013b395ffb54761ac64d48ed81609d2d2baae7cbb7efd19c67dbc5956c4636a7aa9e121d15244ce08fc4f73cc5b8e676beca4a8f7f81236c0984461f98ba3fe90e2bbf8f5cf4c6534358f8aea6f461335eb59c201f72836e127da4332d045b8e715e01fc8d6e8873115e3a75608a8c50fba1319121ee93417826c3df3edeaeabedcb62c22b757c708f502186367ca80d015d42932dde2b889e135012a7a4307d782c06ee7414e0a6188feec3f616b58647d783558eeae8f6851b4655f49387626ee6b9695759ace1ad889b753efb30c4f8af0a6cc492e02d1843a3e09ce3ab6554d9731e8c1e5d43ad3b71e7d",
"62b3d624aac87816b595c6da931a6caaeb9a329a96000c8cafaab7bfbfc3740718692bccbff955a0353c6eaca1093b8524d5f3c59e784da8d573dd151ce4a9ddf5f327925f4dc64e736929d8cd41bd20bfad57ac31b85271b8c5a96e9ceb02e0a009b24a2f6669117bd86a552f4dd24561a7f62d894ed96b4844b933f4e02f76e1a6d98b6f1d5f3dba231ecd7cf0ac094d6b342886931177d76aff990036ec7dde988c1b20f471233c9fb0a38f417cdd8395c903706409ca96e215c4fb229053c86e2457a6c072a15649ac1c1ea6075a4bcd4dae3a1b238ae3d33cf178792c3d6bd56eda2a6ec4ab7130ce15e80399f77bb765719c1dcd50e4282f848beb3659a77633ad10bf279456bcde1c040a003524435ba86a6eb3ca40cd1ad1fa7167193c584c1487b67ee9ed3f6f6c4aca561fa1328c21e5c177fc9877401fc762c52fe448aa06b4bc5ea6631140f9543b6bc45b25e4196af5e45829255217ae534bd36ef52ce09bced4923768f13c415c3eea41ab767e38ec6c65f482083d5c30dc45333599cf4b332c675e3c5e0f16da059c195bffa5f87e1bccfeac1a7c58944a72e41e0b1ba2b978cb256d187e90435a570784bcc7680c0f791d4adf41eff3a87a05aa61238d0ad4abf710e3faa61ac76993f77e525f14112bf0db508b55f0e8c8de0d3c60d510dbebce13053f4ea207c3ef407ad4e353cbce07c73f932fd0693a",
"b61fcbd9060adb9b4882356a3a624864264a2130bebad9688fc2efed8e8383610b7e5cbe5091a604200cb0d4bc90b3ea87aa5f1738932afa68b82770ccc29f56bb0e905885821df1f55bba01f03e49ddb776e962e43951b2e4bfcaa33dfc8cfa5053282d60ebd2140a9e76a097ca646350fa417bdb09988d8c18fb1add9b204ae6399a7885032335eed46769aee10bf901e81ee36d96ecdd8ca61561a1a28173170aa22462d54778c800a48835fb03d2029b790715ffcb1e8a126766e0320ac1e29fe03354a1e1e6605e2e32b27d2387d6eb35e15b92fe86812b829c24843a5778951888f9b82d62f2e980a8a763e076dca1efc044af51f184e8c7d4b0b2ccbb766ea531d414f7a01c27f711f0ba1cf865bb9d923ada18eec68e25cd42a2fd1b0e9a776b5a3ac3780548b6c85751c7704ad3dddf74ce0cfcd583903923d5cf8194b85d98477b880bbf8a12b4c922b7bfb98244cb016420f6f666a406278c69785869c0cd3fce37edcbeb18b6e32cdbb648bde83a5f349d0a61df9aecf07926056d9f58418c77eacbb538b472601a03b76c72d5c8fb588ff0ccc1d9fd926bd3f51e4989b1c120d4f0b6300491c81c5c106681c571329d0b6cc5190b35700f3937d2541752aaa4a31232a963da1ef4dac081d88817c634285824abcd84a1d7dcd88d0eb1035c9953272b4a9ed464962fbf04b289b7333f3345a178a9c2de62a6f8",
"2369100f007fb2f7c44511996094e3baf0b833c457a25cca52852da351895cc1aa149ba2a1c478133fdbde6bdd78934cbac9ad5f3536537f592b9be623b38ab91d72e157e9603e2dae2c05cb4e24de38db95a6f1c78bd25217acddd04639febd08b32e39b72615f372dd8a529422684f773f2764943582daaa924b26622fd8964192a4ea4b76665ad7d8ca90b6f535171b4dd9d68d34fc86b62be6592630599f61eae9715804002b7061063f4d56a2e39c618ec0cf2e1af8fa06bab48af761e36374205c40d11dec239c180054ceca8979aa19f858409ea33b8e9c9d67647fd02f3c312220c41d40c086f7c4c3009e2c1c058d63a76ff5a885a2e990cd5dbbc24a0bad29a7e42b816910ee6ba5d4925965b45f1588facad78ce8df850f0e70ba83eb485ee3db12e6b8e26423b2c92ae76537837cf7def7e5ff3789bc0d2782b97d4f2546a62ddbf954f287c91ffa260090d3baaa50b5d4d04cc86ba47b91076872f34ddb99912bc6425f11c50f2fd43850a6afb76a84a11dd3ed680e86a2a7ce9031784fb5e62a8d8df3426df3f61de4b908a76abcfeb02164585086bac45892114328e3dcff423b519709afd49b460d2963ba79f20ce00b38eebdb4b942c74095b181330a0aeca5ef7f66846987a325defd0412be4b0df2773dd5314569a8584a1e7dd67a6458cac46d296c7fd8b8e155a74d072aa6c977bb5ff865d9bcdb28",
"8fe6e0d37cbc2187f7f5bdc53e56d71aaa6b246cf3b63d88644a130fe49727a2779863330b1463b3fb583176547c444b3b399f880c1d6c13c7e4f8334efad28979ccee440f265802f0c20dac7bbba45c1d0b7095924e02a1ae5a6f2e1d0820a81478ee11ac8c6be4d62f3143ba4c1afe5a1178734f5bdc8c3b43fd877397263166865997f0e798c3129cb3635405b85dc2e2c43b4ffc882e2d9284173de239f6eef893d7da0883f8a552a5755a1e9b95a854bdb831882a3f0ca3a8d5c00a15c2c3db53cea22bba9a5a95749a335b510c444605be6df3aa27cb070827faba753cbc97fb2e17638fda4a6cd39cb52a16b6265bd54dd7d70c7f157cb75b2bb481ff7187d4db341161845b9f9f110efc87d66bc49f8ff8cabc92b931c0d3e34e8a88021bc60380343a59c9900dd1b96458609c4a519ae0662502c514f36fa34004db83aa94fbc97c432ae320a06a186ad8e897a368f01881a9fd64189f84ae5237f23650abdbc2fe1cffde4eb6d1815f23da8339bfeb19a3f614a44c292b741faedc84d5614cbbe1c72076c88cfa8e8efe49b12b1750620306215794c6346a3a786013eb0c9cfc47112d337b87a542e2e68022625fafcd43695c9e4db6cdb3bf9929f3ef293fb4d34b013ad3389c3e52562755c11ff559ef8201038cca38662045360a7cb09c9623579b66be7034884a525508a2f3ecc2921731fc4e8205a7dc00e3",
"09b1d3d8fe2e575996773b74e3481734c14390725c8b0231f446a7bb0fae65678ae9254931e68828260ad3a0201fe93606405869f9cceca5ed7e365595e9c8965a3ec15fb7ef5091cf3270d2f817d16de2152bb74cc0ffd1fd758d3678809d0694054e5c7f8321f6a266ed91534126ebfceb6e102912acb6dabdf61154a238987d6a83c0140f4e16eafffea7091d25e5516e6985fc780f465c2136cd29935695f6e061824ef3b04e3fcdc43a6484ae96b5013cdb8f598317329c058b91f86d3c0e0497acea161eecdb2df768258f9ca461ec9b4b6009a557e3d717be4fbd200788a5c7267d052f156d2a6610ba2702e861b9ba6eae7dcac247758b8c8d8f3e33de76bd56b707020bcf744ede533923df96580638c924ea59c60b6bd244f00295300f47791d2ea7d3fa7dd580756e9189385e9a71d1e1b6a1ec0329bd993a4099fd50f1d4562eca6c7efe3cd56db68eb14b96fa981f9f43af9c8e348c101fd81b5e46812da7b21e1b99521248bfebdb6be773383a326aadaddd80e40f46f34f963ae364afbba2c04aa93fc392966355a3d8b81c516186d9f23dd2b84d9c5d54c1fc6730dddc213601a6fbdd7b93a21c9b8ecfb97f4bc80b4f6c9a92cee605aa4716d08f9c0fd42cf8cc9a8344b7924fb9f775d9ceedf9f8d651831c6263b3f9852afea6c27eceba78fc7285f4df7a67d1ea1fac3be07e3bfe351d6e2e285dbf1f",
"7b15a0ecd91f3a801962dd8c495b12567f2f6ef4e319bc1b7f05c79ad557fb121647b07a95bf0facf649be8b4f94303d7d1926af9ef26f8bd802d69683fd590ec9215ebd0526a4a50865c6bd494c18af20e0846e7be8419df19dfe482f26dd9d02766058a08648d0cfb273e4ffbe904f3bc9ffc92e74cd4b8e2669914d1d4d12802d971c92cade5f8e83f6bfc7b518fec3933fe2762dd79efc9656bd7f92ad2c046d4b7d9aec085d4a8ed4cb40b653df8d7d06b8b6f51d773375fe108bd4411cb773694c6f61bd7e416de0b4022ededcd2cad291408203e25a6bde32d4e5aaca0b2898a41639101479433ed34d80deaaf04d073bbd6d0b2c4b320caf5c3b7a1cf4e08256d1c907e91a5cf20e9461ccc39c973910abd1a3c9437d20bbefd8d00c6aa5a5feb6f778986fe8a644cb413020b945a8922da9362dc15bb7545d21bd50411558b57dcc16a19d195137cc678904700518be66d08968e1197dbe5d0c66e6d077145ce8641eaead2e6ea57b93063c412c339422ddcdd818cc725a290b5e49a6b1a64d83676b52fe61797a34556cbf95f0be375462ca72d6f596ac4749abbb446779aebe51a53b7a34cfa0b0e46e55707e1e651d4ae70bcd7c6d5328cdcaeef9e88fae9f6a9be609c064ba193329cd82bc3ded547899f2e8d426bcf10be8ff2d828fb4968005a73114ac001e8fb7f01ce3522fd46b566f1e5776539956dfa6",
"6960078bc7804d107316a6c4be9d9ffa5acded0052a2f252a01dddae1a4247e9341524643fbb2ebc936394a8521e97810fa81d14fad784c589e745de3724cc5c26020d8e21aff4d106fac224ffeec5094b60707528a46eed9019d2dcaaee7ef1af2aa414cb6f8b72e2365729baf82d3d8c1203edb3a74c06bbb2b55dcab021c1ff27ac3827f8786e422de82b35b245efeb0b47ef55ecdcc3094cc5f5c21da9cf816341b90fdc36f8ccd5fd8ff78e4aa8b10a4a9b038ac09ae0761c300fa498b051ae1f129e0f0aa1c0fec92c31609a8ac6c4ea19908c9e733d272842b1a97dcbafab516d9fe1592cd3a8f60180a9d12c033387c39e18edd4fa3cf0e85c3f021b12ae428718c69bc5a4d3d19b7f4d5b3ab89cf449c4f708db6a1e0123563d59bde0a92d45eaf652a8e4d39c0f4d18b08cf2fcd239983dac1b738a05f55c3c992fe8d297080c1dbed109378c2d5dd85e201d41f79943cfa08a8b0719e72a85d4e4a8935544722f1cb3bb4fd5ce6c21010d6197dfc2227bd74f89b93c82186d118aed142d9e1812b2b7d23d7001a327b49fb3b335fdcf6c6eee5f565f07337480ea8f6e38deb1a9633f4d4fb8d327f6c95372f7986a931c49148c982fca8584ecf6e57449453337ed4c95a4185c409320fd96fabfd3c37ee0fe686f20da2fa451f2f3baa2394bef7acbb06d0adbf60ff8baa37ed1b0eb3e322433139bcfcd80ec86",
"b47ae7224429db36d6253878be84087faf59b5ff8896649afb2aeda0e02bf843b5c591945bf7d4dba0aa2b09a4a52ba358f4d80b5d6f97d8f636e03fe986f37b38a2e8297a48bca4ff3759d21ea6958af1ea7a08efbd61c0b82fde2def4264744b86cacf2603f5fc4828d2db7da947ba91058f704212bc6d1075112cf0dd9d8911f8dfc6f0cf5ad31987095b5d09e520b562af6223cb35dac8c0a6a302ba9e28f797b55299f36f82fe41692857ec7d73bc24604db0ace106a2e68f6d1f9f274cd5f56cd802a4f2683a013d2d3f6992bff578310d81fc1aae7a01a61b8a9df77b020ebfd191ab749c2e3b853f284bb76c83b86ad0978f760266ec5e497f2dbbfd73ebc693140406a0516765b83e4ca7a820fa44b9057af4b702c0069142e2933b7e9699ac099101c2c509b7825d8aef59a6432f38a4cc80e0b3c4034bb992ecce690d2e809627ac13a078b4f1a0855d6e63b2abdfe307653244aa9b23934ec898cffec904645407cae728fa6cd36f3f4a27a01be502df5f5ebd8a7f4d0d21a49086fcc2e44c62ad5441ad9fc73a15d5759eeb13483998792f126f40abbf9b775ae24545a11cdc842edd0f23955dfe752481fca340dbd75bb8902d3a73314ba112e0d4b0ffab3fa9a51697b5efe12e53f7e6ba7322f5194146ae2da2691d14884470a07ef37bd90cb2082c2ecdb1d92062fe2b1c808ec5c07dda12f66d9ab85983",
"9c1be5e857dda58ac54ad9a148038407ebea778650fb48b9345fcac30ac5d17bdda862bf384c2eacc957a20b5250769a3fe3d32f0f1e3e27574b657d3593c51000ed3633f7fc6e2c0ec7b4b148cf34b2f01c80fee1bfb23664ed5e5678ebbb2937921e9f976473325585ba49a7d4af055fb58e350a4d98a2b9e4e03f561b09390358df758fcd3af7aaaccdbeee96a7552877c0890ae435934d47cda981ada606bbe767c7f6a3904d7132ec5906edbb3d2f766f963aac2ff6dbd49986d3a5507666110392fc84bb82b40ad0df6b936059b9045eb2c4a0cd4bbac71e35b0f7994c1def664b7af84ba5e6ccfac1424be3102e15d985890ae44fb06b1b7f45ca18f200c8acb9d98ba114a050912b703f3cf99ed1655b5f631b26fb75d8db6dcbe145d9aadb7903217ef2bd97fab5a0948fecd8fcd22b36ff8ac0d04d8ff17d518bc2286a80e362bfdecc41ae4054ed9b694af8313a2ff8d909d50cf140942da5e77f851e988ea5eeb65bfe6bd793edaa6add6362dd4a62f6395af888085144efa253dd2ac4382972ed40b81f06aa994e4d02000d558e3993b28d77aa66141b7bbbbe4a162bb4f49dd5d3827d750ca79a2bb9fc350c757890d3e80b6d3db102ffa201d79006c5c75aa83b710ec321a2ee2711451195248d5c3e7d3b3aac26a67199a4e85952b5905958377a88b20da16fda986d50be8623491e32a07bd18ad89de4c6",
"c8d66bf1f90237d93b174603c01d7996357afc51ab965e247664b33caa662b567fbced0b66ae00f8116867b0d3664770509a7a2192c5bf5c3832d0a0a19fb3c803a3cbe7933346f92e9b5792658709a92dbbb8d928ed314b5a27daee92c8d927909a15b6c805ad87afa3a8d666eac3496ad81d3250b825380e203084eef1098fdaaba364594418714e7276544f244cb755cf095a0a1a085289fb97ef860e2deabd9d8322c2f2445cbbc6e162be347998d1fc86767bfb4ac17abf33e54d222c054a3f6b339b01fb826694016d8a50f2739a8774223b4a688198e371455714f4dbf98c0d5edc45862ccdb1aef6d86f0ec4c6e7acc106bfe8565ab211a7ae3f806ce98fccc8b3e15dd937228fb75aa98a52597a8bffee05a4eafc92979a2fdc00e23474957d2275f10940fe2faa0564fb187dac74c3dedc6666a8f184c4b0bfa59198d1a4b0b46bae75282c4a8706e20f49e635123c580dacf69b285a46bebdb7dc2e63223732f8bd1aa1ee9ebf979a958d19c46cd8b0e99ed37135b16a6e95b8e478de5b577afa918d128fa012bf13915228d4882f7547f70895254944841c75c85a5559ac9446c75d6df8f92349f692f7a41935e96dd9006daea17c36a06a0b010a48deb184fd4fdfcd31762e7f1d540e0e0405f85de95a039d3bd12176a75a0d778e00e53d37fc47581170f5aed3bd44dfaa2b705e9132e96f13a7d3f792eaa0",
"a05368256ba63f31c4317f2768f8a5b490c044b2ee15fec78a0a85d4f7c1a988a5c6e946040bf2d862e970dfe37b67f0221f85b04b9e607245bd0b21ce5bdaf8b138bb451205fc38b60b942881ff20ce077f2aa070e48bf71a21ce8a18c8b48f09bf5937220e8f0ed0d6cc2ddff2cda195e041ee319b43210834ece6d9030237df5bea8d93a81c4d62f7ff48bc8726a3e32fe7b63450d2d7bb564a8ac80c89b588348bebbaa43c9a62341b194b4cf3f44cf2d7a7dd8eeac77c867894acd9c9aa34eac02e7e81eac0638933ce19913d7a0f6ab9c89d5ffe74a9e779a80cb948805b37a0f952d3bc9b508af0cf9d0c7d9276b29358bde046d65a664b48aff1d0b641a789b5d5f9d0bf661ae611d13ce7153b849ce071628e9f13c1edb092169b26f13b3a6fb0929fa4a033ebd345655022cf3982ab22301a472b3ddada69dff2d51defdfd72c91b4d3dba9d9a8801f03cfab64fd0e63ffe2952bc42ee10253d82d705e04097954bc6201c57ab0d1e0c60591875fe2407cfb1d6717de1c442cabe2f4e81e939947b486044c0244f04660da5533fb4e8c2568bda7e504ff7b3a0e217d83a6dfa3bf2396a1ce92225b8d8374f2c67f5ad944e4cda7641060d0ae3e6e459325bfe6047b5f63969de5a0004c5d9a18301f9862a9988e9d1a7507b3d00e7520717d693db5544edd8341413b03e4a6072efb8053e6ff0a2aad3e351d3d04",
"7591a4f620dcf5a43310af89f8a8d7ded94294d204dcb159eeddcbcb1c7ea6675101d408464d0e4f8abf3c50a82b3d092430467bd08292b57ba9870220f53d3b6ac989ad5ed3249d237bbc76b6479f8c45c2bc9c25460c54c913c242c0932211dc4abfe206dce6302c033885e32366baea3a6b2e1582bccbfbc9e45882ab58425b17449a53e5e0b10d1287c58ac2c44424f4188bfe1de498e29ba2a1f2a8f28e565b997946fb359b7e320e4da6ee64e48547b1b7946919e91fac8f4f631a8de9c1029e87c0503cb18a43a8a8f5d9c3dc59d10a41ac65d4d93c1e7f5c0ac27ea2ffecc17881ffb6d63e4afe8b9c94610661b30ce34d4ec732b9cf886b08f6f38ea9aa094188067b656657eab22fc90e234e64e31dd0558de5891cd49cde67c5d6b1e307e23a35226ba09682f194eea06325c9e0a733c9758bca951cccf5730b71987ef564f92057a1985e45d3fe20bec7d96aceeaac031caaf4504dfcfd8c7c12b9a580844851dd54aedad307b7a6fc79e87a9431faffc9353e497820697e7631600c7cfaf851f844981cdd2b2048c78044e0af699d8b0b614cda9a3032f834112f2ac17bf8636314c1c2c5d2c38606127f57d2ffe8ad7a33cb02abae23c2eb3f3b0852826691729b16cfc6b2cc45d4177782ed1c1de61768b436d5b8fa6501cfa97ec65f5426b63e9e82ec3780cc5fe0cefef8f395a4935da39cffded65f9d37",
"9eb10c1a31066c3eda46d2a6102af5232b92a9e164c2792303454c9c9919d2eb34a896010cf2230f8138bca6869b4625e95c92cf2920b8c897749a1586e9c4e24e7a975f44968216b4ee88a398e49e3a234dc32f16ff998b8cab805ee9876b2ac6390abf53e6bceb2a8b1e6c91a550584208b53c23a13a8d5739343740fc667a8c9883993f9e77b2bdcd8123f1389bd7b3ec363c5f84b5b65dc183529b19e27c3b77db8468d97aded8ef878a112e0fd099ad1a634a3ae84972b95dad1fa7c5c46aae1e6c5f2bf1b57265a2ec4aba9cea60c738810f628ae076c32d1d12cfac0a2704af40162010acbf819bf20c2a5282d76c05a09ee5812db5007ee43930dec8d928a90d675f4223a77491ce2b396bc0a0d33d359051c957e19e411cb3577e9550f2e3ce637954551231088658b11b3e92835f44acf92df0f0481aa8b65216c649201284b85cda544eb9c2f08599f257adf3d3f12fd3032f0ac83cc5ba94537c4a55952e7df234e13e8d0c6513046d7fc5c7f2b2efbecf4c19f207486fdb5940d39b31e0dfc17143c74206c519f3e799606122688604c58eae05ca3b5f2a7a8a280e712e6968d4d225fad844dda555543d2e5fd9f86abeee66a9b98e26f90da6313de0376ffa4714ec1a82f74132c1fa60c6bc63d48f6a31d5bbd49b8a66de5dfec94b354c60123f9063e85ae54e75957170117f384cb72fdd96c04871225d80",
"9a1e8c94597a186ae778ebb2473182b32dbbbe5729a574ad55346c156c5a377ac7302e09859368258139a46312b10aee2cdfd53f213ab42c65ff9b317a1414a071886b3066bcd3328aade60e8e6afa5c28d7d6ed193059c2af4c8617efdd8fbee7dd180c9297783f568f0fd1590490d0132a87b27c4b8be188eb513fbc12a419eac894b254b1b862254047bf582d2faf8c1cbba9465be5e71b7afd3e20bbbe933b044b33e9f06aa313beb4558d02ffaafd4825225037098d567b1120c042a4f5db6349d42bf710f0add3ed28091f0afb34695567baa8170a836fa0a9499de9f2877063b3e34c92cb723e8a1b76aa8e26568938aa5e51e7d0edf666535e5285ba1dc83b59d3fb9a0ee969cf4269aa94f7102f52080ff3985adc62d4f637ab7cebf7914e00141b27687241befc726e7765be8aac4b4902d592e0ad05ef54ce2c278d01e7e0b8de1cc1c48d912965f90be1e5170b754a283c571c88688f2d296c4cb5117372654e82fd9c871cf33bd8a041f48d484777c023db71ab2a0eb336c3a76d11021b7772dd9711d08d7e812e9f1373affae8d5b2e2f6386de3e38f93dfa7094b1cd625efdec3835b82992a3f50e64ebd6fb0c4ec4106f088986f98f1161cd4a8152c6b12c4ee2b3c115f3fe874c0a8d728a18cc761044c2b66aa09193be723d9d841e773347cf2346424089b21a1439a7cc3ae539cd45e99ef6fe285ef80",
"a7ab2b0a42a60f303f11b8f14ffcd35e7357dcf5e4e3e01ba32b8266c6c3dd59298b059142bbfb9f18f22ba1c638bff000299fbfc38ab5c5fa6122d476e214bf8b0fa96297c1a63e134e1283490f16e362ee885d135a58a450067f9dc08270063ff9be625e99037a562f3a47012988790c23842695d4db077b7aaec633094fb20656adec1c733f49e4eb121dfe91c8ec9d0db80f786f91fab87d6dcf68bca9d3fe9bd18d562f37db5f861850422a64df5a69d7e6c7b12d8ad3d7600e6cf259ccd33e7e66c3b8ca2eeeb1d4c03d0264068437b040c90f2edbf3982d227ccde89207f29c8a9114a0544ac9e2b64991621631a9145cb6ac0b637d495add900eb159258600167d71f28ee249466ad43961b1ea563743fd5c700d83afda3d8ce64c1727c2d4563ce9cd146687c2f8f8c2f402d903780cb77e9d9538bbef0d0c13f86044fc690a180227de71fe429b99ff919f4214aaac666f8b0bf18941e75a61d6ce214469b9757a4856b2da118626add8d2fa4d0912468f6796908c4bffc287db9b14e957190370ba72ade18ad1c2cecbb1d9ec77f92be526ca3320851ef576197fc69702c45fb6594d4f9fdd27aa7623fd2812fed0e26214114327f85ab740272f0af3e4e07885c130f9406c0e39d917ba55b4bab001572c0cbecdd6ade69467bebceb0473d3bc1379bd8fdefc255daac9cb88465552b281d525b7c8ee85acb9f8",
"a36086eef46617b01648cfeb43aa676ba1d0f32bdfbab194ff17e685c476a434111f029d75051e00206e7cd12419737d6803fdccbb2eb76bba3286e334dfbdd0f83babf29a92241d97e13b8205d2e8a33a8106c16d9f98a67ab9b132ae0c821d79dcf824e1e28194767ab8b2fde70813b6701f29fcb1470675207498215a6f0a4671bddbbd1a5697e11ceeb61384b1e494eadce1d35e153b5a7eff8be54aeb17212118ca8166ca81f7a374272cfa580b7c2bf8ecde65b42860ad9463316deec871adf5851864b538efab894a8c8370f0bf3afa9c3087cd7e955586d3ad08b90278810e7db57d0aa811146f0ab90698d1ac08a25358938fee57e25ea0620bb40455e6cd2c688c5de20cadb5491a19956ecff1cba23cea6c991765e9f749635dd24871d24a3a475300d6e08924d037b7aa8dd71046e9cbe8857081eafb66aaabb007b6ae395151bc9bbc31ccf72ca756eba01d48c2e24d8422c6ec82d4df1b953739c4846741b81568aaa59509e81109b4665adc1a57b46169ef9bcd912d3f108eca275345b45b2aa571357864ab1212be27d139547bbba26c409681f632bbce553be94de50e8fc47e685dca76252b1094b2785d5a82c5333aefa24523e1e809a75f8c79b182f734bc9359fa1da421c2ebf6b18f0cd79ec97ab1cfff1bd1833d90b8aa482a57a29b6f886db5d8c14128aedfdc17a16a4449f5e2b9c61223b2a5cf",
"a023835c19f3b9e66ec2afaf46820cb34fbe196919e29107a47294669f50690b699c19f08b85da515d4485f1fbc7cb9541e4329a2aecfe764f41a34103850b2748f75de6829545894e3b0d4fdcb047017d30dd3aa8b49b38d21d41e6d89fef60b67d6e956ff0247eaff157c6f079dd520cdbf0915dc08dc6c01a78a5fa3ddb8b8d0acda861341a002b739fe290f14dc41df97490fc1e2d60ab2169301dabfd215f0357b0832a390f97ea96ee98f73a53e7cc6340217abafe5948a0a83190708404e0328fa156e366bfe2d4a9ac75531e458d91d151786c36bef7f0ce2d5ce5b6b0ce4f0d6410fd897342d492c1a7f8185013f723d746a61d2b97aba1e3d534dd63d0ad21a3fc73d97e480a7be367c549784315aea37c3a2f4a3172a5b4c4c6cb15a38d4f2d276c643ef4ade2b7ca6aa34b248849720f1bfef5f9a11f7dd279ae2185e4195691647acbace1ddd38581db67d37a839c2d6c5b62f0fa798d35f92eedcc2caf8a7d5623884f2f2631d82b0633a8c3a42baa8ccbcc7db05a342715788fe88c23652306fe025060d5c4ce305e33f12b8fec51d1d0300a7c0091e9166cc6a9e0f24b93fc93e5c712197781072c040acd5feb83cc49118d50aba69b54b3e51131a64c120a7989f05d7bf4543ed3cb0cb9048af363125d75fa25da39260eabe49004f51bac9a9feeb5818b514b09327caef7489f9c2c2467004947e48fac"
}
}
};
SUITE(openpgo_pka_rsa_test)
{
TEST(sign_pkcs1_v1_5) { //TODO:: fix pka_sign and verify functions
VERIFY_IS_TRUE(RSA_SIGGEN_N.size() == RSA_SIGGEN_D.size());
auto e = hextompi(RSA_SIGGEN_E);
for ( unsigned int i = 0; i < RSA_SIGGEN_N.size(); ++i ) {
auto n = hextompi(RSA_SIGGEN_N[i]);
auto d = hextompi(RSA_SIGGEN_D[i]);
for ( unsigned int x = 0; x < RSA_SIGGEN_MSG[i].size(); ++x ) {
auto msg = RSA_SIGGEN_MSG[i][x];
int h = std::get<0>(msg);
std::string data = unhexlify(std::get<1>(msg));
std::string digest = use_hash(h, data);
std::string error;
std::string encoded = EMSA_PKCS1_v1_5(h, digest, bitsize(n) >> 3);
ProtonMail::crypto::rsa key(n, e, d, "", "");
auto ret = key.sign(rawtompi( encoded ) );
VERIFY_IS_TRUE( ret.size() > 0 );
auto s = mpitohex(ret);
std::transform(s.begin(), s.end(), s.begin(), ::tolower);
auto c = RSA_SIGGEN_SIG[i][x];
VERIFY_IS_TRUE( s == RSA_SIGGEN_SIG[i][x]);
VERIFY_IS_TRUE(key.verify(rawtompi(encoded), hextompi(RSA_SIGGEN_SIG[i][x])) == true);
// VERIFY_IS_TRUE(pka_verify(digest, h, PKA_RSA_TYPE, {n, e}, {hextompi(RSA_SIGGEN_SIG[i][x])}) == true);
}
}
}
const std::string MESSAGE = "The magic words are squeamish ossifrage\n";
TEST(keygen) {
ProtonMail::crypto::rsa key;
key.generate(512);
auto message = rawtompi(MESSAGE);
auto encrypted = key.encrypt(message, RSA_PKCS1_PADDING);
auto decrypted = key.decrypt(encrypted, RSA_PKCS1_PADDING);
auto check = mpitoraw(decrypted);
VERIFY_ARE_EQUAL(check, MESSAGE);
auto signature = key.sign(message, RSA_PKCS1_PADDING);
VERIFY_IS_TRUE(key.verify(message, signature, RSA_PKCS1_PADDING));
}
}
}
}
| 365.273414 | 1,047 | 0.932762 | ProtonMail |
6b035add0b6daa8d234ad47186246d2cff5ee694 | 4,228 | cc | C++ | src/ast/decorated_variable_test.cc | dorba/tint | f81c1081ea7d27ea55f373c0bfaf651e491da7e6 | [
"Apache-2.0"
] | null | null | null | src/ast/decorated_variable_test.cc | dorba/tint | f81c1081ea7d27ea55f373c0bfaf651e491da7e6 | [
"Apache-2.0"
] | null | null | null | src/ast/decorated_variable_test.cc | dorba/tint | f81c1081ea7d27ea55f373c0bfaf651e491da7e6 | [
"Apache-2.0"
] | null | null | null | // Copyright 2020 The Tint Authors.
//
// 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 "src/ast/decorated_variable.h"
#include "gtest/gtest.h"
#include "src/ast/binding_decoration.h"
#include "src/ast/builtin_decoration.h"
#include "src/ast/constant_id_decoration.h"
#include "src/ast/identifier_expression.h"
#include "src/ast/location_decoration.h"
#include "src/ast/set_decoration.h"
#include "src/ast/type/f32_type.h"
#include "src/ast/type/i32_type.h"
#include "src/ast/variable.h"
#include "src/ast/variable_decoration.h"
namespace tint {
namespace ast {
namespace {
using DecoratedVariableTest = testing::Test;
TEST_F(DecoratedVariableTest, Creation) {
type::I32Type t;
auto var = std::make_unique<Variable>("my_var", StorageClass::kFunction, &t);
DecoratedVariable dv(std::move(var));
EXPECT_EQ(dv.name(), "my_var");
EXPECT_EQ(dv.storage_class(), StorageClass::kFunction);
EXPECT_EQ(dv.type(), &t);
EXPECT_EQ(dv.line(), 0u);
EXPECT_EQ(dv.column(), 0u);
}
TEST_F(DecoratedVariableTest, CreationWithSource) {
Source s{27, 4};
type::F32Type t;
auto var = std::make_unique<Variable>(s, "i", StorageClass::kPrivate, &t);
DecoratedVariable dv(std::move(var));
EXPECT_EQ(dv.name(), "i");
EXPECT_EQ(dv.storage_class(), StorageClass::kPrivate);
EXPECT_EQ(dv.type(), &t);
EXPECT_EQ(dv.line(), 27u);
EXPECT_EQ(dv.column(), 4u);
}
TEST_F(DecoratedVariableTest, NoDecorations) {
type::I32Type t;
auto var = std::make_unique<Variable>("my_var", StorageClass::kFunction, &t);
DecoratedVariable dv(std::move(var));
EXPECT_FALSE(dv.HasLocationDecoration());
EXPECT_FALSE(dv.HasBuiltinDecoration());
EXPECT_FALSE(dv.HasConstantIdDecoration());
}
TEST_F(DecoratedVariableTest, WithDecorations) {
type::F32Type t;
auto var = std::make_unique<Variable>("my_var", StorageClass::kFunction, &t);
DecoratedVariable dv(std::move(var));
VariableDecorationList decos;
decos.push_back(std::make_unique<LocationDecoration>(1));
decos.push_back(std::make_unique<BuiltinDecoration>(ast::Builtin::kPosition));
decos.push_back(std::make_unique<ConstantIdDecoration>(1200));
dv.set_decorations(std::move(decos));
EXPECT_TRUE(dv.HasLocationDecoration());
EXPECT_TRUE(dv.HasBuiltinDecoration());
EXPECT_TRUE(dv.HasConstantIdDecoration());
}
TEST_F(DecoratedVariableTest, ConstantId) {
type::F32Type t;
auto var = std::make_unique<Variable>("my_var", StorageClass::kFunction, &t);
DecoratedVariable dv(std::move(var));
VariableDecorationList decos;
decos.push_back(std::make_unique<ConstantIdDecoration>(1200));
dv.set_decorations(std::move(decos));
EXPECT_EQ(dv.constant_id(), 1200u);
}
TEST_F(DecoratedVariableTest, IsValid) {
type::I32Type t;
auto var = std::make_unique<Variable>("my_var", StorageClass::kNone, &t);
DecoratedVariable dv(std::move(var));
EXPECT_TRUE(dv.IsValid());
}
TEST_F(DecoratedVariableTest, IsDecorated) {
DecoratedVariable dv;
EXPECT_TRUE(dv.IsDecorated());
}
TEST_F(DecoratedVariableTest, to_str) {
type::F32Type t;
auto var = std::make_unique<Variable>("my_var", StorageClass::kFunction, &t);
DecoratedVariable dv(std::move(var));
dv.set_constructor(std::make_unique<IdentifierExpression>("expr"));
VariableDecorationList decos;
decos.push_back(std::make_unique<BindingDecoration>(2));
decos.push_back(std::make_unique<SetDecoration>(1));
dv.set_decorations(std::move(decos));
std::ostringstream out;
dv.to_str(out, 2);
EXPECT_EQ(out.str(), R"( DecoratedVariable{
Decorations{
BindingDecoration{2}
SetDecoration{1}
}
my_var
function
__f32
{
Identifier{expr}
}
}
)");
}
} // namespace
} // namespace ast
} // namespace tint
| 29.985816 | 80 | 0.730369 | dorba |
6b068242a3f0dab24e125eb9d33607cfacdd1b8f | 2,500 | hpp | C++ | DFNs/Executors/PerspectiveNPointSolving/PerspectiveNPointSolvingExecutor.hpp | H2020-InFuse/cdff | e55fd48f9a909d0c274c3dfa4fe2704bc5071542 | [
"BSD-2-Clause"
] | 7 | 2019-02-26T15:09:50.000Z | 2021-09-30T07:39:01.000Z | DFNs/Executors/PerspectiveNPointSolving/PerspectiveNPointSolvingExecutor.hpp | H2020-InFuse/cdff | e55fd48f9a909d0c274c3dfa4fe2704bc5071542 | [
"BSD-2-Clause"
] | null | null | null | DFNs/Executors/PerspectiveNPointSolving/PerspectiveNPointSolvingExecutor.hpp | H2020-InFuse/cdff | e55fd48f9a909d0c274c3dfa4fe2704bc5071542 | [
"BSD-2-Clause"
] | 1 | 2020-12-06T12:09:05.000Z | 2020-12-06T12:09:05.000Z | /**
* @addtogroup DFNs
* @{
*/
#ifndef PERSPECTIVENPOINTSOLVING_EXECUTOR_HPP
#define PERSPECTIVENPOINTSOLVING_EXECUTOR_HPP
#include "DFNCommonInterface.hpp"
#include <PerspectiveNPointSolving/PerspectiveNPointSolvingInterface.hpp>
#include <Types/CPP/Pose.hpp>
#include <Types/CPP/VisualPointFeatureVector2D.hpp>
#include <Types/CPP/PointCloud.hpp>
namespace CDFF
{
namespace DFN
{
namespace Executors
{
/**
* All the methods in this file execute the DFN for the computation of a camera pose from 3d points and matching 2d points.
* A DFN instance has to be passed in the constructor of these class. Each method takes the following parameters:
* @param inputMatches: input matches between 2d features of images taken by two cameras;
* @param inputPose: pose of the second camera in the reference system of the first camera;
* @param outputCloud: output point cloud.
*
* The main difference between the four methods are input and output types:
* Methods (i) and (ii) have the constant pointer as input, Methods (iii) and (iv) have a constant reference as input;
* Methods (i) and (iii) are non-creation methods, they give constant pointers as output, the output is just the output reference in the DFN;
* When using creation methods, the output has to be initialized to NULL.
* Methods (ii) and (iv) are creation methods, they copy the output of the DFN in the referenced output variable. Method (ii) takes a pointer, method (iv) takes a reference.
*/
void Execute(PerspectiveNPointSolvingInterface* dfn, PointCloudWrapper::PointCloudConstPtr inputCloud,
VisualPointFeatureVector2DWrapper::VisualPointFeatureVector2DConstPtr inputKeypoints, PoseWrapper::Pose3DConstPtr& outputPose, bool& success);
void Execute(PerspectiveNPointSolvingInterface* dfn, PointCloudWrapper::PointCloudConstPtr inputCloud,
VisualPointFeatureVector2DWrapper::VisualPointFeatureVector2DConstPtr inputKeypoints, PoseWrapper::Pose3DPtr outputPose, bool& success);
void Execute(PerspectiveNPointSolvingInterface* dfn, const PointCloudWrapper::PointCloud& inputCloud,
const VisualPointFeatureVector2DWrapper::VisualPointFeatureVector2D& inputKeypoints, PoseWrapper::Pose3DConstPtr& outputPose, bool& success);
void Execute(PerspectiveNPointSolvingInterface* dfn, const PointCloudWrapper::PointCloud& inputCloud,
const VisualPointFeatureVector2DWrapper::VisualPointFeatureVector2D& inputKeypoints, PoseWrapper::Pose3D& outputPose, bool& success);
}
}
}
#endif // PERSPECTIVENPOINTSOLVING_EXECUTOR_HPP
/** @} */
| 50 | 172 | 0.8108 | H2020-InFuse |
6b0864b4d35147e22b5b75d6cf0e553225040e6e | 9,510 | cpp | C++ | MqttTopic.cpp | ERNICommunity/mqtt-client | 0807aafce90d8cabe84ae9e789323b679b0fbef0 | [
"MIT"
] | 1 | 2017-02-23T08:34:52.000Z | 2017-02-23T08:34:52.000Z | MqttTopic.cpp | ERNICommunity/mqtt-client | 0807aafce90d8cabe84ae9e789323b679b0fbef0 | [
"MIT"
] | 8 | 2016-09-15T21:53:45.000Z | 2021-11-29T11:52:19.000Z | MqttTopic.cpp | ERNICommunity/mqtt-client | 0807aafce90d8cabe84ae9e789323b679b0fbef0 | [
"MIT"
] | 2 | 2016-09-22T01:09:40.000Z | 2017-04-02T22:35:38.000Z | /*
* MqttTopic.cpp
*
* Created on: 16.12.2016
* Author: nid
*/
#include <string.h>
#include <stdio.h>
#include <DbgTracePort.h>
#include <DbgTraceLevel.h>
#include <MqttClientController.h>
#include <MqttTopic.h>
//-----------------------------------------------------------------------------
TopicLevel::TopicLevel(const char* level, unsigned int idx)
: m_idx(idx)
, m_levelSize(strlen(level)+1)
, m_level(new char[m_levelSize])
, m_wcType(eTWC_None)
, m_next(0)
{
strncpy(m_level, level, m_levelSize);
if (strncmp(m_level, "+", m_levelSize) == 0)
{
m_wcType = eTWC_Single;
}
else if (strncmp(level, "#", m_levelSize) == 0)
{
m_wcType = eTWC_Multi;
}
}
TopicLevel::~TopicLevel()
{
delete m_next;
m_next = 0;
delete [] m_level;
m_level = 0;
}
void TopicLevel::append(TopicLevel* level)
{
if (0 == m_next)
{
m_next = level;
}
else
{
m_next->append(level);
}
}
TopicLevel* TopicLevel::next()
{
return m_next;
}
const char* TopicLevel::level() const
{
return m_level;
}
unsigned int TopicLevel::idx() const
{
return m_idx;
}
TopicLevel::WildcardType TopicLevel::getWildcardType()
{
return m_wcType;
}
//-----------------------------------------------------------------------------
const unsigned int MqttTopic::s_maxNumOfTopicLevels = 25;
MqttTopic::MqttTopic(const char* topic)
: m_topic(new char[strlen(topic)+1])
, m_topicLevelCount(0)
, m_levelList(0)
, m_hasWildcards(false)
{
memset(m_topic, 0, strlen(topic)+1);
strncpy(m_topic, topic, strlen(topic));
char tmpTopic[strlen(topic)+1];
memset(tmpTopic, 0, strlen(topic)+1);
strncpy(tmpTopic, topic, strlen(topic));
unsigned int i = 0;
TopicLevel* levelObj = 0;
char* level = strtok(tmpTopic, "/");
while (level != 0)
{
levelObj = new TopicLevel(level, i);
m_hasWildcards |= TopicLevel::eTWC_None != levelObj->getWildcardType();
appendLevel(levelObj);
level = strtok(0, "/");
i++;
}
m_topicLevelCount = i;
// Serial.print("Topic: ");
// Serial.print(m_topic);
// Serial.print(", #levels: ");
// Serial.print(m_topicLevelCount);
// Serial.print(", has ");
// Serial.print(!hasWildcards() ? "no " : "");
// Serial.println("Wildcards");
// levelObj = getLevelList();
// while(0 != levelObj)
// {
// Serial.print("[");
// Serial.print(levelObj->idx());
// Serial.print("] - ");
// Serial.println(levelObj->level());
// levelObj = levelObj->next();
// }
}
MqttTopic::~MqttTopic()
{
delete m_levelList;
m_levelList = 0;
delete [] m_topic;
m_topic = 0;
}
const char* MqttTopic::getTopicString() const
{
return m_topic;
}
bool MqttTopic::hasWildcards() const
{
return m_hasWildcards;
}
void MqttTopic::appendLevel(TopicLevel* level)
{
if (0 == m_levelList)
{
m_levelList = level;
}
else
{
m_levelList->append(level);
}
}
TopicLevel* MqttTopic::getLevelList() const
{
return m_levelList;
}
//-----------------------------------------------------------------------------
const unsigned int MqttTopicPublisher::s_maxDataSize = 500;
const bool MqttTopicPublisher::DO_AUTO_PUBLISH = true;
const bool MqttTopicPublisher::DONT_AUTO_PUBLISH = false;
MqttTopicPublisher::MqttTopicPublisher(const char* topic, const char* data, bool isAutoPublish)
: MqttTopic(topic)
, m_next(0)
, m_data(new char[s_maxDataSize+1])
, m_isAutoPublish(isAutoPublish)
{
memset(m_data, 0, s_maxDataSize+1);
strncpy(m_data, data, s_maxDataSize);
MqttClientController::Instance()->addMqttPublisher(this);
if (m_isAutoPublish)
{
int r = MqttClientController::Instance()->publish(getTopicString(), m_data);
if (0 == r)
{
TR_PRINTF(MqttClientController::Instance()->trPort(), DbgTrace_Level::error, "ERROR! - publish failed");
}
}
}
MqttTopicPublisher::~MqttTopicPublisher()
{
MqttClientController::Instance()->deletePublisher(this);
}
void MqttTopicPublisher::setData(const char* data)
{
memset(m_data, 0, s_maxDataSize+1);
strncpy(m_data, data, s_maxDataSize);
}
const char* MqttTopicPublisher::getData() const
{
return m_data;
}
void MqttTopicPublisher::publish(const char* data)
{
int r = MqttClientController::Instance()->publish(getTopicString(), data);
if (0 == r)
{
TR_PRINTF(MqttClientController::Instance()->trPort(), DbgTrace_Level::error, "ERROR! - publish failed");
}
}
void MqttTopicPublisher::publish()
{
int r = MqttClientController::Instance()->publish(getTopicString(), m_data);
if (0 == r)
{
TR_PRINTF(MqttClientController::Instance()->trPort(), DbgTrace_Level::error, "ERROR! - publish failed");
}
}
void MqttTopicPublisher::publishAll()
{
if (m_isAutoPublish)
{
int r = MqttClientController::Instance()->publish(getTopicString(), m_data);
if (0 == r)
{
TR_PRINTF(MqttClientController::Instance()->trPort(), DbgTrace_Level::error, "ERROR! - publish failed");
}
}
if (0 != next())
{
next()->publishAll();
}
}
void MqttTopicPublisher::setNext(MqttTopicPublisher* mqttPublisher)
{
m_next = mqttPublisher;
}
MqttTopicPublisher* MqttTopicPublisher::next()
{
return m_next;
}
//-----------------------------------------------------------------------------
const unsigned int MqttRxMsg::s_maxRxMsgSize = 500;
MqttRxMsg::MqttRxMsg()
: m_rxTopic(0)
, m_rxMsg(new char[s_maxRxMsgSize+1])
, m_rxMsgSize(0)
{
memset(m_rxMsg, 0, s_maxRxMsgSize+1);
}
MqttRxMsg::~MqttRxMsg()
{
delete [] m_rxMsg;
m_rxMsg = 0;
delete m_rxTopic;
m_rxTopic = 0;
}
void MqttRxMsg::prepare(const char* topic, const char* payload, unsigned int length)
{
if (length > s_maxRxMsgSize)
{
m_rxMsgSize = s_maxRxMsgSize;
}
else
{
m_rxMsgSize = length;
}
memcpy(m_rxMsg, payload, length);
m_rxMsg[m_rxMsgSize] = 0;
delete m_rxTopic;
m_rxTopic = new MqttTopic(topic);
}
MqttTopic* MqttRxMsg::getRxTopic() const
{
return m_rxTopic;
}
const char* MqttRxMsg::getRxMsgString() const
{
return m_rxMsg;
}
const unsigned int MqttRxMsg::getRxMsgSize() const
{
return m_rxMsgSize;
}
//-----------------------------------------------------------------------------
MqttTopicSubscriber::MqttTopicSubscriber(const char* topic)
: MqttTopic(topic)
, m_next(0)
{
MqttClientController::Instance()->addMqttSubscriber(this);
MqttClientController::Instance()->subscribe(topic);
}
MqttTopicSubscriber::~MqttTopicSubscriber()
{
MqttClientController::Instance()->unsubscribe(getTopicString());
MqttClientController::Instance()->deleteSubscriber(this);
}
void MqttTopicSubscriber::setNext(MqttTopicSubscriber* mqttSubscriber)
{
m_next = mqttSubscriber;
}
bool MqttTopicSubscriber::isMyTopic(MqttRxMsg* rxMsg) const
{
bool ismytopic = false;
if ((0 != rxMsg) && (0 != rxMsg->getRxTopic()))
{
if (hasWildcards())
{
// handle smart compare
bool stillMatch = true;
TopicLevel* subscriberTopicLevel = getLevelList();
TopicLevel* rxTopicLevel = rxMsg->getRxTopic()->getLevelList();
while(stillMatch && (0 != subscriberTopicLevel) && (0 != rxTopicLevel))
{
if (TopicLevel::eTWC_None == subscriberTopicLevel->getWildcardType())
{
stillMatch &= (strcmp(subscriberTopicLevel->level(), rxTopicLevel->level()) == 0);
}
subscriberTopicLevel = subscriberTopicLevel->next();
rxTopicLevel = rxTopicLevel->next();
}
ismytopic = stillMatch;
}
else
{
if (strcmp(getTopicString(), rxMsg->getRxTopic()->getTopicString()) == 0)
{
ismytopic = true;
}
}
}
return ismytopic;
}
void MqttTopicSubscriber::handleMessage(MqttRxMsg* rxMsg, DbgTrace_Port* trPortMqttRx)
{
if ((0 != trPortMqttRx) && (0 != rxMsg) && (0 != rxMsg->getRxTopic()))
{
TR_PRINTF(trPortMqttRx, DbgTrace_Level::debug, "MqttTopicSubscriber::handleMessage(), topic: %s, rx topic: %s, rx msg: %s", getTopicString(), rxMsg->getRxTopic()->getTopicString(), rxMsg->getRxMsgString());
}
bool msgHasBeenHandled = false;
if (isMyTopic(rxMsg))
{
// take responsibility
msgHasBeenHandled = processMessage(rxMsg);
}
if (!msgHasBeenHandled)
{
if (0 != next())
{
next()->handleMessage(rxMsg, trPortMqttRx);
}
}
}
void MqttTopicSubscriber::subscribe()
{
MqttClientController::Instance()->subscribe(getTopicString());
if (0 != next())
{
next()->subscribe();
}
}
MqttTopicSubscriber* MqttTopicSubscriber::next()
{
return m_next;
}
//-----------------------------------------------------------------------------
DefaultMqttSubscriber::DefaultMqttSubscriber(const char* topic)
: MqttTopicSubscriber(topic)
, m_trPort(new DbgTrace_Port("mqttdfltsub", DbgTrace_Level::debug))
{ }
bool DefaultMqttSubscriber::processMessage(MqttRxMsg* rxMsg)
{
bool msgHasBeenHandled = false;
if (0 != rxMsg)
{
msgHasBeenHandled = true;
TR_PRINTF(m_trPort, DbgTrace_Level::debug, "DefaultMqttSubscriber (%s), rx: [%s] %s", getTopicString(), rxMsg->getRxTopic()->getTopicString(), rxMsg->getRxMsgString());
}
return msgHasBeenHandled;
}
//-----------------------------------------------------------------------------
DefaultMqttPublisher::DefaultMqttPublisher(const char* topic, const char* data)
: MqttTopicPublisher(topic, data)
, m_trPort(new DbgTrace_Port("mqttdfltpub", DbgTrace_Level::debug))
{ }
void DefaultMqttPublisher::publish(const char* data)
{
TR_PRINTF(m_trPort, DbgTrace_Level::debug, "DefaultMqttPublisher (%s), tx: %s", getTopicString(), data);
MqttTopicPublisher::publish(data);
}
| 22.429245 | 210 | 0.641115 | ERNICommunity |
6b08b4ee5129bbb1564727a367e2e3bcdcd6b66f | 1,845 | cpp | C++ | test/map_tests.cpp | jmsktm/CarND-Path-Planning-Project | f23f673655ba95a9e8c1e8b01f4d971631cb4880 | [
"MIT"
] | 1 | 2019-11-18T00:35:08.000Z | 2019-11-18T00:35:08.000Z | test/map_tests.cpp | jmsktm/CarND-Path-Planning-Project | f23f673655ba95a9e8c1e8b01f4d971631cb4880 | [
"MIT"
] | null | null | null | test/map_tests.cpp | jmsktm/CarND-Path-Planning-Project | f23f673655ba95a9e8c1e8b01f4d971631cb4880 | [
"MIT"
] | null | null | null | #define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include <string>
#include <vector>
#include "../src/map.h"
#include "../src/waypoint.h"
using std::string;
using std::vector;
TEST_CASE("Map should contain a list of endpoints on initialization") {
Map map = Map();
vector<Waypoint> waypoints = map.getWaypoints();
REQUIRE(waypoints.size() == 181); // There are 181 waypoints in provided data file.
REQUIRE(map.get_waypoints_x().size() == 181);
REQUIRE(map.get_waypoints_y().size() == 181);
REQUIRE(map.get_waypoints_s().size() == 181);
REQUIRE(map.get_waypoints_dx().size() == 181);
REQUIRE(map.get_waypoints_dy().size() == 181);
}
SCENARIO("Test for waypoints against data from provided file") {
Map map = Map();
vector<Waypoint> waypoints = map.getWaypoints();
// Rounding off to account for unpredictably changing precision
#define roundz(x,d) ((floor(((x)*pow(10,d))+.5))/pow(10,d))
auto [row, x, y, s, dx, dy] = GENERATE(table<int, double, double, double, double, double> ({
{ 0, 784.6, 1135.57, 0, -0.0235983, -0.999722},
{ 1, 815.268, 1134.93, 30.6745, -0.0109948, -0.99994 }
}));
GIVEN("Given the records in data/highway_map.csv")
WHEN("I consider row: " << row)
THEN("I should have (x, y, s, dx, dy) == (" << x << ", " << y << ", " << s << ", " << dx << ", " << dy << ")") {
std::cout << "(" << x << ", " << y << ", " << s << ", " << dx << ", " << dy << ")" << std::endl;
REQUIRE(roundz(waypoints.at(row).get_x(), 2) == roundz(x, 2));
REQUIRE(roundz(waypoints.at(row).get_y(), 2) == roundz(y, 2));
REQUIRE(roundz(waypoints.at(row).get_s(), 2) == roundz(s, 2));
REQUIRE(roundz(waypoints.at(row).get_dx(), 2) == roundz(dx, 2));
REQUIRE(roundz(waypoints.at(row).get_dy(), 2) == roundz(dy, 2));
}
} | 40.108696 | 116 | 0.582114 | jmsktm |
6b08fe9f98e5c286507ff4b048e1f2c44830bd43 | 6,675 | hpp | C++ | Source/VkToolbox/Camera.hpp | glampert/VulkanDemo | cd9cae2dcbc790bbe6c42f811cb3aee792242ae0 | [
"MIT"
] | null | null | null | Source/VkToolbox/Camera.hpp | glampert/VulkanDemo | cd9cae2dcbc790bbe6c42f811cb3aee792242ae0 | [
"MIT"
] | null | null | null | Source/VkToolbox/Camera.hpp | glampert/VulkanDemo | cd9cae2dcbc790bbe6c42f811cb3aee792242ae0 | [
"MIT"
] | null | null | null | #pragma once
// ================================================================================================
// File: VkToolbox/Camera.hpp
// Author: Guilherme R. Lampert
// Created on: 24/04/17
// Brief: Simple first person camera.
// ================================================================================================
#include "Utils.hpp"
#include "External.hpp"
namespace VkToolbox
{
// ========================================================
// class Camera:
// ========================================================
class Camera final
{
public:
//
// First person camera
//
// (up)
// +Y +Z (forward)
// | /
// | /
// | /
// + ------ +X (right)
// (eye)
//
Vector3 right;
Vector3 up;
Vector3 forward;
Vector3 eye;
Matrix4 viewMatrix;
Matrix4 projMatrix;
Matrix4 vpMatrix;
float rotateSpeed = 27.0f; // Mouse rotation
float moveSpeed = 6.0f; // Keyboard camera movement
float maxPitchAngle = 89.5f; // Max degrees of rotation to avoid lock
float pitchAmount = 0.0f; // Stored from latest update
float fovYDegrees = 0.0f; // Set via constructor or adjustFov() (in degrees!)
float aspectRatio = 0.0f; // srcWidth / scrHeight
float nearPlane = 0.0f; // zNear
float farPlane = 0.0f; // zFar
enum MoveDir
{
Forward, // Move forward relative to the camera's space
Back, // Move backward relative to the camera's space
Left, // Move left relative to the camera's space
Right // Move right relative to the camera's space
};
Camera() = default;
void setup(const float scrWidth, const float scrHeight,
const float fovYDegs, const float zNear, const float zFar,
const Vector3 & rV, const Vector3 & upV, const Vector3 & fwdV, const Vector3 & eyePos)
{
right = rV;
up = upV;
forward = fwdV;
eye = eyePos;
viewMatrix = Matrix4::identity();
vpMatrix = Matrix4::identity();
adjustFov(scrWidth, scrHeight, fovYDegs, zNear, zFar);
}
void adjustFov(const float scrWidth, const float scrHeight,
const float fovYDegs, const float zNear, const float zFar)
{
fovYDegrees = fovYDegs;
aspectRatio = scrWidth / scrHeight;
nearPlane = zNear;
farPlane = zFar;
projMatrix = Matrix4::perspective(fovYDegrees * DegToRad, aspectRatio, nearPlane, farPlane);
}
void pitch(const float angle)
{
// Pitches camera by 'angle' radians.
forward = rotateAroundAxis(forward, right, angle); // Calculate new forward.
up = cross(forward, right); // Calculate new camera up vector.
}
void rotate(const float angle)
{
// Rotates around world Y-axis by the given angle (in radians).
const float sinAng = std::sin(angle);
const float cosAng = std::cos(angle);
float xxx, zzz;
// Rotate forward vector:
xxx = forward[0];
zzz = forward[2];
forward[0] = xxx * cosAng + zzz * sinAng;
forward[2] = xxx * -sinAng + zzz * cosAng;
// Rotate up vector:
xxx = up[0];
zzz = up[2];
up[0] = xxx * cosAng + zzz * sinAng;
up[2] = xxx * -sinAng + zzz * cosAng;
// Rotate right vector:
xxx = right[0];
zzz = right[2];
right[0] = xxx * cosAng + zzz * sinAng;
right[2] = xxx * -sinAng + zzz * cosAng;
}
void move(const MoveDir dir, const float amount)
{
switch (dir)
{
case Camera::Forward : eye += forward * amount; break;
case Camera::Back : eye -= forward * amount; break;
case Camera::Left : eye -= right * amount; break;
case Camera::Right : eye += right * amount; break;
} // switch (dir)
}
void checkKeyboardMovement(const bool wDown, const bool sDown,
const bool aDown, const bool dDown,
const float deltaSeconds)
{
if (aDown) { move(Camera::Left, moveSpeed * deltaSeconds); }
if (dDown) { move(Camera::Right, moveSpeed * deltaSeconds); }
if (wDown) { move(Camera::Forward, moveSpeed * deltaSeconds); }
if (sDown) { move(Camera::Back, moveSpeed * deltaSeconds); }
}
void checkMouseRotation(const int mouseDeltaX, const int mouseDeltaY, const float deltaSeconds)
{
// Rotate left/right:
float amt = mouseDeltaX * rotateSpeed * deltaSeconds;
rotate(amt * DegToRad);
// Calculate amount to rotate up/down:
amt = mouseDeltaY * rotateSpeed * deltaSeconds;
// Clamp pitch amount:
if ((pitchAmount + amt) <= -maxPitchAngle)
{
amt = -maxPitchAngle - pitchAmount;
pitchAmount = -maxPitchAngle;
}
else if ((pitchAmount + amt) >= maxPitchAngle)
{
amt = maxPitchAngle - pitchAmount;
pitchAmount = maxPitchAngle;
}
else
{
pitchAmount += amt;
}
pitch(-amt * DegToRad);
}
void updateMatrices()
{
viewMatrix = Matrix4::lookAt(Point3{ eye }, lookAtTarget(), -up);
vpMatrix = projMatrix * viewMatrix; // Vectormath lib uses column-major OGL style, so multiply P*V*M
}
Point3 lookAtTarget() const
{
return { eye[0] + forward[0], eye[1] + forward[1], eye[2] + forward[2] };
}
static Vector3 rotateAroundAxis(const Vector3 & vec, const Vector3 & axis, const float angle)
{
const float sinAng = std::sin(angle);
const float cosAng = std::cos(angle);
const float oneMinusCosAng = (1.0f - cosAng);
const float aX = axis[0];
const float aY = axis[1];
const float aZ = axis[2];
float x = (aX * aX * oneMinusCosAng + cosAng) * vec[0] +
(aX * aY * oneMinusCosAng + aZ * sinAng) * vec[1] +
(aX * aZ * oneMinusCosAng - aY * sinAng) * vec[2];
float y = (aX * aY * oneMinusCosAng - aZ * sinAng) * vec[0] +
(aY * aY * oneMinusCosAng + cosAng) * vec[1] +
(aY * aZ * oneMinusCosAng + aX * sinAng) * vec[2];
float z = (aX * aZ * oneMinusCosAng + aY * sinAng) * vec[0] +
(aY * aZ * oneMinusCosAng - aX * sinAng) * vec[1] +
(aZ * aZ * oneMinusCosAng + cosAng) * vec[2];
return { x, y, z };
}
};
} // namespace VkToolbox
| 32.560976 | 110 | 0.523296 | glampert |
6b0eef0248262580b298fe3acf93129e143788e5 | 221 | cpp | C++ | src/Native/search_bndm64.cpp | tcwz/vs-chromium | 81b39383940f17c642f5a4fbfe2b881768c315bc | [
"BSD-3-Clause"
] | 251 | 2015-02-26T21:28:34.000Z | 2022-03-30T12:32:12.000Z | src/Native/search_bndm64.cpp | tcwz/vs-chromium | 81b39383940f17c642f5a4fbfe2b881768c315bc | [
"BSD-3-Clause"
] | 72 | 2015-03-11T03:54:46.000Z | 2022-01-21T10:23:12.000Z | src/Native/search_bndm64.cpp | tcwz/vs-chromium | 81b39383940f17c642f5a4fbfe2b881768c315bc | [
"BSD-3-Clause"
] | 88 | 2015-03-04T07:02:26.000Z | 2022-01-30T23:06:31.000Z | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "stdafx.h"
#include "search_bndm64.h"
| 27.625 | 74 | 0.723982 | tcwz |
6b0ef1ebbed1e1a22bbaf91a20089a81bbf4f550 | 38,968 | hpp | C++ | apps/evaluate_compression/include/pcl/apps/evaluate_compression/impl/evaluate_compression_impl.hpp | cwi-dis/cwipc_codec | 35c3663c81e90183e0d353505c81175f04ab9022 | [
"MIT"
] | null | null | null | apps/evaluate_compression/include/pcl/apps/evaluate_compression/impl/evaluate_compression_impl.hpp | cwi-dis/cwipc_codec | 35c3663c81e90183e0d353505c81175f04ab9022 | [
"MIT"
] | null | null | null | apps/evaluate_compression/include/pcl/apps/evaluate_compression/impl/evaluate_compression_impl.hpp | cwi-dis/cwipc_codec | 35c3663c81e90183e0d353505c81175f04ab9022 | [
"MIT"
] | null | null | null | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2014- Centrum Wiskunde en Informatica
* 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 copyright holder (s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
//
// evaluate_compression.hpp
// evaluate_compression
//
// Created by Kees Blom on 01/06/16.
//
//
#ifndef evaluate_compression_hpp
#define evaluate_compression_hpp
#if defined(_OPENMP)
#include <omp.h>
#endif//defined(_OPENMP)
// c++ standard library
#include <fstream>
#include <vector>
#include <ctime> // for 'strftime'
#include <exception>
// boost library
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/exception/diagnostic_information.hpp>
namespace po = boost::program_options;
// point cloud library
#include <pcl/point_cloud.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/ply_io.h>
#include <pcl/compression/octree_pointcloud_compression.h>
#include <pcl/cloud_codec_v2/point_cloud_codec_v2.h>
#include <pcl/filters/radius_outlier_removal.h>
#ifdef WITH_VTK
#include <pcl/visualization/pcl_visualizer.h>
#include <vtkRenderWindow.h>
#include <vtkRect.h>
#endif/*WITH_VTK*/
#ifdef WIN32
#include <direct.h>
#include <stdlib.h>
#include <stdio.h>
#endif//WIN32
#include <evaluate_compression.h>
#include <quality_metrics.h>
template<typename PointT>
class evaluate_compression_impl : evaluate_compression {
// using boost::exception on errors
public:
evaluate_compression_impl (int argc, char** argv) : evaluate_compression (argc, argv), debug_level_ (3) {};
bool evaluate_group(std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > >& group, std::stringstream& compression_settings, std::ofstream& intra_frame_quality_csv, std::ofstream& predictive_quality_csv);
// options handling
void initialize_options_description ();
bool get_options (int argc, char** argv);
void assign_option_values ();
po::options_description desc_;
po::variables_map vm_;
po::positional_options_description pod_;
// preprocessing, encoding, decoding, quality assessment void complete_initialization ();
void complete_initialization ();
#ifdef WITH_VTK
typedef pcl::visualization::PCLVisualizer* ViewerPtr;
ViewerPtr viewer_decoded_, viewer_delta_decoded_, viewer_original_;
int viewer_decoded_window_position_[2];
int viewer_delta_decoded_window_position_[2];
#endif//WITH_VTK
void do_outlier_removal (std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > >& pointcloud);
pcl::io::BoundingBox do_bounding_box_normalization (std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > >& pointcloud);
void do_encoding (pcl::shared_ptr<pcl::PointCloud<PointT> > point_cloud, std::stringstream* coded_stream, QualityMetric & achieved_quality);
bool do_decoding (std::stringstream* coded_stream, pcl::shared_ptr<pcl::PointCloud<PointT> > pointcloud, QualityMetric & achieved_quality);
void do_delta_encoding (pcl::shared_ptr<pcl::PointCloud<PointT> > i_cloud, pcl::shared_ptr<pcl::PointCloud<PointT> > p_cloud, pcl::shared_ptr<pcl::PointCloud<PointT> > out_cloud, std::stringstream* i_stream, std::stringstream* p__stream, QualityMetric & quality_metric);
bool do_delta_decoding (std::stringstream* i_stream, std::stringstream* p_stream, pcl::shared_ptr<pcl::PointCloud<PointT> > i_cloud, pcl::shared_ptr<pcl::PointCloud<PointT> > out_cloud, QualityMetric & qualityMetric);
void do_quality_computation (pcl::shared_ptr<pcl::PointCloud<PointT> > & pointcloud, pcl::shared_ptr<pcl::PointCloud<PointT> > &reference_pointcloud, QualityMetric & quality_metric);
void do_output (std::string path, pcl::shared_ptr<pcl::PointCloud<PointT> > pointcloud, QualityMetric & qualityMetric);
// V1 (common) settings
pcl::shared_ptr<pcl::io::OctreePointCloudCompression<PointT> > encoder_V1_;
pcl::shared_ptr<pcl::io::OctreePointCloudCompression<PointT> > decoder_V1_;
// V2 specific
pcl::shared_ptr<pcl::io::OctreePointCloudCodecV2<PointT> > encoder_V2_;
pcl::shared_ptr<pcl::io::OctreePointCloudCodecV2<PointT> > decoder_V2_;
bool evaluate (); // TBD need catch exceptions
void do_visualization (std::string id, pcl::shared_ptr<pcl::PointCloud<PointT> > pointcloud);
int debug_level_;
};
template<typename PointT>
void
evaluate_compression_impl<PointT>::initialize_options_description ()
{
desc_.add_options ()
("help,h", "produce help message ")
("K_outlier_filter,K",po::value<int> ()->default_value (0), "K neighbours for radius outlier filter ")
("radius",po::value<double> ()->default_value (0.01), "radius outlier filter, maximum radius ")
("group_size,g",po::value<int> ()->default_value (0), "maximum number of files to be compressed together (0=read all files, then en(de)code 1 by 1)")
("bb_expand_factor,f", po::value<double> ()->default_value (0.20), "bounding box expansion to keep bounding box accross frames")
("algorithm,a",po::value<std::string> ()->default_value ("V2"), "compression algorithm ('V1' or 'V2')")
("input_directories,i", po::value<std::vector<std::string> > (), "Directory containing supported files (.pcd or .ply)")
("output_directory,o", po::value<std::string> ()->default_value (""), "Directory to store decompressed pointclouds (.ply)")
("show_statistics,s",po::value<bool> ()->default_value (false)->implicit_value (true), "gather and show a bunch of releavant statistical data")
("visualization,v",po::value<bool> ()->default_value (false)->implicit_value (true), "show both original and decoded PointClouds graphically")
("point_resolution,p", po::value<double> ()->default_value (0.20), "XYZ resolution of point coordinates")
("octree_resolution,r", po::value<double> ()->default_value (0.20), "voxel size")
// V2 specific
("octree_bits,b", po::value<int> ()->default_value (11), "octree resolution (bits)")
("color_bits,c", po::value<int> ()->default_value (8), "color resolution (bits)")
("enh_bits,e", po::value<int> ()->default_value (0), "bits to code the points towards the center ")
("color_coding_type,t", po::value<int> ()->default_value (1), "pcl=0,jpeg=1 or graph transform ")
("macroblock_size,m",po::value<int> ()->default_value (16), "size of macroblocks used for predictive frame (must be power of 2)")
("keep_centroid", po::value<int> ()->default_value (0), "keep voxel grid positions or not ")
("create_scalable", po::value<bool> ()->default_value (false), "create scalable bitstream (not yet implemented)")
("do_connectivity_coding", po::value<bool> ()->default_value (false), "connectivity coding (not yet implemented)")
("icp_on_original", po::value<bool> ()->default_value (false),"icp_on_original ") // iterative closest point
("jpeg_quality,j", po::value<int> ()->default_value (0), "jpeg quality parameter ")
("do_delta_coding,d", po::value<bool> ()->default_value (false),"use delta (predictive) en(de)coding ")
("do_quality_computation,q", po::value<bool> ()->default_value (false),"compute quality of en(de)coding")
("do_icp_color_offset",po::value<bool> ()->default_value (false), "do color offset coding on predictive frames")
("num_threads,n",po::value<int> ()->default_value (1), "number of omp cores (1=default, 1 thread, no parallel execution)")
("intra_frame_quality_csv", po::value<std::string>()->default_value("intra_frame_quality.csv")," intra frame coding quality results file name (.csv file)")
("predictive_quality_csv",po::value<std::string>()->default_value("predictive_quality.csv"), " predictive coding quality results file name (.csv file)")
("debug_level",po::value<int> ()->default_value (0), "debug print level (0=no debug print, 3=all debug print)")
;
pod_.add ("input_directories", -1);
}
inline void
print_options (po::variables_map vm) {
for (po::variables_map::iterator it = vm.begin (); it != vm.end (); it++) {
std::cout << "\t " << it->first;
if ( ( (boost::any)it->second.value ()).empty ()) {
std::cout << " (empty)";
}
if (vm[it->first].defaulted () || it->second.defaulted ()) {
std::cout << " (default)";
}
std::cout << "=";
bool is_char;
try {
boost::any_cast<const char *> (it->second.value ());
is_char = true;
} catch (const boost::bad_any_cast &) {
is_char = false;
}
bool is_str;
try {
boost::any_cast<std::string> (it->second.value ());
is_str = true;
} catch (const boost::bad_any_cast &) {
is_str = false;
}
bool is_vector;
try {
boost::any_cast<std::vector<int> > (it->second.value ());
is_vector = true;
} catch (const boost::bad_any_cast &) {
is_vector = false;
}
if ( ( (boost::any)it->second.value ()).type () == typeid (int)) {
std::cout << vm[it->first].as<int> () << std::endl;
} else if ( ( (boost::any)it->second.value ()).type () == typeid (bool)) {
std::cout << vm[it->first].as<bool> () << std::endl;
} else if ( ( (boost::any)it->second.value ()).type () == typeid (double)) {
std::cout << vm[it->first].as<double> () << std::endl;
} else if (is_char) {
std::cout << vm[it->first].as<const char * > () << std::endl;
} else if (is_str) {
std::string temp = vm[it->first].as<std::string> ();
if (temp.size ()) {
std::cout << temp << std::endl;
} else {
std::cout << "<empty>" << std::endl;
}
} else if (is_vector) {
std::vector<int> temp = vm[it->first].as<std::vector<int> > ();
if (temp.size ()) {
std::cout << "{";
for (int i = 0; i < temp.size (); i++) {
if (i) std::cout << ",";
std::cout << temp[i];
}
std::cout << "}\n";
} else {
std::cout << "<empty>" << std::endl;
}
} else { // Assumes that the only left is vector<string>
try {
std::vector<std::string> vect = vm[it->first].as<std::vector<std::string> > ();
unsigned int i = 0;
for (std::vector<std::string>::iterator oit=vect.begin ();
oit != vect.end (); oit++, ++i) {
std::cout << "\r> " << it->first << "[" << i << "]=" << (*oit) << std::endl;
}
} catch (const boost::bad_any_cast &) {
std::cout << "UnknownType (" << ( (boost::any)it->second.value ()).type ().name () << ")" << std::endl;
}
}
}
}
template<typename PointT>
bool
evaluate_compression_impl<PointT>::get_options (int argc, char** argv)
{
// first parse configuration file, then parse command line options
// po::variables_map vm;
// po::store (po::parse_config_file (in_conf, desc), vm);
// po::notify (vm);
// Check if optional file 'parameter_config.txt' is present in parent or current working directory
bool use_parent = true, has_config = true, return_value = true;
std::ifstream config_file ("..//parameter_config.txt");
if (config_file.fail ()) {
use_parent = false;
config_file.open ("parameter_config.txt");
if (config_file.fail ()) {
std::cerr << " Optional file 'parameter_config.txt' not found in '" << boost::filesystem::current_path ().string ().c_str () << "' or its parent.\n";
has_config = false;
}
}
if (has_config) {
if (debug_level_ >= 2) {
std::cerr << "Using '" << boost::filesystem::current_path ().c_str ();
if (use_parent) {
std::cerr << "/..";
}
std::cerr << "/parameter_config.txt'\n";
}
}
// first parse command line options, then parse configuration file
// Since parsed options are immutable, this has the effect that command line options take precedence
bool allow_unregistered = true;
po::parsed_options parsed_options = po::command_line_parser (argc, argv).options (desc_).positional (pod_).allow_unregistered ().run ();
std::vector<std::string> unrecognized_options = po::collect_unrecognized (parsed_options.options, po::exclude_positional);
if (unrecognized_options.size () > 0) {
std::cerr << "Unrecognized options on command line:\n";
for (std::vector<std::string>::iterator itr= unrecognized_options.begin (); itr != unrecognized_options.end (); itr++) {
std::string unrecognized = *itr;
std::cerr << unrecognized.c_str () << "\n";
}
} else {
po::store (parsed_options, vm_);
po::notify (vm_);
parsed_options = po::parse_config_file (config_file, desc_, allow_unregistered);
unrecognized_options = po::collect_unrecognized (parsed_options.options, po::exclude_positional);
if (unrecognized_options.size () > 0) {
std::cerr << "Unrecognized options in configuration file:\n";
for (std::vector<std::string>::iterator itr= unrecognized_options.begin (); itr != unrecognized_options.end (); itr++) {
std::string unrecognized = *itr;
std::cerr << unrecognized.c_str () << "\n";
}
return_value = false;
} else {
po::store (parsed_options, vm_);
po::notify (vm_);
}
}
return return_value;
}
template<typename PointT>
void
evaluate_compression_impl<PointT>::assign_option_values ()
{
algorithm_ = vm_["algorithm"].template as<std::string> ();
group_size_ = vm_["group_size"].template as<int> ();
K_outlier_filter_ = vm_["K_outlier_filter"].template as<int> ();
radius_ = vm_["radius"].template as<double> ();
bb_expand_factor_ = vm_["bb_expand_factor"].template as<double> ();
show_statistics_ = vm_["show_statistics"].template as<bool> ();
enh_bits_ = vm_["enh_bits"].template as<int> ();
octree_bits_ = vm_["octree_bits"].template as<int> ();
color_bits_ = vm_["color_bits"].template as<int> ();
visualization_ = vm_["visualization"].template as<bool> ();
if (vm_.count ("input_directories")) {
input_directories_ = vm_["input_directories"].template as<std::vector<std::string> > ();
}
output_directory_ = vm_["output_directory"].template as<std::string> ();
if (algorithm_ == "V2")
{
color_coding_type_ = vm_["color_coding_type"].template as<int> ();
macroblock_size_ = vm_["macroblock_size"].template as<int> ();
keep_centroid_ = vm_["keep_centroid"].template as<int> ();
create_scalable_ = vm_["create_scalable"].template as<bool> ();
jpeg_quality_ = vm_["jpeg_quality"].template as<int> ();
do_delta_coding_ = vm_["do_delta_coding"].template as<bool> ();
do_quality_computation_ = vm_["do_quality_computation"].template as<bool> ();
icp_on_original_ = vm_["icp_on_original"].template as<bool> ();
do_icp_color_offset_ = vm_["do_icp_color_offset"].template as<bool> ();
num_threads_ = vm_["num_threads"].template as<int> ();
intra_frame_quality_csv_ = vm_["intra_frame_quality_csv"].template as<std::string>();
predictive_quality_csv_ = vm_["predictive_quality_csv"].template as<std::string>();
}
}
template<typename PointT>
void
evaluate_compression_impl<PointT>::complete_initialization ()
{
// encoder, decoder
if (algorithm_ == "V1")
{
encoder_V1_ = pcl::shared_ptr<pcl::io::OctreePointCloudCompression<PointT> > (
new pcl::io::OctreePointCloudCompression<PointT> (
pcl::io::MANUAL_CONFIGURATION,
show_statistics_,
octree_bits_ > 0 ? std::pow ( 2.0, -1.0 * octree_bits_) : point_resolution_,
octree_bits_ > 0 ? std::pow ( 2.0, -1.0 * octree_bits_) : point_resolution_,
false, // no intra voxel coding in this first version of the codec
0, // i_frame_rate,
color_bits_ > 0 ? true : false,
color_bits_
)
);
decoder_V1_ = pcl::shared_ptr<pcl::io::OctreePointCloudCompression<PointT> > (
new pcl::io::OctreePointCloudCompression<PointT> (
pcl::io::MANUAL_CONFIGURATION,
false,
octree_bits_ > 0 ? std::pow ( 2.0, -1.0 * octree_bits_) : point_resolution_,
octree_bits_ > 0 ? std::pow ( 2.0, -1.0 * octree_bits_) : point_resolution_,
false, // no intra voxel coding in this first version of the codec
0, // i_frame_rate,
color_bits_ > 0 ? true : false,
color_bits_
)
);
}
else
{
if (algorithm_ == "V2")
{
encoder_V2_ = pcl::shared_ptr<pcl::io::OctreePointCloudCodecV2<PointT> > (
new pcl::io::OctreePointCloudCodecV2<PointT> (
pcl::io::MANUAL_CONFIGURATION,
show_statistics_,
(octree_bits_ > 0 ? std::pow ( 2.0, -1.0 * (octree_bits_ + enh_bits_) ) : // XXX
point_resolution_),
(octree_bits_ > 0 ? std::pow ( 2.0, -1.0 * octree_bits_) : // XXX
point_resolution_),
true, // no intra voxel coding in this first version of the codec
0, // i_frame_rate,
color_bits_ > 0 ? true : false, // doColorEncoding
color_bits_, // colorResolution
color_coding_type_,
keep_centroid_,
create_scalable_, // not implemented
false, // do_connectivity_coding_ not implemented
jpeg_quality_,
num_threads_
));
decoder_V2_ = pcl::shared_ptr<pcl::io::OctreePointCloudCodecV2<PointT> > (
new pcl::io::OctreePointCloudCodecV2<PointT> (
pcl::io::MANUAL_CONFIGURATION,
false,
octree_bits_ > 0 ? std::pow ( 2.0, -1.0 * (octree_bits_ + enh_bits_) ) : // XXX
point_resolution_,
octree_bits_ > 0 ? std::pow ( 2.0, -1.0 * octree_bits_) : // XXX
point_resolution_,
true, // no intra voxel coding in this first version of the codec
0, // i_frame_rate,
color_bits_ > 0 ? true : false,
color_bits_,
color_coding_type_,
keep_centroid_,
create_scalable_, // not implemented
false, // do_connectivity_coding_, not implemented
jpeg_quality_,
num_threads_
));
encoder_V2_->setMacroblockSize (macroblock_size_);
// icp offset coding
encoder_V2_->setDoICPColorOffset (do_icp_color_offset_);
}
}
if (output_directory_ != "")
{
boost::filesystem::path out_dir_path(output_directory_);
if ( ! exists(out_dir_path) && ! boost::filesystem::create_directory(out_dir_path))
{
std::cout << "Can't create output_directory '"+output_directory_+"'\n";;
}
}
}
template<typename PointT>
void
evaluate_compression_impl<PointT>::do_outlier_removal (std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > >& group)
{
pcl::io::OctreePointCloudCodecV2 <PointT>::remove_outliers (group, K_outlier_filter_, radius_, debug_level_);
}
template<typename PointT>
pcl::io::BoundingBox
evaluate_compression_impl<PointT>::do_bounding_box_normalization (std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > >& group)
{
std::vector<float> dyn_range, offset;
std::vector<pcl::io::BoundingBox, Eigen::aligned_allocator<pcl::io::BoundingBox> > bounding_boxes (group.size ());
return pcl::io::OctreePointCloudCodecV2 <PointT>::normalize_pointclouds (group, bounding_boxes, bb_expand_factor_, dyn_range, offset, debug_level_);
}
template<typename PointT>
void
evaluate_compression_impl<PointT>::do_encoding (pcl::shared_ptr<pcl::PointCloud<PointT> > pointcloud, std::stringstream* stream, QualityMetric & qualityMetric)
{
pcl::console::TicToc tt;
int initial_stream_pos = stream->tellp ();
if (algorithm_ == "V1")
{
tt.tic ();
encoder_V1_->encodePointCloud (pointcloud , *stream);
qualityMetric.encoding_time_ms = tt.toc ();
}
else
{
if (algorithm_ == "V2")
{
tt.tic ();
encoder_V2_->encodePointCloud (pointcloud , *stream, 0);
qualityMetric.encoding_time_ms = tt.toc ();
// store the partial bytes sizes
uint64_t *c_sizes = encoder_V2_->getPerformanceMetrics ();
qualityMetric.byte_count_octree_layer = c_sizes[0];
qualityMetric.byte_count_centroid_layer = c_sizes[1];
qualityMetric.byte_count_color_layer = c_sizes[2];
}
}
qualityMetric.compressed_size = (int) stream->tellp () - initial_stream_pos;
std::cout << " octreeCoding " << qualityMetric.compressed_size << " bytes base layer " << std::endl;
}
template<typename PointT>
bool
evaluate_compression_impl<PointT>::do_decoding (std::stringstream* coded_stream, pcl::shared_ptr<pcl::PointCloud<PointT> > pointcloud, QualityMetric & qualityMetric)
{
pcl::console::TicToc tt;
tt.tic ();
if (algorithm_ == "V1")
{
decoder_V1_->decodePointCloud (*coded_stream, pointcloud);
}
else
{
if (algorithm_ == "V2")
{
uint64_t t = 0;
if (!decoder_V2_->decodePointCloud (*coded_stream, pointcloud, t)) return false;
}
}
qualityMetric.decoding_time_ms = tt.toc ();
return true;
}
template<typename PointT>
void
evaluate_compression_impl<PointT>::do_delta_encoding (pcl::shared_ptr<pcl::PointCloud<PointT> > i_cloud,
pcl::shared_ptr<pcl::PointCloud<PointT> > p_cloud,
pcl::shared_ptr<pcl::PointCloud<PointT> > out_cloud,
std::stringstream* i_stream,
std::stringstream* p_stream,
QualityMetric & qualityMetric)
{
pcl::console::TicToc tt;
tt.tic ();
uint64_t ignoredTimeStamp = 0;
encoder_V2_->encodePointCloudDeltaFrame (i_cloud, p_cloud, out_cloud, *i_stream, *p_stream, icp_on_original_, false, ignoredTimeStamp);
qualityMetric.encoding_time_ms = tt.toc ();
qualityMetric.byte_count_octree_layer = i_stream->tellp ();
qualityMetric.byte_count_centroid_layer = p_stream->tellp ();
qualityMetric.compressed_size = i_stream->tellp () + p_stream->tellp ();
qualityMetric.byte_count_color_layer= 0;
}
template<typename PointT>
bool
evaluate_compression_impl<PointT>::do_delta_decoding (std::stringstream* i_stream,
std::stringstream* p_stream,
pcl::shared_ptr<pcl::PointCloud<PointT> > i_cloud,
pcl::shared_ptr<pcl::PointCloud<PointT> > out_cloud,
QualityMetric & qualityMetric)
{
pcl::console::TicToc tt;
tt.tic ();
uint64_t ignoredTimeStamp;
if( !encoder_V2_->decodePointCloudDeltaFrame (i_cloud, out_cloud, *i_stream, *p_stream, ignoredTimeStamp)) return false;
qualityMetric.decoding_time_ms = tt.toc ();
return true;
}
template<typename PointT>
void
evaluate_compression_impl<PointT>::do_quality_computation (pcl::shared_ptr<pcl::PointCloud<PointT> > & reference_pointcloud,
pcl::shared_ptr<pcl::PointCloud<PointT> > & pointcloud,
QualityMetric & quality_metric)
{
// compute quality metric
computeQualityMetric<PointT> (*reference_pointcloud, *pointcloud, quality_metric);
}
template<typename PointT>
void
evaluate_compression_impl<PointT>::do_output (std::string path, pcl::shared_ptr<pcl::PointCloud<PointT> > pointcloud, QualityMetric & qualityMetric)
{
// write the .ply file by converting to point cloud2 and then to polygon mesh
pcl::PCLPointCloud2::Ptr cloud2(new pcl::PCLPointCloud2());
pcl::toPCLPointCloud2( *pointcloud, *cloud2);
pcl::PLYWriter writer;
writer.write(output_directory_+"/"+path, cloud2);
}
template<typename PointT>
void
evaluate_compression_impl<PointT>::do_visualization (std::string id, pcl::shared_ptr<pcl::PointCloud<PointT> > pc)
{
if ( ! visualization_) return;
#ifdef WITH_VTK
static std::map <std::string, ViewerPtr> viewers;
static int viewer_index_ = 0;
static vector <vtkRect<int> > viewer_window_; // x,y,w,h
ViewerPtr viewer = viewers[id];
vtkObject::GlobalWarningDisplayOff();
if ( ! viewer)
{
viewer = new pcl::visualization::PCLVisualizer (id);
viewers[id] = viewer;
vtkRenderWindow* vrwp = viewer->getRenderWindow ();
vtkRect<int> this_window;
// TBD Find better way for window positioning, this setting works only for Portrait Oriented Screen
if (viewer_index_ == 0)
{
int* window_size_p = vrwp->GetSize ();
this_window = vtkRect<int> (0 /*window_position_p[0]*/, 800/*ss[1] - window_size_p[1] window_position_p[1]*/, window_size_p[0], window_size_p[1]);
}
else
{
this_window = vtkRect<int> (viewer_window_[viewer_index_ -1].GetX()+viewer_window_[0].GetWidth()*(viewer_index_ % 2),
viewer_window_[viewer_index_ -1].GetY()-viewer_window_[0].GetHeight()*(viewer_index_ / 2),
viewer_window_[viewer_index_ -1].GetWidth(),
viewer_window_[viewer_index_ -1].GetHeight());
}
viewer_window_.push_back (this_window);
viewer->setBackgroundColor (.773, .78, .769); // RAL 7035 light grey
// we use the internal versions of these SetXX methods to avoid unwanted side-effects
vrwp->SetPosition (this_window.GetX(), this_window.GetY());
vrwp->SetSize (this_window.GetWidth(), this_window.GetHeight());
viewer_index_++;
}
if (pc == NULL)
{
delete(viewer);
}
else
{ // show the PointCloud in its viewer
viewer->removePointCloud ();
viewer->addPointCloud<PointT> (pc);
viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1);
viewer->spinOnce(1);
}
#else //WITH_VTK
static bool warning_given = false;
if ( ! warning_given)
{
PCL_WARN("No visualization configured");
warning_given = true;
}
#endif//WITH_VTK
}
// aux. functions for file reading
// xxxjack using namespace boost::filesystem;
// xxxjack using namespace pcl;
template<typename PointT>
int
load_pcd_file (std::string path, pcl::shared_ptr<pcl::PointCloud<PointT> > pc)
{
int rv = 1;
pcl::PCDReader pcd_reader;
if (pcd_reader.read (path, *pc) <= 0)
{
rv = 0;
}
return rv;
}
template<typename PointT>
int
load_ply_file (std::string path, pcl::shared_ptr<pcl::PointCloud<PointT> > pc)
{
int rv = 1;
pcl::PLYReader ply_reader;
/* next straighforward code crashes, work around via PolygonMesh *
PCLPointCloud2 pc2;
if (rv && ply_reader.read (path, pc2) < 0)
{
fromPCLPointCloud2 (pc2, *pc);
rv = 0;
}
*/
pcl::PolygonMesh mesh;
if (rv && ply_reader.read (path, mesh) >= 0) {
pcl::fromPCLPointCloud2 (mesh.cloud, *pc);
} else {
rv= 0;
}
return rv;
}
int
get_filenames_from_dir (std::string directory, std::vector<std::string>& filenames)
{
int rv = 0;
const char* dir_name = directory.c_str();
if ( ! boost::filesystem::is_directory (dir_name)) {
std::cerr << "'" << directory << "' is not a directory.\n";
return -1;
}
// order of filenames returned by directory_iterator is undefined
namespace fs = boost::filesystem;
//#pragma omp parallel for
for (fs::directory_iterator itr (directory); itr != fs::directory_iterator (); itr++)
{
fs::directory_entry de = *itr;
filenames.push_back (de.path ().string ());
}
std::sort (filenames.begin (), filenames.end ());
return rv;
}
template<typename PointT>
bool
load_input_cloud (std::string filename, pcl::shared_ptr<pcl::PointCloud<PointT> > &cloud)
{
bool rv = false;
if (boost::ends_with (filename, ".ply"))
{
if (load_ply_file (filename, cloud))
{
rv = true;
}
}
else
{
if (boost::ends_with (filename, ".pcd"))
{
if (load_pcd_file (filename, cloud))
{
rv = true;
}
}
}
return rv;
}
template<typename PointT>
bool
evaluate_compression_impl<PointT>::evaluate ()
{
bool return_value = true;
try
{
initialize_options_description ();
if ( ! get_options (argc_, argv_))
{
return false;
}
debug_level_ = vm_["debug_level"].template as<int> ();
if (debug_level_ > 0)
{
std::cout << "debug_level=" << debug_level_ << "\n";
print_options (vm_);
}
#ifdef WITH_VTK
std::cout << "WITH_VTK='" << WITH_VTK << "'\n";
#endif/*WITH_VTK*/
if (vm_.count ("help"))
{
std::cout << desc_ << "\n";
return return_value;
}
assign_option_values ();
complete_initialization ();
if (input_directories_.size() > 1)
{
std::cout << "Fusing multiple directories not implemented.\n";
return (false);
}
if (input_directories_.size() < 1)
{
std::cout << "Need to specify a directory containing Point Cloud files (.pcd or .ply).\n";
return (false);
}
std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > > group, encoder_output_clouds;
int count = 0;
std::ofstream intra_frame_quality_csv;
std::stringstream compression_settings;
compression_settings << "octree_bits=" << octree_bits_ << " color_bits=" << color_bits_ << " enh._bits=" << enh_bits_ << "_colortype=" << color_coding_type_ << " centroid=" << keep_centroid_;
if (intra_frame_quality_csv_ != "")
{
intra_frame_quality_csv.open(intra_frame_quality_csv_.c_str());
QualityMetric::print_csv_header(intra_frame_quality_csv);
}
std::ofstream predictive_quality_csv;
if (predictive_quality_csv_ != "")
{
predictive_quality_csv.open(predictive_quality_csv_.c_str());
QualityMetric::print_csv_header(predictive_quality_csv);
}
std::vector<std::string> filenames;
if (get_filenames_from_dir (*input_directories_.begin(), filenames) != 0) return false;
for (std::vector<std::string>::iterator itr = filenames.begin (); itr != filenames.end (); itr++)
{
std::string filename = *itr;
if (output_index_ == -1) { // get index of first file
std::stringstream ss(filename);
std::string tmp;
ss >> tmp >> output_index_;
if (output_index_ == -1) // no index found
output_index_ = 0;
}
pcl::shared_ptr<pcl::PointCloud<PointT> > pc (new pcl::PointCloud<PointT> ());
if ( ! load_input_cloud(filename, pc))
{
continue;
}
group.push_back(pc->makeShared());
count++;
if (group_size_ == 0 && count < filenames.size ())
{
continue;
}
// encode the group for each set of 'group_size' filenames, and the final set
if (group_size_ == 0 || count == filenames.size () || count % group_size_ == 0)
{
evaluate_group (group, compression_settings, intra_frame_quality_csv, predictive_quality_csv);
complete_initialization();
// start new group
group.clear ();
count = 0;
}
}
} catch (boost::exception &e) {
std::cerr << boost::diagnostic_information (e) << "\n";
return_value = false;
}
if (visualization_)
{ // remove data structures related to visualzation
do_visualization ("Original", pcl::shared_ptr<pcl::PointCloud<PointT> >());
do_visualization ("Decoded", pcl::shared_ptr<pcl::PointCloud<PointT> >());
do_visualization ("Delta Decoded", pcl::shared_ptr<pcl::PointCloud<PointT> >());
}
return return_value;
}
template<typename PointT>
bool
evaluate_compression_impl<PointT>::evaluate_group(std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > >& group,
std::stringstream& compression_settings, std::ofstream& intra_frame_quality_csv, std::ofstream& predictive_quality_csv)
{
bool rv = true; // return value
// create a deep copy of the group, as the pointclouds may be modified and the original is needed to compare results
std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > > working_group;
for (typename std::vector<pcl::shared_ptr<pcl::PointCloud<PointT> > >::iterator itr = group.begin (); itr != group.end (); itr++)
{
pcl::shared_ptr<pcl::PointCloud<PointT> > point_cloud = *itr;
working_group.push_back (point_cloud->makeShared ());
}
if (K_outlier_filter_ > 0) do_outlier_removal (working_group);
pcl::io::BoundingBox bb; // bounding box of this working_group
if (bb_expand_factor_ > 0.0) bb = do_bounding_box_normalization (working_group);
int working_group_size = working_group.size();
std::vector<float> icp_convergence_percentage (working_group_size);
std::vector<float> shared_macroblock_percentages (working_group_size);
// pcl::shared_ptr<pcl::PointCloud<PointT> > dpc; // decoded point cloud
for (int i = 0; i < working_group.size (); i++)
{
pcl::shared_ptr<pcl::PointCloud<PointT> > pc = working_group[i];
pcl::shared_ptr<pcl::PointCloud<PointT> > original_pc = group[i]->makeShared ();
std::stringstream ss;
QualityMetric achieved_quality;
int i_strm_pos_cur = 0, i_strm_pos_prev = 0; // current and previous position in i-code stream
int p_strm_pos_cur = 0, p_strm_pos_prev = 0; // current and previous position in p-code stream
// encode pointcloud to string stream
do_encoding (pc, &ss, achieved_quality);
// decode the string stream
std::string s = ss.str ();
std::stringstream coded_stream (s);//ss.str ());
int group_size = group.size ();
pcl::shared_ptr<pcl::PointCloud<PointT> > output_pointcloud (new pcl::PointCloud<PointT> ()), opc (new pcl::PointCloud<PointT> ());
opc = group[i];
if (!do_decoding (&coded_stream, output_pointcloud, achieved_quality)) return false;
if (do_quality_computation_)
{
do_quality_computation (pc, output_pointcloud, achieved_quality);
if (intra_frame_quality_csv_ != "")
{
achieved_quality.print_csv_line(compression_settings.str(), intra_frame_quality_csv);
}
}
// Note that the quality of the en/decompression was computed on the transformed (bb aligned) pointclouds
pcl::shared_ptr<pcl::PointCloud<PointT> > rescaled_pc = output_pointcloud->makeShared ();
if (bb_expand_factor_ > 0.0) pcl::io::OctreePointCloudCodecV2 <PointT>::restore_scaling (rescaled_pc, bb);
if (output_directory_ != "")
{
do_output ( "pointcloud_" + boost::lexical_cast<std::string> (output_index_++) + ".ply", rescaled_pc, achieved_quality);
}
do_visualization ("Original", opc);
do_visualization ("Decoded", rescaled_pc);
// test and evaluation iterative closest point predictive coding
if (algorithm_ == "V2" && do_delta_coding_ && bb_expand_factor_ >= 0 // bounding boxes were aligned
&& i+1 < group_size)
{
pcl::shared_ptr<pcl::PointCloud<PointT> > predicted_pc (new pcl::PointCloud<PointT> ());
std::cout << " delta coding frame nr " << i+1 << std::endl;
std::stringstream p_frame_pdat, p_frame_idat;
QualityMetric predictive_quality;
do_delta_encoding (icp_on_original_ ? pc : encoder_V2_->getOutputCloud (), working_group[i+1], predicted_pc, &p_frame_idat, &p_frame_pdat, predictive_quality);
// quality
shared_macroblock_percentages[i] = encoder_V2_->getMacroBlockPercentage ();
icp_convergence_percentage[i] = encoder_V2_->getMacroBlockConvergencePercentage ();
p_strm_pos_prev = p_strm_pos_cur;
p_strm_pos_cur = p_frame_pdat.tellp ();
i_strm_pos_prev = i_strm_pos_cur;
i_strm_pos_cur = p_frame_idat.tellp ();
std::cout << " encoded a predictive frame: coded " << (i_strm_pos_cur - i_strm_pos_prev) << " bytes intra and " << (p_strm_pos_cur - p_strm_pos_prev) << " inter frame encoded " << std::endl;
// create a deep copy of original pointcloud, for comparison
if (!do_delta_decoding (&p_frame_idat, &p_frame_pdat, output_pointcloud, predicted_pc, predictive_quality)) return false;
// compute the quality of the resulting predictive frame
if (do_quality_computation_)
{
do_quality_computation (working_group[i+1], predicted_pc, predictive_quality);
if (predictive_quality_csv_ != "")
{
predictive_quality.print_csv_line(compression_settings.str(), predictive_quality_csv);
}
}
pcl::io::OctreePointCloudCodecV2 <PointT>::restore_scaling (predicted_pc, bb);
if (output_directory_ != "")
{
do_output ("delta_decoded_pc_" + boost::lexical_cast<std::string> (output_index_) + ".ply", predicted_pc, predictive_quality);
}
do_visualization ("Delta Decoded", predicted_pc);
}
output_pointcloud->clear (); // clear output cloud
}
return rv;
}
#endif /* evaluate_compression_hpp */
| 43.34594 | 274 | 0.6463 | cwi-dis |
6b10020a56c1d4d51b1460b49a7b12f6e63c44aa | 3,784 | cpp | C++ | copasi/function/CEvaluationNodeVariable.cpp | MedAnisse/COPASI | 561f591f8231b1c4880ce554d0197ff21ef4734c | [
"Artistic-2.0"
] | 64 | 2015-03-14T14:06:18.000Z | 2022-02-04T23:19:08.000Z | copasi/function/CEvaluationNodeVariable.cpp | MedAnisse/COPASI | 561f591f8231b1c4880ce554d0197ff21ef4734c | [
"Artistic-2.0"
] | 4 | 2017-08-16T10:26:46.000Z | 2020-01-08T12:05:54.000Z | copasi/function/CEvaluationNodeVariable.cpp | MedAnisse/COPASI | 561f591f8231b1c4880ce554d0197ff21ef4734c | [
"Artistic-2.0"
] | 28 | 2015-04-16T14:14:59.000Z | 2022-03-28T12:04:14.000Z | // Copyright (C) 2019 - 2021 by Pedro Mendes, Rector and Visitors of the
// University of Virginia, University of Heidelberg, and University
// of Connecticut School of Medicine.
// All rights reserved.
// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and University of
// of Connecticut School of Medicine.
// All rights reserved.
// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and The University
// of Manchester.
// All rights reserved.
// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., EML Research, gGmbH, University of Heidelberg,
// and The University of Manchester.
// All rights reserved.
// Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc. and EML Research, gGmbH.
// All rights reserved.
#include "copasi/copasi.h"
#include "CEvaluationNode.h"
#include "CEvaluationTree.h"
#include "copasi/utilities/CValidatedUnit.h"
#include "sbml/math/ASTNode.h"
CEvaluationNodeVariable::CEvaluationNodeVariable()
: CEvaluationNode(MainType::VARIABLE, SubType::INVALID, "")
, mIndex(C_INVALID_INDEX)
{
mPrecedence = PRECEDENCE_NUMBER;
}
CEvaluationNodeVariable::CEvaluationNodeVariable(const SubType & subType,
const Data & data)
: CEvaluationNode(MainType::VARIABLE, subType, data)
, mIndex(C_INVALID_INDEX)
{
mPrecedence = PRECEDENCE_NUMBER;
}
CEvaluationNodeVariable::CEvaluationNodeVariable(const CEvaluationNodeVariable & src):
CEvaluationNode(src),
mIndex(src.mIndex)
{}
CEvaluationNodeVariable::~CEvaluationNodeVariable() {}
CIssue CEvaluationNodeVariable::compile()
{
mpTree = getTree();
if (!mpTree) return CIssue(CIssue::eSeverity::Error, CIssue::eKind::StructureInvalid);
mIndex = mpTree->getVariableIndex(mData);
if (mIndex == C_INVALID_INDEX)
return CIssue(CIssue::eSeverity::Error, CIssue::eKind::VariableNotfound);
if (getChild() == NULL) // We must not have any children.
return CIssue::Success;
else
return CIssue(CIssue::eSeverity::Error, CIssue::eKind::TooManyArguments);
}
void CEvaluationNodeVariable::calculate()
{
mValue = mpTree->getVariableValue(mIndex);
}
// virtual
CIssue CEvaluationNodeVariable::setValueType(const ValueType & valueType)
{
if (mValueType == ValueType::Unknown)
{
mValueType = valueType;
}
return CEvaluationNode::setValueType(valueType);
}
size_t CEvaluationNodeVariable::getIndex() const
{return mIndex;}
// static
CEvaluationNode * CEvaluationNodeVariable::fromAST(const ASTNode * pASTNode, const std::vector< CEvaluationNode * > & children)
{
assert(pASTNode->getNumChildren() == children.size());
return new CEvaluationNodeVariable(SubType::DEFAULT, pASTNode->getName());
}
// virtual
CValidatedUnit CEvaluationNodeVariable::getUnit(const CMathContainer & /* container */,
const std::vector< CValidatedUnit > & units) const
{
if (mIndex < units.size())
{
return units[mIndex];
}
return CValidatedUnit();
}
ASTNode* CEvaluationNodeVariable::toAST(const CDataModel* /*pDataModel*/) const
{
ASTNode* node = new ASTNode();
node->setType(AST_NAME);
node->setName(this->getData().c_str());
return node;
}
#include "copasi/utilities/copasimathml.h"
// virtual
std::string CEvaluationNodeVariable::getMMLString(const std::vector< std::string > & /* children */,
bool /* expand */,
const std::vector< std::vector< std::string > > & variables) const
{
std::ostringstream out;
if (mIndex < variables.size())
{
out << variables[mIndex][0] << std::endl;
}
else
{
out << "<mi>" << CMathMl::fixName(mData) << "</mi>" << std::endl;
}
return out.str();
}
| 27.42029 | 127 | 0.721723 | MedAnisse |
6b107ce024a153f730255300ee26f9926cb7fff9 | 8,971 | hpp | C++ | INCLUDE/Vcl/fmtbcd.hpp | earthsiege2/borland-cpp-ide | 09bcecc811841444338e81b9c9930c0e686f9530 | [
"Unlicense",
"FSFAP",
"Apache-1.1"
] | 1 | 2022-01-13T01:03:55.000Z | 2022-01-13T01:03:55.000Z | INCLUDE/Vcl/fmtbcd.hpp | earthsiege2/borland-cpp-ide | 09bcecc811841444338e81b9c9930c0e686f9530 | [
"Unlicense",
"FSFAP",
"Apache-1.1"
] | null | null | null | INCLUDE/Vcl/fmtbcd.hpp | earthsiege2/borland-cpp-ide | 09bcecc811841444338e81b9c9930c0e686f9530 | [
"Unlicense",
"FSFAP",
"Apache-1.1"
] | null | null | null | // Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved
// (DO NOT EDIT: machine generated header) 'FMTBcd.pas' rev: 6.00
#ifndef FMTBcdHPP
#define FMTBcdHPP
#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Variants.hpp> // Pascal unit
#include <SysUtils.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
#include <System.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Fmtbcd
{
//-- type declarations -------------------------------------------------------
struct TBcd;
typedef TBcd *PBcd;
#pragma pack(push, 1)
struct TBcd
{
Byte Precision;
Byte SignSpecialPlaces;
Byte Fraction[32];
} ;
#pragma pack(pop)
class DELPHICLASS EBcdException;
class PASCALIMPLEMENTATION EBcdException : public Sysutils::Exception
{
typedef Sysutils::Exception inherited;
public:
#pragma option push -w-inl
/* Exception.Create */ inline __fastcall EBcdException(const AnsiString Msg) : Sysutils::Exception(Msg) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateFmt */ inline __fastcall EBcdException(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateRes */ inline __fastcall EBcdException(int Ident)/* overload */ : Sysutils::Exception(Ident) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmt */ inline __fastcall EBcdException(int Ident, const System::TVarRec * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateHelp */ inline __fastcall EBcdException(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateFmtHelp */ inline __fastcall EBcdException(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResHelp */ inline __fastcall EBcdException(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmtHelp */ inline __fastcall EBcdException(System::PResStringRec ResStringRec, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~EBcdException(void) { }
#pragma option pop
};
class DELPHICLASS EBcdOverflowException;
class PASCALIMPLEMENTATION EBcdOverflowException : public EBcdException
{
typedef EBcdException inherited;
public:
#pragma option push -w-inl
/* Exception.Create */ inline __fastcall EBcdOverflowException(const AnsiString Msg) : EBcdException(Msg) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateFmt */ inline __fastcall EBcdOverflowException(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size) : EBcdException(Msg, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateRes */ inline __fastcall EBcdOverflowException(int Ident)/* overload */ : EBcdException(Ident) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmt */ inline __fastcall EBcdOverflowException(int Ident, const System::TVarRec * Args, const int Args_Size)/* overload */ : EBcdException(Ident, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateHelp */ inline __fastcall EBcdOverflowException(const AnsiString Msg, int AHelpContext) : EBcdException(Msg, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateFmtHelp */ inline __fastcall EBcdOverflowException(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size, int AHelpContext) : EBcdException(Msg, Args, Args_Size, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResHelp */ inline __fastcall EBcdOverflowException(int Ident, int AHelpContext)/* overload */ : EBcdException(Ident, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmtHelp */ inline __fastcall EBcdOverflowException(System::PResStringRec ResStringRec, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : EBcdException(ResStringRec, Args, Args_Size, AHelpContext) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~EBcdOverflowException(void) { }
#pragma option pop
};
//-- var, const, procedure ---------------------------------------------------
static const Shortint MaxStringDigits = 0x64;
static const short _NoDecimal = 0xffffff01;
static const Shortint _DefaultDecimals = 0xa;
static const Shortint MaxFMTBcdFractionSize = 0x40;
static const Shortint MaxFMTBcdDigits = 0x20;
static const Shortint DefaultFMTBcdScale = 0x6;
static const Shortint MaxBcdPrecision = 0x12;
static const Shortint MaxBcdScale = 0x4;
extern PACKAGE TBcd NullBcd;
extern PACKAGE Variant __fastcall VarFMTBcdCreate(const AnsiString AValue, Word Precision, Word Scale)/* overload */;
extern PACKAGE Variant __fastcall VarFMTBcdCreate(const double AValue, Word Precision = (Word)(0x12), Word Scale = (Word)(0x4))/* overload */;
extern PACKAGE void __fastcall VarFMTBcdCreate(Variant &ADest, const TBcd &ABcd)/* overload */;
extern PACKAGE Variant __fastcall VarFMTBcdCreate()/* overload */;
extern PACKAGE Variant __fastcall VarFMTBcdCreate(const TBcd &ABcd)/* overload */;
extern PACKAGE bool __fastcall VarIsFMTBcd(const Variant &AValue)/* overload */;
extern PACKAGE Word __fastcall VarFMTBcd(void);
extern PACKAGE TBcd __fastcall StrToBcd(const AnsiString AValue);
extern PACKAGE void __fastcall DoubleToBcd(const double AValue, TBcd &bcd)/* overload */;
extern PACKAGE TBcd __fastcall DoubleToBcd(const double AValue)/* overload */;
extern PACKAGE TBcd __fastcall VarToBcd(const Variant &AValue);
extern PACKAGE TBcd __fastcall IntegerToBcd(const int AValue);
extern PACKAGE double __fastcall BcdToDouble(const TBcd &Bcd);
extern PACKAGE int __fastcall BcdToInteger(const TBcd &Bcd, bool Truncate = false);
extern PACKAGE bool __fastcall TryStrToBcd(const AnsiString AValue, TBcd &Bcd);
extern PACKAGE bool __fastcall NormalizeBcd(const TBcd &InBcd, TBcd &OutBcd, const Word Prec, const Word Scale);
extern PACKAGE int __fastcall BcdCompare(const TBcd &bcd1, const TBcd &bcd2);
extern PACKAGE void __fastcall BcdSubtract(const TBcd &bcdIn1, const TBcd &bcdIn2, TBcd &bcdOut);
extern PACKAGE void __fastcall BcdMultiply(AnsiString StringIn1, AnsiString StringIn2, TBcd &bcdOut)/* overload */;
extern PACKAGE void __fastcall BcdMultiply(const TBcd &bcdIn1, const TBcd &bcdIn2, TBcd &bcdOut)/* overload */;
extern PACKAGE void __fastcall BcdMultiply(const TBcd &bcdIn, const double DoubleIn, TBcd &bcdOut)/* overload */;
extern PACKAGE void __fastcall BcdMultiply(const TBcd &bcdIn, const AnsiString StringIn, TBcd &bcdOut)/* overload */;
extern PACKAGE void __fastcall BcdDivide(AnsiString Dividend, AnsiString Divisor, TBcd &bcdOut)/* overload */;
extern PACKAGE void __fastcall BcdDivide(const TBcd &Dividend, const TBcd &Divisor, TBcd &bcdOut)/* overload */;
extern PACKAGE void __fastcall BcdDivide(const TBcd &Dividend, const double Divisor, TBcd &bcdOut)/* overload */;
extern PACKAGE void __fastcall BcdDivide(const TBcd &Dividend, const AnsiString Divisor, TBcd &bcdOut)/* overload */;
extern PACKAGE void __fastcall BcdAdd(const TBcd &bcdIn1, const TBcd &bcdIn2, TBcd &bcdOut);
extern PACKAGE AnsiString __fastcall BcdToStr(const TBcd &Bcd)/* overload */;
extern PACKAGE Word __fastcall BcdPrecision(const TBcd &Bcd);
extern PACKAGE Word __fastcall BcdScale(const TBcd &Bcd);
extern PACKAGE bool __fastcall IsBcdNegative(const TBcd &Bcd);
extern PACKAGE bool __fastcall CurrToBCD(const System::Currency Curr, TBcd &BCD, int Precision = 0x20, int Decimals = 0x4);
extern PACKAGE bool __fastcall BCDToCurr(const TBcd &BCD, System::Currency &Curr);
extern PACKAGE AnsiString __fastcall BcdToStrF(const TBcd &Bcd, Sysutils::TFloatFormat Format, const int Precision, const int Digits);
extern PACKAGE AnsiString __fastcall FormatBcd(const AnsiString Format, const TBcd &Bcd);
} /* namespace Fmtbcd */
using namespace Fmtbcd;
#pragma option pop // -w-
#pragma option pop // -Vx
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // FMTBcd
| 53.718563 | 258 | 0.73916 | earthsiege2 |
6b1081d6513a948256d0627c3f7a5c9c3779ccc1 | 294 | hh | C++ | Cassie_Example/opt_two_step/periodic/c_code/include/frost/gen/J_BezierSymmetry.hh | prem-chand/Cassie_CFROST | da4bd51442f86e852cbb630cc91c9a380a10b66d | [
"BSD-3-Clause"
] | null | null | null | Cassie_Example/opt_two_step/periodic/c_code/include/frost/gen/J_BezierSymmetry.hh | prem-chand/Cassie_CFROST | da4bd51442f86e852cbb630cc91c9a380a10b66d | [
"BSD-3-Clause"
] | null | null | null | Cassie_Example/opt_two_step/periodic/c_code/include/frost/gen/J_BezierSymmetry.hh | prem-chand/Cassie_CFROST | da4bd51442f86e852cbb630cc91c9a380a10b66d | [
"BSD-3-Clause"
] | null | null | null | /*
* Automatically Generated from Mathematica.
* Fri 5 Nov 2021 09:01:52 GMT-04:00
*/
#ifndef J_BEZIERSYMMETRY_HH
#define J_BEZIERSYMMETRY_HH
namespace frost {
namespace gen {
void J_BezierSymmetry(double *p_output1, const double *var1);
}
}
#endif // J_BEZIERSYMMETRY_HH
| 18.375 | 69 | 0.717687 | prem-chand |
6b11371422ce356e60810a4e7fb40ea2f6c6ad4e | 488 | cpp | C++ | gcommon/source/gscenenodecomponentfactorystubload.cpp | DavidCoenFish/ancient-code-0 | 243fb47b9302a77f9b9392b6e3f90bba2ef3c228 | [
"Unlicense"
] | null | null | null | gcommon/source/gscenenodecomponentfactorystubload.cpp | DavidCoenFish/ancient-code-0 | 243fb47b9302a77f9b9392b6e3f90bba2ef3c228 | [
"Unlicense"
] | null | null | null | gcommon/source/gscenenodecomponentfactorystubload.cpp | DavidCoenFish/ancient-code-0 | 243fb47b9302a77f9b9392b6e3f90bba2ef3c228 | [
"Unlicense"
] | null | null | null | //
// GSceneNodeComponentFactoryStubLoad.cpp
//
// Created by David Coen on 2011 01 28
// Copyright 2010 Pleasure seeking morons. All rights reserved.
//
#include "GSceneNodeComponentFactoryStubLoad.h"
//constructor
GSceneNodeComponentFactoryStubLoad::GSceneNodeComponentFactoryStubLoad(
const char* const in_name,
const char* const in_data
)
: mName(in_name)
, mData(in_data)
{
return;
}
GSceneNodeComponentFactoryStubLoad::~GSceneNodeComponentFactoryStubLoad()
{
return;
}
| 19.52 | 73 | 0.784836 | DavidCoenFish |
6b12255200e548b339a171ca4bf8f9ecfac51f62 | 2,082 | cc | C++ | arms/src/model/CreateAlertContactGroupRequest.cc | iamzken/aliyun-openapi-cpp-sdk | 3c991c9ca949b6003c8f498ce7a672ea88162bf1 | [
"Apache-2.0"
] | 89 | 2018-02-02T03:54:39.000Z | 2021-12-13T01:32:55.000Z | arms/src/model/CreateAlertContactGroupRequest.cc | iamzken/aliyun-openapi-cpp-sdk | 3c991c9ca949b6003c8f498ce7a672ea88162bf1 | [
"Apache-2.0"
] | 89 | 2018-03-14T07:44:54.000Z | 2021-11-26T07:43:25.000Z | arms/src/model/CreateAlertContactGroupRequest.cc | aliyun/aliyun-openapi-cpp-sdk | 0cf5861ece17dfb0bb251f13bf3fbdb39c0c6e36 | [
"Apache-2.0"
] | 69 | 2018-01-22T09:45:52.000Z | 2022-03-28T07:58:38.000Z | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/arms/model/CreateAlertContactGroupRequest.h>
using AlibabaCloud::ARMS::Model::CreateAlertContactGroupRequest;
CreateAlertContactGroupRequest::CreateAlertContactGroupRequest() :
RpcServiceRequest("arms", "2019-08-08", "CreateAlertContactGroup")
{
setMethod(HttpRequest::Method::Post);
}
CreateAlertContactGroupRequest::~CreateAlertContactGroupRequest()
{}
std::string CreateAlertContactGroupRequest::getRegionId()const
{
return regionId_;
}
void CreateAlertContactGroupRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string CreateAlertContactGroupRequest::getContactGroupName()const
{
return contactGroupName_;
}
void CreateAlertContactGroupRequest::setContactGroupName(const std::string& contactGroupName)
{
contactGroupName_ = contactGroupName;
setParameter("ContactGroupName", contactGroupName);
}
std::string CreateAlertContactGroupRequest::getProxyUserId()const
{
return proxyUserId_;
}
void CreateAlertContactGroupRequest::setProxyUserId(const std::string& proxyUserId)
{
proxyUserId_ = proxyUserId;
setParameter("ProxyUserId", proxyUserId);
}
std::string CreateAlertContactGroupRequest::getContactIds()const
{
return contactIds_;
}
void CreateAlertContactGroupRequest::setContactIds(const std::string& contactIds)
{
contactIds_ = contactIds;
setParameter("ContactIds", contactIds);
}
| 28.135135 | 94 | 0.773775 | iamzken |
6b1363396d0568fc04c2334fe9e37fe4992a1709 | 3,350 | hpp | C++ | include/geneticpp/individual.hpp | brentnd/geneticpp | e3a4e7c9e7985384a0546d1e96bdebaa458f77f2 | [
"MIT"
] | null | null | null | include/geneticpp/individual.hpp | brentnd/geneticpp | e3a4e7c9e7985384a0546d1e96bdebaa458f77f2 | [
"MIT"
] | null | null | null | include/geneticpp/individual.hpp | brentnd/geneticpp | e3a4e7c9e7985384a0546d1e96bdebaa458f77f2 | [
"MIT"
] | null | null | null | #pragma once
#include <algorithm> // std::min, std::swap_ranges
#include <functional> // std::function
#include <iostream>
#include <utility> // std::swap
#include <vector>
#include "attribute.hpp"
#include "fitness.hpp"
namespace genetic {
class individual {
public:
individual();
// crossover
template <typename... Args>
static void crossover_method(void (*fcn)(individual *, individual *, Args...), Args... args) {
crossover_function = std::bind(fcn, std::placeholders::_1, std::placeholders::_2, std::forward<Args>(args)...);
}
// Mate two individuals using static method
static void mate(individual * ind1, individual * ind2);
// crossover variants for crossover_method
static void one_point_crossover(individual * ind1, individual * ind2);
static void two_point_crossover(individual * ind1, individual * ind2);
static void uniform_crossover(individual * ind1, individual * ind2, float indpb);
static void ordered_crossover(individual * ind1, individual * ind2);
static void blend_crossover(individual * ind1, individual * ind2, float alpha);
// Evaluate this individuals fitness
void evaluate();
float weighted_fitness() const;
static std::vector<float> eval_sum(individual const & ind);
float sum_attributes() const;
// Custom function for evaluation
static void evaluation_method(std::function<std::vector<float>(individual const &)> && fcn);
// Mutation
template <typename... Args>
static void mutation_method(void (individual::* fcn)(Args...), Args... args) {
mutation_function = std::bind(fcn, std::placeholders::_1, std::forward<Args>(args)...);
}
// Mutate this individual using mutation method
void mutate();
// Mutation variants for mutation_method
void uniform_int(float mutation_rate, int min, int max);
void flip_bit(float mutation_rate);
void shuffle_indexes(float mutation_rate);
void gaussian(float mutation_rate, float mu, float sigma);
void polynomial_bounded(float mutation_rate, float eta, float min, float max);
// Initialize the attributes by seeding them
void seed();
bool operator<(individual const & other) const;
bool operator>(individual const & other) const;
bool operator==(individual const & other) const;
std::vector<attribute>::const_iterator begin() const;
std::vector<attribute>::iterator begin();
std::vector<attribute>::const_iterator end() const;
std::vector<attribute>::iterator end();
attribute const & at(std::size_t pos) const;
std::size_t size() const;
friend std::ostream& operator<<(std::ostream & stream, individual const & ind) {
stream << "individual @ (" << static_cast<const void *>(&ind) << ") f=" << ind.weighted_fitness();
stream << " attr=[";
for (auto const & attr : ind.attributes) {
stream << attr << attribute::display_delimiter;
}
stream << "]";
return stream;
}
public:
static std::size_t attribute_count;
private:
static std::function<std::vector<float>(individual const &)> evaluation_function;
static std::function<void(individual *, individual *)> crossover_function;
static std::function<void(individual &)> mutation_function;
void throw_if_fitness_invalid() const;
private:
fitness fit;
std::vector<attribute> attributes;
};
} // namespace genetic
| 34.536082 | 117 | 0.699104 | brentnd |
6b13c9d19d862dc90eba2b66b469298eb123a137 | 259 | cc | C++ | py/capnp/src/module.cc | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | 3 | 2016-01-04T06:28:52.000Z | 2020-09-20T13:18:40.000Z | py/capnp/src/module.cc | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | py/capnp/src/module.cc | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | // Definition of the extension module
#include "hack.h"
#include <boost/python/module.hpp>
#include "common.h"
BOOST_PYTHON_MODULE(native) {
capnp_python::defineSchemaCapnp();
capnp_python::defineResourceTypes();
capnp_python::defineValueTypes();
}
| 18.5 | 38 | 0.756757 | clchiou |
6b17a6bd185b63bf401936f6c67ec2e8a9b27894 | 1,336 | hpp | C++ | src/Linux/ChildProcessExperiment/ChildProcessExperiment/BinaryWriter.hpp | asmichi/playground | 08730da902c63c005817e98ec247eeb786ba15c4 | [
"MIT"
] | null | null | null | src/Linux/ChildProcessExperiment/ChildProcessExperiment/BinaryWriter.hpp | asmichi/playground | 08730da902c63c005817e98ec247eeb786ba15c4 | [
"MIT"
] | null | null | null | src/Linux/ChildProcessExperiment/ChildProcessExperiment/BinaryWriter.hpp | asmichi/playground | 08730da902c63c005817e98ec247eeb786ba15c4 | [
"MIT"
] | null | null | null | // Copyright (c) @asmichi (https://github.com/asmichi). Licensed under the MIT License. See LICENCE in the project root for details.
#pragma once
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <numeric>
#include <stdexcept>
#include <string>
#include <vector>
class BinaryWriter final
{
public:
template<typename T>
void Write(T value)
{
Write(&value, sizeof(T));
}
void Write(const void* data, std::size_t len)
{
std::memcpy(ExtendAndGetCurrent(len), data, len);
}
void WriteString(const char* s)
{
if (s == nullptr)
{
Write<std::uint32_t>(0);
return;
}
auto bytes = std::char_traits<char>::length(s) + 1;
if (bytes > std::numeric_limits<std::uint32_t>::max())
{
throw std::out_of_range("string too long");
}
Write<std::uint32_t>(static_cast<std::uint32_t>(bytes));
Write(s, bytes);
}
std::vector<std::byte> Detach()
{
return std::move(buf_);
}
private:
std::byte* ExtendAndGetCurrent(std::size_t bytesToWrite)
{
auto cur = buf_.size();
buf_.resize(cur + bytesToWrite);
return &buf_[cur];
}
std::vector<std::byte> buf_;
};
| 22.266667 | 133 | 0.554641 | asmichi |
6b17cc122147f60cc020310c3574872aef7425e4 | 4,201 | cc | C++ | src/tests/test_fourcenter.cc | fossabot/xtp | e82cc53f23e213d09da15da80ada6e32ac031a07 | [
"Apache-2.0"
] | null | null | null | src/tests/test_fourcenter.cc | fossabot/xtp | e82cc53f23e213d09da15da80ada6e32ac031a07 | [
"Apache-2.0"
] | null | null | null | src/tests/test_fourcenter.cc | fossabot/xtp | e82cc53f23e213d09da15da80ada6e32ac031a07 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* 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.
*
*/
#define BOOST_TEST_MAIN
#define BOOST_TEST_MODULE fourcenter_test
// Third party includes
#include <boost/test/unit_test.hpp>
#include <votca/tools/eigenio_matrixmarket.h>
// Local VOTCA includes
#include "votca/xtp/aobasis.h"
#include "votca/xtp/fourcenter.h"
#include "votca/xtp/qmmolecule.h"
using namespace votca::xtp;
using namespace votca;
using namespace std;
BOOST_AUTO_TEST_SUITE(fourcenter_test)
BOOST_AUTO_TEST_CASE(small_l_test) {
QMMolecule mol(" ", 0);
mol.LoadFromFile(std::string(XTP_TEST_DATA_FOLDER) +
"/fourcenter/molecule.xyz");
BasisSet basis;
basis.Load(std::string(XTP_TEST_DATA_FOLDER) + "/fourcenter/3-21G.xml");
AOBasis aobasis;
aobasis.Fill(basis, mol);
const AOShell& shell0 = aobasis.getShell(2);
const AOShell& shell1 = aobasis.getShell(3);
const AOShell& shell2 = aobasis.getShell(4);
const AOShell& shell4 = aobasis.getShell(5);
FCMatrix fcenter;
Eigen::Tensor<double, 4> block(shell0.getNumFunc(), shell4.getNumFunc(),
shell2.getNumFunc(), shell1.getNumFunc());
block.setZero();
fcenter.FillFourCenterRepBlock(block, shell0, shell4, shell2, shell1);
Eigen::Map<Eigen::VectorXd> mapped_result(block.data(), block.size());
Eigen::VectorXd ref = Eigen::VectorXd::Zero(block.size());
ref << 0.021578, 0.0112696, 0.0112696, 0.0112696, 0.021578, 0.0112696,
0.0112696, 0.0112696, 0.021578;
Eigen::TensorMap<Eigen::Tensor<double, 4> > ref_block(
ref.data(), shell0.getNumFunc(), shell4.getNumFunc(), shell2.getNumFunc(),
shell1.getNumFunc());
bool check = mapped_result.isApprox(ref, 0.0001);
BOOST_CHECK_EQUAL(check, 1);
if (!check) {
cout << "ref" << endl;
cout << ref_block << endl;
cout << "result" << endl;
cout << block << endl;
}
}
BOOST_AUTO_TEST_CASE(large_l_test) {
QMMolecule mol("C", 0);
mol.LoadFromFile(std::string(XTP_TEST_DATA_FOLDER) + "/fourcenter/C2.xyz");
BasisSet basisset;
basisset.Load(std::string(XTP_TEST_DATA_FOLDER) + "/fourcenter/G.xml");
AOBasis dftbasis;
dftbasis.Fill(basisset, mol);
FCMatrix fcenter;
Eigen::Tensor<double, 4> block(
dftbasis.getShell(0).getNumFunc(), dftbasis.getShell(1).getNumFunc(),
dftbasis.getShell(0).getNumFunc(), dftbasis.getShell(1).getNumFunc());
block.setZero();
fcenter.FillFourCenterRepBlock(block, dftbasis.getShell(0),
dftbasis.getShell(1), dftbasis.getShell(0),
dftbasis.getShell(1));
// we only check the first and last 600 values because this gets silly quite
// quickly
Eigen::Map<Eigen::VectorXd> mapped_result(block.data(), block.size());
Eigen::VectorXd ref_head = votca::tools::EigenIO_MatrixMarket::ReadVector(
std::string(XTP_TEST_DATA_FOLDER) + "/fourcenter/largeLbegin.mm");
Eigen::VectorXd ref_tail = votca::tools::EigenIO_MatrixMarket::ReadVector(
std::string(XTP_TEST_DATA_FOLDER) + "/fourcenter/largeLend.mm");
bool check_head = mapped_result.head<600>().isApprox(ref_head, 0.0001);
BOOST_CHECK_EQUAL(check_head, 1);
if (!check_head) {
cout << "ref" << endl;
cout << ref_head.transpose() << endl;
cout << "result" << endl;
cout << mapped_result.head<600>().transpose() << endl;
}
bool check_tail = mapped_result.tail<600>().isApprox(ref_tail, 0.0001);
BOOST_CHECK_EQUAL(check_tail, 1);
if (!check_tail) {
cout << "ref" << endl;
cout << ref_tail.transpose() << endl;
cout << "result" << endl;
cout << mapped_result.tail<600>().transpose() << endl;
}
}
BOOST_AUTO_TEST_SUITE_END()
| 34.154472 | 80 | 0.689836 | fossabot |
6b184d189a001bc0f281eea593046df62bc5bda6 | 3,474 | hpp | C++ | src/lapack_like/spectral/HessenbergSchur/Simple/SingleShift.hpp | pjt1988/Elemental | 71d3e2b98829594e9f52980a8b1ef7c1e99c724b | [
"Apache-2.0"
] | 473 | 2015-01-11T03:22:11.000Z | 2022-03-31T05:28:39.000Z | src/lapack_like/spectral/HessenbergSchur/Simple/SingleShift.hpp | pjt1988/Elemental | 71d3e2b98829594e9f52980a8b1ef7c1e99c724b | [
"Apache-2.0"
] | 205 | 2015-01-10T20:33:45.000Z | 2021-07-25T14:53:25.000Z | src/lapack_like/spectral/HessenbergSchur/Simple/SingleShift.hpp | pjt1988/Elemental | 71d3e2b98829594e9f52980a8b1ef7c1e99c724b | [
"Apache-2.0"
] | 109 | 2015-02-16T14:06:42.000Z | 2022-03-23T21:34:26.000Z | /*
Copyright (c) 2009-2016, Jack Poulson
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#ifndef EL_HESS_SCHUR_SINGLE_SHIFT_HPP
#define EL_HESS_SCHUR_SINGLE_SHIFT_HPP
#include "../Util/MakeSubdiagonalReal.hpp"
#include "./SingleShift/Sweep.hpp"
namespace El {
namespace hess_schur {
template<typename Real>
HessenbergSchurInfo
SingleShift
( Matrix<Complex<Real>>& H,
Matrix<Complex<Real>>& w,
Matrix<Complex<Real>>& Z,
const HessenbergSchurCtrl& ctrl )
{
EL_DEBUG_CSE
typedef Complex<Real> F;
const Real zero(0), threeFourths=Real(3)/Real(4);
const Int maxIter=30;
const Int n = H.Height();
Int winBeg = ( ctrl.winBeg==END ? n : ctrl.winBeg );
Int winEnd = ( ctrl.winEnd==END ? n : ctrl.winEnd );
const Int windowSize = winEnd - winBeg;
HessenbergSchurInfo info;
w.Resize( n, 1 );
if( windowSize == 0 )
{
return info;
}
if( windowSize == 1 )
{
w(winBeg) = H(winBeg,winBeg);
return info;
}
// Follow LAPACK's suit and clear the two diagonals below the subdiagonal
for( Int j=winBeg; j<winEnd-3; ++j )
{
H(j+2,j) = zero;
H(j+3,j) = zero;
}
if( winBeg <= winEnd-3 )
H(winEnd-1,winEnd-3) = zero;
// The optimized sweeping procedure assumes/maintains a real subdiagonal
util::MakeSubdiagonalReal( H, Z, ctrl );
// Attempt to converge the eigenvalues one at a time
auto ctrlSweep( ctrl );
while( winBeg < winEnd )
{
Int iterBeg = winBeg;
Int iter;
for( iter=0; iter<maxIter; ++iter )
{
auto winInd = IR(iterBeg,winEnd);
iterBeg += DetectSmallSubdiagonal( H(winInd,winInd) );
if( iterBeg > winBeg )
{
H(iterBeg,iterBeg-1) = zero;
}
if( iterBeg == winEnd-1 )
{
w(iterBeg) = H(iterBeg,iterBeg);
--winEnd;
break;
}
// Pick either the Wilkinson shift or an exceptional shift
F shift;
if( iter == maxIter/3 )
{
const F diagVal = H(iterBeg,iterBeg);
const Real subdiagVal = RealPart(H(iterBeg+1,iterBeg));
shift = diagVal + threeFourths*Abs(subdiagVal);
}
else if( iter == 2*maxIter/3 )
{
const F diagVal = H(winEnd-1,winEnd-1);
const Real subdiagVal = RealPart(H(winEnd-1,winEnd-2));
shift = diagVal + threeFourths*Abs(subdiagVal);
}
else
{
auto subInd = IR(iterBeg,winEnd);
shift = WilkinsonShift( H(subInd,subInd) );
}
ctrlSweep.winBeg = iterBeg;
ctrlSweep.winEnd = winEnd;
single_shift::SweepOpt( H, shift, Z, ctrlSweep );
++info.numIterations;
}
if( iter == maxIter )
{
if( ctrl.demandConverged )
RuntimeError("QR iteration did not converge");
else
break;
}
}
info.numUnconverged = winEnd-winBeg;
return info;
}
} // namespace hess_schur
} // namespace El
#endif // ifndef EL_HESS_SCHUR_SINGLE_SHIFT_HPP
| 28.47541 | 77 | 0.552389 | pjt1988 |
6b1b3b50b2fe37bdc175b66be2446214213e58e4 | 1,088 | cpp | C++ | 397_longest-increasing-continuous-subsequence/longest-increasing-continuous-subsequence.cpp | piguin/lintcode | 382e0880f82480eb8153041e78c297dbaeb4b9ea | [
"CC0-1.0"
] | null | null | null | 397_longest-increasing-continuous-subsequence/longest-increasing-continuous-subsequence.cpp | piguin/lintcode | 382e0880f82480eb8153041e78c297dbaeb4b9ea | [
"CC0-1.0"
] | null | null | null | 397_longest-increasing-continuous-subsequence/longest-increasing-continuous-subsequence.cpp | piguin/lintcode | 382e0880f82480eb8153041e78c297dbaeb4b9ea | [
"CC0-1.0"
] | null | null | null | /*
@Copyright:LintCode
@Author: qili
@Problem: http://www.lintcode.com/problem/longest-increasing-continuous-subsequence
@Language: C++
@Datetime: 16-07-26 00:34
*/
class Solution {
public:
int max(int a, int b) {
return a > b ? a : b;
}
/**
* @param A an array of Integer
* @return an integer
*/
int longestIncreasingContinuousSubsequence(vector<int>& A) {
if (A.size() == 0) return 0;
int lenCurr = 1;
int lenMax = 0;
int dir = 0;
int lastNum = A[0];
for (int i = 1; i < A.size(); ++i) {
int n = A[i];
if (dir == 0) {
dir = n - lastNum; // dir can only be set when we are after the 1st number
lenCurr = (dir != 0) ? 2 : 1;
}
else if (dir * (n - lastNum) <= 0) { // if dir reversed
dir = n - lastNum;
lenMax = max(lenMax, lenCurr);
lenCurr = (dir != 0) ? 2 : 1;
}
else {
++lenCurr;
}
lastNum = n;
}
lenMax = max(lenMax, lenCurr);
return lenMax;
}
}; | 23.148936 | 84 | 0.488971 | piguin |
6b1b94b8e17de4888b661a8b011cac08abb1091b | 932 | cpp | C++ | src/main.cpp | AlexNDRmac/pcloud-console-client | 0a6764de44e25ef159a5f629388fba728a0f6a43 | [
"BSD-3-Clause"
] | 21 | 2021-07-14T13:23:43.000Z | 2022-03-14T11:30:46.000Z | src/main.cpp | AlexNDRmac/pcloud-console-client | 0a6764de44e25ef159a5f629388fba728a0f6a43 | [
"BSD-3-Clause"
] | 14 | 2021-07-17T16:45:17.000Z | 2022-03-14T21:15:45.000Z | src/main.cpp | AlexNDRmac/pcloud-console-client | 0a6764de44e25ef159a5f629388fba728a0f6a43 | [
"BSD-3-Clause"
] | 5 | 2021-07-16T10:41:32.000Z | 2021-12-26T23:23:29.000Z | // This file is part of the pCloud Console Client.
//
// (c) 2021 Serghei Iakovlev <egrep@protonmail.ch>
//
// For the full copyright and license information, please view
// the LICENSE file that was distributed with this source code.
#include <memory>
#include <string>
#include <vector>
#include "cli/app.hpp"
static inline std::vector<std::string> prepare_args(int argc, char **argv) {
std::vector<std::string> args;
args.reserve(static_cast<size_t>(argc - 1));
for (int i = argc - 1; i > 0; i--) {
if (std::string(argv[i]) == "-dumpversion") {
args.emplace_back("--dumpversion");
} else {
args.emplace_back(argv[i]);
}
}
return args;
}
/// \brief pcloudcc entrypoint.
///
/// \return 0 if everything went fine, or a positive error code
int main(int argc, char **argv) {
auto args = prepare_args(argc, argv);
auto app = std::make_unique<pcloud::cli::App>(args);
return app->run();
}
| 25.189189 | 76 | 0.659871 | AlexNDRmac |
6b1c4adc798c9cf7f8a56fe994d78cc7db683229 | 6,050 | cc | C++ | src/filters/particle_filter.cc | jwidauer/refill | 64947e0a8e15855f4a5ad048f09f8d38715bbe91 | [
"MIT"
] | 2 | 2021-06-13T07:28:51.000Z | 2021-09-08T11:26:34.000Z | src/filters/particle_filter.cc | jwidauer/refill | 64947e0a8e15855f4a5ad048f09f8d38715bbe91 | [
"MIT"
] | null | null | null | src/filters/particle_filter.cc | jwidauer/refill | 64947e0a8e15855f4a5ad048f09f8d38715bbe91 | [
"MIT"
] | 3 | 2021-06-01T13:21:41.000Z | 2021-06-01T20:33:20.000Z | #include "refill/filters/particle_filter.h"
using std::size_t;
using Eigen::MatrixXd;
using Eigen::VectorXd;
namespace refill {
ParticleFilter::ParticleFilter()
: num_particles_(0),
particles_(0, 0),
weights_(0),
system_model_(nullptr),
measurement_model_(nullptr),
resample_method_(nullptr) {
}
ParticleFilter::ParticleFilter(const size_t& n_particles,
DistributionInterface* initial_state_dist)
: num_particles_(n_particles),
particles_(initial_state_dist->mean().rows(), n_particles),
weights_(n_particles),
system_model_(nullptr),
measurement_model_(nullptr),
resample_method_(nullptr) {
reinitializeParticles(initial_state_dist);
}
ParticleFilter::ParticleFilter(
const size_t& n_particles, DistributionInterface* initial_state_dist,
const std::function<void(MatrixXd*, VectorXd*)>& resample_method)
: num_particles_(n_particles),
particles_(initial_state_dist->mean().rows(), n_particles),
weights_(n_particles),
system_model_(nullptr),
measurement_model_(nullptr),
resample_method_(resample_method) {
reinitializeParticles(initial_state_dist);
}
ParticleFilter::ParticleFilter(
const size_t& n_particles, DistributionInterface* initial_state_dist,
const std::function<void(MatrixXd*, VectorXd*)>& resample_method,
std::unique_ptr<SystemModelBase> system_model,
std::unique_ptr<Likelihood> measurement_model)
: num_particles_(n_particles),
particles_(initial_state_dist->mean().rows(), n_particles),
weights_(n_particles),
system_model_(std::move(system_model)),
measurement_model_(std::move(measurement_model)),
resample_method_(resample_method) {
reinitializeParticles(initial_state_dist);
}
void ParticleFilter::setFilterParameters(
const size_t& n_particles, DistributionInterface* initial_state_dist) {
num_particles_ = n_particles;
this->reinitializeParticles(initial_state_dist);
}
void ParticleFilter::setFilterParameters(
const size_t& n_particles, DistributionInterface* initial_state_dist,
const std::function<void(MatrixXd*, VectorXd*)>& resample_method) {
this->setFilterParameters(n_particles, initial_state_dist);
resample_method_ = resample_method;
}
void ParticleFilter::setFilterParameters(
const size_t& n_particles, DistributionInterface* initial_state_dist,
const std::function<void(MatrixXd*, VectorXd*)>& resample_method,
std::unique_ptr<SystemModelBase> system_model,
std::unique_ptr<Likelihood> measurement_model) {
this->setFilterParameters(n_particles, initial_state_dist, resample_method);
system_model_ = std::move(system_model);
measurement_model_ = std::move(measurement_model);
}
void ParticleFilter::setParticles(const Eigen::MatrixXd& particles) {
CHECK_EQ(particles_.rows(), particles.rows());
CHECK_EQ(particles_.cols(), particles.cols());
particles_ = particles;
weights_.setConstant(1.0 / num_particles_);
}
void ParticleFilter::setParticlesAndWeights(const Eigen::MatrixXd& particles,
const Eigen::VectorXd& weights) {
CHECK_EQ(particles_.rows(), particles.rows());
CHECK_EQ(weights.rows(), particles.cols());
CHECK_NE(weights.squaredNorm(), 0.0) << "Zero weight vector is not allowed!";
particles_ = particles;
weights_ = weights / weights.sum();
}
void ParticleFilter::reinitializeParticles(
DistributionInterface* initial_state_dist) {
particles_.resize(initial_state_dist->mean().rows(), num_particles_);
weights_.resize(num_particles_);
weights_.setConstant(1.0 / num_particles_);
for (std::size_t i = 0; i < num_particles_; ++i) {
particles_.col(i) = initial_state_dist->drawSample();
}
}
void ParticleFilter::predict() {
CHECK(this->system_model_) << "No default system model provided!";
this->predict(Eigen::VectorXd::Zero(system_model_->getInputDim()));
}
void ParticleFilter::predict(const Eigen::VectorXd& input) {
CHECK(this->system_model_) << "No default system model provided!";
this->predict(*system_model_, input);
}
void ParticleFilter::predict(const SystemModelBase& system_model) {
this->predict(system_model,
Eigen::VectorXd::Zero(system_model.getInputDim()));
}
void ParticleFilter::predict(const SystemModelBase& system_model,
const Eigen::VectorXd& input) {
CHECK_EQ(system_model.getInputDim(), input.rows());
CHECK_EQ(system_model.getStateDim(), particles_.rows());
CHECK_NE(particles_.cols(), 0)<< "Particle vector is empty.";
for (std::size_t i = 0; i < num_particles_; ++i) {
Eigen::VectorXd noise_sample = system_model.getNoise()->drawSample();
particles_.col(i) = system_model.propagate(particles_.col(i), input,
noise_sample);
}
}
void ParticleFilter::update(const Eigen::VectorXd& measurement) {
CHECK(this->measurement_model_) << "No default measurement model provided!";
this->update(*measurement_model_, measurement);
}
void ParticleFilter::update(const Likelihood& measurement_model,
const Eigen::VectorXd& measurement) {
Eigen::VectorXd likelihoods = measurement_model.getLikelihoodVectorized(
particles_, measurement);
weights_ = weights_.cwiseProduct(likelihoods);
weights_ /= weights_.sum();
// Resample using the provided resampling method
if (resample_method_) {
resample_method_(&particles_, &weights_);
}
}
Eigen::VectorXd ParticleFilter::getExpectation() {
return particles_ * weights_;
}
Eigen::VectorXd ParticleFilter::getMaxWeightParticle() {
Eigen::VectorXd::Index index;
weights_.maxCoeff(&index);
return particles_.col(index);
}
Eigen::MatrixXd ParticleFilter::getParticles() {
return particles_;
}
void ParticleFilter::getParticlesAndWeights(Eigen::MatrixXd* particles,
Eigen::VectorXd* weights) {
*particles = particles_;
*weights = weights_;
}
} // namespace refill
| 33.611111 | 79 | 0.722314 | jwidauer |
6b1d21f6469f9edb73a2804840722da9fb79c90b | 351 | cpp | C++ | tests/Issue45Example.cpp | galorojo/cppinsights | 52ecab4ddd8e36fb99893551cf0fb8b5d58589f2 | [
"MIT"
] | 1,853 | 2018-05-13T21:49:17.000Z | 2022-03-30T10:34:45.000Z | tests/Issue45Example.cpp | galorojo/cppinsights | 52ecab4ddd8e36fb99893551cf0fb8b5d58589f2 | [
"MIT"
] | 398 | 2018-05-15T14:48:51.000Z | 2022-03-24T12:14:33.000Z | tests/Issue45Example.cpp | galorojo/cppinsights | 52ecab4ddd8e36fb99893551cf0fb8b5d58589f2 | [
"MIT"
] | 104 | 2018-05-15T04:00:59.000Z | 2022-03-17T02:04:15.000Z | int main()
{
int x = 0;
for(; x < 20; ++x) {
x += x;
}
for(int i=0; x < 20; ++x) {
x += i;
}
for(int i = 0, y=2, t=4, o=5; i < 20; ++i) {
x += i;
}
for(int *i = &x, *y=&x; i ; ++i) {
x += *i;
}
for(;;);
char data[5]{};
for(auto& x : data) {
x = 2;
}
}
| 12.103448 | 48 | 0.270655 | galorojo |
6b1f1422f82b7b23ad946a60eb9998c5f66dd41c | 145 | cpp | C++ | lang/Math.cpp | gizmomogwai/cpplib | a09bf4d3f2a312774d3d85a5c65468099a1797b0 | [
"MIT"
] | null | null | null | lang/Math.cpp | gizmomogwai/cpplib | a09bf4d3f2a312774d3d85a5c65468099a1797b0 | [
"MIT"
] | null | null | null | lang/Math.cpp | gizmomogwai/cpplib | a09bf4d3f2a312774d3d85a5c65468099a1797b0 | [
"MIT"
] | null | null | null | #include <lang/Math.h>
const float Math::PI = 3.1415926535897932384626433832795f;
const float Math::A_PI = 0.0174532925199432957692369076848f;
| 24.166667 | 60 | 0.8 | gizmomogwai |
6b1f4ef9f8f398bed644cd86cac558535e77194e | 4,175 | hh | C++ | src/transport/ConnectionManager.hh | nherment/gazebo | fff0aa30b4b5748e43c2b0aa54ffcd366e9f042a | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2016-01-17T20:41:39.000Z | 2018-05-01T12:02:58.000Z | src/transport/ConnectionManager.hh | nherment/gazebo | fff0aa30b4b5748e43c2b0aa54ffcd366e9f042a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/transport/ConnectionManager.hh | nherment/gazebo | fff0aa30b4b5748e43c2b0aa54ffcd366e9f042a | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2015-09-29T02:30:16.000Z | 2022-03-30T12:11:22.000Z | /*
* Copyright 2011 Nate Koenig & Andrew Howard
*
* 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 CONNECTION_MANAGER_HH
#define CONNECTION_MANAGER_HH
#include <boost/shared_ptr.hpp>
#include <string>
#include <list>
#include <vector>
#include "msgs/msgs.h"
#include "common/SingletonT.hh"
#include "transport/Publisher.hh"
#include "transport/Connection.hh"
namespace gazebo
{
namespace transport
{
/// \addtogroup gazebo_transport
/// \{
/// \brief Manager of connections
class ConnectionManager : public SingletonT<ConnectionManager>
{
/// \brief Constructor
private: ConnectionManager();
/// \brief Destructor
private: virtual ~ConnectionManager();
public: bool Init(const std::string &master_host,
unsigned int master_port);
/// \brief Run the connection manager loop
public: void Run();
/// \brief Return true if running (not stopped)
public: bool IsRunning() const;
/// \brief Finalize the conneciton manager
public: void Fini();
/// \brief Stop the conneciton manager
public: void Stop();
public: void Subscribe(const std::string &_topic,
const std::string &_msgType,
bool _latching);
public: void Unsubscribe(const msgs::Subscribe &_sub);
public: void Unsubscribe(const std::string &_topic,
const std::string &_msgType);
public: void Advertise(const std::string &topic,
const std::string &msgType);
public: void Unadvertise(const std::string &topic);
/// \brief Explicitly update the publisher list
public: void GetAllPublishers(std::list<msgs::Publish> &publishers);
/// \brief Remove a connection
public: void RemoveConnection(ConnectionPtr &conn);
/// \brief Register a new topic namespace
public: void RegisterTopicNamespace(const std::string &_name);
/// \brief Get all the topic namespaces
public: void GetTopicNamespaces(std::list<std::string> &_namespaces);
/// \brief Find a connection that matches a host and port
private: ConnectionPtr FindConnection(const std::string &host,
unsigned int port);
/// \brief Connect to a remote server
public: ConnectionPtr ConnectToRemoteHost(const std::string &host,
unsigned int port);
private: void OnMasterRead(const std::string &data);
private: void OnAccept(const ConnectionPtr &new_connection);
private: void OnRead(const ConnectionPtr &new_connection,
const std::string &data);
private: void ProcessMessage(const std::string &_packet);
public: void RunUpdate();
private: ConnectionPtr masterConn;
private: Connection *serverConn;
private: std::list<ConnectionPtr> connections;
protected: std::vector<event::ConnectionPtr> eventConnections;
private: bool initialized;
private: bool stop, stopped;
private: boost::thread *thread;
private: unsigned int tmpIndex;
private: boost::recursive_mutex *listMutex;
private: boost::recursive_mutex *masterMessagesMutex;
private: boost::recursive_mutex *connectionMutex;
private: std::list<msgs::Publish> publishers;
private: std::list<std::string> namespaces;
private: std::list<std::string> masterMessages;
// Singleton implementation
private: friend class SingletonT<ConnectionManager>;
};
/// \}
}
}
#endif
| 30.698529 | 75 | 0.651018 | nherment |
6b2155265d526ef29c860991525c0ac240e4fe8d | 17,701 | hpp | C++ | boards/src/hls/xfopencv_erosion/include/imgproc/xf_resize_nn_bilinear.hpp | maxpark/Pynq-CV-OV5640 | 8245e17766ff9cad678bd40020bfa0f0d5203972 | [
"BSD-3-Clause"
] | 26 | 2020-04-17T02:24:52.000Z | 2022-03-29T23:17:48.000Z | boards/src/hls/xfopencv_erosion/include/imgproc/xf_resize_nn_bilinear.hpp | maxpark/Pynq-CV-OV5640 | 8245e17766ff9cad678bd40020bfa0f0d5203972 | [
"BSD-3-Clause"
] | 2 | 2020-08-20T06:28:34.000Z | 2020-11-01T04:14:03.000Z | boards/src/hls/xfopencv_erosion/include/imgproc/xf_resize_nn_bilinear.hpp | maxpark/Pynq-CV-OV5640 | 8245e17766ff9cad678bd40020bfa0f0d5203972 | [
"BSD-3-Clause"
] | 16 | 2020-04-24T09:36:43.000Z | 2022-02-08T16:39:25.000Z | /***************************************************************************
Copyright (c) 2018, Xilinx, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the 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.
***************************************************************************/
#ifndef _XF_RESIZE_NN_BILINEAR_
#define _XF_RESIZE_NN_BILINEAR_
#include "hls_stream.h"
#include "ap_int.h"
#include "common/xf_common.h"
#include "common/xf_utility.h"
#include <iostream>
template<int DEPTH, int INTERPOLATION_TYPE, int NPPC>
void interpolatePixel(XF_CTUNAME(DEPTH,NPPC) A0, XF_CTUNAME(DEPTH,NPPC) B0, XF_CTUNAME(DEPTH,NPPC) A1, XF_CTUNAME(DEPTH,NPPC) B1, ap_ufixed<12,2> Wx, ap_ufixed<12,2> Wy, XF_CTUNAME(DEPTH,NPPC) &pixel)
{
#pragma HLS inline
if(INTERPOLATION_TYPE==XF_INTERPOLATION_NN)
{
pixel = A0;
}
else
{
ap_ufixed<12,2> Wxy;
ap_int<16> val0,val1,val2;
ap_fixed<28,18> P1,P2,P3,P4;
ap_ufixed<28,18> one_num = 1.0;
Wxy = (Wx*Wy); // Wx - 0.32, Wy-0.32 (Wx*Wy-0.64) Wxy - 0.32
val0 = (A0+B1-(B0+A1));
val1 = (B0-A0);
val2 = (A1-A0);
P1 = (val0*Wxy); // val0(16.0) * Wxy(0.32) = P1(16.32)
P2 = (val1*Wy); // val1(16.0) * Wy(0.32) = P2(16.32)
P3 = (val2*Wx); // val1(16.0) * Wx(0.32) = P3(16.32)
P4 = (A0); // A0(8.0) P4(8.32)
pixel = (XF_CTUNAME(DEPTH,NPPC))((ap_fixed<32,22>)(P1 + P2 + P3 + P4));
// to get only integer part from sum of 8.32's , right shift by 32
}
}
template<int DEPTH, int INTERPOLATION_TYPE, int NPPC, int T_INDEX_INT, int NUMBEROFINPUTWORDS>
void computeOutputPixel(XF_TNAME(DEPTH,NPPC) A0[NUMBEROFINPUTWORDS], XF_TNAME(DEPTH,NPPC) B0[NUMBEROFINPUTWORDS], ap_uint<T_INDEX_INT> initIndex, ap_uint<T_INDEX_INT> indexx[XF_NPIXPERCYCLE(NPPC)], ap_ufixed<12,2> Wx[XF_NPIXPERCYCLE(NPPC)], ap_ufixed<12,2> Wy, XF_TNAME(DEPTH,NPPC) &pixel)
{
#pragma HLS inline
const int PIXELDEPTH = XF_DTPIXELDEPTH(DEPTH,NPPC)/XF_CHANNELS(DEPTH,NPPC);
/*if(indexx[XF_NPIXPERCYCLE(NPPC)-1] > (initIndex+NUMBEROFINPUTWORDS*XF_NPIXPERCYCLE(NPPC)-1))
{
std::cout << "Insufficient number of words to resize in X" << std::endl;
return;
}*/
assert((indexx[XF_NPIXPERCYCLE(NPPC)-1] < (initIndex+NUMBEROFINPUTWORDS*XF_NPIXPERCYCLE(NPPC)-1)) && "Insufficient number of words to resize in X");
XF_PTUNAME(DEPTH) unpackX1[XF_NPIXPERCYCLE(NPPC)*NUMBEROFINPUTWORDS];
#pragma HLS ARRAY_PARTITION variable=unpackX1 complete dim=1
XF_PTUNAME(DEPTH) unpackX2[XF_NPIXPERCYCLE(NPPC)*NUMBEROFINPUTWORDS];
#pragma HLS ARRAY_PARTITION variable=unpackX2 complete dim=1
XF_PTUNAME(DEPTH) outputPixel[XF_NPIXPERCYCLE(NPPC)];
#pragma HLS ARRAY_PARTITION variable=outputPixel complete dim=1
for(int k=0; k<NUMBEROFINPUTWORDS; k++)
{
#pragma HLS UNROLL
for(int i=0; i<XF_NPIXPERCYCLE(NPPC); i++)
{
#pragma HLS UNROLL
unpackX1[k*XF_NPIXPERCYCLE(NPPC)+i] = A0[k].range((i+1)*XF_DTPIXELDEPTH(DEPTH,NPPC)-1,i*XF_DTPIXELDEPTH(DEPTH,NPPC));
unpackX2[k*XF_NPIXPERCYCLE(NPPC)+i] = B0[k].range((i+1)*XF_DTPIXELDEPTH(DEPTH,NPPC)-1,i*XF_DTPIXELDEPTH(DEPTH,NPPC));
}
}
for(int i=0; i<XF_NPIXPERCYCLE(NPPC); i++)
{
#pragma HLS UNROLL
for(int k=0; k<XF_CHANNELS(DEPTH,NPPC); k++)
{
#pragma HLS UNROLL
XF_CTUNAME(DEPTH,NPPC) unpackX1temp[XF_NPIXPERCYCLE(NPPC)*NUMBEROFINPUTWORDS];
#pragma HLS ARRAY_PARTITION variable=unpackX1temp complete dim=1
XF_CTUNAME(DEPTH,NPPC) unpackX2temp[XF_NPIXPERCYCLE(NPPC)*NUMBEROFINPUTWORDS];
#pragma HLS ARRAY_PARTITION variable=unpackX2temp complete dim=1
for(int l=0; l<XF_NPIXPERCYCLE(NPPC)*NUMBEROFINPUTWORDS; l++)
{
#pragma HLS UNROLL
unpackX1temp[l] = unpackX1[l].range((k+1)*PIXELDEPTH-1,k*PIXELDEPTH);
unpackX2temp[l] = unpackX2[l].range((k+1)*PIXELDEPTH-1,k*PIXELDEPTH);
}
XF_CTUNAME(DEPTH,NPPC) currentoutput;
interpolatePixel<DEPTH, INTERPOLATION_TYPE, NPPC>(unpackX1temp[indexx[i]-initIndex], unpackX2temp[indexx[i]-initIndex], unpackX1temp[indexx[i]-initIndex+1], unpackX2temp[indexx[i]-initIndex+1], Wx[i], Wy, currentoutput);
outputPixel[i].range((k+1)*PIXELDEPTH-1,k*PIXELDEPTH) = currentoutput;
}
}
for(int i=0; i<XF_NPIXPERCYCLE(NPPC); i++)
{
#pragma HLS UNROLL
pixel.range((i+1)*XF_DTPIXELDEPTH(DEPTH,NPPC)-1,i*XF_DTPIXELDEPTH(DEPTH,NPPC)) = outputPixel[i];
}
}
static uint64_t xfUDivResize (uint64_t in_n, unsigned short in_d)
{
#pragma HLS INLINE OFF
uint32_t out_res = in_n/in_d;
return out_res;
}
template<int NPPC, int T_SCALE_WIDTH, int T_SCALE_INT, int T_COMP_INDEX_WIDTH, int T_COMP_INDEX_INT>
void scaleMult(ap_ufixed<T_SCALE_WIDTH,T_SCALE_INT> scalex, ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT> scaleXParallel[XF_NPIXPERCYCLE(NPPC)])
{
#pragma HLS INLINE
for(int i=0; i<XF_NPIXPERCYCLE(NPPC); i++)
{
#pragma HLS PIPELINE
scaleXParallel[i] = (ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT>)scalex*(ap_uint<8>)i;
}
return;
}
template<int T_INDEX_INT, int T_COMP_INDEX_WIDTH, int T_COMP_INDEX_INT, int T_SCALE_WIDTH, int T_SCALE_INT, int INTERPOLATION_TYPE>
void scaleCompute(int currindex, ap_ufixed<T_SCALE_WIDTH,T_SCALE_INT> inscale, ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT> &ind_pre)
{
if(INTERPOLATION_TYPE==XF_INTERPOLATION_NN)
{
ind_pre = (ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT>)currindex*inscale + (ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT>)0.001;
}
else
{
ind_pre = ((ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT>)currindex + (ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT>)0.5)*inscale - (ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT>)0.5;
}
}
template <int INTERPOLATION_TYPE, int T_COMP_INDEX_WIDTH, int T_COMP_INDEX_INT, int T_INDEX_INT, int T_SCALE_WIDTH, int T_SCALE_INT, int T_WEIGHT_WIDTH, int T_WEIGHT_INT, int NPPC>
void computeInterpolation(int inrows, int incols, int j, int output_rows_count, ap_ufixed<T_SCALE_WIDTH,T_SCALE_INT> scalex, ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT> scaleXParallel[XF_NPIXPERCYCLE(NPPC)], ap_ufixed<T_SCALE_WIDTH,T_SCALE_INT> scaley, ap_uint<T_INDEX_INT> indexx[XF_NPIXPERCYCLE(NPPC)], ap_uint<T_INDEX_INT> &indexy, ap_uint<T_INDEX_INT> &nextYScale, ap_ufixed<T_WEIGHT_WIDTH,T_WEIGHT_INT> WeightX[XF_NPIXPERCYCLE(NPPC)], ap_ufixed<T_WEIGHT_WIDTH,T_WEIGHT_INT> &WeightY, ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT> indexx_pre_comp, ap_fixed<T_COMP_INDEX_WIDTH,T_COMP_INDEX_INT> indexy_pre_comp)
{
const int INDEX_INT = T_INDEX_INT;
const int WEIGHT_WIDTH = T_WEIGHT_WIDTH;
const int WEIGHT_INT = T_WEIGHT_INT;
const int SCALE_WIDTH = T_SCALE_WIDTH;
const int SCALE_INT = T_SCALE_INT;
const int COMP_INDEX_WIDTH = T_COMP_INDEX_WIDTH;
const int COMP_INDEX_INT = T_COMP_INDEX_INT;
ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT> indexx_pre = 0;
ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT> indexy_pre = 0;
if(INTERPOLATION_TYPE==XF_INTERPOLATION_NN)
{
indexy_pre = indexy_pre_comp;
nextYScale = indexy_pre+scaley;
indexy = (ap_uint<INDEX_INT>)indexy_pre;
}
else
{
indexy_pre = indexy_pre_comp;
nextYScale = indexy_pre+(ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT>)scaley;
if(indexy_pre < 0)
{
indexy_pre = 0;
}
else if(indexy_pre > inrows-1)
{
indexy_pre = inrows-1;
}
indexy = (ap_uint<INDEX_INT>)indexy_pre;
WeightY = ((ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT>)indexy_pre - (ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT>)indexy);
}
for(int i=0; i<XF_NPIXPERCYCLE(NPPC); i++)
{
ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT> indexy_pre = 0;
if(INTERPOLATION_TYPE==XF_INTERPOLATION_NN)
{
indexx_pre = indexx_pre_comp + scaleXParallel[i];
indexx[i] = (ap_uint<INDEX_INT>)indexx_pre;
}
else
{
indexx_pre = indexx_pre_comp + scaleXParallel[i];
if(indexx_pre < 0)
{
indexx_pre = 0;
}
else if(indexx_pre > incols-1)
{
indexx_pre = incols-1;
}
indexx[i] = (ap_uint<INDEX_INT>)indexx_pre;
WeightX[i] = ((ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT>)indexx_pre - (ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT>)indexx[i]);
}
}
}
template<int SRC_TYPE, int INHEIGHT, int INWIDTH, int NPPC, int OUTHEIGHT, int OUTWIDTH, int INTERPOLATION_TYPE, int MAX_DOWN_SCALE>
void resizeNNBilinear(xf::Mat<SRC_TYPE, INHEIGHT, INWIDTH, NPPC> &imgInput,xf::Mat<SRC_TYPE, OUTHEIGHT, OUTWIDTH, NPPC> &imgOutput)
{
#pragma HLS ALLOCATION instances=scaleCompute limit=1 function
#pragma HLS ALLOCATION instances=xfUDivResize limit=1 function
const int INDEX_INT = 17;
const int WEIGHT_WIDTH = 12;
const int WEIGHT_INT = 2;
const int SCALE_WIDTH = 32;
const int SCALE_INT = 3;
const int PRE_INDEX_WIDTH = 10;
const int PRE_INDEX_INT = 17;
const int COMP_INDEX_WIDTH = SCALE_WIDTH+PRE_INDEX_WIDTH;
const int COMP_INDEX_INT = SCALE_INT+PRE_INDEX_INT;
const int BUFFER_WORDS = MAX_DOWN_SCALE;
const int BUFFER_DUP_FACTOR = (BUFFER_WORDS+1)>>1;
uint64_t xnew,ynew;
xnew = (imgInput.cols);///(float)(out_width<<XF_BITSHIFT(NPPC));
ynew = (imgInput.rows);//(float)(out_height);
xnew = xnew << 28;
ynew = ynew << 28;
ap_ufixed<SCALE_WIDTH,SCALE_INT> scalex,scaley;
uint64_t Xscale64,Yscale64;
Xscale64 = xfUDivResize (xnew , (imgOutput.cols));
Yscale64 = xfUDivResize (ynew , (imgOutput.rows));
ap_ufixed<64,32> temp_scale_conv;
temp_scale_conv = Xscale64;
temp_scale_conv = temp_scale_conv >> 28;
scalex = temp_scale_conv;
temp_scale_conv = Yscale64;
temp_scale_conv = temp_scale_conv >> 28;
scaley = temp_scale_conv;
ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT> scaleXParallel[XF_NPIXPERCYCLE(NPPC)];
#pragma HLS ARRAY_PARTITION variable=scaleXParallel complete dim=1
scaleMult<NPPC,SCALE_WIDTH,SCALE_INT,COMP_INDEX_WIDTH,COMP_INDEX_INT>(scalex,scaleXParallel);
XF_TNAME(SRC_TYPE,NPPC) line_buffer[3][BUFFER_DUP_FACTOR][INWIDTH>>(XF_BITSHIFT(NPPC))];
#pragma HLS ARRAY_PARTITION variable=line_buffer complete dim=1
#pragma HLS ARRAY_PARTITION variable=line_buffer complete dim=2
int input_read_pointer=0;
int read_rows_count = 0;
int output_write_pointer = 0;
for(int i=0; i<2; i++) //read two rows
{
#pragma HLS LOOP_TRIPCOUNT min=1 max=2
for(int j=0; j<(imgInput.cols>>(XF_BITSHIFT(NPPC))); j++)
{
#pragma HLS PIPELINE
#pragma HLS LOOP_TRIPCOUNT min=1 max=INWIDTH/NPPC
for(int k=0; k<BUFFER_DUP_FACTOR ; k++)
{
line_buffer[i][k][j] = imgInput.data[input_read_pointer];
}
input_read_pointer++;
}
read_rows_count++;
}
int output_rows_count = 0;
int first_row_index = 0;
int second_row_index = 1;
int read_row_index = 2;
int loop_row_count = (imgOutput.rows > imgInput.rows)? imgOutput.rows : imgInput.rows;
int loop_col_count = (imgOutput.cols > imgInput.cols)? imgOutput.cols : imgInput.cols;
const int LOOPCOUNTROW = (INHEIGHT>OUTHEIGHT)? INHEIGHT: OUTHEIGHT;
const int LOOPCOUNTCOL = (INWIDTH>OUTWIDTH)? INWIDTH: OUTWIDTH;
ap_uint<INDEX_INT> indexx[XF_NPIXPERCYCLE(NPPC)];
#pragma HLS ARRAY_PARTITION variable=indexx complete dim=1
ap_uint<INDEX_INT> indexy = 0;
ap_uint<INDEX_INT> nextYScale = 0;
ap_ufixed<WEIGHT_WIDTH,WEIGHT_INT> WeightX[XF_NPIXPERCYCLE(NPPC)];
#pragma HLS ARRAY_PARTITION variable=WeightX complete dim=1
ap_ufixed<WEIGHT_WIDTH,WEIGHT_INT> WeightY = 0;
XF_TNAME(SRC_TYPE,NPPC) P0Buf[BUFFER_DUP_FACTOR<<1];
#pragma HLS ARRAY_PARTITION variable=P0Buf complete dim=1
XF_TNAME(SRC_TYPE,NPPC) P1Buf[BUFFER_DUP_FACTOR<<1];
#pragma HLS ARRAY_PARTITION variable=P1Buf complete dim=1
ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT> indexx_pre_comp = 0;
ap_fixed<COMP_INDEX_WIDTH,COMP_INDEX_INT> indexy_pre_comp = 0;
for(int i=0; i<loop_row_count; i++)
{
#pragma HLS LOOP_TRIPCOUNT min=1 max=LOOPCOUNTROW
scaleCompute<INDEX_INT, COMP_INDEX_WIDTH, COMP_INDEX_INT, SCALE_WIDTH, SCALE_INT, INTERPOLATION_TYPE>(output_rows_count, scaley, indexy_pre_comp);
for(int j=0; j<(loop_col_count>>(XF_BITSHIFT(NPPC))); j++)
{
#pragma HLS PIPELINE
#pragma HLS LOOP_TRIPCOUNT min=1 max=LOOPCOUNTCOL/NPPC
scaleCompute<INDEX_INT, COMP_INDEX_WIDTH, COMP_INDEX_INT, SCALE_WIDTH, SCALE_INT, INTERPOLATION_TYPE>(j<<(XF_BITSHIFT(NPPC)), scalex, indexx_pre_comp);
computeInterpolation<INTERPOLATION_TYPE, COMP_INDEX_WIDTH, COMP_INDEX_INT, INDEX_INT, SCALE_WIDTH, SCALE_INT, WEIGHT_WIDTH, WEIGHT_INT, NPPC>(imgInput.rows, imgInput.cols, j<<(XF_BITSHIFT(NPPC)), output_rows_count, scalex, scaleXParallel, scaley, indexx, indexy, nextYScale, WeightX, WeightY, indexx_pre_comp, indexy_pre_comp);
int indexstores = first_row_index;
XF_TNAME(SRC_TYPE,NPPC) read_pixel;
bool flag_write = 0;
if(read_rows_count != imgInput.rows)
{
if((nextYScale >= read_rows_count-1)) //check if the next index y needed needs to be read.
{
if(j<(imgInput.cols>>(XF_BITSHIFT(NPPC))))
{
read_pixel = imgInput.data[input_read_pointer];
flag_write = 1;
input_read_pointer++;
}
else
{
flag_write = 0;
}
}
else
{
flag_write = 0;
}
}
else
{
flag_write = 0;
}
if(indexstores == 0)
{
for(int k=0; k<BUFFER_DUP_FACTOR; k++)
{
#pragma HLS UNROLL
P0Buf[(k<<1)] = line_buffer[0][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)];
P0Buf[(k<<1)+1] = line_buffer[0][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)+1];
P1Buf[(k<<1)] = line_buffer[1][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)];
P1Buf[(k<<1)+1] = line_buffer[1][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)+1];
}
if(flag_write)
{
for(int k=0; k<BUFFER_DUP_FACTOR; k++)
{
#pragma HLS UNROLL
line_buffer[2][k][j] = read_pixel;
}
}
}
else if(indexstores == 1)
{
for(int k=0; k<BUFFER_DUP_FACTOR; k++)
{
#pragma HLS UNROLL
P0Buf[(k<<1)] = line_buffer[1][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)];
P0Buf[(k<<1)+1] = line_buffer[1][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)+1];
P1Buf[(k<<1)] = line_buffer[2][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)];
P1Buf[(k<<1)+1] = line_buffer[2][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)+1];
}
if(flag_write)
{
for(int k=0; k<BUFFER_DUP_FACTOR; k++)
{
#pragma HLS UNROLL
line_buffer[0][k][j] = read_pixel;
}
}
}
else
{
for(int k=0; k<BUFFER_DUP_FACTOR; k++)
{
#pragma HLS UNROLL
P0Buf[(k<<1)] = line_buffer[2][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)];
P0Buf[(k<<1)+1] = line_buffer[2][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)+1];
P1Buf[(k<<1)] = line_buffer[0][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)];
P1Buf[(k<<1)+1] = line_buffer[0][k][(indexx[0]>>XF_BITSHIFT(NPPC))+(k<<1)+1];
}
if(flag_write)
{
for(int k=0; k<BUFFER_DUP_FACTOR; k++)
{
#pragma HLS UNROLL
line_buffer[1][k][j] = read_pixel;
}
}
}
if((output_rows_count <= imgOutput.rows-1) && (((indexy == read_rows_count-1) && (read_rows_count == imgInput.rows)) || (indexy == read_rows_count-2)))
{
if(j<(imgOutput.cols>>(XF_BITSHIFT(NPPC))))
{
if(indexy == read_rows_count-1)
{
for(int k=0; k<BUFFER_WORDS; k++)
{
#pragma HLS UNROLL
P0Buf[k] = P1Buf[k];
}
}
XF_TNAME(SRC_TYPE,NPPC) temp_store_output;
computeOutputPixel<SRC_TYPE,INTERPOLATION_TYPE,NPPC,INDEX_INT,BUFFER_WORDS>(P0Buf,P1Buf,((indexx[0]>>XF_BITSHIFT(NPPC))<<XF_BITSHIFT(NPPC)),indexx,WeightX,WeightY,temp_store_output);
imgOutput.data[output_write_pointer] = temp_store_output;
output_write_pointer++;
}
}
}
if((output_rows_count <= imgOutput.rows-1) && (((indexy == read_rows_count-1) && (read_rows_count == imgInput.rows)) || (indexy == read_rows_count-2)))
{
output_rows_count++;
}
if(read_rows_count != imgInput.rows)
{
if((nextYScale >= read_rows_count-1)) //check if the next index y needed needs to be read.
{
first_row_index++;
second_row_index++;
read_row_index++;
if(read_row_index == 3)
{
read_row_index = 0;
}
if(first_row_index == 3)
{
first_row_index = 0;
}
if(second_row_index == 3)
{
second_row_index = 0;
}
read_rows_count++;
}
}
}
}
#endif
| 39.777528 | 617 | 0.698774 | maxpark |
6b256a3b2e23b1a6805a51d2cd7f357dd8af8df0 | 22,390 | cpp | C++ | game/code/common/engine/render/renderobject.cpp | justinctlam/MarbleStrike | 64fe36a5a4db2b299983b0e2556ab1cd8126259b | [
"MIT"
] | null | null | null | game/code/common/engine/render/renderobject.cpp | justinctlam/MarbleStrike | 64fe36a5a4db2b299983b0e2556ab1cd8126259b | [
"MIT"
] | null | null | null | game/code/common/engine/render/renderobject.cpp | justinctlam/MarbleStrike | 64fe36a5a4db2b299983b0e2556ab1cd8126259b | [
"MIT"
] | 2 | 2019-03-08T03:02:45.000Z | 2019-05-14T08:41:26.000Z | //////////////////////////////////////////////////////
// INCLUDES
//////////////////////////////////////////////////////
#include "common/engine/math/quaternion.hpp"
#include "common/engine/math/mathfunctions.hpp"
#include "common/engine/render/renderobject.hpp"
#include "common/engine/physics/physicsdata.hpp"
#include "common/engine/physics/physicsconstraintdata.hpp"
#include "common/engine/system/stringutilities.hpp"
#include "common/engine/system/utilities.hpp"
#include "common/engine/render/cubicbezierspline.hpp"
#include "common/engine/render/followpathconstraint.hpp"
#include "common/engine/render/curve.hpp"
#include "common/engine/render/cubicbezierspline.hpp"
#include "common/engine/game/gameapp.hpp"
#include "common/engine/messages/messagehandler.hpp"
#include <string>
#include <algorithm>
//////////////////////////////////////////////////////
// CLASS METHODS
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
// CLASS METHODS
//////////////////////////////////////////////////////
RenderObject::RenderObject()
{
System::StringCopy( mObjectName, 64, "" );
System::StringCopy( mGameType, 64, "general" );
mScriptFile[0] = '\0';
mRenderObjectData = NULL;
mPhysicsData = NULL;
mPhysicsConstraintData = NULL;
mFollowPathConstraint = NULL;
mFrame = 0;
mKeyFrame = 0;
mStartFrame = 0;
mEndFrame = 0;
mProxyObject = NULL;
mIsVisible = true;
mAnimationState = ANIMATION_STATE_STOPPED;
mLoopAnimation = false;
mStartAnimation = false;
mResetAnimation = false;
mParentObject = NULL;
mOnStopAnimation = TRIGGER_TYPE_NONE;
mInitStartFrame = 0;
System::StringCopy( mParentObjectName, 64, "" );
}
//============================================================================
RenderObject::~RenderObject()
{
DELETE_PTR( mPhysicsData );
DELETE_PTR( mPhysicsConstraintData );
DELETE_PTR( mFollowPathConstraint );
}
//============================================================================
void RenderObject::Initialize()
{
SetFrame( mInitStartFrame );
StartAnimation();
Update( 0 );
StopAnimation();
if ( mLoopAnimation )
{
LoopAnimation( true );
}
if ( mStartAnimation )
{
StartAnimation();
}
}
//============================================================================
void RenderObject::Reset()
{
if ( mResetAnimation )
{
SetFrame( mInitStartFrame );
StartAnimation();
Update( 0 );
StopAnimation();
}
}
//============================================================================
void RenderObject::Update( float elapsedTime )
{
if ( mAnimationState == ANIMATION_STATE_PLAYING )
{
if ( mFollowPathConstraint )
{
RenderObject* targetObject = mFollowPathConstraint->GetTarget();
Curve* curveObject = reinterpret_cast<Curve*>( targetObject->GetRenderObjectData() );
curveObject->Update( elapsedTime );
if ( curveObject->GetAnimationState() == Curve::CURVE_ANIMATION_STATE_PLAYING )
{
CubicBezierSpline* spline = curveObject->GetSpline( 0 );
float totalLength = spline->GetTotalLength();
float evaluationTime = curveObject->GetEvaluationTime();
float pathDuration = curveObject->GetPathDuration();
float positionLength = totalLength * ( evaluationTime / pathDuration );
float t = spline->GetPercentageFromLength( positionLength );
if ( t >= 1.0f )
{
t = 0.99f;
}
Math::Vector3 position = spline->Evaluate( t );
mTransform.SetIdentity();
mTransform.Translate( position );
mTransform = targetObject->GetTransform() * mTransform;
}
else
{
mAnimationState = ANIMATION_STATE_STOPPED;
}
}
if ( mEndFrame > 0 )
{
UpdateAnimationTransform( mFrame, mKeyFrame );
mFrame += 24.0f * elapsedTime;
if ( mFrame > mAnimationPosition[0][mKeyFrame+1].mCenter[0] )
{
mKeyFrame++;
}
if ( mFrame >= mEndFrame )
{
if ( mOnStopAnimation != TRIGGER_TYPE_NONE )
{
TriggerMessage* triggerMessage = NEW_PTR( "Message" ) TriggerMessage;
triggerMessage->mTriggerType = mOnStopAnimation;
triggerMessage->mData = (void*)mObjectName;
GameApp::Get()->GetMessageHandler()->SendMsg( PORT_GAME, triggerMessage );
}
if ( mLoopAnimation )
{
mFrame = 0;
mKeyFrame = 0;
}
else
{
mAnimationState = ANIMATION_STATE_STOPPED;
}
}
}
}
}
//============================================================================
void RenderObject::SetObjectName( const char* name )
{
System::StringCopy( mObjectName, 64, name );
}
//============================================================================
void RenderObject::SetGameType( const char* type )
{
System::StringCopy( mGameType, 64, type );
}
//============================================================================
const char* RenderObject::GetGameType()
{
if ( mProxyObject )
{
return mProxyObject->GetGameType();
}
else
{
return mGameType;
}
}
//============================================================================
RenderObjectData* RenderObject::GetRenderObjectData() const
{
if ( mProxyObject )
{
return mProxyObject->GetRenderObjectData();
}
else
{
return mRenderObjectData;
}
}
//============================================================================
Math::Matrix44 RenderObject::GetTransform() const
{
Math::Matrix44 parentTransform;
if ( mParentObject )
{
parentTransform = mParentObject->GetTransform();
}
if ( mProxyObject )
{
return parentTransform * mTransform * mProxyObject->GetTransform();
}
else
{
return parentTransform * mTransform;
}
}
//============================================================================
PhysicsData* RenderObject::GetPhysicsData() const
{
if ( mProxyObject )
{
return mProxyObject->GetPhysicsData();
}
else
{
return mPhysicsData;
}
}
//============================================================================
void RenderObject::Load( tinyxml2::XMLNode* node )
{
tinyxml2::XMLElement* element = node->ToElement();
const char* name = element->Attribute( "name" );
SetObjectName( name );
const char* gameType = element->Attribute( "game_type" );
if ( gameType )
{
System::StringCopy( mGameType, 64, gameType );
}
const char* parentObject = element->Attribute( "parent" );
if ( parentObject )
{
System::StringCopy( mParentObjectName, 64, parentObject );
}
const char* startAnimation = element->Attribute( "start_animation" );
if ( startAnimation )
{
if ( System::StringICmp( startAnimation, "true" ) == 0 )
{
mStartAnimation = true;
}
else if ( System::StringICmp( startAnimation, "false" ) == 0 )
{
mStartAnimation = false;
}
}
else
{
mStartAnimation = true;
}
const char* loopAnimation = element->Attribute( "loop_animation" );
if ( loopAnimation )
{
if ( System::StringICmp( loopAnimation, "true" ) == 0 )
{
mLoopAnimation = true;
}
else if ( System::StringICmp( loopAnimation, "false" ) == 0 )
{
mLoopAnimation = false;
}
}
else
{
mLoopAnimation = true;
}
const char* onStopAnimation = element->Attribute( "on_stop_animation" );
if ( onStopAnimation )
{
if ( System::StringICmp( onStopAnimation, "REMOVE_OBJECT" ) == 0 )
{
mOnStopAnimation = TRIGGER_TYPE_REMOVE_OBJECT;
}
}
double value = element->DoubleAttribute( "start_frame" );
mInitStartFrame = static_cast<float>( value );
const char* resetAnimation = element->Attribute( "reset_animation" );
if ( resetAnimation )
{
if ( System::StringICmp( resetAnimation, "true" ) == 0 )
{
mResetAnimation = true;
}
else if ( System::StringICmp( resetAnimation, "false" ) == 0 )
{
mResetAnimation = false;
}
}
else
{
mResetAnimation = false;
}
const char* scriptFile = element->Attribute( "script" );
if ( scriptFile )
{
System::StringCopy( mScriptFile, 64, scriptFile );
}
const char* visible = element->Attribute( "visible" );
if ( visible && strcmp( visible, "True" ) == 0 )
{
mIsVisible = true;
}
else
{
mIsVisible = false;
}
for ( tinyxml2::XMLNode* currentNode = node->FirstChild(); currentNode != NULL; currentNode = currentNode->NextSibling() )
{
tinyxml2::XMLElement* element = currentNode->ToElement();
if ( element )
{
const char* elementValue = element->Value();
if ( strcmp( elementValue, "xform" ) == 0 )
{
LoadTransform( currentNode, mTransform );
}
else if ( strcmp( elementValue, "xform_local" ) == 0 )
{
LoadTransform( currentNode, mLocalTransform );
}
else if ( strcmp( elementValue, "boundingbox" ) == 0 )
{
std::string str = element->GetText();
str.erase( std::remove( str.begin(), str.end(), '\n' ), str.end() );
str.erase( std::remove( str.begin(), str.end(), '\t' ), str.end() );
const char* boundingBoxText = str.c_str();
std::vector<std::string> tokens;
tokens.reserve( 4 );
System::Tokenize( tokens, const_cast<char*>( boundingBoxText ), " " );
mBoundingBox[0] = static_cast<float>( atof( tokens[0].c_str() ) );
mBoundingBox[1] = static_cast<float>( atof( tokens[1].c_str() ) );
mBoundingBox[2] = static_cast<float>( atof( tokens[2].c_str() ) );
}
else if ( strcmp( elementValue, "scale" ) == 0 )
{
double x = element->DoubleAttribute( "x" );
double y = element->DoubleAttribute( "y" );
double z = element->DoubleAttribute( "z" );
mScale[0] = static_cast<float>( x );
mScale[1] = static_cast<float>( y );
mScale[2] = static_cast<float>( z );
}
else if ( strcmp( elementValue, "physics" ) == 0 )
{
mPhysicsData = NEW_PTR( "PhysicsData" ) PhysicsData;
mPhysicsData->Load( currentNode );
}
else if ( strcmp( elementValue, "constraint" ) == 0 )
{
const char* type = element->Attribute( "type" );
if ( strcmp( type, "RIGID_BODY_JOINT" ) == 0 )
{
mPhysicsConstraintData = NEW_PTR( "PhysicsConstraintData" ) PhysicsConstraintData;
mPhysicsConstraintData->Load( currentNode );
}
else if ( strcmp( type, "FOLLOW_PATH" ) == 0 )
{
mFollowPathConstraint = NEW_PTR( "mFollowPathConstraint" ) FollowPathConstraint;
mFollowPathConstraint->Load( currentNode );
}
}
else if ( strcmp( elementValue, "animation" ) == 0 )
{
mStartFrame = element->IntAttribute( "start" );
mEndFrame = element->IntAttribute( "end" );
LoadAnimation( currentNode );
UpdateAnimationTransform( 0, 0 );
}
}
}
}
//============================================================================
void RenderObject::LoadTransform( tinyxml2::XMLNode* node, Math::Matrix44 &transform )
{
tinyxml2::XMLElement* element = node->ToElement();
std::string str = element->GetText();
str.erase( std::remove( str.begin(), str.end(), '\n' ), str.end() );
str.erase( std::remove( str.begin(), str.end(), '\t' ), str.end() );
const char* transformText = str.c_str();
Assert( transformText != NULL, "" );
std::vector<std::string> tokens;
tokens.reserve( 16 );
System::Tokenize( tokens, const_cast<char*>( transformText ), " " );
for ( int i = 0; i < 16; ++i )
{
transform[i] = static_cast<float>( atof( tokens[i].c_str() ) );
}
}
//===========================================================================
void RenderObject::LoadAnimation( tinyxml2::XMLNode* node )
{
for ( tinyxml2::XMLNode* currentNode = node->FirstChild(); currentNode != NULL; currentNode = currentNode->NextSibling() )
{
tinyxml2::XMLElement* element = currentNode->ToElement();
if ( element )
{
const char* elementValue = element->Value();
if ( strcmp( elementValue, "curve" ) == 0 )
{
const char* name = element->Attribute( "name" );
if ( strcmp( name, "location" ) == 0 )
{
int index = element->IntAttribute( "index" );
int numKeys = element->IntAttribute( "keys" );
std::string str = element->GetText();
str.erase( std::remove( str.begin(), str.end(), '\n' ), str.end() );
str.erase( std::remove( str.begin(), str.end(), '\t' ), str.end() );
std::vector<std::string> tokens;
tokens.reserve( numKeys * 6 );
System::Tokenize( tokens, const_cast<char*>( str.c_str() ), " " );
int count = 0;
for ( int i = 0; i < numKeys; ++i )
{
AnimationData newData;
newData.mCenter[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mCenter[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mLeftHandle[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mLeftHandle[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mRightHandle[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mRightHandle[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
mAnimationPosition[index].push_back( newData );
}
}
else if ( strcmp( name, "rotation_euler" ) == 0 )
{
int index = element->IntAttribute( "index" );
int numKeys = element->IntAttribute( "keys" );
std::string str = element->GetText();
str.erase( std::remove( str.begin(), str.end(), '\n' ), str.end() );
str.erase( std::remove( str.begin(), str.end(), '\t' ), str.end() );
std::vector<std::string> tokens;
tokens.reserve( numKeys * 6 );
System::Tokenize( tokens, const_cast<char*>( str.c_str() ), " " );
int count = 0;
for ( int i = 0; i < numKeys; ++i )
{
AnimationData newData;
newData.mCenter[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mCenter[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mLeftHandle[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mLeftHandle[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mRightHandle[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mRightHandle[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
mAnimationRotation[index].push_back( newData );
}
}
else if ( strcmp( name, "scale" ) == 0 )
{
int index = element->IntAttribute( "index" );
int numKeys = element->IntAttribute( "keys" );
std::string str = element->GetText();
str.erase( std::remove( str.begin(), str.end(), '\n' ), str.end() );
str.erase( std::remove( str.begin(), str.end(), '\t' ), str.end() );
std::vector<std::string> tokens;
tokens.reserve( numKeys * 6 );
System::Tokenize( tokens, const_cast<char*>( str.c_str() ), " " );
int count = 0;
for ( int i = 0; i < numKeys; ++i )
{
AnimationData newData;
newData.mCenter[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mCenter[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mLeftHandle[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mLeftHandle[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mRightHandle[0] = static_cast<float>( atof( tokens[count++].c_str() ) );
newData.mRightHandle[1] = static_cast<float>( atof( tokens[count++].c_str() ) );
mAnimationScale[index].push_back( newData );
}
}
}
}
}
}
//===========================================================================
void RenderObject::StartAnimation()
{
if ( mProxyObject )
{
mProxyObject->StartAnimation();
}
if ( mFollowPathConstraint )
{
RenderObject* targetObject = mFollowPathConstraint->GetTarget();
Curve* curveObject = reinterpret_cast<Curve*>( targetObject->GetRenderObjectData() );
curveObject->StartAnimation();
}
mAnimationState = ANIMATION_STATE_PLAYING;
}
//===========================================================================
void RenderObject::StopAnimation()
{
if ( mProxyObject )
{
mProxyObject->StopAnimation();
}
if ( mFollowPathConstraint )
{
RenderObject* targetObject = mFollowPathConstraint->GetTarget();
Curve* curveObject = reinterpret_cast<Curve*>( targetObject->GetRenderObjectData() );
curveObject->StopAnimation();
}
mAnimationState = ANIMATION_STATE_STOPPED;
}
//===========================================================================
void RenderObject::SetFrame( float frame )
{
if ( frame >= mStartFrame && frame <= mEndFrame )
{
if ( mProxyObject )
{
mProxyObject->SetFrame( frame );
}
if ( mFollowPathConstraint )
{
RenderObject* targetObject = mFollowPathConstraint->GetTarget();
Curve* curveObject = reinterpret_cast<Curve*>( targetObject->GetRenderObjectData() );
curveObject->SetFrame( frame );
}
mFrame = frame;
mKeyFrame = FindStartingKeyFrame( frame );
}
else
{
Assert( false, "" );
}
}
//===========================================================================
void RenderObject::LoopAnimation( bool value )
{
if ( mProxyObject )
{
mProxyObject->LoopAnimation( value );
}
if ( mFollowPathConstraint )
{
RenderObject* targetObject = mFollowPathConstraint->GetTarget();
Curve* curveObject = reinterpret_cast<Curve*>( targetObject->GetRenderObjectData() );
curveObject->SetLoopAnimation( value );
}
mLoopAnimation = value;
}
//===========================================================================
float RenderObject::Solve2DCubicBezier( float xTarget, Math::Vector2 p0, Math::Vector2 p1, Math::Vector2 p2, Math::Vector2 p3 )
{
float xTolerance = 0.0001f;
float lower = 0.0f;
float upper = 1.0f;
float percent = (upper + lower) / 2.0f;
float xResult = CubicBezierSpline::CubicBezierEvaluate( percent, p0[0], p1[0], p2[0], p3[0] );
while ( fabs( xTarget - xResult ) > xTolerance && percent < 1.0f )
{
if ( xTarget > xResult )
{
lower = percent;
}
else
{
upper = percent;
}
percent = (upper + lower) / 2.0f;
xResult = CubicBezierSpline::CubicBezierEvaluate( percent, p0[0], p1[0], p2[0], p3[0] );
}
float yResult = CubicBezierSpline::CubicBezierEvaluate( percent, p0[1], p1[1], p2[1], p3[1] );
return yResult;
};
//===========================================================================
float RenderObject::AnimationDataInterpolate( float frame, AnimationData &data0, AnimationData &data1 )
{
float finalValue = Solve2DCubicBezier( frame, data0.mCenter, data0.mRightHandle, data1.mLeftHandle, data1.mCenter );
return finalValue;
}
//===========================================================================
void RenderObject::UpdateAnimationTransform( float frame, int keyFrame )
{
float xvalue = AnimationDataInterpolate( frame, mAnimationPosition[0][keyFrame], mAnimationPosition[0][keyFrame+1] );
float yvalue = AnimationDataInterpolate( frame, mAnimationPosition[1][keyFrame], mAnimationPosition[1][keyFrame+1] );
float zvalue = AnimationDataInterpolate( frame, mAnimationPosition[2][keyFrame], mAnimationPosition[2][keyFrame+1] );
float xrvalue = AnimationDataInterpolate( frame, mAnimationRotation[0][keyFrame], mAnimationRotation[0][keyFrame+1] );
float yrvalue = AnimationDataInterpolate( frame, mAnimationRotation[1][keyFrame], mAnimationRotation[1][keyFrame+1] );
float zrvalue = AnimationDataInterpolate( frame, mAnimationRotation[2][keyFrame], mAnimationRotation[2][keyFrame+1] );
float xsvalue = AnimationDataInterpolate( frame, mAnimationScale[0][keyFrame], mAnimationScale[0][keyFrame+1] );
float ysvalue = AnimationDataInterpolate( frame, mAnimationScale[1][keyFrame], mAnimationScale[1][keyFrame+1] );
float zsvalue = AnimationDataInterpolate( frame, mAnimationScale[2][keyFrame], mAnimationScale[2][keyFrame+1] );
mTransform.SetIdentity();
mTransform.Translate( xvalue, yvalue, zvalue );
mTransform.Rotate( Math::RadiansToDegree( yrvalue ), 0, 1, 0 );
mTransform.Rotate( Math::RadiansToDegree( zrvalue ), 0, 0, 1 );
mTransform.Rotate( Math::RadiansToDegree( xrvalue ), 1, 0, 0 );
mScale.Set( xsvalue, ysvalue, -zsvalue );
}
//===========================================================================
int RenderObject::FindStartingKeyFrame( float frame )
{
int foundKeyFrame = 0;
size_t numAnimationPositions = mAnimationPosition[0].size();
for ( int i = 0; i < numAnimationPositions; ++i )
{
float currentFrame = mAnimationPosition[0][i].mCenter[0];
if ( frame <= currentFrame )
{
break;
}
else
{
foundKeyFrame++;
}
}
if ( foundKeyFrame > 0 )
{
foundKeyFrame--;
}
return foundKeyFrame;
}
| 31.57969 | 128 | 0.544082 | justinctlam |
6b282cf7fc44dee5fc193d0a910f09c1aab123b5 | 555 | cpp | C++ | common/src/debug_test.cpp | honzatran/llvm-message-routing | 6878dffb935efe44fa8fdf443bfb9905ea604d29 | [
"MIT"
] | null | null | null | common/src/debug_test.cpp | honzatran/llvm-message-routing | 6878dffb935efe44fa8fdf443bfb9905ea604d29 | [
"MIT"
] | null | null | null | common/src/debug_test.cpp | honzatran/llvm-message-routing | 6878dffb935efe44fa8fdf443bfb9905ea604d29 | [
"MIT"
] | null | null | null |
#include <routing/call_counter.h>
#include <routing/debug.h>
#include <routing/testing.h>
#include <gtest/gtest.h>
using namespace std;
using namespace routing;
TEST(Once_in_time_test, test)
{
auto call_counter = define_void_mock<>(2, DEFINED("once in time"));
auto counter_fn = [&call_counter] { call_counter(); };
Once_in_time once_in_time(chrono::milliseconds{10});
auto now = chrono::system_clock::now();
while (chrono::system_clock::now() - now < chrono::milliseconds{22})
{
once_in_time(counter_fn);
}
}
| 20.555556 | 72 | 0.686486 | honzatran |
6b2b010c58353d60391b0c4d878aa10f9547d3a9 | 3,314 | cpp | C++ | src/Threading/Thread.cpp | tak2004/RadonFramework | e916627a54a80fac93778d5010c50c09b112259b | [
"Apache-2.0"
] | 3 | 2015-09-15T06:57:50.000Z | 2021-03-16T19:05:02.000Z | src/Threading/Thread.cpp | tak2004/RadonFramework | e916627a54a80fac93778d5010c50c09b112259b | [
"Apache-2.0"
] | 2 | 2015-09-26T12:41:10.000Z | 2015-12-08T08:41:37.000Z | src/Threading/Thread.cpp | tak2004/RadonFramework | e916627a54a80fac93778d5010c50c09b112259b | [
"Apache-2.0"
] | 1 | 2015-07-09T02:56:34.000Z | 2015-07-09T02:56:34.000Z | #include "RadonFramework/System/Threading/Thread.hpp"
#include "RadonFramework/System/Hardware/Hardware.hpp"
#include "RadonFramework/Threading/Scopelock.hpp"
#include "RadonFramework/precompiled.hpp"
namespace RadonFramework::Threading
{
Thread::Thread()
{
m_AffinityMask.Resize(RF_SysHardware::GetAvailableLogicalProcessorCount());
m_AffinityMask.Set();
}
Thread::~Thread()
{
if(m_ImplData != nullptr)
{
RF_SysThread::Destroy(m_ImplData);
}
}
void Thread::Run() {}
void Thread::Start()
{
m_ImplData = RF_SysThread::Create(*this, m_Pid);
RF_SysThread::SetPriority(m_ImplData, m_Priority);
RF_SysThread::SetAffinityMask(m_ImplData, m_AffinityMask);
RF_SysThread::PostConfigurationComplete(m_ImplData);
}
void Thread::Exit()
{
RF_SysThread::Stop(m_ImplData);
RF_SysThread::Join(m_ImplData);
}
void Thread::Interrupt() {}
ThreadPriority::Type Thread::Priority()
{
return m_Priority;
}
void Thread::Priority(ThreadPriority::Type Value)
{
if(Value != m_Priority)
{
m_Priority = Value;
RF_SysThread::SetPriority(m_ImplData, m_Priority);
}
}
void Thread::Join()
{
RF_SysThread::Join(m_ImplData);
}
void Thread::Join(const RF_Time::TimeSpan& Delta)
{
RF_SysThread::Wait(m_ImplData, Delta);
}
void Thread::Sleep(const RF_Time::TimeSpan& Delta)
{
RF_SysThread::Sleep(Delta);
}
RF_Type::Bool Thread::IsAlive()
{
return RF_SysThread::IsAlive(m_ImplData);
}
RF_Type::Bool Thread::Working()
{
return m_ImplData != nullptr;
}
void Thread::Finished() {}
const RF_Type::String& Thread::Name() const
{
return m_Name;
}
void Thread::Name(const class RF_Type::String& NewName)
{
m_Name = NewName;
return RF_SysThread::Rename(m_ImplData, NewName);
}
RF_Type::UInt64 Thread::Pid() const
{
return m_Pid;
}
void* Thread::MemAlloc(const RF_Type::UInt64 Bytes)
{
RF_Thread::Scopelock lock(m_ThreadBarrier);
RF_Mem::AutoPointerArray<RF_Type::UInt8> m(
static_cast<RF_Type::UInt32>(Bytes));
RF_Type::UInt8* p = m.Get();
m_ThreadAllocatedMemory.PushBack(m);
return p;
}
void Thread::FreeMem(const void* Ptr)
{
RF_Thread::Scopelock lock(m_ThreadBarrier);
Collections::AutoVector<RF_Type::UInt8>::Iterator it =
m_ThreadAllocatedMemory.Begin();
for(; it != m_ThreadAllocatedMemory.End(); ++it)
{
if((*it) == Ptr)
{
m_ThreadAllocatedMemory.Erase(it);
break;
}
}
}
RF_Type::Bool Thread::MemAccess(const void* Ptr)
{
RF_Thread::Scopelock lock(m_ThreadBarrier);
Collections::AutoVector<RF_Type::UInt8>::Iterator it =
m_ThreadAllocatedMemory.Begin();
for(; it != m_ThreadAllocatedMemory.End(); ++it)
{
if((*it) == Ptr)
{
return true;
}
}
return false;
}
RF_Type::UInt64 Thread::CurrentPid()
{
return RF_SysThread::GetProcessId();
}
RF_Type::Bool Thread::GetAffinityMask(RF_Collect::BitArray<>& Mask) const
{
return RF_SysThread::GetAffinityMask(m_ImplData, Mask);
}
RF_Type::Bool Thread::SetAffinityMask(const RF_Collect::BitArray<>& NewValue)
{
RF_Type::Bool result = true;
if(NewValue != m_AffinityMask)
{
m_AffinityMask = NewValue;
result = RF_SysThread::SetAffinityMask(m_ImplData, m_AffinityMask);
}
return result;
}
RF_Type::Bool Thread::ShouldRunning()
{
return RF_SysThread::IsRunning(m_ImplData);
}
} // namespace RadonFramework::Threading | 20.331288 | 77 | 0.714544 | tak2004 |
6b2b939775548cc32356ff1fc6745c2056be752c | 778 | cpp | C++ | docs/examples/Pixmap_erase_3.cpp | travisleithead/skia | 2092340a0edc25e9082ce9717643d12d901c3971 | [
"BSD-3-Clause"
] | 6,304 | 2015-01-05T23:45:12.000Z | 2022-03-31T09:48:13.000Z | docs/examples/Pixmap_erase_3.cpp | travisleithead/skia | 2092340a0edc25e9082ce9717643d12d901c3971 | [
"BSD-3-Clause"
] | 67 | 2016-04-18T13:30:02.000Z | 2022-03-31T23:06:55.000Z | docs/examples/Pixmap_erase_3.cpp | travisleithead/skia | 2092340a0edc25e9082ce9717643d12d901c3971 | [
"BSD-3-Clause"
] | 1,231 | 2015-01-05T03:17:39.000Z | 2022-03-31T22:54:58.000Z | // Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#include "tools/fiddle/examples.h"
// HASH=f884f3f46a565f052a5e252ae2f36e9b
REG_FIDDLE(Pixmap_erase_3, 256, 50, false, 0) {
void draw(SkCanvas* canvas) {
uint32_t storage[2];
SkImageInfo info = SkImageInfo::MakeN32Premul(1, 2);
SkPixmap pixmap(info, storage, info.minRowBytes());
SkIRect topPixelBounds = {0, 0, 1, 1};
pixmap.erase({ 0.65f, 0.45f, 0.25f, 1 }, &topPixelBounds);
SkIRect bottomPixelBounds = {0, 1, 1, 2};
pixmap.erase({ 0.25f, 0.65f, 0.45f, 1 }, &bottomPixelBounds);
SkBitmap bitmap;
canvas->scale(20, 20);
bitmap.installPixels(pixmap);
canvas->drawImage(image, 0, 0);
}
} // END FIDDLE
| 38.9 | 100 | 0.68509 | travisleithead |
6b3042475334dcb0e3c53dc27d02adfc9ce82cb2 | 417 | cpp | C++ | examples/set/set.cpp | lostjared/cpp17_Examples | bd754ffca5e894d877624c45db64f9dda93d880a | [
"Unlicense"
] | 20 | 2017-07-22T19:06:39.000Z | 2021-07-12T06:46:24.000Z | examples/set/set.cpp | lostjared/cpp17_Examples | bd754ffca5e894d877624c45db64f9dda93d880a | [
"Unlicense"
] | null | null | null | examples/set/set.cpp | lostjared/cpp17_Examples | bd754ffca5e894d877624c45db64f9dda93d880a | [
"Unlicense"
] | 7 | 2018-05-20T10:26:07.000Z | 2021-07-12T04:11:18.000Z | #include<iostream>
#include<set>
#include<string>
int main() {
std::set<std::string> ideas;
std::string idea;
while(1) {
std::cout << "Enter idea: ";
std::getline(std::cin, idea);
ideas.insert(idea);
for(auto i = ideas.begin(); i != ideas.end(); ++i) {
std::cout << *i << "\n";
if(*i == "quit") exit(EXIT_SUCCESS);
}
}
return 0;
}
| 21.947368 | 60 | 0.484412 | lostjared |
6b3057b8f519336b7bd3f939eda4a3338ecb62eb | 2,329 | cc | C++ | src/utils/tests/legacy/test_split.cc | nrc-cnrc/Portage-SMT-TAS | 73f5a65de4adfa13008ea9a01758385c97526059 | [
"MIT"
] | null | null | null | src/utils/tests/legacy/test_split.cc | nrc-cnrc/Portage-SMT-TAS | 73f5a65de4adfa13008ea9a01758385c97526059 | [
"MIT"
] | null | null | null | src/utils/tests/legacy/test_split.cc | nrc-cnrc/Portage-SMT-TAS | 73f5a65de4adfa13008ea9a01758385c97526059 | [
"MIT"
] | null | null | null | /**
* @author Samuel Larkin
* @file test_split.cc Simple test pgm for split
*
* $Id$
*
* Technologies langagieres interactives / Interactive Language Technologies
* Inst. de technologie de l'information / Institute for Information Technology
* Conseil national de recherches Canada / National Research Council Canada
* Copyright 2007, Sa Majeste la Reine du Chef du Canada /
* Copyright 2007, Her Majesty in Right of Canada
*/
#include <str_utils.h>
#include <voc.h>
#include <vector>
#include <string>
#include <iostream>
#include <iterator>
using namespace std;
using namespace Portage;
void print(const Voc& voc)
{
cout << "voc.size: " << voc.size() << " => ";
voc.write(cout, ", ");
cout << endl;
}
void print(const vector<string>& v)
{
typedef vector<string>::const_iterator IT;
for (IT it(v.begin()); it!=v.end(); ++it)
printf("[%d]%s ", (Uint)it->size(), it->c_str());
cout << endl;
}
template<class T>
void print(const vector<T>& v)
{
copy(v.begin(), v.end(), ostream_iterator<T>(cout, " "));
cout << endl;
}
int main()
{
// STRINGS
cout << "Testing string" << endl;
const string my_string("Samuel Larkin est grand");
vector<string> fields;
cout << "char: " << split(my_string.c_str(), fields) << endl;
print(fields);
cout << "string: " << split(my_string, fields) << endl;
print(fields);
cout << "string: " << splitZ(my_string, fields) << endl;
print(fields);
cout << "string: " << splitZ(my_string, fields) << endl;
print(fields);
cout << "string: " << splitZ(my_string, fields) << endl;
print(fields);
cout << "string: " << splitCheckZ(my_string, fields, " \t\n", 3) << endl;
print(fields);
cout << endl;
// FLOATS
cout << "Testing float" << endl;
string my_float("12 4 -2.5");
vector<float> fieldf;
cout << "float: " << split(my_float, fieldf) << endl;
print(fieldf);
cout << endl;
// VOCABULARY
cout << "Testing vocabulary" << endl;
Voc voc;
Voc::addConverter aConverter(voc);
vector<Uint> fieldi;
cout << "voc: " << split(my_string.c_str(), fieldi, aConverter) << endl;
print(fieldi);
print(voc);
cout << "Voc2: " << split("Samuel mange des fruits pour dejeuner", fieldi, aConverter) << endl;
print(fieldi);
print(voc);
cout << endl;
return 0;
}
| 25.877778 | 100 | 0.623873 | nrc-cnrc |
6b3636a660101397297e7fa40df26d6bd7c2cc15 | 1,043 | hpp | C++ | addons/ares_compositions/Ares/Walls/Wall Sections/Military Wall Corner.hpp | Braincrushy/TBMod | 785f11cd9cd0defb0d01a6d2861beb6c207eb8a3 | [
"MIT"
] | null | null | null | addons/ares_compositions/Ares/Walls/Wall Sections/Military Wall Corner.hpp | Braincrushy/TBMod | 785f11cd9cd0defb0d01a6d2861beb6c207eb8a3 | [
"MIT"
] | 4 | 2018-12-21T06:57:25.000Z | 2020-07-09T09:06:38.000Z | addons/ares_compositions/Ares/Walls/Wall Sections/Military Wall Corner.hpp | Braincrushy/TBMod | 785f11cd9cd0defb0d01a6d2861beb6c207eb8a3 | [
"MIT"
] | null | null | null | class Object0 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={-0.168457,-1.55762,0};dir=0;};
class Object1 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={3.63428,-1.54736,0};dir=0;};
class Object2 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={-3.98242,-1.59229,0};dir=0;};
class Object3 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={7.44824,-1.5127,0};dir=0;};
class Object4 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={-7.77002,-1.58789,0};dir=0;};
class Object5 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={11.2363,-1.51709,0};dir=0;};
class Object6 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={-11.5845,-1.62256,0};dir=0;};
class Object7 {side=8;rank="";vehicle="Land_Mil_WallBig_Corner_F";position[]={-15.0779,-1.59619,0};dir=0;};
class Object8 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={-15.0344,1.8916,0};dir=90.5571;};
class Object9 {side=8;rank="";vehicle="Land_Mil_WallBig_4m_F";position[]={15.0498,-1.48242,0};dir=0;}; | 104.3 | 107 | 0.717162 | Braincrushy |
6b382883b5c1a0017bf865591e30279e1b3abbf5 | 4,445 | cpp | C++ | ImportantExample/QFinances/src/mytransactionslist.cpp | xiaohaijin/Qt | 54d961c6a8123d8e4daf405b7996aba4be9ab7ed | [
"MIT"
] | 3 | 2018-12-24T19:35:52.000Z | 2022-02-04T14:45:59.000Z | ImportantExample/QFinances/src/mytransactionslist.cpp | xiaohaijin/Qt | 54d961c6a8123d8e4daf405b7996aba4be9ab7ed | [
"MIT"
] | null | null | null | ImportantExample/QFinances/src/mytransactionslist.cpp | xiaohaijin/Qt | 54d961c6a8123d8e4daf405b7996aba4be9ab7ed | [
"MIT"
] | 1 | 2019-05-09T02:42:40.000Z | 2019-05-09T02:42:40.000Z | /***************************************************************************
* Copyright (C) 2007 by Peter Komar *
* udldevel@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "mytransactionslist.h"
#include <QApplication>
#include <QPainter>
MyTransactionsList::MyTransactionsList(QWidget* parent)
: QTreeWidget(parent)
{
setSelectionMode(QAbstractItemView::NoSelection);
setAllColumnsShowFocus(true);
setUniformRowHeights(true);
setWordWrap(false);
}
MyTransactionsList::~MyTransactionsList()
{
}
void MyTransactionsList::drawBranches(QPainter * painter, const QRect & rect, const QModelIndex & index ) const
{
QTreeWidgetItem *item = itemFromIndex(index);
if(item->type() == SYS_TYPE)
{
return;
}
QTreeWidget::drawBranches(painter, rect, index);
/*if((item->type() == INC_TYPE) || (item->type() == EXC_TYPE))
{
QStyleOptionViewItemV3 opt;
QColor color = static_cast<QRgb>(QApplication::style()->styleHint(QStyle::SH_Table_GridLineColor, &opt));
painter->save();
painter->setPen(QPen(color));
int right = rect.right();
painter->drawLine(right, rect.x(), right, rect.bottom());
painter->restore();
}*/
}
void MyTransactionsList::drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItemV3 opt = option;
QTreeWidgetItem *item = itemFromIndex(index);
if(item->type() == SYS_TYPE)
{
//const QColor c = option.palette.color(QPalette::Dark);
QFont font = option.font;
font.setBold(true);
opt.font = font;
opt.showDecorationSelected = false;
opt.decorationSize = QSize(opt.decorationSize.width()+3,opt.decorationSize.height()+3);
QLinearGradient grd(0,0,0,option.rect.bottom());
grd.setColorAt(0, QColor("#6799B3"));
grd.setColorAt(0.3, QColor("#377a90"));
grd.setColorAt(0.31, QColor("#0e5e73"));
grd.setColorAt(1, QColor("#4b8598"));;
painter->fillRect(option.rect, QBrush(grd));
opt.palette.setBrush(QPalette::Background, QBrush(grd));
opt.palette.setBrush(QPalette::Text, QBrush(Qt::white));
}
else if(item->type() == INC_TYPE)
{
opt.showDecorationSelected = false;
QColor c("#B8FFBB");
painter->fillRect(option.rect, c);
opt.palette.setColor(QPalette::Base, c);
}
else if(item->type() == EXC_TYPE)
{
opt.showDecorationSelected = false;
QColor c("#FFFFDE");
painter->fillRect(option.rect, c);
opt.palette.setColor(QPalette::Base, c);
}
opt.font.setPointSize(opt.font.pointSize()+1);
QTreeWidget::drawRow(painter, opt, index);
QColor color = static_cast<QRgb>(QApplication::style()->styleHint(QStyle::SH_Table_GridLineColor, &opt));
painter->save();
painter->setPen(QPen(color));
painter->drawLine(opt.rect.x(), opt.rect.bottom(), opt.rect.right(), opt.rect.bottom());
if((item->type() == INC_TYPE) || (item->type() == EXC_TYPE))
{
int cs = 0;//draw vertical lines
for(int i = 0; i<columnCount(); i++)
{
cs += columnWidth(i);
painter->drawLine(opt.rect.x()+cs,opt.rect.top(), opt.rect.x()+cs, opt.rect.bottom());
}
}
painter->restore();
}
| 34.726563 | 119 | 0.580427 | xiaohaijin |
6b38e9bcc5b8077f5061e261b171315aa5383851 | 1,972 | cpp | C++ | http_service/src/register.cpp | nchalkley2/ImgboardServer | 6ee1fa06ef20442aef11c98b3e9588c116a1ef79 | [
"MIT"
] | null | null | null | http_service/src/register.cpp | nchalkley2/ImgboardServer | 6ee1fa06ef20442aef11c98b3e9588c116a1ef79 | [
"MIT"
] | null | null | null | http_service/src/register.cpp | nchalkley2/ImgboardServer | 6ee1fa06ef20442aef11c98b3e9588c116a1ef79 | [
"MIT"
] | null | null | null | #include "routes.hpp"
#include "database.hpp"
#include "account_validation.hpp"
#include <optional>
#include <string>
#include <utility>
#include <acorn>
#include <net/http/request.hpp>
namespace chan::routes
{
using namespace mana;
void
acc_register(Request_ptr req, Response_ptr res)
{
http::Request src = req->source();
auto username = uri::decode(src.post_value("username"));
auto username_valid = validate_username(username);
auto password = uri::decode(src.post_value("password"));
auto password_rep = uri::decode(src.post_value("password-repeat"));
auto password_valid = validate_password(password, password_rep);
// validate_username and validate_password return a <bool, string> pair.
// The first bool has whether the username/password is valid
if (username_valid.first && password_valid.first)
{
database::account::create(
username, password,
[=](bool created_account, std::string username,
std::string db_err) {
if (created_account)
{
res->source().add_body("Succesfully created account \""
+ username + "\".");
res->source().set_status_code(http::Created);
res->send();
}
else
{
res->source().add_body("Failed to create account \""
+ username + "\".\n"
+ "Error: " + db_err);
res->source().set_status_code(http::Bad_Request);
res->send();
}
});
}
else
{
// res->error expects rvalues so this has to be in a
// function
const auto create_error = [&]() -> std::string {
const auto username_err
= username_valid.second.has_value() ?
username_valid.second.value() + "\n" :
"";
const auto password_err
= password_valid.second.has_value() ?
password_valid.second.value() + "\n" :
"";
return username_err + password_err;
};
res->error({ http::Bad_Request, "Error creating account",
create_error() });
}
}
}
| 26.293333 | 74 | 0.632353 | nchalkley2 |
6b39821d806f5bb7956ee8e666986a3ea9d6918d | 6,768 | cc | C++ | ui/base/gtk/gtk_expanded_container.cc | nagineni/chromium-crosswalk | 5725642f1c67d0f97e8613ec1c3e8107ab53fdf8 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | ui/base/gtk/gtk_expanded_container.cc | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-12-13T19:44:12.000Z | 2021-12-13T19:44:12.000Z | ui/base/gtk/gtk_expanded_container.cc | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/base/gtk/gtk_expanded_container.h"
#include <gtk/gtk.h>
#include <algorithm>
#include "ui/gfx/gtk_compat.h"
namespace {
enum {
CHILD_SIZE_REQUEST,
LAST_SIGNAL
};
guint expanded_container_signals[LAST_SIGNAL] = { 0 };
struct SizeAllocateData {
GtkWidget* container;
GtkAllocation* allocation;
int border_width;
};
void GetChildPosition(GtkWidget* container, GtkWidget* child, int* x, int* y) {
GValue v = { 0 };
g_value_init(&v, G_TYPE_INT);
gtk_container_child_get_property(GTK_CONTAINER(container), child, "x", &v);
*x = g_value_get_int(&v);
gtk_container_child_get_property(GTK_CONTAINER(container), child, "y", &v);
*y = g_value_get_int(&v);
g_value_unset(&v);
}
void ChildSizeAllocate(GtkWidget* child, gpointer userdata) {
if (!gtk_widget_get_visible(child))
return;
SizeAllocateData* data = reinterpret_cast<SizeAllocateData*>(userdata);
GtkRequisition child_requisition;
child_requisition.width = data->allocation->width - data->border_width * 2;
child_requisition.height = data->allocation->height - data->border_width * 2;
// We need to give whoever is pulling our strings a chance to adjust the
// size of our children.
g_signal_emit(data->container,
expanded_container_signals[CHILD_SIZE_REQUEST], 0,
child, &child_requisition);
GtkAllocation child_allocation;
child_allocation.width = child_requisition.width;
child_allocation.height = child_requisition.height;
if (child_allocation.width < 0 || child_allocation.height < 0) {
gtk_widget_get_child_requisition(child, &child_requisition);
if (child_allocation.width < 0)
child_allocation.width = child_requisition.width;
if (child_allocation.height < 0)
child_allocation.height = child_requisition.height;
}
int x, y;
GetChildPosition(data->container, child, &x, &y);
child_allocation.x = x + data->border_width;
child_allocation.y = y + data->border_width;
if (!gtk_widget_get_has_window(data->container)) {
child_allocation.x += data->allocation->x;
child_allocation.y += data->allocation->y;
}
gtk_widget_size_allocate(child, &child_allocation);
}
void Marshal_VOID__OBJECT_BOXED(GClosure* closure,
GValue* return_value G_GNUC_UNUSED,
guint n_param_values,
const GValue* param_values,
gpointer invocation_hint G_GNUC_UNUSED,
gpointer marshal_data) {
typedef void (*GMarshalFunc_VOID__OBJECT_BOXED) (gpointer data1,
gpointer arg_1,
gpointer arg_2,
gpointer data2);
register GMarshalFunc_VOID__OBJECT_BOXED callback;
register GCClosure *cc = reinterpret_cast<GCClosure*>(closure);
register gpointer data1, data2;
g_return_if_fail(n_param_values == 3);
if (G_CCLOSURE_SWAP_DATA(closure)) {
data1 = closure->data;
data2 = g_value_peek_pointer(param_values + 0);
} else {
data1 = g_value_peek_pointer(param_values + 0);
data2 = closure->data;
}
callback = reinterpret_cast<GMarshalFunc_VOID__OBJECT_BOXED>(
marshal_data ? marshal_data : cc->callback);
callback(data1,
g_value_get_object(param_values + 1),
g_value_get_boxed(param_values + 2),
data2);
}
} // namespace
G_BEGIN_DECLS
static void gtk_expanded_container_size_allocate(GtkWidget* widget,
GtkAllocation* allocation);
G_DEFINE_TYPE(GtkExpandedContainer, gtk_expanded_container, GTK_TYPE_FIXED)
static void gtk_expanded_container_class_init(
GtkExpandedContainerClass *klass) {
GtkObjectClass* object_class =
reinterpret_cast<GtkObjectClass*>(klass);
GtkWidgetClass* widget_class =
reinterpret_cast<GtkWidgetClass*>(klass);
widget_class->size_allocate = gtk_expanded_container_size_allocate;
expanded_container_signals[CHILD_SIZE_REQUEST] =
g_signal_new("child-size-request",
G_OBJECT_CLASS_TYPE(object_class),
static_cast<GSignalFlags>(G_SIGNAL_RUN_FIRST),
0,
NULL, NULL,
Marshal_VOID__OBJECT_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_WIDGET,
GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
}
static void gtk_expanded_container_init(GtkExpandedContainer* container) {
}
static void gtk_expanded_container_size_allocate(GtkWidget* widget,
GtkAllocation* allocation) {
gtk_widget_set_allocation(widget, allocation);
if (gtk_widget_get_has_window(widget) && gtk_widget_get_realized(widget)) {
gdk_window_move_resize(gtk_widget_get_window(widget),
allocation->x,
allocation->y,
allocation->width,
allocation->height);
}
SizeAllocateData data;
data.container = widget;
data.allocation = allocation;
data.border_width = gtk_container_get_border_width(GTK_CONTAINER(widget));
gtk_container_foreach(GTK_CONTAINER(widget), ChildSizeAllocate, &data);
}
GtkWidget* gtk_expanded_container_new() {
return GTK_WIDGET(g_object_new(GTK_TYPE_EXPANDED_CONTAINER, NULL));
}
void gtk_expanded_container_put(GtkExpandedContainer* container,
GtkWidget* widget, gint x, gint y) {
g_return_if_fail(GTK_IS_EXPANDED_CONTAINER(container));
g_return_if_fail(GTK_IS_WIDGET(widget));
gtk_fixed_put(GTK_FIXED(container), widget, x, y);
}
void gtk_expanded_container_move(GtkExpandedContainer* container,
GtkWidget* widget, gint x, gint y) {
g_return_if_fail(GTK_IS_EXPANDED_CONTAINER(container));
g_return_if_fail(GTK_IS_WIDGET(widget));
gtk_fixed_move(GTK_FIXED(container), widget, x, y);
}
void gtk_expanded_container_set_has_window(GtkExpandedContainer* container,
gboolean has_window) {
g_return_if_fail(GTK_IS_EXPANDED_CONTAINER(container));
g_return_if_fail(!gtk_widget_get_realized(GTK_WIDGET(container)));
gtk_widget_set_has_window(GTK_WIDGET(container), has_window);
}
gboolean gtk_expanded_container_get_has_window(
GtkExpandedContainer* container) {
g_return_val_if_fail(GTK_IS_EXPANDED_CONTAINER(container), FALSE);
return gtk_widget_get_has_window(GTK_WIDGET(container));
}
G_END_DECLS
| 34.530612 | 79 | 0.684249 | nagineni |
6b3da3b6c0fc38c4f30f5e5c105ef3088b596141 | 854 | cpp | C++ | CodeBlocks/C++ Primer/ch4/conditional_operator.cpp | ash1247/DocumentsWindows | 66f65b5170a1ba766cfae08b7104b63ab87331c2 | [
"MIT"
] | null | null | null | CodeBlocks/C++ Primer/ch4/conditional_operator.cpp | ash1247/DocumentsWindows | 66f65b5170a1ba766cfae08b7104b63ab87331c2 | [
"MIT"
] | null | null | null | CodeBlocks/C++ Primer/ch4/conditional_operator.cpp | ash1247/DocumentsWindows | 66f65b5170a1ba766cfae08b7104b63ab87331c2 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
int main()
{
int num;
while(cin >> num){
cout << ( (num >= 75) ? "high pass" : (num < 60) ? "fail" : "low pass");
cout << endl;
}
int quiz1 = 0;
cout << (3 || 7) << endl;
quiz1 |= 1UL << 27;
cout << quiz1 << endl;
quiz1 &= ~(1UL << 27);
cout << quiz1 << endl;
cout << endl;
vector<int> ivec(10);
vector<int>::size_type cnt = ivec.size();
for(vector<int>::size_type ix = 0;
ix != ivec.size(); ix++, cnt--) {
cout << ix << " " << cnt << endl;
ivec[ix] = cnt;
cout << "1 " << ivec[ix] << endl;
}
cout << endl;
int x[10]; int *p = x;
cout << sizeof(p) << endl;
cout << sizeof(*p) << endl;
cout << sizeof(x)/sizeof(*x) << endl;
cout << sizeof(p)/sizeof(*p) << endl;
}
| 23.081081 | 80 | 0.449649 | ash1247 |
6b3eb128ce3a6de0f6eabb141ca4038bee6d1885 | 1,346 | hpp | C++ | engine/graphics/direct3d11/D3D11RenderTarget.hpp | wzhengsen/ouzel | b3b99c42b39efd2998c03967ee8d5b3e91305167 | [
"Unlicense"
] | 923 | 2016-05-30T15:11:16.000Z | 2022-03-30T20:26:24.000Z | engine/graphics/direct3d11/D3D11RenderTarget.hpp | wzhengsen/ouzel | b3b99c42b39efd2998c03967ee8d5b3e91305167 | [
"Unlicense"
] | 46 | 2016-05-31T18:32:23.000Z | 2022-01-18T02:26:06.000Z | engine/graphics/direct3d11/D3D11RenderTarget.hpp | wzhengsen/ouzel | b3b99c42b39efd2998c03967ee8d5b3e91305167 | [
"Unlicense"
] | 131 | 2016-05-30T20:20:07.000Z | 2022-03-10T10:56:08.000Z | // Ouzel by Elviss Strazdins
#ifndef OUZEL_GRAPHICS_D3D11RENDERTARGET_HPP
#define OUZEL_GRAPHICS_D3D11RENDERTARGET_HPP
#include "../../core/Setup.h"
#if OUZEL_COMPILE_DIRECT3D11
#include <set>
#include <vector>
#pragma push_macro("WIN32_LEAN_AND_MEAN")
#pragma push_macro("NOMINMAX")
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
# define NOMINMAX
#endif
#include <d3d11.h>
#pragma pop_macro("WIN32_LEAN_AND_MEAN")
#pragma pop_macro("NOMINMAX")
#include "D3D11RenderResource.hpp"
#include "../../math/Color.hpp"
namespace ouzel::graphics::d3d11
{
class RenderDevice;
class Texture;
class RenderTarget final: public RenderResource
{
public:
RenderTarget(RenderDevice& initRenderDevice,
const std::set<Texture*>& initColorTextures,
Texture* initDepthTexture);
void resolve();
auto& getRenderTargetViews() const noexcept { return renderTargetViews; }
auto getDepthStencilView() const noexcept { return depthStencilView; }
private:
std::set<Texture*> colorTextures;
Texture* depthTexture = nullptr;
std::vector<ID3D11RenderTargetView*> renderTargetViews;
ID3D11DepthStencilView* depthStencilView = nullptr;
};
}
#endif
#endif // OUZEL_GRAPHICS_D3D11RENDERTARGET_HPP
| 24.035714 | 81 | 0.717682 | wzhengsen |
6b3f1f93fff25740320c65140bab2fa7a527e877 | 43 | cpp | C++ | vma.cpp | dylangentile/RayPath | 3a7e0cf78f482554bcb4155f486f1708cdc126c0 | [
"MIT"
] | null | null | null | vma.cpp | dylangentile/RayPath | 3a7e0cf78f482554bcb4155f486f1708cdc126c0 | [
"MIT"
] | null | null | null | vma.cpp | dylangentile/RayPath | 3a7e0cf78f482554bcb4155f486f1708cdc126c0 | [
"MIT"
] | null | null | null | #define VMA_IMPLEMENTATION
#include "vma.h" | 21.5 | 26 | 0.813953 | dylangentile |
6b412fe5dfc215d280ec0ea2565c47093f558bf2 | 1,558 | hpp | C++ | Kernel/Tasking/Processes/Threads/Thread.hpp | Plunkerusr/podsOS | b68e2ebdaa4eb99366dea6cc5509ba0c92c3601a | [
"MIT"
] | null | null | null | Kernel/Tasking/Processes/Threads/Thread.hpp | Plunkerusr/podsOS | b68e2ebdaa4eb99366dea6cc5509ba0c92c3601a | [
"MIT"
] | null | null | null | Kernel/Tasking/Processes/Threads/Thread.hpp | Plunkerusr/podsOS | b68e2ebdaa4eb99366dea6cc5509ba0c92c3601a | [
"MIT"
] | null | null | null | #pragma once
#include "Signals.hpp"
#include <Hardware/Trapframe.hpp>
namespace Kernel::Tasking {
constexpr size_t kernel_stack_size = 4096;
constexpr size_t user_stack_size = 512 * 4096;
// Not realy used inside the C++ code.
// Just to clarify the sequence of push / pop opertions
// inside Scheduling.s block routines.
struct KernelContext {
uint32_t ebx;
uint32_t ebp;
uint32_t esi;
uint32_t edi;
};
class Process;
class Thread {
friend class Process;
friend class Process;
public:
Thread(Process& process, uintptr_t user_stack);
~Thread();
Thread(const Thread&) = delete;
Thread& operator=(const Thread&) = delete;
inline Signals& signals() { return m_signals; }
inline Process& process() { return m_process; }
inline uintptr_t kernel_stack_top() { return m_kernel_stack + kernel_stack_size; }
inline Trapframe* trapframe() { return (Trapframe*)(kernel_stack_top() - sizeof(Trapframe)); }
inline KernelContext** kernel_context() { return &m_kernel_context; }
inline bool blocked_in_kernel() { return m_kernel_context != nullptr; }
void fork_from(Thread& other);
void jump_to_signal_caller(int signo);
void return_from_signal_caller();
private:
void setup_trapframe();
uintptr_t user_stack() { return m_user_stack; }
uintptr_t user_stack_top() { return m_user_stack + user_stack_size; }
private:
Process& m_process;
Signals m_signals {};
uintptr_t m_kernel_stack {};
uintptr_t m_user_stack {};
KernelContext* m_kernel_context {};
};
} | 27.333333 | 98 | 0.712452 | Plunkerusr |
6b41ae332b2907083c9533638081806b9caf3094 | 188 | cpp | C++ | lab5/1 - concrete types/main.cpp | uiowa-cs-3210-0001/cs3210-labs | d6263d719a45257ba056a1ead7cc3dd428d377f3 | [
"MIT"
] | 1 | 2019-01-24T14:04:45.000Z | 2019-01-24T14:04:45.000Z | lab5/1 - concrete types/main.cpp | uiowa-cs-3210-0001/cs3210-labs | d6263d719a45257ba056a1ead7cc3dd428d377f3 | [
"MIT"
] | 1 | 2019-01-24T18:32:45.000Z | 2019-01-28T04:10:28.000Z | lab5/1 - concrete types/main.cpp | uiowa-cs-3210-0001/cs3210-labs | d6263d719a45257ba056a1ead7cc3dd428d377f3 | [
"MIT"
] | 1 | 2019-02-07T00:28:20.000Z | 2019-02-07T00:28:20.000Z | #include "complex.hpp"
int main()
{
complex z = {1,0};
complex a{ 2.3 }; // construct {2.3,0.0} from 2.3
complex b{ a + z };
// ...
if (a != b)
a = -b;
} | 17.090909 | 59 | 0.420213 | uiowa-cs-3210-0001 |
6b43103eb3798281232631c954ec08e0e4fa8b1a | 1,261 | cpp | C++ | solutions/059.cpp | procrastiraptor/euler | 1dd1040527c8de18e6325199a5939b32b8f76cac | [
"MIT"
] | 1 | 2017-10-25T14:45:57.000Z | 2017-10-25T14:45:57.000Z | solutions/059.cpp | procrastiraptor/euler | 1dd1040527c8de18e6325199a5939b32b8f76cac | [
"MIT"
] | null | null | null | solutions/059.cpp | procrastiraptor/euler | 1dd1040527c8de18e6325199a5939b32b8f76cac | [
"MIT"
] | null | null | null | #include <algorithm>
#include <array>
#include <iostream>
#include <numeric>
#include <string>
#include <string_view>
namespace {
using Key = std::array<char, 3>;
std::string tr(std::string_view input, Key key) {
std::string res;
res.reserve(input.size());
std::transform(
input.begin(),
input.end(),
std::back_inserter(res),
[key,i=0](char c) mutable {
return c ^ key[i++ % std::tuple_size<Key>::value];
});
return res;
}
std::string read(std::string_view data) {
std::string res{'\0'};
res.reserve(data.size());
for (char c : data) {
if (c == ',') {
res.push_back('\0');
} else {
res.back() = res.back() * 10 + (c - '0');
}
}
return res;
}
bool plaintext(std::string_view text) {
return text.find(" the ") != std::string_view::npos;
}
}
int p59() {
std::string data;
std::getline(std::cin, data, '\n');
auto input = read(data);
std::array<char, 'z' - 'a' + 1> lc;
std::iota(lc.begin(), lc.end(), 'a');
for (char a : lc) {
for (char b : lc) {
for (char c : lc) {
if (auto decoded = tr(input, { a, b, c, }); plaintext(decoded)) {
return std::accumulate(decoded.begin(), decoded.end(), 0);
}
}
}
}
return 0;
}
| 20.33871 | 73 | 0.547978 | procrastiraptor |
6b451cab1ac5c6c903fe41bcce9e60d5ca7eb276 | 609 | hpp | C++ | pehlaschool/Classes/Common/Controls/Subtitle.hpp | maqsoftware/Pehla-School-Hindi | 61aeae0f1d91952b44eaeaff5d2f6ec1d5aa3c43 | [
"Apache-2.0"
] | 2 | 2019-11-06T23:06:22.000Z | 2019-12-08T09:10:19.000Z | pehlaschool/Classes/Common/Controls/Subtitle.hpp | maqsoftware/GLEXP-Team-KitkitSchool-Hindi | 61aeae0f1d91952b44eaeaff5d2f6ec1d5aa3c43 | [
"Apache-2.0"
] | 123 | 2019-05-28T14:03:04.000Z | 2019-07-12T04:23:26.000Z | pehlaschool/Classes/Common/Controls/Subtitle.hpp | maqsoftware/Pehla-School-Hindi | 61aeae0f1d91952b44eaeaff5d2f6ec1d5aa3c43 | [
"Apache-2.0"
] | 5 | 2019-07-25T09:46:07.000Z | 2020-12-22T06:37:40.000Z | //
// Subtitle.hpp
// PehlaSchool
//
// Created by Jaehun Jung on 17/09/2018.
//
#pragma once
#include <stdio.h>
#include "cocos2d.h"
using namespace cocos2d;
using namespace std;
struct SubtitleStruct {
float start;
float end;
string content;
};
class Subtitle : public Node {
public:
static Subtitle* create();
void setFileName(string fileName);
void start();
float getSecondFromTimeCode(string timeCode);
private:
vector<SubtitleStruct> _subtitleV;
float _currentTime = 0;
string _currentContent;
void setContent(string content);
};
| 15.615385 | 49 | 0.669951 | maqsoftware |
6b458c24afaf856d32f721e5518c8647c25b2267 | 3,148 | cpp | C++ | src-qt5/core/lumina-desktop/LDesktopBackground.cpp | orangecms/lumina-desktop | 603e57e5d0a473ea7f51bf4cf274bebe512ac159 | [
"BSD-3-Clause"
] | null | null | null | src-qt5/core/lumina-desktop/LDesktopBackground.cpp | orangecms/lumina-desktop | 603e57e5d0a473ea7f51bf4cf274bebe512ac159 | [
"BSD-3-Clause"
] | null | null | null | src-qt5/core/lumina-desktop/LDesktopBackground.cpp | orangecms/lumina-desktop | 603e57e5d0a473ea7f51bf4cf274bebe512ac159 | [
"BSD-3-Clause"
] | null | null | null | //===========================================
// Lumina-DE source code
// Copyright (c) 2016, Henry Hu
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
#include "LDesktopBackground.h"
#include <QPainter>
#include <QPaintEvent>
#include <QDebug>
#include "LSession.h"
void LDesktopBackground::paintEvent(QPaintEvent *ev) {
//return; //do nothing - always invisible
if (bgPixmap != NULL) {
//qDebug() << "Wallpaper paint Event:" << ev->rect();
//QPainter painter(this);
//painter.setBrush(*bgPixmap);
//painter.drawRect(ev->rect().adjusted(-1,-1,2,2));
}else{
QWidget::paintEvent(ev);
}
}
QPixmap LDesktopBackground::setBackground(const QString& bgFile, const QString& format, QRect geom) {
//if (bgPixmap != NULL) delete bgPixmap;
QPixmap bgPixmap(geom.size());// = new QPixmap(size());
if (bgFile.startsWith("rgb(")) {
QStringList colors = bgFile.section(")",0,0).section("(",1,1).split(",");
QColor color = QColor(colors[0].toInt(), colors[1].toInt(), colors[2].toInt());
bgPixmap.fill(color);
} else {
bgPixmap.fill(Qt::black);
// Load the background file and scale
QPixmap bgImage(bgFile);
if (format == "stretch" || format == "full" || format == "fit") {
Qt::AspectRatioMode mode;
if (format == "stretch") {
mode = Qt::IgnoreAspectRatio;
} else if (format == "full") {
mode = Qt::KeepAspectRatioByExpanding;
} else {
mode = Qt::KeepAspectRatio;
}
if(bgImage.height() != geom.height() && bgImage.width() != geom.width() ){ bgImage = bgImage.scaled(geom.size(), mode); }
//bgImage = bgImage.scaled(size(), mode);
}
// Calculate the offset
int dx = 0, dy = 0;
int drawWidth = bgImage.width(), drawHeight = bgImage.height();
if (format == "fit" || format == "center" || format == "full") {
dx = (geom.width() - bgImage.width()) / 2;
dy = (geom.height() - bgImage.height()) / 2;
} else if (format == "tile") {
drawWidth = geom.width();
drawHeight = geom.height();
} else {
if (format.endsWith("right")) {
dx = geom.width() - bgImage.width();
}
if (format.startsWith("bottom")) {
dy = geom.height() - bgImage.height();
}
}
// Draw the background image
QPainter painter(&bgPixmap);
painter.setBrush(bgImage);
painter.setBrushOrigin(dx, dy);
painter.drawRect(dx, dy, drawWidth, drawHeight);
}
//this->repaint(); //make sure the entire thing gets repainted right away
//LSession::handle()->XCB->paintRoot(geom, &bgPixmap);
return bgPixmap;
//show();
}
LDesktopBackground::LDesktopBackground() : QWidget() {
bgPixmap = NULL;
this->setWindowOpacity(0);
}
LDesktopBackground::~LDesktopBackground() {
if (bgPixmap != NULL) delete bgPixmap;
}
| 34.593407 | 134 | 0.54892 | orangecms |
6b48e70698ce77c3730b1b9fbe02a5c548756827 | 9,515 | cpp | C++ | mandelbrot/Program.cpp | 08jne01/Mandelbrot-Explorer | 40685555165138d7fd195a02ceee4db6ea511b0f | [
"MIT"
] | 2 | 2018-03-22T21:47:40.000Z | 2018-03-23T03:18:58.000Z | mandelbrot/Program.cpp | 08jne01/Mandelbrot-Explorer | 40685555165138d7fd195a02ceee4db6ea511b0f | [
"MIT"
] | 14 | 2018-03-22T03:04:04.000Z | 2018-09-26T16:29:15.000Z | mandelbrot/Program.cpp | 08jne01/Mandelbrot-Explorer | 40685555165138d7fd195a02ceee4db6ea511b0f | [
"MIT"
] | null | null | null | #include "Header.h"
#include "Complex.h"
#include "InMandel.h"
#include "MandelClass.h"
#include "Program.h"
void program::init(int width_, int height_, double step_, double x_, double y_, double scale_, double greyScale_, double phase_, int fullScreen_)
{
//Set all starting parameters
width = width_;
height = height_;
step = step_;
x = x_;
y = y_;
scale = scale_;
pointSize = 1;
greyScale = greyScale_;
phase = phase_;
fullScreen = fullScreen_;
calculated = 0;
itters = 1000;
if (width > height)
{
res = width;
}
else if (height > width)
{
res = height;
}
}
void program::checkRatio()
{
//Checks ratio and defines depending whether width > height or not
if (ratio > 1.0)
{
res = height;
xRatio = 1.0 / ratio;
yRatio = 1;
}
else
{
res = width;
xRatio = 1;
yRatio = ratio;
}
}
void program::update(double local_step, int init)
{
//Define ratio of window based on window size
ratio = height / (double)width;
//Set calculated to 0 so that the renderer knows not to render otherwise there will be access violation
calculated = 0;
//Check and set Ratio
checkRatio();
//Start clock to time render process
int startS = clock();
//Choose next x, y based on cursor position
if (init != 1)
{
x += ((2.0 / (width*0.5))*xCurs - 2.0) / scale;
y += ((-ratio * 2.0 / (height*0.5))*(yCurs)+ratio * 2.0) / scale;
}
//Change scale based on settings
scale *= local_step;
mandel.scale = scale / 2.0;
//Set the edge of the screen for rendering
if (ratio > 1.0)
{
mandel.xEdge = -2.0 / ((double)scale) + x;
mandel.yEdge = -2.0*ratio / ((double)scale) + y;
}
else
{
mandel.xEdge = -2.0 / ((double)scale) + x;
mandel.yEdge = -2.0 / ((double)scale)*ratio + y;
}
//Print some info
std::cout.precision(20);
std::cout << "\nx = " << x << std::endl;
std::cout << "y = " << y << std::endl;
std::cout.precision(1);
std::cout << "Zoom Level = " << scale << std::endl;
std::cout << "Itterations = " << itters << std::endl;
//Calculate the mandelbrot
mandel.calcMandel(res, xRatio, yRatio, itters);
//Stop the clock and calculate render time
int stopS = clock();
std::cout << "\rRender Time: " << (stopS - startS) / double(CLOCKS_PER_SEC) * 1000 << " ms" << " " << std::endl;
//Set calculated to 1 so that the render knows it can reach the variables without causing an access violation
calculated = 1;
}
void program::draw()
{
//Check that the mandelbrot is not calculating so as to not cause an access violation
if (calculated == 1)
{
double q, r, g, b;
ratio = height / (double)width;
//Check and set ratio
checkRatio();
//Set phase increase or decrease for colour scheme
phase += phaseincrease * 0.1;
//Set pointsize and begin drawing points
glPointSize(pointSize);
glBegin(GL_POINTS);
//Loop through each pixel and draw a point based on colour array
for (int i = 0; i < ceil(mandel.size*xRatio); i++)
{
for (int j = 0; j < ceil(mandel.size*yRatio); j++)
{
//Invert values
q = 1 - mandel.colorArr[i][j];
//Choose colour scheme based on config
if (greyScale >= 1)
{
r = q;
g = q;
b = q;
}
else
{
r = sin(2 * PI *q)*sin(2 * PI *q);
g = sin(phase* PI *q)*sin(2 * PI *q);
b = q;
}
glColor3d(r, g, b);
//glVertex2d(c.re*0.5*scale - x*0.5*scale, (c.im*0.5*scale - y*0.5*scale) / ratio);
glVertex2d(coordTransform(i, width), coordTransform(j, height));
}
}
glEnd();
}
}
void program::mouseCallback(GLFWwindow* window, int button, int action, int mods)
{
//Update to zoom in
if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS)
{
update(step, 0);
}
//Update to zoom out
if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS)
{
update(1.0 / step, 0);
}
}
void program::keyCallBack(int key, int pressed)
{
if (pressed == GLFW_PRESS)
{
switch (key)
{
//Save coordinates and screenshot
case GLFW_KEY_SPACE:
{
std::string s = "Screenshot ";
s += currentTime();
s += ".bmp";
writeCoords(s);
saveBMP(s);
break;
}
//Change phase for colour scheme to on in either direction depending on keys
case GLFW_KEY_LEFT:
{
phaseincrease = -1;
break;
}
case GLFW_KEY_RIGHT:
{
phaseincrease = 1;
break;
}
//Increase or decrease number of itterations for calculation
case GLFW_KEY_UP:
{
itters *= 1.5;
update(1.0, 1);
break;
}
case GLFW_KEY_DOWN:
{
itters /= 1.5;
update(1.0, 1);
break;
}
}
}
else if (pressed == GLFW_RELEASE)
{
switch (key)
{
//Reset phase change when user releases the key
case GLFW_KEY_LEFT:
{
phaseincrease = 0;
break;
}
case GLFW_KEY_RIGHT:
{
phaseincrease = 0;
break;
}
}
}
}
void program::readConfig()
{
//Open the config
std::ifstream file("config.ini");
//Check open and then read the config to variables
if (file.is_open())
{
file >> width;
file >> height;
file >> fullScreen;
file >> step;
file >> x;
file >> y;
file >> scale;
file >> greyScale;
if (greyScale != 1)
{
file >> phase;
}
//Close file
file.close();
}
else
{
std::cout << "File could not be opened. Please run again and create config!" << std::endl;
system("PAUSE");
exit(EXIT_FAILURE);
}
//Set variables from file
init(width, height, step, x, y, scale, greyScale, phase, fullScreen);
}
void program::writeConfig()
{
//Open config file
std::ofstream file("config.ini");
//Check if it is open and write to config
if (file.is_open())
{
file << width << std::endl;
file << height << std::endl;
file << fullScreen << std::endl;
file << step << std::endl;
file << x << std::endl;
file << y << std::endl;
file << scale << std::endl;
file << greyScale << std::endl;
if (greyScale != 1)
{
file.precision(20);
file << phase << std::endl;
}
file.close();
}
else
{
std::cout << "File could not be opened." << std::endl;
}
}
void program::saveBMP(std::string filename)
{
//Allocate memory for filename and convert filename to char array so that string can be used
char *filenameCharArray = (char*)malloc(sizeof(char) * (filename.size() + 1));
strcpy_s(filenameCharArray, filename.size() + 1, filename.c_str());
//Open file and create write buffer
FILE *out;
fopen_s(&out, filenameCharArray, "wb");
byte* buff = new byte[width*height * 3];
//Round down to nearest multiple of 4 otherwise bmp will not work
int tempWidth = roundDownNearest(width, 4);
int tempHeight = height;
//Read back buffer
glReadBuffer(GL_BACK);
glReadPixels(0, 0, tempWidth, tempHeight, GL_BGR_EXT, GL_UNSIGNED_BYTE, buff);
//Check buffer was allocated and the file was opened
if (!out || !buff)
{
std::cout << "Error Writing to File!" << std::endl;
return;
}
//Create file and info header variables
BITMAPFILEHEADER bitmapFileHeader;
BITMAPINFOHEADER bitmapInfoHeader;
//Setup file header
bitmapFileHeader.bfType = 0x4D42;
bitmapFileHeader.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + tempWidth * tempHeight * 3;
bitmapFileHeader.bfReserved1 = 0;
bitmapFileHeader.bfReserved2 = 0;
bitmapFileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
//Setup info header
bitmapInfoHeader.biSize = sizeof(BITMAPINFOHEADER);
bitmapInfoHeader.biWidth = tempWidth - 1;
bitmapInfoHeader.biHeight = tempHeight - 1;
bitmapInfoHeader.biPlanes = 1;
bitmapInfoHeader.biBitCount = 24;
bitmapInfoHeader.biCompression = BI_RGB;
bitmapInfoHeader.biSizeImage = 0;
bitmapInfoHeader.biXPelsPerMeter = 0;
bitmapInfoHeader.biYPelsPerMeter = 0;
bitmapInfoHeader.biClrUsed = 0;
bitmapInfoHeader.biClrImportant = 0;
//Write to file
fwrite(&bitmapFileHeader, sizeof(BITMAPFILEHEADER), 1, out);
fwrite(&bitmapInfoHeader, sizeof(BITMAPINFOHEADER), 1, out);
fwrite(buff, tempWidth*tempHeight * 3, 1, out);
//Free memory and close files
free(filenameCharArray);
fclose(out);
delete[] buff;
std::cout << filename << " saved!" << std::endl;
}
void program::writeCoords(std::string s)
{
//Open file and appened to end of file
std::ofstream file;
file.open("coords.txt", std::ios::app);
//Check file is open and then append the below values
if (file.is_open())
{
file.precision(20);
file << "Re = " << x << " Im = " << y;
file.precision(3);
file << " Scale = " << scale;
file << "Screenshot timestamp: " << s;
file.close();
std::cout << "\nCoords copied to file!" << std::endl;
}
else
{
std::cout << "File could not be opened." << std::endl;
}
}
double program::coordTransform(double pixel, int dimension)
{
//Transforms pixel coordinates to screen coordinates (1 dimensional function)
double screenpos;
screenpos = ((2 * pixel) / (float)dimension) - 1;
return screenpos;
}
int program::roundDownNearest(int val, int multiple)
{
//Rounds down to the nearest multiple (used with bitmap output)
if (val % multiple == 0)
{
return val;
}
else
{
return (val - (val % multiple));
}
}
std::string program::currentTime()
{
//Gets current time and formats to string to be appended to filename and coordinate file
time_t rawTime;
struct tm time_info;
time(&rawTime);
localtime_s(&time_info, &rawTime);
std::ostringstream os;
os << " " << time_info.tm_mday << "-" << time_info.tm_mon + 1 << "-" << time_info.tm_year + 1900 << "_" << time_info.tm_hour << time_info.tm_min << time_info.tm_sec;
return os.str();
} | 20.462366 | 166 | 0.6433 | 08jne01 |
6b4cd8b41945db540a9de931cbcd7d0eecb25dfc | 1,873 | cc | C++ | test/cc/unit/envoy_config_test.cc | Yannic/envoy-mobile | 27fd74c88d71b2c91f484e3660c936948b2eb481 | [
"Apache-2.0"
] | 1 | 2021-06-24T15:10:49.000Z | 2021-06-24T15:10:49.000Z | test/cc/unit/envoy_config_test.cc | Yannic/envoy-mobile | 27fd74c88d71b2c91f484e3660c936948b2eb481 | [
"Apache-2.0"
] | null | null | null | test/cc/unit/envoy_config_test.cc | Yannic/envoy-mobile | 27fd74c88d71b2c91f484e3660c936948b2eb481 | [
"Apache-2.0"
] | null | null | null | #include <string>
#include <vector>
#include "absl/synchronization/notification.h"
#include "gtest/gtest.h"
#include "library/cc/engine_builder.h"
#include "library/cc/log_level.h"
namespace Envoy {
namespace {
using namespace Platform;
TEST(TestConfig, ConfigIsApplied) {
auto engine_builder = EngineBuilder();
engine_builder.addGrpcStatsDomain("asdf.fake.website")
.addConnectTimeoutSeconds(123)
.addDnsRefreshSeconds(456)
.addDnsFailureRefreshSeconds(789, 987)
.addDnsQueryTimeoutSeconds(321)
.addDnsPreresolveHostnames("[hostname]")
.addStatsFlushSeconds(654)
.addVirtualClusters("[virtual-clusters]")
.setAppVersion("1.2.3")
.setAppId("1234-1234-1234")
.setDeviceOs("probably-ubuntu-on-CI");
auto config_str = engine_builder.generateConfigStr();
std::vector<std::string> must_contain = {
"- &stats_domain asdf.fake.website",
"- &connect_timeout 123s",
"- &dns_refresh_rate 456s",
"- &dns_fail_base_interval 789s",
"- &dns_fail_max_interval 987s",
"- &dns_query_timeout 321s",
"- &dns_preresolve_hostnames [hostname]",
"- &stats_flush_interval 654s",
"- &virtual_clusters [virtual-clusters]",
("- &metadata { device_os: probably-ubuntu-on-CI, "
"app_version: 1.2.3, app_id: 1234-1234-1234 }"),
};
for (const auto& string : must_contain) {
ASSERT_NE(config_str.find(string), std::string::npos) << "'" << string << "' not found";
}
}
TEST(TestConfig, RemainingTemplatesThrows) {
auto engine_builder = EngineBuilder("{{ template_that_i_will_not_fill }}");
try {
engine_builder.generateConfigStr();
FAIL() << "Expected std::runtime_error";
} catch (std::runtime_error& err) {
EXPECT_EQ(err.what(), std::string("could not resolve all template keys in config"));
}
}
} // namespace
} // namespace Envoy
| 31.745763 | 92 | 0.683396 | Yannic |
6b50f39fb4a2f540fce73757004af5b8ebebfd51 | 222 | cpp | C++ | src/unittest/main.cpp | jhasse/jngl | 1aab1bb5b9712eca50786418d44e9559373441a8 | [
"Zlib"
] | 61 | 2015-09-30T14:42:38.000Z | 2022-03-30T13:56:54.000Z | src/unittest/main.cpp | jhasse/jngl | 1aab1bb5b9712eca50786418d44e9559373441a8 | [
"Zlib"
] | 57 | 2016-08-10T19:28:36.000Z | 2022-03-15T07:18:00.000Z | src/unittest/main.cpp | jhasse/jngl | 1aab1bb5b9712eca50786418d44e9559373441a8 | [
"Zlib"
] | 3 | 2021-12-14T18:08:56.000Z | 2022-02-23T08:29:19.000Z | // Copyright 2018-2019 Jan Niklas Hasse <jhasse@bixense.com>
// For conditions of distribution and use, see copyright notice in LICENSE.txt
#define BOOST_TEST_MODULE JNGLTest // NOLINT
#include <boost/test/unit_test.hpp>
| 37 | 78 | 0.788288 | jhasse |
6b526978bb6cea400caed492b64c60b5552ca2c8 | 5,562 | cpp | C++ | tools/bins/importance_sampling_cpp/src/random_sampling_std.cpp | junipertcy/network-archaeology | 7cef0de7a388e8dde812e746d50470d167da8a9b | [
"MIT"
] | null | null | null | tools/bins/importance_sampling_cpp/src/random_sampling_std.cpp | junipertcy/network-archaeology | 7cef0de7a388e8dde812e746d50470d167da8a9b | [
"MIT"
] | null | null | null | tools/bins/importance_sampling_cpp/src/random_sampling_std.cpp | junipertcy/network-archaeology | 7cef0de7a388e8dde812e746d50470d167da8a9b | [
"MIT"
] | null | null | null | /**
* \file importance_sampling.cpp
* \brief main file for importance sampling method to infere the age of edges
in a network.
* \author Guillaume St-Onge
* \version 1.0
* \date 08/11/2017
*/
#include "DynamicNetwork.hpp"
#include "auxiliaryFunctions.hpp"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <boost/random/uniform_01.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <boost/random/discrete_distribution.hpp>
#include <chrono>
using namespace std;
using namespace DynNet;
typedef boost::random::uniform_01<> uniform_01;
typedef boost::random::uniform_int_distribution<> uniform_int;
const unsigned int CALIBSIZE = 100;
int main(int argc, char const *argv[])
{
//Parameters
string path = argv[1];
double gamma = stod(argv[2]);
double b = stod(argv[3]);
unsigned int sampleSize = atoi(argv[4]);
double seedExponent = stod(argv[5]);
unsigned int seed;
if (argc == 6)
{
seed = (unsigned int) std::chrono::high_resolution_clock::now().time_since_epoch().count();
}
else
{
seed = atoi(argv[6]);
}
unsigned int calibSize;
if (sampleSize > CALIBSIZE)
{
calibSize = CALIBSIZE;
}
else
{
calibSize = sampleSize;
}
pair<double,double> param(gamma,b);
//Load edgeList
vector<edge> edgeList = input_edgeList(path);
size_t M = edgeList.size();
//Create unvarying maps associated to the observed network
unordered_map<node,set<node> > neighborMap;
unordered_map<node, unsigned int> degreeMap;
edgeIntMap multiplicityMap;
for (int i = 0; i < edgeList.size(); ++i)
{
//edges are assume to be in ascending order
neighborMap[edgeList[i].first].insert(edgeList[i].second);
neighborMap[edgeList[i].second].insert(edgeList[i].first);
if (multiplicityMap.find(edgeList[i]) ==
multiplicityMap.end())
{
multiplicityMap[edgeList[i]] = 1;
}
else
{
multiplicityMap[edgeList[i]] += 1;
}
if (degreeMap.find(edgeList[i].first) != degreeMap.end())
{
degreeMap[edgeList[i].first] += 1;
}
else
{
degreeMap[edgeList[i].first] = 1;
}
if (degreeMap.find(edgeList[i].second) != degreeMap.end())
{
degreeMap[edgeList[i].second] += 1;
}
else
{
degreeMap[edgeList[i].second] = 1;
}
}
size_t N = degreeMap.size();
//Initialize mean marginal estimation
unordered_map< edge, vector<double>,
boost::hash<edge> > meanMarginalMap;
for (auto iter = multiplicityMap.begin(); iter != multiplicityMap.end();
++iter)
{
vector<double> emptyVector(iter->second, 0.);
meanMarginalMap[iter->first] = emptyVector;
}
double effectiveWeightSum = 0.;
/*=======================================
Calibration of the mean logweight
=======================================*/
vector<DynamicNetwork> calibSample;
//Initialize random number generator and seed distribution
RNGType gen(seed);
vector<double> seedWeightVector;
for (auto iter = edgeList.begin(); iter != edgeList.end() ; ++iter)
{
if (iter->first == iter->second)
{
seedWeightVector.push_back(0.);
}
else
{
seedWeightVector.push_back(pow(degreeMap[iter->first]
*degreeMap[iter->second],seedExponent));
}
}
boost::random::discrete_distribution<int> seedDist(seedWeightVector.begin(),
seedWeightVector.end());
//Get calibrating sample
for (int n = 0; n < calibSize; ++n)
{
//Initialize dynamic network
DynamicNetwork net(neighborMap, multiplicityMap);
//choose a first random edge
int seedIndex = seedDist(gen);
edge seedEdge = edgeList[seedIndex];
double seedInvWeight = 1/(seedWeightVector[seedIndex]);
net.init(seedEdge, seedInvWeight);
//init degree norm
double degreeNormalization = 2.; //initial loop are impossible
//Reconstruct the network
while (net.get_reachableEdgeSet().size() > 0)
{
add_edge(net, param, degreeNormalization, gen);
}
calibSample.push_back(net);
}
//Determine mean logweight from calibration
double meanLogweight = 0.;
for (int n = 0; n < calibSize; ++n)
{
meanLogweight += calibSample[n].get_logweight();
}
meanLogweight /= calibSize;
//Estimate the mean marginal from the sample
for (int n = 0; n < calibSize; ++n)
{
update_meanMarginal(calibSample[n], meanMarginalMap, meanLogweight,
effectiveWeightSum);
}
calibSample.clear();
/*=======================================
Refining the mean marginal
=======================================*/
for (int n = 0; n < sampleSize-calibSize; ++n)
{
//Initialize dynamic network
DynamicNetwork net(neighborMap, multiplicityMap);
//choose a first random edge
int seedIndex = seedDist(gen);
edge seedEdge = edgeList[seedIndex];
double seedInvWeight = 1/(seedWeightVector[seedIndex]);
net.init(seedEdge, seedInvWeight);
//init degree norm
double degreeNormalization = 2.; //initial loop are impossible
//Reconstruct the network
while (net.get_reachableEdgeSet().size() > 0)
{
add_edge(net, param, degreeNormalization, gen);
}
update_meanMarginal(net, meanMarginalMap, meanLogweight,
effectiveWeightSum);
}
/*=======================================
Output the data
=======================================*/
for (auto iter = meanMarginalMap.begin(); iter != meanMarginalMap.end();
++iter)
{
double average = 0;
for (int i = 0; i < (iter->second).size(); ++i)
{
average += (iter->second)[i]/effectiveWeightSum;
}
for (int i = 0; i < (iter->second).size(); ++i)
{
cout << (iter->first).first << " " << (iter->first).second << " " << i << " ";
cout << average / double((iter->second).size()) << endl;
}
}
return 0;
} | 25.631336 | 93 | 0.658756 | junipertcy |
6b52ed178bfc8f6caeacf021d832505c01e2d642 | 1,060 | cpp | C++ | demo/thread.cpp | Pawapek/ocilib | 46ea6532e9ae0cf43ecc11dc2ca6542238b3d34d | [
"Apache-2.0"
] | 290 | 2015-07-07T12:53:43.000Z | 2022-02-19T13:17:56.000Z | demo/thread.cpp | Pawapek/ocilib | 46ea6532e9ae0cf43ecc11dc2ca6542238b3d34d | [
"Apache-2.0"
] | 270 | 2015-06-25T10:04:02.000Z | 2022-03-29T11:48:19.000Z | demo/thread.cpp | ljx0305/ocilib | b3d9ce9658766cc4cbd225d22f55e9f50f112a31 | [
"Apache-2.0"
] | 135 | 2015-06-24T05:38:34.000Z | 2022-03-12T06:58:55.000Z | #include <iostream>
#include "ocilib.hpp"
using namespace ocilib;
const int MaxThreads = 50;
void worker(ThreadHandle handle, void *data)
{
ThreadKey::SetValue("ID", const_cast<AnyPointer>(Thread::GetThreadId(handle)));
/* ... do some more processing here... */
std::cout << " Thread handle = " << handle
<< " Key (Thread Id) = " << ThreadKey::GetValue("ID")
<< std::endl;
}
int main(void)
{
try
{
Environment::Initialize(Environment::Threaded);
ThreadKey::Create("ID");
std::vector<ThreadHandle> threads;
for (int i = 0; i < MaxThreads; i++)
{
ThreadHandle th = Thread::Create();
threads.push_back(th);
Thread::Run(th, worker, 0);
}
for (int i = 0; i < MaxThreads; i++)
{
Thread::Join(threads[i]);
Thread::Destroy(threads[i]);
}
}
catch (std::exception &ex)
{
std::cout << ex.what() << std::endl;
}
Environment::Cleanup();
return EXIT_SUCCESS;
}
| 20.384615 | 83 | 0.537736 | Pawapek |
6b5402c64b97a3fb70ff8a2121a4cdcac33377cd | 1,344 | hpp | C++ | day_01/src/calculate_fuel.hpp | Krenth/Advent-of-Code-2019 | 1a8b3dadc0ee0852f12aa6788aef5c94bac06a5b | [
"MIT"
] | null | null | null | day_01/src/calculate_fuel.hpp | Krenth/Advent-of-Code-2019 | 1a8b3dadc0ee0852f12aa6788aef5c94bac06a5b | [
"MIT"
] | null | null | null | day_01/src/calculate_fuel.hpp | Krenth/Advent-of-Code-2019 | 1a8b3dadc0ee0852f12aa6788aef5c94bac06a5b | [
"MIT"
] | null | null | null | #ifndef CALCULATE_FUEL_HPP
#define CALCULATE_FUEL_HPP
#include <vector>
#include <cmath>
#include <iostream>
using namespace std;
/** Calculate Additional Fuel
* Calculates the additional fuel required for the part specific fuel.
*
* COMMENT THIS FUNCTION OUT FOR PART ONE
*/
int calculate_additional_fuel (int partFuel)
{
int additionalFuel = partFuel / 3 - 2;
if (additionalFuel > 0)
{
additionalFuel += calculate_additional_fuel(additionalFuel);
}
else if (additionalFuel < 0)
{
additionalFuel = 0;
}
return additionalFuel;
}
/** Calculate Fuel
* Calculates the part specific fuel requirements, and then the total fuel required for launch.
*
*/
int calculate_fuel (vector<int> &masses)
{
int partFuel;
int totalFuel = 0;
cout << "Calculating Required Fuel for Parts..." << endl;
for (vector<int>::iterator it = begin(masses); it != end(masses); ++it)
{
partFuel = *it / 3 - 2;
// totalFuel += partFuel // Part One
totalFuel += partFuel + calculate_additional_fuel(partFuel); // Part Two
cout << *it << ": " << partFuel + calculate_additional_fuel(partFuel) << endl;
}
cout << "Calculated Required Fuel for Parts!" << endl << endl;
return totalFuel;
}
#endif | 27.428571 | 95 | 0.629464 | Krenth |
6b5499d7ad14419d9da02d08ed3c044733738547 | 125,082 | cc | C++ | src/ClusterPerf.cc | IMCG/RamCloud | dad96cf34d330608acb43b009d12949ed2d938f4 | [
"0BSD"
] | 1 | 2021-12-06T01:24:22.000Z | 2021-12-06T01:24:22.000Z | src/ClusterPerf.cc | IMCG/RamCloud | dad96cf34d330608acb43b009d12949ed2d938f4 | [
"0BSD"
] | null | null | null | src/ClusterPerf.cc | IMCG/RamCloud | dad96cf34d330608acb43b009d12949ed2d938f4 | [
"0BSD"
] | 1 | 2021-12-06T01:24:22.000Z | 2021-12-06T01:24:22.000Z | /* Copyright (c) 2011-2014 Stanford University
* Copyright (c) 2011 Facebook
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
// This program runs a RAMCloud client along with a collection of benchmarks
// for measuring the performance of a RAMCloud cluster. This file works in
// conjunction with clusterperf.py, which starts up the cluster servers
// along with one or more instances of this program. This file contains the
// low-level benchmark code.
//
// TO ADD A NEW BENCHMARK:
// 1. Decide on a symbolic name for the new test.
// 2. Write the function that implements the benchmark. It goes in the
// section labeled "test functions" below, in alphabetical order. The
// name of the function should be the same as the name of the test.
// Tests generally work in one of two ways:
// * The first way is to generate one or more individual metrics;
// "basic" and "readNotFound" are examples of this style. Be sure
// to print results in the same way as existing tests, for consistency.
// * The second style of test is one that generates a graph; "readLoaded"
// is an example of this style. The test should output graph data in
// gnuplot format (comma-separated values), with comments at the
// beginning describing the data and including the name of the test
// that generated it.
// 3. Add an entry for the new test in the "tests" table below; this is
// used to dispatch to the test.
// 4. Add code for this test to clusterperf.py, following the instructions
// in that file.
#include <boost/program_options.hpp>
#include <boost/version.hpp>
#include <iostream>
namespace po = boost::program_options;
#include "assert.h"
#include "CycleCounter.h"
#include "Cycles.h"
#include "PerfStats.h"
#include "RamCloud.h"
#include "Util.h"
using namespace RAMCloud;
// Shared state for client library.
Context context(true);
// Used to invoke RAMCloud operations.
static RamCloud* cluster;
// Total number of clients that will be participating in this test.
static int numClients;
// Index of this client among all of the participating clients (between
// 0 and numClients-1). Client 0 acts as master to control the overall
// flow of the test; the other clients are slaves that respond to
// commands from the master.
static int clientIndex;
// Value of the "--count" command-line option: used by some tests
// to determine how many times to invoke a particular operation.
static int count;
// Value of the "--size" command-line option: used by some tests to
// determine the number of bytes in each object. -1 means the option
// wasn't specified, so each test should pick an appropriate default.
static int objectSize;
// Value of the "--numTables" command-line option: used by some tests
// to specify the number of tables to create.
static int numTables;
// Value of the "--numIndexlet" command-line option: used by some tests
// to specify the number of indexlets to create.
static int numIndexlet;
// Value of the "--numIndexes" command-line option: used by some tests
// to specify the number of indexes/object.
static int numIndexes;
// Value of the "--warmup" command-line option: in some tests this
// determines how many times to invoke the operation before starting
// measurements (e.g. to make sure that caches are loaded).
static int warmupCount;
// Identifier for table that is used for test-specific data.
uint64_t dataTable = -1;
// Identifier for table that is used to communicate between the master
// and slaves to coordinate execution of tests.
uint64_t controlTable = -1;
#define MAX_METRICS 8
// The following type holds metrics for all the clients. Each inner vector
// corresponds to one metric and contains a value from each client, indexed
// by clientIndex.
typedef std::vector<std::vector<double>> ClientMetrics;
// Used to return results about the distribution of times for a
// particular operation.
struct TimeDist {
double min; // Fastest time seen, in seconds.
double p50; // Median time per operation, in seconds.
double p90; // 90th percentile time/op, in seconds.
double p99; // 99th percentile time/op, in seconds.
double p999; // 99.9th percentile time/op, in seconds.
double p9999; // 99.99th percentile time/op, in seconds,
// or 0 if no such measurement.
double p99999; // 99.999th percentile time/op, in seconds,
// or 0 if no such measurement.
double bandwidth; // Average throughput in bytes/sec., or 0
// if no such measurement.
};
// Forward declarations:
extern void readThroughputMaster(int numObjects, int size, uint16_t keyLength);
//----------------------------------------------------------------------
// Utility functions used by the test functions
//----------------------------------------------------------------------
/**
* Given a time value, return a string representation of the value
* with an appropriate scale factor.
*
* \param seconds
* Time value, in seconds.
* \result
* A string corresponding to the time value, such as "4.2ms".
* Appropriate units will be chosen, ranging from nanoseconds to
* seconds.
*/
string formatTime(double seconds)
{
if (seconds < 1.0e-06) {
return format("%5.1f ns", 1e09*seconds);
} else if (seconds < 1.0e-03) {
return format("%5.1f us", 1e06*seconds);
} else if (seconds < 1.0) {
return format("%5.1f ms", 1e03*seconds);
} else {
return format("%5.1f s ", seconds);
}
}
/**
* Given an array of time values, sort it and return information
* about various percentiles.
*
* \param times
* Interval lengths in Cycles::rdtsc units.
* \param[out] dist
* The various percentile values in this structure will be
* filled in with times in seconds.
*/
void getDist(std::vector<uint64_t>& times, TimeDist* dist)
{
int count = downCast<int>(times.size());
std::sort(times.begin(), times.end());
TimeDist result;
dist->min = Cycles::toSeconds(times[0]);
int index = count/2;
if (index < count) {
dist->p50 = Cycles::toSeconds(times[index]);
} else {
dist->p50 = 0;
}
index = count - (count+5)/10;
if (index < count) {
dist->p90 = Cycles::toSeconds(times[index]);
} else {
dist->p90 = 0;
}
index = count - (count+50)/100;
if (index < count) {
dist->p99 = Cycles::toSeconds(times[index]);
} else {
dist->p99 = 0;
}
index = count - (count+500)/1000;
if (index < count) {
dist->p999 = Cycles::toSeconds(times[index]);
} else {
dist->p999 = 0;
}
index = count - (count+5000)/10000;
if (index < count) {
dist->p9999 = Cycles::toSeconds(times[index]);
} else {
dist->p9999 = 0;
}
index = count - (count+50000)/100000;
if (index < count) {
dist->p99999 = Cycles::toSeconds(times[index]);
} else {
result.p99999 = 0;
}
}
/**
* Generate a random string.
*
* \param str
* Pointer to location where the string generated will be stored.
* \param length
* Length of the string to be generated in bytes.
*/
void
genRandomString(char* str, const int length) {
static const char alphanum[] =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < length; ++i) {
str[i] = alphanum[generateRandom() % (sizeof(alphanum) - 1)];
}
}
/**
* Print a performance measurement consisting of a time value.
*
* \param name
* Symbolic name for the measurement, in the form test.value
* where \c test is the name of the test that generated the result,
* \c value is a name for the particular measurement.
* \param seconds
* Time measurement, in seconds.
* \param description
* Longer string (but not more than 20-30 chars) with a human-
* readable explanation of what the value refers to.
*/
void
printTime(const char* name, double seconds, const char* description)
{
printf("%-20s ", name);
if (seconds < 1.0e-06) {
printf("%5.1f ns ", 1e09*seconds);
} else if (seconds < 1.0e-03) {
printf("%5.1f us ", 1e06*seconds);
} else if (seconds < 1.0) {
printf("%5.1f ms ", 1e03*seconds);
} else {
printf("%5.1f s ", seconds);
}
printf(" %s\n", description);
}
/**
* Print a performance measurement consisting of a bandwidth.
*
* \param name
* Symbolic name for the measurement, in the form test.value
* where \c test is the name of the test that generated the result,
* \c value is a name for the particular measurement.
* \param bandwidth
* Measurement in units of bytes/second.
* \param description
* Longer string (but not more than 20-30 chars) with a human-
* readable explanation of what the value refers to.
*/
void
printBandwidth(const char* name, double bandwidth, const char* description)
{
double gb = 1024.0*1024.0*1024.0;
double mb = 1024.0*1024.0;
double kb = 1024.0;
printf("%-20s ", name);
if (bandwidth > gb) {
printf("%5.1f GB/s ", bandwidth/gb);
} else if (bandwidth > mb) {
printf("%5.1f MB/s ", bandwidth/mb);
} else if (bandwidth >kb) {
printf("%5.1f KB/s ", bandwidth/kb);
} else {
printf("%5.1f B/s ", bandwidth);
}
printf(" %s\n", description);
}
/**
* Print a performance measurement consisting of a rate.
*
* \param name
* Symbolic name for the measurement, in the form test.value
* where \c test is the name of the test that generated the result,
* \c value is a name for the particular measurement.
* \param value
* Measurement in units 1/second.
* \param description
* Longer string (but not more than 20-30 chars) with a human-
* readable explanation of what the value refers to.
*/
void
printRate(const char* name, double value, const char* description)
{
printf("%-20s ", name);
if (value > 1e09) {
printf("%5.1f G/s ", value/1e09);
} else if (value > 1e06) {
printf("%5.1f M/s ", value/1e06);
} else if (value > 1e03) {
printf("%5.1f K/s ", value/1e03);
} else {
printf("%5.1f /s ", value);
}
printf(" %s\n", description);
}
/**
* Print a performance measurement consisting of a percentage.
*
* \param name
* Symbolic name for the measurement, in the form test.value
* where \c test is the name of the test that generated the result,
* \c value is a name for the particular measurement.
* \param value
* Measurement in units of %.
* \param description
* Longer string (but not more than 20-30 chars) with a human-
* readable explanation of what the value refers to.
*/
void
printPercent(const char* name, double value, const char* description)
{
printf("%-20s %.1f %% %s\n", name, value, description);
}
/**
* Time how long it takes to do an indexed write/overwrite.
*
* \param tableId
* Table containing the object.
* \param numKeys
* Number of keys in the object
* \param keyList
* Information about all the keys in the object
* \param buf
* Pointer to the object's value
* \param length
* Size in bytes of the object's value.
* \param [out] writeTimes
* Records individual experiment indexed write times
* \param [out] overWriteTimes
* Records individual experiment indexed overwrite times
*/
void
timeIndexWrite(uint64_t tableId, uint8_t numKeys, KeyInfo *keyList,
const void* buf, uint32_t length,
std::vector<double>& writeTimes,
std::vector<double>& overWriteTimes)
{
//warming up
cluster->write(tableId, numKeys, keyList, buf, length);
cluster->remove(tableId, keyList[0].key, keyList[0].keyLength);
Cycles::sleep(100);
uint64_t timeWrite = 0;
uint64_t timeOverwrite = 0;
uint64_t timeTaken = 0;
// record many measurements for each point and then take
// relevant statistics
int count = 1000;
// record the individual times as well
writeTimes.resize(count);
overWriteTimes.resize(count);
uint64_t start;
for (int i = 0; i < count; i++) {
start = Cycles::rdtsc();
cluster->write(tableId, numKeys, keyList, buf, length);
timeTaken = Cycles::rdtsc() - start;
timeWrite += timeTaken;
writeTimes[i] = Cycles::toSeconds(timeTaken);
Cycles::sleep(100);
start = Cycles::rdtsc();
cluster->write(tableId, numKeys, keyList, buf, length);
timeTaken = Cycles::rdtsc() - start;
timeOverwrite += timeTaken;
overWriteTimes[i] = Cycles::toSeconds(timeTaken);
Cycles::sleep(100);
cluster->remove(tableId, keyList[0].key, keyList[0].keyLength);
Cycles::sleep(100);
}
//final write to facilitate lookup afterwords
cluster->write(tableId, numKeys, keyList, buf, length);
}
/**
* Measure lookup and lookup+indexedRead times
*
* \param tableId
* Id of the table in which lookup is to be done.
* \param indexId
* Id of the index for which keys have to be compared.
* \param pk
* Primary key of the object that will be returned by
* the indexedRead operation. This is just used for sanity
* checking
* \param firstKey
* Starting key for the key range in which keys are to be matched.
* The key range includes the firstKey.
* It does not necessarily have to be null terminated. The caller must
* ensure that the storage for this key is unchanged through the life of
* the RPC.
* \param firstKeyLength
* Length in bytes of the firstKey.
* \param firstAllowedKeyHash
* Smallest primary key hash value allowed for firstKey.
* \param lastKey
* Ending key for the key range in which keys are to be matched.
* The key range includes the lastKey.
* It does not necessarily have to be null terminated. The caller must
* ensure that the storage for this key is unchanged through the life of
* the RPC.
* \param lastKeyLength
* Length in byes of the lastKey.
* \param [out] lookupTimes
* Records individual experiment lookup timess
* \param [out] lookupReadTimes
* Records individual experiment lookup+indexedRead times
*/
void
timeLookupAndIndexedRead(uint64_t tableId, uint8_t indexId, Key& pk,
const void* firstKey, uint16_t firstKeyLength,
uint64_t firstAllowedKeyHash,
const void* lastKey, uint16_t lastKeyLength,
std::vector<double>& lookupTimes,
std::vector<double>& lookupReadTimes)
{
// Hard-coding a number that we think is this is enough bulk to
// amortize all the fixed costs per RPC.
uint32_t maxNumHashes = 1000;
//warming up
Buffer responseBufferWarmup;
uint32_t numHashesWarmup;
uint16_t nextKeyLengthWarmup;
uint64_t nextKeyHashWarmup;
cluster->lookupIndexKeys(tableId, indexId, firstKey, firstKeyLength,
firstAllowedKeyHash, lastKey, lastKeyLength,
maxNumHashes,
&responseBufferWarmup, &numHashesWarmup,
&nextKeyLengthWarmup, &nextKeyHashWarmup);
// record many measurements for each point and then take
// relevant statistics
int count = 1000;
uint64_t timeTaken = 0;
lookupTimes.resize(count);
lookupReadTimes.resize(count);
uint64_t start;
for (int i = 0; i < count; i++) {
Buffer responseBuffer;
uint32_t numHashes;
uint16_t nextKeyLength;
uint64_t nextKeyHash;
start = Cycles::rdtsc();
cluster->lookupIndexKeys(tableId, indexId, firstKey, firstKeyLength,
firstAllowedKeyHash, lastKey, lastKeyLength, maxNumHashes,
&responseBuffer, &numHashes, &nextKeyLength, &nextKeyHash);
timeTaken = Cycles::rdtsc() - start;
lookupTimes[i] = Cycles::toSeconds(timeTaken);
// verify
uint32_t lookupOffset;
if (numHashes != 1)
printf("failed object, secKey:%s numHashes:%d\n",
static_cast<const char *>(lastKey), numHashes);
assert(numHashes > 0);
lookupOffset = sizeof32(WireFormat::LookupIndexKeys::Response);
assert(pk.getHash() ==
*responseBuffer.getOffset<uint64_t>(lookupOffset));
Buffer pKHashes;
pKHashes.emplaceAppend<uint64_t>(pk.getHash());
Buffer readResp;
uint32_t numObjects;
start = Cycles::rdtsc();
cluster->indexedRead(tableId, numHashes, &pKHashes, indexId,
firstKey, firstKeyLength, lastKey, lastKeyLength,
&readResp, &numObjects);
timeTaken += Cycles::rdtsc() - start;
lookupReadTimes[i] = Cycles::toSeconds(timeTaken);
}
}
/**
* Time how long it takes to read a set of objects in one multiRead
* operation repeatedly.
*
* \param requests
* The set of ReadObjects that encapsulate information about objects
* to be read.
* \param numObjects
* The number of objects to be read in a single multiRead operation.
*
* \return
* The average time, in seconds, to read all the objects in a single
* multiRead operation.
*/
double
timeMultiRead(MultiReadObject** requests, int numObjects)
{
// Do the multiRead once just to warm up all the caches everywhere.
cluster->multiRead(requests, numObjects);
uint64_t runCycles = Cycles::fromSeconds(500/1e03);
uint64_t start = Cycles::rdtsc();
uint64_t elapsed;
int count = 0;
while (true) {
for (int i = 0; i < 10; i++) {
cluster->multiRead(requests, numObjects);
}
count += 10;
elapsed = Cycles::rdtsc() - start;
if (elapsed >= runCycles)
break;
}
return Cycles::toSeconds(elapsed)/count;
}
/**
* Time how long it takes to write a set of objects in one multiWrite
* operation repeatedly.
*
* \param requests
* The set of WriteObjects that encapsulate information about objects
* to be written.
* \param numObjects
* The number of objects to be written in a single multiWrite operation.
*
* \return
* The average time, in seconds, to write all the objects in a single
* multiWrite operation.
*/
double
timeMultiWrite(MultiWriteObject** requests, int numObjects)
{
uint64_t runCycles = Cycles::fromSeconds(500/1e03);
uint64_t start = Cycles::rdtsc();
uint64_t elapsed;
int count = 0;
while (true) {
for (int i = 0; i < 10; i++) {
cluster->multiWrite(requests, numObjects);
}
count += 10;
elapsed = Cycles::rdtsc() - start;
if (elapsed >= runCycles)
break;
}
return Cycles::toSeconds(elapsed)/count;
}
/**
* Time how long it takes to read a particular object repeatedly.
*
* \param tableId
* Table containing the object.
* \param key
* Variable length key that uniquely identifies the object within tableId.
* \param keyLength
* Size in bytes of the key.
* \param ms
* Read the object repeatedly until this many total ms have
* elapsed.
* \param value
* The contents of the object will be stored here, in case
* the caller wants to examine them.
*
* \return
* The average time to read the object, in seconds.
*/
double
timeRead(uint64_t tableId, const void* key, uint16_t keyLength,
double ms, Buffer& value)
{
uint64_t runCycles = Cycles::fromSeconds(ms/1e03);
// Read the value once just to warm up all the caches everywhere.
cluster->read(tableId, key, keyLength, &value);
uint64_t start = Cycles::rdtsc();
uint64_t elapsed;
int count = 0;
while (true) {
for (int i = 0; i < 10; i++) {
cluster->read(tableId, key, keyLength, &value);
}
count += 10;
elapsed = Cycles::rdtsc() - start;
if (elapsed >= runCycles)
break;
}
return Cycles::toSeconds(elapsed)/count;
}
/**
* Read a particular object repeatedly and return information about
* the distribution of read times.
*
* \param tableId
* Table containing the object.
* \param key
* Variable length key that uniquely identifies the object within tableId.
* \param keyLength
* Size in bytes of the key.
* \param count
* Read the object this many times, unless time runs out.
* \param timeLimit
* Maximum time (in seconds) to spend on this test: if this much
* time elapses, then less than count iterations will be run.
* \param value
* The contents of the object will be stored here, in case
* the caller wants to check them.
*
* \return
* Information about how long the reads took.
*/
TimeDist
readDist(uint64_t tableId, const void* key, uint16_t keyLength,
int count, double timeLimit, Buffer& value)
{
uint64_t total = 0;
std::vector<uint64_t> times;
times.resize(count);
uint64_t stopTime = Cycles::rdtsc() + Cycles::fromSeconds(timeLimit);
// Read the value once just to warm up all the caches everywhere.
cluster->read(tableId, key, keyLength, &value);
for (int i = 0; i < count; i++) {
uint64_t start = Cycles::rdtsc();
if (start >= stopTime) {
LOG(NOTICE, "time expired after %d iterations", i);
times.resize(i);
break;
}
cluster->read(tableId, key, keyLength, &value);
uint64_t interval = Cycles::rdtsc() - start;
total += interval;
times[i] = interval;
}
TimeDist result;
getDist(times, &result);
double totalBytes = value.size();
totalBytes *= downCast<int>(times.size());
result.bandwidth = totalBytes/Cycles::toSeconds(total);
return result;
}
/**
* Write a particular object repeatedly and return information about
* the distribution of write times.
*
* \param tableId
* Table containing the object.
* \param key
* Variable length key that uniquely identifies the object within tableId.
* \param keyLength
* Size in bytes of the key.
* \param value
* Pointer to first byte of contents to write into the object.
* \param length
* Size of data at \c value.
* \param count
* Write the object this many times.
* \param timeLimit
* Maximum time (in seconds) to spend on this test: if this much
* time elapses, then less than count iterations will be run.
*
* \return
* Information about how long the writes took.
*/
TimeDist
writeDist(uint64_t tableId, const void* key, uint16_t keyLength,
const void* value, uint32_t length, int count, double timeLimit)
{
uint64_t total = 0;
std::vector<uint64_t> times;
times.resize(count);
uint64_t stopTime = Cycles::rdtsc() + Cycles::fromSeconds(timeLimit);
// Write the value once just to warm up all the caches everywhere.
cluster->write(tableId, key, keyLength, value, length);
for (int i = 0; i < count; i++) {
uint64_t start = Cycles::rdtsc();
if (start >= stopTime) {
LOG(NOTICE, "time expired after %d iterations", i);
times.resize(i);
break;
}
cluster->write(tableId, key, keyLength, value, length);
uint64_t interval = Cycles::rdtsc() - start;
total += interval;
times[i] = interval;
}
TimeDist result;
getDist(times, &result);
double totalBytes = length;
totalBytes *= downCast<int>(times.size());
result.bandwidth = totalBytes/Cycles::toSeconds(total);
return result;
}
/**
* Fill a buffer with an ASCII value that can be checked later to ensure
* that no data has been lost or corrupted. A particular tableId, key and
* keyLength are incorporated into the value (under the assumption that
* the value will be stored in that object), so that values stored in
* different objects will be detectably different.
*
* \param buffer
* Buffer to fill; any existing contents will be discarded.
* \param size
* Number of bytes of data to place in the buffer.
* \param tableId
* This table identifier will be reflected in the value placed in the
* buffer.
* \param key
* This key will be reflected in the value placed in the buffer.
* \param keyLength
* This key Length will be reflected in the value placed in the buffer.
*/
void
fillBuffer(Buffer& buffer, uint32_t size, uint64_t tableId,
const void* key, uint16_t keyLength)
{
char chunk[51];
buffer.reset();
uint32_t bytesLeft = size;
int position = 0;
while (bytesLeft > 0) {
// Write enough data to completely fill the chunk buffer, then
// ignore the terminating NULL character that snprintf puts at
// the end.
snprintf(chunk, sizeof(chunk),
"| %d: tableId 0x%lx, key %.*s, keyLength 0x%x %s",
position, tableId, keyLength, reinterpret_cast<const char*>(key),
keyLength, "0123456789");
uint32_t chunkLength = static_cast<uint32_t>(sizeof(chunk) - 1);
if (chunkLength > bytesLeft) {
chunkLength = bytesLeft;
}
buffer.appendCopy(chunk, chunkLength);
bytesLeft -= chunkLength;
position += chunkLength;
}
}
/**
* Check the contents of a buffer to ensure that it contains the same data
* generated previously by fillBuffer. Generate a log message if a
* problem is found.
*
* \param buffer
* Buffer whose contents are to be checked.
* \param offset
* Check the data starting at this offset in the buffer.
* \param expectedLength
* The buffer should contain this many bytes starting at offset.
* \param tableId
* This table identifier should be reflected in the buffer's data.
* \param key
* This key should be reflected in the buffer's data.
* \param keyLength
* This key length should be reflected in the buffer's data.
*
* \return
* True means the buffer has the "expected" contents; false means
* there was an error.
*/
bool
checkBuffer(Buffer* buffer, uint32_t offset, uint32_t expectedLength,
uint64_t tableId, const void* key, uint16_t keyLength)
{
uint32_t length = buffer->size();
if (length != (expectedLength + offset)) {
RAMCLOUD_LOG(ERROR, "corrupted data: expected %u bytes, "
"found %u bytes", expectedLength, length - offset);
return false;
}
Buffer comparison;
fillBuffer(comparison, expectedLength, tableId, key, keyLength);
for (uint32_t i = 0; i < expectedLength; i++) {
char c1 = *buffer->getOffset<char>(offset + i);
char c2 = *comparison.getOffset<char>(i);
if (c1 != c2) {
int start = i - 10;
const char* prefix = "...";
const char* suffix = "...";
if (start <= 0) {
start = 0;
prefix = "";
}
uint32_t length = 20;
if (start+length >= expectedLength) {
length = expectedLength - start;
suffix = "";
}
RAMCLOUD_LOG(ERROR, "corrupted data: expected '%c', got '%c' "
"(\"%s%.*s%s\" vs \"%s%.*s%s\")", c2, c1, prefix, length,
static_cast<const char*>(comparison.getRange(start,
length)), suffix, prefix, length,
static_cast<const char*>(buffer->getRange(offset + start,
length)), suffix);
return false;
}
}
return true;
}
/**
* Compute the key for a particular control value in a particular client.
*
* \param client
* Index of the desired client.
* \param name
* Name of control value: state (current state of the slave),
* command (command issued by the master for the slave),
* doc (documentation string for use in log messages), or
* metrics (statistics returned from slaves back to the master).
*
*/
string
keyVal(int client, const char* name)
{
return format("%d:%s", client, name);
}
/**
* Slaves invoke this function to indicate their current state.
*
* \param state
* A string identifying what the slave is doing now, such as "idle".
*/
void
setSlaveState(const char* state)
{
string key = keyVal(clientIndex, "state");
cluster->write(controlTable, key.c_str(), downCast<uint16_t>(key.length()),
state);
}
/**
* Read the value of an object and place it in a buffer as a null-terminated
* string.
*
* \param tableId
* Identifier of the table containing the object.
* \param key
* Variable length key that uniquely identifies the object within table.
* \param keyLength
* Size in bytes of the key.
* \param value
* Buffer in which to store the object's value.
* \param size
* Size of buffer.
*
* \return
* The return value is a pointer to buffer, which contains the contents
* of the specified object, null-terminated and truncated if needed to
* make it fit in the buffer.
*/
char*
readObject(uint64_t tableId, const void* key, uint16_t keyLength,
char* value, uint32_t size)
{
Buffer buffer;
cluster->read(tableId, key, keyLength, &buffer);
uint32_t actual = buffer.size();
if (size <= actual) {
actual = size - 1;
}
buffer.copy(0, size, value);
value[actual] = 0;
return value;
}
/**
* A slave invokes this function to wait for the master to issue it a
* command other than "idle"; the string value of the command is returned.
*
* \param buffer
* Buffer in which to store the state.
* \param size
* Size of buffer.
* \param remove
* If true, the command object is removed once we have retrieved it
* (so the next indication of this method will wait for a new command).
* If false, the command object is left in place, so it will be
* returned by future calls to this method, unless someone else
* changes it.
*
* \return
* The return value is a pointer to a buffer, which now holds the
* command.
*/
const char*
getCommand(char* buffer, uint32_t size, bool remove = true)
{
while (true) {
try {
string key = keyVal(clientIndex, "command");
readObject(controlTable, key.c_str(),
downCast<uint16_t>(key.length()), buffer, size);
if (strcmp(buffer, "idle") != 0) {
if (remove) {
// Delete the command value so we don't process the same
// command twice.
cluster->remove(controlTable, key.c_str(),
downCast<uint16_t>(key.length()));
}
return buffer;
}
}
catch (TableDoesntExistException& e) {
}
catch (ObjectDoesntExistException& e) {
}
Cycles::sleep(10000);
}
}
/**
* Wait for a particular object to come into existence and, optionally,
* for it to take on a particular value. Give up if the object doesn't
* reach the desired state within a short time period.
*
* \param tableId
* Identifier of the table containing the object.
* \param key
* Variable length key that uniquely identifies the object within table.
* \param keyLength
* Size in bytes of the key.
* \param desired
* If non-null, specifies a string value; this function won't
* return until the object's value matches the string.
* \param value
* The actual value of the object is returned here.
* \param timeout
* Seconds to wait before giving up and throwing an Exception.
*/
void
waitForObject(uint64_t tableId, const void* key, uint16_t keyLength,
const char* desired, Buffer& value, double timeout = 1.0)
{
uint64_t start = Cycles::rdtsc();
size_t length = desired ? strlen(desired) : -1;
while (true) {
try {
cluster->read(tableId, key, keyLength, &value);
if (desired == NULL) {
return;
}
const char *actual = value.getStart<char>();
if ((length == value.size()) &&
(memcmp(actual, desired, length) == 0)) {
return;
}
double elapsed = Cycles::toSeconds(Cycles::rdtsc() - start);
if (elapsed > timeout) {
// Slave is taking too long; time out.
throw Exception(HERE, format(
"Object <%lu, %.*s> didn't reach desired state '%s' "
"(actual: '%.*s')",
tableId, keyLength, reinterpret_cast<const char*>(key),
desired, downCast<int>(value.size()),
actual));
exit(1);
}
}
catch (TableDoesntExistException& e) {
}
catch (ObjectDoesntExistException& e) {
}
}
}
/**
* The master invokes this function to wait for a slave to respond
* to a command and enter a particular state. Give up if the slave
* doesn't enter the desired state within a short time period.
*
* \param slave
* Index of the slave (1 corresponds to the first slave).
* \param state
* A string identifying the desired state for the slave.
* \param timeout
* Seconds to wait before giving up and throwing an Exception.
*/
void
waitSlave(int slave, const char* state, double timeout = 1.0)
{
Buffer value;
string key = keyVal(slave, "state");
waitForObject(controlTable, key.c_str(), downCast<uint16_t>(key.length()),
state, value, timeout);
}
/**
* Issue a command to one or more slaves and wait for them to receive
* the command.
*
* \param command
* A string identifying what the slave should do next. If NULL
* then no command is sent; we just wait for the slaves to reach
* the given state.
* \param state
* The state that each slave will enter once it has received the
* command. NULL means don't wait for the slaves to receive the
* command.
* \param firstSlave
* Index of the first slave to interact with.
* \param numSlaves
* Total number of slaves to command.
*/
void
sendCommand(const char* command, const char* state, int firstSlave,
int numSlaves = 1)
{
if (command != NULL) {
for (int i = 0; i < numSlaves; i++) {
string key = keyVal(firstSlave+i, "command");
cluster->write(controlTable, key.c_str(),
downCast<uint16_t>(key.length()), command);
}
}
if (state != NULL) {
for (int i = 0; i < numSlaves; i++) {
waitSlave(firstSlave+i, state);
}
}
}
/**
* Create one or more tables, each on a different master, and create one
* object in each table.
*
* \param numTables
* How many tables to create.
* \param objectSize
* Number of bytes in the object to create each table.
* \param key
* Key to use for the created object in each table.
* \param keyLength
* Size in bytes of the key.
*
*/
uint64_t*
createTables(int numTables, int objectSize, const void* key, uint16_t keyLength)
{
uint64_t* tableIds = new uint64_t[numTables];
// Create the tables in backwards order to reduce possible correlations
// between clients, tables, and servers (if we have 60 clients and 60
// servers, with clients and servers colocated and client i accessing
// table i, we wouldn't want each client reading a table from the
// server on the same machine).
for (int i = numTables-1; i >= 0; i--) {
char tableName[20];
snprintf(tableName, sizeof(tableName), "table%d", i);
cluster->createTable(tableName);
tableIds[i] = cluster->getTableId(tableName);
Buffer data;
fillBuffer(data, objectSize, tableIds[i], key, keyLength);
cluster->write(tableIds[i], key, keyLength,
data.getRange(0, objectSize), objectSize);
}
return tableIds;
}
/**
* Slaves invoke this method to return one or more performance measurements
* back to the master.
*
* \param m0
* A performance measurement such as latency or bandwidth. The precise
* meaning is defined by each individual test, and most tests only use
* a subset of the possible metrics.
* \param m1
* Another performance measurement.
* \param m2
* Another performance measurement.
* \param m3
* Another performance measurement.
* \param m4
* Another performance measurement.
* \param m5
* Another performance measurement.
* \param m6
* Another performance measurement.
* \param m7
* Another performance measurement.
*/
void
sendMetrics(double m0, double m1 = 0.0, double m2 = 0.0, double m3 = 0.0,
double m4 = 0.0, double m5 = 0.0, double m6 = 0.0, double m7 = 0.0)
{
double metrics[MAX_METRICS];
metrics[0] = m0;
metrics[1] = m1;
metrics[2] = m2;
metrics[3] = m3;
metrics[4] = m4;
metrics[5] = m5;
metrics[6] = m6;
metrics[7] = m7;
string key = keyVal(clientIndex, "metrics");
cluster->write(controlTable, key.c_str(), downCast<uint16_t>(key.length()),
metrics, sizeof(metrics));
}
/**
* Masters invoke this method to retrieved performance measurements from
* slaves. This method waits for slaves to fill in their metrics, if they
* haven't already.
*
* \param metrics
* This vector of vectors is cleared and then filled with the slaves'
* performance data. Each inner vector corresponds to one metric
* and contains a value from each of the slaves.
* \param clientCount
* Metrics will be read from this many clients, starting at 0.
*/
void
getMetrics(ClientMetrics& metrics, int clientCount)
{
// First, reset the result.
metrics.clear();
metrics.resize(MAX_METRICS);
for (int i = 0; i < MAX_METRICS; i++) {
metrics[i].resize(clientCount);
for (int j = 0; j < clientCount; j++) {
metrics[i][j] = 0.0;
}
}
// Iterate over all the slaves to fetch metrics from each.
for (int client = 0; client < clientCount; client++) {
Buffer metricsBuffer;
string key = keyVal(client, "metrics");
waitForObject(controlTable, key.c_str(),
downCast<uint16_t>(key.length()), NULL, metricsBuffer);
const double* clientMetrics = static_cast<const double*>(
metricsBuffer.getRange(0,
MAX_METRICS*sizeof32(double))); // NOLINT
for (int i = 0; i < MAX_METRICS; i++) {
metrics[i][client] = clientMetrics[i];
}
}
}
/**
* Return the largest element in a vector.
*
* \param data
* Input values.
*/
double
max(std::vector<double>& data)
{
double result = data[0];
for (int i = downCast<int>(data.size())-1; i > 0; i--) {
if (data[i] > result)
result = data[i];
}
return result;
}
/**
* Return the smallest element in a vector.
*
* \param data
* Input values.
*/
double
min(std::vector<double>& data)
{
double result = data[0];
for (int i = downCast<int>(data.size())-1; i > 0; i--) {
if (data[i] < result)
result = data[i];
}
return result;
}
/**
* Return the sum of the elements in a vector.
*
* \param data
* Input values.
*/
double
sum(std::vector<double>& data)
{
double result = 0.0;
for (int i = downCast<int>(data.size())-1; i >= 0; i--) {
result += data[i];
}
return result;
}
/**
* Return the average of the elements in a vector.
*
* \param data
* Input values.
*/
double
average(std::vector<double>& data)
{
double result = 0.0;
int length = downCast<int>(data.size());
for (int i = length-1; i >= 0; i--) {
result += data[i];
}
return result / length;
}
/**
* Print the elements of a vector
*
* \param data
* Vector whose elements need to be printed
*/
void
printVector(std::vector<double>& data)
{
for (std::vector<double>::iterator it = data.begin();
it != data.end(); ++it)
printf("%lf\n", 1e06*(*it));
}
/**
* Given an integer value, generate a key of a given length
* that corresponds to that value.
*
* \param value
* Unique value to encapsulate in the key.
* \param length
* Total number of bytes in the resulting key. Must be at least 4.
* \param dest
* Memory block in which to write the key; must contain at
* least length bytes.
*/
void makeKey(int value, uint32_t length, char* dest)
{
memset(dest, 'x', length);
*(reinterpret_cast<int*>(dest)) = value;
}
/**
* Fill a table with a given number of objects of a given size.
* This method uses multi-writes to do it quickly.
*
* \param tableId
* Identifier for the table in which the objects should be written.
* \param numObjects
* Number of objects to write in the table. The objects will have keys
* generated by passing the values (0..numObjects-1) to makeKey.
* \param keyLength
* Number of bytes in each key.
* \param valueLength
* Size of each object, in bytes.
*/
void fillTable(uint64_t tableId, int numObjects, uint16_t keyLength,
uint32_t valueLength)
{
#define BATCH_SIZE 500
// The following buffer is used to accumulate keys and values for
// a single multi-write operation.
Buffer buffer;
char keys[BATCH_SIZE*keyLength];
char values[BATCH_SIZE*valueLength];
MultiWriteObject* objects[BATCH_SIZE];
// Each iteration through the following loop adds one object to
// the current multi-write, and invokes the multi-write if needed.
uint64_t writeTime = 0;
for (int i = 0; i < numObjects; i++) {
int j = i % BATCH_SIZE;
char* key = &keys[j*keyLength];
makeKey(i, keyLength, key);
char* value = &values[j*valueLength];
genRandomString(value, valueLength);
objects[j] = buffer.emplaceAppend<MultiWriteObject>(tableId,
key, keyLength, value, valueLength);
// Do the write, if needed.
if ((j == (BATCH_SIZE - 1)) || (i == (numObjects-1))) {
uint64_t start = Cycles::rdtsc();
cluster->multiWrite(objects, j+1);
writeTime += Cycles::rdtsc() - start;
buffer.reset();
}
}
double rate = numObjects/Cycles::toSeconds(writeTime);
RAMCLOUD_LOG(NOTICE, "write rate for objects: %.1f kobjects/sec",
rate/1e03);
}
//----------------------------------------------------------------------
// Test functions start here
//----------------------------------------------------------------------
// Basic read and write times for objects of different sizes
void
basic()
{
if (clientIndex != 0)
return;
Buffer input, output;
int sizes[] = {100, 1000, 10000, 100000, 1000000};
const char* ids[] = {"100", "1K", "10K", "100K", "1M"};
const char* key = "123456789012345678901234567890";
uint16_t keyLength = downCast<uint16_t>(strlen(key));
char name[50], description[50];
for (int i = 0; i < 5; i++) {
int size = sizes[i];
fillBuffer(input, size, dataTable, key, keyLength);
cluster->write(dataTable, key, keyLength,
input.getRange(0, size), size);
Buffer output;
TimeDist dist = readDist(dataTable, key, keyLength, 100000, 2.0,
output);
checkBuffer(&output, 0, size, dataTable, key, keyLength);
snprintf(description, sizeof(description),
"read single %sB object (%uB key)", ids[i], keyLength);
snprintf(name, sizeof(name), "basic.read%s", ids[i]);
printf("%-20s %s %s median\n", name, formatTime(dist.p50).c_str(),
description);
snprintf(name, sizeof(name), "basic.read%s.min", ids[i]);
printf("%-20s %s %s minimum\n", name, formatTime(dist.min).c_str(),
description);
snprintf(name, sizeof(name), "basic.read%s.9", ids[i]);
printf("%-20s %s %s 90%%\n", name, formatTime(dist.p90).c_str(),
description);
if (dist.p99 != 0) {
snprintf(name, sizeof(name), "basic.read%s.99", ids[i]);
printf("%-20s %s %s 99%%\n", name, formatTime(dist.p99).c_str(),
description);
}
if (dist.p999 != 0) {
snprintf(name, sizeof(name), "basic.read%s.999", ids[i]);
printf("%-20s %s %s 99.9%%\n", name,
formatTime(dist.p999).c_str(), description);
}
snprintf(name, sizeof(name), "basic.readBw%s", ids[i]);
snprintf(description, sizeof(description),
"bandwidth reading %sB object (%uB key)", ids[i], keyLength);
printBandwidth(name, dist.bandwidth, description);
}
for (int i = 0; i < 5; i++) {
int size = sizes[i];
fillBuffer(input, size, dataTable, key, keyLength);
cluster->write(dataTable, key, keyLength,
input.getRange(0, size), size);
Buffer output;
TimeDist dist = writeDist(dataTable, key, keyLength,
input.getRange(0, size), size, 10000, 2.0);
// Make sure the object was properly written.
cluster->read(dataTable, key, keyLength, &output);
checkBuffer(&output, 0, size, dataTable, key, keyLength);
snprintf(description, sizeof(description),
"write single %sB object (%uB key)", ids[i], keyLength);
snprintf(name, sizeof(name), "basic.write%s", ids[i]);
printf("%-20s %s %s median\n", name, formatTime(dist.p50).c_str(),
description);
snprintf(name, sizeof(name), "basic.write%s.min", ids[i]);
printf("%-20s %s %s minimum\n", name, formatTime(dist.min).c_str(),
description);
snprintf(name, sizeof(name), "basic.write%s.9", ids[i]);
printf("%-20s %s %s 90%%\n", name, formatTime(dist.p90).c_str(),
description);
if (dist.p99 != 0) {
snprintf(name, sizeof(name), "basic.write%s.99", ids[i]);
printf("%-20s %s %s 99%%\n", name, formatTime(dist.p99).c_str(),
description);
}
if (dist.p999 != 0) {
snprintf(name, sizeof(name), "basic.write%s.999", ids[i]);
printf("%-20s %s %s 99.9%%\n", name,
formatTime(dist.p999).c_str(), description);
}
snprintf(name, sizeof(name), "basic.writeBw%s", ids[i]);
snprintf(description, sizeof(description),
"bandwidth writing %sB object (%uB key)", ids[i], keyLength);
printBandwidth(name, dist.bandwidth, description);
}
}
// Measure the time to broadcast a short value from a master to multiple slaves
// using RAMCloud objects. This benchmark is also useful as a mechanism for
// exercising the master-slave communication mechanisms.
void
broadcast()
{
if (clientIndex > 0) {
while (true) {
char command[20];
char message[200];
getCommand(command, sizeof(command));
if (strcmp(command, "read") == 0) {
setSlaveState("waiting");
// Wait for a non-empty "doc" string to appear.
while (true) {
string key = keyVal(0, "doc");
readObject(controlTable, key.c_str(),
downCast<uint16_t>(key.length()),
message, sizeof(message));
if (message[0] != 0) {
break;
}
}
setSlaveState(message);
} else if (strcmp(command, "done") == 0) {
setSlaveState("done");
RAMCLOUD_LOG(NOTICE, "finished with %s", message);
return;
} else {
RAMCLOUD_LOG(ERROR, "unknown command %s", command);
return;
}
}
}
// RAMCLOUD_LOG(NOTICE, "master starting");
uint64_t totalTime = 0;
int count = 100;
for (int i = 0; i < count; i++) {
char message[30];
snprintf(message, sizeof(message), "message %d", i);
string key = keyVal(clientIndex, "doc");
cluster->write(controlTable, key.c_str(),
downCast<uint16_t>(key.length()), "");
sendCommand("read", "waiting", 1, numClients-1);
uint64_t start = Cycles::rdtsc();
cluster->write(controlTable, key.c_str(),
downCast<uint16_t>(key.length()), message);
for (int slave = 1; slave < numClients; slave++) {
waitSlave(slave, message);
}
uint64_t thisRun = Cycles::rdtsc() - start;
totalTime += thisRun;
}
sendCommand("done", "done", 1, numClients-1);
char description[50];
snprintf(description, sizeof(description),
"broadcast message to %d slaves", numClients-1);
printTime("broadcast", Cycles::toSeconds(totalTime)/count, description);
}
/**
* This method contains the core of all the "multiRead" tests.
* It writes objsPerMaster objects on numMasters servers
* and reads them back in one multiRead operation.
*
* \param dataLength
* Length of data for each object to be written.
* \param keyLength
* Length of key for each object to be written.
* \param numMasters
* The number of master servers across which the objects written
* should be distributed.
* \param objsPerMaster
* The number of objects to be written to each master server.
* \param randomize
* Randomize the order of requests sent from the client.
* Note: Randomization can cause bad cache effects on the client
* and cause slower than normal operation.
*
* \return
* The average time, in seconds, to read all the objects in a single
* multiRead operation.
*/
double
doMultiRead(int dataLength, uint16_t keyLength,
int numMasters, int objsPerMaster,
bool randomize = false)
{
if (clientIndex != 0)
return 0;
Buffer input;
MultiReadObject requestObjects[numMasters][objsPerMaster];
MultiReadObject* requests[numMasters][objsPerMaster];
Tub<ObjectBuffer> values[numMasters][objsPerMaster];
char keys[numMasters][objsPerMaster][keyLength];
uint64_t* tableIds = createTables(numMasters, dataLength, "0", 1);
for (int tableNum = 0; tableNum < numMasters; tableNum++) {
for (int i = 0; i < objsPerMaster; i++) {
genRandomString(keys[tableNum][i], keyLength);
fillBuffer(input, dataLength, tableIds[tableNum],
keys[tableNum][i], keyLength);
// Write each object to the cluster
cluster->write(tableIds[tableNum], keys[tableNum][i], keyLength,
input.getRange(0, dataLength), dataLength);
// Create read object corresponding to each object to be
// used in the multiread request later.
requestObjects[tableNum][i] =
MultiReadObject(tableIds[tableNum],
keys[tableNum][i], keyLength, &values[tableNum][i]);
requests[tableNum][i] = &requestObjects[tableNum][i];
}
}
// Scramble the requests. Checking code below it stays valid
// since the value buffer is a pointer to a Buffer in the request.
if (randomize) {
uint64_t numRequests = numMasters*objsPerMaster;
MultiReadObject** reqs = *requests;
for (uint64_t i = 0; i < numRequests; i++) {
uint64_t rand = generateRandom() % numRequests;
MultiReadObject* tmp = reqs[i];
reqs[i] = reqs[rand];
reqs[rand] = tmp;
}
}
double latency = timeMultiRead(*requests, numMasters*objsPerMaster);
// Check that the values read were the same as the values written.
for (int tableNum = 0; tableNum < numMasters; ++tableNum) {
for (int i = 0; i < objsPerMaster; i++) {
ObjectBuffer* output = values[tableNum][i].get();
uint16_t offset;
output->getValueOffset(&offset);
checkBuffer(output, offset, dataLength, tableIds[tableNum],
keys[tableNum][i], keyLength);
}
}
return latency;
}
/**
* This method contains the core of all the "multiWrite" tests.
* It writes objsPerMaster objects on numMasters servers.
*
* \param dataLength
* Length of data for each object to be written.
* \param keyLength
* Length of key for each object to be written.
* \param numMasters
* The number of master servers across which the objects written
* should be distributed.
* \param objsPerMaster
* The number of objects to be written to each master server.
* \param randomize
* Randomize the order of requests sent from the client.
* Note: Randomization can cause bad cache effects on the client
* and cause slower than normal operation.
*
* \return
* The average time, in seconds, to read all the objects in a single
* multiRead operation.
*/
double
doMultiWrite(int dataLength, uint16_t keyLength,
int numMasters, int objsPerMaster,
bool randomize = false)
{
if (clientIndex != 0)
return 0;
// MultiWrite Objects
MultiWriteObject writeRequestObjects[numMasters][objsPerMaster];
MultiWriteObject* writeRequests[numMasters][objsPerMaster];
Buffer values[numMasters][objsPerMaster];
char keys[numMasters][objsPerMaster][keyLength];
uint64_t* tableIds = createTables(numMasters, dataLength, "0", 1);
for (int tableNum = 0; tableNum < numMasters; tableNum++) {
for (int i = 0; i < objsPerMaster; i++) {
genRandomString(keys[tableNum][i], keyLength);
fillBuffer(values[tableNum][i], dataLength,
tableIds[tableNum], keys[tableNum][i], keyLength);
// Create write object corresponding to each object to be
// used in the multiWrite request later.
writeRequestObjects[tableNum][i] =
MultiWriteObject(tableIds[tableNum],
keys[tableNum][i], keyLength,
values[tableNum][i].getRange(0, dataLength),
dataLength);
writeRequests[tableNum][i] = &writeRequestObjects[tableNum][i];
}
}
// Scramble the requests. Checking code below it stays valid
// since the value buffer is a pointer to a Buffer in the request.
if (randomize) {
uint64_t numRequests = numMasters*objsPerMaster;
MultiWriteObject ** wreqs = *writeRequests;
for (uint64_t i = 0; i < numRequests; i++) {
uint64_t rand = generateRandom() % numRequests;
MultiWriteObject* wtmp = wreqs[i];
wreqs[i] = wreqs[rand];
wreqs[rand] = wtmp;
}
}
double latency = timeMultiWrite(*writeRequests, numMasters*objsPerMaster);
// TODO(syang0) currently values written are unchecked, someone should do
// this with a multiread.
return latency;
}
// Basic index write/overwrite, lookups and indexedRead operation times.
// All objects have just one secondary key and all keys are 30 bytes long.
void
indexBasic()
{
if (clientIndex != 0)
return;
// all keys (including primary key) will be 30 bytes long
const uint32_t keyLength = 30;
uint8_t indexId = 1;
uint8_t numIndexlets = 1;
cluster->createIndex(dataTable, indexId, 0, numIndexlets);
// number of objects in the table and in the index
int indexSizes[] = {1, 10, 100, 1000, 10000, 100000, 1000000};
int maxNumObjects = indexSizes[6];
// each object has only 1 secondary key because we are only measuring basic
// indexing performance.
uint8_t numKeys = 2;
int size = 100; // value size
uint64_t firstAllowedKeyHash = 0;
printf("# RAMCloud index write, overwrite, lookup and read performance"
" with varying number of objects.\n"
"# All keys are 30 bytes and the value of the object is fixed"
" to be 100 bytes.\n"
"# Write and overwrite latencies are measured for the 'nth' object"
" insertion where the size of the\n"
"# table is 'n-1'. Lookup and indexedRead latencies are measured"
" when the size of the index is 'n'.\n"
"# All latency measurements are printed as 10 percentile/ "
"median/ 90 percentile.\n");
printf("# Generated by 'clusterperf.py indexBasic'\n#\n"
"# n write latency(us) overwrite latency(us)"
" lookup latency(us) lookup+read latency(us)\n"
"#----------------------------------------------------------"
"------------------------------------------------------------\n");
for (int i = 0, k = 0; i < maxNumObjects; i++) {
char primaryKey[keyLength];
snprintf(primaryKey, sizeof(primaryKey), "%dp%0*d", i, keyLength, 0);
char secondaryKey[keyLength];
snprintf(secondaryKey, sizeof(secondaryKey), "b%ds%0*d", i,
keyLength, 0);
KeyInfo keyList[2];
keyList[0].keyLength = keyLength;
keyList[0].key = primaryKey;
keyList[1].keyLength = keyLength;
keyList[1].key = secondaryKey;
Buffer input;
fillBuffer(input, size, dataTable,
keyList[0].key, keyList[0].keyLength);
std::vector<double> timeWrites, timeOverWrites, timeLookups,
timeLookupIndexedReads;
bool measureFlag = false;
// record/measure only points that are in indexSizes[]
if ((i + 1) == indexSizes[k]) {
timeIndexWrite(dataTable, numKeys, keyList, input.getRange(0, size),
size, timeWrites, timeOverWrites);
measureFlag = true;
} else {
cluster->write(dataTable, numKeys, keyList,
input.getRange(0, size), size);
}
if (measureFlag) {
// measuere both lookup and lookup+indexedRead operations
Key pk(dataTable, keyList[0].key, keyList[0].keyLength);
timeLookupAndIndexedRead(dataTable, indexId, pk, keyList[1].key,
keyList[1].keyLength, firstAllowedKeyHash, keyList[1].key,
keyList[1].keyLength, timeLookups, timeLookupIndexedReads);
// measurements for 'i+1'th object (current size of table/index = i)
std::sort(timeWrites.begin(),
timeWrites.end());
std::sort(timeOverWrites.begin(),
timeOverWrites.end());
std::sort(timeLookups.begin(),
timeLookups.end());
std::sort(timeLookupIndexedReads.begin(),
timeLookupIndexedReads.end());
printf("%9d %9.1f/%6.1f/%6.1f %13.1f/%6.1f/%6.1f ",
indexSizes[k],
timeWrites[timeWrites.size()/10] *1e6,
timeWrites[timeWrites.size()/2] *1e6,
timeWrites[timeWrites.size()*9/10] *1e6,
timeOverWrites[timeOverWrites.size()/10] *1e6,
timeOverWrites[timeOverWrites.size()/2] *1e6,
timeOverWrites[timeOverWrites.size()*9/10] *1e6);
printf("%10.1f/%6.1f/%6.1f %12.1f/%6.1f/%6.1f\n",
timeLookups[timeLookups.size()/10] *1e6,
timeLookups[timeLookups.size()/2] *1e6,
timeLookups[timeLookups.size()*9/10] *1e6,
timeLookupIndexedReads[timeLookupIndexedReads.size()/10]*1e6,
timeLookupIndexedReads[timeLookupIndexedReads.size()/2]*1e6,
timeLookupIndexedReads[timeLookupIndexedReads.size()*9/10]*
1e6);
k++;
printf("\n");
}
}
cluster->dropIndex(dataTable, indexId);
}
// Index write and overwrite times for varying number of indexes/object
void
indexMultiple()
{
if (clientIndex != 0)
return;
const uint32_t keyLength = 30;
int numObjects = 1000; // size of the table/index
// includes the primary key
uint8_t maxNumKeys = static_cast<uint8_t>(numIndexes + 1);
printf("# RAMCloud write/overwrite performance for %dth object "
"insertion with varying number of index keys.\n"
"# The size of the table is %d objects and is constant"
" for this experiment. The latency measurements\n"
"# are printed as 10 percentile/ median/ 90 percentile\n",
numObjects, numObjects-1);
printf("# Generated by 'clusterperf.py indexMultiple'\n#\n"
"# Num secondary keys/obj write latency (us)"
" overwrite latency (us)\n"
"#---------------------------------------------------"
"------------------------------\n");
for (uint8_t numKeys = 0; numKeys < maxNumKeys; numKeys++) {
// numKeys refers to the number of secondary keys
char tableName[20];
snprintf(tableName, sizeof(tableName), "table%d", numKeys);
uint64_t indexTable = cluster->createTable(tableName);
for (uint8_t z = 1; z <= numKeys; z++)
cluster->createIndex(indexTable, z, 0);
// records measurements for one specific value of numKeys
std::vector<double> timeWrites, timeOverWrites;
for (int i = 0; i < numObjects; i++) {
KeyInfo keyList[numKeys+1];
char key[numKeys+1][keyLength];
// primary key
snprintf(key[0], sizeof(key[0]), "%dp%d%0*d",
numKeys, i, keyLength, 0);
keyList[0].keyLength = keyLength;
keyList[0].key = key[0];
for (int j = 1; j < numKeys + 1; j++) {
snprintf(key[j], sizeof(key[j]), "b%ds%d%d%0*d",
numKeys, i, j, keyLength, 0);
keyList[j].keyLength = keyLength;
keyList[j].key = key[j];
}
// Keeping value size constant = 100 bytes
uint32_t size = 100;
char value[size];
snprintf(value, sizeof(value), "Value %0*d", size, 0);
// do the measurement only for the last object insertion
if (i == numObjects - 1)
timeIndexWrite(indexTable, (uint8_t)(numKeys+1), keyList,
value, sizeof32(value), timeWrites,
timeOverWrites);
else
cluster->write(indexTable, (uint8_t)(numKeys+1), keyList,
value, sizeof32(value));
// verify
Key pkey(indexTable, keyList[0].key, keyList[0].keyLength);
for (uint8_t z = 1; z <= numKeys; z++) {
Buffer lookupResp;
uint32_t numHashes;
uint16_t nextKeyLength;
uint64_t nextKeyHash;
uint32_t maxNumHashes = 1000;
uint32_t lookupOffset;
cluster->lookupIndexKeys(indexTable, z, keyList[z].key,
keyList[z].keyLength, 0, keyList[z].key,
keyList[z].keyLength, maxNumHashes,
&lookupResp, &numHashes,
&nextKeyLength, &nextKeyHash);
assert(1 == numHashes);
lookupOffset = sizeof32(
WireFormat::LookupIndexKeys::Response);
assert(pkey.getHash()==
*lookupResp.getOffset<uint64_t>(lookupOffset));
}
}
for (uint8_t z = 1; z <= numKeys; z++)
cluster->dropIndex(indexTable, z);
cluster->dropTable(tableName);
// note that this modifies the underlying vector.
std::sort(timeWrites.begin(), timeWrites.end());
std::sort(timeOverWrites.begin(), timeOverWrites.end());
printf("%24d %11.1f/%6.1f/%6.1f %14.1f/%6.1f/%6.1f\n", numKeys,
timeWrites[timeWrites.size()/10] *1e6,
timeWrites[timeWrites.size()/2] *1e6,
timeWrites[timeWrites.size()*9/10] *1e6,
timeOverWrites[timeOverWrites.size()/10] *1e6,
timeOverWrites[timeOverWrites.size()/2] *1e6,
timeOverWrites[timeOverWrites.size()*9/10] *1e6);
}
}
/**
* This method contains the core of the "indexScalability" test; it is
* shared by the master and slaves and measure lookup index operations
* throughput. Please make sure that the dataTable is also split into multiple
* tablets to ensure read don't bottleneck.
*
* \param range
* Range of identifiers [1, range] for the indexlets available for
* the test.
* \param numObjects
* Total number of objects present in each indexlet.
* \param docString
* Information provided by the master about this run; used
* in log messages.
*/
void
indexScalabilityCommonLookup(uint8_t range, int numObjects, char *docString)
{
double ms = 1000;
uint64_t runCycles = Cycles::fromSeconds(ms/1e03);
uint64_t lookupStart, lookupEnd;
uint64_t elapsed = 0;
int count = 0;
while (true) {
int numRequests = range;
Buffer lookupResp[numRequests];
uint32_t numHashes[numRequests];
uint16_t nextKeyLength[numRequests];
uint64_t nextKeyHash[numRequests];
char primaryKey[numRequests][30];
char secondaryKey[numRequests][30];
Tub<LookupIndexKeysRpc> rpcs[numRequests];
for (int i =0; i < numRequests; i++) {
char firstKey = static_cast<char>(('a') +
static_cast<int>(generateRandom() % range));
int randObj = static_cast<int>(generateRandom() % numObjects);
snprintf(primaryKey[i], sizeof(primaryKey[i]), "%c:%dp%0*d",
firstKey, randObj, 30, 0);
snprintf(secondaryKey[i], sizeof(secondaryKey[i]), "%c:%ds%0*d",
firstKey, randObj, 30, 0);
}
lookupStart = Cycles::rdtsc();
for (int i =0; i < numRequests; i++) {
rpcs[i].construct(cluster, dataTable, (uint8_t)1, secondaryKey[i],
(uint16_t)30, (uint16_t)0,
secondaryKey[i], (uint16_t)30, (uint32_t)1000,
&lookupResp[i]);
}
for (int i = 0; i < numRequests; i++) {
if (rpcs[i])
rpcs[i]->wait(&numHashes[i], &nextKeyLength[i], &nextKeyHash[i]);
}
lookupEnd = Cycles::rdtsc();
for (int i =0; i < numRequests; i++) {
Key pk(dataTable, primaryKey[i], 30);
uint32_t lookupOffset;
lookupOffset = sizeof32(WireFormat::LookupIndexKeys::Response);
assert(numHashes[i] == 1);
assert(pk.getHash()==
*lookupResp[i].getOffset<uint64_t>(lookupOffset));
}
uint64_t latency = lookupEnd - lookupStart;
count = count + numRequests;
elapsed += latency;
if (elapsed >= runCycles)
break;
}
double thruput = count/Cycles::toSeconds(elapsed);
sendMetrics(thruput);
if (clientIndex != 0) {
RAMCLOUD_LOG(NOTICE,
"Client:%d %s: throughput: %.1f lookups/sec",
clientIndex, docString, thruput);
}
}
/**
* This method contains the core of the "indexScalability" test; it is
* shared by the master and slaves and measure lookup and read index operations
* throughput. Please make sure that the dataTable is also split into multiple
* tablets to ensure read don't bottleneck.
*
* \param range
* Range of identifiers [1, range] for the indexlets available for
* the test.
* \param numObjects
* Total number of objects present in each indexlet.
* \param docString
* Information provided by the master about this run; used
* in log messages.
*/
void
indexScalabilityCommonLookupRead(uint8_t range, int numObjects, char *docString)
{
double ms = 1000;
uint64_t runCycles = Cycles::fromSeconds(ms/1e03);
uint64_t lookupStart;
uint64_t readEnd;
uint64_t elapsed = 0;
int count = 0;
while (true) {
int numRequests = range;
Buffer lookupResp[numRequests];
uint32_t numHashes[numRequests];
uint16_t nextKeyLength[numRequests];
uint64_t nextKeyHash[numRequests];
char primaryKey[numRequests][30];
char secondaryKey[numRequests][30];
Tub<IndexedReadRpc> readRpcs[numRequests];
Tub<LookupIndexKeysRpc> rpcs[numRequests];
uint32_t readNumObjects[numRequests];
Buffer pKHashes[numRequests];
Buffer readResp[numRequests];
for (int i = 0; i < numRequests; i++) {
char firstKey = static_cast<char>(('a') +
static_cast<int>(generateRandom() % range));
int randObj = static_cast<int>(generateRandom() % numObjects);
snprintf(primaryKey[i], sizeof(primaryKey[i]), "%c:%dp%0*d",
firstKey, randObj, 30, 0);
snprintf(secondaryKey[i], sizeof(secondaryKey[i]), "%c:%ds%0*d",
firstKey, randObj, 30, 0);
Key pk(dataTable, primaryKey[i], 30);
pKHashes[i].emplaceAppend<uint64_t>(pk.getHash());
}
lookupStart = Cycles::rdtsc();
for (int i =0; i < numRequests; i++) {
rpcs[i].construct(cluster, dataTable, (uint8_t)1, secondaryKey[i],
(uint16_t)30, (uint16_t)0,
secondaryKey[i], (uint16_t)30, (uint32_t)1000,
&lookupResp[i]);
}
for (int i = 0; i < numRequests; i++) {
if (rpcs[i]) {
rpcs[i]->wait(&numHashes[i], &nextKeyLength[i], &nextKeyHash[i]);
readRpcs[i].construct(cluster, dataTable, numHashes[i],
&pKHashes[i], (uint8_t)1, secondaryKey[i], (uint16_t)30,
secondaryKey[i], (uint16_t)30, &readResp[i]);
}
}
for (int i = 0; i < numRequests; i++) {
if (readRpcs[i])
readRpcs[i]->wait(&readNumObjects[i]);
}
readEnd = Cycles::rdtsc();
//verify
for (int i = 0; i < numRequests; i++) {
Key pk(dataTable, primaryKey[i], 30);
uint32_t lookupOffset;
lookupOffset = sizeof32(WireFormat::LookupIndexKeys::Response);
assert(numHashes[i] == 1);
assert(readNumObjects[i] == 1);
assert(pk.getHash() ==
*lookupResp[i].getOffset<uint64_t>(lookupOffset));
}
uint64_t latency = readEnd - lookupStart;
count = count + numRequests;
elapsed += latency;
if (elapsed >= runCycles)
break;
}
double thruput = count/Cycles::toSeconds(elapsed);
sendMetrics(thruput);
if (clientIndex != 0) {
RAMCLOUD_LOG(NOTICE,
"Client:%d %s: throughput: %.1f lookups/sec",
clientIndex, docString, thruput);
}
}
// In this test all of the clients repeatedly lookup and/or read objects
// from a collection of indexlets on a single table. For each lookup/read a
// client chooses an indexlet at random.
void
indexScalability()
{
uint8_t numIndexlets = (uint8_t)numIndexlet;
int numObjectsPerIndexlet = 1000;
if (clientIndex > 0) {
while (true) {
char command[20];
char doc[200];
getCommand(command, sizeof(command));
if (strcmp(command, "run") == 0) {
string controlKey = keyVal(0, "doc");
readObject(controlTable, controlKey.c_str(),
downCast<uint16_t>(controlKey.length()),
doc, sizeof(doc));
setSlaveState("running");
indexScalabilityCommonLookup(numIndexlets,
numObjectsPerIndexlet, doc);
setSlaveState("idle");
} else if (strcmp(command, "done") == 0) {
setSlaveState("done");
return;
} else {
RAMCLOUD_LOG(ERROR, "unknown command %s", command);
return;
}
}
}
//dataset parameters
uint8_t indexId = 1;
uint8_t numKeys = 2;
uint64_t firstAllowedKeyHash = 0;
int size = 100;
//insert objects in dataset
cluster->createIndex(dataTable, indexId, 0, numIndexlets);
for (int j = 0; j < numIndexlets; j++) {
char firstKey = static_cast<char>('a'+j);
for (int i = 0; i < numObjectsPerIndexlet; i++) {
char primaryKey[30];
snprintf(primaryKey, sizeof(primaryKey), "%c:%dp%0*d",
firstKey, i, 30, 0);
char secondaryKey[30];
snprintf(secondaryKey, sizeof(secondaryKey), "%c:%ds%0*d",
firstKey, i, 30, 0);
KeyInfo keyList[2];
keyList[0].keyLength = 30;
keyList[0].key = primaryKey;
keyList[1].keyLength = 30;
keyList[1].key = secondaryKey;
Buffer input;
fillBuffer(input, size, dataTable,
keyList[0].key, keyList[0].keyLength);
cluster->write(dataTable, numKeys, keyList,
input.getRange(0, size), size);
Key pk(dataTable, keyList[0].key, keyList[0].keyLength);
Buffer lookupResp;
uint32_t numHashes;
uint16_t nextKeyLength;
uint64_t nextKeyHash;
uint32_t maxNumHashes = 1000;
cluster->lookupIndexKeys(dataTable, indexId, keyList[1].key,
keyList[1].keyLength, firstAllowedKeyHash, keyList[1].key,
keyList[1].keyLength, maxNumHashes,
&lookupResp, &numHashes, &nextKeyLength,
&nextKeyHash);
//verify
uint32_t lookupOffset;
assert(numHashes == 1);
lookupOffset = sizeof32(WireFormat::LookupIndexKeys::Response);
assert(pk.getHash() ==
*lookupResp.getOffset<uint64_t>(lookupOffset));
}
}
// Vary the number of clients and repeat the test for each number.
printf("# RAMCloud index scalability when 1 or more clients lookup/read\n");
printf("# %d-byte objects with 30-byte keys chosen at random from\n"
"# %d indexlets.\n", size, numIndexlets);
printf("# Generated by 'clusterperf.py indexScalability'\n");
printf("#\n");
printf("# numClients throughput(klookups/sec)\n");
printf("#-------------------------------------\n");
fflush(stdout);
double maximum = 0.0;
for (int numActive = 1; numActive <= numClients; numActive++) {
char doc[100];
snprintf(doc, sizeof(doc), "%d active clients", numActive);
string key = keyVal(0, "doc");
cluster->write(controlTable, key.c_str(),
downCast<uint16_t>(key.length()), doc);
sendCommand("run", "running", 1, numActive-1);
indexScalabilityCommonLookup(numIndexlets, numObjectsPerIndexlet, doc);
sendCommand(NULL, "idle", 1, numActive-1);
ClientMetrics metrics;
getMetrics(metrics, numActive);
double thruput = sum(metrics[0])/1e03;
if (thruput > maximum)
maximum = thruput;
printf("%3d %6.0f\n", numActive, thruput);
fflush(stdout);
}
sendCommand("done", "done", 1, numClients-1);
cluster->dropIndex(dataTable, indexId);
}
// This benchmark measures the multiread times for 100B objects with 30B keys
// distributed across multiple master servers such that there is one
// object located on each master server.
void
multiRead_oneObjectPerMaster()
{
int dataLength = 100;
uint16_t keyLength = 30;
printf("# RAMCloud multiRead performance for %u B objects"
" with %u byte keys\n", dataLength, keyLength);
printf("# with one object located on each master.\n");
printf("# Generated by 'clusterperf.py multiRead_oneObjectPerMaster'\n#\n");
printf("# Num Objs Num Masters Objs/Master "
"Latency (us) Latency/Obj (us)\n");
printf("#--------------------------------------------------------"
"--------------------\n");
int objsPerMaster = 1;
int maxNumMasters = numTables;
for (int numMasters = 1; numMasters <= maxNumMasters; numMasters++) {
double latency =
doMultiRead(dataLength, keyLength, numMasters, objsPerMaster);
printf("%10d %14d %14d %14.1f %18.2f\n",
numMasters*objsPerMaster, numMasters, objsPerMaster,
1e06*latency, 1e06*latency/numMasters/objsPerMaster);
}
}
// This benchmark measures the multiread times for multiple
// 100B objects with 30B keys on a single master server.
void
multiRead_oneMaster()
{
int dataLength = 100;
uint16_t keyLength = 30;
printf("# RAMCloud multiRead performance for %u B objects"
" with %u byte keys\n", dataLength, keyLength);
printf("# located on a single master.\n");
printf("# Generated by 'clusterperf.py multiRead_oneMaster'\n#\n");
printf("# Num Objs Num Masters Objs/Master "
"Latency (us) Latency/Obj (us)\n");
printf("#--------------------------------------------------------"
"--------------------\n");
int numMasters = 1;
int maxObjsPerMaster = 5000;
for (int objsPerMaster = 1; objsPerMaster <= maxObjsPerMaster;
objsPerMaster = (objsPerMaster < 10) ?
objsPerMaster + 1 : (objsPerMaster < 100) ?
objsPerMaster + 10 : (objsPerMaster < 1000) ?
objsPerMaster + 100 : objsPerMaster + 1000) {
double latency =
doMultiRead(dataLength, keyLength, numMasters, objsPerMaster);
printf("%10d %14d %14d %14.1f %18.2f\n",
numMasters*objsPerMaster, numMasters, objsPerMaster,
1e06*latency, 1e06*latency/numMasters/objsPerMaster);
}
}
// This benchmark measures the multiread times for an approximately
// fixed number of 100B objects with 30B keys distributed evenly
// across varying number of master servers.
void
multiRead_general()
{
int dataLength = 100;
uint16_t keyLength = 30;
printf("# RAMCloud multiRead performance for "
"an approximately fixed number\n");
printf("# of %u B objects with %u byte keys\n", dataLength, keyLength);
printf("# distributed evenly across varying number of masters.\n");
printf("# Generated by 'clusterperf.py multiRead_general'\n#\n");
printf("# Num Objs Num Masters Objs/Master "
"Latency (us) Latency/Obj (us)\n");
printf("#--------------------------------------------------------"
"--------------------\n");
int totalObjs = 5000;
int maxNumMasters = numTables;
for (int numMasters = 1; numMasters <= maxNumMasters; numMasters++) {
int objsPerMaster = totalObjs / numMasters;
double latency =
doMultiRead(dataLength, keyLength, numMasters, objsPerMaster);
printf("%10d %14d %14d %14.1f %18.2f\n",
numMasters*objsPerMaster, numMasters, objsPerMaster,
1e06*latency, 1e06*latency/numMasters/objsPerMaster);
}
}
// This benchmark measures the multiread times for an approximately
// fixed number of 100B objects with 30B keys distributed evenly
// across varying number of master servers. Requests are issued
// in a random order.
void
multiRead_generalRandom()
{
int dataLength = 100;
uint16_t keyLength = 30;
printf("# RAMCloud multiRead performance for "
"an approximately fixed number\n");
printf("# of %u B objects with %u byte keys\n", dataLength, keyLength);
printf("# distributed evenly across varying number of masters.\n");
printf("# Requests are issued in a random order.\n");
printf("# Generated by 'clusterperf.py multiRead_generalRandom'\n#\n");
printf("# Num Objs Num Masters Objs/Master "
"Latency (us) Latency/Obj (us)\n");
printf("#--------------------------------------------------------"
"--------------------\n");
int totalObjs = 5000;
int maxNumMasters = numTables;
for (int numMasters = 1; numMasters <= maxNumMasters; numMasters++) {
int objsPerMaster = totalObjs / numMasters;
double latency =
doMultiRead(dataLength, keyLength, numMasters, objsPerMaster, true);
printf("%10d %14d %14d %14.1f %18.2f\n",
numMasters*objsPerMaster, numMasters, objsPerMaster,
1e06*latency, 1e06*latency/numMasters/objsPerMaster);
}
}
// This benchmark measures the total throughput of a single server under
// a workload consisting of multiRead operations from several clients.
void
multiReadThroughput()
{
const uint16_t keyLength = 30;
const int numObjects = 2000000;
#define MRT_BATCH_SIZE 70
if (clientIndex == 0) {
// This is the master client. Fill in the table, then measure
// throughput while gradually increasing the number of workers.
int size = objectSize;
if (size < 0)
size = 100;
printf("# RAMCloud multi-read throughput of a single server with a\n"
"# varying number of clients issuing %d-object multi-reads on\n"
"# randomly-chosen %d-byte objects with %d-byte keys\n",
MRT_BATCH_SIZE, size, keyLength);
printf("# Generated by 'clusterperf.py multiReadThroughput'\n");
readThroughputMaster(numObjects, size, keyLength);
} else {
// Slaves execute the following code, which creates load by
// issuing randomized multi-reads.
bool running = false;
// The following buffer is used to accumulate keys and values for
// a single multi-read operation.
Buffer buffer;
char keys[MRT_BATCH_SIZE*keyLength];
Tub<ObjectBuffer> values[MRT_BATCH_SIZE];
MultiReadObject* objects[MRT_BATCH_SIZE];
uint64_t startTime;
int objectsRead;
bool firstRead = true;
while (true) {
char command[20];
if (running) {
// Write out some statistics for debugging.
double totalTime = Cycles::toSeconds(Cycles::rdtsc()
- startTime);
double rate = objectsRead/totalTime;
RAMCLOUD_LOG(NOTICE, "Multi-read rate: %.1f kobjects/sec",
rate/1e03);
}
getCommand(command, sizeof(command), false);
if (strcmp(command, "run") == 0) {
if (!running) {
setSlaveState("running");
running = true;
RAMCLOUD_LOG(NOTICE,
"Starting multiReadThroughput benchmark");
}
// Perform multi-reads for a second (then check to see
// if the experiment is over).
startTime = Cycles::rdtsc();
objectsRead = 0;
uint64_t checkTime = startTime + Cycles::fromSeconds(1.0);
do {
if (firstRead) {
// Each iteration through the following loop adds one
// object to the current multi-read.
buffer.reset();
for (int i = 0; i < MRT_BATCH_SIZE; i++) {
char* key = &keys[i*keyLength];
makeKey(downCast<int>(generateRandom()%numObjects),
keyLength, key);
values[i].destroy();
objects[i] = buffer.emplaceAppend<MultiReadObject>(
dataTable, key, keyLength, &values[i]);
}
firstRead = false;
}
cluster->multiRead(objects, MRT_BATCH_SIZE);
objectsRead += MRT_BATCH_SIZE;
} while (Cycles::rdtsc() < checkTime);
} else if (strcmp(command, "done") == 0) {
setSlaveState("done");
RAMCLOUD_LOG(NOTICE, "Ending multiReadThroughput benchmark");
return;
} else {
RAMCLOUD_LOG(ERROR, "unknown command %s", command);
return;
}
}
}
}
// This benchmark measures the multiwrite times for multiple
// 100B objects with 30B keys on a single master server.
void
multiWrite_oneMaster()
{
int numMasters = 1;
int dataLength = 100;
uint16_t keyLength = 30;
int maxObjsPerMaster = 5000;
printf("# RAMCloud multiWrite performance for %u B objects"
" with %u byte keys\n", dataLength, keyLength);
printf("# located on a single master.\n");
printf("# Generated by 'clusterperf.py multiWrite_oneMaster'\n#\n");
printf("# Num Objs Num Masters Objs/Master "
"Latency (us) Latency/Obj (us)\n");
printf("#--------------------------------------------------------"
"--------------------\n");
for (int objsPerMaster = 1; objsPerMaster <= maxObjsPerMaster;
objsPerMaster = (objsPerMaster < 10) ?
objsPerMaster + 1 : (objsPerMaster < 100) ?
objsPerMaster + 10 : (objsPerMaster < 1000) ?
objsPerMaster + 100 : objsPerMaster + 1000) {
double latency =
doMultiWrite(dataLength, keyLength, numMasters, objsPerMaster);
printf("%10d %14d %14d %14.1f %18.2f\n",
numMasters*objsPerMaster, numMasters, objsPerMaster,
1e06*latency, 1e06*latency/numMasters/objsPerMaster);
}
}
// This benchmark measures overall network bandwidth using many clients, each
// reading repeatedly a single large object on a different server. The goal
// is to stress the internal network switching fabric without overloading any
// particular client or server.
void
netBandwidth()
{
const char* key = "123456789012345678901234567890";
uint16_t keyLength = downCast<uint16_t>(strlen(key));
// Duration of the test, in ms.
int ms = 100;
if (clientIndex > 0) {
// Slaves execute the following code. First, wait for the master
// to set everything up, then open the table we will use.
char command[20];
getCommand(command, sizeof(command));
char tableName[20];
snprintf(tableName, sizeof(tableName), "table%d", clientIndex);
uint64_t tableId = cluster->getTableId(tableName);
RAMCLOUD_LOG(NOTICE, "Client %d reading from table %lu", clientIndex,
tableId);
setSlaveState("running");
// Read a value from the table repeatedly, and compute bandwidth.
Buffer value;
double latency = timeRead(tableId, key, keyLength, ms, value);
double bandwidth = value.size()/latency;
sendMetrics(bandwidth);
setSlaveState("done");
RAMCLOUD_LOG(NOTICE,
"Bandwidth (%u-byte object with %u-byte key): %.1f MB/sec",
value.size(), keyLength, bandwidth/(1024*1024));
return;
}
// The master executes the code below. First, create a table for each
// slave, with a single object.
int size = objectSize;
if (size < 0)
size = 1024*1024;
uint64_t* tableIds = createTables(numClients, objectSize, key, keyLength);
// Start all the slaves running, and read our own local object.
sendCommand("run", "running", 1, numClients-1);
RAMCLOUD_LOG(DEBUG, "Master reading from table %lu", tableIds[0]);
Buffer value;
double latency = timeRead(tableIds[0], key, keyLength, 100, value);
double bandwidth = (keyLength + value.size())/latency;
sendMetrics(bandwidth);
// Collect statistics.
ClientMetrics metrics;
getMetrics(metrics, numClients);
RAMCLOUD_LOG(DEBUG,
"Bandwidth (%u-byte object with %u-byte key): %.1f MB/sec",
value.size(), keyLength, bandwidth/(1024*1024));
printBandwidth("netBandwidth", sum(metrics[0]),
"many clients reading from different servers");
printBandwidth("netBandwidth.max", max(metrics[0]),
"fastest client");
printBandwidth("netBandwidth.min", min(metrics[0]),
"slowest client");
}
// Each client reads a single object from each master. Good for
// testing that each host in the cluster can send/receive RPCs
// from every other host.
void
readAllToAll()
{
const char* key = "123456789012345678901234567890";
uint16_t keyLength = downCast<uint16_t>(strlen(key));
if (clientIndex > 0) {
char command[20];
do {
getCommand(command, sizeof(command));
Cycles::sleep(10 * 1000);
} while (strcmp(command, "run") != 0);
setSlaveState("running");
for (int tableNum = 0; tableNum < numTables; ++tableNum) {
string tableName = format("table%d", tableNum);
try {
uint64_t tableId = cluster->getTableId(tableName.c_str());
Buffer result;
uint64_t startCycles = Cycles::rdtsc();
ReadRpc read(cluster, tableId, key, keyLength, &result);
while (!read.isReady()) {
context.dispatch->poll();
double secsWaiting =
Cycles::toSeconds(Cycles::rdtsc() - startCycles);
if (secsWaiting > 1.0) {
RAMCLOUD_LOG(ERROR,
"Client %d couldn't read from table %s",
clientIndex, tableName.c_str());
read.cancel();
continue;
}
}
read.wait();
} catch (ClientException& e) {
RAMCLOUD_LOG(ERROR,
"Client %d got exception reading from table %s: %s",
clientIndex, tableName.c_str(), e.what());
} catch (...) {
RAMCLOUD_LOG(ERROR,
"Client %d got unknown exception reading from table %s",
clientIndex, tableName.c_str());
}
}
setSlaveState("done");
return;
}
int size = objectSize;
if (size < 0)
size = 100;
uint64_t* tableIds = createTables(numTables, size, key, keyLength);
for (int i = 0; i < numTables; ++i) {
uint64_t tableId = tableIds[i];
Buffer result;
uint64_t startCycles = Cycles::rdtsc();
ReadRpc read(cluster, tableId, key, keyLength, &result);
while (!read.isReady()) {
context.dispatch->poll();
if (Cycles::toSeconds(Cycles::rdtsc() - startCycles) > 1.0) {
RAMCLOUD_LOG(ERROR,
"Master client %d couldn't read from tableId %lu",
clientIndex, tableId);
return;
}
}
read.wait();
}
for (int slaveIndex = 1; slaveIndex < numClients; ++slaveIndex) {
sendCommand("run", "running", slaveIndex);
// Give extra time if clients have to contact a lot of masters.
waitSlave(slaveIndex, "done", 1.0 + 0.1 * numTables);
}
delete[] tableIds;
}
// Read a single object many times, and compute a cumulative distribution
// of read times.
void
readDist()
{
if (clientIndex != 0)
return;
// Create an object to read, and verify its contents (this also
// loads all caches along the way).
const char* key = "123456789012345678901234567890";
uint16_t keyLength = downCast<uint16_t>(strlen(key));
Buffer input, value;
fillBuffer(input, objectSize, dataTable, key, keyLength);
cluster->write(dataTable, key, keyLength,
input.getRange(0, objectSize), objectSize);
cluster->read(dataTable, key, keyLength, &value);
checkBuffer(&value, 0, objectSize, dataTable, key, keyLength);
// Warmup, if desired
for (int i = 0; i < warmupCount; i++) {
cluster->read(dataTable, key, keyLength, &value);
}
// Issue the reads as quickly as possible, and save the times.
std::vector<uint64_t> ticks;
ticks.resize(count);
uint64_t start = Cycles::rdtsc();
for (int i = 0; i < count; i++) {
cluster->read(dataTable, key, keyLength, &value);
ticks[i] = Cycles::rdtsc();
}
// Output the times (several comma-separated values on each line).
int valuesInLine = 0;
for (int i = 0; i < count; i++) {
if (valuesInLine >= 10) {
valuesInLine = 0;
printf("\n");
}
if (valuesInLine != 0) {
printf(",");
}
double micros = Cycles::toSeconds(ticks[i] - start)*1.0e06;
printf("%.2f", micros);
valuesInLine++;
start = ticks[i];
}
printf("\n");
}
// Read randomly-chosen objects from a large table (so that there will be cache
// misses on the hash table and the object) and compute a cumulative
// distribution of read times.
void
readDistRandom()
{
int numKeys = 2000000;
#define BATCH_SIZE 500
if (clientIndex != 0)
return;
const uint16_t keyLength = 30;
char key[keyLength];
Buffer input, value;
// Initialize keys and values
MultiWriteObject** objects = new MultiWriteObject*[BATCH_SIZE];
char* keys = new char[BATCH_SIZE * keyLength];
memset(keys, 0, BATCH_SIZE * keyLength);
char* charValues = new char[BATCH_SIZE * objectSize];
memset(charValues, 0, BATCH_SIZE * objectSize);
int i, j;
uint64_t stopTime = Cycles::rdtsc() + Cycles::fromSeconds(10.0);
for (i = 0; i < numKeys; i++) {
if (Cycles::rdtsc() >= stopTime) {
// Limit the amount of time we spend filling the table, so the
// test doesn't time out.
numKeys = i;
LOG(NOTICE, "Limiting object count to %d", numKeys);
break;
}
j = i % BATCH_SIZE;
char* key = keys + j * keyLength;
char* value = charValues + j * objectSize;
*reinterpret_cast<uint64_t*>(key) = i;
genRandomString(value, objectSize);
objects[j] = new MultiWriteObject(dataTable, key, keyLength, value,
objectSize);
// Do the write and recycle the objects
if (j == BATCH_SIZE - 1) {
cluster->multiWrite(objects, BATCH_SIZE);
// Clean up the actual MultiWriteObjects
for (int k = 0; k < BATCH_SIZE; k++)
delete objects[k];
memset(keys, 0, BATCH_SIZE * keyLength);
memset(charValues, 0, BATCH_SIZE * objectSize);
}
}
// Do the last partial batch and clean up, if it exists.
j = i % BATCH_SIZE;
if (j < BATCH_SIZE - 1) {
cluster->multiWrite(objects, static_cast<uint32_t>(j));
// Clean up the actual MultiWriteObjects
for (int k = 0; k < j; k++)
delete objects[k];
}
delete[] keys;
delete[] charValues;
delete[] objects;
// Force serialization so that writing interferes less with the read
// benchmark.
Util::serialize();
// Issue the reads back-to-back, and save the times.
std::vector<uint64_t> ticks;
ticks.resize(count);
for (int i = 0; i < count; i++) {
// We generate the random number separately to avoid timing potential
// cache misses on the client side.
memset(key, 0, keyLength);
*reinterpret_cast<uint64_t*>(&key) = generateRandom() % numKeys;
// Do the benchmark
uint64_t start = Cycles::rdtsc();
cluster->read(dataTable, key, keyLength, &value);
ticks[i] = Cycles::rdtsc() - start;
}
// Dump cache traces. This amounts to almost a no-op if there are no
// traces, and we do not currently expect traces in production code.
cluster->objectServerControl(dataTable, key, keyLength,
WireFormat::LOG_TIME_TRACE);
// Output the times (several comma-separated values on each line).
int valuesInLine = 0;
for (int i = 0; i < count; i++) {
if (valuesInLine >= 10) {
valuesInLine = 0;
printf("\n");
}
if (valuesInLine != 0) {
printf(",");
}
double micros = Cycles::toSeconds(ticks[i])*1.0e06;
printf("%.2f", micros);
valuesInLine++;
}
printf("\n");
}
// This benchmark measures the latency and server throughput for reads
// when several clients are simultaneously reading the same object.
void
readLoaded()
{
const char* key = "123456789012345678901234567890";
uint16_t keyLength = downCast<uint16_t>(strlen(key));
if (clientIndex > 0) {
// Slaves execute the following code, which creates load by
// repeatedly reading a particular object.
while (true) {
char command[20];
char doc[200];
getCommand(command, sizeof(command));
if (strcmp(command, "run") == 0) {
string controlKey = keyVal(0, "doc");
readObject(controlTable, controlKey.c_str(),
downCast<uint16_t>(controlKey.length()),
doc, sizeof(doc));
setSlaveState("running");
// Although the main purpose here is to generate load, we
// also measure performance, which can be checked to ensure
// that all clients are seeing roughly the same performance.
// Only measure performance when the size of the object is
// nonzero (this indicates that all clients are active)
uint64_t start = 0;
Buffer buffer;
int count = 0;
int size = 0;
while (true) {
cluster->read(dataTable, key, keyLength, &buffer);
int currentSize = buffer.size();
if (currentSize != 0) {
if (start == 0) {
start = Cycles::rdtsc();
size = currentSize;
}
count++;
} else {
if (start != 0)
break;
}
}
RAMCLOUD_LOG(NOTICE, "Average latency (object size %d, "
"key size %u): %.1fus (%s)", size, keyLength,
Cycles::toSeconds(Cycles::rdtsc() - start)*1e06/count,
doc);
setSlaveState("idle");
} else if (strcmp(command, "done") == 0) {
setSlaveState("done");
return;
} else {
RAMCLOUD_LOG(ERROR, "unknown command %s", command);
return;
}
}
}
// The master executes the following code, which starts up zero or more
// slaves to generate load, then times the performance of reading.
int size = objectSize;
if (size < 0)
size = 100;
printf("# RAMCloud read performance as a function of load (1 or more\n");
printf("# clients all reading a single %d-byte object with %d-byte key\n"
"# repeatedly).\n", size, keyLength);
printf("# Generated by 'clusterperf.py readLoaded'\n");
printf("#\n");
printf("# numClients readLatency(us) throughput(total kreads/sec)\n");
printf("#----------------------------------------------------------\n");
for (int numSlaves = 0; numSlaves < numClients; numSlaves++) {
char message[100];
Buffer input, output;
snprintf(message, sizeof(message), "%d active clients", numSlaves+1);
string controlKey = keyVal(0, "doc");
cluster->write(controlTable, controlKey.c_str(),
downCast<uint16_t>(controlKey.length()),
message);
cluster->write(dataTable, key, keyLength, "");
sendCommand("run", "running", 1, numSlaves);
fillBuffer(input, size, dataTable, key, keyLength);
cluster->write(dataTable, key, keyLength,
input.getRange(0, size), size);
double t = timeRead(dataTable, key, keyLength, 100, output);
cluster->write(dataTable, key, keyLength, "");
checkBuffer(&output, 0, size, dataTable, key, keyLength);
printf("%5d %10.1f %8.0f\n", numSlaves+1, t*1e06,
(numSlaves+1)/(1e03*t));
sendCommand(NULL, "idle", 1, numSlaves);
}
sendCommand("done", "done", 1, numClients-1);
}
// Read an object that doesn't exist. This excercises some exception paths that
// are supposed to be fast. This comes up, for example, in workloads in which a
// RAMCloud is used as a cache with frequent cache misses.
void
readNotFound()
{
if (clientIndex != 0)
return;
uint64_t runCycles = Cycles::fromSeconds(.1);
// Similar to timeRead but catches the exception
uint64_t start = Cycles::rdtsc();
uint64_t elapsed;
int count = 0;
while (true) {
for (int i = 0; i < 10; i++) {
Buffer output;
try {
cluster->read(dataTable, "55", 2, &output);
} catch (const ObjectDoesntExistException& e) {
continue;
}
throw Exception(HERE, "Object exists?");
}
count += 10;
elapsed = Cycles::rdtsc() - start;
if (elapsed >= runCycles)
break;
}
double t = Cycles::toSeconds(elapsed)/count;
printTime("readNotFound", t, "read object that doesn't exist");
}
/**
* This method contains the core of the "readRandom" test; it is
* shared by the master and slaves.
*
* \param tableIds
* Array of numTables identifiers for the tables available for
* the test.
* \param docString
* Information provided by the master about this run; used
* in log messages.
*/
void readRandomCommon(uint64_t *tableIds, char *docString)
{
// Duration of test.
double ms = 100;
uint64_t startTime = Cycles::rdtsc();
uint64_t endTime = startTime + Cycles::fromSeconds(ms/1e03);
uint64_t slowTicks = Cycles::fromSeconds(10e-06);
uint64_t readStart, readEnd;
uint64_t maxLatency = 0;
int count = 0;
int slowReads = 0;
const char* key = "123456789012345678901234567890";
uint16_t keyLength = downCast<uint16_t>(strlen(key));
// Each iteration through this loop issues one read operation to a
// randomly-selected table.
while (true) {
uint64_t tableId = tableIds[generateRandom() % numTables];
readStart = Cycles::rdtsc();
Buffer value;
cluster->read(tableId, key, keyLength, &value);
readEnd = Cycles::rdtsc();
count++;
uint64_t latency = readEnd - readStart;
// When computing the slowest read, skip the first reads so that
// everything has a chance to get fully warmed up.
if ((latency > maxLatency) && (count > 100))
maxLatency = latency;
if (latency > slowTicks)
slowReads++;
if (readEnd > endTime)
break;
}
double thruput = count/Cycles::toSeconds(readEnd - startTime);
double slowPercent = 100.0 * slowReads / count;
sendMetrics(thruput, Cycles::toSeconds(maxLatency), slowPercent);
if (clientIndex != 0) {
RAMCLOUD_LOG(NOTICE,
"%s: throughput: %.1f reads/sec., max latency: %.1fus, "
"reads > 20us: %.1f%%", docString,
thruput, Cycles::toSeconds(maxLatency)*1e06, slowPercent);
}
}
// In this test all of the clients repeatedly read objects from a collection
// of tables on different servers. For each read a client chooses a table
// at random.
void
readRandom()
{
uint64_t *tableIds = NULL;
if (clientIndex > 0) {
// This is a slave: execute commands coming from the master.
while (true) {
char command[20];
char doc[200];
getCommand(command, sizeof(command));
if (strcmp(command, "run") == 0) {
if (tableIds == NULL) {
// Open all the tables.
tableIds = new uint64_t[numTables];
for (int i = 0; i < numTables; i++) {
char tableName[20];
snprintf(tableName, sizeof(tableName), "table%d", i);
tableIds[i] = cluster->getTableId(tableName);
}
}
string controlKey = keyVal(0, "doc");
readObject(controlTable, controlKey.c_str(),
downCast<uint16_t>(controlKey.length()), doc,
sizeof(doc));
setSlaveState("running");
readRandomCommon(tableIds, doc);
setSlaveState("idle");
} else if (strcmp(command, "done") == 0) {
setSlaveState("done");
return;
} else {
RAMCLOUD_LOG(ERROR, "unknown command %s", command);
return;
}
}
}
// This is the master: first, create the tables.
int size = objectSize;
if (size < 0)
size = 100;
const char* key = "123456789012345678901234567890";
uint16_t keyLength = downCast<uint16_t>(strlen(key));
tableIds = createTables(numTables, size, key, keyLength);
// Vary the number of clients and repeat the test for each number.
printf("# RAMCloud read performance when 1 or more clients read\n");
printf("# %d-byte objects with %u-byte keys chosen at random from\n"
"# %d servers.\n", size, keyLength, numTables);
printf("# Generated by 'clusterperf.py readRandom'\n");
printf("#\n");
printf("# numClients throughput(total kreads/sec) slowest(ms) "
"reads > 10us\n");
printf("#--------------------------------------------------------"
"------------\n");
fflush(stdout);
for (int numActive = 1; numActive <= numClients; numActive++) {
char doc[100];
snprintf(doc, sizeof(doc), "%d active clients", numActive);
string key = keyVal(0, "doc");
cluster->write(controlTable, key.c_str(),
downCast<uint16_t>(key.length()), doc);
sendCommand("run", "running", 1, numActive-1);
readRandomCommon(tableIds, doc);
sendCommand(NULL, "idle", 1, numActive-1);
ClientMetrics metrics;
getMetrics(metrics, numActive);
printf("%3d %6.0f %6.2f"
" %.1f%%\n",
numActive, sum(metrics[0])/1e03, max(metrics[1])*1e03,
sum(metrics[2])/numActive);
fflush(stdout);
}
sendCommand("done", "done", 1, numClients-1);
}
/**
* This method implements the client-0 (master) functionality for both
* readThroughput and multiReadThroughput.
* \param numObjects
* Number of objects to create in the table.
* \param size
* Size of each object, in bytes.
* \param keyLength
* Size of keys, in bytes.
*/
void
readThroughputMaster(int numObjects, int size, uint16_t keyLength)
{
// This is the master client. Fill in the table, then measure
// throughput while gradually increasing the number of workers.
printf("#\n");
printf("# numClients throughput worker utiliz.\n");
printf("# (kreads/sec)\n");
printf("#-------------------------------------------\n");
fillTable(dataTable, numObjects, keyLength, size);
for (int numSlaves = 1; numSlaves < numClients; numSlaves++) {
sendCommand("run", "running", numSlaves, 1);
Buffer statsBuffer;
cluster->objectServerControl(dataTable, "abc", 3,
WireFormat::ControlOp::GET_PERF_STATS, NULL, 0,
&statsBuffer);
PerfStats startStats = *statsBuffer.getStart<PerfStats>();
Cycles::sleep(1000000);
cluster->objectServerControl(dataTable, "abc", 3,
WireFormat::ControlOp::GET_PERF_STATS, NULL, 0,
&statsBuffer);
PerfStats finishStats = *statsBuffer.getStart<PerfStats>();
double elapsedTime = static_cast<double>(finishStats.collectionTime -
startStats.collectionTime)/ finishStats.cyclesPerSecond;
double rate = static_cast<double>(finishStats.readCount -
startStats.readCount) / elapsedTime;
double utilization = static_cast<double>(finishStats.activeCycles -
startStats.activeCycles) / static_cast<double>(
finishStats.collectionTime - startStats.collectionTime);
printf("%5d %8.0f %8.3f\n", numSlaves, rate/1e03,
utilization);
}
cluster->objectServerControl(dataTable, "abc", 3,
WireFormat::ControlOp::LOG_TIME_TRACE);
sendCommand("done", "done", 1, numClients-1);
}
// This benchmark measures total throughput of a single server (in objects
// read per second) under a workload consisting of individual random object
// reads.
void
readThroughput()
{
const uint16_t keyLength = 30;
const int numObjects = 2000000;
if (clientIndex == 0) {
// This is the master client.
int size = objectSize;
if (size < 0)
size = 100;
printf("# RAMCloud read throughput of a single server with a varying\n"
"# number of clients issuing individual reads on randomly\n"
"# chosen %d-byte objects with %d-byte keys\n",
size, keyLength);
printf("# Generated by 'clusterperf.py readThroughput'\n");
readThroughputMaster(numObjects, size, keyLength);
} else {
// Slaves execute the following code, which creates load by
// issuing individual reads.
bool running = false;
uint64_t startTime;
int objectsRead;
while (true) {
char command[20];
if (running) {
// Write out some statistics for debugging.
double totalTime = Cycles::toSeconds(Cycles::rdtsc()
- startTime);
double rate = objectsRead/totalTime;
RAMCLOUD_LOG(NOTICE, "Read rate: %.1f kobjects/sec",
rate/1e03);
}
getCommand(command, sizeof(command), false);
if (strcmp(command, "run") == 0) {
if (!running) {
setSlaveState("running");
running = true;
RAMCLOUD_LOG(NOTICE,
"Starting readThroughput benchmark");
}
// Perform reads for a second (then check to see
// if the experiment is over).
startTime = Cycles::rdtsc();
objectsRead = 0;
uint64_t checkTime = startTime + Cycles::fromSeconds(1.0);
do {
char key[keyLength];
Buffer value;
makeKey(downCast<int>(generateRandom() % numObjects),
keyLength, key);
cluster->read(dataTable, key, keyLength, &value);
++objectsRead;
} while (Cycles::rdtsc() < checkTime);
} else if (strcmp(command, "done") == 0) {
setSlaveState("done");
RAMCLOUD_LOG(NOTICE, "Ending readThroughput benchmark");
return;
} else {
RAMCLOUD_LOG(ERROR, "unknown command %s", command);
return;
}
}
}
}
// Read times for 100B objects with string keys of different lengths.
void
readVaryingKeyLength()
{
if (clientIndex != 0)
return;
Buffer input, output;
uint16_t keyLengths[] = {
1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50,
55, 60, 65, 70, 75, 80, 85, 90, 95, 100,
200, 300, 400, 500, 600, 700, 800, 900, 1000,
2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000,
20000, 30000, 40000, 50000, 60000
};
int dataLength = 100;
printf("# RAMCloud read performance for %u B objects\n", dataLength);
printf("# with keys of various lengths.\n");
printf("# Generated by 'clusterperf.py readVaryingKeyLength'\n#\n");
printf("# Key Length Latency (us) Bandwidth (MB/s)\n");
printf("#--------------------------------------------------------"
"--------------------\n");
foreach (uint16_t keyLength, keyLengths) {
char key[keyLength];
genRandomString(key, keyLength);
fillBuffer(input, dataLength, dataTable, key, keyLength);
cluster->write(dataTable, key, keyLength,
input.getRange(0, dataLength), dataLength);
double t = readDist(dataTable, key, keyLength, 1000, 1.0, output).p50;
checkBuffer(&output, 0, dataLength, dataTable, key, keyLength);
printf("%12u %16.1f %19.1f\n", keyLength, 1e06*t,
((keyLength + dataLength) / t)/(1024.0*1024.0));
}
}
// Write times for 100B objects with string keys of different lengths.
void
writeVaryingKeyLength()
{
if (clientIndex != 0)
return;
Buffer input, output;
uint16_t keyLengths[] = {
1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50,
55, 60, 65, 70, 75, 80, 85, 90, 95, 100,
200, 300, 400, 500, 600, 700, 800, 900, 1000,
2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000,
20000, 30000, 40000, 50000, 60000
};
int dataLength = 100;
printf("# RAMCloud write performance for %u B objects\n", dataLength);
printf("# with keys of various lengths.\n");
printf("# Generated by 'clusterperf.py writeVaryingKeyLength'\n#\n");
printf("# Key Length Latency (us) Bandwidth (MB/s)\n");
printf("#--------------------------------------------------------"
"--------------------\n");
foreach (uint16_t keyLength, keyLengths) {
char key[keyLength];
genRandomString(key, keyLength);
fillBuffer(input, dataLength, dataTable, key, keyLength);
cluster->write(dataTable, key, keyLength,
input.getRange(0, dataLength), dataLength);
TimeDist dist = writeDist(dataTable, key, keyLength,
input.getRange(0, dataLength), dataLength, 1000, 1.0);
Buffer output;
cluster->read(dataTable, key, keyLength, &output);
checkBuffer(&output, 0, dataLength, dataTable, key, keyLength);
printf("%12u %16.1f %19.1f\n", keyLength, 1e06*dist.p50,
((keyLength+dataLength) / dist.p50)/(1024.0*1024.0));
}
}
// This benchmark measures the latency and server throughput for write
// when some data is written asynchronously and then some smaller value
// is written synchronously.
void
writeAsyncSync()
{
if (clientIndex > 0)
return;
const uint32_t count = 100;
const uint32_t syncObjectSize = 100;
const uint32_t asyncObjectSizes[] = { 100, 1000, 10000, 100000, 1000000 };
const uint32_t arrayElts = static_cast<uint32_t>
(sizeof32(asyncObjectSizes) /
sizeof32(asyncObjectSizes[0]));
uint32_t maxSize = syncObjectSize;
for (uint32_t j = 0; j < arrayElts; ++j)
maxSize = std::max(maxSize, asyncObjectSizes[j]);
char* garbage = new char[maxSize];
const char* key = "123456789012345678901234567890";
uint16_t keyLength = downCast<uint16_t>(strlen(key));
// prime
cluster->write(dataTable, key, keyLength, &garbage[0], syncObjectSize);
cluster->write(dataTable, key, keyLength, &garbage[0], syncObjectSize);
printf("# Gauges impact of asynchronous writes on synchronous writes.\n"
"# Write two values. The size of the first varies over trials\n"
"# (its size is given as 'firstObjectSize'). The first write is\n"
"# either synchronous (if firstWriteIsSync is 1) or asynchronous\n"
"# (if firstWriteIsSync is 0). The response time of the first\n"
"# write is given by 'firstWriteLatency'. The second write is\n"
"# a %u B object which is always written synchronously (its \n"
"# response time is given by 'syncWriteLatency'\n"
"# Both writes use a %u B key.\n"
"# Generated by 'clusterperf.py writeAsyncSync'\n#\n"
"# firstWriteIsSync firstObjectSize firstWriteLatency(us) "
"syncWriteLatency(us)\n"
"#--------------------------------------------------------"
"--------------------\n",
syncObjectSize, keyLength);
for (int sync = 0; sync < 2; ++sync) {
for (uint32_t j = 0; j < arrayElts; ++j) {
const uint32_t asyncObjectSize = asyncObjectSizes[j];
uint64_t asyncTicks = 0;
uint64_t syncTicks = 0;
for (uint32_t i = 0; i < count; ++i) {
{
CycleCounter<> _(&asyncTicks);
cluster->write(dataTable, key, keyLength, &garbage[0],
asyncObjectSize, NULL, NULL, !sync);
}
{
CycleCounter<> _(&syncTicks);
cluster->write(dataTable, key, keyLength, &garbage[0],
syncObjectSize);
}
}
printf("%18d %15u %21.1f %20.1f\n", sync, asyncObjectSize,
Cycles::toSeconds(asyncTicks) * 1e6 / count,
Cycles::toSeconds(syncTicks) * 1e6 / count);
}
}
delete garbage;
}
// The following struct and table define each performance test in terms of
// a string name and a function that implements the test.
struct TestInfo {
const char* name; // Name of the performance test; this is
// what gets typed on the command line to
// run the test.
void (*func)(); // Function that implements the test.
};
TestInfo tests[] = {
{"basic", basic},
{"broadcast", broadcast},
{"indexBasic", indexBasic},
{"indexMultiple", indexMultiple},
{"indexScalability", indexScalability},
{"multiWrite_oneMaster", multiWrite_oneMaster},
{"multiRead_oneMaster", multiRead_oneMaster},
{"multiRead_oneObjectPerMaster", multiRead_oneObjectPerMaster},
{"multiRead_general", multiRead_general},
{"multiRead_generalRandom", multiRead_generalRandom},
{"multiReadThroughput", multiReadThroughput},
{"netBandwidth", netBandwidth},
{"readAllToAll", readAllToAll},
{"readDist", readDist},
{"readDistRandom", readDistRandom},
{"readLoaded", readLoaded},
{"readNotFound", readNotFound},
{"readRandom", readRandom},
{"readThroughput", readThroughput},
{"readVaryingKeyLength", readVaryingKeyLength},
{"writeVaryingKeyLength", writeVaryingKeyLength},
{"writeAsyncSync", writeAsyncSync},
};
int
main(int argc, char *argv[])
try
{
// Parse command-line options.
vector<string> testNames;
string coordinatorLocator, logFile;
string logLevel("NOTICE");
po::options_description desc(
"Usage: ClusterPerf [options] testName testName ...\n\n"
"Runs one or more benchmarks on a RAMCloud cluster and outputs\n"
"performance information. This program is not normally invoked\n"
"directly; it is invoked by the clusterperf script.\n\n"
"Allowed options:");
desc.add_options()
("clientIndex", po::value<int>(&clientIndex)->default_value(0),
"Index of this client (first client is 0)")
("coordinator,C", po::value<string>(&coordinatorLocator),
"Service locator for the cluster coordinator (required)")
("count,c", po::value<int>(&count)->default_value(100000),
"Number of times to invoke operation for test")
("logFile", po::value<string>(&logFile),
"Redirect all output to this file")
("logLevel,l", po::value<string>(&logLevel)->default_value("NOTICE"),
"Print log messages only at this severity level or higher "
"(ERROR, WARNING, NOTICE, DEBUG)")
("help,h", "Print this help message")
("numClients", po::value<int>(&numClients)->default_value(1),
"Total number of clients running")
("size,s", po::value<int>(&objectSize)->default_value(100),
"Size of objects (in bytes) to use for test")
("numTables", po::value<int>(&numTables)->default_value(10),
"Number of tables to use for test")
("testName", po::value<vector<string>>(&testNames),
"Name(s) of test(s) to run")
("warmup", po::value<int>(&warmupCount)->default_value(100),
"Number of times to invoke operation before beginning "
"measurements")
("numIndexlet", po::value<int>(&numIndexlet)->default_value(1),
"number of Indexlets")
("numIndexes", po::value<int>(&numIndexes)->default_value(1),
"number of secondary keys per object");
po::positional_options_description desc2;
desc2.add("testName", -1);
po::variables_map vm;
po::store(po::command_line_parser(argc, argv).
options(desc).positional(desc2).run(), vm);
po::notify(vm);
if (logFile.size() != 0) {
// Redirect both stdout and stderr to the log file. Don't
// call logger.setLogFile, since that will not affect printf
// calls.
FILE* f = fopen(logFile.c_str(), "w");
if (f == NULL) {
RAMCLOUD_LOG(ERROR, "couldn't open log file '%s': %s",
logFile.c_str(), strerror(errno));
exit(1);
}
stdout = stderr = f;
}
Logger::get().setLogLevels(logLevel);
if (vm.count("help")) {
std::cout << desc << '\n';
exit(0);
}
if (coordinatorLocator.empty()) {
RAMCLOUD_LOG(ERROR, "missing required option --coordinator");
exit(1);
}
RamCloud r(&context, coordinatorLocator.c_str());
cluster = &r;
cluster->createTable("data");
dataTable = cluster->getTableId("data");
cluster->createTable("control");
controlTable = cluster->getTableId("control");
if (testNames.size() == 0) {
// No test names specified; run all tests.
foreach (TestInfo& info, tests) {
info.func();
}
} else {
// Run only the tests that were specified on the command line.
foreach (string& name, testNames) {
bool foundTest = false;
foreach (TestInfo& info, tests) {
if (name.compare(info.name) == 0) {
foundTest = true;
info.func();
break;
}
}
if (!foundTest) {
printf("No test named '%s'\n", name.c_str());
}
}
}
}
catch (std::exception& e) {
RAMCLOUD_LOG(ERROR, "%s", e.what());
exit(1);
}
| 36.467055 | 80 | 0.585784 | IMCG |
6b54c3afcc8529415bd995c841d21f600f768a2b | 552 | cc | C++ | string/1047.cc | MingfeiPan/leetcode | 55dc878cfb7b15a34252410ae7420a656da604f8 | [
"Apache-2.0"
] | null | null | null | string/1047.cc | MingfeiPan/leetcode | 55dc878cfb7b15a34252410ae7420a656da604f8 | [
"Apache-2.0"
] | null | null | null | string/1047.cc | MingfeiPan/leetcode | 55dc878cfb7b15a34252410ae7420a656da604f8 | [
"Apache-2.0"
] | null | null | null | class Solution {
public:
string removeDuplicates(string s) {
int index = 0;
while (!s.empty() && index < (s.size()-1)) {
if (s[index] == s[index+1]) {
if ((index+2) < s.size()) {
s = s.substr(0, index) + s.substr(index+2);
} else {
s = s.substr(0, index);
}
if (index > 0)
--index;
} else {
++index;
}
}
return s;
}
};
| 25.090909 | 71 | 0.327899 | MingfeiPan |
6b568e5c6693776854d166f9a265e3bdde0ab282 | 79 | hpp | C++ | std/cstdio.hpp | mapsme/travelguide | 26dd50b93f55ef731175c19d12514da5bace9fa4 | [
"Apache-2.0"
] | 61 | 2015-12-05T19:34:20.000Z | 2021-06-25T09:07:09.000Z | std/cstdio.hpp | mapsme/travelguide | 26dd50b93f55ef731175c19d12514da5bace9fa4 | [
"Apache-2.0"
] | 9 | 2016-02-19T23:22:20.000Z | 2017-01-03T18:41:04.000Z | std/cstdio.hpp | mapsme/travelguide | 26dd50b93f55ef731175c19d12514da5bace9fa4 | [
"Apache-2.0"
] | 35 | 2015-12-17T00:09:14.000Z | 2021-01-27T10:47:11.000Z | #pragma once
#include <cstdio>
#define fseek64 fseeko
#define ftell64 ftello
| 11.285714 | 22 | 0.772152 | mapsme |
6b579f458a33197559c108f4151b21ae7ffbd13d | 6,103 | hpp | C++ | include/System/IO/Compression/Crc32Helper.hpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | include/System/IO/Compression/Crc32Helper.hpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | include/System/IO/Compression/Crc32Helper.hpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | // Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
#include "beatsaber-hook/shared/utils/byref.hpp"
#include "beatsaber-hook/shared/utils/typedefs-array.hpp"
// Completed includes
// Type namespace: System.IO.Compression
namespace System::IO::Compression {
// Forward declaring type: Crc32Helper
class Crc32Helper;
}
#include "beatsaber-hook/shared/utils/il2cpp-type-check.hpp"
NEED_NO_BOX(::System::IO::Compression::Crc32Helper);
DEFINE_IL2CPP_ARG_TYPE(::System::IO::Compression::Crc32Helper*, "System.IO.Compression", "Crc32Helper");
// Type namespace: System.IO.Compression
namespace System::IO::Compression {
// Size: 0x10
#pragma pack(push, 1)
// Autogenerated type: System.IO.Compression.Crc32Helper
// [TokenAttribute] Offset: FFFFFFFF
class Crc32Helper : public ::Il2CppObject {
public:
// Get static field: static private readonly System.UInt32[] s_crcTable_0
static ::ArrayW<uint> _get_s_crcTable_0();
// Set static field: static private readonly System.UInt32[] s_crcTable_0
static void _set_s_crcTable_0(::ArrayW<uint> value);
// Get static field: static private readonly System.UInt32[] s_crcTable_1
static ::ArrayW<uint> _get_s_crcTable_1();
// Set static field: static private readonly System.UInt32[] s_crcTable_1
static void _set_s_crcTable_1(::ArrayW<uint> value);
// Get static field: static private readonly System.UInt32[] s_crcTable_2
static ::ArrayW<uint> _get_s_crcTable_2();
// Set static field: static private readonly System.UInt32[] s_crcTable_2
static void _set_s_crcTable_2(::ArrayW<uint> value);
// Get static field: static private readonly System.UInt32[] s_crcTable_3
static ::ArrayW<uint> _get_s_crcTable_3();
// Set static field: static private readonly System.UInt32[] s_crcTable_3
static void _set_s_crcTable_3(::ArrayW<uint> value);
// Get static field: static private readonly System.UInt32[] s_crcTable_4
static ::ArrayW<uint> _get_s_crcTable_4();
// Set static field: static private readonly System.UInt32[] s_crcTable_4
static void _set_s_crcTable_4(::ArrayW<uint> value);
// Get static field: static private readonly System.UInt32[] s_crcTable_5
static ::ArrayW<uint> _get_s_crcTable_5();
// Set static field: static private readonly System.UInt32[] s_crcTable_5
static void _set_s_crcTable_5(::ArrayW<uint> value);
// Get static field: static private readonly System.UInt32[] s_crcTable_6
static ::ArrayW<uint> _get_s_crcTable_6();
// Set static field: static private readonly System.UInt32[] s_crcTable_6
static void _set_s_crcTable_6(::ArrayW<uint> value);
// Get static field: static private readonly System.UInt32[] s_crcTable_7
static ::ArrayW<uint> _get_s_crcTable_7();
// Set static field: static private readonly System.UInt32[] s_crcTable_7
static void _set_s_crcTable_7(::ArrayW<uint> value);
// static private System.Void .cctor()
// Offset: 0x111B628
static void _cctor();
// static public System.UInt32 UpdateCrc32(System.UInt32 crc32, System.Byte[] buffer, System.Int32 offset, System.Int32 length)
// Offset: 0x111AD1C
static uint UpdateCrc32(uint crc32, ::ArrayW<uint8_t> buffer, int offset, int length);
// static private System.UInt32 ManagedCrc32(System.UInt32 crc32, System.Byte[] buffer, System.Int32 offset, System.Int32 length)
// Offset: 0x111B2C4
static uint ManagedCrc32(uint crc32, ::ArrayW<uint8_t> buffer, int offset, int length);
}; // System.IO.Compression.Crc32Helper
#pragma pack(pop)
}
#include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp"
// Writing MetadataGetter for method: System::IO::Compression::Crc32Helper::_cctor
// Il2CppName: .cctor
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (*)()>(&System::IO::Compression::Crc32Helper::_cctor)> {
static const MethodInfo* get() {
return ::il2cpp_utils::FindMethod(classof(System::IO::Compression::Crc32Helper*), ".cctor", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{});
}
};
// Writing MetadataGetter for method: System::IO::Compression::Crc32Helper::UpdateCrc32
// Il2CppName: UpdateCrc32
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint (*)(uint, ::ArrayW<uint8_t>, int, int)>(&System::IO::Compression::Crc32Helper::UpdateCrc32)> {
static const MethodInfo* get() {
static auto* crc32 = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* buffer = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Byte"), 1)->byval_arg;
static auto* offset = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg;
static auto* length = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::IO::Compression::Crc32Helper*), "UpdateCrc32", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{crc32, buffer, offset, length});
}
};
// Writing MetadataGetter for method: System::IO::Compression::Crc32Helper::ManagedCrc32
// Il2CppName: ManagedCrc32
template<>
struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<uint (*)(uint, ::ArrayW<uint8_t>, int, int)>(&System::IO::Compression::Crc32Helper::ManagedCrc32)> {
static const MethodInfo* get() {
static auto* crc32 = &::il2cpp_utils::GetClassFromName("System", "UInt32")->byval_arg;
static auto* buffer = &il2cpp_functions::array_class_get(::il2cpp_utils::GetClassFromName("System", "Byte"), 1)->byval_arg;
static auto* offset = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg;
static auto* length = &::il2cpp_utils::GetClassFromName("System", "Int32")->byval_arg;
return ::il2cpp_utils::FindMethod(classof(System::IO::Compression::Crc32Helper*), "ManagedCrc32", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{crc32, buffer, offset, length});
}
};
| 59.252427 | 196 | 0.729805 | RedBrumbler |
6b5886f37a33bfc263dab3178b586b62373416bd | 20,060 | cpp | C++ | lib/Basics/skip-list.cpp | morsdatum/ArangoDB | 9cfc6d5cd50b8f451ebdedd77e2c5257fa72a573 | [
"Apache-2.0"
] | null | null | null | lib/Basics/skip-list.cpp | morsdatum/ArangoDB | 9cfc6d5cd50b8f451ebdedd77e2c5257fa72a573 | [
"Apache-2.0"
] | null | null | null | lib/Basics/skip-list.cpp | morsdatum/ArangoDB | 9cfc6d5cd50b8f451ebdedd77e2c5257fa72a573 | [
"Apache-2.0"
] | null | null | null | ////////////////////////////////////////////////////////////////////////////////
/// @brief generic skip list implementation
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2014 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Max Neunhoeffer
/// @author Copyright 2014, ArangoDB GmbH, Cologne, Germany
/// @author Copyright 2013-2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
#include "Basics/random.h"
#include "skip-list.h"
using namespace triagens::basics;
// -----------------------------------------------------------------------------
// --SECTION-- SKIP LIST
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// --SECTION-- private functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @brief randomHeight, select a node height randomly
////////////////////////////////////////////////////////////////////////////////
static int randomHeight (void) {
int height = 1;
int count;
while (true) { // will be left by return when the right height is found
uint32_t r = TRI_UInt32Random();
for (count = 32; count > 0; count--) {
if (0 != (r & 1UL) || height == TRI_SKIPLIST_MAX_HEIGHT) return height;
r = r >> 1;
height++;
}
}
}
////////////////////////////////////////////////////////////////////////////////
/// @brief Allocation function for a node. If height is 0, then a
/// random height is taken.
////////////////////////////////////////////////////////////////////////////////
SkipListNode* SkipList::allocNode (int height) {
SkipListNode* newNode = new SkipListNode();
newNode->_doc = nullptr;
if (0 == height) {
newNode->_height = randomHeight();
}
else {
newNode->_height = height;
}
try {
newNode->_next = new SkipListNode*[newNode->_height];
}
catch (...) {
delete newNode;
throw;
}
for (int i = 0; i < newNode->_height; i++) {
newNode->_next[i] = nullptr;
}
newNode->_prev = nullptr;
_memoryUsed += sizeof(SkipListNode) +
sizeof(SkipListNode*) * newNode->_height;
return newNode;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief Free function for a node.
////////////////////////////////////////////////////////////////////////////////
void SkipList::freeNode (SkipListNode* node) {
// update memory usage
_memoryUsed -= sizeof(SkipListNode) +
sizeof(SkipListNode*) * node->_height;
delete[] node->_next;
delete node;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief lookupLess
/// The following function is the main search engine for our skiplists.
/// It is used in the insertion and removal functions. See below for
/// a tiny variation which is used in the right lookup function.
/// This function does the following:
/// The skiplist sl is searched for the largest document m that is less
/// than doc. It uses preorder comparison if cmp is SKIPLIST_CMP_PREORDER
/// and proper order comparison if cmp is SKIPLIST_CMP_TOTORDER. At the end,
/// (*pos)[0] points to the node containing m and *next points to the
/// node following (*pos)[0], or is nullptr if there is no such node. The
/// array *pos contains for each level lev in 0.._start->_height-1
/// at (*pos)[lev] the pointer to the node that contains the largest
/// document that is less than doc amongst those nodes that have height >
/// lev.
////////////////////////////////////////////////////////////////////////////////
int SkipList::lookupLess (void* doc,
SkipListNode* (*pos)[TRI_SKIPLIST_MAX_HEIGHT],
SkipListNode** next,
SkipListCmpType cmptype) const {
int lev;
int cmp = 0; // just in case to avoid undefined values
SkipListNode* cur;
cur = _start;
for (lev = _start->_height-1; lev >= 0; lev--) {
while (true) { // will be left by break
*next = cur->_next[lev];
if (nullptr == *next) {
break;
}
cmp = _cmp_elm_elm(_cmpdata, (*next)->_doc, doc, cmptype);
if (cmp >= 0) {
break;
}
cur = *next;
}
(*pos)[lev] = cur;
}
// Now cur == (*pos)[0] points to the largest node whose document
// is less than doc. *next is the next node and can be nullptr if there
// is none.
return cmp;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief lookupLessOrEq
/// The following function is nearly as LookupScript above, but
/// finds the largest document m that is less than or equal to doc.
/// It uses preorder comparison if cmp is SKIPLIST_CMP_PREORDER
/// and proper order comparison if cmp is SKIPLIST_CMP_TOTORDER. At the end,
/// (*pos)[0] points to the node containing m and *next points to the
/// node following (*pos)[0], or is nullptr if there is no such node. The
/// array *pos contains for each level lev in 0.._start->_height-1
/// at (*pos)[lev] the pointer to the node that contains the largest
/// document that is less than or equal to doc amongst those nodes
/// that have height > lev.
////////////////////////////////////////////////////////////////////////////////
int SkipList::lookupLessOrEq (void* doc,
SkipListNode* (*pos)[TRI_SKIPLIST_MAX_HEIGHT],
SkipListNode** next,
SkipListCmpType cmptype) const {
int lev;
int cmp = 0; // just in case to avoid undefined values
SkipListNode* cur;
cur = _start;
for (lev = _start->_height-1; lev >= 0; lev--) {
while (true) { // will be left by break
*next = cur->_next[lev];
if (nullptr == *next) {
break;
}
cmp = _cmp_elm_elm(_cmpdata, (*next)->_doc, doc, cmptype);
if (cmp > 0) {
break;
}
cur = *next;
}
(*pos)[lev] = cur;
}
// Now cur == (*pos)[0] points to the largest node whose document
// is less than or equal to doc. *next is the next node and can be nullptr
// is if there none.
return cmp;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief lookupKeyLess
/// We have two more very similar functions which look up documents if
/// only a key is given. This implies using the cmp_key_elm function
/// and using the preorder only. Otherwise, they behave identically
/// as the two previous ones.
////////////////////////////////////////////////////////////////////////////////
int SkipList::lookupKeyLess (void* key,
SkipListNode* (*pos)[TRI_SKIPLIST_MAX_HEIGHT],
SkipListNode** next) const {
int lev;
int cmp = 0; // just in case to avoid undefined values
SkipListNode* cur;
cur = _start;
for (lev = _start->_height-1; lev >= 0; lev--) {
while (true) { // will be left by break
*next = cur->_next[lev];
if (nullptr == *next) {
break;
}
cmp = _cmp_key_elm(_cmpdata, key, (*next)->_doc);
if (cmp <= 0) {
break;
}
cur = *next;
}
(*pos)[lev] = cur;
}
// Now cur == (*pos)[0] points to the largest node whose document is
// less than key in the preorder. *next is the next node and can be
// nullptr if there is none.
return cmp;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief lookupKeyLessOrEq
////////////////////////////////////////////////////////////////////////////////
int SkipList::lookupKeyLessOrEq (void* key,
SkipListNode* (*pos)[TRI_SKIPLIST_MAX_HEIGHT],
SkipListNode** next) const {
int lev;
int cmp = 0; // just in case to avoid undefined values
SkipListNode* cur;
cur = _start;
for (lev = _start->_height-1; lev >= 0; lev--) {
while (true) { // will be left by break
*next = cur->_next[lev];
if (nullptr == *next) {
break;
}
cmp = _cmp_key_elm(_cmpdata, key, (*next)->_doc);
if (cmp < 0) {
break;
}
cur = *next;
}
(*pos)[lev] = cur;
}
// Now cur == (*pos)[0] points to the largest node whose document is
// less than or equal to key in the preorder. *next is the next node
// and can be nullptr is if there none.
return cmp;
}
// -----------------------------------------------------------------------------
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a new skiplist
///
/// Returns nullptr if allocation fails and a pointer to the skiplist
/// otherwise.
////////////////////////////////////////////////////////////////////////////////
SkipList::SkipList (SkipListCmpElmElm cmp_elm_elm,
SkipListCmpKeyElm cmp_key_elm,
void* cmpdata,
SkipListFreeFunc freefunc,
bool unique)
: _cmp_elm_elm(cmp_elm_elm), _cmp_key_elm(cmp_key_elm), _cmpdata(cmpdata),
_free(freefunc), _unique(unique), _nrUsed(0) {
// set initial memory usage
_memoryUsed = sizeof(SkipList);
_start = allocNode(TRI_SKIPLIST_MAX_HEIGHT);
// Note that this can throw
_end = _start;
_start->_height = 1;
_start->_next[0] = nullptr;
_start->_prev = nullptr;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief frees a skiplist and all its documents
////////////////////////////////////////////////////////////////////////////////
SkipList::~SkipList () {
SkipListNode* p;
SkipListNode* next;
// First call free for all documents and free all nodes other than start:
p = _start->_next[0];
while (nullptr != p) {
if (nullptr != _free) {
_free(p->_doc);
}
next = p->_next[0];
freeNode(p);
p = next;
}
freeNode(_start);
}
////////////////////////////////////////////////////////////////////////////////
/// @brief inserts a new document into a skiplist
///
/// Comparison is done using proper order comparison. If the skiplist
/// is unique then no two documents that compare equal in the
/// preorder can be inserted. Returns TRI_ERROR_NO_ERROR if all
/// is well, TRI_ERROR_OUT_OF_MEMORY if allocation failed and
/// TRI_ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED if the unique constraint
/// would have been violated by the insert or if there is already a
/// document in the skip list that compares equal to doc in the proper
/// total order. In the latter two cases nothing is inserted.
////////////////////////////////////////////////////////////////////////////////
int SkipList::insert (void* doc) {
int lev;
SkipListNode* pos[TRI_SKIPLIST_MAX_HEIGHT];
SkipListNode* next = nullptr; // to please the compiler
SkipListNode* newNode;
int cmp;
cmp = lookupLess(doc,&pos,&next,SKIPLIST_CMP_TOTORDER);
// Now pos[0] points to the largest node whose document is less than
// doc. next is the next node and can be nullptr if there is none. doc is
// in the skiplist iff next != nullptr and cmp == 0 and in this case it
// is stored at the node next.
if (nullptr != next && 0 == cmp) {
// We have found a duplicate in the proper total order!
return TRI_ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED;
}
// Uniqueness test if wanted:
if (_unique) {
if ((pos[0] != _start &&
0 == _cmp_elm_elm(_cmpdata,doc,pos[0]->_doc,SKIPLIST_CMP_PREORDER)) ||
(nullptr != next &&
0 == _cmp_elm_elm(_cmpdata,doc,next->_doc,SKIPLIST_CMP_PREORDER))) {
return TRI_ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED;
}
}
try {
newNode = allocNode(0);
}
catch (...) {
return TRI_ERROR_OUT_OF_MEMORY;
}
if (newNode->_height > _start->_height) {
// The new levels where not considered in the above search,
// therefore pos is not set on these levels.
for (lev = _start->_height; lev < newNode->_height; lev++) {
pos[lev] = _start;
}
// Note that _start is already initialised with nullptr to the top!
_start->_height = newNode->_height;
}
newNode->_doc = doc;
// Now insert between newNode and next:
newNode->_next[0] = pos[0]->_next[0];
pos[0]->_next[0] = newNode;
newNode->_prev = pos[0];
if (newNode->_next[0] == nullptr) {
// a new last node
_end = newNode;
}
else {
newNode->_next[0]->_prev = newNode;
}
// Now the element is successfully inserted, the rest is performance
// optimisation:
for (lev = 1; lev < newNode->_height; lev++) {
newNode->_next[lev] = pos[lev]->_next[lev];
pos[lev]->_next[lev] = newNode;
}
_nrUsed++;
return TRI_ERROR_NO_ERROR;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief removes a document from a skiplist
///
/// Comparison is done using proper order comparison.
/// Returns TRI_ERROR_NO_ERROR if all is well and
/// TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND if the document was not found.
/// In the latter two cases nothing is removed.
////////////////////////////////////////////////////////////////////////////////
int SkipList::remove (void* doc) {
int lev;
SkipListNode* pos[TRI_SKIPLIST_MAX_HEIGHT];
SkipListNode* next = nullptr; // to please the compiler
int cmp;
cmp = lookupLess(doc,&pos,&next,SKIPLIST_CMP_TOTORDER);
// Now pos[0] points to the largest node whose document is less than
// doc. next points to the next node and can be nullptr if there is none.
// doc is in the skiplist iff next != nullptr and cmp == 0 and in this
// case it is stored at the node next.
if (nullptr == next || 0 != cmp) {
return TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND;
}
if (nullptr != _free) {
_free(next->_doc);
}
// Now delete where next points to:
for (lev = next->_height-1; lev >= 0; lev--) {
// Note the order from top to bottom. The element remains in the
// skiplist as long as we are at a level > 0, only some optimisations
// in performance vanish before that. Only when we have removed it at
// level 0, it is really gone.
pos[lev]->_next[lev] = next->_next[lev];
}
if (next->_next[0] == nullptr) {
// We were the last, so adjust _end
_end = next->_prev;
}
else {
next->_next[0]->_prev = next->_prev;
}
freeNode(next);
_nrUsed--;
return TRI_ERROR_NO_ERROR;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief looks up doc in the skiplist using the proper order
/// comparison.
///
/// Only comparisons using the proper order are done. Returns nullptr
/// if doc is not in the skiplist.
////////////////////////////////////////////////////////////////////////////////
SkipListNode* SkipList::lookup (void* doc) const {
SkipListNode* pos[TRI_SKIPLIST_MAX_HEIGHT];
SkipListNode* next = nullptr; // to please the compiler
int cmp;
cmp = lookupLess(doc,&pos,&next,SKIPLIST_CMP_TOTORDER);
// Now pos[0] points to the largest node whose document is less than
// doc. next points to the next node and can be nullptr if there is none.
// doc is in the skiplist iff next != nullptr and cmp == 0 and in this
// case it is stored at the node next.
if (nullptr == next || 0 != cmp) {
return nullptr;
}
return next;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief finds the last document that is less to doc in the preorder
/// comparison or the start node if none is.
///
/// Only comparisons using the preorder are done.
////////////////////////////////////////////////////////////////////////////////
SkipListNode* SkipList::leftLookup (void* doc) const {
SkipListNode* pos[TRI_SKIPLIST_MAX_HEIGHT];
SkipListNode* next;
lookupLess(doc,&pos,&next,SKIPLIST_CMP_PREORDER);
// Now pos[0] points to the largest node whose document is less than
// doc in the preorder. next points to the next node and can be nullptr
// if there is none. doc is in the skiplist iff next != nullptr and cmp
// == 0 and in this case it is stored at the node next.
return pos[0];
}
////////////////////////////////////////////////////////////////////////////////
/// @brief finds the last document that is less or equal to doc in
/// the preorder comparison or the start node if none is.
///
/// Only comparisons using the preorder are done.
////////////////////////////////////////////////////////////////////////////////
SkipListNode* SkipList::rightLookup (void* doc) const {
SkipListNode* pos[TRI_SKIPLIST_MAX_HEIGHT];
SkipListNode* next;
lookupLessOrEq(doc,&pos,&next,SKIPLIST_CMP_PREORDER);
// Now pos[0] points to the largest node whose document is less than
// or equal to doc in the preorder. next points to the next node and
// can be nullptr if there is none. doc is in the skiplist iff next !=
// nullptr and cmp == 0 and in this case it is stored at the node next.
return pos[0];
}
////////////////////////////////////////////////////////////////////////////////
/// @brief finds the last document whose key is less to key in the preorder
/// comparison or the start node if none is.
///
/// Only comparisons using the preorder are done using cmp_key_elm.
////////////////////////////////////////////////////////////////////////////////
SkipListNode* SkipList::leftKeyLookup (void* key) const {
SkipListNode* pos[TRI_SKIPLIST_MAX_HEIGHT];
SkipListNode* next;
lookupKeyLess(key,&pos,&next);
// Now pos[0] points to the largest node whose document is less than
// key in the preorder. next points to the next node and can be nullptr
// if there is none. doc is in the skiplist iff next != nullptr and cmp
// == 0 and in this case it is stored at the node next.
return pos[0];
}
////////////////////////////////////////////////////////////////////////////////
/// @brief finds the last document that is less or equal to doc in
/// the preorder comparison or the start node if none is.
///
/// Only comparisons using the preorder are done using cmp_key_elm.
////////////////////////////////////////////////////////////////////////////////
SkipListNode* SkipList::rightKeyLookup (void* key) const {
SkipListNode* pos[TRI_SKIPLIST_MAX_HEIGHT];
SkipListNode* next;
lookupKeyLessOrEq(key,&pos,&next);
// Now pos[0] points to the largest node whose document is less than
// or equal to key in the preorder. next points to the next node and
// can be nullptr if there is none. doc is in the skiplist iff next !=
// nullptr and cmp == 0 and in this case it is stored at the node next.
return pos[0];
}
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
// End:
| 35.757576 | 91 | 0.53679 | morsdatum |
6b59eccfc19f7499f13abf641d0efaa774288378 | 556 | cpp | C++ | UnitTests/Source/Main-Tests-Run.cpp | jwolak/Equinox-Logger | 982d4a8688133299a77671e927ae9506172fe16c | [
"BSD-3-Clause"
] | null | null | null | UnitTests/Source/Main-Tests-Run.cpp | jwolak/Equinox-Logger | 982d4a8688133299a77671e927ae9506172fe16c | [
"BSD-3-Clause"
] | null | null | null | UnitTests/Source/Main-Tests-Run.cpp | jwolak/Equinox-Logger | 982d4a8688133299a77671e927ae9506172fe16c | [
"BSD-3-Clause"
] | null | null | null | /*#include "Command-Line-Parser-Tests.cpp"*/
#include <gtest/gtest.h>
#include "gmock/gmock.h"
#include "EquinoxLoggerTests/File-Logger-Tests.cpp"
#include "EquinoxLoggerTests/Console-Logger-Tests.cpp"
#include "EquinoxLoggerTests/Logger-Level-Tests.cpp"
#include "EquinoxLoggerTests/Logger-Output-Tests.cpp"
#include "EquinoxLoggerTests/Logger-Log-Message-Macros-Tests.cpp"
#include "EquinoxLoggerTests/Logger-Enable-Log-Levels-Macros-Tests.cpp"
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
| 32.705882 | 71 | 0.77518 | jwolak |
6b633ea015d0ccd621f0f928e772682c35999e83 | 33,267 | cpp | C++ | vsomeip/implementation/utility/src/utility.cpp | MicrochipTech/some-ip | b1ab3161f38c4db498c16b1dd478693b17b994f9 | [
"BSD-3-Clause"
] | 5 | 2021-09-03T13:31:46.000Z | 2022-03-30T05:02:49.000Z | vsomeip/implementation/utility/src/utility.cpp | MicrochipTech/some-ip | b1ab3161f38c4db498c16b1dd478693b17b994f9 | [
"BSD-3-Clause"
] | null | null | null | vsomeip/implementation/utility/src/utility.cpp | MicrochipTech/some-ip | b1ab3161f38c4db498c16b1dd478693b17b994f9 | [
"BSD-3-Clause"
] | 5 | 2019-06-17T05:27:14.000Z | 2021-12-26T01:16:08.000Z | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifdef _WIN32
#include <iostream>
#else
#include <dlfcn.h>
#include <signal.h>
#include <sys/mman.h>
#include <thread>
#include <sstream>
#endif
#include <sys/stat.h>
#include <vsomeip/constants.hpp>
#include <vsomeip/defines.hpp>
#include "../include/byteorder.hpp"
#include "../include/utility.hpp"
#include "../../configuration/include/configuration.hpp"
#include "../../configuration/include/internal.hpp"
#include "../../logging/include/logger.hpp"
#ifdef _WIN32
#ifndef _WINSOCKAPI_
#include <Windows.h>
#endif
#endif
namespace vsomeip {
uint64_t utility::get_message_size(const byte_t *_data, size_t _size) {
uint64_t its_size(0);
if (VSOMEIP_SOMEIP_HEADER_SIZE <= _size) {
its_size = VSOMEIP_SOMEIP_HEADER_SIZE
+ VSOMEIP_BYTES_TO_LONG(_data[4], _data[5], _data[6], _data[7]);
}
return (its_size);
}
uint32_t utility::get_payload_size(const byte_t *_data, uint32_t _size) {
uint32_t its_size(0);
if (VSOMEIP_SOMEIP_HEADER_SIZE <= _size) {
its_size = VSOMEIP_BYTES_TO_LONG(_data[4], _data[5], _data[6], _data[7])
- VSOMEIP_SOMEIP_HEADER_SIZE;
}
return (its_size);
}
bool utility::exists(const std::string &_path) {
struct stat its_stat;
return (stat(_path.c_str(), &its_stat) == 0);
}
bool utility::is_file(const std::string &_path) {
struct stat its_stat;
if (stat(_path.c_str(), &its_stat) == 0) {
if (its_stat.st_mode & S_IFREG)
return true;
}
return false;
}
bool utility::is_folder(const std::string &_path) {
struct stat its_stat;
if (stat(_path.c_str(), &its_stat) == 0) {
if (its_stat.st_mode & S_IFDIR)
return true;
}
return false;
}
const std::string utility::get_base_path(
const std::shared_ptr<configuration> &_config) {
return std::string(VSOMEIP_BASE_PATH + _config->get_network() + "-");
}
const std::string utility::get_shm_name(
const std::shared_ptr<configuration> &_config) {
return std::string("/" + _config->get_network());
}
// pointer to shared memory
configuration_data_t *utility::the_configuration_data__(nullptr);
// critical section to protect shared memory pointers, handles and ref count in this process
CriticalSection utility::its_local_configuration_mutex__;
// number of times auto_configuration_init() has been called in this process
std::atomic<std::uint16_t> utility::its_configuration_refs__(0);
// pointer to used client IDs array in shared memory
std::uint16_t* utility::used_client_ids__(0);
#ifdef _WIN32
// global (inter-process) mutex
static HANDLE configuration_data_mutex(INVALID_HANDLE_VALUE);
// memory mapping handle
static HANDLE its_descriptor(INVALID_HANDLE_VALUE);
#endif
bool utility::auto_configuration_init(const std::shared_ptr<configuration> &_config) {
std::unique_lock<CriticalSection> its_lock(its_local_configuration_mutex__);
const size_t its_shm_size = sizeof(configuration_data_t) +
static_cast<std::uint16_t>(~_config->get_diagnosis_mask()) * sizeof(client_t);
#ifdef _WIN32
if (its_configuration_refs__ > 0) {
assert(configuration_data_mutex != INVALID_HANDLE_VALUE);
assert(its_descriptor != INVALID_HANDLE_VALUE);
assert(the_configuration_data__ != nullptr);
++its_configuration_refs__;
} else {
configuration_data_mutex = CreateMutex(
NULL, // default security attributes
true, // initially owned
"vSomeIP_SharedMemoryLock"); // named mutex
if (configuration_data_mutex) {
if (GetLastError() == ERROR_ALREADY_EXISTS) {
VSOMEIP_INFO << "utility::auto_configuration_init: use existing shared memory";
// mapping already exists, wait for mutex release and map in
DWORD waitResult = WaitForSingleObject(configuration_data_mutex, INFINITE);
if (waitResult == WAIT_OBJECT_0) {
its_descriptor = CreateFileMapping(
INVALID_HANDLE_VALUE, // use paging file
NULL, // default security
PAGE_READWRITE, // read/write access
0, // maximum object size (high-order DWORD)
its_shm_size, // maximum object size (low-order DWORD)
utility::get_shm_name(_config).c_str());// name of mapping object
if (its_descriptor && GetLastError() == ERROR_ALREADY_EXISTS) {
void *its_segment = (LPTSTR)MapViewOfFile(its_descriptor, // handle to map object
FILE_MAP_ALL_ACCESS, // read/write permission
0,
0,
its_shm_size);
if (its_segment) {
the_configuration_data__
= reinterpret_cast<configuration_data_t *>(its_segment);
++its_configuration_refs__;
used_client_ids__ = reinterpret_cast<unsigned short*>(
reinterpret_cast<size_t>(&the_configuration_data__->routing_manager_host_) + sizeof(unsigned short));
} else {
VSOMEIP_ERROR << "utility::auto_configuration_init: MapViewOfFile failed (" << GetLastError() << ")";
}
} else {
if (its_descriptor) {
VSOMEIP_ERROR << "utility::auto_configuration_init: CreateFileMapping failed. expected existing mapping";
} else {
VSOMEIP_ERROR << "utility::auto_configuration_init: CreateFileMapping failed (" << GetLastError() << ")";
}
}
} else {
VSOMEIP_ERROR << "utility::auto_configuration_init: WaitForSingleObject(mutex) failed (" << GetLastError() << ")";
}
} else {
VSOMEIP_INFO << "utility::auto_configuration_init: create new shared memory";
// create and init new mapping
its_descriptor = CreateFileMapping(
INVALID_HANDLE_VALUE, // use paging file
NULL, // default security
PAGE_READWRITE, // read/write access
0, // maximum object size (high-order DWORD)
its_shm_size, // maximum object size (low-order DWORD)
utility::get_shm_name(_config).c_str());// name of mapping object
if (its_descriptor) {
void *its_segment = (LPTSTR)MapViewOfFile(its_descriptor, // handle to map object
FILE_MAP_ALL_ACCESS, // read/write permission
0,
0,
its_shm_size);
if (its_segment) {
the_configuration_data__
= reinterpret_cast<configuration_data_t *>(its_segment);
the_configuration_data__->client_base_
= static_cast<unsigned short>((_config->get_diagnosis_address() << 8) & _config->get_diagnosis_mask());
the_configuration_data__->max_clients_ = static_cast<std::uint16_t>(~_config->get_diagnosis_mask());
the_configuration_data__->max_used_client_ids_index_ = 1;
the_configuration_data__->max_assigned_client_id_without_diagnosis_ = 0x00;
the_configuration_data__->routing_manager_host_ = 0x0000;
// the clientid array starts right after the routing_manager_host_ struct member
used_client_ids__ = reinterpret_cast<unsigned short*>(
reinterpret_cast<size_t>(&the_configuration_data__->routing_manager_host_) + sizeof(unsigned short));
used_client_ids__[0] = the_configuration_data__->client_base_;
the_configuration_data__->client_base_++;
std::string its_name = _config->get_routing_host();
if (its_name == "")
the_configuration_data__->routing_manager_host_ = the_configuration_data__->client_base_;
its_configuration_refs__++;
} else {
VSOMEIP_ERROR << "utility::auto_configuration_init: MapViewOfFile failed (" << GetLastError() << ")";
}
} else {
VSOMEIP_ERROR << "utility::auto_configuration_init: CreateFileMapping failed (" << GetLastError() << ")";
}
}
// always release mutex
ReleaseMutex(configuration_data_mutex);
} else {
VSOMEIP_ERROR << "utility::auto_configuration_init: CreateMutex failed (" << GetLastError() << ")";
}
// cleanup in case of error
if (the_configuration_data__ == nullptr) {
if (its_descriptor != INVALID_HANDLE_VALUE) {
CloseHandle(its_descriptor);
its_descriptor = INVALID_HANDLE_VALUE;
}
if (configuration_data_mutex != INVALID_HANDLE_VALUE) {
CloseHandle(configuration_data_mutex);
configuration_data_mutex = INVALID_HANDLE_VALUE;
}
}
}
#else
if (its_configuration_refs__ > 0) {
// shm is already mapped into the process
its_configuration_refs__++;
} else {
const mode_t previous_mask(::umask(static_cast<mode_t>(_config->get_umask())));
int its_descriptor = shm_open(utility::get_shm_name(_config).c_str(), O_RDWR | O_CREAT | O_EXCL,
static_cast<mode_t>(_config->get_permissions_shm()));
::umask(previous_mask);
if (its_descriptor > -1) {
if (-1 == ftruncate(its_descriptor, its_shm_size)) {
VSOMEIP_ERROR << "utility::auto_configuration_init: "
"ftruncate failed: " << std::strerror(errno);
} else {
void *its_segment = mmap(0, its_shm_size,
PROT_READ | PROT_WRITE, MAP_SHARED,
its_descriptor, 0);
if(MAP_FAILED == its_segment) {
VSOMEIP_ERROR << "utility::auto_configuration_init: "
"mmap failed: " << std::strerror(errno);
} else {
the_configuration_data__
= reinterpret_cast<configuration_data_t *>(its_segment);
if (the_configuration_data__ != nullptr) {
int ret;
pthread_mutexattr_t attr;
ret = pthread_mutexattr_init(&attr);
if (0 == ret) {
ret = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
if (0 != ret) {
VSOMEIP_ERROR << "pthread_mutexattr_setpshared() failed " << ret;
}
ret = pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST);
if (0 != ret) {
VSOMEIP_ERROR << "pthread_mutexattr_setrobust() failed " << ret;
}
} else {
VSOMEIP_ERROR << "pthread_mutexattr_init() failed " << ret;
}
ret = pthread_mutex_init(&the_configuration_data__->mutex_, (0==ret)?&attr:NULL);
if (0 != ret) {
VSOMEIP_ERROR << "pthread_mutex_init() failed " << ret;
}
ret = pthread_mutex_lock(&the_configuration_data__->mutex_);
if (0 != ret) {
VSOMEIP_ERROR << "pthread_mutex_lock() failed " << ret;
}
the_configuration_data__->client_base_
= static_cast<unsigned short>((_config->get_diagnosis_address() << 8) & _config->get_diagnosis_mask());
the_configuration_data__->max_clients_ = static_cast<std::uint16_t>(~_config->get_diagnosis_mask());
the_configuration_data__->max_used_client_ids_index_ = 1;
the_configuration_data__->max_assigned_client_id_without_diagnosis_ = 0x00;
the_configuration_data__->routing_manager_host_ = 0x0000;
// the clientid array starts right after the routing_manager_host_ struct member
used_client_ids__ = reinterpret_cast<unsigned short*>(
reinterpret_cast<size_t>(&the_configuration_data__->routing_manager_host_) + sizeof(unsigned short));
used_client_ids__[0] = the_configuration_data__->client_base_;
the_configuration_data__->client_base_++;
std::string its_name = _config->get_routing_host();
its_configuration_refs__++;
the_configuration_data__->initialized_ = 1;
ret = pthread_mutex_unlock(&the_configuration_data__->mutex_);
if (0 != ret) {
VSOMEIP_ERROR << "pthread_mutex_unlock() failed " << ret;
}
}
if(-1 == ::close(its_descriptor)) {
VSOMEIP_ERROR << "utility::auto_configuration_init: "
"close failed: " << std::strerror(errno);
}
}
}
} else if (errno == EEXIST) {
const mode_t previous_mask(::umask(static_cast<mode_t>(_config->get_umask())));
its_descriptor = shm_open(utility::get_shm_name(_config).c_str(), O_RDWR,
static_cast<mode_t>(_config->get_permissions_shm()));
::umask(previous_mask);
if (-1 == its_descriptor) {
VSOMEIP_ERROR << "utility::auto_configuration_init: "
"shm_open failed: " << std::strerror(errno);
} else {
// truncate to make sure we work on valid shm;
// in case creator already called truncate, this effectively becomes a noop
if (-1 == ftruncate(its_descriptor, its_shm_size)) {
VSOMEIP_ERROR << "utility::auto_configuration_init: "
"ftruncate failed: " << std::strerror(errno);
} else {
void *its_segment = mmap(0, its_shm_size,
PROT_READ | PROT_WRITE, MAP_SHARED,
its_descriptor, 0);
if(MAP_FAILED == its_segment) {
VSOMEIP_ERROR << "utility::auto_configuration_init: "
"mmap failed: " << std::strerror(errno);
} else {
configuration_data_t *configuration_data
= reinterpret_cast<configuration_data_t *>(its_segment);
// check if it is ready for use (for 3 seconds)
int retry_count = 300;
while (configuration_data->initialized_ == 0 && --retry_count > 0) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
if (configuration_data->initialized_ == 0) {
VSOMEIP_ERROR << "utility::auto_configuration_init: data in shm not initialized";
} else {
the_configuration_data__ = configuration_data;
int its_result = pthread_mutex_lock(&the_configuration_data__->mutex_);
used_client_ids__ = reinterpret_cast<unsigned short*>(
reinterpret_cast<size_t>(&the_configuration_data__->routing_manager_host_)
+ sizeof(unsigned short));
if (EOWNERDEAD == its_result) {
VSOMEIP_WARNING << "utility::auto_configuration_init EOWNERDEAD";
check_client_id_consistency();
if (0 != pthread_mutex_consistent(&the_configuration_data__->mutex_)) {
VSOMEIP_ERROR << "pthread_mutex_consistent() failed ";
}
}
its_configuration_refs__++;
pthread_mutex_unlock(&the_configuration_data__->mutex_);
}
if (-1 == ::close(its_descriptor)) {
VSOMEIP_ERROR << "utility::auto_configuration_init: "
"close failed: " << std::strerror(errno);
}
}
}
}
}
}
#endif
return (the_configuration_data__ != nullptr);
}
void utility::auto_configuration_exit(client_t _client,
const std::shared_ptr<configuration> &_config) {
std::unique_lock<CriticalSection> its_lock(its_local_configuration_mutex__);
const size_t its_shm_size = sizeof(configuration_data_t) +
static_cast<std::uint16_t>(~_config->get_diagnosis_mask()) * sizeof(client_t);
if (the_configuration_data__) {
#ifdef _WIN32
// not manipulating data in shared memory, no need to take global mutex
assert(configuration_data_mutex != INVALID_HANDLE_VALUE);
assert(its_descriptor != INVALID_HANDLE_VALUE);
its_configuration_refs__--;
if (is_routing_manager_host(_client)) {
set_routing_manager_host(0x0000);
}
if (its_configuration_refs__ == 0) {
UnmapViewOfFile(the_configuration_data__);
the_configuration_data__ = nullptr;
used_client_ids__ = nullptr;
CloseHandle(its_descriptor);
its_descriptor = NULL;
CloseHandle(configuration_data_mutex);
configuration_data_mutex = NULL;
}
#else
its_configuration_refs__--;
bool unlink_shm = false;
if (is_routing_manager_host(_client)) {
set_routing_manager_host(0x0000);
unlink_shm = true;
}
if (its_configuration_refs__ == 0) {
if (-1 == ::munmap(the_configuration_data__, its_shm_size)) {
VSOMEIP_ERROR << "utility::auto_configuration_exit: "
"munmap failed: " << std::strerror(errno);
} else {
VSOMEIP_INFO << "utility::auto_configuration_exit: "
"munmap succeeded.";
the_configuration_data__ = nullptr;
used_client_ids__ = nullptr;
if (unlink_shm) {
shm_unlink(utility::get_shm_name(_config).c_str());
}
}
}
#endif
}
}
bool utility::is_used_client_id(client_t _client,
const std::shared_ptr<configuration> &_config) {
for (int i = 0;
i < the_configuration_data__->max_used_client_ids_index_;
i++) {
if (used_client_ids__[i] == _client) {
return true;
}
}
#ifndef _WIN32
std::stringstream its_client;
its_client << utility::get_base_path(_config) << std::hex << _client;
if (exists(its_client.str())) {
if (-1 == ::unlink(its_client.str().c_str())) {
VSOMEIP_WARNING << "unlink failed for " << its_client.str() << ". Client identifier 0x"
<< std::hex << _client << " can't be reused!";
return true;
}
}
#endif
return false;
}
std::set<client_t> utility::get_used_client_ids() {
std::set<client_t> clients;
std::unique_lock<CriticalSection> its_lock(its_local_configuration_mutex__);
if (the_configuration_data__ != nullptr) {
#ifdef _WIN32
DWORD waitResult = WaitForSingleObject(configuration_data_mutex, INFINITE);
assert(waitResult == WAIT_OBJECT_0);
(void)waitResult;
#else
if (EOWNERDEAD == pthread_mutex_lock(&the_configuration_data__->mutex_)) {
VSOMEIP_WARNING << "utility::request_client_id EOWNERDEAD";
check_client_id_consistency();
if (0 != pthread_mutex_consistent(&the_configuration_data__->mutex_)) {
VSOMEIP_ERROR << "pthread_mutex_consistent() failed ";
}
}
#endif
for (int i = 1;
i < the_configuration_data__->max_used_client_ids_index_;
i++) {
clients.insert(used_client_ids__[i]);
}
#ifdef _WIN32
BOOL releaseResult = ReleaseMutex(configuration_data_mutex);
assert(releaseResult);
(void)releaseResult;
#else
pthread_mutex_unlock(&the_configuration_data__->mutex_);
#endif
}
return clients;
}
client_t utility::request_client_id(const std::shared_ptr<configuration> &_config, const std::string &_name, client_t _client) {
std::unique_lock<CriticalSection> its_lock(its_local_configuration_mutex__);
if (the_configuration_data__ != nullptr) {
const std::string its_name = _config->get_routing_host();
#ifdef _WIN32
DWORD waitResult = WaitForSingleObject(configuration_data_mutex, INFINITE);
assert(waitResult == WAIT_OBJECT_0);
(void)waitResult;
#else
if (EOWNERDEAD == pthread_mutex_lock(&the_configuration_data__->mutex_)) {
VSOMEIP_WARNING << "utility::request_client_id EOWNERDEAD";
check_client_id_consistency();
if (0 != pthread_mutex_consistent(&the_configuration_data__->mutex_)) {
VSOMEIP_ERROR << "pthread_mutex_consistent() failed ";
}
}
pid_t pid = getpid();
if (its_name == "" || _name == its_name) {
if (the_configuration_data__->pid_ != 0) {
if (pid != the_configuration_data__->pid_) {
if (kill(the_configuration_data__->pid_, 0) == -1) {
VSOMEIP_WARNING << "Routing Manager seems to be inactive. Taking over...";
the_configuration_data__->routing_manager_host_ = 0x0000;
}
}
}
}
#endif
bool set_client_as_manager_host(false);
if (its_name != "" && its_name == _name) {
if (the_configuration_data__->routing_manager_host_ == 0x0000) {
set_client_as_manager_host = true;
} else {
VSOMEIP_ERROR << "Routing manager with id " << the_configuration_data__->routing_manager_host_ << " already exists.";
#ifdef _WIN32
BOOL releaseResult = ReleaseMutex(configuration_data_mutex);
assert(releaseResult);
(void)releaseResult;
#else
pthread_mutex_unlock(&the_configuration_data__->mutex_);
#endif
return ILLEGAL_CLIENT;
}
} else if (its_name == "" && the_configuration_data__->routing_manager_host_ == 0x0000) {
set_client_as_manager_host = true;
}
if (the_configuration_data__->max_used_client_ids_index_
== the_configuration_data__->max_clients_) {
VSOMEIP_ERROR << "Max amount of possible concurrent active"
<< " vsomeip applications reached (" << std::dec <<
the_configuration_data__->max_clients_ << ").";
#ifdef _WIN32
BOOL releaseResult = ReleaseMutex(configuration_data_mutex);
assert(releaseResult);
(void)releaseResult;
#else
pthread_mutex_unlock(&the_configuration_data__->mutex_);
#endif
return ILLEGAL_CLIENT;
}
bool use_autoconfig = true;
if (_name != "" && _client != ILLEGAL_CLIENT) { // preconfigured client id
// check if application name has preconfigured client id in json
const client_t its_preconfigured_client_id = _config->get_id(_name);
if (its_preconfigured_client_id) {
// preconfigured client id for application name present in json
if (its_preconfigured_client_id == _client) {
// preconfigured client id for application name present in json
// and requested
if (!is_used_client_id(_client, _config)) {
use_autoconfig = false;
}
} else {
// preconfigured client id for application name present in
// json, but different client id requested
if (!is_used_client_id(its_preconfigured_client_id, _config)) {
// assign preconfigured client id if not already used
_client = its_preconfigured_client_id;
use_autoconfig = false;
} else if (!is_used_client_id(_client, _config)) {
// if preconfigured client id is already used and
// requested is unused assign requested
use_autoconfig = false;
}
}
}
}
if (use_autoconfig) {
if (_client == ILLEGAL_CLIENT || is_used_client_id(_client, _config)) {
_client = the_configuration_data__->client_base_;
}
int increase_count = 0;
while (is_used_client_id(_client, _config)
|| !is_bigger_last_assigned_client_id(_client, _config->get_diagnosis_mask())
|| _config->is_configured_client_id(_client)) {
if ((_client & the_configuration_data__->max_clients_)
+ 1 > the_configuration_data__->max_clients_) {
_client = the_configuration_data__->client_base_;
the_configuration_data__->max_assigned_client_id_without_diagnosis_ = 0;
} else {
_client++;
increase_count++;
if (increase_count > the_configuration_data__->max_clients_) {
VSOMEIP_ERROR << "Max amount of possible concurrent active"
<< " vsomeip applications reached (" << std::dec <<
the_configuration_data__->max_clients_ << ").";
#ifdef _WIN32
BOOL releaseResult = ReleaseMutex(configuration_data_mutex);
assert(releaseResult);
(void)releaseResult;
#else
pthread_mutex_unlock(&the_configuration_data__->mutex_);
#endif
return ILLEGAL_CLIENT;
}
}
}
set_max_assigned_client_id_without_diagnosis(_client);
}
if (set_client_as_manager_host) {
the_configuration_data__->routing_manager_host_ = _client;
#ifndef _WIN32
the_configuration_data__->pid_ = pid;
#endif
}
used_client_ids__[the_configuration_data__->max_used_client_ids_index_] = _client;
the_configuration_data__->max_used_client_ids_index_++;
#ifdef _WIN32
BOOL releaseResult = ReleaseMutex(configuration_data_mutex);
assert(releaseResult);
(void)releaseResult;
#else
pthread_mutex_unlock(&the_configuration_data__->mutex_);
#endif
return _client;
}
return ILLEGAL_CLIENT;
}
void utility::release_client_id(client_t _client) {
std::unique_lock<CriticalSection> its_lock(its_local_configuration_mutex__);
if (the_configuration_data__ != nullptr) {
#ifdef _WIN32
WaitForSingleObject(configuration_data_mutex, INFINITE);
#else
if (EOWNERDEAD == pthread_mutex_lock(&the_configuration_data__->mutex_)) {
VSOMEIP_WARNING << "utility::release_client_id EOWNERDEAD";
check_client_id_consistency();
if (0 != pthread_mutex_consistent(&the_configuration_data__->mutex_)) {
VSOMEIP_ERROR << "pthread_mutex_consistent() failed ";
}
}
#endif
int i = 0;
for (; i < the_configuration_data__->max_used_client_ids_index_; i++) {
if (used_client_ids__[i] == _client) {
break;
}
}
if (i < the_configuration_data__->max_used_client_ids_index_) {
for (; i < (the_configuration_data__->max_used_client_ids_index_ - 1); i++) {
used_client_ids__[i] = used_client_ids__[i+1];
}
the_configuration_data__->max_used_client_ids_index_--;
}
#ifdef _WIN32
ReleaseMutex(configuration_data_mutex);
#else
pthread_mutex_unlock(&the_configuration_data__->mutex_);
#endif
}
}
bool utility::is_routing_manager_host(client_t _client) {
if (the_configuration_data__ == nullptr) {
VSOMEIP_ERROR << "utility::is_routing_manager_host: configuration data not available";
return false;
}
#ifdef _WIN32
WaitForSingleObject(configuration_data_mutex, INFINITE);
#else
if (EOWNERDEAD == pthread_mutex_lock(&the_configuration_data__->mutex_)) {
VSOMEIP_WARNING << "utility::is_routing_manager_host EOWNERDEAD";
check_client_id_consistency();
if (0 != pthread_mutex_consistent(&the_configuration_data__->mutex_)) {
VSOMEIP_ERROR << "pthread_mutex_consistent() failed ";
}
}
#endif
bool is_routing_manager = (the_configuration_data__->routing_manager_host_ == _client);
#ifdef _WIN32
ReleaseMutex(configuration_data_mutex);
#else
pthread_mutex_unlock(&the_configuration_data__->mutex_);
#endif
return is_routing_manager;
}
void utility::set_routing_manager_host(client_t _client) {
if (the_configuration_data__ == nullptr) {
VSOMEIP_ERROR << "utility::set_routing_manager_host: configuration data not available";
return;
}
#ifdef _WIN32
WaitForSingleObject(configuration_data_mutex, INFINITE);
#else
if (EOWNERDEAD == pthread_mutex_lock(&the_configuration_data__->mutex_)) {
VSOMEIP_WARNING << "utility::set_routing_manager_host EOWNERDEAD";
check_client_id_consistency();
if (0 != pthread_mutex_consistent(&the_configuration_data__->mutex_)) {
VSOMEIP_ERROR << "pthread_mutex_consistent() failed ";
}
}
#endif
the_configuration_data__->routing_manager_host_ = _client;
#ifdef _WIN32
ReleaseMutex(configuration_data_mutex);
#else
pthread_mutex_unlock(&the_configuration_data__->mutex_);
#endif
}
bool utility::is_bigger_last_assigned_client_id(client_t _client, std::uint16_t _diagnosis_mask) {
return _client
> ((the_configuration_data__->client_base_ & _diagnosis_mask)
+ the_configuration_data__->max_assigned_client_id_without_diagnosis_);
}
void utility::set_max_assigned_client_id_without_diagnosis(client_t _client) {
const std::uint16_t its_client_id_without_diagnosis =
static_cast<std::uint16_t>(_client
& the_configuration_data__->max_clients_);
the_configuration_data__->max_assigned_client_id_without_diagnosis_ =
static_cast<std::uint16_t>(its_client_id_without_diagnosis
% the_configuration_data__->max_clients_);
}
void utility::check_client_id_consistency() {
if (1 < the_configuration_data__->max_used_client_ids_index_) {
client_t prevID = used_client_ids__[0];
int i = 1;
for (; i < the_configuration_data__->max_used_client_ids_index_; i++) {
const client_t currID = used_client_ids__[i];
if (prevID == currID) {
break;
}
prevID = currID;
}
if (i < the_configuration_data__->max_used_client_ids_index_) {
for (; i < (the_configuration_data__->max_used_client_ids_index_ - 1); i++) {
used_client_ids__[i] = used_client_ids__[i+1];
}
the_configuration_data__->max_used_client_ids_index_--;
}
}
}
} // namespace vsomeip
| 43.14786 | 137 | 0.575946 | MicrochipTech |
6b63e91fc0d00d3343cc1d25388a9f0b99053f65 | 3,186 | cc | C++ | optickscore/OpticksEventStat.cc | hanswenzel/opticks | b75b5929b6cf36a5eedeffb3031af2920f75f9f0 | [
"Apache-2.0"
] | 11 | 2020-07-05T02:39:32.000Z | 2022-03-20T18:52:44.000Z | optickscore/OpticksEventStat.cc | hanswenzel/opticks | b75b5929b6cf36a5eedeffb3031af2920f75f9f0 | [
"Apache-2.0"
] | null | null | null | optickscore/OpticksEventStat.cc | hanswenzel/opticks | b75b5929b6cf36a5eedeffb3031af2920f75f9f0 | [
"Apache-2.0"
] | 4 | 2020-09-03T20:36:32.000Z | 2022-01-19T07:42:21.000Z | /*
* Copyright (c) 2019 Opticks Team. All Rights Reserved.
*
* This file is part of Opticks
* (see https://bitbucket.org/simoncblyth/opticks).
*
* 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 <iostream>
#include "NPY.hpp"
#include "RecordsNPY.hpp"
#include "Opticks.hh"
#include "OpticksEvent.hh"
#include "OpticksFlags.hh"
#include "OpticksEventStat.hh"
#include "PLOG.hh"
OpticksEventStat::OpticksEventStat(OpticksEvent* evt, unsigned num_cat)
:
m_ok(evt->getOpticks()),
m_evt(evt),
m_num_cat(num_cat),
m_noload(evt->isNoLoad()),
m_records(evt->getRecordsNPY()),
m_pho(evt->getPhotonData()),
m_seq(evt->getSequenceData()),
m_pho_num(m_pho ? m_pho->getShape(0) : 0),
m_seq_num(m_seq ? m_seq->getShape(0) : 0),
m_counts(new MQC[num_cat]),
m_totmin(2)
{
init();
}
void OpticksEventStat::init()
{
assert(m_ok);
countTotals();
}
void OpticksEventStat::increment(unsigned cat, unsigned long long seqhis_)
{
assert( cat < m_num_cat );
m_counts[cat][seqhis_]++ ;
}
void OpticksEventStat::countTotals()
{
for(unsigned i=0 ; i < m_pho_num ; i++)
{
unsigned long long seqhis_ = m_seq->getValue(i,0,0);
m_total[seqhis_]++; // <- same for all trees
}
}
void OpticksEventStat::dump(const char* msg)
{
LOG(info) << msg
<< " evt " << m_evt->brief()
<< " totmin " << m_totmin
;
// copy map into vector of pairs to allow sort into descending tot order
VPQC vpqc ;
for(MQC::const_iterator it=m_total.begin() ; it != m_total.end() ; it++) vpqc.push_back(PQC(it->first,it->second));
std::sort( vpqc.begin(), vpqc.end(), PQC_desc );
for(VPQC::const_iterator it=vpqc.begin() ; it != vpqc.end() ; it++)
{
unsigned long long _seqhis = it->first ;
unsigned tot_ = it->second ;
if(tot_ < m_totmin ) continue ;
std::cout
<< " seqhis " << std::setw(16) << std::hex << _seqhis << std::dec
<< " " << std::setw(64) << OpticksFlags::FlagSequence( _seqhis, true )
<< " tot " << std::setw(6) << tot_
;
if(m_num_cat > 0)
{
std::cout << " cat ( " ;
for(unsigned cat=0 ; cat < m_num_cat ; cat++ ) std::cout << " " << std::setw(6) << m_counts[cat][_seqhis] ;
std::cout << " ) " ;
std::cout << " frac ( " ;
for(unsigned cat=0 ; cat < m_num_cat ; cat++ ) std::cout << " " << std::setw(6) << float(m_counts[cat][_seqhis])/float(tot_) ;
std::cout << " ) " ;
}
std::cout << std::endl ;
}
}
| 26.55 | 139 | 0.58914 | hanswenzel |
6b646a330e5c2783f756079ef40e7c121d937408 | 1,485 | cpp | C++ | tests/copySwap/copySwap.cpp | mlund/h5pp | a12edaf53b064cd00a073f28d489a6eaf7103246 | [
"MIT"
] | null | null | null | tests/copySwap/copySwap.cpp | mlund/h5pp | a12edaf53b064cd00a073f28d489a6eaf7103246 | [
"MIT"
] | null | null | null | tests/copySwap/copySwap.cpp | mlund/h5pp | a12edaf53b064cd00a073f28d489a6eaf7103246 | [
"MIT"
] | null | null | null |
#include <complex>
#include <h5pp/h5pp.h>
#include <iostream>
/*! \brief Prints the content of a vector nicely */
template<typename T> std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
if(!v.empty()) {
out << "[ ";
std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, " "));
out << "]";
}
return out;
}
using namespace std::complex_literals;
// Store some dummy data to an hdf5 file
int main() {
static_assert(h5pp::type::sfinae::has_data<std::vector<double>>() and
"Compile time type-checker failed. Could not properly detect class member data. Check that you are using a supported compiler!");
std::string outputFilenameA = "outputA/copySwapA.h5";
std::string outputFilenameB = "outputB/copySwapB.h5";
size_t logLevel = 1;
h5pp::File fileA(outputFilenameA, h5pp::AccessMode::READWRITE, h5pp::CreateMode::TRUNCATE, logLevel);
h5pp::File fileB(outputFilenameB, h5pp::AccessMode::READWRITE, h5pp::CreateMode::TRUNCATE, logLevel);
fileA.writeDataset("A", "groupA/A");
fileB.writeDataset("B", "groupB/B");
h5pp::File fileC;
fileC = fileB;
fileC.writeDataset("C", "groupC/C");
h5pp::File fileD(fileC);
fileD.writeDataset("D", "groupD/D");
h5pp::File fileE(h5pp::File("outputE/copySwapE.h5", h5pp::AccessMode::READWRITE, h5pp::CreateMode::TRUNCATE, logLevel));
fileE.writeDataset("E", "groupE/E");
fileD = fileB;
return 0;
} | 32.282609 | 147 | 0.653199 | mlund |
6b65c69ceefbc0441a16b05a83ab6d7c286df93e | 198 | cpp | C++ | Lab04/ZBledami/Wypisz.cpp | arokasprz100/CPP-Labs-Third-Semester | 774daafdde2a2bd737fec7ebd1fb181c9ccb9d63 | [
"MIT"
] | null | null | null | Lab04/ZBledami/Wypisz.cpp | arokasprz100/CPP-Labs-Third-Semester | 774daafdde2a2bd737fec7ebd1fb181c9ccb9d63 | [
"MIT"
] | null | null | null | Lab04/ZBledami/Wypisz.cpp | arokasprz100/CPP-Labs-Third-Semester | 774daafdde2a2bd737fec7ebd1fb181c9ccb9d63 | [
"MIT"
] | null | null | null | #include"Typy.h"
#include<iostream>
using namespace std;
void Wypisz(ciag dane, rozmiarCiagu ile)
{
cout<<"("<<dane[0];
for (int i = 1; i < ile; ++i)
cout<<", "<<dane[i];
cout<<")\n";
}
| 15.230769 | 40 | 0.570707 | arokasprz100 |
6b6cab436f17d7f013f10058d542b9d919b57719 | 3,943 | cpp | C++ | Gear/Win32/System.cpp | Alpha255/Rockcat | f04124b17911fb6148512dd8fb260bd84702ffc1 | [
"MIT"
] | null | null | null | Gear/Win32/System.cpp | Alpha255/Rockcat | f04124b17911fb6148512dd8fb260bd84702ffc1 | [
"MIT"
] | null | null | null | Gear/Win32/System.cpp | Alpha255/Rockcat | f04124b17911fb6148512dd8fb260bd84702ffc1 | [
"MIT"
] | null | null | null | #include "Gear/System.h"
#include "Gear/File.hpp"
NAMESPACE_START(Gear)
namespace System
{
#if defined(PLATFORM_WIN32)
std::string getErrorMessage(uint32_t err)
{
static std::shared_ptr<char8_t> buffer(new char8_t[UINT16_MAX]());
memset(buffer.get(), 0, UINT16_MAX);
VERIFY(::FormatMessageA(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr,
err == ~0u ? ::GetLastError() : err,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buffer.get(),
UINT16_MAX,
nullptr) != 0);
return std::string(buffer.get());
}
std::string getModuleDirectory()
{
static std::shared_ptr<char8_t> buffer(new char8_t[UINT16_MAX]());
memset(buffer.get(), 0, UINT16_MAX);
VERIFY_SYSTEM(::GetModuleFileNameA(nullptr, buffer.get(), UINT16_MAX) != 0);
return File::directory(std::string(buffer.get()));
}
std::string getCurrentWorkingDirectory()
{
static std::shared_ptr<char8_t> buffer(new char8_t[UINT16_MAX]());
memset(buffer.get(), 0, UINT16_MAX);
VERIFY_SYSTEM(::GetCurrentDirectoryA(UINT16_MAX, buffer.get()) != 0);
return std::string(buffer.get());
}
void setWorkingDirectory(const char8_t* path)
{
assert(File::exists(path, true));
VERIFY_SYSTEM(::SetCurrentDirectoryA(path) != 0);
}
void sleep(uint32_t milliseconds)
{
::Sleep(milliseconds);
}
void executeProcess(const char8_t* commandline, bool8_t waitDone)
{
::SECURITY_ATTRIBUTES security
{
sizeof(::SECURITY_ATTRIBUTES),
nullptr,
true
};
::HANDLE read = nullptr, write = nullptr;
VERIFY_SYSTEM(::CreatePipe(&read, &write, &security, INT16_MAX) != 0);
VERIFY_SYSTEM(::SetStdHandle(STD_OUTPUT_HANDLE, write) != 0);
/// If an error occurs, the ANSI version of this function (GetStartupInfoA) can raise an exception.
/// The Unicode version (GetStartupInfoW) does not fail
::STARTUPINFOA startupInfo;
::GetStartupInfoA(&startupInfo);
startupInfo.cb = sizeof(::STARTUPINFOA);
startupInfo.dwFlags = STARTF_USESTDHANDLES;
startupInfo.hStdInput = read;
startupInfo.hStdOutput = write;
static std::shared_ptr<char8_t> buffer(new char8_t[INT16_MAX]());
memset(buffer.get(), 0, INT16_MAX);
::PROCESS_INFORMATION processInfo;
if (::CreateProcessA(
nullptr,
const_cast<::LPSTR>(commandline),
nullptr,
nullptr,
true,
CREATE_NO_WINDOW,
nullptr,
nullptr,
&startupInfo,
&processInfo))
{
if (waitDone)
{
::DWORD exit = 0u;
::WaitForSingleObject(processInfo.hProcess, INFINITE);
if (::GetExitCodeProcess(processInfo.hProcess, &exit) && exit != 0u)
{
::DWORD bytes = 0u;
VERIFY_SYSTEM(::ReadFile(read, buffer.get(), INT16_MAX, &bytes, nullptr) != 0);
//buffer[bytes] = '\0';
LOG_ERROR("Failed to execute command \"%s\"", buffer.get());
}
else
{
VERIFY_SYSTEM(0);
}
/// STILL_ACTIVE
}
::CloseHandle(processInfo.hThread);
::CloseHandle(processInfo.hProcess);
::CloseHandle(read);
::CloseHandle(write);
return;
}
VERIFY_SYSTEM(0);
}
std::string getEnvironmentVariable(const char8_t* var)
{
static std::shared_ptr<char8_t> buffer(new char8_t[UINT16_MAX]());
memset(buffer.get(), 0, UINT16_MAX);
VERIFY_SYSTEM(::GetEnvironmentVariableA(var, buffer.get(), UINT16_MAX) != 0);
return std::string(buffer.get());
}
uint64_t getModuleHandle()
{
::HMODULE handle = ::GetModuleHandleA(nullptr);
VERIFY_SYSTEM(handle);
return reinterpret_cast<uint64_t>(handle);
}
DynamicLibrary::DynamicLibrary(const char8_t* name)
{
m_Handle = reinterpret_cast<uint64_t>(::LoadLibraryA(name));
VERIFY_SYSTEM(m_Handle);
}
void* DynamicLibrary::getProcAddress(const char8_t* name)
{
assert(m_Handle);
return ::GetProcAddress(reinterpret_cast<::HMODULE>(m_Handle), name);
}
DynamicLibrary::~DynamicLibrary()
{
VERIFY_SYSTEM(::FreeLibrary(reinterpret_cast<::HMODULE>(m_Handle)) != 0);
}
#else
#error Unknown platform!
#endif
}
NAMESPACE_END(Gear) | 24.490683 | 102 | 0.697438 | Alpha255 |
6b6dc43732deb51532d61f2c3d16c638d33f7740 | 74 | cc | C++ | src/aut_catch_flag.cc | schlepil/funnels_cpp_2 | 1ed746a90019f7f6aff7a54fd4b63bfbd58fa2ac | [
"MIT"
] | null | null | null | src/aut_catch_flag.cc | schlepil/funnels_cpp_2 | 1ed746a90019f7f6aff7a54fd4b63bfbd58fa2ac | [
"MIT"
] | null | null | null | src/aut_catch_flag.cc | schlepil/funnels_cpp_2 | 1ed746a90019f7f6aff7a54fd4b63bfbd58fa2ac | [
"MIT"
] | null | null | null | //
// Created by philipp on 1/21/20.
//
#include "aut/aut_catch_flag.hh"
| 12.333333 | 33 | 0.662162 | schlepil |
6b7024372850ff3b8874874a15cdf36abe07fd52 | 5,720 | cpp | C++ | test/feature-test.cpp | Telecommunication-Telemedia-Assessment/GBVS360-BMS360-ProSal | d0312f54a28e1ef2cf1e1581241571d9612bb36c | [
"MIT",
"Unlicense"
] | 26 | 2018-01-23T14:37:03.000Z | 2021-10-31T13:53:41.000Z | test/feature-test.cpp | Telecommunication-Telemedia-Assessment/GBVS360-BMS360-ProSal | d0312f54a28e1ef2cf1e1581241571d9612bb36c | [
"MIT",
"Unlicense"
] | 8 | 2018-09-05T23:38:09.000Z | 2021-09-27T18:52:18.000Z | test/feature-test.cpp | Telecommunication-Telemedia-Assessment/GBVS360-BMS360-ProSal | d0312f54a28e1ef2cf1e1581241571d9612bb36c | [
"MIT",
"Unlicense"
] | 6 | 2017-12-13T00:35:10.000Z | 2021-09-08T16:55:07.000Z | // **************************************************************************************************
//
// The MIT License (MIT)
//
// Copyright (c) 2017 Pierre Lebreton
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
// associated documentation files (the "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial
// portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// **************************************************************************************************
#include <iostream>
#include <fstream>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/objdetect.hpp>
#include <boost/program_options.hpp>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <list>
#include <Segm.h>
#include <VPD.h>
void objectFeature(cv::Mat &colorImage, cv::Mat& output) {
//int msseg(cv::Mat &I, float spatialBW, float rangeBW, unsigned int minArea, cv::Mat &seg);
cv::Mat labels;
cv::resize(colorImage, colorImage, colorImage.size()/5);
for(int i = 0 ; i < 8 ; ++i) {
msseg(colorImage, 3, 5, 200, labels);
}
cv::imshow("segmentation", colorImage);
double mx, mn;
cv::minMaxLoc(labels, &mn, &mx);
std::cout << "Number of features: "<< mx << std::endl;
output = colorImage;
//cv::cvtColor(colorImage, output, CV_BGR2GRAY);
}
void vanishingLineFeatureMapBind(const cv::Mat &image, cv::Mat &output) {
output = vanishingLineFeatureMap(image);
}
int main(int argc, char **argv) {
// ------------------------------------------------------------------------------------------------------------------------------------------
// parse parameters
namespace po = boost::program_options;
po::positional_options_description p;
p.add("input-file", -1);
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce help message")
("input-file1", po::value< std::string >(), "Saliency input image.")
("input-file2", po::value< std::string >(), "Saliency input image 2.")
("output-file,o", po::value< std::string >(), "output.")
;
po::variables_map vm;
try {
po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);
po::notify(vm);
} catch(boost::exception &) {
std::cerr << "Error incorect program options. See --help... \n";
return 0;
}
if (vm.count("help")) {
std::cout << "--------------------------------------------------------------------------------\n";
std::cout << "\t\tApply the equatorial prior on saliency maps\n";
std::cout << "--------------------------------------------------------------------------------\n";
std::cout << "\n\n";
std::cout << desc << "\n";
return 1;
}
std::string inputImagePath1;
std::string inputImagePath2;
std::string inputColorImagePath;
std::string outputPath;
if (vm.count("input-file1")) {
inputImagePath1 = vm["input-file1"].as< std::string >();
} else {
std::cerr << "It is required to provide the an input 1. See --help\n";
return 0;
}
if (vm.count("input-file2")) {
inputImagePath2 = vm["input-file2"].as< std::string >();
} else {
std::cerr << "It is required to provide the an input 2. See --help\n";
return 0;
}
if (vm.count("output-file")) {
outputPath = vm["output-file"].as< std::string >();
}
// ---------------------------------------------------------------------------------------------------
// Get statistics
cv::Mat image1 = cv::imread(inputImagePath1);
if(image1.empty()) {
std::cerr << "Cannot open: " << inputImagePath1 << std::endl;
return 0;
}
cv::Mat image2 = cv::imread(inputImagePath2);
if(image2.empty()) {
std::cerr << "Cannot open: " << inputImagePath2 << std::endl;
return 0;
}
cv::cvtColor(image1, image1, CV_BGR2GRAY);
cv::cvtColor(image2, image2, CV_BGR2GRAY);
image1.convertTo(image1, CV_32FC1);
image2.convertTo(image2, CV_32FC1);
image1 /= 255;
image2 /= 255;
cv::Mat output = image1.mul(image2);
double mx, mn;
cv::minMaxLoc(output, &mn, &mx);
output = (output - mn) / (mx - mn);
// objectFeature(image, output);
// cv::resize(image, image, cv::Size(1200, static_cast<int>((1000.f/image.cols) * image.rows)));
// boost::thread_group g;
// cv::Mat res1, res2, res3;
// g.create_thread(boost::bind(&vanishingLineFeatureMapBind, boost::ref(image), boost::ref(res1)));
// g.create_thread(boost::bind(&vanishingLineFeatureMapBind, boost::ref(image), boost::ref(res2)));
// g.create_thread(boost::bind(&vanishingLineFeatureMapBind, boost::ref(image), boost::ref(res3)));
// g.join_all();
// output = (res1 + res2 + res3) / 3;
// if(output.empty()) return 0;
if(!outputPath.empty()) {
cv::Mat tmp;
cv::cvtColor(output, tmp, CV_GRAY2BGR);
tmp *= 255;
tmp.convertTo(tmp, CV_8UC3);
cv::imwrite(outputPath, tmp);
return 0;
} else {
cv::imshow("feature map", output);
cv::waitKey();
}
return 0;
}
| 29.183673 | 142 | 0.601049 | Telecommunication-Telemedia-Assessment |
6b71126c7f38f08ff52515f725b55930aa642234 | 169 | cc | C++ | tests/CompileTests/ElsaTestCases/t0477.cc | maurizioabba/rose | 7597292cf14da292bdb9a4ef573001b6c5b9b6c0 | [
"BSD-3-Clause"
] | 488 | 2015-01-09T08:54:48.000Z | 2022-03-30T07:15:46.000Z | tests/CompileTests/ElsaTestCases/t0477.cc | sujankh/rose-matlab | 7435d4fa1941826c784ba97296c0ec55fa7d7c7e | [
"BSD-3-Clause"
] | 174 | 2015-01-28T18:41:32.000Z | 2022-03-31T16:51:05.000Z | tests/CompileTests/ElsaTestCases/t0477.cc | sujankh/rose-matlab | 7435d4fa1941826c784ba97296c0ec55fa7d7c7e | [
"BSD-3-Clause"
] | 146 | 2015-04-27T02:48:34.000Z | 2022-03-04T07:32:53.000Z | // t0477.cc
// template class with nested class and instance declared together
template < class T >
class A {
private:
struct B { } b;
};
void foo()
{
A<int> x;
}
| 12.071429 | 66 | 0.64497 | maurizioabba |
6b73864347d969b4ad938fea3a345b4d4066bd25 | 6,683 | cpp | C++ | dali/internal/system/common/performance-server.cpp | Coquinho/dali-adaptor | a8006aea66b316a5eb710e634db30f566acda144 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | dali/internal/system/common/performance-server.cpp | Coquinho/dali-adaptor | a8006aea66b316a5eb710e634db30f566acda144 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-10-19T13:45:40.000Z | 2020-12-10T20:21:03.000Z | dali/internal/system/common/performance-server.cpp | expertisesolutions/dali-adaptor | 810bf4dea833ea7dfbd2a0c82193bc0b3b155011 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2017 Samsung Electronics 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.
*
*/
// CLASS HEADER
#include <dali/internal/system/common/performance-server.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/platform-abstraction.h>
// INTERNAL INCLUDES
#include <dali/internal/system/common/environment-options.h>
#include <dali/internal/system/common/time-service.h>
namespace Dali
{
namespace Internal
{
namespace Adaptor
{
namespace
{
const unsigned int NANOSECONDS_PER_MICROSECOND = 1000u;
const float MICROSECONDS_TO_SECOND = 1e-6;
} // unnamed namespace
PerformanceServer::PerformanceServer( AdaptorInternalServices& adaptorServices,
const EnvironmentOptions& environmentOptions)
: mEnvironmentOptions( environmentOptions ),
mKernelTrace( adaptorServices.GetKernelTraceInterface() ),
mSystemTrace( adaptorServices.GetSystemTraceInterface() ),
mLogMutex(),
#if defined(NETWORK_LOGGING_ENABLED)
mNetworkServer( adaptorServices, environmentOptions ),
mNetworkControlEnabled( mEnvironmentOptions.GetNetworkControlMode()),
#endif
mStatContextManager( *this ),
mStatisticsLogBitmask( 0 ),
mPerformanceOutputBitmask( 0 ),
mLoggingEnabled( false ),
mLogFunctionInstalled( false )
{
SetLogging( mEnvironmentOptions.GetPerformanceStatsLoggingOptions(),
mEnvironmentOptions.GetPerformanceTimeStampOutput(),
mEnvironmentOptions.GetPerformanceStatsLoggingFrequency());
#if defined(NETWORK_LOGGING_ENABLED)
if( mNetworkControlEnabled )
{
mLoggingEnabled = true;
mNetworkServer.Start();
}
#endif
}
PerformanceServer::~PerformanceServer()
{
#if defined(NETWORK_LOGGING_ENABLED)
if( mNetworkControlEnabled )
{
mNetworkServer.Stop();
}
#endif
if( mLogFunctionInstalled )
{
mEnvironmentOptions.UnInstallLogFunction();
}
}
void PerformanceServer::SetLogging( unsigned int statisticsLogOptions,
unsigned int timeStampOutput,
unsigned int logFrequency )
{
mStatisticsLogBitmask = statisticsLogOptions;
mPerformanceOutputBitmask = timeStampOutput;
mStatContextManager.SetLoggingLevel( mStatisticsLogBitmask, logFrequency);
if( ( mStatisticsLogBitmask == 0) && ( mPerformanceOutputBitmask == 0 ))
{
mLoggingEnabled = false;
}
else
{
mLoggingEnabled = true;
}
}
void PerformanceServer::SetLoggingFrequency( unsigned int logFrequency, ContextId contextId )
{
mStatContextManager.SetLoggingFrequency( logFrequency, contextId );
}
void PerformanceServer::EnableLogging( bool enable, ContextId contextId )
{
mStatContextManager.EnableLogging( enable, contextId );
}
PerformanceInterface::ContextId PerformanceServer::AddContext( const char* name )
{
// for adding custom contexts
return mStatContextManager.AddContext( name, PerformanceMarker::CUSTOM_EVENTS );
}
void PerformanceServer::RemoveContext( ContextId contextId )
{
mStatContextManager.RemoveContext( contextId );
}
void PerformanceServer::AddMarker( MarkerType markerType, ContextId contextId )
{
// called only for custom markers
if( !mLoggingEnabled )
{
return;
}
// Get the time stamp
uint64_t timeStamp = 0;
TimeService::GetNanoseconds( timeStamp );
timeStamp /= NANOSECONDS_PER_MICROSECOND; // Convert to microseconds
// Create a marker
PerformanceMarker marker( markerType, FrameTimeStamp( 0, timeStamp ) );
// get the marker description for this context, e.g SIZE_NEGOTIATION_START
const char* const description = mStatContextManager.GetMarkerDescription( markerType, contextId );
// log it
LogMarker( marker, description );
// Add custom marker to statistics context manager
mStatContextManager.AddCustomMarker( marker, contextId );
}
void PerformanceServer::AddMarker( MarkerType markerType )
{
// called only for internal markers
if( !mLoggingEnabled )
{
return;
}
if( markerType == VSYNC )
{
// make sure log function is installed, note this will be called only from v-sync thread
// if the v-sync thread has already installed one, it won't make any difference.
if( ! mLogFunctionInstalled )
{
mEnvironmentOptions.InstallLogFunction();
mLogFunctionInstalled = true;
}
}
// Get the time
uint64_t timeStamp = 0;
TimeService::GetNanoseconds( timeStamp );
timeStamp /= NANOSECONDS_PER_MICROSECOND; // Convert to microseconds
// Create a marker
PerformanceMarker marker( markerType, FrameTimeStamp( 0, timeStamp ) );
// log it
LogMarker(marker, marker.GetName() );
// Add internal marker to statistics context manager
mStatContextManager.AddInternalMarker( marker );
}
void PerformanceServer::LogContextStatistics( const char* const text )
{
Integration::Log::LogMessage( Dali::Integration::Log::DebugInfo, text );
}
void PerformanceServer::LogMarker( const PerformanceMarker& marker, const char* const description )
{
#if defined(NETWORK_LOGGING_ENABLED)
// log to the network ( this is thread safe )
if( mNetworkControlEnabled )
{
mNetworkServer.TransmitMarker( marker, description );
}
#endif
// log to kernel trace
if( mPerformanceOutputBitmask & OUTPUT_KERNEL_TRACE )
{
// Kernel tracing implementation may not be thread safe
Mutex::ScopedLock lock( mLogMutex );
// description will be something like UPDATE_START or UPDATE_END
mKernelTrace.Trace( marker, description );
}
// log to system trace
if( mPerformanceOutputBitmask & OUTPUT_SYSTEM_TRACE )
{
// System tracing implementation may not be thread safe
Mutex::ScopedLock lock( mLogMutex );
mSystemTrace.Trace( marker, description );
}
// log to Dali log ( this is thread safe )
if ( mPerformanceOutputBitmask & OUTPUT_DALI_LOG )
{
Integration::Log::LogMessage( Dali::Integration::Log::DebugInfo,
"%.6f (seconds), %s\n",
float( marker.GetTimeStamp().microseconds ) * MICROSECONDS_TO_SECOND,
description );
}
}
} // namespace Internal
} // namespace Adaptor
} // namespace Dali
| 27.845833 | 105 | 0.724226 | Coquinho |
6b778df8d301b3f59ef70bd1de11b3578c4ef526 | 6,493 | cpp | C++ | code/src/apps/celldetection-class/CellDetectorClass.cpp | pkainz/MICCAI2015 | 933e9e52d244ad1179713fe2f1dbb749d9e1f8d5 | [
"Apache-2.0"
] | 23 | 2015-12-14T06:06:45.000Z | 2022-03-25T10:51:42.000Z | code/src/apps/celldetection-class/CellDetectorClass.cpp | pkainz/MICCAI2015 | 933e9e52d244ad1179713fe2f1dbb749d9e1f8d5 | [
"Apache-2.0"
] | 3 | 2016-08-18T13:16:30.000Z | 2017-04-01T15:04:00.000Z | code/src/apps/celldetection-class/CellDetectorClass.cpp | pkainz/MICCAI2015 | 933e9e52d244ad1179713fe2f1dbb749d9e1f8d5 | [
"Apache-2.0"
] | 8 | 2015-08-18T10:31:06.000Z | 2020-12-30T13:55:01.000Z | /*
* CellDetectorClass.cpp
*
* Author: Philipp Kainz, Martin Urschler, Samuel Schulter, Paul Wohlhart, Vincent Lepetit
* Institution: Medical University of Graz and Graz University of Technology, Austria
*
*/
#include "CellDetectorClass.h"
CellDetectorClass::CellDetectorClass(TClassificationForest* rfin, AppContextCellDetClass* apphp) : m_apphp(apphp), m_rf(rfin) {
this->m_pwidth = m_apphp->patch_size[1];
this->m_pheight = m_apphp->patch_size[0];
}
/**
* Predict the distance transform image.
*
* @param src_img the source image
* @param pred_conf_img the confidence map of this image
*/
void CellDetectorClass::PredictImage(const cv::Mat& src_img, cv::Mat& pred_img){
if (!m_apphp->quiet)
cout << "Predicting... " << flush;
// 01) extract feature planes
std::vector<cv::Mat> img_features;
DataLoaderCellDetClass::ExtractFeatureChannelsObjectDetection(src_img, img_features, m_apphp);
// 02) initialize the prediction image (forest predicts floats!)
pred_img = cv::Mat::zeros(src_img.rows, src_img.cols, CV_32F);
// 03) use the m_rf and predict each pixel position of the image
// define the patch offsets
int xoffset = (int)(m_pwidth/2);
int yoffset = (int)(m_pheight/2);
// Define the search region
int startX = xoffset;
int endX = src_img.cols - xoffset;
int startY = yoffset;
int endY = src_img.rows - yoffset;
// set the pixel stride
int pixel_step = 1;
// iterate the image
SampleImgPatch imgpatch;
imgpatch.features = img_features;
// ALWAYS! compute the normalization feature mask
cv::Mat temp_mask;
temp_mask.create(cv::Size(src_img.cols, src_img.rows), CV_8U);
temp_mask.setTo(cv::Scalar::all(1.0));
cv::integral(temp_mask, imgpatch.normalization_feature_mask, CV_32F);
// we only have to fill the Sample in the labelled sample for testing ... so we use a dummy label
LabelMLClass dummy_label = LabelMLClass();
LabelledSample<SampleImgPatch, LabelMLClass>* labelled_sample =
new LabelledSample<SampleImgPatch, LabelMLClass>(imgpatch, dummy_label, 1.0, 0);
// move sliding window over the image
// y,x is the center pixel position to be predicted
float confidence_value_foreground;
int predicted_class;
for (int y = startY; y < endY; y += pixel_step)
{
for (int x = startX; x < endX; x += pixel_step)
{
// set the patch location in the image
labelled_sample->m_sample.x = x-xoffset;
labelled_sample->m_sample.y = y-yoffset;
LeafNodeStatisticsMLClass<SampleImgPatch, AppContextCellDetClass> stats(m_apphp);
stats = m_rf->TestAndAverage(labelled_sample);
// for (size_t c = 0; c < stats.m_class_histogram.size(); c++)
// cout << stats.m_class_histogram[c] << " ";
// cout << endl;
// get the maximum value from the histogram (this indicates the class)
std::vector<double>::iterator result;
result = std::max_element(stats.m_class_histogram.begin(), stats.m_class_histogram.end());
predicted_class = std::distance(stats.m_class_histogram.begin(), result);
// nevertheless just use the probability for foreground in the prediction image
confidence_value_foreground = stats.m_class_histogram[1];
pred_img.at<float>(y, x) = confidence_value_foreground;
//std::cout << confidence_value_foreground << std::endl;
}
//cout << "max class response: " << predicted_class << ", fg-probability: ";
//cout << confidence_value_foreground << endl;
}
if (!m_apphp->quiet)
cout << " done." << endl;
// delete the labelled sample, this is important otherwise, all the image features won't be free'd!
delete(labelled_sample);
{
cout << "Clearing feature map of prediction image" << endl;
std::vector<cv::Mat> tmp;
img_features.clear();
tmp.swap(img_features);
std::vector<cv::Mat> tmp2;
imgpatch.features.clear();
tmp2.swap(imgpatch.features);
}
}
// loads and predicts a single image
cv::Mat CellDetectorClass::PredictSingleImage(boost::filesystem::path file){
string filename = file.filename().string();
// Load image
cv::Mat src_img_raw = DataLoaderCellDetClass::ReadImageData(file.c_str(), false);
// scaling
cv::Mat src_img;
cv::Size new_size = cv::Size((int)((double)src_img_raw.cols*this->m_apphp->general_scaling_factor), (int)((double)src_img_raw.rows*this->m_apphp->general_scaling_factor));
resize(src_img_raw, src_img, new_size, 0, 0, cv::INTER_LINEAR);
// extend border if required
ExtendBorder(m_apphp, src_img, src_img, true);
// The predicted image
cv::Mat pred_img;
// predict the image
this->PredictImage(src_img, pred_img);
// cv::namedWindow("prediction", CV_WINDOW_AUTOSIZE );
// cv::imshow("prediction", _8bit);
// cv::waitKey(0);
// store the predicted image to the hd
if (m_apphp->store_predictionimages == 1)
{
if (!m_apphp->quiet){
cout << "Storing prediction image to " << m_apphp->path_predictionimages << filename << endl;
}
// convert output image
cv::Mat tmp;
cv::normalize(pred_img, pred_img, 0, 255, cv::NORM_MINMAX, CV_8U);
pred_img.convertTo(tmp, CV_8U);
cv::imwrite(m_apphp->path_predictionimages + filename, tmp);
}
return pred_img;
}
/**
* Loads the images from a directory and produces the prediction results.
* Post-processing is done in matlab.
*/
void CellDetectorClass::PredictTestImages(){
// 01) read all images from the test path
vector<boost::filesystem::path> testImgFilenames;
testImgFilenames.clear();
ls(m_apphp->path_testdata, ".*png", testImgFilenames);
// 1) read the source data
if (!m_apphp->quiet)
cout << "Using " << testImgFilenames.size() << " images for testing ..." << endl;
// Run detector for each image
#pragma omp parallel for
for (size_t i = 0; i < testImgFilenames.size(); i++)
{
this->PredictSingleImage(testImgFilenames[i]);
// Status message
if (!m_apphp->quiet)
cout << "Done predicting image " << i + 1 << " / " << testImgFilenames.size() << endl;
}
if (!m_apphp->quiet)
cout << "Done predicting all images." << endl;
}
| 35.097297 | 175 | 0.652087 | pkainz |
6b7b3a65f4277ffa6cf15de6369cc343a7ff1b03 | 6,188 | cpp | C++ | SDK/Examples/FilamentViewer/FilamentViewer/Quesa to Filament/GeomToRenderable.cpp | h-haris/Quesa | a438ab824291ce6936a88dfae4fd0482dcba1247 | [
"BSD-3-Clause"
] | 24 | 2019-10-28T07:01:48.000Z | 2022-03-04T16:10:39.000Z | SDK/Examples/FilamentViewer/FilamentViewer/Quesa to Filament/GeomToRenderable.cpp | h-haris/Quesa | a438ab824291ce6936a88dfae4fd0482dcba1247 | [
"BSD-3-Clause"
] | 8 | 2020-04-22T19:42:45.000Z | 2021-04-30T16:28:32.000Z | SDK/Examples/FilamentViewer/FilamentViewer/Quesa to Filament/GeomToRenderable.cpp | h-haris/Quesa | a438ab824291ce6936a88dfae4fd0482dcba1247 | [
"BSD-3-Clause"
] | 6 | 2019-09-22T14:44:15.000Z | 2021-04-01T20:04:29.000Z | //
// GeomToRenderable.cpp
// FilamentViewer
//
// Created by James Walker on 6/3/21.
//
/* ___________________________________________________________________________
COPYRIGHT:
Copyright (c) 2021, Quesa Developers. All rights reserved.
For the current release of Quesa, please see:
<https://github.com/jwwalker/Quesa>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
o Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
o 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.
o Neither the name of Quesa nor the names of its contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
___________________________________________________________________________
*/
#include "GeomToRenderable.h"
#import "BaseMaterials.h"
#import "CQ3AttributeSet_Inherit.h"
#import "GeomCache.h"
#import "LogToConsole.h"
#import "MakeMaterialInstance.h"
#import "ObjectName.h"
#import "RenderableGeom.h"
#import "TextureManager.h"
#import <Quesa/QuesaGeometry.h>
#import <Quesa/QuesaMath.h>
#import <Quesa/QuesaSet.h>
#import <Quesa/QuesaShader.h>
#import <Quesa/QuesaStyle.h>
#import <Quesa/QuesaView.h>
#import <Quesa/CQ3ObjectRef_Gets.h>
#import <filament/RenderableManager.h>
#import <filament/Box.h>
#import <filament/Material.h>
#import <filament/MaterialInstance.h>
#import <filament/TextureSampler.h>
#import <filament/Color.h>
#import <filamat/MaterialBuilder.h>
#import <assert.h>
#import <vector>
#import <memory>
#import <string>
using namespace filament;
static sharedRenderableGeom InnerGeomToRenderable(
TQ3GeometryObject inGeom,
sharedFilaGeom inFilaGeom,
TQ3FillStyle inFillStyle,
TQ3AttributeSet inOuterAtts,
TQ3ViewObject inView,
filament::Engine& inEngine,
BaseMaterials& inBaseMaterials,
const std::string& inPartName,
TextureManager& inTxMgr,
filament::Texture* inDummyTexture )
{
sharedRenderableGeom result( new RenderableGeom( inEngine, inPartName ) );
result->_geom = inFilaGeom;
result->_srcGeom.Assign( inGeom );
CQ3ObjectRef geomAtts( CQ3Geometry_GetAttributeSet( inGeom ) );
CQ3ObjectRef effectiveAtts( CQ3AttributeSet_Inherit( inOuterAtts, geomAtts.get() ) );
result->_mat = MakeMaterialInstance( inBaseMaterials, effectiveAtts.get(),
inView, inPartName, inTxMgr, inDummyTexture, inFilaGeom->_primitiveType,
inFilaGeom->_hasVertexColors, inEngine );
TQ3Boolean castShadows = kQ3True;
TQ3Boolean receiveShadows = kQ3True;
Q3View_GetCastShadowsStyleState( inView, &castShadows );
Q3View_GetReceiveShadowsStyleState( inView, &receiveShadows );
bool isPoint = (inFilaGeom->_primitiveType == filament::backend::PrimitiveType::POINTS);
if (isPoint)
{
castShadows = receiveShadows = kQ3False;
}
RenderableManager::Builder myBuilder( 1 );
myBuilder
.boundingBox( inFilaGeom->_localBounds )
.material( 0, result->_mat.get() )
.geometry( 0,
inFilaGeom->EffectivePrimitiveType( inFillStyle ),
inFilaGeom->_vb.get(),
inFilaGeom->IndexBuffer( inFillStyle ).get() )
.culling( isPoint? false : true )
.receiveShadows( receiveShadows != kQ3False )
.castShadows( castShadows != kQ3False );
myBuilder.build( inEngine, result->_entity );
return result;
}
/*!
@function GeomToRenderable
@abstract Convert a Quesa geometry to a Filament renderable.
@discussion We assume that this is called from within a submitting loop, so that you can get
current style states from the view.
@param inGeom A Quesa Geometry.
@param inOuterAtts A set of attributes which will be combined with the attribute set
of the geometry.
@param inView The Quesa view in which the geometry is being submitted.
@param inEngine A Filament Engine.
@param inBaseMaterials Some parametrized Materials.
@param inTxMgr Cache of textures.
@param inDummyTexture A dummy texture to use if the geometry is not textured.
@param inGeomCache Cache mapping Quesa geometry to Filament geometry buffers.
@result A renderable.
*/
sharedRenderableGeom GeomToRenderable(
TQ3GeometryObject inGeom,
TQ3AttributeSet inOuterAtts,
TQ3ViewObject inView,
filament::Engine& inEngine,
BaseMaterials& inBaseMaterials,
TextureManager& inTxMgr,
filament::Texture* inDummyTexture,
GeomCache& inGeomCache )
{
sharedRenderableGeom result;
TQ3FillStyle fillStyle = kQ3FillStyleFilled;
Q3View_GetFillStyleState( inView, &fillStyle );
sharedFilaGeom filaGeom = inGeomCache.GetGeom( inGeom, fillStyle );
if (filaGeom.get() != nullptr)
{
std::string name( ObjectName( inGeom ) );
result = InnerGeomToRenderable( inGeom, filaGeom, fillStyle,
inOuterAtts, inView,
inEngine, inBaseMaterials, name, inTxMgr, inDummyTexture );
}
return result;
}
| 34.960452 | 93 | 0.730608 | h-haris |
6b7d20cc507e453e49708c2418f6d67abf3326f8 | 3,133 | cpp | C++ | paddle/gserver/layers/IdentityProjection.cpp | TarzanQll/Paddle-master | 1f192b22c641f91bd98a5babe7189ac5d7d3b408 | [
"Apache-2.0"
] | 1 | 2016-10-23T09:31:38.000Z | 2016-10-23T09:31:38.000Z | paddle/gserver/layers/IdentityProjection.cpp | TarzanQll/Paddle-master | 1f192b22c641f91bd98a5babe7189ac5d7d3b408 | [
"Apache-2.0"
] | 3 | 2016-10-22T16:06:11.000Z | 2016-11-07T06:30:37.000Z | paddle/gserver/layers/IdentityProjection.cpp | TarzanQll/Paddle-master | 1f192b22c641f91bd98a5babe7189ac5d7d3b408 | [
"Apache-2.0"
] | 1 | 2019-10-26T12:51:13.000Z | 2019-10-26T12:51:13.000Z | /* Copyright (c) 2016 Baidu, Inc. All Rights Reserve.
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 "paddle/utils/Stat.h"
#include "Projection.h"
namespace paddle {
/**
* IdentityProjection performs addition:
* \f[
* out.row[i] += in.row[i]
* \f]
*
* The config file api is identity_projection.
*/
class IdentityProjection : public Projection {
public:
IdentityProjection(const ProjectionConfig& config,
const ParameterPtr& parameter, bool useGpu);
virtual void forward();
virtual void backward(const UpdateCallback& callback);
};
REGISTER_PROJECTION(identity, IdentityProjection);
/**
* Constructed function.
* @note IdentityProjection should not have any parameter.
*/
IdentityProjection::IdentityProjection(const ProjectionConfig& config,
const ParameterPtr& parameter,
bool useGpu)
: Projection(config, parameter, useGpu) {
CHECK(!parameter) << "'identity' projection should not have any parameter";
}
void IdentityProjection::forward() { out_->value->add(*in_->value); }
void IdentityProjection::backward(const UpdateCallback& callback) {
if (in_->grad) {
in_->grad->add(*out_->grad);
}
}
/**
* IdentityOffsetProjection likes IdentityProjection, but layer size may be
* smaller
* than input size. It selects dimensions [offset, offset+layer_size) from input
* to
* perform addition:
* \f[
* out.row[i] += in.row[i + \textrm{offset}]
* \f]
*
* The config file api is identity_projection.
*/
class IdentityOffsetProjection : public Projection {
public:
IdentityOffsetProjection(const ProjectionConfig& config,
const ParameterPtr& parameter, bool useGpu);
virtual void forward();
virtual void backward(const UpdateCallback& callback);
};
REGISTER_PROJECTION(identity_offset, IdentityOffsetProjection);
/**
* Constructed function.
* @note IdentityOffsetProjection should not have any parameter.
*/
IdentityOffsetProjection::IdentityOffsetProjection(
const ProjectionConfig& config, const ParameterPtr& parameter, bool useGpu)
: Projection(config, parameter, useGpu) {
CHECK(!parameter) << "'identity_offset' projection "
"should not have any parameter";
CHECK_LE(config.output_size() + config.offset(), config.input_size());
}
void IdentityOffsetProjection::forward() {
out_->value->addAtOffset(*in_->value, config_.offset());
}
void IdentityOffsetProjection::backward(const UpdateCallback& callback) {
if (in_->grad) {
in_->grad->addAtOffset(*out_->grad, config_.offset());
}
}
} // namespace paddle
| 30.417476 | 80 | 0.710182 | TarzanQll |
6b8616869162bc986ad83782fd880beb74c8a518 | 554 | cpp | C++ | src/demo/benchmark_suite/functions/Sphere.cpp | geneial/geneial | 5e525c32b7c1e1e88788644e448e9234c93b55e2 | [
"MIT"
] | 5 | 2015-08-25T15:40:09.000Z | 2020-03-15T19:33:22.000Z | src/demo/benchmark_suite/functions/Sphere.cpp | geneial/geneial | 5e525c32b7c1e1e88788644e448e9234c93b55e2 | [
"MIT"
] | null | null | null | src/demo/benchmark_suite/functions/Sphere.cpp | geneial/geneial | 5e525c32b7c1e1e88788644e448e9234c93b55e2 | [
"MIT"
] | 3 | 2019-01-24T13:14:51.000Z | 2022-01-03T07:30:20.000Z | #include "Sphere.h"
#include <numeric>
#include <cmath>
#include <iostream>
double Sphere::compute(const std::vector<double>& coordinates) const
{
const double sum = std::accumulate(coordinates.begin(), coordinates.end(), 0.0, [](double a, double b)
{
return a + std::pow(b,2);
});
return sum;
}
std::vector<double> Sphere::getMinima(const unsigned int num_dimension) const
{
unsigned int dimleft = num_dimension;
std::vector<double> res;
while(dimleft--)
{
res.emplace_back(0);
}
return res;
}
| 21.307692 | 106 | 0.644404 | geneial |
6b87810b20a9ec133ef2907ef636a66a44de7510 | 1,098 | cpp | C++ | tests/texture_atlas.cpp | mnewhouse/tselements | bd1c6724018e862156948a680bb1bc70dd28bef6 | [
"MIT"
] | null | null | null | tests/texture_atlas.cpp | mnewhouse/tselements | bd1c6724018e862156948a680bb1bc70dd28bef6 | [
"MIT"
] | null | null | null | tests/texture_atlas.cpp | mnewhouse/tselements | bd1c6724018e862156948a680bb1bc70dd28bef6 | [
"MIT"
] | null | null | null | /*
* TS Elements
* Copyright 2015-2018 M. Newhouse
* Released under the MIT license.
*/
#include "catch.hpp"
#include "utility/texture_atlas.hpp"
#include <vector>
#include <iostream>
using namespace ts;
using utility::TextureAtlas;
TEST_CASE("Let's see if the texture atlas works and packs in an efficient manner.")
{
TextureAtlas atlas;
REQUIRE_FALSE(atlas.insert({ 100, 100 }));
atlas = TextureAtlas({ 512, 512 });
atlas.set_padding(0);
REQUIRE(atlas.insert({ 512, 256 }));
// No room for this one
REQUIRE_FALSE(atlas.insert({ 512, 300 }));
std::vector<IntRect> rects;
for (int i = 0; i != 20; ++i)
{
auto rect = atlas.insert({ 50, 128 });
REQUIRE(rect);
if (rect) rects.push_back(*rect);
}
REQUIRE(atlas.insert({ 12, 128 }));
REQUIRE(atlas.insert({ 12, 128 }));
// Make sure none of the rectangles we got intersect with each other.
for (auto outer = rects.begin(); outer != rects.end(); ++outer)
{
for (auto inner = std::next(outer); inner != rects.end(); ++inner)
{
REQUIRE_FALSE(intersects(*inner, *outer));
}
}
}
| 21.529412 | 83 | 0.641166 | mnewhouse |
6b8938d3b05591ed8a0822f19d89b89be68ab87a | 5,135 | hpp | C++ | src/crypto/crypto/crypto.hpp | games-on-whales/wolf | cd5aa47e0547d1bc7b093fb6cdd0582eae78b391 | [
"MIT"
] | 1 | 2021-12-30T13:15:05.000Z | 2021-12-30T13:15:05.000Z | src/crypto/crypto/crypto.hpp | games-on-whales/wolf | cd5aa47e0547d1bc7b093fb6cdd0582eae78b391 | [
"MIT"
] | null | null | null | src/crypto/crypto/crypto.hpp | games-on-whales/wolf | cd5aa47e0547d1bc7b093fb6cdd0582eae78b391 | [
"MIT"
] | null | null | null | #pragma once
#include <openssl/aes.h>
#include <openssl/x509.h>
#include <optional>
#include <string>
namespace crypto {
/**
* @brief Generates length random bytes using a cryptographically secure pseudo random generator (CSPRNG)
*/
std::string random(int length);
/**
* Encrypt the given msg using AES ecb at 128 bit
*
* @param msg: the message to be encrypted
* @param enc_key: the key used for encryption
* @param iv: optional, if not provided a random one will be generated
* @param padding: optional, enables or disables padding
* @return: the encrypted string
*/
std::string aes_encrypt_ecb(const std::string &msg,
const std::string &enc_key,
const std::string &iv = random(AES_BLOCK_SIZE),
bool padding = false);
/**
* Decrypt the given msg using AES ecb at 128 bit
*
* @param msg: the message to be encrypted
* @param enc_key: the key used for encryption
* @param iv: optional, if not provided a random one will be generated
* @param padding: optional, enables or disables padding
* @return: the decrypted string
*/
std::string aes_decrypt_ecb(const std::string &msg,
const std::string &enc_key,
const std::string &iv = random(AES_BLOCK_SIZE),
bool padding = false);
/**
* Will sign the given message using the private key
* @param msg: the message to be signed
* @param private_key: the key used for signing
* @return: the signature binary data
*/
std::string sign(const std::string &msg, const std::string &private_key);
/**
* Will verify that the signature for the given message has been generated by the public_key
* @param msg: the message that was originally signed
* @param signature: the signature data
* @param public_key: the public key, used to verify the signature
* @return: true if the signature is correct, false otherwise.
*/
bool verify(const std::string &msg, const std::string &signature, const std::string &public_key);
/**
* @brief returns the SHA256 hash of the given str
*/
std::string sha256(const std::string &str);
/**
* @brief converts the given input into a HEX string
*/
std::string str_to_hex(const std::string &input);
/**
* @brief takes an HEX vector and returns a string representation of it.
*/
std::string hex_to_str(const std::string &hex, bool reverse);
} // namespace crypto
/**
* @brief Wrappers on top of OpenSSL methods in order to deal with x509 certificates
*
* Adapted from: https://gist.github.com/nathan-osman/5041136
*/
namespace x509 {
/**
* @brief Generates a 2048-bit RSA key.
*
* @return EVP_PKEY*: a ptr to a private key
*/
EVP_PKEY *generate_key();
/**
* @brief Generates a self-signed x509 certificate.
*
* @param pkey: a private key generated with generate_key()
* @return X509*: a pointer to a x509 certificate
*/
X509 *generate_x509(EVP_PKEY *pkey);
/**
* @brief Reads a X509 certificate string
*/
X509 *cert_from_string(const std::string &cert);
/**
* @brief Reads a X509 certificate from file
*/
X509 *cert_from_file(const std::string &cert_path);
/**
* @brief Reads a private key from file
*/
EVP_PKEY *pkey_from_file(const std::string &pkey_path);
/**
* @brief Write cert and key to disk
*
* @param pkey: a private key generated with generate_key()
* @param pkey_filename: the name of the key file to be saved
* @param x509: a certificate generated with generate_x509()
* @param cert_filename: the name of the cert file to be saved
* @return true when both pkey and x509 are stored on disk
* @return false when one or both failed
*/
bool write_to_disk(EVP_PKEY *pkey, const std::string &pkey_filename, X509 *x509, const std::string &cert_filename);
/**
* @param pkey_filename: the name of the key file to be saved
* @param cert_filename: the name of the cert file to be saved
* @return true when both files are present
*/
bool cert_exists(const std::string &pkey_filename, const std::string &cert_filename);
/**
* @return the certificate signature
*/
std::string get_cert_signature(const X509 *cert);
/**
* @param private_key: set to true if EVP_PKEY is a private key, set to false for public keys
* @return the key content in plaintext
*/
std::string get_key_content(EVP_PKEY *pkey, bool private_key);
/**
* @return the private key content
*/
std::string get_pkey_content(EVP_PKEY *pkey);
/**
* @return the certificate in pem format
*/
std::string get_cert_pem(const X509 &x509);
/**
*
* @return the certificate public key content
*/
std::string get_cert_public_key(X509 *cert);
/**
* Checks that the paired_cert is a valid chain for untrusted_cert.
* @return std::nullopt if the verification runs fine, else the error message
*/
std::optional<std::string> verification_error(X509 *paired_cert, X509 *untrusted_cert);
/**
* @brief: cleanup pointers after use
*
* TODO: replace with smart pointers?
*
* @param pkey: a private key generated with generate_key()
* @param x509: a certificate generated with generate_x509()
*/
void cleanup(EVP_PKEY *pkey, X509 *cert);
} // namespace x509 | 29.511494 | 115 | 0.699708 | games-on-whales |
6b89f70aed90f8504ee7392cc765f50211d0aff9 | 968 | hpp | C++ | src/host/registry.hpp | Ghosty141/Terminal | c1220435bea5790ea3596b30568f724b74ce5dda | [
"MIT"
] | 5 | 2019-05-10T19:37:22.000Z | 2021-02-14T12:22:35.000Z | src/host/registry.hpp | Ghosty141/Terminal | c1220435bea5790ea3596b30568f724b74ce5dda | [
"MIT"
] | 2 | 2019-05-27T11:40:16.000Z | 2019-09-03T05:58:42.000Z | src/host/registry.hpp | Ghosty141/Terminal | c1220435bea5790ea3596b30568f724b74ce5dda | [
"MIT"
] | 2 | 2019-12-21T19:14:22.000Z | 2021-02-17T16:12:52.000Z | /*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- registry.hpp
Abstract:
- This module is used for reading/writing registry operations
Author(s):
- Michael Niksa (MiNiksa) 23-Jul-2014
- Paul Campbell (PaulCam) 23-Jul-2014
Revision History:
- From components of srvinit.c
--*/
#pragma once
#include "precomp.h"
class Registry
{
public:
Registry(_In_ Settings* const pSettings);
~Registry();
void LoadGlobalsFromRegistry();
void LoadDefaultFromRegistry();
void LoadFromRegistry(_In_ PCWSTR const pwszConsoleTitle);
void GetEditKeys(_In_opt_ HKEY hConsoleKey) const;
private:
void _LoadMappedProperties(_In_reads_(cPropertyMappings) const RegistrySerialization::RegPropertyMap* const rgPropertyMappings,
const size_t cPropertyMappings,
const HKEY hKey);
Settings* const _pSettings;
};
| 22.511628 | 132 | 0.679752 | Ghosty141 |
6b8d0938aeccd4302da2742c7bc8b8af96b1a92a | 3,716 | hpp | C++ | gsMassAssembler.hpp | gismo/gsElasticity | a94347d4b8d8cd76de79d4b512023be9b68363bf | [
"BSD-3-Clause-Attribution"
] | 7 | 2020-04-24T04:11:02.000Z | 2021-09-18T19:24:10.000Z | gsMassAssembler.hpp | gismo/gsElasticity | a94347d4b8d8cd76de79d4b512023be9b68363bf | [
"BSD-3-Clause-Attribution"
] | 1 | 2021-08-16T20:41:48.000Z | 2021-08-16T20:41:48.000Z | gsMassAssembler.hpp | gismo/gsElasticity | a94347d4b8d8cd76de79d4b512023be9b68363bf | [
"BSD-3-Clause-Attribution"
] | 6 | 2020-05-12T11:11:51.000Z | 2021-10-21T14:13:46.000Z | /** @file gsElMassAssembler.hpp
@brief Provides mass matrix for elasticity systems in 2D plain strain and 3D continua.
This file is part of the G+Smo library.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Author(s):
O. Weeger (2012 - 2015, TU Kaiserslautern),
A.Shamanskiy (2016 - ...., TU Kaiserslautern)
*/
#pragma once
#include <gsElasticity/gsMassAssembler.h>
#include <gsElasticity/gsBasePde.h>
#include <gsElasticity/gsVisitorMass.h>
namespace gismo
{
template<class T>
gsMassAssembler<T>::gsMassAssembler(const gsMultiPatch<T> & patches,
const gsMultiBasis<T> & basis,
const gsBoundaryConditions<T> & bconditions,
const gsFunction<T> & body_force)
{
// Originally concieved as a meaningful class, now gsPde is just a container for
// the domain, boundary conditions and the right-hand side;
// any derived class can surve this purpuse, for example gsPoissonPde;
// TUDO: change/remove gsPde from gsAssembler logic
gsPiecewiseFunction<T> rightHandSides;
rightHandSides.addPiece(body_force);
typename gsPde<T>::Ptr pde( new gsBasePde<T>(patches,bconditions,rightHandSides) );
// gsAssembler<>::initialize requires a vector of bases, one for each unknown;
// different bases are used to compute Dirichlet DoFs;
// but always the first basis is used for the assembly;
// TODO: change gsAssembler logic
m_dim = body_force.targetDim();
for (short_t d = 0; d < m_dim; ++d)
m_bases.push_back(basis);
Base::initialize(pde, m_bases, defaultOptions());
}
template <class T>
gsOptionList gsMassAssembler<T>::defaultOptions()
{
gsOptionList opt = Base::defaultOptions();
opt.addReal("Density","Density of the material",1.);
return opt;
}
template <class T>
void gsMassAssembler<T>::refresh()
{
GISMO_ENSURE(m_dim == m_pde_ptr->domain().parDim(), "The RHS dimension and the domain dimension don't match!");
GISMO_ENSURE(m_dim == 2 || m_dim == 3, "Only two- and three-dimenstion domains are supported!");
std::vector<gsDofMapper> m_dofMappers(m_bases.size());
for (unsigned d = 0; d < m_bases.size(); d++)
m_bases[d].getMapper((dirichlet::strategy)m_options.getInt("DirichletStrategy"),
iFace::glue,m_pde_ptr->bc(),m_dofMappers[d],d,true);
m_system = gsSparseSystem<T>(m_dofMappers,gsVector<index_t>::Ones(m_bases.size()));
m_options.setReal("bdO",m_bases.size()*(1+m_options.getReal("bdO"))-1);
m_system.reserve(m_bases[0], m_options, 1);
for (unsigned d = 0; d < m_bases.size(); ++d)
Base::computeDirichletDofs(d);
}
template<class T>
void gsMassAssembler<T>::assemble(bool saveEliminationMatrix)
{
// allocate space for the linear system
m_system.matrix().setZero();
m_system.reserve(m_bases[0], m_options, 1);
m_system.rhs().setZero(Base::numDofs(),1);
if (saveEliminationMatrix)
{
eliminationMatrix.resize(Base::numDofs(),Base::numFixedDofs());
eliminationMatrix.setZero();
eliminationMatrix.reservePerColumn(m_system.numColNz(m_bases[0],m_options));
}
gsVisitorMass<T> visitor(saveEliminationMatrix ? &eliminationMatrix : nullptr);
Base::template push<gsVisitorMass<T> >(visitor);
m_system.matrix().makeCompressed();
if (saveEliminationMatrix)
{
Base::rhsWithZeroDDofs = m_system.rhs();
eliminationMatrix.makeCompressed();
}
}
}// namespace gismo ends
| 34.728972 | 115 | 0.67465 | gismo |
6b91940f5e4de26027991a0e6671bceb3c08b61c | 3,735 | cc | C++ | firestore/src/common/listener_registration.cc | NetsoftHoldings/firebase-cpp-sdk | 356c63bddde5ed76483cbfc5f3ff5b228c5cbe1f | [
"Apache-2.0"
] | null | null | null | firestore/src/common/listener_registration.cc | NetsoftHoldings/firebase-cpp-sdk | 356c63bddde5ed76483cbfc5f3ff5b228c5cbe1f | [
"Apache-2.0"
] | null | null | null | firestore/src/common/listener_registration.cc | NetsoftHoldings/firebase-cpp-sdk | 356c63bddde5ed76483cbfc5f3ff5b228c5cbe1f | [
"Apache-2.0"
] | null | null | null | #include "firestore/src/include/firebase/firestore/listener_registration.h"
#include <utility>
#include "firestore/src/common/cleanup.h"
#if defined(__ANDROID__)
#include "firestore/src/android/listener_registration_android.h"
#elif defined(FIRESTORE_STUB_BUILD)
#include "firestore/src/stub/listener_registration_stub.h"
#else
#include "firestore/src/ios/listener_registration_ios.h"
#endif // defined(__ANDROID__)
namespace firebase {
namespace firestore {
// ListenerRegistration specific fact:
// ListenerRegistration does NOT own the ListenerRegistrationInternal object,
// which is different from other wrapper types. FirestoreInternal owns all
// ListenerRegistrationInternal objects instead. So FirestoreInternal can
// remove all listeners upon destruction.
using CleanupFnListenerRegistration =
CleanupFn<ListenerRegistration, ListenerRegistrationInternal>;
ListenerRegistration::ListenerRegistration() : ListenerRegistration(nullptr) {}
ListenerRegistration::ListenerRegistration(
const ListenerRegistration& registration)
: firestore_(registration.firestore_) {
internal_ = registration.internal_;
CleanupFnListenerRegistration::Register(this, firestore_);
}
ListenerRegistration::ListenerRegistration(ListenerRegistration&& registration)
: firestore_(registration.firestore_) {
CleanupFnListenerRegistration::Unregister(®istration,
registration.firestore_);
std::swap(internal_, registration.internal_);
CleanupFnListenerRegistration::Register(this, firestore_);
}
ListenerRegistration::ListenerRegistration(
ListenerRegistrationInternal* internal)
: firestore_(internal == nullptr ? nullptr
: internal->firestore_internal()),
internal_(internal) {
CleanupFnListenerRegistration::Register(this, firestore_);
}
ListenerRegistration::~ListenerRegistration() {
CleanupFnListenerRegistration::Unregister(this, firestore_);
internal_ = nullptr;
}
ListenerRegistration& ListenerRegistration::operator=(
const ListenerRegistration& registration) {
if (this == ®istration) {
return *this;
}
firestore_ = registration.firestore_;
CleanupFnListenerRegistration::Unregister(this, firestore_);
internal_ = registration.internal_;
CleanupFnListenerRegistration::Register(this, firestore_);
return *this;
}
ListenerRegistration& ListenerRegistration::operator=(
ListenerRegistration&& registration) {
if (this == ®istration) {
return *this;
}
firestore_ = registration.firestore_;
CleanupFnListenerRegistration::Unregister(®istration,
registration.firestore_);
CleanupFnListenerRegistration::Unregister(this, firestore_);
internal_ = registration.internal_;
CleanupFnListenerRegistration::Register(this, firestore_);
return *this;
}
void ListenerRegistration::Remove() {
// The check for firestore_ is required. User can hold a ListenerRegistration
// instance indefinitely even after Firestore is destructed, in which case
// firestore_ will be reset to nullptr by the Cleanup function.
// The check for internal_ is optional. Actually internal_ can be of following
// cases:
// * nullptr if already called Remove() on the same instance;
// * not nullptr but invalid if Remove() is called on a copy of this;
// * not nullptr and valid.
// Unregister a nullptr or invalid ListenerRegistration is a no-op.
if (internal_ && firestore_) {
firestore_->UnregisterListenerRegistration(internal_);
internal_ = nullptr;
}
}
void ListenerRegistration::Cleanup() {
Remove();
firestore_ = nullptr;
}
} // namespace firestore
} // namespace firebase
| 34.583333 | 80 | 0.754752 | NetsoftHoldings |
6b91b26cc8afa584c77f7a9c3aa088a64679542d | 3,172 | cpp | C++ | Homework01v2/Matrix4D.cpp | Nazul/MSC-CG_OpenGL | 266823851b09a72aebcd9c62e806db36e7ec7409 | [
"Apache-2.0"
] | null | null | null | Homework01v2/Matrix4D.cpp | Nazul/MSC-CG_OpenGL | 266823851b09a72aebcd9c62e806db36e7ec7409 | [
"Apache-2.0"
] | null | null | null | Homework01v2/Matrix4D.cpp | Nazul/MSC-CG_OpenGL | 266823851b09a72aebcd9c62e806db36e7ec7409 | [
"Apache-2.0"
] | null | null | null | #include "stdafx.h"
#include "Matrix4D.h"
#include <math.h>
MATRIX4D operator*(MATRIX4D & A, MATRIX4D & B) {
MATRIX4D R = Zero();
for (int j = 0; j < 4; j++)
for (int i = 0; i < 4; i++)
for (int k = 0; k < 4; k++)
R.m[j][i] += A.m[j][k] * B.m[k][i];
return R;
}
VECTOR4D operator*(MATRIX4D & A, VECTOR4D & V) {
VECTOR4D R = { 0, 0, 0, 0 };
for (int j = 0; j < 4; j++)
for (int i = 0; i < 4; i++)
R.v[j] += A.m[j][i] * V.v[i];
return R;
}
VECTOR4D operator*(VECTOR4D & V, MATRIX4D & A) {
VECTOR4D R = { 0, 0, 0, 0 };
for (int j = 0; j < 4; j++)
for (int i = 0; i < 4; i++)
R.v[j] += A.m[i][j] * V.v[i];
return R;
}
VECTOR4D operator*(VECTOR4D & A, VECTOR4D & B) {
VECTOR4D R = { A.x * B.x, A.y * B.y, A.z * B.z, A.w * B.w };
return R;
}
VECTOR4D Cross3(VECTOR4D & A, VECTOR4D & B) {
VECTOR4D R;
R.x = A.y * B.z - A.z * B.y;
R.y = B.x * A.z - B.z * A.x;
R.z = A.x * B.y - A.y * B.x;
R.w = 0;
return R;
}
float Dot(VECTOR4D & A, VECTOR4D & B) {
return A.x * B.x + A.y * B.y + A.z * B.z + A.w * B.w;
}
float Magnity(VECTOR4D & A) {
return sqrtf(Dot(A, A));
}
VECTOR4D Normalize(VECTOR4D & A) {
float inv = 1.0f / Magnity(A);
VECTOR4D R = { A.x * inv, A.y * inv, A.z * inv, A.w * inv };
return R;
}
MATRIX4D Zero() {
MATRIX4D R;
for (int i = 0; i < 16; i++)
R.v[i] = 0.0f;
return R;
}
MATRIX4D Identity() {
MATRIX4D R;
R.vec[0] = { 1.0f, 0.0f, 0.0f, 0.0f };
R.vec[1] = { 0.0f, 1.0f, 0.0f, 0.0f };
R.vec[2] = { 0.0f, 0.0f, 1.0f, 0.0f };
R.vec[3] = { 0.0f, 0.0f, 0.0f, 1.0f };
return R;
}
MATRIX4D RotationX(float theta) {
MATRIX4D R = Zero();
R.m00 = 1.0f;
R.m01 = 0.0f;
R.m02 = 0.0f;
R.m03 = 0.0f;
R.m10 = 0.0f;
R.m11 = cosf(theta * PI / 180.0f);
R.m12 = -sinf(theta * PI / 180.0f);
R.m13 = 0.0f;
R.m20 = 0.0f;
R.m21 = sinf(theta * PI / 180.0f);
R.m22 = cosf(theta * PI / 180.0f);
R.m23 = 0.0f;
R.m30 = 0.0f;
R.m31 = 0.0f;
R.m32 = 0.0f;
R.m33 = 1.0f;
return R;
}
MATRIX4D RotationY(float theta) {
MATRIX4D R = Zero();
R.m00 = cosf(theta * PI / 180.0f);
R.m01 = 0.0f;
R.m02 = sinf(theta * PI / 180.0f);
R.m03 = 0.0f;
R.m10 = 0.0f;
R.m11 = 1.0f;
R.m12 = 0.0f;
R.m13 = 0.0f;
R.m20 = -sinf(theta * PI / 180.0f);
R.m21 = 0.0f;
R.m22 = cosf(theta * PI / 180.0f);
R.m23 = 0.0f;
R.m30 = 0.0f;
R.m31 = 0.0f;
R.m32 = 0.0f;
R.m33 = 1.0f;
return R;
}
MATRIX4D RotationZ(float theta) {
MATRIX4D R = Zero();
R.m00 = cosf(theta * PI / 180.0f);
R.m01 = -sinf(theta * PI / 180.0f);
R.m02 = 0.0f;
R.m03 = 0.0f;
R.m10 = sinf(theta * PI / 180.0f);
R.m11 = cosf(theta * PI / 180.0f);
R.m12 = 0.0f;
R.m13 = 0.0f;
R.m20 = 0.0f;
R.m21 = 0.0f;
R.m22 = 0.0f;
R.m23 = 0.0f;
R.m30 = 0.0f;
R.m31 = 0.0f;
R.m32 = 0.0f;
R.m33 = 1.0f;
return R;
}
MATRIX4D Translation(float dx, float dy, float dz) {
MATRIX4D R = Identity();
R.vec[0].w = dx;
R.vec[1].w = dy;
R.vec[2].w = dz;
return R;
}
MATRIX4D Scaling(float dx, float dy, float dz) {
return MATRIX4D();
}
MATRIX4D View(VECTOR4D & EyePos, VECTOR4D & Target, VECTOR4D & Up) {
return MATRIX4D();
}
| 18.549708 | 68 | 0.50662 | Nazul |
6b944121c76ab19157aa731af2fbefcb3ec68d43 | 3,362 | cpp | C++ | wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp | liorsagy/allwpilib | 3838cc4ec48d4bf38815565fab016f0c4f746585 | [
"BSD-3-Clause"
] | null | null | null | wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp | liorsagy/allwpilib | 3838cc4ec48d4bf38815565fab016f0c4f746585 | [
"BSD-3-Clause"
] | null | null | null | wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp | liorsagy/allwpilib | 3838cc4ec48d4bf38815565fab016f0c4f746585 | [
"BSD-3-Clause"
] | null | null | null | // Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "frc/filter/LinearFilter.h" // NOLINT(build/include_order)
#include <cmath>
#include <functional>
#include <memory>
#include <random>
#include <wpi/numbers>
#include "gtest/gtest.h"
#include "units/time.h"
// Filter constants
static constexpr auto kFilterStep = 5_ms;
static constexpr auto kFilterTime = 2_s;
static constexpr double kSinglePoleIIRTimeConstant = 0.015915;
static constexpr double kSinglePoleIIRExpectedOutput = -3.2172003;
static constexpr double kHighPassTimeConstant = 0.006631;
static constexpr double kHighPassExpectedOutput = 10.074717;
static constexpr int32_t kMovAvgTaps = 6;
static constexpr double kMovAvgExpectedOutput = -10.191644;
enum LinearFilterOutputTestType {
kTestSinglePoleIIR,
kTestHighPass,
kTestMovAvg,
kTestPulse
};
static double GetData(double t) {
return 100.0 * std::sin(2.0 * wpi::numbers::pi * t) +
20.0 * std::cos(50.0 * wpi::numbers::pi * t);
}
static double GetPulseData(double t) {
if (std::abs(t - 1.0) < 0.001) {
return 1.0;
} else {
return 0.0;
}
}
/**
* A fixture that includes a consistent data source wrapped in a filter
*/
class LinearFilterOutputTest
: public testing::TestWithParam<LinearFilterOutputTestType> {
protected:
frc::LinearFilter<double> m_filter = [=] {
switch (GetParam()) {
case kTestSinglePoleIIR:
return frc::LinearFilter<double>::SinglePoleIIR(
kSinglePoleIIRTimeConstant, kFilterStep);
break;
case kTestHighPass:
return frc::LinearFilter<double>::HighPass(kHighPassTimeConstant,
kFilterStep);
break;
case kTestMovAvg:
return frc::LinearFilter<double>::MovingAverage(kMovAvgTaps);
break;
default:
return frc::LinearFilter<double>::MovingAverage(kMovAvgTaps);
break;
}
}();
std::function<double(double)> m_data;
double m_expectedOutput = 0.0;
LinearFilterOutputTest() {
switch (GetParam()) {
case kTestSinglePoleIIR: {
m_data = GetData;
m_expectedOutput = kSinglePoleIIRExpectedOutput;
break;
}
case kTestHighPass: {
m_data = GetData;
m_expectedOutput = kHighPassExpectedOutput;
break;
}
case kTestMovAvg: {
m_data = GetData;
m_expectedOutput = kMovAvgExpectedOutput;
break;
}
case kTestPulse: {
m_data = GetPulseData;
m_expectedOutput = 0.0;
break;
}
}
}
};
/**
* Test if the linear filters produce consistent output for a given data set.
*/
TEST_P(LinearFilterOutputTest, Output) {
double filterOutput = 0.0;
for (auto t = 0_s; t < kFilterTime; t += kFilterStep) {
filterOutput = m_filter.Calculate(m_data(t.to<double>()));
}
RecordProperty("LinearFilterOutput", filterOutput);
EXPECT_FLOAT_EQ(m_expectedOutput, filterOutput)
<< "Filter output didn't match expected value";
}
INSTANTIATE_TEST_SUITE_P(Test, LinearFilterOutputTest,
testing::Values(kTestSinglePoleIIR, kTestHighPass,
kTestMovAvg, kTestPulse));
| 27.785124 | 77 | 0.665675 | liorsagy |
6b9453f5254feefd99566baab97330134e296acd | 11,970 | cc | C++ | compiler/jit/jit_logger.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | 20 | 2021-06-24T16:38:42.000Z | 2022-01-20T16:15:57.000Z | compiler/jit/jit_logger.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | null | null | null | compiler/jit/jit_logger.cc | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | 4 | 2021-11-03T06:01:12.000Z | 2022-02-24T02:57:31.000Z | /*
* Copyright 2016 The Android Open Source Project
*
* 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 "jit_logger.h"
#include "arch/instruction_set.h"
#include "art_method-inl.h"
#include "base/time_utils.h"
#include "base/unix_file/fd_file.h"
#include "jit/jit.h"
#include "jit/jit_code_cache.h"
#include "oat_file-inl.h"
namespace art {
namespace jit {
#ifdef ART_TARGET_ANDROID
static const char* kLogPrefix = "/data/misc/trace";
#else
static const char* kLogPrefix = "/tmp";
#endif
// File format of perf-PID.map:
// +---------------------+
// |ADDR SIZE symbolname1|
// |ADDR SIZE symbolname2|
// |... |
// +---------------------+
void JitLogger::OpenPerfMapLog() {
std::string pid_str = std::to_string(getpid());
std::string perf_filename = std::string(kLogPrefix) + "/perf-" + pid_str + ".map";
perf_file_.reset(OS::CreateEmptyFileWriteOnly(perf_filename.c_str()));
if (perf_file_ == nullptr) {
LOG(ERROR) << "Could not create perf file at " << perf_filename <<
" Are you on a user build? Perf only works on userdebug/eng builds";
}
}
void JitLogger::WritePerfMapLog(const void* ptr, size_t code_size, ArtMethod* method) {
if (perf_file_ != nullptr) {
std::string method_name = method->PrettyMethod();
std::ostringstream stream;
stream << std::hex
<< reinterpret_cast<uintptr_t>(ptr)
<< " "
<< code_size
<< " "
<< method_name
<< std::endl;
std::string str = stream.str();
bool res = perf_file_->WriteFully(str.c_str(), str.size());
if (!res) {
LOG(WARNING) << "Failed to write jitted method info in log: write failure.";
}
} else {
LOG(WARNING) << "Failed to write jitted method info in log: log file doesn't exist.";
}
}
void JitLogger::ClosePerfMapLog() {
if (perf_file_ != nullptr) {
UNUSED(perf_file_->Flush());
UNUSED(perf_file_->Close());
}
}
// File format of jit-PID.jump:
//
// +--------------------------------+
// | PerfJitHeader |
// +--------------------------------+
// | PerfJitCodeLoad { | .
// | struct PerfJitBase; | .
// | uint32_t process_id_; | .
// | uint32_t thread_id_; | .
// | uint64_t vma_; | .
// | uint64_t code_address_; | .
// | uint64_t code_size_; | .
// | uint64_t code_id_; | .
// | } | .
// +- -+ .
// | method_name'\0' | +--> one jitted method
// +- -+ .
// | jitted code binary | .
// | ... | .
// +--------------------------------+ .
// | PerfJitCodeDebugInfo { | .
// | struct PerfJitBase; | .
// | uint64_t address_; | .
// | uint64_t entry_count_; | .
// | struct PerfJitDebugEntry; | .
// | } | .
// +--------------------------------+
// | PerfJitCodeLoad |
// ...
//
struct PerfJitHeader {
uint32_t magic_; // Characters "JiTD"
uint32_t version_; // Header version
uint32_t size_; // Total size of header
uint32_t elf_mach_target_; // Elf mach target
uint32_t reserved_; // Reserved, currently not used
uint32_t process_id_; // Process ID of the JIT compiler
uint64_t time_stamp_; // Timestamp when the header is generated
uint64_t flags_; // Currently the flags are only used for choosing clock for timestamp,
// we set it to 0 to tell perf that we use CLOCK_MONOTONIC clock.
static const uint32_t kMagic = 0x4A695444; // "JiTD"
static const uint32_t kVersion = 1;
};
// Each record starts with such basic information: event type, total size, and timestamp.
struct PerfJitBase {
enum PerfJitEvent {
// A jitted code load event.
// In ART JIT, it is used to log a new method is jit compiled and committed to jit-code-cache.
// Note that such kLoad event supports code cache GC in ART JIT.
// For every kLoad event recorded in jit-PID.dump and every perf sample recorded in perf.data,
// each event/sample has time stamp. In case code cache GC happens in ART JIT, and a new
// jitted method is committed to the same address of a previously deleted method,
// the time stamp information can help profiler to tell whether this sample belongs to the
// era of the first jitted method, or does it belong to the period of the second jitted method.
// JitCodeCache doesn't have to record any event on 'code delete'.
kLoad = 0,
// A jitted code move event, i,e. a jitted code moved from one address to another address.
// It helps profiler to map samples to the right symbol even when the code is moved.
// In ART JIT, this event can help log such behavior:
// A jitted method is recorded in previous kLoad event, but due to some reason,
// it is moved to another address in jit-code-cache.
kMove = 1,
// Logs debug line/column information.
kDebugInfo = 2,
// Logs JIT VM end of life event.
kClose = 3
};
uint32_t event_; // Must be one of the events defined in PerfJitEvent.
uint32_t size_; // Total size of this event record.
// For example, for kLoad event, size of the event record is:
// sizeof(PerfJitCodeLoad) + method_name.size() + compiled code size.
uint64_t time_stamp_; // Timestamp for the event.
};
// Logs a jitted code load event (kLoad).
// In ART JIT, it is used to log a new method is jit compiled and commited to jit-code-cache.
struct PerfJitCodeLoad : PerfJitBase {
uint32_t process_id_; // Process ID who performs the jit code load.
// In ART JIT, it is the pid of the JIT compiler.
uint32_t thread_id_; // Thread ID who performs the jit code load.
// In ART JIT, it is the tid of the JIT compiler.
uint64_t vma_; // Address of the code section. In ART JIT, because code_address_
// uses absolute address, this field is 0.
uint64_t code_address_; // Address where is jitted code is loaded.
uint64_t code_size_; // Size of the jitted code.
uint64_t code_id_; // Unique ID for each jitted code.
};
// This structure is for source line/column mapping.
// Currently this feature is not implemented in ART JIT yet.
struct PerfJitDebugEntry {
uint64_t address_; // Code address which maps to the line/column in source.
uint32_t line_number_; // Source line number starting at 1.
uint32_t column_; // Column discriminator, default 0.
const char name_[0]; // Followed by null-terminated name or \0xff\0 if same as previous.
};
// Logs debug line information (kDebugInfo).
// This structure is for source line/column mapping.
// Currently this feature is not implemented in ART JIT yet.
struct PerfJitCodeDebugInfo : PerfJitBase {
uint64_t address_; // Starting code address which the debug info describes.
uint64_t entry_count_; // How many instances of PerfJitDebugEntry.
PerfJitDebugEntry entries_[0]; // Followed by entry_count_ instances of PerfJitDebugEntry.
};
static uint32_t GetElfMach() {
#if defined(__arm__)
static const uint32_t kElfMachARM = 0x28;
return kElfMachARM;
#elif defined(__aarch64__)
static const uint32_t kElfMachARM64 = 0xB7;
return kElfMachARM64;
#elif defined(__i386__)
static const uint32_t kElfMachIA32 = 0x3;
return kElfMachIA32;
#elif defined(__x86_64__)
static const uint32_t kElfMachX64 = 0x3E;
return kElfMachX64;
#else
UNIMPLEMENTED(WARNING) << "Unsupported architecture in JitLogger";
return 0;
#endif
}
void JitLogger::OpenMarkerFile() {
int fd = jit_dump_file_->Fd();
// The 'perf inject' tool requires that the jit-PID.dump file
// must have a mmap(PROT_READ|PROT_EXEC) record in perf.data.
marker_address_ = mmap(nullptr, kPageSize, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
if (marker_address_ == MAP_FAILED) {
LOG(WARNING) << "Failed to create record in perf.data. JITed code profiling will not work.";
return;
}
}
void JitLogger::CloseMarkerFile() {
if (marker_address_ != nullptr) {
munmap(marker_address_, kPageSize);
}
}
void JitLogger::WriteJitDumpDebugInfo() {
// In the future, we can add java source file line/column mapping here.
}
void JitLogger::WriteJitDumpHeader() {
PerfJitHeader header;
std::memset(&header, 0, sizeof(header));
header.magic_ = PerfJitHeader::kMagic;
header.version_ = PerfJitHeader::kVersion;
header.size_ = sizeof(header);
header.elf_mach_target_ = GetElfMach();
header.process_id_ = static_cast<uint32_t>(getpid());
header.time_stamp_ = art::NanoTime(); // CLOCK_MONOTONIC clock is required.
header.flags_ = 0;
bool res = jit_dump_file_->WriteFully(reinterpret_cast<const char*>(&header), sizeof(header));
if (!res) {
LOG(WARNING) << "Failed to write profiling log. The 'perf inject' tool will not work.";
}
}
void JitLogger::OpenJitDumpLog() {
std::string pid_str = std::to_string(getpid());
std::string jitdump_filename = std::string(kLogPrefix) + "/jit-" + pid_str + ".dump";
jit_dump_file_.reset(OS::CreateEmptyFile(jitdump_filename.c_str()));
if (jit_dump_file_ == nullptr) {
LOG(ERROR) << "Could not create jit dump file at " << jitdump_filename <<
" Are you on a user build? Perf only works on userdebug/eng builds";
return;
}
OpenMarkerFile();
// Continue to write jit-PID.dump file even above OpenMarkerFile() fails.
// Even if that means 'perf inject' tool cannot work, developers can still use other tools
// to map the samples in perf.data to the information (symbol,address,code) recorded
// in the jit-PID.dump file, and still proceed the jitted code analysis.
WriteJitDumpHeader();
}
void JitLogger::WriteJitDumpLog(const void* ptr, size_t code_size, ArtMethod* method) {
if (jit_dump_file_ != nullptr) {
std::string method_name = method->PrettyMethod();
PerfJitCodeLoad jit_code;
std::memset(&jit_code, 0, sizeof(jit_code));
jit_code.event_ = PerfJitCodeLoad::kLoad;
jit_code.size_ = sizeof(jit_code) + method_name.size() + 1 + code_size;
jit_code.time_stamp_ = art::NanoTime(); // CLOCK_MONOTONIC clock is required.
jit_code.process_id_ = static_cast<uint32_t>(getpid());
jit_code.thread_id_ = static_cast<uint32_t>(art::GetTid());
jit_code.vma_ = 0x0;
jit_code.code_address_ = reinterpret_cast<uint64_t>(ptr);
jit_code.code_size_ = code_size;
jit_code.code_id_ = code_index_++;
// Write one complete jitted method info, including:
// - PerfJitCodeLoad structure
// - Method name
// - Complete generated code of this method
//
// Use UNUSED() here to avoid compiler warnings.
UNUSED(jit_dump_file_->WriteFully(reinterpret_cast<const char*>(&jit_code), sizeof(jit_code)));
UNUSED(jit_dump_file_->WriteFully(method_name.c_str(), method_name.size() + 1));
UNUSED(jit_dump_file_->WriteFully(ptr, code_size));
WriteJitDumpDebugInfo();
}
}
void JitLogger::CloseJitDumpLog() {
if (jit_dump_file_ != nullptr) {
CloseMarkerFile();
UNUSED(jit_dump_file_->Flush());
UNUSED(jit_dump_file_->Close());
}
}
} // namespace jit
} // namespace art
| 38.737864 | 100 | 0.647118 | Paschalis |
6b95e79e995335c6323e9e09400bd830da835586 | 3,751 | hpp | C++ | include/motion_manager/scenario.hpp | JoaoQPereira/motion_manager | de853e9341c482a0c13e0ba7b78429c019890507 | [
"MIT"
] | null | null | null | include/motion_manager/scenario.hpp | JoaoQPereira/motion_manager | de853e9341c482a0c13e0ba7b78429c019890507 | [
"MIT"
] | null | null | null | include/motion_manager/scenario.hpp | JoaoQPereira/motion_manager | de853e9341c482a0c13e0ba7b78429c019890507 | [
"MIT"
] | null | null | null | #ifndef SCENARIO_HPP
#define SCENARIO_HPP
#include "robot.hpp"
#include "object.hpp"
#include "pose.hpp"
#include "waypoint.hpp"
namespace motion_manager
{
typedef boost::shared_ptr<Robot> robotPtr; /**< shared pointer to a robot */
typedef boost::shared_ptr<Object> objectPtr; /**< shared pointer to an object*/
typedef boost::shared_ptr<Pose> posePtr; /**< shared pointer to a pose*/
typedef boost::shared_ptr<Waypoint> waypointPtr; /**< shared pointer to a waypoint*/
class Scenario
{
public:
/**
* @brief Scenario, a constructor
* @param name
* @param id
*/
Scenario(string name, int id);
/**
* @brief Scenario, a copy constructor
* @param scene
*/
Scenario(const Scenario& scene);
/**
* @brief ~Scenario, a destructor.
*/
~Scenario();
/**
* @brief This method sets the name of the scenario
* @param name
*/
void setName(string& name);
/**
* @brief This method sets the ID of the scenario
* @param id
*/
void setID(int id);
/**
* @brief This method insert an object in the vector of objects at the position pos
* @param pos
* @param obj
*/
void setObject(int pos, objectPtr obj);
/**
* @brief This method insert a pose in the vector of poses at the position pos
* @param pos
* @param pt
*/
void setPose(int pos, posePtr pt);
/**
* @brief This method gets the name of the scenario
* @return
*/
string getName();
/**
* @brief This method gets the ID of the scenario
* @return
*/
int getID();
/**
* @brief This method gets a pointer to the robot in the scenario
* @return
*/
robotPtr getRobot();
/**
* @brief This method get the list of the objects in the scenario
* @param objs
* @return
*/
bool getObjects(vector<objectPtr>& objs);
/**
* @brief This method get the list of the poses in the scenario
* @param pts
* @return
*/
bool getPoses(vector<posePtr>& pts);
/**
* @brief getWaypoints
* @param wps
* @return
*/
bool getWaypoints(vector<waypointPtr> &wps);
/**
* @brief This method adds a new object to the scenario
* @param obj_ptr
*/
void addObject(objectPtr obj_ptr);
/**
* @brief addPose
* @param pose_ptr
*/
void addPose(posePtr pose_ptr);
/**
* @brief addWaypoint
* @param wp_Ptr
*/
void addWaypoint(waypointPtr wp_ptr);
//void addWaypoint(Waypoint &wp_ptr);
/**
* @brief This method gets the object at the position pos in the vector of objects
* @param pos
* @return
*/
objectPtr getObject(int pos);
/**
* @brief getPose
* @param pos
* @return
*/
posePtr getPose(int pos);
/**
* @brief This method gets the object named "obj_name"
* @param obj_name
* @return
*/
objectPtr getObject(string obj_name);
/**
* @brief getPose
* @param pose_name
* @return
*/
posePtr getPose(string pose_name);
waypointPtr getWaypoint_traj(string traj_name);
/**
* @brief This method adds the robot to the scenario
* @param hh_ptr
*/
void addRobot(robotPtr hh_ptr);
private:
string m_name; /**< the name of the scenario*/
int m_scenarioID; /**< the ID of the scenario*/
vector<objectPtr> objs_list; /**< the objects in the scenario */
vector<posePtr> poses_list; /**< the poses in the scenario */
robotPtr rPtr; /**< the robot in the scenario */
vector<waypointPtr> wps_list; /** the waypoints in the scenario **/
};
} // namespace motion_manager
#endif // SCENARIO_HPP
| 22.195266 | 87 | 0.597174 | JoaoQPereira |
6b95f5915b84bf0426913b35b698fed6a19e1c52 | 460 | cpp | C++ | src/tests/Interop/MarshalAPI/IUnknown/IUnknownNative.cpp | pyracanda/runtime | 72bee25ab532a4d0636118ec2ed3eabf3fd55245 | [
"MIT"
] | 9,402 | 2019-11-25T23:26:24.000Z | 2022-03-31T23:19:41.000Z | src/tests/Interop/MarshalAPI/IUnknown/IUnknownNative.cpp | pyracanda/runtime | 72bee25ab532a4d0636118ec2ed3eabf3fd55245 | [
"MIT"
] | 37,522 | 2019-11-25T23:30:32.000Z | 2022-03-31T23:58:30.000Z | src/tests/Interop/MarshalAPI/IUnknown/IUnknownNative.cpp | pyracanda/runtime | 72bee25ab532a4d0636118ec2ed3eabf3fd55245 | [
"MIT"
] | 3,629 | 2019-11-25T23:29:16.000Z | 2022-03-31T21:52:28.000Z | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include <stdio.h>
#include <xplatform.h>
extern "C" DLL_EXPORT BOOL __cdecl Marshal_IUnknown(/*[in]*/IUnknown *o)
{
//Call AddRef and Release on the passed IUnknown
//test if the ref counts get updated as expected
unsigned long refCount = o->AddRef();
if((refCount-1) != o->Release())
return FALSE;
return TRUE;
}
| 30.666667 | 72 | 0.726087 | pyracanda |
6b97f9de5307f0df4092fe3d93cb5439bc6d4931 | 4,800 | cpp | C++ | src/gl/Renderer.cpp | chao-mu/vidrevolt | d7be4ed7a30ef9cec794c54ca1a06e4117420604 | [
"MIT"
] | null | null | null | src/gl/Renderer.cpp | chao-mu/vidrevolt | d7be4ed7a30ef9cec794c54ca1a06e4117420604 | [
"MIT"
] | null | null | null | src/gl/Renderer.cpp | chao-mu/vidrevolt | d7be4ed7a30ef9cec794c54ca1a06e4117420604 | [
"MIT"
] | null | null | null | #include "gl/Renderer.h"
#include <stdexcept>
#define AUX_OUTPUT_NAME "aux"
namespace vidrevolt {
namespace gl {
void Renderer::setResolution(const Resolution& res) {
resolution_ = res;
}
void Renderer::render(const Address target, const std::string& shader_path, ParamSet params) {
preloadModule(shader_path);
auto res = getResolution();
if (render_outs_.count(target) <= 0) {
auto render = std::make_shared<RenderOut>(
res, GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1);
render->load();
render_outs_[target] = render;
}
auto& mod = modules_.at(shader_path);
auto program = mod->getShaderProgram();
unsigned int slot = 0;
auto out = render_outs_.at(target);
out->bind(program);
for (const auto& kv : mod->getNeeds(params)) {
const std::string& uni_name = kv.first;
AddressOrValue addr_or_val = kv.second;
if (isValue(addr_or_val)) {
program->setUniform(uni_name, std::get<Value>(addr_or_val));
} else if (isAddress(addr_or_val)) {
auto addr = std::get<Address>(addr_or_val);
if (textures_.count(addr) > 0) {
auto tex = textures_.at(addr);
program->setUniform(uni_name, [tex, &slot](GLint& id) {
tex->bind(slot);
glUniform1i(id, slot);
slot++;
});
} else if (textures_.count(addr.withoutBack()) && addr.getBack() == "resolution") {
auto res = textures_.at(addr.withoutBack())->getResolution();
program->setUniform(uni_name, [&res](GLint& id) {
glUniform2f(
id,
static_cast<float>(res.width),
static_cast<float>(res.height)
);
});
} else {
std::cerr << "WARNING: undefined texture '" << addr.str() << "' referenced"<< std::endl;
}
}
}
/*
program->setUniform("firstPass", [this](GLint& id) {
glUniform1i(id, static_cast<int>(first_pass_));
});
*/
double time = glfwGetTime();
program->setUniform("iTime", [&time](GLint& id) {
glUniform1f(id, static_cast<float>(time));
});
program->setUniform("iResolution", [&res](GLint& id) {
glUniform2f(
id,
static_cast<float>(res.width),
static_cast<float>(res.height)
);
});
/*
program->setUniform("lastOut", [this, &slot](GLint& id) {
getLastOutTex()->bind(slot);
glUniform1i(id, slot);
slot++;
});
*/
glViewport(0,0, res.width, res.height);
// Draw our vertices
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
// Unbind and swap output/input textures
out->unbind(program);
textures_[target] = out->getSrcTex();
last_ = out;
if (target.str() == "aux") {
last_aux_ = out;
}
}
Resolution Renderer::getResolution() const {
if (resolution_.width <= 0 || resolution_.height <= 0) {
throw std::runtime_error("Renderer had resolution with width or height of zero, possibly unset.");
}
return resolution_;
}
void Renderer::preloadModule(const std::string& shader_path) {
if (modules_.count(shader_path) <= 0) {
modules_[shader_path] = std::make_unique<Module>();
modules_.at(shader_path)->compile(shader_path);
}
}
void Renderer::render(const Address target, cv::Mat& frame) {
if (textures_.count(target) <= 0) {
textures_[target] = std::make_shared<Texture>();
}
textures_.at(target)->populate(frame);
}
std::map<std::string, std::shared_ptr<Module>> Renderer::getModules() {
return modules_;
}
std::shared_ptr<RenderOut> Renderer::getLast() {
return last_;
}
std::shared_ptr<RenderOut> Renderer::getLastAux() {
return last_aux_;
}
}
}
| 34.285714 | 114 | 0.472708 | chao-mu |
6b9a7a425e2265a6ba4d6877c5cba08eaa87afda | 943 | cpp | C++ | B2G/gecko/tools/profiler/nsProfilerFactory.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-08-31T15:24:31.000Z | 2020-04-24T20:31:29.000Z | B2G/gecko/tools/profiler/nsProfilerFactory.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | null | null | null | B2G/gecko/tools/profiler/nsProfilerFactory.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-07-29T07:17:15.000Z | 2020-11-04T06:55:37.000Z | /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/ModuleUtils.h"
#include "nsCOMPtr.h"
#include "nsProfiler.h"
#include "nsProfilerCIID.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfiler)
NS_DEFINE_NAMED_CID(NS_PROFILER_CID);
static const mozilla::Module::CIDEntry kProfilerCIDs[] = {
{ &kNS_PROFILER_CID, false, NULL, nsProfilerConstructor },
{ NULL }
};
static const mozilla::Module::ContractIDEntry kProfilerContracts[] = {
{ "@mozilla.org/tools/profiler;1", &kNS_PROFILER_CID },
{ NULL }
};
static const mozilla::Module kProfilerModule = {
mozilla::Module::kVersion,
kProfilerCIDs,
kProfilerContracts
};
NSMODULE_DEFN(nsProfilerModule) = &kProfilerModule;
| 29.46875 | 80 | 0.717922 | wilebeast |
6b9b73451fa776993372eee5efb36f5405b924e4 | 2,407 | cpp | C++ | test-app/runtime/src/main/cpp/v8_inspector/src/inspector/v8-network-agent-impl.cpp | ClarkGuan/android-runtime | fd3a3c06f1b4590b4f8177b7deef91ebdf9166e3 | [
"Apache-2.0"
] | null | null | null | test-app/runtime/src/main/cpp/v8_inspector/src/inspector/v8-network-agent-impl.cpp | ClarkGuan/android-runtime | fd3a3c06f1b4590b4f8177b7deef91ebdf9166e3 | [
"Apache-2.0"
] | null | null | null | test-app/runtime/src/main/cpp/v8_inspector/src/inspector/v8-network-agent-impl.cpp | ClarkGuan/android-runtime | fd3a3c06f1b4590b4f8177b7deef91ebdf9166e3 | [
"Apache-2.0"
] | null | null | null | //
// Created by pkanev on 2/22/2017.
//
#include <assert.h>
#include <v8_inspector/src/inspector/utils/v8-inspector-common.h>
#include "v8-network-agent-impl.h"
namespace v8_inspector {
namespace NetworkAgentState {
static const char networkEnabled[] = "networkEnabled";
}
V8NetworkAgentImpl::V8NetworkAgentImpl(V8InspectorSessionImpl* session, protocol::FrontendChannel* frontendChannel,
protocol::DictionaryValue* state)
: m_responses(),
m_session(session),
m_frontend(frontendChannel),
m_state(state),
m_enabled(false) {
Instance = this;
}
V8NetworkAgentImpl::~V8NetworkAgentImpl() {}
///////
DispatchResponse V8NetworkAgentImpl::enable() {
if (m_enabled) {
return DispatchResponse::OK();
}
m_state->setBoolean(NetworkAgentState::networkEnabled, true);
m_enabled = true;
return DispatchResponse::OK();
}
DispatchResponse V8NetworkAgentImpl::disable() {
if (!m_enabled) {
return DispatchResponse::OK();
}
m_state->setBoolean(NetworkAgentState::networkEnabled, false);
m_enabled = false;
return DispatchResponse::OK();
}
DispatchResponse V8NetworkAgentImpl::setExtraHTTPHeaders(std::unique_ptr<protocol::Network::Headers> in_headers) {
return utils::Common::protocolCommandNotSupportedDispatchResponse();
}
DispatchResponse V8NetworkAgentImpl::getResponseBody(const String& in_requestId, String* out_body, bool* out_base64Encoded) {
auto it = m_responses.find(in_requestId.utf8());
if (it == m_responses.end()) {
auto error = "Response not found for requestId = " + in_requestId;
return DispatchResponse::Error(error);
} else {
v8_inspector::utils::NetworkRequestData* response = it->second;
*out_body = String16((const uint16_t*) response->getData());
*out_base64Encoded = !response->hasTextContent();
}
return DispatchResponse::OK();
}
DispatchResponse V8NetworkAgentImpl::setCacheDisabled(bool in_cacheDisabled) {
return utils::Common::protocolCommandNotSupportedDispatchResponse();
}
DispatchResponse V8NetworkAgentImpl::loadResource(const String& in_frameId, const String& in_url, String* out_content, String* out_mimeType, double* out_status) {
return utils::Common::protocolCommandNotSupportedDispatchResponse();
}
//////
V8NetworkAgentImpl* V8NetworkAgentImpl::Instance = 0;
} | 29 | 162 | 0.718322 | ClarkGuan |
6b9e8a83bb3c48542cb60fd7b7e8a7177c45948b | 2,353 | cpp | C++ | sqaodc/tests/DeviceTest.cpp | rickyHong/Qubo-GPU-repl | a2bea6857885d318cd3aa6b6ed37dc6e7f011433 | [
"Apache-2.0"
] | 51 | 2018-01-04T06:26:07.000Z | 2022-03-31T12:05:16.000Z | sqaodc/tests/DeviceTest.cpp | rickyHong/Qubo-GPU-repl | a2bea6857885d318cd3aa6b6ed37dc6e7f011433 | [
"Apache-2.0"
] | 63 | 2018-02-21T10:57:26.000Z | 2020-10-20T18:25:25.000Z | sqaodc/tests/DeviceTest.cpp | rickyHong/Qubo-GPU-repl | a2bea6857885d318cd3aa6b6ed37dc6e7f011433 | [
"Apache-2.0"
] | 15 | 2018-01-18T16:56:15.000Z | 2021-09-16T12:19:43.000Z | #include "DeviceTest.h"
#include <vector>
using namespace sqaod_cuda;
DeviceTest::DeviceTest(void) : MinimalTestSuite("DeviceTest") {
}
DeviceTest::~DeviceTest(void) {
}
void DeviceTest::setUp() {
}
void DeviceTest::tearDown() {
}
void DeviceTest::run(std::ostream &ostm) {
testcase("DevInit/Fin") {
try {
Device device;
device.initialize(0);
device.finalize();
TEST_SUCCESS;
}
catch (...) {
TEST_FAIL;
}
}
testcase("device alloc/dealloc") {
Device device;
device.initialize(0);
auto *alloc = device.objectAllocator();
std::vector<void*> pvlist;
for (int size = 4; size < (1 << 20); size *= 2) {
for (int idx = 0; idx < 100; ++idx) {
void *pv = alloc->allocate(size);
pvlist.push_back(pv);
}
}
for (size_t idx = 0; idx < pvlist.size(); ++idx)
alloc->deallocate(pvlist[idx]);
pvlist.clear();
device.finalize();
TEST_SUCCESS;
}
}
template<class real>
void DeviceTest::tests() {
Device device;
device.initialize();
auto *alloc = device.objectAllocator();
testcase("matrix alloc/dealloc") {
DeviceMatrixType<real> mat;
alloc->allocate(&mat, 10, 10);
TEST_ASSERT(mat.dim() == sqaod::Dim(10, 10));
TEST_ASSERT(mat.d_data != NULL);
alloc->deallocate(mat);
}
testcase("vector alloc/dealloc") {
DeviceVectorType<real> vec;
alloc->allocate(&vec, 10);
TEST_ASSERT(vec.size == 10);
TEST_ASSERT(vec.d_data != NULL);
alloc->deallocate(vec);
}
testcase("scalar alloc/dealloc") {
DeviceScalarType<real> sc;
alloc->allocate(&sc);
TEST_ASSERT(sc.d_data != NULL);
alloc->deallocate(sc);
}
DeviceStream *defStream = device.defaultStream();
testcase("tmp object alloc/dealloc") {
DeviceMatrixType<real> *tmpMat = defStream->tempDeviceMatrix<real>(10, 10);
DeviceVectorType<real> *tmpVec = defStream->tempDeviceVector<real>(10);
DeviceScalarType<real> *tmpSc = defStream->tempDeviceScalar<real>();
defStream->synchronize();
TEST_ASSERT(true);
}
device.synchronize();
device.finalize();
}
| 24.257732 | 83 | 0.568636 | rickyHong |
6ba52671fdce3d6eacbfa3551eb4a6afcfed4718 | 3,761 | cpp | C++ | contrib/spreadinterp.cpp | elliottslaughter/cufinufft | bb1453dfe9dc12159e8e346eae79ad4d71fd566f | [
"Apache-2.0"
] | 56 | 2020-05-12T22:22:22.000Z | 2022-01-28T23:54:48.000Z | contrib/spreadinterp.cpp | elliottslaughter/cufinufft | bb1453dfe9dc12159e8e346eae79ad4d71fd566f | [
"Apache-2.0"
] | 108 | 2020-05-13T16:59:51.000Z | 2022-03-31T22:30:57.000Z | contrib/spreadinterp.cpp | elliottslaughter/cufinufft | bb1453dfe9dc12159e8e346eae79ad4d71fd566f | [
"Apache-2.0"
] | 15 | 2020-05-22T12:29:36.000Z | 2022-03-03T18:08:03.000Z | #include "spreadinterp.h"
#include <stdlib.h>
#include <vector>
#include <math.h>
int setup_spreader(SPREAD_OPTS &opts,FLT eps, FLT upsampfac, int kerevalmeth)
// Initializes spreader kernel parameters given desired NUFFT tolerance eps,
// upsampling factor (=sigma in paper, or R in Dutt-Rokhlin), and ker eval meth
// (etiher 0:exp(sqrt()), 1: Horner ppval).
// Also sets all default options in SPREAD_OPTS. See cnufftspread.h for opts.
// Must call before any kernel evals done.
// Returns: 0 success, 1, warning, >1 failure (see error codes in utils.h)
{
if (upsampfac!=2.0) { // nonstandard sigma
if (kerevalmeth==1) {
fprintf(stderr,"setup_spreader: nonstandard upsampfac=%.3g cannot be handled by kerevalmeth=1\n",(double)upsampfac);
return HORNER_WRONG_BETA;
}
if (upsampfac<=1.0) {
fprintf(stderr,"setup_spreader: error, upsampfac=%.3g is <=1.0\n",(double)upsampfac);
return ERR_UPSAMPFAC_TOO_SMALL;
}
// calling routine must abort on above errors, since opts is garbage!
if (upsampfac>4.0)
fprintf(stderr,"setup_spreader: warning, upsampfac=%.3g is too large to be beneficial!\n",(double)upsampfac);
}
// defaults... (user can change after this function called)
opts.spread_direction = 1; // user should always set to 1 or 2 as desired
opts.pirange = 1; // user also should always set this
opts.upsampfac = upsampfac;
// as in FINUFFT v2.0, allow too-small-eps by truncating to eps_mach...
int ier = 0;
if (eps<EPSILON) {
fprintf(stderr,"setup_spreader: warning, increasing tol=%.3g to eps_mach=%.3g.\n",(double)eps,(double)EPSILON);
eps = EPSILON;
ier = WARN_EPS_TOO_SMALL;
}
// Set kernel width w (aka ns) and ES kernel beta parameter, in opts...
int ns = std::ceil(-log10(eps/(FLT)10.0)); // 1 digit per power of ten
if (upsampfac!=2.0) // override ns for custom sigma
ns = std::ceil(-log(eps) / (PI*sqrt(1-1/upsampfac))); // formula, gamma=1
ns = max(2,ns); // we don't have ns=1 version yet
if (ns>MAX_NSPREAD) { // clip to match allocated arrays
fprintf(stderr,"%s warning: at upsampfac=%.3g, tol=%.3g would need kernel width ns=%d; clipping to max %d.\n",__func__,
upsampfac,(double)eps,ns,MAX_NSPREAD);
ns = MAX_NSPREAD;
ier = WARN_EPS_TOO_SMALL;
}
opts.nspread = ns;
opts.ES_halfwidth=(FLT)ns/2; // constants to help ker eval (except Horner)
opts.ES_c = 4.0/(FLT)(ns*ns);
FLT betaoverns = 2.30; // gives decent betas for default sigma=2.0
if (ns==2) betaoverns = 2.20; // some small-width tweaks...
if (ns==3) betaoverns = 2.26;
if (ns==4) betaoverns = 2.38;
if (upsampfac!=2.0) { // again, override beta for custom sigma
FLT gamma=0.97; // must match devel/gen_all_horner_C_code.m
betaoverns = gamma*PI*(1-1/(2*upsampfac)); // formula based on cutoff
}
opts.ES_beta = betaoverns * (FLT)ns; // set the kernel beta parameter
//fprintf(stderr,"setup_spreader: sigma=%.6f, chose ns=%d beta=%.6f\n",(double)upsampfac,ns,(double)opts.ES_beta); // user hasn't set debug yet
return ier;
}
FLT evaluate_kernel(FLT x, const SPREAD_OPTS &opts)
/* ES ("exp sqrt") kernel evaluation at single real argument:
phi(x) = exp(beta.sqrt(1 - (2x/n_s)^2)), for |x| < nspread/2
related to an asymptotic approximation to the Kaiser--Bessel, itself an
approximation to prolate spheroidal wavefunction (PSWF) of order 0.
This is the "reference implementation", used by eg common/onedim_* 2/17/17 */
{
if (abs(x)>=opts.ES_halfwidth)
// if spreading/FT careful, shouldn't need this if, but causes no speed hit
return 0.0;
else
return exp(opts.ES_beta * sqrt(1.0 - opts.ES_c*x*x));
}
| 45.313253 | 145 | 0.667642 | elliottslaughter |
6ba7c527633cf9a4f1de6d4670ab5afbd46e649e | 1,472 | cpp | C++ | Source/OpenExrWrapper/OpenExrWrapper.cpp | TQwan/ExrMedia | 3934b82b85c4f0c00987c535fb0a2fb2d1602034 | [
"MIT"
] | null | null | null | Source/OpenExrWrapper/OpenExrWrapper.cpp | TQwan/ExrMedia | 3934b82b85c4f0c00987c535fb0a2fb2d1602034 | [
"MIT"
] | null | null | null | Source/OpenExrWrapper/OpenExrWrapper.cpp | TQwan/ExrMedia | 3934b82b85c4f0c00987c535fb0a2fb2d1602034 | [
"MIT"
] | null | null | null | #pragma warning(push)
#pragma warning(disable:28251)
#include "OpenExrWrapper.h"
#include "ImathBox.h"
#include "ImfHeader.h"
#include "ImfRgbaFile.h"
#include "ImfStandardAttributes.h"
#include "Modules/ModuleManager.h"
FRgbaInputFile::FRgbaInputFile(const FString& FilePath)
{
InputFile = new Imf::RgbaInputFile(TCHAR_TO_ANSI(*FilePath));
}
FRgbaInputFile::~FRgbaInputFile()
{
delete (Imf::RgbaInputFile*)InputFile;
}
FIntPoint FRgbaInputFile::GetDataWindow() const
{
Imath::Box2i Win = ((Imf::RgbaInputFile*)InputFile)->dataWindow();
return FIntPoint(
Win.max.x - Win.min.x + 1,
Win.max.y - Win.min.y + 1
);
}
double FRgbaInputFile::GetFramesPerSecond(double DefaultValue) const
{
auto Attribute = ((Imf::RgbaInputFile*)InputFile)->header().findTypedAttribute<Imf::RationalAttribute>("framesPerSecond");
if (Attribute == nullptr)
{
return DefaultValue;
}
return Attribute->value();
}
void FRgbaInputFile::ReadPixels(int32 StartY, int32 EndY)
{
Imath::Box2i Win = ((Imf::RgbaInputFile*)InputFile)->dataWindow();
((Imf::RgbaInputFile*)InputFile)->readPixels(Win.min.y, Win.max.y);
}
void FRgbaInputFile::SetFrameBuffer(void* Buffer, const FIntPoint& BufferDim)
{
Imath::Box2i Win = ((Imf::RgbaInputFile*)InputFile)->dataWindow();
((Imf::RgbaInputFile*)InputFile)->setFrameBuffer((Imf::Rgba*)Buffer - Win.min.x - Win.min.y * BufferDim.X, 1, BufferDim.X);
}
IMPLEMENT_MODULE(FDefaultModuleImpl, OpenExrWrapper);
#pragma warning(pop)
| 22.30303 | 124 | 0.737772 | TQwan |
6ba84b024c11855a782c96fe585b836a8cfe5170 | 1,233 | cpp | C++ | Introduction/Ad Hoc Problems - Part 2/12060 All Integer Average.cpp | satvik007/UvaRevision | b2473130eb17435ac55132083e85262491db3d1b | [
"MIT"
] | null | null | null | Introduction/Ad Hoc Problems - Part 2/12060 All Integer Average.cpp | satvik007/UvaRevision | b2473130eb17435ac55132083e85262491db3d1b | [
"MIT"
] | null | null | null | Introduction/Ad Hoc Problems - Part 2/12060 All Integer Average.cpp | satvik007/UvaRevision | b2473130eb17435ac55132083e85262491db3d1b | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector <int> vi;
int n, u, sum;
void solve(){
if(abs(sum) % n == 0){
sum /= n;
if(sum < 0) cout << "- ";
cout << abs(sum) << "\n";
}else{
int sign = (sum < 0);
sum = abs(sum);
int avg = sum / n;
int gcd = __gcd(n, sum);
sum /= gcd; n /= gcd;
int offset = (sign ? 2 : 0);
offset += (avg == 0) ? 0 : to_string(avg).size();
int len1 = to_string(sum % n).size();
int len2 = to_string(n).size();
for(int i=0; i<offset + len2 - len1; i++) cout << " ";
cout << (sum % n) << "\n";
if(sign) cout << "- ";
if(avg) cout << avg;
for(int i=0; i<len2; i++) cout << "-"; cout << "\n";
for(int i=0; i<offset; i++) cout << " ";
cout << n << "\n";
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
int cas = 1;
while(cin >> n, n){
cout << "Case " << cas++ << ":\n";
sum = 0;
for(int i=0; i<n; i++){
cin >> u; sum += u;
}
solve();
}
return 0;
} | 26.234043 | 62 | 0.42498 | satvik007 |
6ba8908e11be99d3e63f5eee5ade7b1c7abb7f66 | 3,645 | cpp | C++ | SFML/SFML04-2dExplorer/src/State_Game.cpp | Gaetz/cpp-training | 5191da36be37c5bef18637ba82f1edac1c2474fa | [
"MIT"
] | null | null | null | SFML/SFML04-2dExplorer/src/State_Game.cpp | Gaetz/cpp-training | 5191da36be37c5bef18637ba82f1edac1c2474fa | [
"MIT"
] | null | null | null | SFML/SFML04-2dExplorer/src/State_Game.cpp | Gaetz/cpp-training | 5191da36be37c5bef18637ba82f1edac1c2474fa | [
"MIT"
] | null | null | null | #include "State_Game.h"
#include "StateManager.h"
State_Game::State_Game(StateManager *stateManager) : BaseState(stateManager) {}
State_Game::~State_Game() {}
void State_Game::onCreate()
{
// View setup
sf::Vector2u viewSize = mStateManager->getContext()->mWindow->getWindowSize();
mView.setSize(viewSize.x, viewSize.y);
mView.setCenter(viewSize.x / 2, 120); // viewSize.y / 2
mView.zoom(0.6f);
mStateManager->getContext()->mWindow->getRenderWindow()->setView(mView);
// Map load
mGameMap = new Map(mStateManager->getContext(), this);
mGameMap->loadMap("assets/data/maps/map1.map");
// Tutorail text
mFont.loadFromFile("assets/arial.ttf");
mText.setFont(mFont);
mText.setFillColor(sf::Color(100, 100, 100));
mText.setString({L"Shift gauche: contrôle souris | Echap: menu"});
mText.setCharacterSize(18);
sf::FloatRect textRect = mText.getLocalBounds();
mText.setOrigin(textRect.left + textRect.width / 2, textRect.top + textRect.height / 2);
mText.setPosition(mStateManager->getContext()->mWindow->getWindowSize().x * 0.75f, mStateManager->getContext()->mWindow->getWindowSize().y - 20);
// Callback setup
EventManager *evMgr = mStateManager->getContext()->mEventManager;
evMgr->addCallback(StateType::Game, "KeyEscape", &State_Game::stateMainMenu, this);
evMgr->addCallback(StateType::Game, "KeyP", &State_Game::statePaused, this);
evMgr->addCallback(StateType::Game, "KeyO", &State_Game::toggleOverlay, this);
}
void State_Game::onDestroy()
{
EventManager *evMgr = mStateManager->getContext()->mEventManager;
evMgr->removeCallback(StateType::Game, "KeyEscape");
evMgr->removeCallback(StateType::Game, "KeyP");
evMgr->removeCallback(StateType::Game, "KeyO");
delete mGameMap;
mGameMap = nullptr;
}
void State_Game::activate()
{
}
void State_Game::deactivate()
{
}
void State_Game::update(const sf::Time &time)
{
SharedContext* context = mStateManager->getContext();
EntityBase* player = context->mEntityManager->find("Player");
if(!player) {
/*std::cout << "Respawning player" << std::endl;
context->mEntityManager->add(EntityType::Player, "Player");
player = context->mEntityManager->find("Player");
player->setPosition(mGameMap->getPlayerStart());*/
} else {
mView.setCenter(sf::Vector2f(player->getPosition().x, mView.getCenter().y)); // Formerly player->getPosition();
context->mWindow->getRenderWindow()->setView(mView);
}
sf::FloatRect viewSpace = context->mWindow->getViewSpace();
if(viewSpace.left <= 0){
mView.setCenter(viewSpace.width / 2, mView.getCenter().y);
context->mWindow->getRenderWindow()->setView(mView);
} else if (viewSpace.left + viewSpace.width > (mGameMap->getMapSize().x + 1) * Sheet::TileSize){
mView.setCenter(((mGameMap->getMapSize().x + 1) * Sheet::TileSize) - (viewSpace.width / 2), mView.getCenter().y);
context->mWindow->getRenderWindow()->setView(mView);
}
mGameMap->update(time.asSeconds());
mStateManager->getContext()->mEntityManager->update(time.asSeconds());
}
void State_Game::draw()
{
mGameMap->draw();
mStateManager->getContext()->mEntityManager->draw();
}
void State_Game::stateMainMenu(EventDetails *details)
{
mStateManager->switchTo(StateType::MainMenu);
}
void State_Game::statePaused(EventDetails *details)
{
mStateManager->switchTo(StateType::Paused);
}
void State_Game::toggleOverlay(EventDetails* details){
mStateManager->getContext()->mDebugOverlay.setDebug(!mStateManager->getContext()->mDebugOverlay.debug());
}
| 34.714286 | 149 | 0.691084 | Gaetz |
6ba92bcc7a6c613243d8ed0b8e0389b6bb8563f7 | 4,491 | hpp | C++ | include/estd/tuple/for_each.hpp | fizyr/estd | 6562e7d3d21972f9eee7f4b36dfd381b4ae9d2bf | [
"BSD-3-Clause"
] | 9 | 2018-07-28T21:37:28.000Z | 2021-12-20T22:24:14.000Z | include/estd/tuple/for_each.hpp | fizyr/estd | 6562e7d3d21972f9eee7f4b36dfd381b4ae9d2bf | [
"BSD-3-Clause"
] | 8 | 2019-05-17T18:40:19.000Z | 2021-10-11T09:35:08.000Z | include/estd/tuple/for_each.hpp | fizyr/estd | 6562e7d3d21972f9eee7f4b36dfd381b4ae9d2bf | [
"BSD-3-Clause"
] | 4 | 2019-02-23T13:39:26.000Z | 2021-12-20T22:24:19.000Z | /* Copyright 2017-2018 Fizyr B.V. - https://fizyr.com
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the 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 "../traits/is_tuple.hpp"
#include <cstddef>
#include <functional>
#include <tuple>
#include <type_traits>
#include <utility>
namespace estd {
namespace detail {
template<std::size_t I, typename F, typename Tuple>
constexpr std::size_t tuple_for_each_impl(Tuple && tuple, F && f) {
if constexpr (I == std::tuple_size_v<std::decay_t<Tuple>>) {
return I;
} else {
using std::get;
using R = decltype(std::invoke(f, get<I>(std::forward<Tuple>(tuple))));
if constexpr(std::is_same_v<R, void>) {
std::invoke(f, get<I>(std::forward<Tuple>(tuple)));
} else {
if (!std::invoke(f, get<I>(std::forward<Tuple>(tuple)))) return I;
}
return tuple_for_each_impl<I + 1>(std::forward<Tuple>(tuple), std::forward<F>(f));
}
}
template<std::size_t I, typename F, typename Tuple>
constexpr std::size_t tuple_for_each_i_impl(Tuple && tuple, F && f) {
if constexpr (I == std::tuple_size_v<std::decay_t<Tuple>>) {
return I;
} else {
using std::get;
using R = decltype(std::invoke(f, I, get<I>(std::forward<Tuple>(tuple))));
if constexpr(std::is_same_v<R, void>) {
std::invoke(f, I, get<I>(std::forward<Tuple>(tuple)));
} else {
if (!std::invoke(f, I, get<I>(std::forward<Tuple>(tuple)))) return I;
}
return tuple_for_each_i_impl<I + 1>(std::forward<Tuple>(tuple), std::forward<F>(f));
}
}
}
/// Execute a functor for each tuple element in order.
/**
* The functor willed be called as func(elem) where elem is the value of the element.
*
* The functor may optionally return a value to abort the loop before all elements are processed.
* If the functor returns a value it is tested in boolean context.
* If the value compares as false, the loop is stopped.
*
* Returns the index of the element that caused the loop to halt,
* or the size of the tuple if no element caused the loop to stop.
*/
template<typename F, typename Tuple, typename = std::enable_if_t<estd::is_tuple<Tuple>>>
constexpr std::size_t for_each(Tuple && tuple, F && func) {
return detail::tuple_for_each_impl<0>(std::forward<Tuple>(tuple), std::forward<F>(func));
}
/// Execute a functor for each tuple element in order.
/**
* The functor willed be called as func(i, elem) where i is the index in the tuple,
* and elem is the value of the element.
*
* The functor may optionally return a value to abort the loop before all elements are processed.
* If the functor returns a value it is tested in boolean context.
* If the value compares as false, the loop is stopped.
*
* Returns the index of the element that caused the loop to halt,
* or the size of the tuple if no element caused the loop to stop.
*/
template<typename F, typename Tuple, typename = std::enable_if_t<estd::is_tuple<Tuple>>>
constexpr std::size_t for_each_i(Tuple && tuple, F && func) {
return detail::tuple_for_each_i_impl<0>(std::forward<Tuple>(tuple), std::forward<F>(func));
}
}
| 41.583333 | 97 | 0.717435 | fizyr |
6baa61169badd91f1029ae2817562f354457a866 | 1,103 | cpp | C++ | linear-list/array/median_of_two_sorted_arrays.cpp | zhangxin23/leetcode | 4c8fc60e59448045a3e880caaedd0486164e68e7 | [
"MIT"
] | 1 | 2015-07-15T07:31:42.000Z | 2015-07-15T07:31:42.000Z | linear-list/array/median_of_two_sorted_arrays.cpp | zhangxin23/leetcode | 4c8fc60e59448045a3e880caaedd0486164e68e7 | [
"MIT"
] | null | null | null | linear-list/array/median_of_two_sorted_arrays.cpp | zhangxin23/leetcode | 4c8fc60e59448045a3e880caaedd0486164e68e7 | [
"MIT"
] | null | null | null | #include <iostream>
using namespace std;
/**
* There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays.
* The overall run time complexity should be O(log(m + n)).
* */
class Solution {
public:
double findMedian(int A[], int m, int B[], int n) {
int total = m + n;
if(total % 2 != 0)
return find_kth(A, m, B, n, total / 2 + 1);
else
return (find_kth(A, m, B, n, total / 2) + find_kth(A, m, B, n, total / 2 + 1)) / 2.0;
}
private:
static int find_kth(int A[], int m, int B[], int n, int k) {
if(m > n)
return find_kth(B, n, A, m, k);
if(m == 0)
return B[k - 1];
if(k == 1)
return min(A[0], B[0]);
int idx_a = min(k / 2, m), idx_b = k - idx_a;
if(A[idx_a - 1] < B[idx_b - 1])
return find_kth(A + idx_a, m - idx_a, B, n, k - idx_a);
else if(A[idx_a - 1] > B[idx_b -1])
return find_kth(A, m, B + idx_b, n - idx_b, k - idx_b);
else
return A[idx_a - 1];
}
};
| 29.026316 | 110 | 0.4932 | zhangxin23 |
6bb02840355fc14356f0266998b0c1ed3b7128db | 25,634 | hpp | C++ | include/virt_wrap/Domain.hpp | AeroStun/virthttp | d6ae9d752721aa5ecc74dbc2dbb54de917ba31ad | [
"Apache-2.0"
] | 7 | 2019-08-22T20:48:15.000Z | 2021-12-31T16:08:59.000Z | include/virt_wrap/Domain.hpp | AeroStun/virthttp | d6ae9d752721aa5ecc74dbc2dbb54de917ba31ad | [
"Apache-2.0"
] | 10 | 2019-08-22T21:40:43.000Z | 2020-09-03T14:21:21.000Z | include/virt_wrap/Domain.hpp | AeroStun/virthttp | d6ae9d752721aa5ecc74dbc2dbb54de917ba31ad | [
"Apache-2.0"
] | 2 | 2019-08-22T21:08:28.000Z | 2019-08-23T21:31:56.000Z | //
// Created by _as on 2019-01-31.
//
#ifndef VIRTPP_DOMAIN_HPP
#define VIRTPP_DOMAIN_HPP
#include <filesystem>
#include <stdexcept>
#include <variant>
#include <vector>
#include <gsl/gsl>
#include "../cexpr_algs.hpp"
#include "enums/Connection/Decls.hpp"
#include "enums/Domain/Decls.hpp"
#include "enums/Domain/Domain.hpp"
#include "enums/GFlags.hpp"
#include "CpuMap.hpp"
#include "fwd.hpp"
#include "tfe.hpp"
#include "utility.hpp"
namespace tmp {
/*
using virConnectDomainEventAgentLifecycleCallback = void (*)(virConnectPtr conn, virDomainPtr dom, int state, int reason, void* opaque);
using virConnectDomainEventBalloonChangeCallback = void (*)(virConnectPtr conn, virDomainPtr dom, unsigned long long actual, void* opaque);
using virConnectDomainEventBlockJobCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* disk, int type, int status, void* opaque);
using virConnectDomainEventBlockThresholdCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* dev, const char* path,
unsigned long long threshold, unsigned long long excess, void* opaque);
using virConnectDomainEventCallback = int (*)(virConnectPtr conn, virDomainPtr dom, int event, int detail, void* opaque);
int virConnectDomainEventDeregister(virConnectPtr conn, virConnectDomainEventCallback cb);
int virConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID);
using virConnectDomainEventDeviceAddedCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* devAlias, void* opaque);
using virConnectDomainEventDeviceRemovalFailedCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* devAlias, void* opaque);
using virConnectDomainEventDeviceRemovedCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* devAlias, void* opaque);
using virConnectDomainEventDiskChangeCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* oldSrcPath, const char* newSrcPath,
const char* devAlias, int reason, void* opaque);
using virConnectDomainEventGenericCallback = void (*)(virConnectPtr conn, virDomainPtr dom, void* opaque);
using virConnectDomainEventGraphicsCallback = void (*)(virConnectPtr conn, virDomainPtr dom, int phase, const virDomainEventGraphicsAddress* local,
const virDomainEventGraphicsAddress* remote, const char* authScheme,
const virDomainEventGraphicsSubject* subject, void* opaque);
using virConnectDomainEventIOErrorCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* srcPath, const char* devAlias, int action,
void* opaque);
using virConnectDomainEventIOErrorReasonCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* srcPath, const char* devAlias,
int action, const char* reason, void* opaque);
using virConnectDomainEventJobCompletedCallback = void (*)(virConnectPtr conn, virDomainPtr dom, virTypedParameterPtr params, int nparams,
void* opaque);
using virConnectDomainEventMetadataChangeCallback = void (*)(virConnectPtr conn, virDomainPtr dom, int type, const char* nsuri, void* opaque);
using virConnectDomainEventMigrationIterationCallback = void (*)(virConnectPtr conn, virDomainPtr dom, int iteration, void* opaque);
using virConnectDomainEventPMSuspendCallback = void (*)(virConnectPtr conn, virDomainPtr dom, int reason, void* opaque);
using virConnectDomainEventPMSuspendDiskCallback = void (*)(virConnectPtr conn, virDomainPtr dom, int reason, void* opaque);
using virConnectDomainEventPMWakeupCallback = void (*)(virConnectPtr conn, virDomainPtr dom, int reason, void* opaque);
using virConnectDomainEventRTCChangeCallback = void (*)(virConnectPtr conn, virDomainPtr dom, long long utcoffset, void* opaque);
int virConnectDomainEventRegister(virConnectPtr conn, virConnectDomainEventCallback cb, void* opaque, virFreeCallback freecb);
int virConnectDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, int eventID, virConnectDomainEventGenericCallback cb, void* opaque,
virFreeCallback freecb);
using virConnectDomainEventTrayChangeCallback = void (*)(virConnectPtr conn, virDomainPtr dom, const char* devAlias, int reason, void* opaque);
using virConnectDomainEventTunableCallback = void (*)(virConnectPtr conn, virDomainPtr dom, virTypedParameterPtr params, int nparams, void* opaque);
using virConnectDomainEventWatchdogCallback = void (*)(virConnectPtr conn, virDomainPtr dom, int action, void* opaque);
char* virConnectDomainXMLFromNative(virConnectPtr conn, const char* nativeFormat, const char* nativeConfig, unsigned int flags);
char* virConnectDomainXMLToNative(virConnectPtr conn, const char* nativeFormat, const char* domainXml, unsigned int flags);
char* virConnectGetDomainCapabilities(virConnectPtr conn, const char* emulatorbin, const char* arch, const char* machine, const char* virttype,
unsigned int flags);
*/
/*
* ((?:[A-Z]+_)+([A-Z]+)(?!_))\s*=.*,(.*)
* $2 = $1, $3
* */
} // namespace tmp
namespace virt {
class Domain {
friend Connection;
virDomainPtr underlying = nullptr;
public:
using Info = virDomainInfo;
class StatsRecord;
struct StateReason {};
struct StateWReason;
struct DiskError;
struct FSInfo;
struct Interface;
struct InterfaceView;
struct IPAddress;
struct IPAddressView;
struct JobInfo;
struct light {
struct IOThreadInfo;
};
struct heavy {
struct IOThreadInfo;
};
using BlockStats = virDomainBlockStatsStruct;
constexpr inline explicit Domain(virDomainPtr ptr = nullptr) noexcept;
Domain(const Domain&) = delete;
constexpr inline Domain(Domain&&) noexcept;
Domain& operator=(const Domain&) = delete;
inline Domain& operator=(Domain&&) noexcept;
inline ~Domain() noexcept;
constexpr inline explicit operator bool() const noexcept;
bool abortJob() noexcept;
bool addIOThread(unsigned int iothread_id, enums::domain::ModificationImpactFlag flags) noexcept;
bool attachDevice(gsl::czstring<> xml) noexcept;
bool attachDevice(gsl::czstring<> xml, enums::domain::DeviceModifyFlag flags) noexcept;
bool blockCommit(gsl::czstring<> disk, gsl::czstring<> base, gsl::czstring<> top, unsigned long bandwidth,
enums::domain::BlockCommitFlag flags) noexcept;
bool blockCopy(gsl::czstring<> disk, gsl::czstring<> destxml, const TypedParams& params, enums::domain::BlockCopyFlag flags) noexcept;
bool blockJobAbort(gsl::czstring<> disk, enums::domain::BlockJobAbortFlag flags) noexcept;
bool blockJobSetSpeed(gsl::czstring<> disk, unsigned long bandwidth, enums::domain::BlockJobSetSpeedFlag flags) noexcept;
bool blockPeek(gsl::czstring<> disk, unsigned long long offset, gsl::span<std::byte> buffer) const noexcept;
bool blockPull(gsl::czstring<> disk, unsigned long bandwidth, enums::domain::BlockPullFlag flags) noexcept;
bool blockRebase(gsl::czstring<> disk, gsl::czstring<> base, unsigned long bandwidth, enums::domain::BlockRebaseFlag flags);
bool blockResize(gsl::czstring<> disk, unsigned long long size, enums::domain::BlockResizeFlag flags) noexcept;
auto blockStats(gsl::czstring<> disk, size_t size) const noexcept;
auto blockStatsFlags(gsl::czstring<> disk, enums::TypedParameterFlag flags) const noexcept;
bool create() noexcept;
bool create(enums::domain::CreateFlag flag) noexcept;
// createWithFiles() // Left out
bool coreDump(std::filesystem::path to, enums::domain::core_dump::Flag flags) const noexcept;
bool coreDump(std::filesystem::path to, enums::domain::core_dump::Format format, enums::domain::core_dump::Flag flags) const noexcept;
bool delIOThread(unsigned int iothread_id, enums::domain::ModificationImpactFlag flags) noexcept;
bool destroy() noexcept;
bool destroy(enums::domain::DestroyFlag flag) noexcept;
bool detachDevice(gsl::czstring<> xml) noexcept;
bool detachDevice(gsl::czstring<> xml, enums::domain::DeviceModifyFlag flag) noexcept;
bool detachDeviceAlias(gsl::czstring<> alias, enums::domain::DeviceModifyFlag flag) noexcept;
int fsFreeze(gsl::span<gsl::czstring<>> mountpoints) noexcept;
int fsThaw(gsl::span<gsl::czstring<>> mountpoints) noexcept;
bool fsTrim(gsl::czstring<> mountpoint, unsigned long long minimum) noexcept;
[[nodiscard]] bool getAutostart() const noexcept;
[[nodiscard]] auto getBlkioParameters(enums::domain::MITPFlags flags) const noexcept;
[[nodiscard]] auto getBlockInfo(gsl::czstring<> disk) const noexcept -> std::optional<virDomainBlockInfo>;
[[nodiscard]] auto getBlockIoTune(gsl::czstring<> disk, enums::domain::MITPFlags flags) const noexcept;
[[nodiscard]] auto getBlockJobInfo(gsl::czstring<> disk, enums::domain::BlockJobInfoFlag flags) const noexcept;
[[nodiscard]] Connection getConnect() const noexcept;
[[nodiscard]] std::optional<virDomainControlInfo> getControlInfo() const noexcept;
[[nodiscard]] auto getTotalCPUStats() const noexcept;
[[nodiscard]] auto getCPUStats(unsigned start_cpu, unsigned ncpus) const noexcept;
[[nodiscard]] auto getDiskErrors() const noexcept;
[[nodiscard]] std::vector<DiskError> extractDiskErrors() const;
//[[nodiscard]] CpuMap getEmulatorPinInfo(std::size_t maplen, ModificationImpactFlag flags) const noexcept;
[[nodiscard]] auto getFSInfo() const noexcept;
[[nodiscard]] std::vector<FSInfo> extractFSInfo() const;
[[nodiscard]] auto getJobStats(enums::domain::GetJobStatsFlag flags) const noexcept;
[[nodiscard]] std::optional<TypedParams> getGuestVcpus() const noexcept;
[[nodiscard]] UniqueZstring getHostname() const noexcept;
[[nodiscard]] std::string extractHostname() const noexcept;
[[nodiscard]] unsigned getID() const noexcept;
[[nodiscard]] auto getIOThreadInfo(enums::domain::ModificationImpactFlag flags) const noexcept;
[[nodiscard]] auto extractIOThreadInfo(enums::domain::ModificationImpactFlag flags) const -> std::vector<heavy::IOThreadInfo>;
[[nodiscard]] Info getInfo() const noexcept;
[[nodiscard]] auto getInterfaceParameters(gsl::czstring<> device, enums::domain::MITPFlags flags) const noexcept;
[[nodiscard]] std::optional<JobInfo> getJobInfo() const noexcept;
[[nodiscard]] auto getLaunchSecurityInfo() const noexcept;
[[nodiscard]] int getMaxVcpus() const noexcept;
[[nodiscard]] auto getMemoryParameters(enums::domain::MITPFlags flags) const noexcept;
[[nodiscard]] UniqueZstring getMetadata(enums::domain::MetadataType type, gsl::czstring<> ns,
enums::domain::ModificationImpactFlag flags) const noexcept;
[[nodiscard]] std::string extractMetadata(enums::domain::MetadataType type, gsl::czstring<> ns,
enums::domain::ModificationImpactFlag flags) const;
[[nodiscard]] gsl::czstring<> getName() const noexcept;
[[nodiscard]] auto getNumaParameters(enums::domain::MITPFlags flags) const noexcept;
[[nodiscard]] int getNumVcpus(enums::domain::VCpuFlag flags) const noexcept;
[[nodiscard]] auto getSchedulerType() const noexcept -> std::pair<UniqueZstring, int>;
[[nodiscard]] auto getSecurityLabel() const noexcept -> std::unique_ptr<virSecurityLabel>;
[[nodiscard]] auto getSecurityLabelList() const noexcept;
[[nodiscard]] auto extractSecurityLabelList() const -> std::vector<virSecurityLabel>;
[[nodiscard]] auto getState() const noexcept -> StateWReason;
[[nodiscard]] auto getTime() const noexcept;
[[nodiscard]] auto getUUID() const;
[[nodiscard]] bool isActive() const noexcept;
[[nodiscard]] auto getUUIDString() const noexcept -> std::optional<std::array<char, VIR_UUID_STRING_BUFLEN>>;
[[nodiscard]] auto extractUUIDString() const -> std::string;
[[nodiscard]] auto getOSType() const;
[[nodiscard]] unsigned long getMaxMemory() const noexcept;
[[nodiscard]] auto getSchedulerParameters() const noexcept;
[[nodiscard]] auto getSchedulerParameters(enums::domain::MITPFlags flags) const noexcept;
[[nodiscard]] auto getPerfEvents(enums::domain::MITPFlags flags) const noexcept;
[[nodiscard]] auto getVcpuPinInfo(enums::domain::VCpuFlag flags) -> std::optional<std::vector<unsigned char>>;
[[nodiscard]] auto getVcpus() const noexcept;
[[nodiscard]] UniqueZstring getXMLDesc(enums::domain::XMLFlags flag) const noexcept;
[[nodiscard]] TFE hasManagedSaveImage() const noexcept;
bool injectNMI() noexcept;
[[nodiscard]] auto interfaceAddressesView(enums::domain::InterfaceAddressesSource source) const noexcept;
[[nodiscard]] auto interfaceAddresses(enums::domain::InterfaceAddressesSource source) const -> std::vector<Interface>;
[[nodiscard]] auto interfaceStats(gsl::czstring<> device) const noexcept -> std::optional<virDomainInterfaceStatsStruct>;
[[nodiscard]] TFE isPersistent() const noexcept;
[[nodiscard]] TFE isUpdated() const noexcept;
bool PMSuspendForDuration(unsigned target, unsigned long long duration) noexcept;
bool PMWakeup() noexcept;
// [[nodiscard]] static int listGetStats(gsl::basic_zstring<Domain> doms, StatsType stats, virDomainStatsRecordPtr** retStats,
// GetAllDomainStatsFlag flags);
bool managedSave(enums::domain::SaveRestoreFlag flag) noexcept;
bool managedSaveDefineXML(gsl::czstring<> dxml, enums::domain::SaveRestoreFlag flag) noexcept;
[[nodiscard]] UniqueZstring managedSaveGetXMLDesc(enums::domain::SaveImageXMLFlag flag) const noexcept;
[[nodiscard]] std::string managedSaveExtractXMLDesc(enums::domain::SaveImageXMLFlag flag) const noexcept;
bool managedSaveRemove() noexcept;
bool memoryPeek(unsigned long long start, gsl::span<unsigned char> buffer, enums::domain::MemoryFlag flag) const noexcept;
auto memoryStats(unsigned int nr_stats) const noexcept;
[[nodiscard]] Domain migrate(Connection dconn, enums::domain::MigrateFlag flags, gsl::czstring<> dname, gsl::czstring<> uri,
unsigned long bandwidth) noexcept;
[[nodiscard]] Domain migrate(Connection dconn, gsl::czstring<> dxml, enums::domain::MigrateFlag flags, gsl::czstring<> dname, gsl::czstring<> uri,
unsigned long bandwidth) noexcept;
[[nodiscard]] Domain migrate(Connection dconn, const TypedParams& params, enums::domain::MigrateFlag flags) noexcept;
bool migrateToURI(gsl::czstring<> duri, enums::domain::MigrateFlag flags, gsl::czstring<> dname, unsigned long bandwidth) noexcept;
bool migrateToURI(gsl::czstring<> dconnuri, gsl::czstring<> miguri, gsl::czstring<> dxml, enums::domain::MigrateFlag flags, gsl::czstring<> dname,
unsigned long bandwidth) noexcept;
bool migrateToURI(gsl::czstring<> dconnuri, const TypedParams& params, enums::domain::MigrateFlag flags) noexcept;
[[nodiscard]] auto migrateGetCompressionCache() const noexcept -> std::optional<unsigned long long>;
[[nodiscard]] auto migrateGetMaxDowntime() const noexcept -> std::optional<unsigned long long>;
[[nodiscard]] auto migrateGetMaxSpeed(unsigned int flag) const noexcept -> std::optional<unsigned long>;
bool migrateSetCompressionCache(unsigned long long cacheSize) noexcept;
bool migrateSetMaxDowntime(unsigned long long downtime) noexcept;
bool migrateSetMaxSpeed(unsigned long bandwidth, unsigned int flag) noexcept;
bool migrateStartPostCopy(unsigned int flag) noexcept;
bool openChannel(gsl::czstring<> name, Stream& st, enums::domain::ChannelFlag flags) noexcept;
bool openConsole(gsl::czstring<> dev_name, Stream& st, enums::domain::ConsoleFlag flags) noexcept;
bool openGraphics(unsigned int idx, int fd, enums::domain::OpenGraphicsFlag flags) const noexcept;
[[nodiscard]] int openGraphicsFD(unsigned int idx, enums::domain::OpenGraphicsFlag flags) const noexcept;
bool pinEmulator(CpuMap cpumap, enums::domain::ModificationImpactFlag flags) noexcept;
bool pinIOThread(unsigned int iothread_id, CpuMap cpumap, enums::domain::ModificationImpactFlag flags) noexcept;
bool pinVcpu(unsigned int vcpu, CpuMap cpumap) noexcept;
bool pinVcpuFlags(unsigned int vcpu, CpuMap cpumap, enums::domain::ModificationImpactFlag flags) noexcept;
bool sendKey(enums::domain::KeycodeSet codeset, unsigned int holdtime, gsl::span<const unsigned int> keycodes) noexcept;
bool sendProcessSignal(long long pid_value, enums::domain::ProcessSignal signum) noexcept;
bool setMaxMemory(unsigned long);
bool setMemory(unsigned long);
bool setMemoryStatsPeriod(int period, enums::domain::MemoryModFlag flags) noexcept;
bool reboot(enums::domain::ShutdownFlag flags);
bool reboot();
bool reset();
bool rename(gsl::czstring<>);
bool resume() noexcept;
bool save(gsl::czstring<> to) noexcept;
bool save(gsl::czstring<> to, gsl::czstring<> dxml, enums::domain::SaveRestoreFlag flags) noexcept;
UniqueZstring screenshot(Stream& stream, unsigned int screen) const noexcept;
bool setAutoStart(bool);
bool setBlkioParameters(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept;
bool setBlockIoTune(gsl::czstring<> disk, TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept;
bool setBlockThreshold(gsl::czstring<> dev, unsigned long long threshold) noexcept;
bool setGuestVcpus(gsl::czstring<> cpumap, bool state) noexcept; // https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetGuestVcpus
bool setIOThreadParams(unsigned int iothread_id, TypedParams params, enums::domain::MITPFlags flags) noexcept;
bool setInterfaceParameters(gsl::czstring<> device, TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept;
bool setLifecycleAction(enums::domain::Lifecycle type, enums::domain::LifecycleAction action,
enums::domain::ModificationImpactFlag flags) noexcept;
bool setMemoryFlags(unsigned long memory, enums::domain::MemoryModFlag flags) noexcept;
bool setMemoryParameters(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept;
bool setNumaParameters(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept;
bool setPerfEvents(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept;
bool setSchedulerParameters(TypedParams params) noexcept;
bool setSchedulerParameters(TypedParams params, enums::domain::ModificationImpactFlag flags) noexcept;
bool setMetadata(enums::domain::MetadataType type, gsl::czstring<> metadata, gsl::czstring<> key, gsl::czstring<> uri,
enums::domain::ModificationImpactFlag flags) noexcept;
bool setTime(long long seconds, unsigned int nseconds, enums::domain::SetTimeFlag flags) noexcept;
bool setUserPassword(gsl::czstring<> user, gsl::czstring<> password, enums::domain::SetUserPasswordFlag flags) noexcept;
bool setVcpu(gsl::czstring<> vcpumap, bool state, enums::domain::ModificationImpactFlag flags) noexcept;
bool setVcpus(unsigned int nvcpus) noexcept;
bool setVcpus(unsigned int nvcpus, enums::domain::VCpuFlag flags) noexcept;
bool shutdown() noexcept;
bool shutdown(enums::domain::ShutdownFlag flag) noexcept;
bool suspend() noexcept;
bool undefine() noexcept;
bool undefine(enums::domain::UndefineFlag) noexcept;
bool updateDeviceFlags(gsl::czstring<> xml, enums::domain::DeviceModifyFlag flags) noexcept;
[[nodiscard]] static Domain createXML(Connection&, gsl::czstring<> xml, enums::domain::CreateFlag flags);
[[nodiscard]] static Domain createXML(Connection&, gsl::czstring<> xml);
// [[nodiscard]] static Domain defineXML();
};
class Domain::StatsRecord {
friend Connection;
Domain dom;
std::vector<TypedParameter> params{};
explicit StatsRecord(const virDomainStatsRecord&) noexcept;
public:
};
class Domain::StateWReason
: public std::variant<enums::domain::state_reason::NoState, enums::domain::state_reason::Running, enums::domain::state_reason::Blocked,
enums::domain::state_reason::Paused, enums::domain::state_reason::Shutdown, enums::domain::state_reason::Shutoff,
enums::domain::state_reason::Crashed, enums::domain::state_reason::PMSuspended> {
constexpr enums::domain::State state() const noexcept { return enums::domain::State(EHTag{}, this->index()); }
};
struct alignas(alignof(virDomainDiskError)) Domain::DiskError {
enum class Code : decltype(virDomainDiskError::error) {
NONE = VIR_DOMAIN_DISK_ERROR_NONE, /* no error */
UNSPEC = VIR_DOMAIN_DISK_ERROR_UNSPEC, /* unspecified I/O error */
NO_SPACE = VIR_DOMAIN_DISK_ERROR_NO_SPACE, /* no space left on the device */
};
UniqueZstring disk;
Code error;
};
struct Domain::FSInfo {
std::string mountpoint; /* path to mount point */
std::string name; /* device name in the guest (e.g. "sda1") */
std::string fstype; /* filesystem type */
std::vector<std::string> dev_alias; /* vector of disk device aliases */
FSInfo(virDomainFSInfo* from) noexcept
: mountpoint(from->mountpoint), name(from->name), fstype(from->fstype), dev_alias(from->devAlias, from->devAlias + from->ndevAlias) {
virDomainFSInfoFree(from);
}
};
class Domain::IPAddress {
friend Domain;
friend Interface;
IPAddress(virDomainIPAddressPtr ptr) : type(Type{ptr->type}), addr(ptr->addr), prefix(ptr->prefix) {}
public:
enum class Type : int {
IPV4 = VIR_IP_ADDR_TYPE_IPV4,
IPV6 = VIR_IP_ADDR_TYPE_IPV6,
};
IPAddress() noexcept = default;
IPAddress(const virDomainIPAddress& ref) : type(Type{ref.type}), addr(ref.addr), prefix(ref.prefix) {}
IPAddress(Type type, std::string addr, uint8_t prefix) noexcept : type(type), addr(std::move(addr)), prefix(prefix) {}
Type type;
std::string addr;
uint8_t prefix;
};
class Domain::IPAddressView : private virDomainIPAddress {
friend InterfaceView;
using Base = virDomainIPAddress;
public:
[[nodiscard]] constexpr IPAddress::Type type() const noexcept { return IPAddress::Type{Base::type}; }
[[nodiscard]] constexpr gsl::czstring<> addr() const noexcept { return Base::addr; }
[[nodiscard]] constexpr uint8_t prefix() const noexcept { return Base::prefix; }
[[nodiscard]] operator IPAddress() const noexcept { return {type(), addr(), prefix()}; };
};
class Domain::Interface {
friend Domain;
public:
Interface(virDomainInterfacePtr ptr) : name(ptr->name), hwaddr(ptr->hwaddr), addrs(ptr->addrs, ptr->addrs + ptr->naddrs) {}
std::string name;
std::string hwaddr;
std::vector<IPAddress> addrs;
};
class Domain::InterfaceView : private virDomainInterface {
using Base = virDomainInterface;
public:
~InterfaceView() noexcept { virDomainInterfaceFree(this); }
[[nodiscard]] constexpr gsl::czstring<> name() const noexcept { return Base::name; }
[[nodiscard]] constexpr gsl::czstring<> hwaddr() const noexcept { return Base::hwaddr; }
[[nodiscard]] constexpr gsl::span<IPAddressView> addrs() const noexcept { return {static_cast<IPAddressView*>(Base::addrs), Base::naddrs}; }
};
struct alignas(alignof(virDomainJobInfo)) Domain::JobInfo : public virDomainJobInfo {
[[nodiscard]] constexpr enums::domain::JobType type() const noexcept { return enums::domain::JobType{virDomainJobInfo::type}; }
};
// concept Domain::IOThreadInfo
class alignas(alignof(virDomainIOThreadInfo)) Domain::light::IOThreadInfo : private virDomainIOThreadInfo {
friend Domain;
using Base = virDomainIOThreadInfo;
public:
inline ~IOThreadInfo() noexcept { virDomainIOThreadInfoFree(this); }
constexpr unsigned iothread_id() const noexcept { return Base::iothread_id; }
constexpr unsigned& iothread_id() noexcept { return Base::iothread_id; }
constexpr CpuMap cpumap() const noexcept { return {Base::cpumap, Base::cpumaplen}; }
constexpr CpuMap cpumap() noexcept { return {Base::cpumap, Base::cpumaplen}; }
};
class Domain::heavy::IOThreadInfo {
friend Domain;
unsigned m_iothread_id{};
std::vector<unsigned char> m_cpumap{};
IOThreadInfo(const virDomainIOThreadInfo& ref) noexcept
: m_iothread_id(ref.iothread_id), m_cpumap(ref.cpumap, ref.cpumap + ref.cpumaplen) {} // C++2aTODO make constexpr
public:
IOThreadInfo(virDomainIOThreadInfo* ptr) noexcept
: m_iothread_id(ptr->iothread_id), m_cpumap(ptr->cpumap, ptr->cpumap + ptr->cpumaplen) {} // C++2aTODO make constexpr
inline ~IOThreadInfo() = default;
constexpr unsigned iothread_id() const noexcept { return m_iothread_id; }
constexpr unsigned& iothread_id() noexcept { return m_iothread_id; }
gsl::span<const unsigned char> cpumap() const noexcept { return {m_cpumap.data(), static_cast<long>(m_cpumap.size())}; }
CpuMap cpumap() noexcept { return {m_cpumap.data(), static_cast<int>(m_cpumap.size())}; }
};
} // namespace virt
#include "impl/Domain.hpp"
#endif | 43.082353 | 150 | 0.721815 | AeroStun |
6bb03b09da63988edc7040cc8632669eddb6daa5 | 1,454 | cpp | C++ | testing/execution/executor/executor_traits/executor_execution_category.cpp | brycelelbach/agency | aef6649ea4e8cce334dd47c346d42b3c9eaf1222 | [
"BSD-3-Clause"
] | null | null | null | testing/execution/executor/executor_traits/executor_execution_category.cpp | brycelelbach/agency | aef6649ea4e8cce334dd47c346d42b3c9eaf1222 | [
"BSD-3-Clause"
] | null | null | null | testing/execution/executor/executor_traits/executor_execution_category.cpp | brycelelbach/agency | aef6649ea4e8cce334dd47c346d42b3c9eaf1222 | [
"BSD-3-Clause"
] | 1 | 2019-06-10T06:21:44.000Z | 2019-06-10T06:21:44.000Z | #include <iostream>
#include <agency/execution/executor/executor_traits.hpp>
#include "../test_executors.hpp"
struct bulk_executor_without_category
{
template<class Function, class ResultFactory, class SharedFactory>
typename std::result_of<ResultFactory()>::type
bulk_sync_execute(Function f, size_t n, ResultFactory result_factory, SharedFactory shared_factory);
};
struct bulk_executor_with_category
{
using execution_category = agency::sequenced_execution_tag;
template<class Function, class ResultFactory, class SharedFactory>
typename std::result_of<ResultFactory()>::type
bulk_sync_execute(Function f, size_t n, ResultFactory result_factory, SharedFactory shared_factory);
};
int main()
{
using namespace agency;
static_assert(!agency::detail::is_detected<executor_execution_category_t, not_an_executor>::value,
"executor_execution_category_t<not_an_executor> should not be detected");
static_assert(agency::detail::is_detected_exact<unsequenced_execution_tag, executor_execution_category_t, bulk_executor_without_category>::value,
"bulk_executor_without_category should have unsequenced_execution_tag execution_category");
static_assert(agency::detail::is_detected_exact<sequenced_execution_tag, executor_execution_category_t, bulk_executor_with_category>::value,
"bulk_executor_with_category should have sequenced_execution_tag execution_category");
std::cout << "OK" << std::endl;
return 0;
}
| 34.619048 | 147 | 0.815681 | brycelelbach |
6bb046663e3e1ca84b74ca857009a40e40915b9b | 7,473 | cpp | C++ | src/tohir.cpp | kimmoli/tohiri-app | 8508dd05bf55847158c3d1ed99fa6dad2d013bfb | [
"MIT"
] | 1 | 2017-10-06T10:39:50.000Z | 2017-10-06T10:39:50.000Z | src/tohir.cpp | kimmoli/tohiri-app | 8508dd05bf55847158c3d1ed99fa6dad2d013bfb | [
"MIT"
] | null | null | null | src/tohir.cpp | kimmoli/tohiri-app | 8508dd05bf55847158c3d1ed99fa6dad2d013bfb | [
"MIT"
] | null | null | null | #include "tohir.h"
#include <QSettings>
#include <QCoreApplication>
#include <QTime>
#include <QtDBus/QtDBus>
#include <QDBusArgument>
#include "amg883x.h"
TohIR::TohIR(QObject *parent) :
QObject(parent)
{
// Create seed for the random
// That is needed only once on application startup
QTime time = QTime::currentTime();
qsrand((uint)time.msec());
m_min = 100.0;
m_max = -20.0;
m_avg = 0.0;
m_hotSpot = 31;
readSettings();
controlVdd(true);
QThread::msleep(300);
amg = new amg883x(0x68);
}
void TohIR::readSettings()
{
QSettings s("kimmoli", "tohiri");
s.beginGroup("View");
m_gradientOpacity = s.value("gradientOpacity", "0.5").toReal();
m_updateRate = s.value("updateRate", 500).toInt();
m_granularity = s.value("granularity", "2.0").toReal();
m_contrast = s.value("contrast", 1.0).toReal();
s.endGroup();
emit gradientOpacityChanged();
emit updateRateChanged();
emit granularityChanged();
emit contrastChanged();
}
void TohIR::saveSettings()
{
QSettings s("kimmoli", "tohiri");
s.beginGroup("View");
s.setValue("gradientOpacity", QString::number(m_gradientOpacity,'f',2) );
s.setValue("updateRate", m_updateRate);
s.setValue("granularity", m_granularity);
s.setValue("contrast", m_contrast);
s.endGroup();
}
TohIR::~TohIR()
{
controlVdd(false);
}
int TohIR::randInt(int low, int high)
{
// Random number between low and high
return qrand() % ((high + 1) - low) + low;
}
/* Return git describe as string (see .pro file) */
QString TohIR::readVersion()
{
return QString(APPVERSION);
}
/**/
qreal TohIR::readGradientOpacity()
{
return m_gradientOpacity;
}
/**/
void TohIR::writeGradientOpacity(qreal val)
{
m_gradientOpacity = val;
emit gradientOpacityChanged();
}
int TohIR::readUpdateRate()
{
return m_updateRate;
}
void TohIR::writeUpdateRate(int val)
{
m_updateRate = val;
emit updateRateChanged();
}
qreal TohIR::readGranularity()
{
return m_granularity;
}
void TohIR::writeGranularity(qreal val)
{
m_granularity = val;
emit granularityChanged();
}
qreal TohIR::readContrast()
{
return m_contrast;
}
void TohIR::writeContrast(qreal val)
{
m_contrast = val;
emit contrastChanged();
}
/* Return thermistor temperature */
QString TohIR::readThermistor()
{
return QString("%1 °C").arg(QString::number(amg->getThermistor(), 'g', 3));
}
/* Start IR Scan function, emit changed after completed */
void TohIR::startScan()
{
// printf("Thermistor %0.5f\n", amg->getThermistor());
QList<qreal> res = amg->getTemperatureArray();
int i;
qreal thisMax = -40.0;
m_min = 200.0;
m_max = -40.0;
m_avg = 0.0;
// for (i=0 ; i < 64 ; i++)
// printf("%0.2f%s", res.at(i), (( i%8 == 0 ) ? "\n" : " ") );
/* Return color gradient array */
for (i=0 ; i<64 ; i++)
{
/* Just use whole numbers */
qreal tmp = res.at(i);
if (tmp > thisMax)
{
thisMax = tmp;
m_hotSpot = i;
}
if (tmp > m_max)
m_max = tmp;
if (tmp < m_min)
m_min = tmp;
m_avg = m_avg + tmp;
}
emit maxTempChanged();
emit minTempChanged();
emit hotSpotChanged();
m_avg = m_avg/64;
emit avgTempChanged();
/* Get RGB values for each pixel */
m_temperatures.clear();
for (i=0 ; i<64 ; i++)
m_temperatures.append(temperatureColor(res.at(i), m_min, m_max, m_avg));
emit temperaturesChanged();
}
/* Return temperature color gradients as array */
QList<QString> TohIR::readTemperatures()
{
return m_temperatures;
}
/* Return minimum, average and maximum temperature of last scan */
QString TohIR::readMinTemp()
{
return QString("%1 °C").arg(QString::number(m_min, 'g', 3));
}
QString TohIR::readAvgTemp()
{
return QString("%1 °C").arg(QString::number(m_avg, 'g', 3));
}
QString TohIR::readMaxTemp()
{
return QString("%1 °C").arg(QString::number(m_max, 'g', 3));
}
int TohIR::readHotSpot()
{
return m_hotSpot;
}
/* Call dbus method to save screencapture */
void TohIR::saveScreenCapture()
{
QDate ssDate = QDate::currentDate();
QTime ssTime = QTime::currentTime();
QString ssFilename = QString("%8/tohiri-%1%2%3-%4%5%6-%7.png")
.arg((int) ssDate.day(), 2, 10, QLatin1Char('0'))
.arg((int) ssDate.month(), 2, 10, QLatin1Char('0'))
.arg((int) ssDate.year(), 2, 10, QLatin1Char('0'))
.arg((int) ssTime.hour(), 2, 10, QLatin1Char('0'))
.arg((int) ssTime.minute(), 2, 10, QLatin1Char('0'))
.arg((int) ssTime.second(), 2, 10, QLatin1Char('0'))
.arg((int) ssTime.msec(), 3, 10, QLatin1Char('0'))
.arg(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
QDBusMessage m = QDBusMessage::createMethodCall("org.nemomobile.lipstick",
"/org/nemomobile/lipstick/screenshot",
"",
"saveScreenshot" );
QList<QVariant> args;
args.append(ssFilename);
m.setArguments(args);
if (QDBusConnection::sessionBus().send(m))
printf("Screenshot success to %s\n", qPrintable(ssFilename));
else
printf("Screenshot failed\n");
}
QString TohIR::temperatureColor(qreal temp, qreal min, qreal max, qreal avg)
{
/* We have 61 different colors - for now */
static const QString lookup[61] =
{
"#0500ff", "#0400ff", "#0300ff", "#0200ff", "#0100ff", "#0000ff",
"#0002ff", "#0012ff", "#0022ff", "#0032ff", "#0044ff", "#0054ff",
"#0064ff", "#0074ff", "#0084ff", "#0094ff", "#00a4ff", "#00b4ff",
"#00c4ff", "#00d4ff", "#00e4ff", "#00fff4", "#00ffd0", "#00ffa8",
"#00ff83", "#00ff5c", "#00ff36", "#00ff10", "#17ff00", "#3eff00",
"#65ff00", "#8aff00", "#b0ff00", "#d7ff00", "#fdff00", "#FFfa00",
"#FFf000", "#FFe600", "#FFdc00", "#FFd200", "#FFc800", "#FFbe00",
"#FFb400", "#FFaa00", "#FFa000", "#FF9600", "#FF8c00", "#FF8200",
"#FF7800", "#FF6e00", "#FF6400", "#FF5a00", "#FF5000", "#FF4600",
"#FF3c00", "#FF3200", "#FF2800", "#FF1e00", "#FF1400", "#FF0a00",
"#FF0000"
};
/* If true span is low, tweak it to around avg */
if ((max - min) < 20.0)
{
max = ( ((avg + 10.0) > max) ? (avg + 10.0) : max );
min = ( ((avg - 10.0) < min) ? (avg - 10.0) : min );
}
/* Adjust low end to 0, to get only positive numbers */
qreal t = temp - min;
/* span is 2x max or min difference to average, which is larger */
qreal span = 2.0 * ((max - avg) > (avg - min) ? (max - avg) : (avg - min));
/* Scale to 60 points */
qreal x = (t * (60000.0/span))/1000.0;
/* just to prevent segfaults, return error color (white) */
if ( (x < 0.0) || (x > 60.0) )
return "#FFFFFF";
return lookup[static_cast<int>(x)]; /* Return corresponding RGB color */
}
void TohIR::controlVdd(bool state)
{
int fd = open("/sys/devices/platform/reg-userspace-consumer.0/state", O_WRONLY);
if (!(fd < 0))
{
if (write (fd, state ? "1" : "0", 1) != 1)
qDebug() << "Failed to control VDD.";
close(fd);
}
return;
}
| 23.951923 | 93 | 0.569785 | kimmoli |