lang
stringclasses
3 values
file_path
stringlengths
5
150
repo_name
stringlengths
6
110
commit
stringlengths
40
40
file_code
stringlengths
1.52k
18.9k
prefix
stringlengths
82
16.5k
suffix
stringlengths
0
15.1k
middle
stringlengths
121
8.18k
strategy
stringclasses
8 values
context_items
listlengths
0
100
C++
src/BabylonCpp/src/maths/spherical_polynomial.cpp
samdauwe/BabylonCpp
eea9f761a49bb460ff1324c20e4674ef120e94f1
#include <babylon/maths/spherical_polynomial.h> #include <babylon/maths/color3.h> #include <babylon/maths/tmp_vectors.h> namespace BABYLON { SphericalPolynomial::SphericalPolynomial() : x{Vector3::Zero()} , y{Vector3::Zero()} , z{Vector3::Zero()} , xx{Vector3::Zero()} , yy{Vector3::Zero()} , ...
#include <babylon/maths/spherical_polynomial.h> #include <babylon/maths/color3.h> #include <babylon/maths/tmp_vectors.h> namespace BABYLON { SphericalPolynomial::SphericalPolynomial() : x{Vector3::Zero()} , y{Vector3::Zero()} , z{Vector3::Zero()} , xx{Vector3::Zero()} , yy{Vector3::Zero()} , ...
}
9) { return sp; } Vector3::FromArrayToRef(data[0], 0, sp.x); Vector3::FromArrayToRef(data[1], 0, sp.y); Vector3::FromArrayToRef(data[2], 0, sp.z); Vector3::FromArrayToRef(data[3], 0, sp.xx); Vector3::FromArrayToRef(data[4], 0, sp.yy); Vector3::FromArrayToRef(data[5], 0, sp.zz); Vector3::FromArrayTo...
function_block-function_prefixed
[ { "content": "class Color3;\n", "file_path": "src/BabylonCpp/include/babylon/maths/spherical_harmonics.h", "rank": 0, "score": 282209.0951003985 }, { "content": "namespace BABYLON {\n\n\n\n/**\n\n * @brief Defines One Image in the file. It requires only the position in the\n\n * file as well...
C++
examples/UseOptiXGeometryInstancedStandalone/UseOptiXGeometryInstancedStandalone.cc
hanswenzel/opticks
b75b5929b6cf36a5eedeffb3031af2920f75f9f0
#include <chrono> #include <iomanip> #include <iostream> #include <cstdlib> #include <cstring> #include <sstream> #include <fstream> #include <optix_world.h> #include <optixu/optixpp_namespace.h> #include <glm/glm.hpp> #include <glm/gtx/transform.hpp> #include <glm/gtc/type_ptr.hpp> void getEyeUVW(const glm::vec4&...
#include <chrono> #include <iomanip> #include <iostream> #include <cstdlib> #include <cstring> #include <sstream> #include <fstream> #include <optix_world.h> #include <optixu/optixpp_namespace.h> #include <glm/glm.hpp> #include <glm/gtx/transform.hpp> #include <glm/gtc/type_ptr.hpp> void getEyeUVW(const glm::vec4&...
tion( context->createAcceleration( "Trbvh" ) ); top->addChild(assembly); optix::Acceleration instance_accel = context->createAcceleration( "Trbvh" ); unsigned ichild(0); for( unsigned u = 0; u < nu; ++u ) { for( unsigned v = 0; v < nv ; ++v ) { for( unsigned w = 0; w < nw ; ++w ) { ...
ec3(axis_angle)) ; break ; case 't': mat = glm::translate(mat, tlat ) ; break ; } } return mat ; } glm::mat4 make_transform(const std::string& order) { glm::vec3 tla(0,0,100) ; glm::vec4 rot(0,0,1,45); glm::vec3 sca(1,1,1) ; return make_trans...
random
[ { "content": "struct DescriptorDataType<unsigned int> { static const char value = 'u'; };\n\ntemplate<>\n", "file_path": "npy/numpy.hpp", "rank": 0, "score": 339528.31468513457 }, { "content": "struct DescriptorDataType<unsigned char> { static const char value = 'u'; };\n\ntemplate<>\n", ...
C++
CompareContacts/main.cpp
Sioniras/MD-Tools
df408c122dfb57100bdc976dba66b47ee03622fe
#include <iostream> #include <vector> #include <memory> #include <cstdlib> #include <algorithm> #include <sstream> #include <iomanip> #include "ContactList.h" int main(int argc,char** argv) { if(argc < 4) { std::cout << "Please specify the minimum score and at least two contacts files." << std::endl; std::c...
#include <iostream> #include <vector> #include <memory> #include <cstdlib> #include <algorithm> #include <sstream> #include <iomanip> #include "ContactList.h" int main(int argc,char** argv) { if(argc < 4) { std::cout << "Please specify the minimum score and at least two contacts files." << std::endl; std::c...
str << " " << std::setw(columnpadding) << "" << " |"; } k2++; } if(m >= minscore) s[k-1] += str.str() + "\n"; } for(unsigned int i = 0;i < list.size(); i++) std::cout << s[i]; std::cout << std::string(str.str().size(),'-') << std::endl; std::cout << std::setw(2*columnpadding+2) ...
<< (*i).Left << " -" << std::setw(columnpadding) << (*i).Right + " |"; k = 0; k2 = 0; m = 0.0; for(auto j = list.cbegin(); j != list.cend(); j++) { auto it = std::find( (*j)->List().cbegin(), (*j)->List().cend(), (*i)); if(it != (*j)->List().cend() && (*it).Mean >= minscore) { k++;...
random
[ { "content": "// Contact helper struct\n\nstruct Contact\n\n{\n\n\tpublic:\n\n\t\t// Data members\n\n\t\tstd::string Left;\n\n\t\tstd::string Right;\n\n\t\tstd::string Type;\n\n\t\tfloat Mean;\n\n\t\tfloat Median;\n\n\t\tfloat HBondPercentage;\n\n\t\n\n\t\t// Constructors / destructor\n\n\t\tContact() {};\n\n\t...
C++
Builds/JuceLibraryCode/modules/juce_core/native/juce_android_Network.cpp
eriser/CSL
6f4646369f0c90ea90e2c113374044818ab37ded
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "<init>", "()V") \ METHOD (toString, "toString", "()Ljava/lang/String;") \ DECLARE_JNI_CLASS (StringBuffer, "java/lang/StringBuffer"); #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIEL...
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "<init>", "()V") \ METHOD (toString, "toString", "()Ljava/lang/String;") \ DECLARE_JNI_CLASS (StringBuffer, "java/lang/StringBuffer"); #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIEL...
LocalRef<jobject> responseHeaderBuffer (env->NewObject (StringBuffer, StringBuffer.constructor)); stream = GlobalRef (env->CallStaticObjectMethod (JuceAppActivity, JuceAppActivity.createHTTPStream, ...
if (postData.getSize() > 0) { postDataArray = env->NewByteArray (postData.getSize()); env->SetByteArrayRegion (postDataArray, 0, postData.getSize(), (const jbyte*) postData.getData()); }
if_condition
[ { "content": "class KarplusString : public UnitGenerator, public Scalable, public Phased {\n\n\n\npublic:\n\n\tKarplusString();\n\n\tKarplusString(float frequency);\n\n\tvoid setFrequency(float frequency);\n\n\tvoid trigger();\t\t\t\t\t///< reset internal buffers to re-pluck the string.\n\n\tvoid dump();\t\t\t\...
C++
curves/include/curves/PolynomialSpline.hpp
leggedrobotics/curves
696db3e9ecf67c143e7b48a8dd53d2c5ea1ba2fe
#pragma once #include <Eigen/Core> #include "curves/polynomial_splines_traits.hpp" #include <numeric> namespace curves { template <int splineOrder_> class PolynomialSpline { public: static constexpr unsigned int splineOrder = splineOrder_; static constexpr unsigned int coefficientCount = splineOrder + 1; ...
#pragma once #include <Eigen/Core> #include "curves/polynomial_splines_traits.hpp" #include <numeric> namespace curves { template <int splineOrder_> class PolynomialSpline { public: static constexpr unsigned int splineOrder = splineOrder_; static constexpr unsigned int coefficientCount = splineOrder + 1; ...
static inline void getDDTimeVectorAtZero(Eigen::Ref<EigenTimeVectorType> ddtimeVec) { ddtimeVec = Eigen::Map<const EigenTimeVectorType>((SplineImplementation::ddtauZero).data()); } template<typename Derived> static inline void getDDiffTimeVectorAtZero( Eigen::MatrixBase<Derived> const & ddtime...
Derived> static inline void getTimeVector(Eigen::MatrixBase<Derived> const & timeVec, const double tk) { assert(timeVec.rows() == EigenTimeVectorType::RowsAtCompileTime && timeVec.cols() == EigenTimeVectorType::ColsAtCompileTime); const_cast<Eigen::MatrixBase<Derived>&>(timeVec) = Eig...
random
[ { "content": "class LocalSupport2CoefficientManagerTest : public ::testing::Test {\n\n protected:\n\n\n\n typedef Eigen::Matrix<double,3,1> Coefficient;\n\n typedef LocalSupport2CoefficientManager<Coefficient>::CoefficientIter CoefficientIter;\n\n\n\n virtual void SetUp() {\n\n N = 50;\n\n for(size_t i...
C++
DigitalHaze-Libraries/cpp/DH_BitParser.cpp
Phytress/DigitalHaze-Libraries
a94a292da302da23851cc780cfec9d4736dcf9c4
#include "DH_BitParser.hpp" namespace DigitalHaze { BitParser::BitParser(void* buffer, size_t lenInBits) noexcept : dataPtr((unsigned char*) buffer), lengthInBits(lenInBits), startBitPos(0) { } BitParser::BitParser(const BitParser& other) noexcept : dataPtr(other.dataPtr), lengthInBits(other.lengthInBits), st...
#include "DH_BitParser.hpp" namespace DigitalHaze { BitParser::BitParser(void* buffer, size_t lenInBits) noexcept : dataPtr((unsigned char*) buffer), lengthInBits(lenInBits), startBitPos(0) { } BitParser::BitParser(const BitParser& other) noexcept : dataPtr(other.dataPtr), lengthInBits(other.lengthInBits), st...
or::operator!=(BitBufferIterator& rhs) const { return pos != rhs.pos; } SingleBitDescriptor BitBufferIterator::operator*() const { return (*bbPtr)[pos]; } BitBufferIterator& BitBufferIterator::operator++() { pos++; return *this; } }
s == rhs; } bool SingleBitDescriptor::operator!=(bool rhs) const { return !(*this == rhs); } SingleBitDescriptor::operator int() const { return !!(*bytePtr & (1 << bitPos)); } SingleBitDescriptor::operator bool() const { return !!(*bytePtr & (1 << bitPos)); } BitBufferIterator BitParser::begin() const...
random
[ { "content": "\tclass BitBufferIterator {\n\n\tpublic:\n\n\t\tBitBufferIterator(const BitParser* bptr, size_t bpos) noexcept;\n\n\n\n\t\tbool operator!=(BitBufferIterator& other) const;\n\n\t\tSingleBitDescriptor operator*() const;\n\n\t\tBitBufferIterator& operator++();\n\n\tprivate:\n\n\t\tsize_t pos;\n\n\t\t...
C++
qt-creator-opensource-src-4.6.1/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp
kevinlq/Qt-Creator-Opensource-Study
b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f
#include "itemlibraryinfo.h" #include "nodemetainfo.h" #include <QSharedData> #include <utils/fileutils.h> namespace QmlDesigner { namespace Internal { class ItemLibraryEntryData : public QSharedData { public: ItemLibraryEntryData() : majorVersion(-1), minorVersion(-1) { } QString name; TypeName ...
#include "itemlibraryinfo.h" #include "nodemetainfo.h" #include <QSharedData> #include <utils/fileutils.h> namespace QmlDesigner { namespace Internal { class ItemLibraryEntryData : public QSharedData { public: ItemLibraryEntryData() : majorVersion(-1), minorVersion(-1) { } QString name; TypeName ...
QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry) { stream >> itemLibraryEntry.m_data->name; stream >> itemLibraryEntry.m_data->typeName; stream >> itemLibraryEntry.m_data->majorVersion; stream >> itemLibraryEntry.m_data->minorVersion; stream >> itemLibraryEntry.m_da...
QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibraryEntry) { stream << itemLibraryEntry.name(); stream << itemLibraryEntry.typeName(); stream << itemLibraryEntry.majorVersion(); stream << itemLibraryEntry.minorVersion(); stream << itemLibraryEntry.typeIcon(); stream <...
function_block-full_function
[]
C++
code_reading/oceanbase-master/src/sql/optimizer/ob_log_table_lookup.cpp
wangcy6/weekly_read
3a8837ee9cd957787ee1785e4066dd623e02e13a
#define USING_LOG_PREFIX SQL_OPT #include "sql/optimizer/ob_log_table_lookup.h" #include "sql/optimizer/ob_log_table_scan.h" #include "sql/optimizer/ob_log_plan.h" using namespace oceanbase::share; namespace oceanbase { namespace sql { int ObLogTableLookup::copy_without_child(ObLogicalOperator*& out) { int ret = ...
#define USING_LOG_PREFIX SQL_OPT #include "sql/optimizer/ob_log_table_lookup.h" #include "sql/optimizer/ob_log_table_scan.h" #include "sql/optimizer/ob_log_plan.h" using namespace oceanbase::share; namespace oceanbase { namespace sql { int ObLogTableLookup::copy_without_child(ObLogicalOperator*& out) { int ret = ...
bool is_basic = false; ObLogicalOperator* child = NULL; ObExchangeInfo exch_info; if (OB_ISNULL(ctx) || OB_ISNULL(child = get_child(first_child))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(ctx), K(child), K(ret)); } else if (OB_FAIL(compute_basic_sharding_info(ctx, is_basic))) { ...
rn ret; } int ObLogTableLookup::transmit_op_ordering() { int ret = OB_SUCCESS; reset_op_ordering(); reset_local_ordering(); return ret; } int ObLogTableLookup::allocate_expr_post(ObAllocExprContext& ctx) { int ret = OB_SUCCESS; if (OB_ISNULL(index_back_scan_)) { ret = OB_INVALID_ARGUMENT; LOG_WARN...
random
[]
C++
Servable/DlibServable/test/TestDlibServable.cpp
bzcheeseman/BatchingRPCServer
d1130720fef6e15e129fa59cc37235537f609e36
#include <dlib/data_io.h> #include <sstream> #include "BatchingRPC.pb.h" #include "DlibServable.hpp" #include "gtest/gtest.h" namespace { using namespace dlib; using net_type = loss_multiclass_log<fc< 10, relu<fc< 84, relu<fc< 120, max_pool<2, 2, 2, 2, ...
#include <dlib/data_io.h> #include <sstream> #include "BatchingRPC.pb.h" #include "DlibServable.hpp" #include "gtest/gtest.h" namespace { using namespace dlib; using net_type = loss_multiclass_log<fc< 10, relu<fc< 84, relu<fc< 120, max_pool<2, 2, 2, 2, ...
}
TEST_F(TestDlibServable, NextBatch) { Serving::DlibServable<net_type, matrix<unsigned char>, unsigned long> servable(3); servable.Bind(raw_args); Serving::TensorMessage msg = ToMessage({input_[0], input_[1]}); msg.set_client_id("too_big"); Serving::ReturnCodes r = servable.AddToBatch(msg); EXPECT_EQ...
function_block-full_function
[ { "content": "class DlibServable : public Servable {\n\npublic:\n\n DlibServable(const int &batch_size);\n\n ~DlibServable() override;\n\n\n\n ReturnCodes SetBatchSize(const int &new_size) override;\n\n\n\n ReturnCodes AddToBatch(const TensorMessage &message) override;\n\n\n\n ReturnCodes GetResult(const s...
C++
src/plugins/algorithms/lda.cpp
kmoham6/phylanx
252fa5fbb84acaf6f999410e6823b9f8d6693213
#include <phylanx/config.hpp> #include <phylanx/plugins/algorithms/lda.hpp> #include <hpx/iostream.hpp> #include <hpx/include/lcos.hpp> #include <hpx/include/util.hpp> #include <hpx/errors/throw_exception.hpp> #include <cstddef> #include <cstdint> #include <iostream> #include <memory> #include <numeric> #include <s...
#include <phylanx/config.hpp> #include <phylanx/plugins/algorithms/lda.hpp> #include <hpx/iostream.hpp> #include <hpx/include/lcos.hpp> #include <hpx/include/util.hpp> #include <hpx/errors/throw_exception.hpp> #include <cstddef> #include <cstdint> #include <iostream> #include <memory> #include <numeric> #include <s...
d_doc_mat') to represent a matrix")); } auto word_doc_mat = arg5.matrix(); using lda_trainer_t = phylanx::execution_tree::primitives::lda_trainer_impl; lda_trainer_t trainer(alpha, beta); auto result = trainer(word_doc_mat, topics, iterations); return prim...
st of two matrices:\n" " [word_topic, document_topic] :\n" "\n" "word_topic: document-topic assignment matrix\n" "document_topic: document-topic assignment matrix\n" "\n" )}; lda_trainer::lda_trainer(primitive_arguments_type && operands, ...
random
[ { "content": " class matrix_column_iterator\n\n : public hpx::util::iterator_facade<matrix_column_iterator<T>,\n\n blaze::Column<T>, std::random_access_iterator_tag, blaze::Column<T>>\n\n {\n\n public:\n\n explicit matrix_column_iterator(T& t, const std::size_t index = 0)\n\n ...
C++
src/backend/gporca/libgpopt/src/search/CJobGroupOptimization.cpp
Viocalpan/gpdb
3cf72f6cbed32cc5e5aeea645beeb4c82db9ac1a
#include "gpopt/engine/CEngine.h" #include "gpopt/search/CGroup.h" #include "gpopt/search/CGroupExpression.h" #include "gpopt/search/CGroupProxy.h" #include "gpopt/search/CJobFactory.h" #include "gpopt/search/CJobGroupImplementation.h" #include "gpopt/search/CJobGroupOptimization.h" #include "gpopt/search/CJobGroupEx...
#include "gpopt/engine/CEngine.h" #include "gpopt/search/CGroup.h" #include "gpopt/search/CGroupExpression.h" #include "gpopt/search/CGroupProxy.h" #include "gpopt/search/CJobFactory.h" #include "gpopt/search/CJobGroupImplementation.h" #include "gpopt/search/CJobGroupOptimization.h" #include "gpopt/search/CJobGroupEx...
ed; CGroupExpression *pgexpr = PgexprFirstUnsched(); while (NULL != pgexpr) { if (psc->Peng()->FOptimizeChild(m_pgexprOrigin, pgexpr, m_poc, EolCurrent())) { const ULONG ulOptRequests = CPhysical::PopConvert(pgexpr->Pop())->UlOptRequests(); for (ULONG ul = 0; ul < ulOptRequests; u...
prOrigin = pgexprOrigin; m_poc = m_pgroup->PocInsert(poc); if (poc == m_poc) { m_poc->AddRef(); } SetJobQueue(m_poc->PjqOptimization()); m_eolCurrent = EolLow; CJob::SetInit(); } BOOL CJobGroupOptimization::FScheduleGroupExpressions(CSchedulerContext *psc) { CGroupExpression *pgexprLast = m_pgexprLast...
random
[]
C++
modules/remote_bitrate_estimator/mimd_rate_control.cc
yuxw75/temp
ab2fd478821e6c98ff10f2976ce43f617250cff6
#include "webrtc/modules/remote_bitrate_estimator/mimd_rate_control.h" #include <algorithm> #include <cassert> #include <cmath> #include <cstring> namespace webrtc { const int64_t kDefaultRttMs = 200; const int64_t kLogIntervalMs = 1000; MimdRateControl::MimdRateControl(uint32_t min_bitrate_bps) : min_configu...
#include "webrtc/modules/remote_bitrate_estimator/mimd_rate_control.h" #include <algorithm> #include <cassert> #include <cmath> #include <cstring> namespace webrtc { const int64_t kDefaultRttMs = 200; const int64_t kLogIntervalMs = 1000; MimdRateControl::MimdRateControl(uint32_t min_bitrate_bps) : min_configu...
); const int bitrate_difference = LatestEstimate() - incoming_bitrate_bps; return bitrate_difference > threshold; } return false; } uint32_t MimdRateControl::LatestEstimate() const { return current_bit_rate_; } uint32_t MimdRateControl::UpdateBandwidthEstimate(int64_t now_ms) { current_bit_rate_ = Cha...
uint32_t incoming_bitrate_bps) const { const int64_t bitrate_reduction_interval = std::max<int64_t>(std::min<int64_t>(rtt_, 200), 10); if (time_now - last_bit_rate_change_ >= bitrate_reduction_interval) { return true; } if (ValidEstimate()) { const int threshold = static_cast<int>(1...
function_block-random_span
[ { "content": "namespace webrtc {\n\n\n\n// Supported video types.\n\nenum VideoType {\n\n kUnknown,\n\n kI420,\n\n kIYUV,\n\n kRGB24,\n\n kABGR,\n\n kARGB,\n\n kARGB4444,\n\n kRGB565,\n\n kARGB1555,\n\n kYUY2,\n\n kYV12,\n\n kUYVY,\n\n kMJPG,\n\n kNV21,\n\n kNV12,\n\n kBGRA,\n\n};\n\n\n\n// This...
C++
src/hir/path.cpp
nabijaczleweli/mrustc
c3565612a003fbc2f87aa55250fe3f5218cb99aa
#include <hir/path.hpp> #include <hir/type.hpp> ::HIR::SimplePath HIR::SimplePath::operator+(const RcString& s) const { ::HIR::SimplePath ret(m_crate_name); ret.m_components = m_components; ret.m_components.push_back( s ); return ret; } namespace HIR { ::std::ostream& operator<<(::std::ostream& ...
#include <hir/path.hpp> #include <hir/type.hpp> ::HIR::SimplePath HIR::SimplePath::operator+(const RcString& s) const { ::HIR::SimplePath ret(m_crate_name); ret.m_components = m_components; ret.m_components.push_back( s ); return ret; } namespace HIR { ::std::ostream& operator<<(::std::ostream& ...
} throw ""; } Ordering HIR::Path::ord(const ::HIR::Path& x) const { ORD( (unsigned)m_data.tag(), (unsigned)x.m_data.tag() ); TU_MATCH(::HIR::Path::Data, (this->m_data, x.m_data), (tpe, xpe), (Generic, return ::ord(tpe, xpe); ), (UfcsInherent, ORD(tpe.type, xpe.type); ...
n Compare::Unequal; ::HIR::Compare rv = ::HIR::Compare::Equal; CMP(rv, ple.type.compare_with_placeholders(sp, pre.type, resolve_placeholder)); CMP(rv, ::compare_with_placeholders(sp, ple.trait, pre.trait, resolve_placeholder)); CMP(rv, ::compare_with_placeholders(sp, ple.params, pre.pa...
function_block-function_prefixed
[]
C++
analysis/EnergyDepVSIntialEnergy.cpp
suerfu/TesseractSim
406a469f864726386afc2df7133f07df625cd4b9
#include <iostream> #include <string> #include <vector> #include <sstream> #include <fstream> #include <functional> #include <map> #include <stdlib.h> #include "TSystem.h" #include "TCanvas.h" #include "TH1.h" #include "TRint.h" #include "TStyle.h" #include "THStack.h" #include "TTreeReader.h" #include "TTreeReaderVa...
#include <iostream> #include <string> #include <vector> #include <sstream> #include <fstream> #include <functional> #include <map> #include <stdlib.h> #include "TSystem.h" #include "TCanvas.h" #include "TH1.h" #include "TRint.h" #include "TStyle.h" #include "THStack.h" #include "TTreeReader.h" #include "TTreeReaderVa...
pt + 1 == optionNum) return strTo<T>(*itr); } else { std::string pos = "nth"; if(iOpt == 0) pos = "1st"; else if(iOpt == 1) pos = "2nd"; else if(iOpt == 2) pos = "3rd"; else pos = std::to_string(iOpt + 1) + "th"; ...
tion, int optionNum = 1) { if(!CmdOptionExists(argc, argv, option)) { abort(); } char** begin = argv; char** end = argv + argc; char ** itr = std::find(begin, end, option); for(int iOpt = 0; iOpt < optionNum; ++iOpt) { if(itr != end && ++itr != end && ((*itr)[...
function_block-random_span
[]
C++
include/lsFromMesh.hpp
YourKarma42/ViennaLS
aae39a860e1fb6edc2d3568ab09110f7e81572b1
#ifndef LS_FROM_MESH_HPP #define LS_FROM_MESH_HPP #include <lsPreCompileMacros.hpp> #include <lsDomain.hpp> #include <lsMesh.hpp> template <class T, int D> class lsFromMesh { typedef typename lsDomain<T, D>::DomainType hrleDomainType; lsSmartPointer<lsDomain<T, D>> levelSet = nullptr; lsSmartPointer<lsMesh<T>...
#ifndef LS_FROM_MESH_HPP #define LS_FROM_MESH_HPP #include <lsPreCompileMacros.hpp> #include <lsDomain.hpp> #include <lsMesh.hpp> template <class T, int D> class lsFromMesh { typedef typename lsDomain<T, D>::DomainType hrleDomainType; lsSmartPointer<lsDomain<T, D>> levelSet = nullptr; lsSmartPointer<lsMesh<T>...
for (unsigned i = 0; i < D; ++i) { nextIndex[i] = std::round(pointDataIt->at(i) / gridDelta); } } for (int q = 0; q < D; q++) { hrleVectorType<hrleIndexType, D> tmp = currentIndex; tmp[q]++; if (tmp[q] > grid.getMaxGridPoint(q)) ...
if (changeSign) { signs[i] = *valueIt <= -std::numeric_limits<T>::epsilon(); lastIndex[i] = currentIndex[i]; } } } } hrleVectorType<hrleIndexType, D> nextIndex; ++pointDataIt; ++valueIt; if (pointDataIt == pointD...
random
[ { "content": "// implement own velocity field\n\nclass velocityField : public lsVelocityField<double> {\n\npublic:\n\n double getScalarVelocity(const std::array<double, 3> & /*coordinate*/,\n\n int /*material*/,\n\n const std::array<double, 3> & /*normalVecto...
C++
qt/QtXdagWallet/pwddialog.cpp
sgaragagghu/QtXdagWallet
850fac4c6714edde4d91e58a8ca5a2d4602b9937
#include "PwdDialog.h" #include "ui_pwddialog.h" #include <QKeyEvent> PwdDialog::PwdDialog(QWidget *parent, PWD_DLG_TYPE type) : QDialog(parent), mDlgType(type), ui(new Ui::PwdDialog) { ui->setupUi(this); m_pLable = new QLabel; m_pLEPwd = new PwdLineEdit; m_pPBOK = new QPushButton(tr("OK"...
#include "PwdDialog.h" #include "ui_pwddialog.h" #include <QKeyEvent> PwdDialog::PwdDialog(QWidget *parent, PWD_DLG_TYPE type) : QDialog(parent), mDlgType(type), ui(new Ui::PwdDialog) { ui->setupUi(this); m_pLable = new QLabel; m_pLEPwd = new PwdLineEdit; m_pPBOK = new QPushButton(tr("OK"...
void PwdDialog::keyPressEvent(QKeyEvent *event) { switch (event->key()) { case Qt::Key_Tab: case Qt::Key_Left: case Qt::Key_Right: case Qt::Key_Up: case Qt::Key_Down: break; default: QDialog::keyPressEvent(event); } }
if(pKeyEvent->matches(QKeySequence::SelectAll) || pKeyEvent->matches(QKeySequence::Copy) || pKeyEvent->matches(QKeySequence::Paste)) { return true; } if(pKeyEvent->key() == Qt::Key_Tab || ...
function_block-function_prefix_line
[ { "content": "#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L\n\n\n", "file_path": "qt/QtXdagWallet/win64_dependency/include/openssl/obj_mac.h", "rank": 0, "score": 156120.08268075265 }, { "content": "#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L\n\n\n", "file...
C++
extlib/include/xyginext/ecs/systems/DynamicTreeSystem.hpp
fallahn/speljongen
57cb5e09eec7db8c21ee7b3e7943fa0a76738c51
#pragma once #include "xyginext/ecs/System.hpp" #include <SFML/Graphics/Rect.hpp> #include <vector> #include <limits> #include <cstdint> #include <array> namespace xy { struct TreeNode final { static constexpr std::int32_t Null = -1; bool isLeaf() const { return ch...
#pragma once #include "xyginext/ecs/System.hpp" #include <SFML/Graphics/Rect.hpp> #include <vector> #include <limits> #include <cstdint> #include <array> namespace xy { struct TreeNode final { static constexpr std::int32_t Null = -1; bool isLeaf() const { return ch...
: public xy::System { public: explicit DynamicTreeSystem(xy::MessageBus&); void process(float) override; void onEntityAdded(xy::Entity) override; void onEntityRemoved(xy::Entity) override; std::vector<xy::Entity> query(sf::FloatRect area, std::uint64_t filter =...
std::int32_t next; }; std::int32_t childA = Null; std::int32_t childB = Null; std::int32_t height = Null; }; class XY_EXPORT_API DynamicTreeSystem final
random
[]
C++
src/platform/shm_win.cpp
nickhuangxinyu/cpp-ipc
64f4104b741b6f283906d01177d4e70bcdb8d6a0
#include "shm.h" #include <Windows.h> #include <string> #include <utility> #include "def.h" #include "log.h" #include "pool_alloc.h" #include "platform/to_tchar.h" #include "platform/get_sa.h" #include "memory/resource.h" namespace { struct id_info_t { HANDLE h_ = NULL; void* ...
#include "shm.h" #include <Windows.h> #include <string> #include <utility> #include "def.h" #include "log.h" #include "pool_alloc.h" #include "platform/to_tchar.h" #include "platform/get_sa.h" #include "memory/resource.h" namespace { struct id_info_t { HANDLE h_ = NULL; void* ...
void release(id_t id) { if (id == nullptr) { ipc::error("fail release: invalid id (null)\n"); return; } auto ii = static_cast<id_info_t*>(id); if (ii->mem_ == nullptr || ii->size_ == 0) { ipc::error("fail release: invalid id (mem = %p, size = %zd)\n", ii->mem_, ii->siz...
ii->mem_ = mem; ii->size_ = static_cast<std::size_t>(mem_info.RegionSize); if (size != nullptr) *size = ii->size_; return static_cast<void *>(mem); }
function_block-function_prefix_line
[ { "content": "// A builtin parameterized test name generator which returns the result of\n\n// testing::PrintToString.\n\nstruct PrintToStringParamName {\n\n template <class ParamType>\n\n std::string operator()(const TestParamInfo<ParamType>& info) const {\n\n return PrintToString(info.param);\n\n }\n\n}...
C++
test/api/union/hyperloglog_test.cpp
Felix-Droop/Chopper
5cc214103b2d088ae400bec0fde8973e03dd3095
#include <gtest/gtest.h> #include <gmock/gmock.h> #include <unordered_set> #include <vector> #include <fstream> #include <iostream> #include <chopper/union/hyperloglog.hpp> #include <seqan3/io/sequence_file/input.hpp> #include <seqan3/test/tmp_filename.hpp> struct input_traits : public seqan3::sequence_file_input_de...
#include <gtest/gtest.h> #include <gmock/gmock.h> #include <unordered_set> #include <vector> #include <fstream> #include <iostream> #include <chopper/union/hyperloglog.hpp> #include <seqan3/io/sequence_file/input.hpp> #include <seqan3/test/tmp_filename.hpp> struct input_traits : public seqan3::sequence_file_input_de...
TEST(hyperloglog_test, merge_and_merge_SIMD) { std::string input_file = DATADIR"small.fa"; size_t const k = 16; size_t const b = 5; size_t const m = 1 << b; hyperloglog full_sketch(b); hyperloglog merge_sketch(b); hyperloglog merge_SIMD_sketch(b); std::vector<hyperloglog> partial_ske...
TEST(hyperloglog_test, add_and_estimate_large) { std::string input_file = DATADIR"small.fa"; size_t const k = 16; size_t const b = 4; size_t const m = 1 << b; hyperloglog sketch(b); std::unordered_set<std::string> control; sequence_file_type seq_file{input_file}; for (auto && [s...
function_block-full_function
[ { "content": "struct input_traits : public seqan3::sequence_file_input_default_traits_dna\n\n{\n\n using sequence_alphabet = seqan3::dna4;\n\n};\n\n\n\nint main(int argc, const char *argv [])\n\n{\n\n seqan3::argument_parser parser{\"measure_hyperloglog\", argc, argv,\n\n ...
C++
02Segundo/Estructura_de_Datos_ED/PracticaFinal/src/prueba.cpp
elsudano/Facultad
8ff2c5904f0a38a3a0682e040da4439f2bc872f2
#include <fstream> #include <iostream> #include <cstdlib> #include <ctime> #include <sstream> #include "ArbolGeneral.h" #include "Personas.h" #include "QuitaComentarios.h" #include "Preguntas.h" using namespace std; void imprime_arbol_con_formato(string nom, ArbolGeneral<int> &ab){ ArbolGeneral<int>::iter_preorde...
#include <fstream> #include <iostream> #include <cstdlib> #include <ctime> #include <sstream> #include "ArbolGeneral.h" #include "Personas.h" #include "QuitaComentarios.h" #include "Preguntas.h" using namespace std; void imprime_arbol_con_formato(string nom, ArbolGeneral<int> &ab){ ArbolGeneral<int>::iter_preorde...
ut << "Voy a poner el AB3 como subarbol de AB1 en el nodo 10 (cuando NO tiene hijos)" << endl; it_tree = ab1.begin(); for (; (*it_tree) != 10; ++it_tree); cout << "Encuentro el nodo: " << (*it_tree) << endl; ab1.asignar_subarbol(ab3, it_tree.GetNodo()); cout << "Arbol AB1 despúes de asignar sub...
function_block-function_prefixed
[]
C++
HybridRenderer/HybridRenderer/Camera.cpp
lbondi7/HybridRenderer
592ff5c4ea9039bc79a99e20c848f11e2669f885
#include "Camera.h" #include "Initilizers.h" #include "ImGUI_.h" #include <algorithm> Camera::~Camera() { } void Camera::init(DeviceContext* deviceContext, const VkExtent2D& _extent) { viewport = { 0, 0, 1, 1 }; scissor = { 0, 0, 1, 1 }; vkViewport = Initialisers::viewport(viewport.x, viewport.y, static_cast<...
#include "Camera.h" #include "Initilizers.h" #include "ImGUI_.h" #include <algorithm> Camera::~Camera() { } void Camera::init(DeviceContext* deviceContext, const VkExtent2D& _extent) { viewport = { 0, 0, 1, 1 }; scissor = { 0, 0, 1, 1 }; vkViewport = Initialisers::viewport(viewport.x, viewport.y, static_cast<...
void Camera::updateWindow(float _windowWidth, float _windowHeight) { } void Camera::ResetPan() { currentIndex = 0; pan = true; time = 0.0f; }
extent) { prevTransform = transform; prevLookAt == lookAt; prevUp = worldUp; prevFOV = FOV; prevNearPlane = nearPlane; prevFarPlane = farPlane; extent = _extent; prevLookAtPlace = lookAtPlace; prevViewport = viewport; prevScissor = scissor; }
function_block-function_prefixed
[ { "content": "struct Transform {\n\n\n\n\tglm::vec3 position = glm::vec3(0);\n\n\tglm::vec3 rotation = glm::vec3(0);\n\n\tglm::vec3 scale = glm::vec3(1);\n\n\n\n\tglm::vec3 right = glm::vec3(1, 0, 0);\n\n\tglm::vec3 up = glm::vec3(0, 1, 0);\n\n\tglm::vec3 forward = glm::vec3(0, 0, 1);\n\n\n\n\n\n\tbool operator...
C++
samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cpp/remarks.cpp
hamarb123/dotnet-api-docs
6aeb55784944a2f1f5e773b657791cbd73a92dd4
#using <System.dll> using namespace System; using namespace System::Collections; using namespace System::Collections::Specialized; public ref class ODEnum : IDictionaryEnumerator { private: int position; ArrayList^ itemlist; public: ODEnum(ArrayList^ list) { this->R...
#using <System.dll> using namespace System; using namespace System::Collections; using namespace System::Collections::Specialized; public ref class ODEnum : IDictionaryEnumerator { private: int position; ArrayList^ itemlist; public: ODEnum(ArrayList^ list) { this->R...
virtual property Object^ SyncRoot { Object^ get() { return itemlist->SyncRoot; } } virtual IEnumerator^ IfcGetEnumerator() = IEnumerable::GetEnumerator { return (IEnumerator^) gcnew ODEnum(itemlist); } }; class App { public...
virtual property bool IsSynchronized { bool get() { return itemlist->IsSynchronized; } }
function_block-function_prefix_line
[]
C++
tutorial/lesson_15_generators.cpp
pelikan/Halide
5b4eac0f810dbd8dc8d224cb322d5b1215ea224d
#include "Halide.h" #include <stdio.h> using namespace Halide; class MyFirstGenerator : public Halide::Generator<MyFirstGenerator> { public: Input<uint8_t> offset{"offset"}; Input<Buffer<uint8_t>> input{"input", 2}; Output<Buffer<uint8_t>> brighter{"brighter", 2}; Var...
#include "Halide.h" #include <stdio.h> using namespace Halide; class MyFirstGenerator : public Halide::Generator<MyFirstGenerator> { public: Input<uint8_t> offset{"offset"}; Input<Buffer<uint8_t>> input{"input", 2}; Output<Buffer<uint8_t>> brighter{"brighter", 2}; Var...
}; HALIDE_REGISTER_GENERATOR(MyFirstGenerator, my_first_generator) class MySecondGenerator : public Halide::Generator<MySecondGenerator> { public: GeneratorParam<bool> parallel{"parallel", true}; GeneratorParam<float> scale{"scale", 1.0f , ...
void generate() { brighter(x, y) = input(x, y) + offset; brighter.vectorize(x, 16).parallel(y); }
function_block-full_function
[ { "content": "class ExprUsesVars : public IRGraphVisitor {\n\n using IRGraphVisitor::visit;\n\n\n\n const Scope<T> &vars;\n\n Scope<Expr> scope;\n\n\n\n void include(const Expr &e) override {\n\n if (result) return;\n\n IRGraphVisitor::include(e);\n\n }\n\n\n\n void include(const...
C++
tests/rwops/customRWops/main.cpp
jamesl-github/scc
c1dddf41778eeb2ef2a910372d1eb6a6a8dfa68e
#include <iostream> #include <sstream> #include <string> #include <ios> #include <SDL.h> #include "rwops.hpp" const int ERR_SDL_INIT = -1; const int BUFFER_SIZE = 4; const int CHAR_SKIP = 2; bool init(Uint32 sdlInitFlags) { if(SDL_Init(sdlInitFlags) < 0) { return false; } return true; } void quit() { SDL_Qu...
#include <iostream> #include <sstream> #include <string> #include <ios> #include <SDL.h> #include "rwops.hpp" const int ERR_SDL_INIT = -1; const int BUFFER_SIZE = 4; const int CHAR_SKIP = 2; bool init(Uint32 sdlInitFlags) { if(SDL_Init(sdlInitFlags) < 0) { return false; } return true; } void quit() { SDL_Qu...
FER_SIZE, RW_SEEK_END); custom.read(buffer, sizeof(char), BUFFER_SIZE); std::cout << BUFFER_SIZE << " last characters: "; std::cout.write(buffer, BUFFER_SIZE); std::cout << std::endl; custom.seek(0, RW_SEEK_SET); } int main(int argc, char **argv) { Uint32 sdlFlags = SDL_INIT_VIDEO; if(!init(sdlFlags)) { SDL...
std::endl; custom.seek(0, RW_SEEK_SET); custom.read(buffer, sizeof(char), BUFFER_SIZE); std::cout << BUFFER_SIZE << " first characters: "; std::cout.write(buffer, BUFFER_SIZE); std::cout << std::endl; custom.seek(CHAR_SKIP, RW_SEEK_CUR); custom.read(buffer, sizeof(char), BUFFER_SIZE); std::cout << BUFFER_SIZ...
random
[ { "content": "\tstd::cout << \"byte 0x\" << std::setbase(16)\n\n\t\t<< (static_cast<int>(c) & 0xff) << std::setbase(10)\n\n\t\t<< \" at position \" << pos << std::endl;\n\n\tconstMem.seek(0, RW_SEEK_SET);\n\n}\n\n\n\nvoid test()\n\n{\n\n\tSDL::RWops constMem(memory, sizeof(memory));\n\n\n\n\t// read. Positions ...
C++
xdl/ps-plus/ps-plus/common/test/hashmap_test.cc
Ru-Xiang/x-deeplearning
04cc0497150920c64b06bb8c314ef89977a3427a
#include <iostream> #include "gtest/gtest.h" #include "ps-plus/common/hashmap.h" #include "ps-plus/common/thread_pool.h" using ps::Hash128Key; using ps::HashMap; using ps::Range; using ps::Status; using std::vector; TEST(HashMap64Test, Get) { std::unique_ptr<HashMap> hashmap(new ps::HashMapImpl<int64_t>(1)); in...
#include <iostream> #include "gtest/gtest.h" #include "ps-plus/common/hashmap.h" #include "ps-plus/common/thread_pool.h" using ps::Hash128Key; using ps::HashMap; using ps::Range; using ps::Status; using std::vector; TEST(HashMap64Test, Get) { std::unique_ptr<HashMap> hashmap(new ps::HashMapImpl<int64_t>(1)); in...
; EXPECT_EQ(49995000, total); auto end = std::chrono::system_clock::now(); std::cout << "insert " << key_count/2 << " keys, takes " << (end-start).count()/1000000 << "ms" <<std::endl; delete [] keys; }
ps::MultiThreadDoTBB(thread_count, [&](const Range& r) { for (size_t i = r.begin; i < r.end; i++) { vector<size_t> ids; tbb::concurrent_vector<size_t> reused_ids; size_t filtered; hashmap->Get(keys + i* key_count/thread_count, key_count/2/thread_count, false, 1.0, &ids, &...
call_expression
[]
C++
Mesh.cpp
nvpro-samples/gl_vk_chopper
e7ffdd0b0277843fc14af7ba110538089efb459e
#include "Mesh.h" #include <stdlib.h> Mesh::Mesh() : m_vertices(NULL) , m_indices(NULL) , m_normals(NULL) , m_max_vertices(0) , m_max_indices(0) , m_vertex_count(0) , m_index_count(0) , m_material_id(-1) { } Mesh::Mesh(const Mesh::ID& inID) : m_id(inID) , m_vertices(NULL) ...
#include "Mesh.h" #include <stdlib.h> Mesh::Mesh() : m_vertices(NULL) , m_indices(NULL) , m_normals(NULL) , m_max_vertices(0) , m_max_indices(0) , m_vertex_count(0) , m_index_count(0) , m_material_id(-1) { } Mesh::Mesh(const Mesh::ID& inID) : m_id(inID) , m_vertices(NULL) ...
Vec4f*& Mesh::getVertices() { return m_vertices; } Vec4f*& Mesh::getNormals() { return m_normals; } uint32_t*& Mesh::getIndices() { return m_indices; } Vec2f*& Mesh::getUVs() { return m_uvs; } void Mesh::addVertex(const Vec4f& inVertex) { Vec4f normal = {0.0, 0.0, 0.0, 1.0}; addVertex(inVertex, normal...
new Vec4f[m_max_vertices]; m_normals = new Vec4f[m_max_vertices]; m_indices = new uint32_t[m_max_indices]; m_uvs = new Vec2f[m_max_vertices]; }
function_block-function_prefixed
[ { "content": "class VkeIBO : public VkeBuffer<uint32_t>\n\n{\n\npublic:\n\n VkeIBO();\n\n ~VkeIBO();\n\n\n\n void bind(VkCommandBuffer* inCmd);\n\n};\n\n\n\n#endif", "file_path": "VkeIBO.h", "rank": 0, "score": 14104.936708526924 }, { "content": "\n\n#include \"VKSFile.h\"\n\n#include \"n...
C++
src/carnot/end_to_end_join_test.cc
hangqiu/pixie
1dd4af47d40ff856c4d52a1d6de81f78a76ff31e
#include <google/protobuf/text_format.h> #include <algorithm> #include <map> #include <tuple> #include <unordered_map> #include <vector> #include <pypa/parser/parser.hh> #include "src/carnot/carnot.h" #include "src/carnot/exec/local_grpc_result_server.h" #include "src/carnot/exec/test_utils.h" #include "src/carnot...
#include <google/protobuf/text_format.h> #include <algorithm> #include <map> #include <tuple> #include <unordered_map> #include <vector> #include <pypa/parser/parser.hh> #include "src/carnot/carnot.h" #include "src/carnot/exec/local_grpc_result_server.h" #include "src/carnot/exec/test_utils.h" #include "src/carnot...
auto query = absl::StrJoin({queryString}, "\n"); auto query_id = sole::uuid4(); auto s = carnot_->ExecuteQuery(query, query_id, 0); ASSERT_OK(s); auto exec_stats = result_server_->exec_stats().ConsumeValueOrDie(); EXPECT_EQ(5, exec_stats.execution_stats().records_processed()); EXPECT_EQ(5 * sizeof(d...
1, 5.1}; std::vector<types::Int64Value> expected_col2 = {1, 2, 3, 5, 6}; EXPECT_TRUE(rb1.ColumnAt(0)->Equals(types::ToArrow(expected_col1, arrow::default_memory_pool()))); EXPECT_TRUE(rb1.ColumnAt(1)->Equals(types::ToArrow(expected_col2, arrow::default_memory_pool()))); } TEST_F(JoinTest, self_join) { std::str...
random
[ { "content": "class SetupJoinTypeRule : public Rule {\n\n /**\n\n * @brief Converts a right join into a left join.\n\n *\n\n */\n\n public:\n\n SetupJoinTypeRule()\n\n : Rule(nullptr, /*use_topo*/ false, /*reverse_topological_execution*/ false) {}\n\n\n\n protected:\n\n StatusOr<bool> Apply(IRNode...
C++
GLAC/observables/latticeactionchargedensity.cpp
hmvege/GluonicLQCD
9bb7466fce408bf51cb98d65f639acd37d034d62
#include "latticeactionchargedensity.h" #include <cmath> #include "parallelization/communicator.h" #include "config/parameters.h" #include "io/fieldio.h" LatticeActionChargeDensity::LatticeActionChargeDensity(const bool flow) : Correlator() { initializeObservableStorer(flow); m_plaqMultiplicationFac...
#include "latticeactionchargedensity.h" #include <cmath> #include "parallelization/communicator.h" #include "config/parameters.h" #include "io/fieldio.h" LatticeActionChargeDensity::LatticeActionChargeDensity(const bool flow) : Correlator() { initializeObservableStorer(flow); m_plaqMultiplicationFac...
void LatticeActionChargeDensity::copyObservable(const unsigned int iObs, const std::vector<double> &obs) { (*m_plaqObservable)[iObs] = obs[0]; (*m_topcObservable)[iObs] = obs[1]; (*m_energyObservable)[iObs] = obs[2]; } std::vector<double> LatticeActionChargeDensity::getObservablesVector(const unsigned in...
nChargeDensity::printStatistics() { m_plaqObservable->printStatistics(); m_topcObservable->printStatistics(); m_energyObservable->printStatistics(); }
function_block-function_prefixed
[ { "content": "class Flow\n\n{\n\nprivate:\n\n // Flow update step\n\n double m_epsilon = 0.02;\n\n // Lattice constants\n\n std::vector<unsigned int> m_N;\n\n unsigned long int m_subLatticeSize;\n\n // Temporary lattice to use when flowing\n\n Lattice<SU3> *m_tempLattice;\n\n Lattice<SU3...
C++
src/Cluster/ClusterMain.cpp
BBN-E/serif
1e2662d82fb1c377ec3c79355a5a9b0644606cb4
#include "Generic/common/leak_detection.h" #include "Generic/common/limits.h" #include "Generic/common/ParamReader.h" #include "Generic/common/UnrecoverableException.h" #include "Generic/common/UTF8InputStream.h" #include "Generic/common/UTF8OutputStream.h" #include "Generic/common/UTF8Token.h" #include...
#include "Generic/common/leak_detection.h" #include "Generic/common/limits.h" #include "Generic/common/ParamReader.h" #include "Generic/common/UnrecoverableException.h" #include "Generic/common/UTF8InputStream.h" #include "Generic/common/UTF8OutputStream.h" #include "Generic/common/UTF8Token.h" #include...
char rare_words_file[500]; if (strcmp(output_rare_words, "true") == 0) { if(!ParamReader::getParam("rare_words_file",rare_words_file, 500)){ throw UnexpectedInputException("Cluster::Main()", "Missing Parameter: rare-words-file"); } } char serif_style_cluster_output[10]; if(!ParamReader::g...
if(!ParamReader::getParam("output_rare_words",output_rare_words, 10)){ throw UnexpectedInputException( "Cluster::Main()", "Missing Parameter: output-rare-words"); }
if_condition
[ { "content": "\tclass const_iterator: public boost::iterator_facade<const_iterator, std::vector<ActorMention_ptr> const, boost::forward_traversal_tag> {\n\n\tprivate:\n\n\t\tfriend class boost::iterator_core_access;\n\n\t\tfriend class ActorMentionSet;\n\n\t\texplicit const_iterator(ActorMentionMap::const_itera...
C++
src/bustools_extract.cpp
johan-gson/bustools
b0df3edef7e0df53d6461cd76572ae38280c4a94
#include <iostream> #include <fstream> #include <zlib.h> #include "kseq.h" #include "Common.hpp" #include "BUSData.h" #include "bustools_extract.h" KSEQ_INIT(gzFile, gzread); inline bool open_fastqs( std::vector<gzFile> &outFastq, std::vector<gzFile> &inFastq, std::vector<kseq_t *> &seq, const Busto...
#include <iostream> #include <fstream> #include <zlib.h> #include "kseq.h" #include "Common.hpp" #include "BUSData.h" #include "bustools_extract.h" KSEQ_INIT(gzFile, gzread); inline bool open_fastqs( std::vector<gzFile> &outFastq, std::vector<gzFile> &inFastq, std::vector<kseq_t *> &seq, const Busto...
buf[bufLen++] = '\n'; if (gzwrite(outFastq[i], buf, bufLen) != bufLen) { std::cerr << "Error writing to FASTQ" << std::endl; goto end_extract; } } } } std::cout << "Read in " << nr << " BUS records" << std::endl; end_extract: delete[] p; delete[] buf; for (auto...
function_block-function_prefix_line
[ { "content": "enum SORT_TYPE : char {SORT_BC = 0, SORT_UMI, SORT_F, SORT_COUNT};\n", "file_path": "src/Common.hpp", "rank": 0, "score": 97682.47177461298 }, { "content": " function returns true and set element to the element of given rank.\n\n Otherwise, it returns false.\n\n ...
C++
TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.cpp
cflowe/ACE
5ff60b41adbe1772372d1a43bcc1f2726ff8f810
#include "orbsvcs/Log_Macros.h" #include "RTEvent_Logging_Service.h" #include "tao/IORTable/IORTable.h" #include "ace/Get_Opt.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_unistd.h" RTEvent_Logging_Service::RTEvent_Logging_Service (void) : service_name_ ("RTEventLogFactory"), ior_file_name_ (0), pid_...
#include "orbsvcs/Log_Macros.h" #include "RTEvent_Logging_Service.h" #include "tao/IORTable/IORTable.h" #include "ace/Get_Opt.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_unistd.h" RTEvent_Logging_Service::RTEvent_Logging_Service (void) : service_name_ ("RTEventLogFactory"), ior_file_name_ (0), pid_...
void RTEvent_Logging_Service::shutdown (void) { if (this->bind_to_naming_service_) { CosNaming::Name name (1); name.length (1); name[0].id = CORBA::string_dup (this->service_name_.c_str ()); this->naming_->unbind (name); } if (!CORBA::is_nil (this->orb_.in ())) this->orb_->s...
function_block-full_function
[]
C++
mediapipe/calculators/video/tracked_detection_manager_calculator.cc
nodamu/sign-langage-recogntion
41a22d4f28cc94d6eb14d2c89456eba874c7f05b
#include <memory> #include <string> #include <unordered_map> #include <vector> #include "absl/container/node_hash_map.h" #include "mediapipe/framework/calculator_framework.h" #include "mediapipe/framework/formats/detection.pb.h" #include "mediapipe/framework/formats/location_data.pb.h" #include "mediapipe/framework/...
#include <memory> #include <string> #include <unordered_map> #include <vector> #include "absl/container/node_hash_map.h" #include "mediapipe/framework/calculator_framework.h" #include "mediapipe/framework/formats/detection.pb.h" #include "mediapipe/framework/formats/location_data.pb.h" #include "mediapipe/framework/...
void TrackedDetectionManagerCalculator::AddDetections( const std::vector<Detection>& detections, CalculatorContext* cc) { for (const auto& detection : detections) { std::unique_ptr<TrackedDetection> new_detection = GetTrackedDetectionFromDetection( detection, cc->InputTimestamp().Mi...
void TrackedDetectionManagerCalculator::AddDetectionList( const DetectionList& detection_list, CalculatorContext* cc) { for (const auto& detection : detection_list.detection()) { std::unique_ptr<TrackedDetection> new_detection = GetTrackedDetectionFromDetection( detection, cc->InputTi...
function_block-full_function
[ { "content": "class StringToIntCalculatorTemplate : public CalculatorBase {\n\n public:\n\n static ::mediapipe::Status GetContract(CalculatorContract* cc) {\n\n cc->InputSidePackets().Index(0).Set<std::string>();\n\n cc->OutputSidePackets().Index(0).Set<IntType>();\n\n return ::mediapipe::OkStatus();\...
C++
Examples/ReadWriteExample/ReadWriteExample.cpp
scaredyfish/MPCDI
1ddbc9abf99d39d4464afa2005934c325443cf28
#include "mpcdiDisplay.h" #include "mpcdiWriter.h" #include "mpcdiReader.h" #include "CreateSampleProfile.h" #include "VerboseCompareProfile.h" #include <iostream> #include <algorithm> #define DO_PAUSE #ifdef DO_PAUSE # define PAUSE {std::cout<< "Press enter to continue....";std::cin.ignore();} #else # definE PAU...
#include "mpcdiDisplay.h" #include "mpcdiWriter.h" #include "mpcdiReader.h" #include "CreateSampleProfile.h" #include "VerboseCompareProfile.h" #include <iostream> #include <algorithm> #define DO_PAUSE #ifdef DO_PAUSE # define PAUSE {std::cout<< "Press enter to continue....";std::cin.ignore();} #else # definE PAU...
mpcdi::MPCDI_Error WriteTest(const std::string &FileName, mpcdi::Profile *profile) { mpcdi::Writer *writer = mpcdi::Writer::CreateWriter(); writer->SetOverwriteExistingFile(true); bool test = writer->GetOverwriteExistingFile(); mpcdi::MPCDI_Error mpcdi_err = writer->Write(FileNa...
t) { if(MPCDI_FAILED(WriteTest(profileName,profileOut))) { delete profileOut; PAUSE; return mpcdi::MPCDI_FAILURE; } } mpcdi::Profile *profileIn = NULL; if (DoReadTest) { if (MPCDI_FAILED(ReadTest(profileName,profileIn))) { dele...
function_block-function_prefixed
[ { "content": "local int gz_decomp(state)\n", "file_path": "ThirdParty/zlib-1.2.7/gzread.c", "rank": 0, "score": 99229.37633994885 }, { "content": "local int build_bl_tree(s)\n", "file_path": "ThirdParty/zlib-1.2.7/trees.c", "rank": 1, "score": 99229.01503971723 }, { "cont...
C++
visual/gl/univtrans_sse2.cpp
wtnbgo/krkrz
d9bcf1b08b694385e1fab68fe56501c7fbbd9332
#include "tjsCommHead.h" #include "simd_def_x86x64.h" #include "tvpgl.h" #include "tvpgl_ia32_intf.h" extern "C" { extern unsigned char TVPOpacityOnOpacityTable[256*256]; extern unsigned char TVPNegativeMulTable[256*256]; } struct sse2_univ_trans_blend_func { const __m128i zero_; const tjs_uint32 *table_; inline...
#include "tjsCommHead.h" #include "simd_def_x86x64.h" #include "tvpgl.h" #include "tvpgl_ia32_intf.h" extern "C" { extern unsigned char TVPOpacityOnOpacityTable[256*256]; extern unsigned char TVPNegativeMulTable[256*256]; } struct sse2_univ_trans_blend_func { const __m128i zero_; const tjs_uint32 *table_; inline...
} len -= count; } tjs_uint32 rem = (len>>2)<<2; tjs_uint32* limit = dest + rem; const __m128i msrc1lv = _mm_set1_epi32(src1lv); const __m128i msrc2lv = _mm_set1_epi32(src2lv); const __m128i not = _mm_set1_epi32(0xffffffff); while( dest < limit ) { tjs_uint32 r = *(tjs_uint32*)rule; __m128i mr = _mm_cvts...
if(opa < src2lv) { *dest = *src2; rule++; src1++; src2++; dest++; } else { *dest = func( *src1, *src2, *rule ); dest++; src1++; src2++, rule++; }
if_condition
[ { "content": "struct sse2_const_alpha_copy_functor {\n\n\tconst tjs_uint32 alpha32_;\n\n\tconst __m128i alpha_;\n\n\tconst __m128i colormask_;\n\n\tinline sse2_const_alpha_copy_functor( tjs_uint32 mask )\n\n\t: alpha32_(mask<<24), alpha_(_mm_set1_epi32(mask<<24)), colormask_(_mm_set1_epi32(0x00ffffff)) {}\n\n\t...
C++
framework/data/cfg_loader.inl
ans-hub/gdm_framework
4218bb658d542df2c0568c4d3aac813cd1f18e1b
#include "cfg_loader.h" template<> inline int gdm::Config::Get<int>(const std::string& name) const { return ints_.at(name); } template<> inline float gdm::Config::Get<float>(const std::string& name) const { return floats_.at(name); } template<> inline bool gdm::Config::Get<bool>(const std::string& name) cons...
#include "cfg_loader.h" template<> inline int gdm::Config::Get<int>(const std::string& name) const { return ints_.at(name); } template<> inline float gdm::Config::Get<float>(const std::string& name) const { return floats_.at(name); } template<> inline bool gdm::Config::Get<bool>(const std::string& name) cons...
template<> inline std::vector<gdm::Vec3f> gdm::Config::GetAllVals<gdm::Vec3f>(const std::string& name) const { std::vector<Vec3f> result {}; std::for_each(vectors3f_.begin(), vectors3f_.end(), [&name, &result](const std::pair<std::string, Vec3f>& pair) { if (pair.first.find(name) == 0) result.push_b...
inline std::vector<float> gdm::Config::GetAllVals<float>(const std::string& name) const { std::vector<float> result {}; std::for_each(floats_.begin(), floats_.end(), [&name, &result](const std::pair<std::string, float>& pair) { if (pair.first.find(name) == 0) result.push_back(pair.second); }); ret...
function_block-full_function
[ { "content": "class TMap : public std::map<K, D, CMP, pool_allocator<std::pair<K const, D> > > {\n\n};\n\n\n\ntemplate <class K, class D, class HASH = std::hash<K>, class PRED = std::equal_to<K> >\n", "file_path": "3rdparty/vulkan_sdk/1.2.170.0/Include/glslang/Include/Common.h", "rank": 0, "score": ...
C++
Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/modules/rtp_rtcp/source/byte_io_unittest.cc
Yash-Wasalwar-07/Boss2D
37c5ba0f1c83c89810359a207cabfa0905f803d2
#include <limits> #include "modules/rtp_rtcp/source/byte_io.h" #include BOSS_WEBRTC_U_test__gtest_h namespace webrtc { namespace { class ByteIoTest : public ::testing::Test { protected: ByteIoTest() {} virtual ~ByteIoTest() {} enum { kAlignments = sizeof(uint64_t) - 1 }; template <typename T> T Cr...
#include <limits> #include "modules/rtp_rtcp/source/byte_io.h" #include BOSS_WEBRTC_U_test__gtest_h namespace webrtc { namespace { class ByteIoTest : public ::testing::Test { protected: ByteIoTest() {} virtual ~ByteIoTest() {} enum { kAlignments = sizeof(uint64_t) - 1 }; template <typename T> T Cr...
4_t, ByteWriter<uint64_t>::WriteLittleEndian, sizeof(uint64_t)>(false); } TEST_F(ByteIoTest, Test16SBitLittleEndian) { TestRead<int16_t, ByteReader<int16_t>::ReadLittleEndian, sizeof(int16_t)>(false); TestWrite<int16_t, ByteWriter<int16_t>::WriteLittleEndian, sizeof(int16_t)>(false); } TEST_F(By...
>::WriteBigEndian, sizeof(int32_t)>(true); } TEST_F(ByteIoTest, Test64SBitBigEndian) { TestRead<int64_t, ByteReader<int64_t>::ReadBigEndian, sizeof(int64_t)>(true); TestWrite<int64_t, ByteWriter<int64_t>::WriteBigEndian, sizeof(int64_t)>(true); } TEST_F(ByteIoTest, Test16UBitLittleEndian) { Te...
random
[]
C++
ErrorPrintout.cpp
dascenzo/MyDictionary
f258f987f05d58be0c0df6eec58eec6be0b441dc
#include "ErrorPrintout.h" #include "Options.h" #include "Error.h" #include "CommandLine.h" #include "StringViewOutput.h" template<typename T> class GeneratorBase { public: GeneratorBase(const CommandLine& commandLine, const T& error) noexcept : commandLine(commandLine), error(error) { } protected: ~Generato...
#include "ErrorPrintout.h" #include "Options.h" #include "Error.h" #include "CommandLine.h" #include "StringViewOutput.h" template<typename T> class GeneratorBase { public: GeneratorBase(const CommandLine& commandLine, const T& error) noexcept : commandLine(commandLine), error(error) { } protected: ~Generato...
failed: word (%s) %s\n", C_STR(commandLine.programName), data.value(), problem()); } void operator()(const DataStateError::TagData& data) const noexcept { std::fprintf(stderr, "%.*s: operation failed: tag (%s) %s\n", C_STR(commandLine.programName), data.value(), problem()); } void operator(...
std::fprintf(stderr, "%.*s: invalid argument for %s\n", C_STR(commandLine.programName), e.option()); } void operator()(const MultipleFormats& ) const noexcept { std::fprintf(stderr, "%.*s: multiple formats given\n", C_STR(commandLine.programName)); } void operator()(const NoAction& ) const noexcept { ...
random
[ { "content": "class SetEnvFailed {\n\npublic:\n\n SetEnvFailed(int errNo) noexcept;\n\n int errNo() const noexcept;\n\nprivate:\n\n int m_errNo;\n\n};\n", "file_path": "Error.h", "rank": 0, "score": 156967.1348443014 }, { "content": "// === EnvironmentSetupError ===\n\nclass BadEnvVar {\n...
C++
AltTabber/Gui.cpp
alzwded/AltTabber
9da50d23f5e132e9133ecea0093fe1b02ed01fc6
#include "stdafx.h" #include "AltTabber.h" #include <WinUser.h> extern ProgramState_t g_programState; extern void log(LPTSTR fmt, ...); extern MonitorGeom_t GetMonitorGeometry(); static inline BOOL IsAltTabWindow(HWND hwnd) { if(!IsWindowVisible(hwnd)) return FALSE; TCHAR str[MAX_PATH + 1]; GetWi...
#include "stdafx.h" #include "AltTabber.h" #include <WinUser.h> extern ProgramState_t g_programState; extern void log(LPTSTR fmt, ...); extern MonitorGeom_t GetMonitorGeometry(); static inline BOOL IsAltTabWindow(HWND hwnd) { if(!IsWindowVisible(hwnd)) return FALSE; TCHAR str[MAX_PATH + 1]; GetWi...
rogramState.activeSlot >= 0) { RECT r = (g_programState.slots[g_programState.activeSlot]).r; Rectangle(hdc, r.left, r.top, r.right, r.bottom); } SelectObject(hdc, GetStockObject(WHITE_BRUSH)); SelectObject(hdc, GetStockObject(BLACK_PEN)); int prevBkMode = SetBkMode(hdc, TRANSPARENT); ...
lta; dRect.bottom = dRect.top + h; } else { dRect.bottom = r.bottom; LONG w = (LONG)(rs.cy * sRap); LONG delta = (rs.cx - w) / 2; dRect.left += delta; dRec...
random
[ { "content": " HMONITOR hMonitor;\n", "file_path": "AltTabber/AltTabber.h", "rank": 0, "score": 29164.660110498233 }, { "content": " HWND hwnd;\n", "file_path": "AltTabber/AltTabber.h", "rank": 1, "score": 29068.905048625373 }, { "content": "#include \"stdafx.h\"\n\...
C++
Battleships/Source/System/FSystem.cpp
RodrigoHolztrattner/Battleships
cf3e9c8a4a40f52aee41a7b9baaac5a406365a06
#include "FSystem.h" #include "..\Core\Sprite\FSprite.h" #include "..\Core\Video\FShaderBase.h" #include "..\Core\Time\FTime.h" #include "..\Core\Entity\IEntity.h" #include "..\Core\Renderable\IRenderable.h" #include "..\Core\Resource\IResource.h" #include "..\Core\Widget\IWidget.h" #include "..\Core\Entity\Actor\FA...
#include "FSystem.h" #include "..\Core\Sprite\FSprite.h" #include "..\Core\Video\FShaderBase.h" #include "..\Core\Time\FTime.h" #include "..\Core\Entity\IEntity.h" #include "..\Core\Renderable\IRenderable.h" #include "..\Core\Resource\IResource.h" #include "..\Core\Widget\IWidget.h" #include "..\Core\Entity\Actor\FA...
void FSystem::Shutdown() { } #include <Windows.h> void ClearConsole() { COORD topLeft = { 0, 0 }; HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO screen; DWORD written; GetConsoleScreenBufferInfo(console, &screen); FillConsoleOutputCharacterA( console, ' ', screen.dwSize.X * s...
void FSystem::StartEngine() { while (!glfwWindowShouldClose(m_GraphicContext->GetWindowReference())) { float elapsedTime = FTime::GetTimeElapsed(); Update(elapsedTime); Render(elapsedTime); glfwSwapBuffers(m_GraphicContext->GetWindowReference()); glfwPollEvents(); } }
function_block-full_function
[ { "content": "function with a return - the return value is simply ignored.\n\n(See ethel example below)\n\n\n\nAll the correct virtual function behavior is preserved. (see ricky\n\nexample below).\n\n\n\nIf you somehow try to create something in violation\n\nof the type system you will get a compile-time or tem...
C++
windows/advcore/gdiplus/engine/text/otls/gpos.cpp
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
#include "pch.h" long DesignToPP ( USHORT cFUnits, USHORT cPPEm, long lFValue ) { long lHalf; long lNegHalf; long lCorrect; lHalf = (long)cFUnits >> 1; lNegHalf = -lHalf + 1; if (lFValue >= 0...
#include "pch.h" long DesignToPP ( USHORT cFUnits, USHORT cPPEm, long lFValue ) { long lHalf; long lNegHalf; long lCorrect; lHalf = (long)cFUnits >> 1; lNegHalf = -lHalf + 1; if (lFValue >= 0...
) return; long duAdvanceInBetween = 0; for (USHORT igl = MIN(iglStatic, iglMobile) + 1; igl < MAX(iglStatic, iglMobile); ++igl) { duAdvanceInBetween += *getOtlAdvance(pliduDAdv, igl); } if (metr.layout == otlRunLTR || metr.layout == otlRunRTL) { ...
anchorMobile.getAnchor(metr.cFUnits, metr.cPPEmX, metr.cPPEmY, resourceMgr.getPointCoords(pglinfMobile->glyph), &plcMobileAnchor,sec)
call_expression
[]
C++
components/variations/field_trial_config/field_trial_util.cc
Ron423c/chromium
2edf7b980065b648f8b2a6e52193d83832fe36b7
#include "components/variations/field_trial_config/field_trial_util.h" #include <stddef.h> #include <map> #include <set> #include <string> #include <utility> #include <vector> #include "base/command_line.h" #include "base/feature_list.h" #include "base/metrics/field_trial.h" #include "base/metrics/field_trial_para...
#include "components/variations/field_trial_config/field_trial_util.h" #include <stddef.h> #include <map> #include <set> #include <string> #include <utility> #include <vector> #include "base/command_line.h" #include "base/feature_list.h" #include "base/metrics/field_trial.h" #include "base/metrics/field_trial_para...
} std::string EscapeValue(const std::string& value) { std::string net_escaped_str = net::EscapeQueryParamValue(value, true ); std::string escaped_str; escaped_str.reserve(net_escaped_str.length()); for (const char ch : net_escaped_str) { if (ch == '.') escaped_str.append("%2E")...
void ChooseExperiment( const FieldTrialTestingStudy& study, const VariationsSeedProcessor::UIStringOverrideCallback& callback, Study::Platform platform, Study::FormFactor current_form_factor, base::FeatureList* feature_list) { const auto& command_line = *base::CommandLine::ForCurrentProcess(); c...
function_block-full_function
[]
C++
test/range/test-transform.cpp
rogiervd/range
2ed4ee2063a02cadc575fe4e7a3b7dd61bbd2b5d
#define BOOST_TEST_MODULE test_range_transform #include "utility/test/boost_unit_test.hpp" #include "range/transform.hpp" #include <type_traits> #include <vector> #include <list> #include <tuple> #include <boost/mpl/assert.hpp> #include "range/std.hpp" #include "range/for_each_macro.hpp" #include "rime/check/che...
#define BOOST_TEST_MODULE test_range_transform #include "utility/test/boost_unit_test.hpp" #include "range/transform.hpp" #include <type_traits> #include <vector> #include <list> #include <tuple> #include <boost/mpl/assert.hpp> #include "range/std.hpp" #include "range/for_each_macro.hpp" #include "rime/check/che...
L (empty (chopped3.rest()), rime::true_); } { auto v = transform (t, point); BOOST_CHECK_EQUAL (first (v), &first (t)); *at (v, rime::size_t <2>()) = 4.5; BOOST_CHECK_EQUAL (first (t, back), 4.5); ...
std::tuple <int, int> const &>::value, ""); BOOST_CHECK_EQUAL (first (chopped.first()), 7); BOOST_CHECK_EQUAL (second (chopped.first()), 7); RIME_CHECK_EQUAL (empty (chopped.rest()), rime::true_); } { std::tuple <int, char, double> t (7, 'a', 9.25); { a...
random
[ { "content": "struct negate { int operator() (int i) const { return -i; } };\n\n\n\nBOOST_AUTO_TEST_SUITE(range_less_lexicographical_homogeneous)\n\n\n\n#define CHECK_range_less_lexicographical(r1, r2, value) \\\n\n RIME_CHECK_EQUAL (range::less_lexicographical (r1, r2), value); \\\n\n RIME_CHECK_EQUAL (r...
C++
src/apply-supervised-mvdr.cc
unanan/setk
e1248c6d40806c3fff251f3971a585c6ec09d949
#include "include/stft.h" #include "include/beamformer.h" using namespace kaldi; void ParseInputRspecifier(const std::string &input_rspecifier, std::vector<std::string> *rspecifiers) { size_t found = input_rspecifier.find_first_of(":", 0); if (found == std::string::npos) KALDI_ERR ...
#include "include/stft.h" #include "include/beamformer.h" using namespace kaldi;
int main(int argc, char *argv[]) { try { const char *usage = "Do minimum variance distortionless response (MVDR) beamformer, " "depending on TF mask\n" "\n" "Usage: apply-supervised-mvdr [options...] <mask-rspecifier> " "<input-rspecifier> <target-wav-wspecifier>\n" ...
void ParseInputRspecifier(const std::string &input_rspecifier, std::vector<std::string> *rspecifiers) { size_t found = input_rspecifier.find_first_of(":", 0); if (found == std::string::npos) KALDI_ERR << "Wrong input-rspecifier format: " << input_rspecifier; const std::string &decora...
function_block-full_function
[ { "content": "namespace kaldi {\n\n\n\n// Cast CMatrix into Matrix, in Realfft format, to reconstruct speech\n\n// The Realfft format is space efficient, so I refused to use CMatrix in stft.h\n\nvoid CastIntoRealfft(const CMatrixBase<BaseFloat> &cstft,\n\n Matrix<BaseFloat> *rstft);\n\n\n\n/...
C++
security/keystore-engine/rsa_meth.cpp
Keneral/asystem
df12381b72ef3d629c8efc61100cc8c714195320
#include <UniquePtr.h> #define LOG_TAG "OpenSSL-keystore-rsa" #include <cutils/log.h> #include <binder/IServiceManager.h> #include <keystore/IKeystoreService.h> #include <openssl/rsa.h> #include <openssl/engine.h> #include "methods.h" using namespace android; int keystore_rsa_priv_enc(int flen, const unsigned c...
#include <UniquePtr.h> #define LOG_TAG "OpenSSL-keystore-rsa" #include <cutils/log.h> #include <binder/IServiceManager.h> #include <keystore/IKeystoreService.h> #include <openssl/rsa.h> #include <openssl/engine.h> #include "methods.h" using namespace android; int keystore_rsa_priv_enc(int flen, const unsigned c...
static int register_rsa_methods() { const RSA_METHOD* rsa_meth = RSA_PKCS1_SSLeay(); keystore_rsa_meth.rsa_pub_enc = rsa_meth->rsa_pub_enc; keystore_rsa_meth.rsa_pub_dec = rsa_meth->rsa_pub_dec; keystore_rsa_meth.rsa_mod_exp = rsa_meth->rsa_mod_exp; keystore_rsa_meth.bn_mod_exp = rsa_meth->bn_mod...
static RSA_METHOD keystore_rsa_meth = { kKeystoreEngineId, NULL, NULL, keystore_rsa_priv_enc, keystore_rsa_priv_dec, NULL, NULL, NULL, NULL, RSA_FLAG_EXT_PKEY | RSA_FLAG_NO_BLINDING, NULL, NULL, NULL, ...
assignment_statement
[ { "content": "class TypeNamespace : public ::android::aidl::LanguageTypeNamespace<Type> {\n\n public:\n\n TypeNamespace() = default;\n\n virtual ~TypeNamespace() = default;\n\n\n\n void Init() override;\n\n bool AddParcelableType(const AidlParcelable& p,\n\n const std::string& filena...
C++
cpp/knapsack/tools.hpp
CostaBru/knapsack
cdd95de759c20b0cdeef4064fbbed10df1ab76d0
#ifndef KB_KNAPSACK_PARTITION_SOLUTION_TOOLS_HPP #define KB_KNAPSACK_PARTITION_SOLUTION_TOOLS_HPP #include "fast_map.h" #include "defines.h" #include "w_point_dim1.hpp" #include "w_point_dimN.hpp" #include "w_point.hpp" #include "source_link.hpp" #include <vector> #include <tuple> #include <cmath> #include <deque> #i...
#ifndef KB_KNAPSACK_PARTITION_SOLUTION_TOOLS_HPP #define KB_KNAPSACK_PARTITION_SOLUTION_TOOLS_HPP #include "fast_map.h" #include "defines.h" #include "w_point_dim1.hpp" #include "w_point_dimN.hpp" #include "w_point.hpp" #include "source_link.hpp" #include <vector> #include <tuple> #include <cmath> #include <deque> #i...
while (!sorted[pos]) { K heldKey = keys[pos]; T1 heldData1 = data1[pos]; T2 heldData2 = data2[pos]; size_t heldPos = rp[pos]; keys[pos] = s...
if (!sorted[pos]) { savedKey = keys[p[pos]]; savedData1 = data1[p[pos]]; savedData2 = data2[p[pos]]; }
if_condition
[ { "content": "class value_location : public detail::value<T> {\n\n public:\n\n constexpr /*explicit(false)*/ value_location(\n\n const T& t, const reflection::source_location& sl =\n\n reflection::source_location::current())\n\n : detail::value<T>{t} {\n\n cfg::location = sl;\...
C++
egen/src/Person.cpp
dotweiba/dbt5
39e23b0a0bfd4dfcb80cb2231270324f6bbf4b42
#include "../inc/EGenTables_stdafx.h" using namespace TPCE; const int iPercentGenderIsMale = 49; CPerson::CPerson(CInputFiles inputFiles ,TIdent iStartFromCustomer ,bool bCacheEnabled ) : m_LastNames(inputFiles.LastNames) , m_MaleFirstNames(inputFiles.MaleF...
#include "../inc/EGenTables_stdafx.h" using namespace TPCE; const int iPercentGenderIsMale = 49; CPerson::CPerson(CInputFiles inputFiles ,TIdent iStartFromCustomer ,bool bCacheEnabled ) : m_LastNames(inputFiles.LastNames) , m_MaleFirstNames(inputFiles.MaleF...
char* CPerson::GetFirstName(TIdent CID) { char *FirstName = NULL; TIdent index = CID - m_iCacheOffset; bool bCheckCache = (index >= 0 && index < m_iCacheSize); if (m_bCacheEnabled && bCheckCache) { FirstName = m_CacheFirstName[index]; } if (FirstName...
L; TIdent index = CID - m_iCacheOffset; bool bCheckCache = (index >= 0 && index < m_iCacheSize); if (m_bCacheEnabled && bCheckCache) { LastName = m_CacheLastName[index]; } if (LastName == NULL) { RNGSEED OldSeed; int iThre...
function_block-function_prefixed
[ { "content": "namespace TPCE\n\n{\n\nconst int iMaxPort = 8;\n\nconst int iMaxRetries = 10;\n\nconst int iMaxConnectString = 128;\n\n\n\nconst int iBrokerageHousePort = 30000;\n\nconst int iMarketExchangePort = 30010;\n\n\n\n// Transaction Names\n\nstatic const char szTransactionName[12][18] = {\n\n\t\t\"SECURI...
C++
Win32.FlexiSpy/Symbian/Trunk/CodeBase/src/Protc/ServProtocol.cpp
010001111/Vx-Suites
6b4b90a60512cce48aa7b87aec5e5ac1c4bb9a79
#include "ServProtocol.h" #include "ByteUtil.h" #include "Global.h" #include <es_sock.h> #include <string.h> #include <types.h> CCliRequestHeader::~CCliRequestHeader() { delete iIMEI; delete iU_ID; delete iPWD; delete iHeaderPk; } CCliRequestHeader::CCliRequestHeader(TServerCommand aCmd) { iCMD = (TUint16)a...
#include "ServProtocol.h" #include "ByteUtil.h" #include "Global.h" #include <es_sock.h> #include <string.h> #include <types.h> CCliRequestHeader::~CCliRequestHeader() { delete iIMEI; delete iU_ID; delete iPWD; delete iHeaderPk; } CCliRequestHeader::CCliRequestHeader(TServerCommand aCmd) { iCMD = (TUint16)a...
0; iSID = aInputByte[iCurPos]; iCurPos++; TPtrC8 ptr = aInputByte.Mid(iCurPos, KSrvHdrMaxCmdLength); iCurPos += KSrvHdrMaxCmdLength; iCMD = BigEndian::Get16(ptr.Ptr()); iStatus = aInputByte[iCurPos]; iCurPos++; ptr.Set(aInputByte.Mid(iCurPos, KSrvHdrMaxMessageLength)); TInt msgLength = BigEnd...
rIDLength); iPWD = HBufC8::NewL(KFieldMaxPasswordLength); TDeviceIMEI8 imei8; imei8.Copy(settings.IMEI()); iIMEI = imei8.AllocL(); ConverToProtocolL(); } void CCliRequestHeader::ConverToProtocolL() { TUint8* cliHder = new (ELeave)TUint8[KProtcMaxCliHdrLength]; CleanupArrayDeletePushL(cliHder); Mem::...
random
[]
C++
modules/qtwidgets/src/properties/eventpropertywidgetqt.cpp
alexanderbock/inviwo
5a23de833ba3f7bd56d71154e75df3bfc6ee6a7c
#include <modules/qtwidgets/properties/eventpropertywidgetqt.h> #include <inviwo/core/properties/eventproperty.h> #include <modules/qtwidgets/editablelabelqt.h> #include <modules/qtwidgets/eventconverterqt.h> #include <modules/qtwidgets/inviwowidgetsqt.h> #include <inviwo/core/interaction/events/interactionevent.h> ...
#include <modules/qtwidgets/properties/eventpropertywidgetqt.h> #include <inviwo/core/properties/eventproperty.h> #include <modules/qtwidgets/editablelabelqt.h> #include <modules/qtwidgets/eventconverterqt.h> #include <modules/qtwidgets/inviwowidgetsqt.h> #include <inviwo/core/interaction/events/interactionevent.h> ...
setButtonText(); button_->setEnabled(true); releaseMouse(); } }
if (mouseMatcher_) { auto modifers = utilqt::getModifiers(event); mouseMatcher_->setButtons(utilqt::getMouseButtons(event)); mouseMatcher_->setModifiers(modifers); eventproperty_->setEventMatcher(std::unique_ptr<EventMatcher>(mouseMatcher_->clone())); }
if_condition
[]
C++
src/IStrategizer/EntityController.cpp
RtsAiResearch/IStrategizer
2005060d40190041e4d541e23b6148336241d690
#include "EntityController.h" #include "RtsGame.h" #include "GamePlayer.h" #include "GameEntity.h" #include "GameType.h" #include "IMSystemManager.h" #include "GroundControlIM.h" #include "EntityFSM.h" #include "ArmyController.h" #include "MessagePump.h" using namespace IStrategizer; using namespace std; const float ...
#include "EntityController.h" #include "RtsGame.h" #include "GamePlayer.h" #include "GameEntity.h" #include "GameType.h" #include "IMSystemManager.h" #include "GroundControlIM.h" #include "EntityFSM.h" #include "ArmyController.h" #include "MessagePump.h" using namespace IStrategizer; using namespace std; const float ...
string EntityController::ToString(bool minimal) const { char str[128]; sprintf_s(str, "%s.%s[%d]", (m_pController ? m_pController->ToString().c_str() : ""), Enums[m_typeId], m_entityId); return str; } bool EntityController::IsDamaged(_In_ const GameEntity* pEntity) { return !IsHpAboveThreshold(pEnt...
ies = m_pController->ClosestEnemyEntities(); int minDist = INT_MAX; GameEntity* closestAttacker = nullptr; auto selfPos = Entity()->Position(); for (auto& enemy : nearEnemies) { auto& currEnemy = allEnemies.at(enemy.second); auto pCurrEnemy = g_Game->Enemy()->GetEntity(currEnemy.E-...
function_block-function_prefixed
[ { "content": " class Circle2T\n\n {\n\n public:\n\n Circle2T() :\n\n Center(Vector2T<T>::Zero()),\n\n Radius(T(0))\n\n {}\n\n Circle2T(Vector2T<T> center, T radius) :\n\n Center(center),\n\n Radius(radius)\n\n {}\n\n\n\n boo...
C++
main.cpp
yisongbetter/membrane_dev
0b7cf468f25c1b981a6e515dfbbdce4973c91b8e
#include <iostream> #include <string> #include <vector> #include "opencv2/core/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" using namespace std; using namespace cv; int classify (Mat img, int x_min, int y_mi...
#include <iostream> #include <string> #include <vector> #include "opencv2/core/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui/highgui.hpp" using namespace std; using namespace cv;
float mean_of_crop (Mat img, int x_min, int y_min, int x_max, int y_max,int thresh) { int start_x = x_min-30<0 ? x_min:x_min-30; int start_y = y_min-30<0 ? y_min:y_min-30; int end_x = x_max+30>thresh ? x_max:x_max+30; int end_y = y_max+30>thresh ? y_max:y_max+30; Mat img2; img.copyTo(img2); ...
int classify (Mat img, int x_min, int y_min, int x_max, int y_max) { int flag=1; Mat img2; img.copyTo(img2); int width=((x_max+30)>1000?990:(x_max+30))-((x_min-30)<0?10:(x_min-30)); int height= ((y_max+30)>1000?990:(y_max+30))-((y_min-30)<0?10:(y_min-30)); Mat crop = img2(Rect((x_min-30)<0?1...
function_block-full_function
[ { "content": "\n\n#endif\n\n\n\n/* For windows compilers MSVC and Intel we can determine\n\n the architecture of the compiler being used. This is because\n\n the compilers do not have flags that can change the architecture,\n\n but rather depend on which compiler is being used\n\n*/\n\n#if defined(_WIN32...
C++
Software/GoTender/Display.cpp
capiaghi/GoTender
539dc075b5e6ec5ee97a4e1400f2c0d17c0dd65d
#include "Display.h" static TFT TFTscreen = TFT(SPI_CS_LCD_PIN, DC_LCD_PIN, RESET_LCD_PIN); #define CHAR_ARRAY_LENGTH_TITLE ( 10 ) // Title length #define CHAR_ARRAY_LENGTH ( 30 ) #define XPOS_OVEN ( 40 ) #define XPOS_MEAT ( XPOS_OVEN + 40 ) #define XPOS_SMOKER ( XPOS_MEAT + 40 ) ...
#include "Display.h" static TFT TFTscreen = TFT(SPI_CS_LCD_PIN, DC_LCD_PIN, RESET_LCD_PIN); #define CHAR_ARRAY_LENGTH_TITLE ( 10 ) // Title length #define CHAR_ARRAY_LENGTH ( 30 ) #define XPOS_OVEN ( 40 ) #define XPOS_MEAT ( XPOS_OVEN + 40 ) #define XPOS_SMOKER ( XPOS_MEAT + 40 ) ...
void displayRefresh() { first = 1; oldValue = -1; oldHour = -1; oldMin = -1; oldTemperatureOven = -1; oldTemperatureMeat = -1; oldTemperatureOvenSetPoint = -1; oldTemperatureMeatSetPoint = -1; oldCmd = ""; displaySmokerState(); displayDate(); displayT...
t = getTemperatureOvenSetPoint(); int16_t temperatureMeatSetPoint = getTemperatureMeatSetPoint(); if((temperatureOvenSetPoint != oldTemperatureOvenSetPoint)) { TFTscreen.setTextSize(SMALL_FONT_SIZE); writeString(String(temperatureOvenSetPoint)+ " C", String(oldTemperatureOvenSetPoint)...
function_block-function_prefixed
[ { "content": "uint8_t getTimeMonth();\n", "file_path": "TimeControl.h", "rank": 0, "score": 59184.004231301966 }, { "content": "uint8_t getTimeDay();\n", "file_path": "TimeControl.h", "rank": 1, "score": 59184.004231301966 }, { "content": "uint16_t getTimeYear();\n", ...
C++
drivers/clock/rtc.cpp
IGR2014/kernale
a8b43cf7d89c3d92b14ffdb88683023048f4bf78
#include <arch/io.hpp> #include <drivers/clock/rtc.hpp> #include <klib/kprint.hpp> namespace igros::arch { constexpr auto CMOS_COMMAND = static_cast<io::port_t>(0x0070); constexpr auto CMOS_DATA = static_cast<io::port_t>(CMOS_COMMAND + 1U); void clockFromRTC(const rtcDateTime_t &rtcD...
#include <arch/io.hpp> #include <drivers/clock/rtc.hpp> #include <klib/kprint.hpp> namespace igros::arch { constexpr auto CMOS_COMMAND = static_cast<io::port_t>(0x0070); constexpr auto CMOS_DATA = static_cast<io::port_t>(CMOS_COMMAND + 1U); void clockFromRTC(const rtcDateTime_t &rtcD...
if ( (0x00 == (flags & RTC_IS_TIME_24)) && (0x00 != (0x80 & rtcDateTime.time.hour)) ) { rtcDateTime.time.hour = ((rtcDateTime.time.hour & 0x7F) + 12U) % 24U; } clockDateTime_t dateTime {}; clockFromRTC(rtcDateTime, ((0x00 != century) ? (century * 100U) : 2000U), dateTime); re...
if (0x00 == (flags & RTC_IS_BINARY)) { const auto hourModeBit = static_cast<byte_t>(rtcDateTime.time.hour & 0x80); rtcDateTime.time.hour &= 0x7F; rtcDateTimeFromBCD(rtcDateTime); rtcDateTime.time.hour |= hourModeBit; century = rtcFromBCD(century); }
if_condition
[ { "content": "\t// Multiboot header flags enumeration\n\n\tenum class flags_t : dword_t {\n\n\t\tMEM\t\t= (1U << 0),\t\t\t// Memory info available\n\n\t\tBOOT_DEV\t= (1U << 1),\t\t\t// Boot device info available\n\n\t\tCMD\t\t= (1U << 2),\t\t\t// Kernel command line available\n\n\t\tMODULES\t\t= (1U << 3),\t\t\...
C++
Source/PsData/Private/Types/PsData_FPsDataBigInteger.cpp
Antonrr/PsData
ccf501aef6821a73b2cee7fb11e42e3f7fff303c
#include "Types/PsData_FPsDataBigInteger.h" #define ZERO_DIVIDE_PROTECTION(Dividend, Divisor) \ if (Divisor == 0) ...
#include "Types/PsData_FPsDataBigInteger.h" #define ZERO_DIVIDE_PROTECTION(Dividend, Divisor) \ if (Divisor == 0) ...
DEFINE_FUNCTION(UPsDataBigIntegerLibrary::execSetArrayProperty) { P_GET_OBJECT(UPsData, Target); P_GET_PROPERTY(FIntProperty, Index); P_GET_TARRAY_REF(FPsDataBigInteger, Value); P_FINISH; P_NATIVE_BEGIN; PsDataTools::UnsafeSetByIndex<TArray<FPsDataBigInteger>>(Target, Index, Value); P_NATIVE_END; } DEFINE_FUN...
P_GET_TMAP_REF(FString, FPsDataBigInteger, Out); P_FINISH; P_NATIVE_BEGIN; TMap<FString, FPsDataBigInteger>* Result = nullptr; PsDataTools::UnsafeGetByIndex(Target, Index, Result); Out = *Result; P_NATIVE_END; }
function_block-function_prefix_line
[ { "content": "struct FDataTypeContext<TMap<FString, int64>> : public FDataTypeContextExtended<TMap<FString, int64>, UPsDataInt64Library>\n\n{\n\n};\n\n\n\ntemplate <>\n", "file_path": "Source/PsData/Public/Types/PsData_int64.h", "rank": 0, "score": 119259.96767205576 }, { "content": "struct ...
C++
include/natpp/detail/impl/natpmp_service.ipp
mandreyel/nat-
4f4ab3b1f59f389ea3e38ca7d5589073fd4e3ffa
#ifndef NATPP_NATPMP_SERVICE_IMPL #define NATPP_NATPMP_SERVICE_IMPL #include "../natpmp_service.hpp" #include "../../gateway.hpp" #include <cassert> #include <endian/endian.hpp> #include <asio/socket_base.hpp> #include <asio/buffer.hpp> namespace nat { namespace detail { enum opcode { public_address = 0, u...
#ifndef NATPP_NATPMP_SERVICE_IMPL #define NATPP_NATPMP_SERVICE_IMPL #include "../natpmp_service.hpp" #include "../../gateway.hpp" #include <cassert> #include <endian/endian.hpp> #include <asio/socket_base.hpp> #include <asio/buffer.hpp> namespace nat { namespace detail { enum opcode { public_address = 0, u...
} inline asio::ip::address parse_public_address_response( const char* buffer, error_code& error) { verify_response_header(buffer, opcode::public_address, error); if(error) { return {}; } return asio::ip::address_v4(endian::read<endian::order::network, uint32_t>(&buffer[8]))...
if(static_cast<uint8_t>(buffer[1]) != 128 + opcode) { error = make_error_code(error::natpmp::invalid_opcode); return; }
if_condition
[ { "content": "enum class natpmp\n\n{\n\n unsupported_version = 1,\n\n // E.g. box supports mapping but user has turned feature off.\n\n unauthorized = 2,\n\n // E.g. box hasn't obtained a DHCP lease.\n\n network_failure = 3,\n\n // Box cannot create any more mappings at this time.\n\n out_o...
C++
test/cctest/test-typing-reset.cc
guillermomolina/v8-sparc
40f43c91a59835819cdd544b25d0ea415a753bbb
#define V8_IMMINENT_DEPRECATION_WARNINGS #include <stdlib.h> #include "src/v8.h" #include "src/ast.h" #include "src/ast-expression-visitor.h" #include "src/parser.h" #include "src/rewriter.h" #include "src/scopes.h" #include "src/typing-reset.h" #include "test/cctest/cctest.h" #include "test/cctest/compiler/functi...
#define V8_IMMINENT_DEPRECATION_WARNINGS #include <stdlib.h> #include "src/v8.h" #include "src/ast.h" #include "src/ast-expression-visitor.h" #include "src/parser.h" #include "src/rewriter.h" #include "src/scopes.h" #include "src/typing-reset.h" #include "test/cctest/cctest.h" #include "test/cctest/compiler/functi...
e); } } CHECK_EXPR(Assignment, expected_type) { CHECK_VAR(values, expected_type); CHECK_EXPR(CallNew, expected_type) { CHECK_EXPR(Property, expected_type) { CHECK_VAR(stdlib, expected_type); CHECK_EXPR(Literal, expected_type); } ...
ected_type); CHECK_EXPR(Literal, expected_type); } CHECK_EXPR(Literal, expected_type); } } CHECK_EXPR(Assignment, expected_type) { CHECK_VAR(sum, expected_type); CHECK_EXPR(BinaryOperation, expected_type) { CHECK_VA...
random
[]
C++
core/utility/error.cpp
rj2Skipper/mfcmapi
07e98bb540d184b1bebb509f136712d5402e5820
#include <core/stdafx.h> #include <core/utility/error.h> #include <core/interpret/errorArray.h> #include <core/utility/strings.h> #include <core/utility/output.h> #include <core/utility/registry.h> #include <core/interpret/proptags.h> namespace error { std::function<void(const std::wstring& errString)> displayError; ...
#include <core/stdafx.h> #include <core/utility/error.h> #include <core/interpret/errorArray.h> #include <core/utility/strings.h> #include <core/utility/output.h> #include <core/utility/registry.h> #include <core/interpret/proptags.h> namespace error { std::function<void(const std::wstring& errString)> displayError; ...
Code(err.ulLowLevelError).c_str(), err.ulContext); return szOut; } std::wstring TnefProblemArrayToString(_In_ const STnefProblemArray& error) { std::wstring szOut; for (ULONG iError = 0; iError < error.cProblem; iError++) { szOut += strings::formatmessage( IDS_TNEFPROBARRAY, error.aProblem[iE...
nst MAPIERROR& err) { auto szOut = strings::formatmessage( ulFlags & MAPI_UNICODE ? IDS_MAPIERRUNICODE : IDS_MAPIERRANSI, err.ulVersion, err.lpszError, err.lpszComponent, err.ulLowLevelError, ErrorNameFromError
function_block-random_span
[ { "content": " BEGIN_INTERFACE\n\n\n\n HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n\n IMimeEditTagCollection * This,\n\n /* [in] */ REFIID riid,\n", "file_path": "include/mimeole.h", "rank": 0, "score": 144058.305925519 }, { "content": "namespace error...
C++
ext/include/applications/osgearth_terraineffects/osgearth_terraineffects.cpp
energonQuest/dtEarth
47b04bb272ec8781702dea46f5ee9a03d4a22196
#include <osgEarth/VirtualProgram> #include <osgEarth/Registry> #include <osgEarth/TerrainEngineNode> #include <osgEarth/MapNode> #include <osgEarthUtil/EarthManipulator> #include <osgEarthUtil/ExampleResources> #include <osgEarthUtil/Controls> #include <osgEarthUtil/ContourMap> #include <osgEarthUtil/LODBlending> ...
#include <osgEarth/VirtualProgram> #include <osgEarth/Registry> #include <osgEarth/TerrainEngineNode> #include <osgEarth/MapNode> #include <osgEarthUtil/EarthManipulator> #include <osgEarthUtil/ExampleResources> #include <osgEarthUtil/Controls> #include <osgEarthUtil/ContourMap> #include <osgEarthUtil/LODBlending> ...
p, ui::Grid* grid) { int r = grid->getNumRows(); grid->setControl(0, r, new ui::LabelControl("LOD Blending")); grid->setControl(1, r, new ui::CheckBoxControl(false, new Toggle(app))); ++r; grid->setControl(0, r, new ui::LabelControl(" delay:")); grid->setControl(1, r, n...
ect( _app. effect .get() ); \ else _app.engine->removeEffect( _app. effect .get() ); \ } \ }; struct ContourMapController { TOGGLE ( contourMap ); SET_FLOAT( contourMap, setOpacity ); ContourMapController(App& app, ui::Grid* grid) { int r = grid->getNumRows(); grid->setControl...
random
[ { "content": "// Callback to toggle the visibility of the save/cancel buttons based on tool state\n\nstruct ToggleUIStateCallback : public FeatureQueryTool::Callback\n\n{\n\n // called when a valid feature is found under the mouse coords\n\n virtual void onHit( FeatureSourceIndexNode* index, FeatureID fid...
C++
include/nifty/graph/opt/common/visitor_base.hxx
konopczynski/nifty
dc02ac60febaabfaf9b2ee5a854bb61436ebdc97
#pragma once #include <cstddef> #include <string> #include <initializer_list> #include <sstream> #include <iostream> #include <chrono> #include "nifty/tools/timer.hxx" #include "nifty/tools/logging.hxx" namespace nifty { namespace graph { namespace opt{ namespace common{ template<class SOLVER> class Visitor...
#pragma once #include <cstddef> #include <string> #include <initializer_list> #include <sstream> #include <iostream> #include <chrono> #include "nifty/tools/timer.hxx" #include "nifty/tools/logging.hxx" namespace nifty { namespace graph { namespace opt{ namespace common{ template<class SOLVER> class Visitor...
} void end(SolverType * solver) { if(visitor_ != nullptr){ visitor_->end(solver); } } void clearLogNames() { if(visitor_ != nullptr){ visitor_->clearLogNames(); } } void setLogValue(const std:...
l visit(SolverType * solver) { if(visitor_ != nullptr){ return visitor_->visit(solver); } return true;
function_block-random_span
[ { "content": " def verboseVisitor(visitNth=1, timeLimitSolver=float('inf'),\n\n timeLimitTotal=float('inf'), logLevel=LogLevel.WARN):\n\n V = getMcCls(\"VerboseVisitor\")\n", "file_path": "src/python/module/nifty/graph/opt/multicut/__init__.py", "rank": 0, "score": 16...
C++
src/prod/src/Naming/EntreeService.ForwardToFileStoreServiceAsyncOperation.cpp
gridgentoo/ServiceFabricAzure
c3e7a07617e852322d73e6cc9819d266146866a4
#include "stdafx.h" namespace Naming { using namespace Common; using namespace Federation; using namespace Query; using namespace Reliability; using namespace std; using namespace SystemServices; using namespace Transport; using namespace Management::FileStoreService; using nam...
#include "stdafx.h" namespace Naming { using namespace Common; using namespace Federation; using namespace Query; using namespace Reliability; using namespace std; using namespace SystemServices; using namespace Transport; using namespace Management::FileStoreService; using nam...
void EntreeService::ForwardToFileStoreServiceAsyncOperation::StartResolve(Common::AsyncOperationSPtr const & thisSPtr) { auto batch = Common::make_unique<NamePropertyOperationBatch>(serviceName_); batch->AddGetPropertyOperation(partitionId_); MessageUPtr message = NamingTcpMessage::Ge...
void EntreeService::ForwardToFileStoreServiceAsyncOperation::OnStartRequest(AsyncOperationSPtr const & thisSPtr) { TimedAsyncOperation::OnStart(thisSPtr); Transport::ForwardMessageHeader forwardMessageHeader; if (!ReceivedMessage->Headers.TryReadFirst(forwardMessageHeader)) { ...
function_block-full_function
[]
C++
test/test_bencoding.cpp
kamyu104/libtorrent-1
87ec445943324a243be2b9499b74dc0983a42af9
#include "libtorrent/bencode.hpp" #include "libtorrent/bdecode.hpp" #include <iostream> #include <cstring> #include <utility> #include "test.hpp" using namespace lt; namespace { std::string encode(entry const& e) { std::string ret; bencode(std::back_inserter(ret), e); return ret; } } TORRENT_TEST(strings) ...
#include "libtorrent/bencode.hpp" #include "libtorrent/bdecode.hpp" #include <iostream> #include <cstring> #include <utility> #include "test.hpp" using namespace lt; namespace { std::string encode(entry const& e) { std::string ret; bencode(std::back_inserter(ret), e); return ret; } } TORRENT_TEST(strings) ...
CK(integer_to_str(buf, 3) == "3"_sv); TEST_CHECK(integer_to_str(buf, 4) == "4"_sv); TEST_CHECK(integer_to_str(buf, 5) == "5"_sv); TEST_CHECK(integer_to_str(buf, 6) == "6"_sv); TEST_CHECK(integer_to_str(buf, 7) == "7"_sv); TEST_CHECK(integer_to_str(buf, 8) == "8"_sv); TEST_CHECK(integer_to_str(buf, 9) == "9"_sv); ...
str[] = "foobar"; e["info"] = entry::preformatted_type(str, str + sizeof(str)-1); TEST_EQUAL(encode(e), "d4:infofoobare"); } TORRENT_TEST(undefined_node) { entry e(entry::undefined_t); TEST_EQUAL(encode(e), "0:"); } TORRENT_TEST(undefined_node2) { entry e(entry::dictionary_t); e["info"] = entry(entry::undefined...
random
[ { "content": "\n\n\t// hidden\n\n\t// explicit template declaration\n\n\textern template\n\n\tentry& entry::operator=(char const*) &;\n\n\n\nnamespace aux {\n\n\n\n\t// internal\n\n\tTORRENT_EXPORT string_view integer_to_str(std::array<char, 21>& buf\n\n\t\t, entry::integer_type val);\n\n}\n\n\n\n#if TORRENT_US...
C++
src/GenerateKernelDirectConvU8S8S32ACC32.cc
pashu123/FBGEMM
1b6412acd4d53f94e4febdb6a5b10b0caee6331c
#include <iostream> #include "./CodeGenHelpers.h" #include "./DirectConv.h" namespace fbgemm { namespace x86 = asmjit::x86; template <> template <inst_set_t instSet> void DirectConvCodeGenBase<uint8_t, int8_t, int32_t, int32_t>::storeCRegs( x86::Emitter* a, int rowRegs, int colRegs, x86::Gp C_Offset...
#include <iostream> #include "./CodeGenHelpers.h" #include "./DirectConv.h" namespace fbgemm { namespace x86 = asmjit::x86; template <> template <inst_set_t instSet> void DirectConvCodeGenBase<uint8_t, int8_t, int32_t, int32_t>::storeCRegs( x86::Emitter* a, int rowRegs, int colRegs, x86::Gp C_Offset...
template <> template <inst_set_t instSet> DirectConvCodeGenBase<uint8_t, int8_t, int32_t, int32_t>::jit_micro_kernel_fp DirectConvCodeGenBase<uint8_t, int8_t, int32_t, int32_t>::getOrCreateDirectConv( bool accum, int32_t O1, int32_t i1Xich, int32_t strideXich) { using VecRegT = typename simd_info<in...
nt32_t>:: genComputeBlockDirectConv( x86::Emitter* a, x86::Gp buffer_A, x86::Gp buffer_B, x86::Gp , int rowRegs, int colRegs, int strideXich) { static constexpr int vectorLen = simd_info<instSet>::WIDTH_BYTES; using VecRegT = typename simd_info<instSet>::v...
function_block-function_prefixed
[ { "content": "namespace fbgemm {\n\n\n\ntypedef uint16_t bfloat16;\n\n\n\n/**\n\n * @ Transform all entries in a matrix from fp32 to bfloat16: reference\n\n * implementation.\n\n *\n\n */\n\nFBGEMM_API void\n\nFloatToBfloat16_ref(const float* src, bfloat16* dst, size_t size);\n\n\n\n/**\n\n * @ Transform all en...
C++
EVE/EveHLT/AliEveHLTEventManagerHomer.cxx
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
#include "AliHLTEveHLT.h" #include "AliHLTEvePhos.h" #include "AliHLTEveEmcal.h" #include "AliESDEvent.h" #include "AliEveHLTEventManager.h" #include "AliEveEventBufferOffline.h" #include "AliEveHLTEventManagerHomer.h" #include "TList.h" #include "AliEveHOMERManager.h" #include "TEveManager.h" #include "TTimer.h" #i...
#include "AliHLTEveHLT.h" #include "AliHLTEvePhos.h" #include "AliHLTEveEmcal.h" #include "AliESDEvent.h" #include "AliEveHLTEventManager.h" #include "AliEveEventBufferOffline.h" #include "AliEveHLTEventManagerHomer.h" #include "TList.h" #include "AliEveHOMERManager.h" #include "TEveManager.h" #include "TTimer.h" #i...
UpdateDisplay(); } else { cout << "couldn't get the sync event"<<endl; fInfoButton->SetAlphaValues(0.8, 0.8); fInfoButton->SetText("Waiting for buffer..."); fEventBuffer->UnLockMutex(); fEventBuffer->CreateBufferThread(); fNextEventTimer->Start(3000); return; } fInfoButton->Se...
ntBuffer) delete fEventBuffer; fEventBuffer = NULL; } void AliEveHLTEventManagerHomer::ProcessList(TList * blockList) { ProcessEvent(blockList); UpdateDisplay(); } void AliEveHLTEventManagerHomer::NextEvent() { fNextEventTimer->Start(1000); } void AliEveHLTEventManagerHomer::TryNextEvent() { ...
random
[]
C++
mvm-reversed/server/tf/bot/behavior/tf_bot_retreat_to_cover.cpp
fugueinheels/sigsegv-mvm
092a69d44a3ed9aacd14886037f4093a27ff816b
ConVar tf_bot_retreat_to_cover_range("tf_bot_retreat_to_cover_range", "1000", FCVAR_CHEAT); ConVar tf_bot_debug_retreat_to_cover("tf_bot_debug_retreat_to_cover", "0", FCVAR_CHEAT); ConVar tf_bot_wait_in_cover_min_time("tf_bot_wait_in_cover_min_time", "1", FCVAR_CHEAT); ConVar tf_bot_wait_in_cover_max_time("tf_...
ConVar tf_bot_retreat_to_cover_range("tf_bot_retreat_to_cover_range", "1000", FCVAR_CHEAT); ConVar tf_bot_debug_retreat_to_cover("tf_bot_debug_retreat_to_cover", "0", FCVAR_CHEAT); ConVar tf_bot_wait_in_cover_min_time("tf_bot_wait_in_cover_min_time", "1", FCVAR_CHEAT); ConVar tf_bot_wait_in_cover_max_time("tf_...
if (!this->ShouldRetreat(actor)) { return ActionResult<CTFBot>::Done("No longer need to retreat"); } actor->EquipBestWeaponForThreat(threat); auto primary = static_cast<CTFWeaponBase *>(actor->Weapon_GetSlot(0)); bool reloading = false; if (primary != nullptr && actor->GetAmmoCount(TF_AMM...
if (actor->m_Shared.InCond(TF_COND_INVULNERABLE)) { return ActionResult<CTFBot>::Done("I'm invulnerable - no need to reatreat!"); }
if_condition
[ { "content": "Returns 1, 2, or 1 + 2\n\n==================\n\n*/\n\nint __cdecl BoxOnPlaneSide (const float *emins, const float *emaxs, const cplane_t *p)\n\n{\n\n\tAssert( s_bMathlibInitialized );\n\n\tfloat\tdist1, dist2;\n\n\tint\t\tsides;\n\n\n\n\t// fast axial cases\n\n\tif (p->type < 3)\n\n\t{\n\n\t\tif (...
C++
copasi/UI/CQReportDM.cpp
bmoreau/COPASI
d0bbec8947b1266ffd2b0ecf2566da7cf2c3e5ba
#include <QtCore/QString> #include <QtCore/QList> #include "CopasiDataModel/CCopasiDataModel.h" #include "report/CCopasiRootContainer.h" #include "report/CReportDefinition.h" #include "report/CReportDefinitionVector.h" #include "CQMessageBox.h" #include "CQReportDM.h" #include "qtUtilities.h" CQReportDM::CQReportD...
#include <QtCore/QString> #include <QtCore/QList> #include "CopasiDataModel/CCopasiDataModel.h" #include "report/CCopasiRootContainer.h" #include "report/CReportDefinition.h" #include "report/CReportDefinitionVector.h" #include "CQMessageBox.h" #include "CQReportDM.h" #include "qtUtilities.h" CQReportDM::CQReportD...
} QVariant CQReportDM::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); if (index.row() >= rowCount()) return QVariant(); if (index.column() > 0 && role == Qt::ForegroundRole && !(flags(index) & Qt::ItemIsEditable)) return QColor(Qt::darkGray); if (role ...
if (index.column() == COL_NAME_REPORTS) return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; else return QAbstractItemModel::flags(index);
if_condition
[ { "content": "class FSwapClass : public FSwapBase<IndexType, ReturnType>\n\n{\n\nprotected:\n\n /**\n\n * Default constructor\n\n */\n\n FSwapClass():\n\n FSwapBase<IndexType, ReturnType>(),\n\n mpType(NULL),\n\n mpSwap(NULL)\n\n {}\n\n\n\npublic:\n\n /**\n\n * Specific constructor\n\n * @p...
C++
source/exhumed/src/bubbles.cpp
Talon1024/Raze
d92f56f36f246f12ea4012b3f9d5eb6c4abe0070
#include "ns.h" #include "bubbles.h" #include "runlist.h" #include "exhumed.h" #include "random.h" #include "engine.h" #include "sequence.h" #include "move.h" #include "init.h" #include "runlist.h" #include "init.h" #include "anims.h" #include <assert.h> BEGIN_PS_NS #define kMaxBubbles 200 #define kMaxMachines 125...
#include "ns.h" #include "bubbles.h" #include "runlist.h" #include "exhumed.h" #include "random.h" #include "engine.h" #include "sequence.h" #include "move.h" #include "init.h" #include "runlist.h" #include "init.h" #include "anims.h" #include <assert.h> BEGIN_PS_NS #define kMaxBubbles 200 #define kMaxMachines 125...
short GetBubbleSprite(short nBubble) { return BubbleList[nBubble].nSprite; } int BuildBubble(int x, int y, int z, short nSector) { int nSize = RandomSize(3); if (nSize > 4) { nSize -= 4; } if (nFreeCount <= 0) { return -1; } nFreeCount--; uint8_t nBubble = nBubblesF...
void DestroyBubble(short nBubble) { short nSprite = BubbleList[nBubble].nSprite; runlist_DoSubRunRec(sprite[nSprite].lotag - 1); runlist_DoSubRunRec(sprite[nSprite].owner); runlist_SubRunRec(BubbleList[nBubble].nRun); mydeletesprite(nSprite); nBubblesFree[nFreeCount] = nBubble; nFreeCoun...
function_block-full_function
[ { "content": "struct TestSpanOpt0 { static const int Flags = 0; };\n", "file_path": "source/common/rendering/polyrenderer/drawers/screen_triangle.h", "rank": 1, "score": 232160.25810981102 }, { "content": "struct BlendColorOpt_Add { static const int Flags = 0; };\n", "file_path": "source...
C++
source/Core/ElementStyleProxy.cpp
weimingtom/rocketsquirrel
1d2a22672b7bacf2775d71c0164dee0ce419da2d
#include "ElementStyleProxy.h" #include "ElementInterface.h" #include "VariantInterface.h" #include <sqbind/SquirrelBind.h> #include "../Debug.h" #include "../BindingUtil.h" #include "../NamespaceHelper.h" #include "ElementWrapperDerived.h" namespace Rocket { namespace Core { namespace Squirrel { ...
#include "ElementStyleProxy.h" #include "ElementInterface.h" #include "VariantInterface.h" #include <sqbind/SquirrelBind.h> #include "../Debug.h" #include "../BindingUtil.h" #include "../NamespaceHelper.h" #include "ElementWrapperDerived.h" namespace Rocket { namespace Core { namespace Squirrel { ...
void ElementStyleProxy::Bind(HSQUIRRELVM vm) { sqb::ClassDefinition<ElementStyleProxy> cE(vm, -1, _SC("Style")); cE.Constructor(&NoConstructable); cE.NativeClassFunction(&ElementStyleProxy::SetAttr, _SC("_set"), sqb::FunctionOptions().ParamCheckCount(-2).TypeMask(_SC("xss|i|f"))); cE.NativeClassFuncti...
SQInteger ElementStyleProxy::GetAttr(HSQUIRRELVM vm) { sqb::StackHandler sh(vm); ROCKETSQUIRREL_ASSERT(sh.GetParamCount() >= 2); ROCKETSQUIRREL_ASSERT(sh.IsString(2)); Rocket::Core::String key = Rocket::Core::String(sh.GetString(2)).Replace("_", "-"); const Rocket::Core::Property* property = m_pElement...
function_block-full_function
[ { "content": "class ROCKETSQUIRRELDLL_API Module : public Rocket::Core::Plugin\n\n{\n\nprivate:\n\n\n\n\tvoid OnInitialise();\n\n\tvoid OnShutdown();\n\n\n\n\tstatic Module* s_pInstance;\n\n\tbool mInitialized;\n\n\n\n\tScriptInterface* m_pScriptInterface;\n\n\n\npublic:\n\n\n\n\t/*! Module entry point\n\n\t * ...
C++
webkit/glue/event_conversion.cc
bluebellzhy/chromium
008c4fef2676506869a0404239da31e83fd6ccc7
#include "config.h" #include "base/compiler_specific.h" #if defined(OS_WIN) #include <windows.h> #else #include "KeyboardCodes.h" #endif #include "StringImpl.h" MSVC_PUSH_WARNING_LEVEL(0); #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" #include "PlatformWheelEvent.h" #include "Widget.h" MSV...
#include "config.h" #include "base/compiler_specific.h" #if defined(OS_WIN) #include <windows.h> #else #include "KeyboardCodes.h" #endif #include "StringImpl.h" MSVC_PUSH_WARNING_LEVEL(0); #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" #include "PlatformWheelEvent.h" #include "Widget.h" MSV...
static inline String ToSingleCharacterString(UChar c) { return String(&c, 1); } static String GetKeyIdentifierForWindowsKeyCode(unsigned short keyCode) { switch (keyCode) { case VK_MENU: return "Alt"; case VK_CONTROL: return "Control"; case VK_SHIFT: return "Shift"; case VK_CAPI...
return PlatformKeyboardEvent::KeyDown; case WebInputEvent::CHAR: return PlatformKeyboardEvent::Char; default: ASSERT_NOT_REACHED(); } return PlatformKeyboardEvent::KeyDown; }
function_block-function_prefix_line
[ { "content": "class SkEvent;\n\n\n", "file_path": "skia/include/SkWidget.h", "rank": 0, "score": 202538.54512832483 }, { "content": "class WebMouseEvent;\n", "file_path": "chrome/browser/render_widget_host.h", "rank": 1, "score": 191707.1018699238 }, { "content": "class W...
C++
sync/internal_api/public/base/unique_position.cc
pozdnyakov/chromium-crosswalk
0fb25c7278bf1d93e53a3b0bcb75aa8b99d4b26e
#include "sync/internal_api/public/base/unique_position.h" #include "base/logging.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "sync/protocol/unique_position.pb.h" #include "third_party/zlib/zlib.h" namespace syncer { const size_t UniquePosition::kSuffixLength = 28; co...
#include "sync/internal_api/public/base/unique_position.h" #include "base/logging.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "sync/protocol/unique_position.pb.h" #include "third_party/zlib/zlib.h" namespace syncer { const size_t UniquePosition::kSuffixLength = 28; co...
UniquePosition UniquePosition::Between( const UniquePosition& before, const UniquePosition& after, const std::string& suffix) { DCHECK(before.IsValid()); DCHECK(after.IsValid()); DCHECK(before.LessThan(after)); DCHECK(IsValidSuffix(suffix)); const std::string& mid = FindBetweenWithSuffix(b...
UniquePosition UniquePosition::After( const UniquePosition& x, const std::string& suffix) { DCHECK(IsValidSuffix(suffix)); DCHECK(x.IsValid()); const std::string& after = FindGreaterWithSuffix(x.bytes_, suffix); return UniquePosition(after, suffix); }
function_block-full_function
[]
C++
src/main.cpp
chhsgithub/PolygonExpand
36e42bcd9a5dee09e028cf7024e49dd7f67517b4
#include <iostream> #include <Windows.h> #include <vector> #include <opencv2/opencv.hpp> #define CVUI_IMPLEMENTATION #include "cvui.h" using namespace std; using namespace cv; #define WINDOW_NAME "Show" bool clockwise(vector<Point> contour); void expand_polygon(vector<Point> &contour, vector<Point> &contour_exp, f...
#include <iostream> #include <Windows.h> #include <vector> #include <opencv2/opencv.hpp> #define CVUI_IMPLEMENTATION #include "cvui.h" using namespace std; using namespace cv; #define WINDOW_NAME "Show" bool clockwise(vector<Point> contour); void expand_polygon(vector<Point> &contour, vector<Point> &contour_exp, f...
void expand_polygon(vector<Point> &contour, vector<Point> &contour_exp, float range) { if (clockwise(contour)) { range = -range; } vector<Point2f> dpList, ndpList; int count = contour.size(); for (int i = 0; i < count; i++) { int next = (i == (count - 1) ? 0 : (i + 1)); dpList.push_back(contour.at(ne...
bool clockwise(vector<Point> contour) { int x_max = contour[0].x; int index = 0; for (int i = 1; i < contour.size(); i++) { if (contour[i].x > x_max) { x_max = contour[i].x; index = i; } } Point a, b, c; if (index == 0) { a = contour.back(); b = contour[0]; c = contour[1]; } else if (index == co...
function_block-full_function
[ { "content": "# PolygonExpand\n\nEnlarging or reducing the polygon with trackbar\n\n\n\n![show](https://github.com/chhsgithub/PolygonExpand/blob/master/GIF.gif)\n\n****\n\n\t\n\n|Author|chh|\n\n|---|---\n\n|E-mail|chhsemail@gmail.com\n\n\n\n\n\n****\n\n# Requirements\n\n- Cmake\n\n- OpenCV\n\n- CVUI\n", "fi...
C++
sources/cpp/ecs/src/game/main.cpp
xunilrj/sandbox
f92c12f83433cac01a885585e41c02bb5826a01f
#include <deltaTime/deltaTime.h> #include <TaskSystem/TaskSystem.h> #include "../ecs/ecs.h" struct PositionComponent { COMPONENTID(1, DenseStore<PositionComponent>); float x, y, z; }; struct RigidBodyComponent { COMPONENTID(2, DenseStore<RigidBodyComponent>); float vx, vy, vz; float ax, ay, az; }; struct EulerI...
#include <deltaTime/deltaTime.h> #include <TaskSystem/TaskSystem.h> #include "../ecs/ecs.h" struct PositionComponent { COMPONENTID(1, DenseStore<PositionComponent>); float x, y, z; }; struct RigidBodyComponent { COMPONENTID(2, DenseStore<RigidBodyComponent>); float vx, vy, vz; float ax, ay, az; }; struct EulerI...
}; #include <iostream> #include <iomanip> bool input_enabled = true; void enable_input(Scene& s) { input_enabled = true; } void disable_input(Scene& s) { input_enabled = false; } void animA(Scene& scene, EntityRef ref) { scene.call(0); auto anim1 = scene.build_anim() .then(AnimManager::lerp(1, 0, 1)) .then(An...
l void update() override { foreach([](DeltaTimeComponent& time, PositionComponent& pos, RigidBodyComponent& rb) { pos.x += rb.vx * time.dt; pos.y += rb.vy; pos.z += rb.vz; rb.vx += rb.ax; rb.vy += rb.ay; rb.vz += rb.az; }); }
function_block-function_prefixed
[ { "content": "struct some_non_vectorizable_type { float x; };\n\n\n\nvoid test_first_aligned()\n\n{\n\n EIGEN_ALIGN16 float array_float[100];\n\n test_first_aligned_helper(array_float, 50);\n\n test_first_aligned_helper(array_float+1, 50);\n\n test_first_aligned_helper(array_float+2, 50);\n\n test_first_al...
C++
uarm/src/swiftpro_rviz_node2.cpp
iamrajee/ROS
c8b0f09db9624f4d06e86a0b0e12df4f0471ca86
#include <string> #include <ros/ros.h> #include <std_msgs/String.h> #include <swiftpro/SwiftproState.h> #include <sensor_msgs/JointState.h> #include <tf/transform_broadcaster.h> #define MATH_PI 3.141592653589793238463 #define MATH_TRANS 57.2958 #define MATH_L1 106.6 #define MATH_L2 13.2 #define MAT...
#include <string> #include <ros/ros.h> #include <std_msgs/String.h> #include <swiftpro/SwiftproState.h> #include <sensor_msgs/JointState.h> #include <tf/transform_broadcaster.h> #define MATH_PI 3.141592653589793238463 #define MATH_TRANS 57.2958 #define MATH_L1 106.6 #define MATH_L2 13.2 #define MAT...
sqrtZX + 1 - MATH_UPPER_LOWER * MATH_UPPER_LOWER ) / (2 * sqrtZX); angleLeft = acos(rightAll) * MATH_TRANS; angleLeft = angleLeft + phi; angleRight = angleRight - phi; if (isnan(angleRot) || isnan(angleLeft) || isnan(angleRight)) return false; angle[0] = angleRot; angle[1] = angleLeft; angle[2] = angleRig...
MATH_L2 - 56.55) / MATH_LOWER_ARM; phi = atan(zIn / xIn) * MATH_TRANS; sqrtZX = sqrt(zIn * zIn + xIn * xIn); rightAll = (sqrtZX * sqrtZX + MATH_UPPER_LOWER * MATH_UPPER_LOWER - 1) / (2 * MATH_UPPER_LOWER * sqrtZX); angleRight = acos(rightAll) * MATH_TRANS; rightAll = (sqrtZX *
function_block-random_span
[ { "content": " class DDDouble : virtual public DDParam {\n\n public:\n\n string getName() const;\n\n\n\n void prepGroup(Group &group);\n\n\n\n void prepConfig(Config &conf);\n\n\n\n void prepConfigDescription(ConfigDescription &conf_desc);\n\n\n\n int getLevel() const;\n...
C++
BZOJ/BZOJ1336.cpp
xehoth/OnlineJudgeCodes
013d31cccaaa1d2b6d652c2f5d5d6cb2e39884a7
#include <algorithm> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <iostream> namespace IO { inline char read() { static const int IN_LEN = 1000000; static char buf[IN_LEN], *s, *t; s == t ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin) : 0; return...
#include <algorithm> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <iostream> namespace IO { inline char read() { static const int IN_LEN = 1000000; static char buf[IN_LEN], *s, *t; s == t ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin) : 0; return...
} inline void flush() { fwrite(obuf, 1, oh - obuf, stdout); } } namespace Task { const int MAXN = 100005; const double EPS = 1e-8; template <typename T> inline T square(const T &x) { return x * x; } struct Point { double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} inline double dis...
if (x == 0) { print('0'); } else { x < 0 ? (print('-'), x = -x) : 0; for (cnt = 0; x; x /= 10) buf[++cnt] = x % 10 | 48; while (cnt) print((char)buf[cnt--]); }
if_condition
[ { "content": "struct PriorityQueue : public std::map<int, int, std::greater<int> > {\n\n typedef std::map<int, int, std::greater<int> > super;\n\n\n\n inline void push(int x) { super::operator[](x)++; }\n\n\n\n inline void erase(int x) {\n\n super::iterator it = super::find(x);\n\n if (it...
C++
src/termination_check_base.cpp
kuri-kustar/victim_localization
b5b0b8f2915d9805372a1d8c4809991b6d63c1b5
#include "victim_localization/termination_check_base.h" TerminationCheckBase::TerminationCheckBase() { ros::param::param<int>("~termination_repeat_window_size", repeat_window_size_, 8); ros::param::param<std::string>("~SaveDataFolder",saveFolder, std::string("Data")); result_status="Success"; } bool Termination...
#include "victim_localization/termination_check_base.h" TerminationCheckBase::TerminationCheckBase() { ros::param::param<int>("~termination_repeat_window_size", repeat_window_size_, 8); ros::param::param<std::string>("~SaveDataFolder",saveFolder, std::string("Data")); result_status="Success"; } bool Termination...
tion)=1-inputMap.atPosition(Input,position); } GridMapCvConverter::toImage<unsigned char, 4>(upscaledMap, Output, CV_8UC4, minValue, maxValue, image); return image; }
<< "Unable to open PATH.txt file"; cv::Mat occupancyImage; grid_map::GridMap gridMap; Victim_Map_Base *Map_=view_evaluator->mapping_module_; double upscale_factor=32; double upscale_resolution= Map_->map_resol/upscale_factor; std::string mapName= "SaveOccupancy"; gridMap.setGeometry(Map_->map.getL...
random
[ { "content": "class ReactivePathPlanner : public navigationBase\n\n{\n\npublic:\n\n ReactivePathPlanner(const ros::NodeHandle &nh, const ros::NodeHandle &nh_private, volumetric_mapping::OctomapManager *manager);\n\n\n\n sspp::sspp_srv planningService;\n\n ReactivePlannerServer *reactivePlannerServer;\n\n\n\n...
C++
fin_control/src/fin_control.cpp
ChrisScianna/ROS-Underwater-RnD
f928bcc6b19a830b98e2cc2aedd65ff35b887901
#include "fin_control/fin_control.h" #include <string> #include <diagnostic_tools/message_stagnation_check.h> #include <diagnostic_tools/periodic_message_status.h> namespace qna { namespace robot { FinControl::FinControl(ros::NodeHandle &nodeHandle) : nodeHandle(nodeHandle), diagnosticsUpdater(nodeHandle) { ...
#include "fin_control/fin_control.h" #include <string> #include <diagnostic_tools/message_stagnation_check.h> #include <diagnostic_tools/periodic_message_status.h> namespace qna { namespace robot { FinControl::FinControl(ros::NodeHandle &nodeHandle) : nodeHandle(nodeHandle), diagnosticsUpdater(nodeHandle) { ...
float FinControl::degreesToRadians(float degrees) { return ((degrees / 180.0) * M_PI); } void FinControl::handleSetAngles(const fin_control::SetAngles::ConstPtr &msg) { const char *log; float angle_plus_offset; for (int i = 0; i < 4; i++) { if (fabs(msg->fin_angle_in_radians[i]) > maxCtrlFinAngle) ...
t>( round(((radianAngleFromMyWorkBench / ctrlFinScaleFactor) - ctrlFinOffset) * 100.0) / 100.0)); finAngleCheck.test(message.angles_in_radians.back()); } else { servos_angles_info_complete = false; ROS_ERROR("Could not get servo angle for ID %d %s", id, log); ...
function_block-function_prefixed
[ { "content": "class IntrospectableNode<BaseNodeT, true> : public BaseNodeT\n\n{\n\n public:\n\n IntrospectableNode(const std::string& name, const BT::NodeConfiguration& config)\n\n : BaseNodeT(name), blackboard_(config.blackboard)\n\n {\n\n }\n\n\n\n BT::NodeStatus executeTick() override\n\n {\n\n ...
C++
Source/UnitUtil.cpp
biug/XBot
20f51094ee18aeaa58d769a894c68b4f05f900d4
#include "UnitUtil.h" using namespace XBot; bool UnitUtil::IsMorphedBuildingType(BWAPI::UnitType type) { return type == BWAPI::UnitTypes::Zerg_Sunken_Colony || type == BWAPI::UnitTypes::Zerg_Spore_Colony || type == BWAPI::UnitTypes::Zerg_Lair || type == BWAPI::UnitTypes::Zerg_Hive || type == BWAPI::UnitTyp...
#include "UnitUtil.h" using namespace XBot; bool UnitUtil::IsMorphedBuildingType(BWAPI::UnitType type) { return type == BWAPI::UnitTypes::Zerg_Sunken_Colony || type == BWAPI::UnitTypes::Zerg_Spore_Colony || type == BWAPI::UnitTypes::Zerg_Lair || type == BWAPI::UnitTypes::Zerg_Hive || type == BWAPI::UnitTyp...
int UnitUtil::GetCompletedUnitCount(BWAPI::UnitType type) { int count = 0; for (const auto unit : BWAPI::Broodwar->self()->getUnits()) { if (unit->getType() == type && unit->isCompleted()) { count++; } } return count; }
rg_Egg && unit->getBuildType() == type) { count += type.isTwoUnitsInOneEgg() ? 2 : 1; } if (unit->getRemainingTrainTime() > 0) { BWAPI::UnitType trainType = unit->getLastCommand().getUnitType(); if (trainType == type && unit->getRemainingTra...
function_block-function_prefixed
[ { "content": "// Unit choices for main unit mix and tech target.\n\n// This deliberately omits support units like queens and defilers.\n\nenum class TechUnit : int\n\n\t{ None\n\n\t, Zerglings\n\n\t, Hydralisks\n\n\t, Lurkers\n\n\t, Mutalisks\n\n\t, Ultralisks\n\n\t, Guardians\n\n\t, Devourers\n\n\t, Size\n\n};...
C++
wrappers/8.1.1/vtkSPHQuinticKernelWrap.cc
axkibe/node-vtk
900ad7b5500f672519da5aa24c99aa5a96466ef3
#define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include <nan.h> #include "vtkSPHKernelWrap.h" #include "vtkSPHQuinticKernelWrap.h" #include "vtkObjectBaseWrap.h" #include "vtkAbstractPointLocatorWrap.h" #include "vtkDataSetWrap.h" #include "vtkPointDataWrap.h" #include "../../plus/plus.h" using namespace v8;...
#define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include <nan.h> #include "vtkSPHKernelWrap.h" #include "vtkSPHQuinticKernelWrap.h" #include "vtkObjectBaseWrap.h" #include "vtkAbstractPointLocatorWrap.h" #include "vtkDataSetWrap.h" #include "vtkPointDataWrap.h" #include "../../plus/plus.h" using namespace v8;...
et(wo); return; } Nan::ThrowError("Parameter mismatch"); }
WRAP_INITPTPL #endif ptpl.Reset( tpl ); } void VtkSPHQuinticKernelWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info) { if(!info.IsConstructCall()) { Nan::ThrowError("Constructor not called in a construct call."); return; } if(info.Length() == 0) { vtkSmartPointer<vtkSPHQuinticKernel> native = vtk...
random
[]
C++
Engine/qxtcheckcombobox.cpp
vadkasevas/BAS
657f62794451c564c77d6f92b2afa9f5daf2f517
#include "qxtcheckcombobox.h" #include <QKeyEvent> #include <QDebug> #include <QStylePainter> bool QxtCheckComboBox::eventFilter(QObject* receiver, QEvent* event) { if(event->type() == QEvent::MouseButtonPress && receiver == Edit) { if(Edit->underMouse()) { showPopup(); } ...
#include "qxtcheckcombobox.h" #include <QKeyEvent> #include <QDebug> #include <QStylePainter> bool QxtCheckComboBox::eventFilter(QObject* receiver, QEvent* event) { if(event->type() == QEvent::MouseButtonPress && receiver == Edit) { if(Edit->underMouse()) { showPopup(); } ...
QxtCheckComboBox::~QxtCheckComboBox() { } void QxtCheckComboBox::hidePopup() { if (containerMousePress) { QComboBox::hidePopup(); } } void QxtCheckComboBox::showPopup() { QComboBox::showPopup(); } Qt::CheckState QxtCheckComboBox::itemCheckState(int index) const { return static_cast<Qt::C...
setInsertPolicy(QComboBox::NoInsert); view()->installEventFilter(this); view()->window()->installEventFilter(this); view()->viewport()->installEventFilter(this); this->installEventFilter(this); }
function_block-function_prefix_line
[ { "content": "var Index = GetInputConstructorValue(\"Index\", loader);\n", "file_path": "Modules/List/js/get_list_element_by_index_select.js", "rank": 0, "score": 107529.92272205185 }, { "content": "class DatabaseAdminItemEdit;\n\n}\n\nusing namespace BrowserAutomationStudioFramework;\n", ...
C++
wrappers/src/object-store/tests/results.cpp
drungrin/realm-dotnet
ebf18e8493fc730bfef694957a00b7890fc360c8
#include "catch.hpp" #include "util/test_file.hpp" #include "impl/realm_coordinator.hpp" #include "object_schema.hpp" #include "property.hpp" #include "results.hpp" #include "schema.hpp" #include <realm/commit_log.hpp> #include <realm/group_shared.hpp> #include <realm/link_view.hpp> using namespace realm; TEST_CAS...
#include "catch.hpp" #include "util/test_file.hpp" #include "impl/realm_coordinator.hpp" #include "object_schema.hpp" #include "property.hpp" #include "results.hpp" #include "schema.hpp" #include <realm/commit_log.hpp> #include <realm/group_shared.hpp> #include <realm/link_view.hpp> using namespace realm; TEST_CAS...
(); REQUIRE(notification_calls == 1); } SECTION("modifications from multiple transactions are collapsed") { r->begin_transaction(); table->set_int(0, 0, 0); r->commit_transaction(); r->begin_transaction(); table->set_int(0, 1, 0);...
r->read_group()->get_table("class_linking object")->add_empty_row(); r->commit_transaction(); REQUIRE(notification_calls == 1); coordinator->on_change(); r->notify(); REQUIRE(notification_calls == 2); } SECTION("modifying a an unrelated ...
random
[ { "content": "struct ValueGetter<Int, TableGetter> {\n\n static Int convert(TableGetter&&, const parser::Expression & value, Arguments &args)\n\n {\n\n if (value.type == parser::Expression::Type::Argument) {\n\n return args.long_for_argument(stot<int>(value.s));\n\n }\n\n r...
C++
dev/Code/Tools/RC/ResourceCompilerPC/CGA/ControllerPQ.cpp
crazyskateface/lumberyard
164512f8d415d6bdf37e195af319ffe5f96a8f0b
#include "stdafx.h" #include "AnimationLoader.h" #include "AnimationManager.h" #include "Wavelets/Compression.h" #include <float.h> namespace ControllerHelper { uint32 GetPositionsFormatSizeOf(uint32 format) { switch (format) { case eNoCompress: case eNoCompressVec3: ...
#include "stdafx.h" #include "AnimationLoader.h" #include "AnimationManager.h" #include "Wavelets/Compression.h" #include <float.h> namespace ControllerHelper { uint32 GetPositionsFormatSizeOf(uint32 format) { switch (format) { case eNoCompress: case eNoCompressVec3: ...
ation; case eByte: return new ByteKeyTimesInformation; case eBitset: return new CKeyTimesInformationBitSet; } return 0; } const uint8 m_byteLowBit[byteArraySize] _ALIGN(16) = { 8,...
h (format) { case eF32: return sizeof(float); case eUINT16: return sizeof(uint16); case eByte: return sizeof(uint8); case eF32StartStop: return sizeof(float); case eUINT16StartStop: return sizeof(uint16); ...
random
[]
C++
qtmultimedia/src/plugins/gstreamer/camerabin/camerabinrecorder.cpp
wgnet/wds_qt
8db722fd367d2d0744decf99ac7bafaba8b8a3d3
#include "camerabinrecorder.h" #include "camerabincontrol.h" #include "camerabinresourcepolicy.h" #include "camerabinaudioencoder.h" #include "camerabinvideoencoder.h" #include "camerabincontainer.h" #include <QtCore/QDebug> QT_BEGIN_NAMESPACE CameraBinRecorder::CameraBinRecorder(CameraBinSession *session) :QMe...
#include "camerabinrecorder.h" #include "camerabincontrol.h" #include "camerabinresourcepolicy.h" #include "camerabinaudioencoder.h" #include "camerabinvideoencoder.h" #include "camerabincontainer.h" #include <QtCore/QDebug> QT_BEGIN_NAMESPACE CameraBinRecorder::CameraBinRecorder(CameraBinSession *session) :QMe...
} if (m_state != oldState) emit stateChanged(m_state); if (m_status != oldStatus) emit statusChanged(m_status); } bool CameraBinRecorder::isMuted() const { return m_session->isMuted(); } qreal CameraBinRecorder::volume() const { return 1.0; } void CameraBinRecorder::setMuted(bo...
if (m_session->status() != QCamera::ActiveStatus) { emit error(QMediaRecorder::ResourceError, tr("Service has not been started")); } else if (!m_session->cameraControl()->resourcePolicy()->canCapture()) { emit error(QMediaRecorder::ResourceError, tr("Recording permissions are not availab...
if_condition
[]
C++
camera/hal/test/v4l2/src/pipeline_test.cpp
openharmony-gitee-mirror/drivers_peripheral
4ee6d41befdf54a97afeb5838be5fcd0b4888d56
#include "pipeline_test.h" void UtestPipelineTest::SetUpTestCase(void) {} void UtestPipelineTest::TearDownTestCase(void) {} void UtestPipelineTest::SetUp(void) { if (display_ == nullptr) display_ = std::make_shared<TestDisplay>(); display_->FBInit(); display_->Init(); } void UtestPipelineTest::TearDow...
#include "pipeline_test.h" void UtestPipelineTest::SetUpTestCase(void) {} void UtestPipelineTest::TearDownTestCase(void) {} void UtestPipelineTest::SetUp(void) { if (display_ == nullptr) display_ = std::make_shared<TestDisplay>(); display_->FBInit(); display_->Init(); } void UtestPipelineTest::TearDow...
TEST_F(UtestPipelineTest, camera_ppl_0002) { std::cout << "==========[test log] Check ppl: preview + capture success." << std::endl; display_->AchieveStreamOperator(); display_->intents = {Camera::PREVIEW, Camera::STILL_CAPTURE}; display_->StartStream(display_->intents); display_->S...
TEST_F(UtestPipelineTest, camera_ppl_0001) { std::cout << "==========[test log] Check ppl: preview success." << std::endl; display_->AchieveStreamOperator(); display_->intents = {Camera::PREVIEW}; display_->StartStream(display_->intents); display_->StartCapture(display_->streamId_prev...
function_block-full_function
[ { "content": "struct IWiFi *g_wifi = nullptr;\n\nconst int32_t WLAN_TX_POWER = 160;\n\nconst uint32_t WLAN_MIN_CHIPID = 0;\n\nconst uint32_t WLAN_MAX_CHIPID = 2;\n\nconst uint32_t IFNAME_MIN_NUM = 0;\n\nconst uint32_t IFNAME_MAX_NUM = 32;\n\nconst uint32_t MAX_IF_NAME_LENGTH = 16;\n\nconst uint32_t SIZE = 4;\n\...
C++
src/type3_AndroidCloud/anbox-master/external/process-cpp-minimal/src/core/posix/child_process.cpp
akraino-edge-stack/iec
b01bce6165ef8368a607e17e1f3d4697b79db31b
#include <core/posix/child_process.h> #ifndef ANDROID #include <boost/iostreams/device/file_descriptor.hpp> #include <boost/iostreams/stream.hpp> #endif #include <atomic> #include <fstream> #include <mutex> #include <unordered_map> #include <fcntl.h> #include <poll.h> #include <unistd.h> #include <sys/eventfd.h> ...
#include <core/posix/child_process.h> #ifndef ANDROID #include <boost/iostreams/device/file_descriptor.hpp> #include <boost/iostreams/stream.hpp> #endif #include <atomic> #include <fstream> #include <mutex> #include <unordered_map> #include <fcntl.h> #include <poll.h> #include <unistd.h> #include <sys/eventfd.h> ...
bool add(const core::posix::ChildProcess& process) override { if (process.pid() == -1) return false; std::lock_guard<std::mutex> lg(guard); bool added = false; auto new_process = std::make_pair(process.pid(), process); std::tie(std::ignore, added) = childr...
DeathObserverImpl(const std::shared_ptr<core::posix::SignalTrap>& trap) : on_sig_child_connection { trap->signal_raised().connect([this](core::posix::Signal signal) { switch (signal) { case core::posix::Signal::sig_chld:...
function_block-full_function
[ { "content": "struct CORE_POSIX_DLL_PUBLIC Stat\n\n{\n\n pid_t pid = 1; ///< The process ID\n\n std::string executable; ///< The filename of the executable, in parentheses.\n\n State state = State::undefined; ///< State of the process.\n\n pid_t parent = -1; ///< The PID of the parent.\n\n pid_t ...
C++
gmsh/Mesh/meshGRegionCarveHole.cpp
Poofee/fastFEM
14eb626df973e2123604041451912c867ab7188c
#include <set> #include "GmshConfig.h" #include "GmshMessage.h" #include "GModel.h" #include "MTriangle.h" #include "MQuadrangle.h" #include "MTetrahedron.h" #include "MHexahedron.h" #include "MPrism.h" #include "MPyramid.h" #if !defined(HAVE_ANN) void carveHole(GRegion *gr, int num, double distance, ...
#include <set> #include "GmshConfig.h" #include "GmshMessage.h" #include "GModel.h" #include "MTriangle.h" #include "MQuadrangle.h" #include "MTetrahedron.h" #include "MHexahedron.h" #include "MPrism.h" #include "MPyramid.h" #if !defined(HAVE_ANN) void carveHole(GRegion *gr, int num, double distance, ...
; } } #endif
gf->quadrangles.push_back( new MQuadrangle(it->getVertex(0), it->getVertex(1), it->getVertex(2), it->getVertex(3)))
call_expression
[ { "content": "class GFace;\n", "file_path": "gmsh/Mesh/meshGFace.h", "rank": 0, "score": 346488.86100550985 }, { "content": "class GFace;\n\n\n\nvoid meshGFaceBamg(GFace *gf);\n\n\n\n#endif\n", "file_path": "gmsh/Mesh/meshGFaceBamg.h", "rank": 1, "score": 339593.6655204776 }, ...
C++
Clients/OIViewer/ConfigurationLoader.cpp
OpenImageViewer/OIV
7b2b67ea156255bf77819ce77bf687c9d360e217
#include "ConfigurationLoader.h" #include <LLUtils/FileHelper.h> #include <LLUtils/PlatformUtility.h> #include <LLUtils/Exception.h> #include <LLUtils/Logging/Logger.h> #include <nlohmann/json.hpp> #include <stack> namespace OIV { ConfigurationLoader::CommandGroupList ConfigurationLoader::LoadCommandGroups() { usi...
#include "ConfigurationLoader.h" #include <LLUtils/FileHelper.h> #include <LLUtils/PlatformUtility.h> #include <LLUtils/Exception.h> #include <LLUtils/Logging/Logger.h> #include <nlohmann/json.hpp> #include <stack> namespace OIV {
ConfigurationLoader::KeyBindingList ConfigurationLoader::LoadKeyBindings() { using namespace nlohmann; using namespace LLUtils; std::string jsonText = File::ReadAllText<std::string>(LLUtils::PlatformUtility::GetExeFolder() + LLUTILS_TEXT("./Resources/Configuration/KeyBindings.json")); auto jsonObject = jso...
ConfigurationLoader::CommandGroupList ConfigurationLoader::LoadCommandGroups() { using namespace nlohmann; using namespace LLUtils; std::string jsonText = File::ReadAllText<std::string>(LLUtils::PlatformUtility::GetExeFolder() + LLUTILS_TEXT("./Resources/Configuration/Commands.json")); auto jsonObject = json:...
function_block-full_function
[ { "content": "namespace OIV\n\n{\n\n struct SelectionRect\n\n {\n\n LLUtils::PointI32 p0;\n\n LLUtils::PointI32 p1;\n\n };\n\n\n\n struct ViewParameters\n\n {\n\n LLUtils::PointI32 uViewportSize;\n\n LLUtils::Color uTransparencyColor1;\n\n LLUtils::Color uTransp...
C++
dependencies/PyMesh/tools/MeshUtils/DegeneratedTriangleRemoval.cpp
aprieels/3D-watermarking-spectral-decomposition
dcab78857d0bb201563014e58900917545ed4673
#include "DegeneratedTriangleRemoval.h" #include <cassert> #include <iostream> #include <limits> #include <set> #include <vector> #include <Math/MatrixUtils.h> #include <MeshUtils/FaceUtils.h> #include <MeshUtils/IsolatedVertexRemoval.h> #include <MeshUtils/ShortEdgeRemoval.h> #include <Predicates/predicates.h> usin...
#include "DegeneratedTriangleRemoval.h" #include <cassert> #include <iostream> #include <limits> #include <set> #include <vector> #include <Math/MatrixUtils.h> #include <MeshUtils/FaceUtils.h> #include <MeshUtils/IsolatedVertexRemoval.h> #include <MeshUtils/ShortEdgeRemoval.h> #include <Predicates/predicates.h> usin...
} assert(fj_opp_v != INVALID); const size_t vj_opp = neighbor_face[fj_opp_v]; const size_t vj_0 = neighbor_face[(fj_opp_v+1)%3]; const size_t vj_1 = neighbor_face[(fj_opp_v+2)%3]; new_faces.push_back(Vector3I(vi_opp, vj_opp, vj_0)); ne...
if (neighbor_face[i] != vi_0 && neighbor_face[i] != vi_1) { fj_opp_v = i; break; }
if_condition
[ { "content": "struct RemoveConst<const T[N]> {\n\n typedef typename RemoveConst<T>::type type[N];\n\n};\n\n\n\n#if defined(_MSC_VER) && _MSC_VER < 1400\n\n// This is the only specialization that allows VC++ 7.1 to remove const in\n\n// 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC\n...
C++
Sandbox/src/Sandbox2D.cpp
SunHailang/Hazel
1b4784c8d6bd2ad402ded34d677fd482a81a9d72
#include "Sandbox2D.h" #include <imgui/imgui.h> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> static const char* s_MapTiles = "lajksdasd"; Sandbox2D::Sandbox2D() :Hazel::Layer("Sandbox2D"), m_CameraController(1280.0f / 720.0f, true) { } void Sandbox2D::OnAttach() { H...
#include "Sandbox2D.h" #include <imgui/imgui.h> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> static const char* s_MapTiles = "lajksdasd"; Sandbox2D::Sandbox2D() :Hazel::Layer("Sandbox2D"), m_CameraController(1280.0f / 720.0f, true) { } void Sandbox2D::OnAttach() { H...
tWindow().GetWidth(); auto height = Hazel::Application::Get().GetWindow().GetHeight(); auto bounds = m_CameraController.GetBounds(); auto pos = m_CameraController.GetCamera().GetPosition(); x = (x / width) * bounds.GetWidth() - bounds.GetWidth() * 0.5f; y = bounds.GetHeight() * 0.5f - (y / height) * ...
OnUpdate(ts); Hazel::Renderer2D::ResetStats(); { HZ_PROFILE_SCOPE("Renderer Prep"); Hazel::RendererCommand::SetClearColor(glm::vec4(0.2f, 0.2f, 0.2f, 1.0f)); Hazel::RendererCommand::Clear(); } { } if (Hazel::Input::IsMouseButtonPres...
random
[ { "content": "#include \"hzpch.h\"\n\n#include \"OpenGLFramebuffer.h\"\n\n\n\n#include <glad/glad.h>\n\n\n\nnamespace Hazel\n\n{\n\n\n\n\tstatic const uint32_t s_MaxFramebufferSize = 8192;\n\n\n\n\tnamespace Utils {\n\n\n\n\t\tstatic GLenum TextureTarget(bool multisampled)\n\n\t\t{\n\n\t\t\treturn multisampled ...
C++
src/vm/vm_detect.cpp
bouldev/libbouldev
afe0d5dca71d4f9c94b11273c4884a92f2549df8
#include <libbouldev.h> #include <string> #ifdef _WIN32 #include "stdafx.h" #include <iostream> #include <Wbemidl.h> #pragma comment(lib, "wbemuuid.lib") #endif #ifdef _WIN32 static bool InitWMI(IWbemServices **pSvc, IWbemLocator **pLoc, const TCHAR* szNetworkResource) { HRESULT hres; hres = CoInitializeEx(0, COIN...
#include <libbouldev.h> #include <string> #ifdef _WIN32 #include "stdafx.h" #include <iostream> #include <Wbemidl.h> #pragma comment(lib, "wbemuuid.lib") #endif #ifdef _WIN32 static bool InitWMI(IWbemServices **pSvc, IWbemLocator **pLoc, const TCHAR* szNetworkResource) { HRESULT hres; hres = CoInitializeEx(0, COIN...
static int wmi_query_count(const _TCHAR* query) { IWbemServices *pSvc = NULL; IWbemLocator *pLoc = NULL; IEnumWbemClassObject* pEnumerator = NULL; BOOL bStatus = FALSE; HRESULT hRes; int count = 0; bStatus = InitWMI(&pSvc, &pLoc, _T("ROOT\\CIMV2")); if (bStatus) { bStatus =...
cString(szQuery); BOOL bQueryResult = TRUE; if (strQueryLanguage && strQuery) HRESULT hres = (*pSvc)->ExecQuery(strQueryLanguage, strQuery, WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, pEnumerator); if (strQueryLanguage) SysFreeString(strQueryLanguage); if (strQuery) SysFreeString(strQuery); return...
function_block-function_prefixed
[ { "content": "\tchar *out; // stdout buffer\n", "file_path": "src/common/libbouldev_private.h", "rank": 6, "score": 1.5771744743371818 } ]
C++
argos3/src/plugins/robots/generic/simulator/radios_default_sensor.cpp
yiftachn/krembot_sim_fork
d3d1b050f9fff4c96bded298eadde5a9ca4dab6b
#include "radios_default_sensor.h" #include <argos3/plugins/simulator/entities/radio_equipped_entity.h> namespace argos { CRadiosDefaultSensor::CRadiosDefaultSensor() : m_pcRadioEquippedEntity(nullptr), m_pcControllableEntity(nullptr), m_bShowRays(false) {} void CRadiosDef...
#include "radios_default_sensor.h" #include <argos3/plugins/simulator/entities/radio_equipped_entity.h> namespace argos { CRadiosDefaultSensor::CRadiosDefaultSensor() : m_pcRadioEquippedEntity(nullptr), m_pcControllableEntity(nullptr), m_bShowRays(false) {} void CRadiosDef...
REGISTER_SENSOR(CRadiosDefaultSensor, "radios", "default", "Michael Allwright [allsey87@gmail.com]", "1.0", "A generic radio sensor to receive messages from nearby radios.", "This radio sensor implementation al...
CRadiosDefaultSensor::Reset() { for(SInterface& s_interface : m_vecInterfaces) { s_interface.Data.clear(); } }
function_block-function_prefixed
[ { "content": " class CRadiosDefaultSensor;\n\n}\n\n\n\n#include <argos3/core/simulator/sensor.h>\n\n#include <argos3/plugins/robots/generic/control_interface/ci_radios_sensor.h>\n\n#include <argos3/plugins/simulator/entities/radio_equipped_entity.h>\n\n\n\nnamespace argos {\n\n\n", "file_path": "argos3/sr...
C++
Studio/src/Application/Groom/GroomTool.cc
amylenz/ShapeWorks
78c2ee067a23e31f5b83d0121e60addb1b0bf462
#include <iostream> #include <QXmlStreamWriter> #include <QTemporaryFile> #include <QFileDialog> #include <QMessageBox> #include <QThread> #include <Groom/GroomTool.h> #include <Visualization/ShapeworksWorker.h> #include <Data/Project.h> #include <Data/Mesh.h> #include <Data/Shape.h> #include <ui_GroomTool.h> Groom...
#include <iostream> #include <QXmlStreamWriter> #include <QTemporaryFile> #include <QFileDialog> #include <QMessageBox> #include <QThread> #include <Groom/GroomTool.h> #include <Visualization/ShapeworksWorker.h> #include <Data/Project.h> #include <Data/Mesh.h> #include <Data/Shape.h> #include <ui_GroomTool.h>
GroomTool::~GroomTool() {} void GroomTool::on_antialias_checkbox_stateChanged(int state) { this->ui_->antialias_groupbox->setEnabled(state); } void GroomTool::on_blur_checkbox_stateChanged(int state) { this->ui_->blur_groupbox->setEnabled(state); } void GroomTool::on_autopad_checkbox_stateChanged(int state) { ...
GroomTool::GroomTool(Preferences& prefs, std::vector<std::string>& files) : preferences_(prefs), files_(files) { this->ui_ = new Ui_GroomTool; this->ui_->setupUi(this); qRegisterMetaType<std::string>(); }
function_block-full_function
[ { "content": "// Constrained Delaunay Triangulation types\n\n#include <CGAL/Constrained_Delaunay_triangulation_2.h>\n\n#include <CGAL/Constrained_triangulation_plus_2.h>\n\n\n\n// Axis-align boxes for all-pairs self-intersection detection\n\n#include <CGAL/point_generators_3.h>\n\n#include <CGAL/Bbox_3.h>\n\n#i...
C++
owGame/M2/M2_AnimatorComponent.cpp
Chaos192/OpenWow
1d91a51fafeedadc67122a3e9372ec4637a48434
#include "stdafx.h" #include "M2.h" #include "M2_Base_Instance.h" #include "M2_AnimatorComponent.h" CM2AnimatorComponent::CM2AnimatorComponent(const CM2_Base_Instance& OwnerNode) : CSceneNodeComponentBase(OwnerNode) , m_CurrentAnimationID(EAnimationID::Stand) , m_CurrentAnimation(nullptr) , m_IsLoop(false) ...
#include "stdafx.h" #include "M2.h" #include "M2_Base_Instance.h" #include "M2_AnimatorComponent.h" CM2AnimatorComponent::CM2AnimatorComponent(const CM2_Base_Instance& OwnerNode) : CSceneNodeComponentBase(OwnerNode) , m_CurrentAnimationID(EAnimationID::Stand) , m_CurrentAnimation(nullptr) , m_IsLoop(false) ...
const CM2_Base_Instance & CM2AnimatorComponent::GetM2OwnerNode() const { return dynamic_cast<const CM2_Base_Instance&>(GetOwnerNode()); }
void CM2AnimatorComponent::Update(const UpdateEventArgs & e) { if (m_CurrentAnimation == nullptr) return; if (m_IsStopped) return; m_AnimTime += e.DeltaTime; m_CurrentTime = m_CurrentAnimation->getStart() + static_cast<uint32>(m_AnimTime); if (m_CurrentTime < m_CurrentAnimation->getEnd()) { return; } ...
function_block-full_function
[ { "content": "enum Opcodes : uint16\n\n{\n\n\tNULL_ACTION = 0x000,\n\n\tCMSG_BOOTME = 0x001,\n\n\tCMSG_DBLOOKUP = 0x002,\n\n\tSMSG_DBLOOKUP = 0x003,\n\n\tCMSG_QUERY_OBJECT_POSITION = 0x004,\n\n\tSMSG_QUERY_OBJECT_POSITION = 0x005,\n\n\tCMSG_QUERY_OBJECT_ROTATION = 0x006,\n\n\tSMSG_QUERY_OBJECT_ROTATION = 0x007,...
C++
src/mame/audio/dsbz80.cpp
Robbbert/messui
49b756e2140d8831bc81335298ee8c5471045e79
#include "emu.h" #include "audio/dsbz80.h" #include "machine/clock.h" #define Z80_TAG "mpegcpu" void dsbz80_device::dsbz80_map(address_map &map) { map(0x0000, 0x7fff).rom().region(":mpegcpu", 0); map(0x8000, 0xffff).ram(); } void dsbz80_device::dsbz80io_map(address_map &map) { map.global_mask(0xff); map(0xe0, ...
#include "emu.h" #include "audio/dsbz80.h" #include "machine/clock.h" #define Z80_TAG "mpegcpu" void dsbz80_device::dsbz80_map(address_map &map) { map(0x0000, 0x7fff).rom().region(":mpegcpu", 0); map(0x8000, 0xffff).ram(); } void dsbz80_device::dsbz80io_map(address_map &map) { map.global_mask(0xff); map(0xe0, ...
ampindex++; break; } audio_pos++; samples--; } if(!samples) { break; } if(mp_state == 0) { out_l.fill(0, sampindex); out_r.fill(0, sampindex); break; } else { int sample_rate, channel_count; bool ok = decoder->decode_buffer(mp_pos, mp_end*8, audio_buf, audio_avail, s...
break; case 2: out_l.put_int(sampindex, audio_buf[audio_pos*2+1], 32768); out_r.put_int(sampindex, audio_buf[audio_pos*2+1], 32768); s
random
[]
C++
Charts/Core/Testing/Cxx/TestPlotBarRangeHandlesItem.cxx
cclauss/VTK
f62a52cce9044159efb4adb7cc0cfd7ec0bc8b6d
#include <vtkAxis.h> #include <vtkChartXY.h> #include <vtkContextInteractorStyle.h> #include <vtkContextScene.h> #include <vtkIntArray.h> #include <vtkInteractorEventRecorder.h> #include <vtkNew.h> #include <vtkPlotBar.h> #include <vtkPlotBarRangeHandlesItem.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInte...
#include <vtkAxis.h> #include <vtkChartXY.h> #include <vtkContextInteractorStyle.h> #include <vtkContextScene.h> #include <vtkIntArray.h> #include <vtkInteractorEventRecorder.h> #include <vtkNew.h> #include <vtkPlotBar.h> #include <vtkPlotBarRangeHandlesItem.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInte...
ventSpy[event] = 0; } ++this->EventSpy[event]; std::cout << "InvokedEvent: " << event << this->EventSpy[event] << std::endl; } std::map<unsigned long, int> EventSpy; double Range[2]; }; int TestPlotBarRangeHandlesItem(int, char*[]) { vtkNew<vtkTable> table; vtkNew<vtkIntArray> arrMonth; arrMon...
andlesItem::SafeDownCast(caller); if (!self) { return; } if (event == vtkCommand::EndInteractionEvent) { self->GetHandlesRange(this->Range); } if (this->EventSpy.count(event) == 0) { this->E
random
[]
C++
uuv_gazebo_plugins/uuv_gazebo_ros_plugins/src/ThrusterROSPlugin.cpp
MoMagDii/VAUV-simulator
56f55f9349e38e0a327a40feb5a437fcad511b00
#include <uuv_gazebo_ros_plugins/ThrusterROSPlugin.h> #include <string> #include <gazebo/physics/Base.hh> #include <gazebo/physics/Link.hh> #include <gazebo/physics/Model.hh> #include <gazebo/physics/World.hh> #include <uuv_gazebo_ros_plugins_msgs/msg/float_stamped.hpp> namespace uuv_simulator_ros { ThrusterROSP...
#include <uuv_gazebo_ros_plugins/ThrusterROSPlugin.h> #include <string> #include <gazebo/physics/Base.hh> #include <gazebo/physics/Link.hh> #include <gazebo/physics/Model.hh> #include <gazebo/physics/World.hh> #include <uuv_gazebo_ros_plugins_msgs/msg/float_stamped.hpp> namespace uuv_simulator_ros { ThrusterROSP...
; myPubThrust = myRosNode->create_publisher< uuv_gazebo_ros_plugins_msgs::msg::FloatStamped >(this->thrustTopicPublisher->GetTopic(), 10); myPubThrustWrench = myRosNode->create_publisher<geometry_msgs::msg::WrenchStamped>( this->thrustTopicPublisher->GetTopic() + "_wrench", 10); ...
myRosNode->create_subscription< uuv_gazebo_ros_plugins_msgs::msg::FloatStamped >(this->commandSubscriber->GetTopic(), 10, std::bind(&ThrusterROSPlugin::SetThrustReference, this, _1))
call_expression
[ { "content": "/// \\brief Gazebo model plugin class for underwater objects\n\nclass UnderwaterObjectPlugin : public gazebo::ModelPlugin\n\n{\n\n /// \\brief Constructor\n\n public: UnderwaterObjectPlugin();\n\n\n\n /// \\brief Destructor\n\n public: virtual ~UnderwaterObjectPlugin();\n\n\n\n // Documentati...
C++
src/publishers/EnviroDIYPublisher.cpp
ssuttles-usgs/ModularSensors
8bc62eb7705729e47e4a47a6b2f02dab955b63f8
#include "EnviroDIYPublisher.h" const char *EnviroDIYPublisher::postEndpoint = "/api/data-stream/"; const char *EnviroDIYPublisher::enviroDIYHost = "data.envirodiy.org"; const int EnviroDIYPublisher::enviroDIYPort = 80; const char *EnviroDIYPublisher::tokenHeader = "\r\nTOKEN: "; const char *EnviroDIYPublisher::con...
#include "EnviroDIYPublisher.h" const char *EnviroDIYPublisher::postEndpoint = "/api/data-stream/"; const char *EnviroDIYPublisher::enviroDIYHost = "data.envirodiy.org"; const int EnviroDIYPublisher::enviroDIYPort = 80; const char *EnviroDIYPublisher::tokenHeader = "\r\nTOKEN: "; const char *EnviroDIYPublisher::con...
- Response Code --")); PRINTOUT(responseCode); return responseCode; }
txBuffer[strlen(txBuffer)] = '"'; txBuffer[strlen(txBuffer)] = ':'; _baseLogger->getValueStringAtI(i).toCharArray(tempBuffer, 37); strcat(txBuffer, tempBuffer); if (i + 1 != _baseLogger->getArrayVarCount()) { txBuffer[strlen(txBuffer)]...
random
[ { "content": " // Returns the data destination\n\n virtual String getEndpoint(void){return String(enviroDIYHost);}\n\n\n\n // Adds the site registration token\n\n void setToken(const char *registrationToken);\n\n\n\n // Calculates how long the JSON will be\n\n uint16_t calculateJsonSize();\n\n...
C++
third_party/blink/renderer/core/layout/ng/ng_relative_utils_test.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
#include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" #include "third_party/blink/renderer/core/layout/geometry/physical_size.h" #include "third_party/blink/renderer/core/sty...
#include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" #include "third_party/blink/renderer/core/layout/geometry/physical_size.h" #include "third_party/blink/renderer/core/sty...
scoped_refptr<ComputedStyle> style_; LogicalSize container_size_; }; TEST_F(NGRelativeUtilsTest, HorizontalTB) { LogicalOffset offset; SetTRBL(kAuto, kAuto, kAuto, kAuto); offset = ComputeRelativeOffset( *style_, {WritingMode::kHorizontalTb, TextDirection::kLtr}, container_size_); EXPECT_...
void SetTRBL(LayoutUnit top, LayoutUnit right, LayoutUnit bottom, LayoutUnit left) { style_->SetTop(top == kAuto ? Length::Auto() : Length::Fixed(top.ToInt())); style_->SetRight(right == kAuto ? Length::Auto() : Length::Fixed(right...
function_block-full_function
[]
C++
v8bridge/userland/userland_class.hpp
QuartzTechnologies/v8bridge
5e2f2d6b93adae25295b88c0c4e0eb4f93e22057
#ifndef BOOST_PP_IS_ITERATING # ifndef v8bridge_userland_class_hpp # define v8bridge_userland_class_hpp # include <stdexcept> # include <v8bridge/detail/prefix.hpp> # include <v8bridge/conversion.hpp> # include <v8bridge/userland/userland_instance.hpp> # include <boost/prepro...
#ifndef BOOST_PP_IS_ITERATING # ifndef v8bridge_userland_class_hpp # define v8bridge_userland_class_hpp # include <stdexcept> # include <v8bridge/detail/prefix.hpp> # include <v8bridge/conversion.hpp> # include <v8bridge/userland/userland_instance.hpp> # include <boost/prepro...
function returned value does not match the specified TResult (" << TypeId<TResult>().name() << ")."; throw std::runtime_error(io.str()); } return result; } template <class TResult, BOOST_PP_ENUM_PARAMS(N, class TClass) > inline typename boost::enable_if< boost::is_same<TResult, void>, TResult >::...
for (TInstancesList::iterator it = this->m_instances->begin(); it != this->m_instances->end(); ++it) { (*it).reset(); } this->m_instances->clear(); } inline Local<Function> getCtorFu...
random
[ { "content": " class V8_DECL NativeClass : public NativeEndpoint\n\n {\n\n public:\n\n NativeClass(Isolate *isolationScope) : NativeEndpoint(isolationScope),\n\n m_ctor(new NativeCtor(isolationScope)),\n\n m_methods(new TMethodsMap()),\n\n m_stati...
C++
ModelTakuzu.cpp
Ezryuk/Takuzu
6dd94470c15c0071ca210a9655eb85d8458163c3
#include "ModelTakuzu.h" #include <cassert> #include <iostream> #include <QtAlgorithms> #include <QFile> #include <QTextStream> ModelTakuzu::ModelTakuzu() { _nbMaps = -1; _sizeMap = -1; _grids = nullptr; } ModelTakuzu::~ModelTakuzu() { delete[] _grids; } Pawn ModelTakuzu::permuteR(Pawn p) { if (...
#include "ModelTakuzu.h" #include <cassert> #include <iostream> #include <QtAlgorithms> #include <QFile> #include <QTextStream> ModelTakuzu::ModelTakuzu() { _nbMaps = -1; _sizeMap = -1; _grids = nullptr; } ModelTakuzu::~ModelTakuzu() { delete[] _grids; } Pawn ModelTakuzu::permuteR(Pawn p) { if (...
; return (std::all_of(_currentGrid.begin(), _currentGrid.end(), [](Pawn p)->bool { return (p != Empty);}) && std::all_of(isValid.begin(), isValid.end(), [](bool b)-> bool {return b;}) && std::all_of(counterOcc.begin(), counterOcc.end(), [this](int v) -> bool {return (...
std::for_each(rowsAndCols.begin(), rowsAndCols.end(), [&counterOcc](std::vector<Pawn> &vec) -> void { counterOcc.push_back(std::count(vec.begin(), vec.end(), Black)); counterOcc.push_back(std::count(vec.begin(), vec.end(), White)); })
call_expression
[ { "content": "enum Pawn : unsigned char { Empty, Black, White};\n\nusing Grid_ = std::vector<Pawn>;\n\n\n", "file_path": "ModelTakuzu.h", "rank": 0, "score": 86767.76155417053 }, { "content": " void updateCount(int i, int j, Pawn oldPawn, Pawn newPawn);\n\n Pawn getPawn(int i, int j) c...
C++
hardware/interface/power/Power.cpp
aospwhatawurst/aosp_android_device_samsung_exynos9820-common
77fe612901d6133d2734619cd3d1e86f6e7f0200
#define LOG_TAG "power@1.0-exynos9820" #include <android-base/logging.h> #include <android-base/file.h> #include <android-base/properties.h> #include <android-base/strings.h> #include "Power.h" #include <tsp.h> #include <iostream> namespace android { namespace hardware { namespace power { namespace V1_0 { namesp...
#define LOG_TAG "power@1.0-exynos9820" #include <android-base/logging.h> #include <android-base/file.h> #include <android-base/properties.h> #include <android-base/strings.h> #include "Power.h" #include <tsp.h> #include <iostream> namespace android { namespace hardware { namespace power { namespace V1_0 { namesp...
Return<void> Power::setInteractive(bool interactive) { writeNode("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", interactive ? "1950000" : "1053000"); if (mDoubleTapEnabled && !interactive) { tsp_enable_doubletap(); } for (size_t i = 0; i < mInteractiveNodes....
Power::Power() { size_t inode_size = ARRAY_SIZE(interactive_node_paths); mInteractionHandler.Init(); mEpic.Init(); tsp_init(); LOG(DEBUG) << "Looking for touchsceen/lcd nodes"; for (size_t i = 0; i < inode_size; i++) { std::string node_path = interactive_node_paths[i]; i...
function_block-full_function
[ { "content": "namespace android {\n\nnamespace hardware {\n\nnamespace power {\n\nnamespace V1_0 {\n\nnamespace implementation {\n\n\n\nusing ::android::hardware::power::V1_0::Feature;\n\nusing ::android::hardware::power::V1_0::PowerHint;\n\nusing ::android::hardware::power::V1_0::IPower;\n\nusing ::android::ha...
C++
Src/Qt/qwt/src/qwt_spline.cpp
iclosure/smartsoft
62eaed49efd8306642b928ef4f2d96e36aca6527
#include "precomp.h" #include "qwt_spline.h" #include "qwt_math.h" class QwtSpline::PrivateData { public: PrivateData(): splineType( QwtSpline::Natural ) { } QwtSpline::SplineType splineType; QVector<double> a; QVector<double> b; QVector<double> c; QPolygonF points...
#include "precomp.h" #include "qwt_spline.h" #include "qwt_math.h" class QwtSpline::PrivateData { public: PrivateData(): splineType( QwtSpline::Natural ) { } QwtSpline::SplineType splineType; QVector<double> a; QVector<double> b; QVector<double> c; QPolygonF points...
QwtSpline::QwtSpline() { d_data = new PrivateData; } QwtSpline::QwtSpline( const QwtSpline& other ) { d_data = new PrivateData( *other.d_data ); } QwtSpline &QwtSpline::operator=( const QwtSpline & other ) { *d_data = *other.d_data; return *this; } QwtSpline::~QwtSpline() { delete d_data; } vo...
i1 = 0; int i2 = size - 2; int i3 = 0; while ( i2 - i1 > 1 ) { i3 = i1 + ( ( i2 - i1 ) >> 1 ); if ( values[i3].x() > x ) i2 = i3; else i1 = i3; } } return i1; }
function_block-function_prefix_line
[ { "content": "class BCGCBPRODLLEXPORT CBCGPPointsArray : public CArray<CBCGPPoint, const CBCGPPoint&>\n\n{\n\npublic:\n\n\tCBCGPPointsArray() {}\n\n\tCBCGPPointsArray(int nNewSize, int nGrowBy = -1)\n\n\t{\n\n\t\tSetSize(nNewSize, nGrowBy);\n\n\t}\n\n\n\n\t~CBCGPPointsArray() {}\n\n\n\n\tCBCGPRect GetBoundsRect...
C++
src/client/commands/CmdBase.cpp
lclc/opentxs
0bc847c6601d20e3346bb2faf81feda3a14ab303
#include "CmdBase.hpp" #include "../ot_made_easy_ot.hpp" #include <opentxs/client/ot_otapi_ot.hpp> #include "../ot_utility_ot.hpp" #include <opentxs/client/OpenTransactions.hpp> #include <opentxs/client/OTAPI.hpp> #include <opentxs/client/OTWallet.hpp> #include <opentxs/core/Account.hpp> #include <opentxs/core/Asse...
#include "CmdBase.hpp" #include "../ot_made_easy_ot.hpp" #include <opentxs/client/ot_otapi_ot.hpp> #include "../ot_utility_ot.hpp" #include <opentxs/client/OpenTransactions.hpp> #include <opentxs/client/OTAPI.hpp> #include <opentxs/client/OTWallet.hpp> #include <opentxs/core/Account.hpp> #include <opentxs/core/Asse...
Category CmdBase::getCategory() const { return category; } const char* CmdBase::getCommand() const { return command; } const char* CmdBase::getHelp() const { return help; } string CmdBase::getAccountAssetType(const string& myacct) const { string assetType = OTAPI_Wrap::GetAccountWallet_AssetTypeID(...
string CmdBase::formatAmount(const string& assetType, int64_t amount) const { if (OT_ERROR_AMOUNT == amount) { return "UNKNOWN_AMOUNT"; } if ("" == assetType) { return to_string(amount); } return OTAPI_Wrap::FormatAmount(assetType, amount); }
function_block-function_prefix_line
[ { "content": "class String;\n", "file_path": "include/opentxs/core/Account.hpp", "rank": 0, "score": 273173.24958394736 }, { "content": "class Account;\n", "file_path": "include/opentxs/server/Transactor.hpp", "rank": 1, "score": 272706.39791854477 }, { "content": "class ...