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++
lib/src/Core/AnimatedEntity.cpp
emilhornlund/DV1537Project-AlienAdventure
b370e49d259ee722edd6f39c979824280522076a
#include <Core/AnimatedEntity.hpp> #include <Core/Animation.hpp> #include <SFML/Graphics/RenderStates.hpp> #include <SFML/Graphics/RenderTarget.hpp> CGL::AnimatedEntity::AnimatedEntity(const bool paused) : m_animation(nullptr), m_currentFrame(0), ...
#include <Core/AnimatedEntity.hpp> #include <Core/Animation.hpp> #include <SFML/Graphics/RenderStates.hpp> #include <SFML/Graphics/RenderTarget.hpp> CGL::AnimatedEntity::AnimatedEntity(const bool paused) : m_animation(nullptr), m_currentFrame(0), ...
void CGL::AnimatedEntity::update(sf::Time deltaTime) { if (!this->m_isPaused && this->m_animation) { this->m_currentTime += deltaTime; if (this->m_currentTime >= this->m_animation->getFrameTime()) { this->m_currentTime = sf::microseconds(this->m_currentTime.asMicroseconds() % this->m_a...
t>(rect.left) + 0.0001f; float right = left + static_cast<float>(rect.width); float top = static_cast<float>(rect.top); float bottom = top + static_cast<float>(rect.height); this->m_vertices[0].texCoords = sf::Vector2f(left, top); this->m_vertices[1].texCoords = sf::Vector2f(lef...
function_block-function_prefixed
[ { "content": " class Animation {\n\n private:\n\n sf::Time m_frameTime;\n\n\n\n bool m_isLooped;\n\n\n\n std::vector<sf::IntRect> m_frames;\n\n\n\n const sf::Texture *m_texture;\n\n\n\n Animation(const Animation &original);\n\n\n\n Animation &operator=(const Anima...
C++
NNet/ModelIO/NNetModelImporter.cpp
pk1954/solutions
02cd67fc1e6299e9fe56ce04dce2515d6f30df92
#include "stdafx.h" #include <filesystem> #include <assert.h> #include "ERRHNDL.H" #include "SignalFactory.h" #include "SignalGenerator.h" #include "UPSigGenList.h" #include "Knot.h" #include "Neuron.h" #include "InputConnector.h" #include "OutputConnector.h" #include "MonitorData.h" #include "NobException.h" #includ...
#include "stdafx.h" #include <filesystem> #include <assert.h> #include "ERRHNDL.H" #include "SignalFactory.h" #include "SignalGenerator.h" #include "UPSigGenList.h" #include "Knot.h" #include "Neuron.h" #include "InputConnector.h" #include "OutputConnector.h" #include "MonitorData.h" #include "NobException.h" #includ...
; } ); } void NNetModelImporter::importModel() { ImportTermination::Result res; Script script; bool bSuccess { false }; if (! m_wstrFile2Read.empty()) { script.SetEcho(true); try { bSuccess = script.ScrProcess...
SymbolTable::ScrDefConst ( ParamType::GetName(param), static_cast<unsigned long>(param) )
call_expression
[ { "content": "class Neuron : public BaseKnot\n\n{\n\npublic:\n\n\tNeuron(MicroMeterPnt const &, NobType const = NobType::Value::neuron);\n\n\tNeuron(BaseKnot const &, NobType const = NobType::Value::neuron);\n\n\tNeuron(Neuron const &); // copy constructor\n\n\n\n\tNeuron & operator=(Neuron con...
C++
hpx/runtime/serialization/map.hpp
akemp/hpx
1ddf7282e322c30d82f2be044071aed14807ebe1
#ifndef HPX_SERIALIZATION_MAP_HPP #define HPX_SERIALIZATION_MAP_HPP #include <map> #include <boost/mpl/and.hpp> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/add_reference.hpp> #include <hpx/runtime/serialization/input_archive.hpp> #include <hpx/runtime/serialization/output_archive.hpp>...
#ifndef HPX_SERIALIZATION_MAP_HPP #define HPX_SERIALIZATION_MAP_HPP #include <map> #include <boost/mpl/and.hpp> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/add_reference.hpp> #include <hpx/runtime/serialization/input_archive.hpp> #include <hpx/runtime/serialization/output_archive.hpp>...
} } template <class Key, class Value> void serialize(input_archive& ar, std::pair<Key, Value>& t, unsigned) { typedef std::pair<Key, Value> pair_type; typedef typename traits::is_bitwise_serializable<pair_type> optimized; detail::load_...
if (!has_array_optimization(ar)) save_pair_impl(ar, t, boost::mpl::false_()); else save_binary(ar, &t, sizeof(std::pair<Key, Value>));
if_condition
[ { "content": " class function<Sig, void, void>\n\n : public detail::basic_function<\n\n detail::function_vtable_ptr<Sig, void, void>\n\n , Sig\n\n >\n\n {\n\n typedef detail::function_vtable_ptr<Sig, void, void> vtable_ptr;\n\n typedef detail::basic_function<v...
C++
native-library/src/util_classes/accessor_base.hpp
AVSystem/Anjay-java
c8f8c5e0ac5a086db4ca183155eed07374fc6585
#pragma once #include "../jni_wrapper.hpp" #include <optional> #include <string> #include <type_traits> #include <unordered_map> #include "./exception.hpp" #include "./optional_tag.hpp" namespace utils { namespace detail { template <class T> struct dependent_false : std::false_type {}; template <typename T> st...
#pragma once #include "../jni_wrapper.hpp" #include <optional> #include <string> #include <type_traits> #include <unordered_map> #include "./exception.hpp" #include "./optional_tag.hpp" namespace utils { namespace detail { template <class T> struct dependent_false : std::false_type {}; template <typename T> st...
template <typename T> auto get_value(const char *field_name) { if constexpr (std::is_same<T, size_t>::value) { auto value = get_impl<jni::jlong>(field_name); if (value < 0) { avs_throw(IllegalArgumentException( env_, ...
std::optional<std::vector<T>> get_optional_array(const char *field_name) { if constexpr (std::is_arithmetic<T>::value) { auto optional_value = get_impl<jni::Object<OptionalTag>>(field_name); auto accessor = AccessorBase<OptionalTag>{ env_, optional_value }; ...
function_block-full_function
[ { "content": "struct ClassCastException : public jni::PendingJavaException {\n\n ClassCastException(JNIEnv &env, const char *str)\n\n : jni::PendingJavaException() {\n\n env.ThrowNew(env.FindClass(\"java/lang/ClassCastException\"), str);\n\n }\n\n\n\n ClassCastException(JNIEnv &env, c...
C++
tools/macpo/tests/integration-tests/itest_harness.cpp
roystgnr/perfexpert
a03b13db9ac83e992e1c5cc3b6e45e52c266fe30
#include <fcntl.h> #include <rose.h> #include <sys/types.h> #include <sys/wait.h> #include <cerrno> #include <fstream> #include <string> #include <vector> #include "generic_defs.h" #include "itest_harness.h" #include "minst.h" bool file_exists(const std::string& filename) { return access(filename.c_str(), F_OK)...
#include <fcntl.h> #include <rose.h> #include <sys/types.h> #include <sys/wait.h> #include <cerrno> #include <fstream> #include <string> #include <vector> #include "generic_defs.h" #include "itest_harness.h" #include "minst.h" bool file_exists(const std::string& filename) { return access(filename.c_str(), F_OK)...
.push_back("-o"); args.push_back(output_file); args.push_back("-lstdc++"); std::string mock_include_path = get_src_directory() + "/../libmrt"; args.push_back("-I" + mock_include_path); args.push_back(get_build_directory() + "/mrt.o"); if (special_args) { args.insert(args.end(), sp...
put_file, std::string& output_file, string_list_t* special_args) { args.push_back("cc"); args.push_back(input_file); args
random
[ { "content": "class FooTest : public ::testing::TestWithParam<const char*> {\n\n // You can implement all the usual class fixture members here.\n\n};\n\n\n\n// Then, use the TEST_P macro to define as many parameterized tests\n\n// for this fixture as you want. The _P suffix is for \"parameterized\"\n\n// or \"...
C++
Common/Loader/ssloader_sspj.cpp
SpriteStudio/SpriteStudio6-SDK
f2ad84c8e3ca9d189904da9c3d1114bb4044eecb
#include "ssloader_sspj.h" #include "ssloader_ssae.h" #include "ssloader_ssce.h" #include "ssloader_ssee.h" #include "ssloader_ssqe.h" #include "ssstring_uty.h" #include "../Helper/DebugPrint.h" #include "sscharconverter.h" namespace spritestudio6 { SsString SsProject::getSsceBasepath(){ return getFullPath( m_pro...
#include "ssloader_sspj.h" #include "ssloader_ssae.h" #include "ssloader_ssce.h" #include "ssloader_ssee.h" #include "ssloader_ssqe.h" #include "ssstring_uty.h" #include "../Helper/DebugPrint.h" #include "sscharconverter.h" namespace spritestudio6 { SsString SsProject::getSsceBasepath(){ return getFullPath( m_pro...
rsion" ); if ( anime ) delete anime; delete proj; return 0; } } std::map<std::string, std::string> textures; for ( size_t i = 0 ;i < proj->getCellMapNum() ; i++ ) { SsString sscepath = SsCharConverter::convert_path_string(proj->getCellMapFilePath(i)); SsCellMap* cell = ssloader_ssce::...
FullPath( m_proj_filepath , settings.animeBaseDirectory ); } SsString SsProject::getImageBasepath() { return getFullPath( m_proj_filepath , settings.imageBaseDirectory ); } SsProject::~SsProject() { for ( SsAnimePackListItr itr = animeList.begin() ; itr != animeList.end() ; itr ++ ) itr->reset(); animeList.clear...
random
[ { "content": "namespace spritestudio6\n\n{\n\n\n\n\n", "file_path": "Common/Animator/ssplayer_types.h", "rank": 0, "score": 87211.16099266979 }, { "content": "namespace spritestudio6\n\n{\n\n\n\n\tconstexpr auto __PI__ = (3.14159265358979323846f);\n\n\t// #define RadianToDegree(Radian) ((dou...
C++
lib/getTunViaUSocket.cpp
xywzwd/VT-Wireless
ec42e742e2be26310df4b25cef9cea873896890b
#include <stdio.h> #include <string.h> #include <signal.h> #include <stdlib.h> #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/wait.h> #include <errno.h> #include <unistd.h> #include "crts/debug.h" #include "getTunViaUSocket.hpp" static int checkHaveRead(int fd, long sec, long usec)...
#include <stdio.h> #include <string.h> #include <signal.h> #include <stdlib.h> #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/wait.h> #include <errno.h> #include <unistd.h> #include "crts/debug.h" #include "getTunViaUSocket.hpp" static int checkHaveRead(int fd, long sec, long usec)...
et); const char *s = subnet; if(len > 18 || len < 10) goto fail; if(subnet[len-3] != '/') goto fail; errno = 0; val = strtoul(&subnet[len-2], 0, 10); if(errno || val > 31 || val < 24) goto fail; for(int i=0; i<3; ++i) { val = strtoul(s, 0, 10); if(errno || val >...
); int fd = *((int*) data); INFO("Got from UNIX Socket TUN fd=%d", fd); close(socket); if((fd = dup2(fd, socket)) != socket) { ERROR("dup2() failed"); close(fd); socket = -1; return -1; } socket = -1; INFO("Got TUN duped to fd=%d", fd); ...
random
[ { "content": "// This is an internal data structure and not a user interface; hence\n\n// it's not called CRTSParameter.\n\nstruct Parameter\n\n{\n\n // called in CRTSController to set the value.\n\n std::function<bool (double)> set;\n\n\n\n // called in CRTSController to poll the value\n\n std::fun...
C++
iRODS/server/re/src/testMS.cpp
nesi/irods
49eeaf76305fc483f21b1bbfbdd77d540b59cfd2
#include "reGlobalsExtern.hpp" #include "reFuncDefs.hpp" #include "icatHighLevelRoutines.hpp" int print_hello( ruleExecInfo_t *rei ) { RE_TEST_MACRO( "Test for print_hello\n" ); fprintf( stdout, "Hello\n" ); _writeString( "stdout", "Hello\n", rei ); return 0; } int recover_print_hello( ruleExecIn...
#include "reGlobalsExtern.hpp" #include "reFuncDefs.hpp" #include "icatHighLevelRoutines.hpp" int print_hello( ruleExecInfo_t *rei ) { RE_TEST_MACRO( "Test for print_hello\n" ); fprintf( stdout, "Hello\n" ); _writeString( "stdout", "Hello\n", rei ); return 0; } int recover_print_hello( ruleExecIn...
int print_uoi( userInfo_t *uoi ) { if ( reTestFlag == COMMAND_TEST_1 ) { fprintf( stdout, " userName = %s\n", uoi->userName ); fprintf( stdout, " rodsZone= %s\n", uoi->rodsZone ); fprintf( stdout, " userType= %s\n", uoi->userType ); } else if ( reTestFlag == HTML_TEST_1...
tdout, " objPath = %s\n", doi->objPath ); fprintf( stdout, " rescName= %s\n", doi->rescName ); fprintf( stdout, " dataType= %s\n", doi->dataType ); fprintf( stdout, " dataSize= %lld\n", doi->dataSize ); } else if ( reTestFlag == HTML_TEST_1 ) { fprintf( stdout, " ...
function_block-function_prefixed
[ { "content": " def test(self):\n\n self.rods_session.assert_icommand(\"icd\")\n\n self.rods_session.assert_icommand(\"irule -vF \" + rules30dir + rulefile,\n", "file_path": "tests/pydevtest/test_allrules.py", "rank": 0, "score": 117236.89308473901...
C++
src/ukf.cpp
lb5160482/Sensor-Fusion-Unscented-Kalman-Filter
4636755b6a5dcc25f181684796d3ade82cb943f9
#include "ukf.h" #include "Eigen/Dense" #include <iostream> using namespace std; using Eigen::MatrixXd; using Eigen::VectorXd; using std::vector; UKF::UKF() { is_initialized_ = false; use_laser_ = true; use_radar_ = true; x_ = VectorXd(5); x_pred = VectorXd(5); P_ = Mat...
#include "ukf.h" #include "Eigen/Dense" #include <iostream> using namespace std; using Eigen::MatrixXd; using Eigen::VectorXd; using std::vector; UKF::UKF() { is_initialized_ = false; use_laser_ = true; use_radar_ = true; x_ = VectorXd(5); x_pred = VectorXd(5); P_ = Mat...
} void UKF::Prediction(double dt) { MatrixXd sigAug = GenerateSigmaAug(); SigPrediction(sigAug, dt); MeanAndCovPrediction(); } void UKF::UpdateLidar(MeasurementPackage meas_package) { MatrixXd ZSig = MatrixXd(n_z_lidar_, 2 * n_aug_ + 1); VectorXd zPred = VectorXd(n_z_lid...
if (meas_package.sensor_type_ == MeasurementPackage::RADAR) { UpdateRadar(meas_package); } else { UpdateLidar(meas_package); }
if_condition
[ { "content": "struct has_std_result_type {int a[2];};\n", "file_path": "src/Eigen/src/Core/util/Meta.h", "rank": 0, "score": 167285.48100387253 }, { "content": "struct has_none {int a[1];};\n", "file_path": "src/Eigen/src/Core/util/Meta.h", "rank": 1, "score": 117858.8414467264 ...
C++
wled00/7segmdisp.cpp
imeszaros/ledclock
e739b11608e52a1e2a3dc88c54dcc40dbc1e5793
#include "7segmdisp.h" static CRGB dummy; void LedBasedDisplay::setRowColor(uint8_t row, bool state, CRGB color) { for (uint8_t c = 0, n = columnCount(); c < n; ++c) { setLedColor(row, c, state, color); } } void LedBasedDisplay::setColumnColor(uint8_t column, bool state, CRGB color) { for (uint8_...
#include "7segmdisp.h" static CRGB dummy; void LedBasedDisplay::setRowColor(uint8_t row, bool state, CRGB color) { for (uint8_t c = 0, n = columnCount(); c < n; ++c) { setLedColor(row, c, state, color); } } void LedBasedDisplay::setColumnColor(uint8_t column, bool state, CRGB color) { for (uint8_...
SevenSegmentDisplay::~SevenSegmentDisplay() { delete _indices; delete _offColors; delete _onColors; } uint8_t SevenSegmentDisplay::rowCount() { return _ledsPerSegment * 2 + 3; } uint8_t SevenSegmentDisplay::columnCount() { return _ledsPerSegment + 2; } uint8_t SevenSegmentDisplay::internalIndex...
SevenSegmentDisplay::SevenSegmentDisplay(LedBasedDisplayOutput output, uint8_t ledsPerSegment): _output(output), _ledsPerSegment(ledsPerSegment), _value(_7SEG_SYM_EMPTY), _mode(LedBasedDisplayMode::SET_ALL_LEDS) { _offColors = (CRGB*) malloc(7 * _ledsPerSegment * sizeof(CRGB)); _onColors = (CRG...
function_block-full_function
[ { "content": "const _C = d.querySelector('.container'), N = 4;\n", "file_path": "wled00/data/index.js", "rank": 0, "score": 80796.51181418088 }, { "content": "struct Reader<VariantRef, void> : Reader<char*, void> {\n\n explicit Reader(VariantRef x) : Reader<char*, void>(x.as<const char*>())...
C++
lib/src/TypeRegistration.cpp
PrincetonUniversity/mcpib
72a6b7a04288b9707f20699dbbdcdb964a8ca379
#include "mcpib/TypeRegistration.hpp" #include "mcpib/TypeRegistry.hpp" #include "mcpib/WrapperError.hpp" namespace mcpib { void TypeRegistration::registerFromPython(std::unique_ptr<FromPythonFactory> factory) { for (auto const & existing : _from_python) { if (factory->name == existing->name) { ...
#include "mcpib/TypeRegistration.hpp" #include "mcpib/TypeRegistry.hpp" #include "mcpib/WrapperError.hpp" namespace mcpib { void TypeRegistration::registerFromPython(std::unique_ptr<FromPythonFactory> factory) { for (auto const & existing : _from_python) { if (factory->name == existing->name) { ...
}
_ref_to_python; } ToPythonConverter const & TypeRegistration::getConstRefToPython() const { if (!_const_ref_to_python) { throw raiseToPythonError("No const reference to-Python converter found"); } return *_const_ref_to_python; } ToPythonConverter const & TypeRegistration::getPointerToPyth...
random
[ { "content": "class ReturnConverter<void> {\n\npublic:\n\n\n\n explicit ReturnConverter(TypeRegistry &) {}\n\n\n\n template <typename ArgumentBuilder, typename ...Args>\n\n PyPtr apply(ArgumentBuilder builder, std::function<void(Args...)> const & function) const {\n\n callFunction(builder, funct...
C++
ecmascript/napi/test/jsi_test.cpp
openharmony-gitee-mirror/ark_js_runtime
b5ac878349b00b337c45f4702332c23aa82e1e28
#include <cstdint> #include <cstdio> #include <cstring> #include <iostream> #include <memory> #include "ark_js_runtime.h" #include "js_value.h" using OHOS::Ace::Framework::ArkJSRuntime; using OHOS::Ace::Framework::JsRuntime; using OHOS::Ace::Framework::JsValue; using OHOS::Ace::Framework::RegisterFunctionType; usin...
#include <cstdint> #include <cstdio> #include <cstring> #include <iostream> #include <memory> #include "ark_js_runtime.h" #include "js_value.h" using OHOS::Ace::Framework::ArkJSRuntime; using OHOS::Ace::Framework::JsRuntime; using OHOS::Ace::Framework::JsValue; using OHOS::Ace::Framework::RegisterFunctionType; usin...
int main() { TestRuntime runtime; RegisterFunctionType func = AppDebugLogPrint; shared_ptr<JsValue> global = runtime->GetGlobal(); shared_ptr<JsValue> logFunc = runtime->NewFunction(func); shared_ptr<JsValue> consoleObj = runtime->NewObject(); global->SetProperty(*runtime, "console", consoleObj)...
function_block-full_function
[ { "content": "class JSTaggedValue : public coretypes::TaggedValue {\n\npublic:\n\n static JSTaggedValue Cast(ObjectHeader *object)\n\n {\n\n return JSTaggedValue(object);\n\n }\n\n\n\n JSTaggedValue(void *) = delete;\n\n\n\n constexpr JSTaggedValue() = default;\n\n constexpr explicit JS...
C++
sourceCode/dotNet4.6/ndp/fx/src/data/native/sni/include/sni_servicebindings.hpp
csoap/csoap.github.io
2a8db44eb63425deff147652b65c5912f065334e
#ifndef _SNI_SERVICE_BINDINGS_07_15_2009_ #define _SNI_SERVICE_BINDINGS_07_15_2009_ #include "sni_spn.hpp" class SNI_ServiceBindings { public: static DWORD SetHostNamesAndAcceptedSPNs(__in_ecount_opt(dwcAllowedSPNs) WCHAR **pwszAcceptedSPNs, DWORD...
#ifndef _SNI_SERVICE_BINDINGS_07_15_2009_ #define _SNI_SERVICE_BINDINGS_07_15_2009_ #include "sni_spn.hpp" class SNI_ServiceBindings { public: static DWORD SetHostNamesAndAcceptedSPNs(__in_ecount_opt(dwcAllowedSPNs) WCHAR **pwszAcceptedSPNs, DWORD...
stNames); static DWORD AllocAndSetHostname(COMPUTER_NAME_FORMAT NameType); static DWORD RepackSzIntoWsz(__in_z LPCSTR szMbcsString); static void ReleaseIPs(); static void ReleaseNames(); inline static void BidTraceAddedIPv4Address(__in struct in_addr *psin_addr); inline static void BidTraceAddedIPv6Address(__in ...
zClientSuppliedSPN, __out SNIAuthErrStates *pSSPIFailureState); static void Release(); #ifndef SNIX private: static volatile LONG s_lClusterAddressesInitialized; static bool s_fClusterHostNamesInitialized; static bool s_fWSAStarted; static struct in_addr *s_piaIPv4Address; st...
random
[]
C++
src/red4ext/FlightSettings.cpp
jackhumbert/flight_control
02938f5a26b3a299ef3d9b9e4d40e9294872a7ee
#include "FlightSettings.hpp" #include "FlightModule.hpp" #include "Utils.hpp" #include "stdafx.hpp" namespace FlightSettings { RED4ext::TTypedClass<FlightSettings> cls("FlightSettings"); RED4ext::CClass *FlightSettings::GetNativeType() { return &cls; } RED4ext::HashMap<RED4ext::CName, float> floats; void GetFloa...
#include "FlightSettings.hpp" #include "FlightModule.hpp" #include "Utils.hpp" #include "stdafx.hpp" namespace FlightSettings { RED4ext::TTypedClass<FlightSettings> cls("FlightSettings"); RED4ext::CClass *FlightSettings::GetNativeType() { return &cls; } RED4ext::HashMap<RED4ext::CName, float> floats; void GetFloa...
auto setFloat = RED4ext::CClassStaticFunction::Create(&cls, "SetFloat", "SetFloat", &SetFloat, {.isNative = true, .isStatic = true}); cls.RegisterFunction(setFloat); } }; REGISTER_FLIGHT_MODULE(FlightSettingsModule); }
actorDrone", 5.0); return true; } struct FlightSettingsModule : FlightModule { void Load(const RED4ext::Sdk *aSdk, RED4ext::PluginHandle aHandle) { RED4ext::GameState runningState; runningState.OnEnter = nullptr; runningState.OnUpdate = &Setup; runningState.OnExit = nullptr; aSdk->gameStates-...
random
[ { "content": " FMOD_DSP_ALLOC_FUNC alloc;\n", "file_path": "deps/fmod/include/fmod_dsp.h", "rank": 0, "score": 130866.68190463846 }, { "content": " FMOD_CODEC_ALLOC_FUNC alloc;\n", "file_path": "deps/fmod/include/fmod_codec.h", "rank": 1, "score": 130...
C++
diffkemp/simpll/Utils.cpp
tmalecova/diffkemp
226166cec9044ff23753e7d74b49d2272677c0d6
#include "Utils.h" #include "Config.h" #include <llvm/IR/Instructions.h> #include <llvm/IR/Module.h> #include <llvm/IR/Operator.h> #include <llvm/Support/LineIterator.h> #include <llvm/Support/MemoryBuffer.h> #include <llvm/Support/Path.h> #include <llvm/Support/raw_ostream.h> #include <set> #include <iostream> #incl...
#include "Utils.h" #include "Config.h" #include <llvm/IR/Instructions.h> #include <llvm/IR/Module.h> #include <llvm/IR/Operator.h> #include <llvm/Support/LineIterator.h> #include <llvm/Support/MemoryBuffer.h> #include <llvm/Support/Path.h> #include <llvm/Support/raw_ostream.h> #include <set> #include <iostream> #incl...
return Type; } void simplifyFunction(Function *Fun) { PassBuilder pb; FunctionPassManager fpm(false); FunctionAnalysisManager fam(false); pb.registerFunctionAnalyses(fam); fpm.addPass(SimplifyCFGPass {}); fpm.addPass(DCEPass {}); fpm.addPass(NewGVNPass {}); fpm.run(*Fun, fam); } A...
if (auto PtrTy = dyn_cast<PointerType>(Value->getType())) { if (auto *StructTy = dyn_cast<StructType>(PtrTy->getElementType())) { Type = StructTy; } else if (auto *BitCast = dyn_cast<BitCastInst>(Value)) { if (auto *SrcPtrTy = dyn_cast<PointerTy...
if_condition
[ { "content": "class CalledFunctionsAnalysis\n\n : public AnalysisInfoMixin<CalledFunctionsAnalysis> {\n\n public:\n\n using Result = std::set<const Function *>;\n\n Result run(Module &Mod,\n\n AnalysisManager<Module, Function *> &mam,\n\n Function *Main);\n\n\n\n prote...
C++
src/EDepSimModuleBuilder.hh
andrewmogan/edep-sim
4e9923ccba8b2f65f47b72cbb41ed683f19f1123
#ifndef EDepSim_ModuleBuilder_hh_seen #define EDepSim_ModuleBuilder_hh_seen #include <sstream> #include <G4ThreeVector.hh> class G4LogicalVolume; #include "EDepSimBuilder.hh" #include "EDepSimComponentBuilder.hh" namespace EDepSim {class ModuleBuilder;} class EDepSim::ModuleBuilder : public EDepSim::Builder { pub...
#ifndef EDepSim_ModuleBuilder_hh_seen #define EDepSim_ModuleBuilder_hh_seen #include <sstream> #include <G4ThreeVector.hh> class G4LogicalVolume; #include "EDepSimBuilder.hh" #include "EDepSimComponentBuilder.hh" namespace EDepSim {class ModuleBuilder;} class EDepSim::ModuleBuilder : public EDepSim::Builder { pub...
; virtual ~ModuleBuilderMessenger() { delete fClearCMD; delete fAddCMD; delete fRepeatCMD; delete fWidthCMD; delete fHeightCMD; }; void SetNewValue(G4UIcommand *cmd, G4String val) { if (cmd==fClearCMD) { fBuilder->ClearComponentList(); } ...
ModuleBuilderMessenger(EDepSim::ModuleBuilder* c, const char* guide=NULL) : EDepSim::BuilderMessenger(c,guide), fBuilder(c) { fClearCMD = new G4UIcmdWithoutParameter(CommandName("clear"),this); fClearCMD->SetGuidance("Clear the component list for th...
function_block-full_function
[ { "content": "class EDepSim::DokeBirks : public G4VRestDiscreteProcess //class definition\n\n{\n\npublic:\n\n\n\n DokeBirks(const G4String& processName = \"Doke-Birks\",\n\n G4ProcessType type = fElectromagnetic);\n\n ~DokeBirks();\n\n\n\n /// Determine which particles this process sho...
C++
Classes/Bmob/baseobject/bmobobject.cpp
isuhao/RaidenFree
1811a79d6704fb58e2abc58fb3feaad79af33841
#include "bmobobject.h" #include "network/HttpClient.h" #include "network/HttpResponse.h" #include "../util/bmobstrutil.h" using namespace network; BmobObject::BmobObject(){ this->m_pSaveDelegate = NULL; this->m_pUpdateDelegate = NULL; this->m_pSaveDelegate = NULL; } BmobObject::BmobObject(string tableN...
#include "bmobobject.h" #include "network/HttpClient.h" #include "network/HttpResponse.h" #include "../util/bmobstrutil.h" using namespace network; BmobObject::BmobObject(){ this->m_pSaveDelegate = NULL; this->m_pUpdateDelegate = NULL; this->m_pSaveDelegate = NULL; } BmobObject::BmobObject(string tableN...
y,"objects"); this->enParamsToHttp(name,dict); } void BmobObject::del(BmobDeleteDelegate* delegate){ _opType = HTTP_OP_Type::_bHTTP_DELETE; this->m_pDeleteDelegate = delegate; this->m_url = BmobSDKInit::URL + m_tableName + "/" + m_objectId; this->send(HttpRequest::Type::DELETE); } void BmobObjec...
if (array == NULL) { return ; } __Dictionary* dict = __Dictionary::create(); string op = "Remove"; dict->setObject(__String::createWithFormat("%s",op.c_str()),"__op"); dict->setObject(arra
function_block-random_span
[ { "content": "class DefaultValueArrayAllocator : public ValueArrayAllocator\n\n{\n\npublic: // overridden from ValueArrayAllocator\n\n virtual ~DefaultValueArrayAllocator()\n\n {\n\n }\n\n\n\n virtual ValueInternalArray *newArray()\n\n {\n\n return new ValueInternalArray();\n\n }\n\n\n\n virt...
C++
Raspberry Pi/build-GUI_app-Desktop-Debug/moc_writewindow.cpp
AnasKhedr/Smart-Home-2017
b847baa26fbd12b831e2f4325f74d0aa1a766dad
#include "../gui/writewindow.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'writewindow.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.3.2. It" #error "cannot be used wi...
#include "../gui/writewindow.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'writewindow.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.3.2. It" #error "cannot be used wi...
2), QT_MOC_LITERAL(9, 181, 31) }, "WriteWindow\0on_dial_temp_valueChanged\0" "\0value\0on_spinBox_temp_valueChanged\0" "arg1\0on_horizontalSlider_light_valueChanged\0" "on_spinBox_light_valueChanged\0" "on_pushButton_send_light_clicked\0" "on_pushButton_send_temp_clicked" }; #undef QT_MOC_LI...
ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ qptrdiff(offsetof(qt_meta_stringdata_WriteWindow_t, stringdata) + ofs \ - idx * sizeof(QByteArrayData)) \ ) static const qt_meta_stringdata_WriteWindow_t qt_meta_stringdata_WriteWindow = { { QT_MOC_LITERAL(0, 0, 11), QT_MOC_LITERAL(1, 12, 25), QT_MOC_...
random
[ { "content": "struct qt_meta_stringdata_ReadWindow_t {\n\n QByteArrayData data[5];\n\n char stringdata[80];\n\n};\n\n#define QT_MOC_LITERAL(idx, ofs, len) \\\n\n Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \\\n\n qptrdiff(offsetof(qt_meta_stringdata_ReadWindow_t, stringdata) + ofs \...
C++
src/canoe/phrasetable_filter_joint.cc
nrc-cnrc/Portage-SMT-TAS
73f5a65de4adfa13008ea9a01758385c97526059
#include "phrasetable_filter_joint.h" #include "soft_filter_tm_visitor.h" #include "hard_filter_tm_visitor.h" #include "logging.h" using namespace Portage; Logging::logger ptLogger_filter_joint(Logging::getLogger("debug.canoe.phraseTable_filter_joint")); PhraseTableFilterJoint::PhraseTableFilterJoint(bool limitPhr...
#include "phrasetable_filter_joint.h" #include "soft_filter_tm_visitor.h" #include "hard_filter_tm_visitor.h" #include "logging.h" using namespace Portage; Logging::logger ptLogger_filter_joint(Logging::getLogger("debug.canoe.phraseTable_filter_joint")); PhraseTableFilterJoint::PhraseTableFilterJoint(bool limitPhr...
; const Uint numBeforeFiltering(tgtTable->size()); visitor->set(L, tgtTable->begin()->second.backward.size()); (*visitor)(*tgtTable); write(*online_filter_output, src, *tgtTable); const Uint numKeptEntry(tgtTable->size()); tgtTable->clear(); return numBeforeFiltering - numKeptEntry;...
LOG_VERBOSE3(ptLogger_filter_joint, "Online processing of one entry (%s) L=%d n=%d", visitor->style.c_str(), L, tgtTable->begin()->second.backward.size())
call_expression
[ { "content": "struct null_deleter\n\n{\n\n void operator()(T const *) const {}\n\n};\n\n\n\n\n\nptr_FF FeatureFunctionSet::create(const string& name,\n\n const string& arg,\n\n const char* fileff_prefix,\n\n boo...
C++
cpp/test/main.cc
yjhatfdu/zstd-codec
f3f52dd801df1ece0d6cdbc9445dcb2a00973e37
#include <algorithm> #include <cstdio> #include <fstream> #include <functional> #include <iterator> #include <iostream> #include <string> #include "zstd-codec.h" #include "zstd-dict.h" #include "zstd-stream.h" #define CATCH_CONFIG_MAIN #include "catch.hpp" class FileResource : public Resource<FILE> { public: Fil...
#include <algorithm> #include <cstdio> #include <fstream> #include <functional> #include <iterator> #include <iostream> #include <string> #include "zstd-codec.h" #include "zstd-dict.h" #include "zstd-stream.h" #define CATCH_CONFIG_MAIN #include "catch.hpp" class FileResource : public Resource<FILE> { public: Fil...
TEST_CASE("Zstd-Dictionary-Interfaces", "[zstd][compress][decompress][dictionary]") { const auto dict_bytes = loadFixture("sample-dict"); const auto sample_books = loadFixture("sample-books.json"); const auto compression_level = 5; ZstdCompressionDict cdict(dict_bytes, compression_level); ZstdDec...
const auto path = fixturePath(name); std::ifstream stream(path.c_str(), std::ios::in | std::ios::binary); return Vec<u8>((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>()); }
function_block-function_prefix_line
[ { "content": " class NamePattern : public Pattern {\n\n public:\n\n NamePattern( std::string const& name );\n\n virtual ~NamePattern();\n\n virtual bool matches( TestCaseInfo const& testCase ) const override;\n\n private:\n\n WildcardPattern m_wil...
C++
WebKit2-7604.1.38.0.7/WebKit2-7604.1.38.0.7/UIProcess/API/glib/WebKitWebResource.cpp
mlcldh/appleWebKit2
39cc42a4710c9319c8da269621844493ab2ccdd6
#include "config.h" #include "WebKitWebResource.h" #include "APIData.h" #include "WebFrameProxy.h" #include "WebKitURIRequest.h" #include "WebKitWebResourcePrivate.h" #include <glib/gi18n-lib.h> #include <wtf/glib/GRefPtr.h> #include <wtf/glib/WTFGType.h> #include <wtf/text/CString.h> using namespace WebKit; enum ...
#include "config.h" #include "WebKitWebResource.h" #include "APIData.h" #include "WebFrameProxy.h" #include "WebKitURIRequest.h" #include "WebKitWebResourcePrivate.h" #include <glib/gi18n-lib.h> #include <wtf/glib/GRefPtr.h> #include <wtf/glib/WTFGType.h> #include <wtf/text/CString.h> using namespace WebKit; enum ...
Errors(WebKitWebResource* resource, GTlsCertificateFlags tlsErrors, GTlsCertificate* certificate) { g_signal_emit(resource, signals[FAILED_WITH_TLS_ERRORS], 0, certificate, tlsErrors); g_signal_emit(resource, signals[FINISHED], 0, nullptr); } WebFrameProxy* webkitWebResourceGetFrame(WebKitWebResource* resource...
_("URI"), _("The current active URI of the resource"), 0, WEBKIT_PARAM_READABLE)); g_object_class_install_property...
random
[ { "content": "struct external_constructor<value_t::object>\n\n{\n\n template<typename BasicJsonType>\n\n static void construct(BasicJsonType& j, const typename BasicJsonType::object_t& obj)\n\n {\n\n j.m_type = value_t::object;\n\n j.m_value = obj;\n\n j.assert_invariant();\n\n ...
C++
core/src/love/DrawDataFrame.hpp
castle-games/castle-client
7fb34759b164d8de1d83b43bc00ff200a5086e2e
#ifndef DrawDataFrame_hpp #define DrawDataFrame_hpp #define _USE_MATH_DEFINES #include <stdio.h> #include <functional> #include <memory> #include "GhostTypes.hpp" namespace love { class DrawData; struct DrawDataLayer; class DrawDataFrame { public: bool isLinked; PathDataList pathDataList; Bounds fillImage...
#ifndef DrawDataFrame_hpp #define DrawDataFrame_hpp #define _USE_MATH_DEFINES #include <stdio.h> #include <functional> #include <memory> #include "GhostTypes.hpp" namespace love { class DrawData; struct DrawDataLayer; class DrawDataFrame { public: bool isLinked; PathDataList pathDataList; Bounds fillImage...
const char *fileDataString = (const char *)fileData->getData(); size_t fileDataSize = fileData->getSize(); size_t dstlen = 0; char *result = data::encode(data::ENCODE_BASE64, fileDataString, fileDataSize, dstlen, 0); archive.str("fillPng", std::string(result)); delete result; ...
love::filesystem::FileData *fileData = fillImageData->encode( love::image::FormatHandler::EncodedFormat::ENCODED_PNG, "Image.png", false);
assignment_statement
[]
C++
plugins/CleverbotPlugin/CleverbotPlugin/CleverbotPlugin.cpp
daemon/monkeybot
50bf65674daefa12bfc002771243360bb1d07481
#include "api/Api.h" #include "plugin/Plugin.h" #include "CleverbotHTTP.h" #include <algorithm> #include <future> #include <thread> #include <queue> #include <iostream> #include <string> #include <random> #include <atomic> #include <chrono> #include <curl/curl.h> namespace { const long Timeout = 12000; const ChatMes...
#include "api/Api.h" #include "plugin/Plugin.h" #include "CleverbotHTTP.h" #include <algorithm> #include <future> #include <thread> #include <queue> #include <iostream> #include <string> #include <random> #include <atomic> #include <chrono> #include <curl/curl.h> namespace { const long Timeout = 12000; const ChatMes...
bool Contains(std::string str, const std::string& find) { std::string find_lower = strtolower(find); str = strtolower(str); return str.find(find_lower) != std::string::npos; } std::string EraseName(std::string thought) { std::string bot_name = strtolower(m_Bot->GetName())...
void StripEntities(std::string& str) { using namespace std; while (true) { size_t begin = str.find("&"); size_t end = str.find(";"); if (begin == string::npos || end == string::npos || begin >= end) return; str.erase(begin, end - begin + 1); } ...
function_block-full_function
[ { "content": "class int_generator {\n\n public:\n\n typedef typename concurrency::scoped_lock_type scoped_lock_type;\n\n typedef typename concurrency::mutex_type mutex_type;\n\n\n\n /// constructor\n\n //mac TODO: figure out if signed types present a range problem\n\n int_g...
C++
src/hdf5/DataTypeHDF5.cpp
balint42/nix
50f1de33b946b7b194c82fb0efd9b0cecba9ed54
#include <nix/hdf5/DataTypeHDF5.hpp> #include <stdexcept> #include <iostream> #include <cassert> namespace nix { namespace hdf5 { namespace h5x { DataType DataType::copy(hid_t source) { DataType hi_copy = H5Tcopy(source); hi_copy.check("Could not copy type"); return hi_copy; } DataType DataType::makeS...
#include <nix/hdf5/DataTypeHDF5.hpp> #include <stdexcept> #include <iostream> #include <cassert> namespace nix { namespace hdf5 { namespace h5x { DataType DataType::copy(hid_t source) { DataType hi_copy = H5Tcopy(source); hi_copy.check("Could not copy type"); return hi_copy; } DataType DataType::makeS...
std::cerr << "FIXME: Not implemented " << vclass << " " << vsize << " " << vsign << " " << std::endl; assert(NOT_IMPLEMENTED); return DataType::Nothing; } } }
if (vclass == H5T_STRING) { return DataType::String; } else if (vclass == H5T_BITFIELD) { switch (vsize) { case 1: return DataType::Bool; } }
if_condition
[ { "content": "struct to_data_type<bool> {\n\n static const bool is_valid = true;\n\n static const DataType value = DataType::Bool;\n\n};\n\n\n\n/**\n\n * @brief Determine if a type is a valid data type.\n\n */\n\ntemplate<>\n", "file_path": "include/nix/DataType.hpp", "rank": 0, "score": 18745...
C++
src/base/circlebuffer.cpp
aksenofo/sparrow
c0300700a023f374ebb8faa69bcefe261e99d9d5
#include "circlebuffer.h" namespace sparrow { CircularBuffer::CircularBuffer(uint32_t size) : m_size(size) { m_buffer.reset(new uint8_t[m_size]); m_head = m_tail = m_buffer.get(); m_state = m_size == 0 ? Full : Empty; } uint32_t CircularBuffer::WriteEnd(const void* ptr, uint32_t size) noexcept { as...
#include "circlebuffer.h" namespace sparrow { CircularBuffer::CircularBuffer(uint32_t size) : m_size(size) { m_buffer.reset(new uint8_t[m_size]); m_head = m_tail = m_buffer.get(); m_state = m_size == 0 ? Full : Empty; } uint32_t CircularBuffer::WriteEnd(const void* ptr, uint32_t size) noexcept { as...
} uint32_t s2 = m_buffer.get() - m_head; if (s1 < lateSize) return consumed; else { uint8_t* start = m_buffer.get() + lateSize; uint8_t* stop = std::min(start + size, m_head); memcpy(start, point, stop - start); consumed += stop - sta...
start = m_tail + lateSize; uint8_t* stop = std::min(m_buffer.get() + m_size, start + size); memcpy(start, point, stop - start); point += stop - start; consumed += stop - start; size -= stop - start; lateSize = 0;
random
[ { "content": "class Consumer\n\n{\n\npublic:\n\n Consumer() = default;\n\n COPYBLE_DEFAULT(Consumer);\n\n MOVEBLE_DEFAULT(Consumer);\n\n\n\n template<typename Func>\n\n uint32_t operator()(CircularBuffer& circularBuffer, Func fn)\n\n {\n\n uint32_t totallyConsumed = 0;\n\n while ...
C++
caffe2/operators/load_save_op_util.cc
wenhaopeter/read_pytorch_code
491f989cd918cf08874dd4f671fb7f0142a0bc4f
#include "caffe2/operators/load_save_op_util.h" namespace caffe2 { namespace load_save_op_util { std::string buildBlobNameFromDbKey( const std::string& dbKey, const std::string& strip_prefix, const std::string& add_prefix) { std::string key = dbKey.substr(0, dbKey.find(kChunkIdSeparator)); if (!strip_...
#include "caffe2/operators/load_save_op_util.h" namespace caffe2 { namespace load_save_op_util { std::string buildBlobNameFromDbKey( const std::string& dbKey, const std::string& strip_prefix, const std::string& add_prefix) { std::string key = dbKey.substr(0, dbKey.find(kChunkIdSeparator)); if (!strip_...
; CAFFE_ENFORCE( proto.tensor().has_segment(), "Partial tensor must have a segment: ", key); blob_states[key].current_size += proto.tensor().segment().end() - proto.tensor().segment().begin(); CAFFE_ENFORCE( blob_states[key].current_size <= blob_states[key].total_size...
CAFFE_ENFORCE( blob_states[key].current_size < blob_states[key].total_size, "Found an extra part for an already filled tensor: ", key)
call_expression
[ { "content": "class Int8GivenIntTensorFillOp final : public Operator<CPUContext> {\n\n public:\n\n template <class... Args>\n\n explicit Int8GivenIntTensorFillOp(Args&&... args)\n\n : Operator<CPUContext>(std::forward<Args>(args)...),\n\n scale_(this->template GetSingleArgument<float>(\"Y_scale\",...
C++
test/syscalls/linux/close_range.cc
neilalexander/gvisor
14807179c24110d46441efbf30cf375a22d04e57
#include <asm-generic/errno-base.h> #include <unistd.h> #include <vector> #include "gtest/gtest.h" #include "absl/base/macros.h" #include "test/util/file_descriptor.h" #include "test/util/posix_error.h" #include "test/util/temp_path.h" #include "test/util/test_util.h" namespace gvisor { namespace testing { namesp...
#include <asm-generic/errno-base.h> #include <unistd.h> #include <vector> #include "gtest/gtest.h" #include "absl/base/macros.h" #include "test/util/file_descriptor.h" #include "test/util/posix_error.h" #include "test/util/temp_path.h" #include "test/util/test_util.h" namespace gvisor { namespace testing { namesp...
TEST_F(CloseRangeTest, RangeFirstGreaterThanLast) { SKIP_IF(!IsRunningOnGvisor() && close_range(1, 0, 0) < 0 && errno == ENOSYS); int num_files_in_range = 10; unsigned int flags = 0; CreateFiles(num_files_in_range); OpenFilesRdwr(); EXPECT_THAT(close_range(fds_[num_files_in_range - 1], fds_[0], flags), ...
TEST_F(CloseRangeTest, CloexecAndUnshareFlagTest) { SKIP_IF(!IsRunningOnGvisor() && close_range(1, 0, 0) < 0 && errno == ENOSYS); int num_files_in_range = 10; unsigned int flags = CLOSE_RANGE_CLOEXEC | CLOSE_RANGE_UNSHARE; CreateFiles(num_files_in_range); OpenFilesRdwr(); for (int fd : fds_) { auto re...
function_block-full_function
[ { "content": "class SpecificErrnoMatcher : public ::testing::MatcherInterface<int> {\n\n public:\n\n explicit SpecificErrnoMatcher(int const expected) : expected_(expected) {}\n\n\n\n bool MatchAndExplain(\n\n int const actual_errno,\n\n ::testing::MatchResultListener* const listener) const override...
C++
src/modules/Bots/playerbot/RandomPlayerbotFactory.cpp
YggDrazil/-MaNGOsZero0.20
6bc64bf5c42cbd1e491c28a4d7a2bf91051323fb
#include "Config/Config.h" #include "../botpch.h" #include "playerbot.h" #include "PlayerbotAIConfig.h" #include "PlayerbotFactory.h" #include "AccountMgr.h" #include "ObjectMgr.h" #include "DatabaseEnv.h" #include "PlayerbotAI.h" #include "Player.h" #include "RandomPlayerbotFactory.h" #include "SystemConfig.h" map<ui...
#include "Config/Config.h" #include "../botpch.h" #include "playerbot.h" #include "PlayerbotAIConfig.h" #include "PlayerbotFactory.h" #include "AccountMgr.h" #include "ObjectMgr.h" #include "DatabaseEnv.h" #include "PlayerbotAI.h" #include "Player.h" #include "RandomPlayerbotFactory.h" #include "SystemConfig.h" map<ui...
player->setCinematic(2); player->SetAtLoginFlag(AT_LOGIN_NONE); player->SaveToDB(); sLog.outDetail("Random bot created for account %d - name: \"%s\"; race: %u; class: %u; gender: %u; skin: %u; face: %u; hairStyle: %u; hairColor: %u; facialHair: %u; outfitId: %u", accountId, name.c_str(), ...
if (!player->Create(sObjectMgr.GeneratePlayerLowGuid(), name, race, cls, gender, skin, face, hairStyle, hairColor, facialHair, outfitId)) { player->DeleteFromDB(player->GetObjectGuid(), accountId, true, true); delete session; delete player; sLog.outError("Unable to create random bot ...
if_condition
[ { "content": "class Player;\n", "file_path": "src/modules/Bots/playerbot/RandomPlayerbotMgr.h", "rank": 0, "score": 310367.1292837344 }, { "content": "class Player;\n", "file_path": "src/modules/Bots/playerbot/RandomPlayerbotFactory.h", "rank": 1, "score": 310367.1292837344 }, ...
C++
examples/FloodPedestrian_2019/Flood_XML_inpGen/XML_inpGen/xmlGen.cpp
SahebSh/FLAMEGPU
c81323b68532a52756b96dbf55fd29416e642cc9
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <algorithm> double bed_data(double x_int, double y_int); #define SIZE 128 #define xmin 0 #define xmax 15 #define ymin 0 #define ymax 15 #define OFF 0 #define ON 1 int main() { FILE *fp = fopen("flood_init.xml", "w"); if (fp == NULL) { prin...
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <algorithm> double bed_data(double x_int, double y_int); #define SIZE 128 #define xmin 0 #define xmax 15 #define ymin 0 #define ymax 15 #define OFF 0 #define ON 1 int main() { FILE *fp = fopen("flood_init.xml", "w"); if (fp == NULL) { prin...
1; double x1 = (xmax - flume_length) / 2 ; double x2 = (xmax + flume_length) / 2 ; if ((x_int <= x1) || (x_int >= x2)) zz = 10; else zz = 0; return zz; }
function_block-function_prefixed
[ { "content": "class Double {\n\npublic:\n\n Double() {}\n\n Double(double d) : d_(d) {}\n\n Double(uint64_t u) : u_(u) {}\n\n\n\n double Value() const { return d_; }\n\n uint64_t Uint64Value() const { return u_; }\n\n\n\n double NextPositiveDouble() const {\n\n RAPIDJSON_ASSERT(!Sign())...
C++
LuaKitProject/src/Projects/jni/com_common_luakit_LuaHelper.cpp
williamwen1986/Luakit
2e113a3b429a8205cf8ac0dbc074480906b34384
#include <com_common_luakit_LuaHelper.h> #include "base/logging.h" #include "base/command_line.h" #include "base/memory/scoped_ptr.h" #include "common/business_main_delegate.h" #include "common/business_runtime.h" #include "base/android/base_jni_registrar.h" #include "base/android/jni_android.h" #include "JniEn...
#include <com_common_luakit_LuaHelper.h> #include "base/logging.h" #include "base/command_line.h" #include "base/memory/scoped_ptr.h" #include "common/business_main_delegate.h" #include "common/business_runtime.h" #include "base/android/base_jni_registrar.h" #include "base/android/jni_android.h" #include "JniEn...
#ifdef __cplusplus } #endif
NI_Onload start"; base::android::InitVM(jvm); if (!base::android::RegisterJni(env)) { LOG(ERROR)<<"base::android::RegisterJni(env) error"; return -1; } CommandLine::Init(0, nullptr); LOG(INFO) << "JNI_Onload end"; return JNI_VERSION_1_6; }
function_block-function_prefixed
[ { "content": "struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5,\n\n P6)> : public BindStateBase {\n\n typedef Runnable RunnableType;\n\n typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;\n\n typedef Invoker<6, BindState, RunType> InvokerType;\n\n typedef typename InvokerTyp...
C++
xls/noc/config_ng/flattened_multi_dimensional_array_test.cc
felixzhuologist/xls
b6a4ec7190049002be1c0829d52b1d7767c88204
#include "xls/noc/config_ng/flattened_multi_dimensional_array.h" #include "gtest/gtest.h" namespace xls::noc { namespace { TEST(FlattenedMultiDimensionalArrayTest, GetElementCount) { FlattenedMultiDimensionalArray<int64_t> array({3, 4}); EXPECT_EQ(array.GetElementCount(), 12); FlattenedMultiDimensional...
#include "xls/noc/config_ng/flattened_multi_dimensional_array.h" #include "gtest/gtest.h" namespace xls::noc { namespace { TEST(FlattenedMultiDimensionalArrayTest, GetElementCount) { FlattenedMultiDimensionalArray<int64_t> array({3, 4}); EXPECT_EQ(array.GetElementCount(), 12); FlattenedMultiDimensional...
PECT_EQ(zero_array.GetValue(0), 42); } } }
or = zero_array.GetDimensionalSpaceIterator({}); array_t::DimensionalSpaceIterator zero_iterator_copy(zero_iterator); array_t::DimensionalSpaceIterator zero_iterator_postfix = zero_iterator++; EXPECT_EQ(zero_iterator_copy, zero_iterator_postfix); EXPECT_NE(zero_iterator, zero_iterator_postfix); } TEST(Fl...
random
[ { "content": "fn array_and_array(p: bits[2][5][4][42], q: bits[32], v: bits[2][5][4]) -> bits[2][5][4][42] {\n\n ret array_update.1: bits[2][5][4][42] = array_update(p, v, indices=[q], id=1)\n\n}\n\n)\";\n\n ParseFunctionAndCheckDump(input);\n\n}\n\n\n\nTEST(IrParserTest, DifferentWidthMultiplies) {\n\n std:...
C++
src/god_field.cpp
connorzl/geometry-central
99114ffaf3efb58c912f94402dd0426cbb17d3f1
#include "geometrycentral/god_field.h" GodField::GodField(HalfedgeMesh *m, Geometry<Euclidean>* g) : mesh(m), geom(g) { edgeVector = HalfedgeData<std::complex<double>>(mesh); r = HalfedgeData<std::complex<double>>(mesh); field = FaceData<std::complex<double>>(mesh); faceAreas = FaceData<double>(mesh); ...
#include "geometrycentral/god_field.h" GodField::GodField(HalfedgeMesh *m, Geometry<Euclidean>* g) : mesh(m), geom(g) { edgeVector = HalfedgeData<std::complex<double>>(mesh); r = HalfedgeData<std::complex<double>>(mesh); field = FaceData<std::complex<double>>(mesh); faceAreas = FaceData<double>(mesh); ...
void GodField::setup() { for (FacePtr f : mesh->faces()) { HalfedgePtr he = f.halfedge(); double l_jl = edgeLengths[he.edge()]; double l_ij = edgeLengths[he.prev().edge()]; double theta_ijl = heAngles[he.next()]; Vector2 j = Vector2{0,0}; Vector2...
void GodField::computeCrossField(EdgeData<double> &lengths, HalfedgeData<double> &angles) { std::cout << "Computing Smoothest Cross Field" << std::endl; edgeLengths = lengths; heAngles = angles; faceAreas = Operators::computeAreas(mesh, edgeLengths); setup(); Eigen::SparseMatrix<std::...
function_block-full_function
[ { "content": "class GodField {\n\n public:\n\n GodField() {};\n\n GodField(HalfedgeMesh *m, Geometry<Euclidean> *geom);\n\n\n\n void computeCrossField(EdgeData<double> &lengths, HalfedgeData<double> &angles);\n\n size_t computeSingularities(VertexData<int> &singularities);\n\n\n\n...
C++
Src/Graphics/Camera.cpp
QuaternionMark/COMP371-FinalProject
ac750a5bb4896f4800d8fbc08fac9ef9a002ed44
#include <cmath> #include <stdexcept> #include "Camera.h" #include "../Math/MathUtil.h" Camera::Camera(int w, int h, float fov, float nearZ, float farZ, bool orthographic) { position = Vector3f(0.f, 0.f, 0.f); lookAt = Vector3f(0.f, 0.f, 1.f); upDir = Vector3f(0.f, 1.f, 0.f); viewMatrix = Matrix4x4f:...
#include <cmath> #include <stdexcept> #include "Camera.h" #include "../Math/MathUtil.h" Camera::Camera(int w, int h, float fov, float nearZ, float farZ, bool orthographic) { position = Vector3f(0.f, 0.f, 0.f); lookAt = Vector3f(0.f, 0.f, 1.f); upDir = Vector3f(0.f, 1.f, 0.f); viewMatrix = Matrix4x4f:...
; viewMatrix = Matrix4x4f::constructViewMat(thirdPersonPosition, position.subtract(thirdPersonPosition).normalize(), upDir); } for (int i = 0; i < (int)shaders.size(); i++) { shaders[i]->getMat4Uniform("viewMatrix")->setValue(viewMatrix); } ...
position.subtract(Vector3f(thirdPersonRadius * cosYAngle * cosXAngle, thirdPersonRadius * sinYAngle, -thirdPersonRadius * cosYAngle * sinXAngle))
call_expression
[ { "content": "struct NameCompare: std::binary_function <const char *, const char *, bool>\n\n{\n\n bool\n\n operator () (const char *x, const char *y) const\n\n {\n\n\treturn strcmp (x, y) < 0;\n\n }\n\n};\n\n\n\n\n\ntypedef Attribute* (*Constructor)();\n\ntypedef std::map <const char *, Constructor...
C++
StageProc2F64Neon.hpp
unevens/hiir
4589fedb4d08b899514cb605ccd7418bf262ab18
#if ! defined (hiir_StageProc2F64Neon_CODEHEADER_INCLUDED) #define hiir_StageProc2F64Neon_CODEHEADER_INCLUDED #include "hiir/StageDataNeonV2F64.h" namespace hiir { template <> inline void StageProc2F64Neon <1>::process_sample_pos (const int nbr_coefs, float64x2_t &spl_0, float64x2_t &spl_1, StageDataNeonV2F64 *sta...
#if ! defined (hiir_StageProc2F64Neon_CODEHEADER_INCLUDED) #define hiir_StageProc2F64Neon_CODEHEADER_INCLUDED #include "hiir/StageDataNeonV2F64.h" namespace hiir { template <> inline void StageProc2F64Neon <1>::process_sample_pos (const int nbr_coefs, float64x2_t &spl_0, float64x2_t &spl_1, St
aq_f64 ( vld1q_f64 (stage_arr [cnt - 2]._mem ), spl_0 - vld1q_f64 (stage_arr [cnt ]._mem ), vld1q_f64 (stage_arr [cnt ]._coef) ); const float64x2_t tmp_1 = vmlaq_f64 ( vld1q_f64 (stage_arr [cnt - 1]._mem ), spl_1 - vld1q_f64 (stage_arr [cnt + 1]._mem ), vld1q_f64 (sta...
ageDataNeonV2F64 *stage_arr) { const int cnt = nbr_coefs + 2 - 1; const float64x2_t tmp_0 = vmlaq_f64 ( vld1q_f64 (stage_arr [cnt - 2]._mem ), spl_0 - vld1q_f64 (stage_arr [cnt ]._mem ), vld1q_f64 (stage_arr [cnt ]._coef) ); vst1q_f64 (stage_arr [cnt - 2]._mem, spl_0); vst1q_f64 ...
random
[ { "content": "class StageProc2F64Neon\n\n{\n\n\tstatic_assert (REMAINING >= 0, \"REMAINING must be >= 0.\");\n\n\n\n/*\\\\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/\n\n\n\npublic:\n\n\n\n\tstatic hiir_FORCEINLINE voi...
C++
dependencies/mountutils/src/linux/functions.cpp
runcitadel/imager
5519eec99a8003b4acb71cbfea507f384d4fb910
#include "../mountutils.hpp" #include <cerrno> #include <mntent.h> #include <sys/mount.h> #include <sys/stat.h> auto unmount_disk(const char *device_path) -> MOUNTUTILS_RESULT { const char *mount_path = nullptr; std::vector<std::string> mount_dirs = {}; struct stat stats; if (stat(device_path, &stats) !...
#include "../mountutils.hpp" #include <cerrno> #include <mntent.h> #include <sys/mount.h> #include <sys/stat.h> auto unmount_disk(const char *device_path) -> MOUNTUTILS_RESULT { const char *mount_path = nullptr; std::vector<std::string> mount_dirs = {}; struct stat stats; if (stat(device_path, &stats) !...
ts == nullptr) { MountUtilsLog("Couldn't read /proc/mounts"); return MOUNTUTILS_ERROR_GENERAL; } while ((mnt_p = getmntent_r(proc_mounts, &data, mnt_buf, sizeof(mnt_buf))) != nullptr) { mount_path = mnt_p->mnt_fsname; if (strncmp(mount_path, device_...
iled"); return MOUNTUTILS_ERROR_GENERAL; } else if (S_ISDIR(stats.st_mode)) { MountUtilsLog("Device is a directory"); return MOUNTUTILS_ERROR_INVALID_DRIVE; } struct mntent *mnt_p; struct mntent data; char mnt_buf[4096 + 1024]; FILE *...
random
[ { "content": "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1\n", "file_path": "dependencies/libarchive-3.4.2/libarchive/config_freebsd.h", "rank": 0, "score": 121046.8140738607 }, { "content": "#define\tHAVE_STRUCT_STAT_ST_FLAGS 1\n", "file_path": "dependencies/libarchive-3.4.2/tar/config_freebsd...
C++
src/imageio/NumpyImageLoader.cpp
gao-duan/tev
4916200e2315f4fe3c22dfa1546faa085ea68a62
#include <tev/imageio/NumpyImageLoader.h> #include <tev/ThreadPool.h> #include <regex> using namespace Eigen; using namespace filesystem; using namespace std; TEV_NAMESPACE_BEGIN bool NumpyImageLoader::canLoadFile(std::istream& iStream) const { std::string header; std::getline(iStream, header); bool r...
#include <tev/imageio/NumpyImageLoader.h> #include <tev/ThreadPool.h> #include <regex> using namespace Eigen; using namespace filesystem; using namespace std; TEV_NAMESPACE_BEGIN bool NumpyImageLoader::canLoadFile(std::istream& iStream) const { std::string header; std::getline(iStream, header); bool r...
TEV_NAMESPACE_END
if (!channelSelector.empty()) { sort(begin(matches), end(matches)); } for (const auto& match : matches) { result.channels.emplace_back(move(channels[match.second])); } result.layers.emplace_back(""); return result; }
function_block-function_prefix_line
[ { "content": "class NumpyImageSaver : public TypedImageSaver<float> {\n\npublic:\n\n void save(std::ostream& oStream, const filesystem::path& path, const std::vector<float>& data, const Eigen::Vector2i& imageSize, int nChannels) const override;\n\n\n\n bool hasPremultipliedAlpha() const override {\n\n ...
C++
externals/mpir-3.0.0/tests/cxx/t-binary.cc
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
#include <iostream> #include "mpir.h" #include "mpirxx.h" #include "gmp-impl.h" #include "tests.h" using namespace std; void check_mpz (void) { { mpz_class a(1), b(2); mpz_class c(a + b); ASSERT_ALWAYS(c == 3); } { mpz_class a(3), b(4); mpz_class c; c = a * b; ASSERT_ALWAYS(c == 12)...
#include <iostream> #include "mpir.h" #include "mpirxx.h" #include "gmp-impl.h" #include "tests.h" using namespace std; void check_mpz (void) { { mpz_class a(1), b(2); mpz_class c(a + b); ASSERT_ALWAYS(c == 3); } { mpz_class a(3), b(4); mpz_class c; c = a * b; ASSERT_ALWAYS(c == 12)...
2), b(1, 4); mpz_class c(1); mpq_class d((a + b) - c); ASSERT_ALWAYS(d == -0.25); } { mpq_class a(1, 3), b(3, 2); mpz_class c(2), d(4); mpq_class e; e = (a * b) / (c - d); ASSERT_ALWAYS(e == -0.25); } { mpq_class a(1, 3), b(3, 4); mpz_class c(-3); mpq_class d(c * (a * ...
YS(b == 0.5); } { mpq_class a(2, 3); signed int b = 4; mpq_class c; c = b / a; ASSERT_ALWAYS(c == 6); } { mpq_class a(1, 2); mpz_class b(1); mpq_class c(a + b); ASSERT_ALWAYS(c == 1.5); } { mpq_class a(2, 3); mpz_class b(1); double c = 2.0; mpq_class...
random
[]
C++
Classes/Scene/BattleMode/BattleScene.cpp
jimmyy512/LegendStory
d2b271023d02eab4f1b540a297d56eae5716bf1f
#include "scene/BattleMode/BattleScene.h" #include <sstream> #include "cocos-ext.h" #include "spine\spine-cocos2dx.h" #include "spine\spine.h" #include "Tools\AudioManagement.h" #include "UI\BattleMode\BattleHUDlayer.h" #include "Map\BattleMode\BattleMap.h" #include "Monster\BattleMode\BattleSoldierFactory.h" #include...
#include "scene/BattleMode/BattleScene.h" #include <sstream> #include "cocos-ext.h" #include "spine\spine-cocos2dx.h" #include "spine\spine.h" #include "Tools\AudioManagement.h" #include "UI\BattleMode\BattleHUDlayer.h" #include "Map\BattleMode\BattleMap.h" #include "Monster\BattleMode\BattleSoldierFactory.h" #include...
irginSize.width * battleMap->getAnchorPoint().x+origin.x; auto MaxMapPosY = battleMapOirginSize.height * battleMap->getAnchorPoint().y+origin.y; auto MinMapPosX = -battleMapOirginSize.width + visible.width + battleMapOirginSize.width * battleMap->getAnchorPoint().x+origin.x; auto MinMapPosY = -battleMapOirginS...
_BattleScene = this; visible = Director::getInstance()->getVisibleSize(); origin = Director::getInstance()->getVisibleOrigin(); NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(BattleScene::pauseBattleMapListenerCallBack), "PauseBattleMapListenerCallBack", NULL); NotificationCenter::getInst...
random
[ { "content": "#include \"cocos2d.h\"\n\n#include \"DefinitionBattleMode.h\"\n\n#include \"cocostudio\\CocoStudio.h\"\n\n#include \"ui/CocosGUI.h\"\n\nclass LoginScene : public cocos2d::Layer\n\n{\n\npublic:\n\n static cocos2d::Scene* createScene();\n\n virtual bool init();\n\n CREATE_FUNC(LoginScene);\...
C++
3rdParty/iresearch/utils/index-convert.cpp
sita1999/arangodb
6a4f462fa209010cd064f99e63d85ce1d432c500
#if defined(_MSC_VER) #pragma warning(disable: 4101) #pragma warning(disable: 4267) #endif #include <cmdline.h> #if defined(_MSC_VER) #pragma warning(default: 4267) #pragma warning(default: 4101) #endif #include "shared.hpp" #include "index-convert.hpp" #include "common.hpp" #include "formats/formats.hp...
#if defined(_MSC_VER) #pragma warning(disable: 4101) #pragma warning(disable: 4267) #endif #include <cmdline.h> #if defined(_MSC_VER) #pragma warning(default: 4267) #pragma warning(default: 4101) #endif #include "shared.hpp" #include "index-convert.hpp" #include "common.hpp" #include "formats/formats.hp...
int convert(const cmdline::parser& args) { if (!args.exist(IN_DIR) || !args.exist(OUT_DIR) || !args.exist(OUT_FORMAT)) { return 1; } const auto& in_path = args.get<std::string>(IN_DIR); if (in_path.empty()) { return 1; } const auto& out_path = args.get<std::string>(OUT_DIR); if (...
NS_END int convert( const std::string& in, const std::string& out, const std::string& dir_type, const std::string& format) { auto in_dir = create_directory(dir_type, in); if (!in_dir) { std::cerr << "Unable to create input directory directory of type '" << dir_type << "'" << std::endl; ret...
function_block-full_function
[]
C++
asw/xy_to_angle.cpp
aswdevz/asw
ba483a71742fefbe6aa886e0e6acf56f22f375fe
#include "stdafx.h" #include "asw.h" #include "xy_to_angle.h" #ifdef USE_ORIGINAL_DEADZONE_FUNCTION bool in_deadzone(short x, short y, int deadzone) { int x_percent = (int)(abs(x) / 327.67); int y_percent = (int)(abs(y) / 327.67); if ( sqrt(pow(x_percent, 2) + pow(y_percent, 2) ) <= deadzone) { return TR...
#include "stdafx.h" #include "asw.h" #include "xy_to_angle.h" #ifdef USE_ORIGINAL_DEADZONE_FUNCTION bool in_deadzone(short x, short y, int deadzone) { int x_percent = (int)(abs(x) / 327.67); int y_percent = (int)(abs(y) / 327.67); if ( sqrt(pow(x_percent, 2) + pow(y_percent, 2) ) <= deadzone) { return TR...
uble)virtual_wheel_max_angle)) + 1)); return finalvalue; } int check_if_rotated_past_180(double current, double last, int* rotations) { if (((current >= -180.0) && (current < 0.0)) && (current < (last - 180.0))) { *rotations = *rotations + 1; return 1; } if (((current <= 180.0)...
= 0) return 90.0; else return -90.0; } if (x > 0) { if (y > 0) { return (atan((double)x / (double)y) * 180.0 / M_PI); } if (y < 0) { return ((atan(-(double)y / (double)x) * 180.0 / M_PI) + 90.0); } } if (x < 0) { if (y > 0) { return ((-atan(-(double)x / (double)y)) * 180.0 / ...
random
[ { "content": "\tint* thumbstick_deadzone;\n", "file_path": "asw/asw.h", "rank": 0, "score": 26571.359982119866 }, { "content": "bool in_deadzone(short x, short y, int deadzone);\n", "file_path": "asw/xy_to_angle.h", "rank": 1, "score": 26571.359982119866 }, { "content": "...
C++
thread_lib/main.cpp
fu4ck/linux_env_dev
8076ca56a2ec907dec0c952e6ed27b6e644c5ae1
#include <iostream> #include <unistd.h> #include <signal.h> #include <sys/types.h> #include <sys/epoll.h> #include <fcntl.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <assert.h> #include <sys/stat.h> #include <string> #include <pthread.h> #include <stdio.h> #include <stdlib.h> #inc...
#include <iostream> #include <unistd.h> #include <signal.h> #include <sys/types.h> #include <sys/epoll.h> #include <fcntl.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <assert.h> #include <sys/stat.h> #include <string> #include <pthread.h> #include <stdio.h> #include <stdlib.h> #inc...
else if(events[i].events&EPOLLOUT){ if(!users[sockfd].write()){ users[sockfd].close_conn(); } }else{ } } } close(epollfd); close(listenfd); delete []users; delete pool; return 0; }
function_block-function_prefix_line
[ { "content": "char const* info_compiler = \"INFO\" \":\" \"compiler[\" COMPILER_ID \"]\";\n", "file_path": "thread_lib/cmake-build-debug/CMakeFiles/3.20.2/CompilerIdC/CMakeCCompilerId.c", "rank": 0, "score": 15856.93664216525 }, { "content": "char const* info_platform = \"INFO\" \":\" \"plat...
C++
cpp_analysis/bin/check_sizes.cpp
shahrukhqasim/HGCalML
2808564b31c89d9b7eb882734f6aebc6f35e94f3
#include "TString.h" #include "TFile.h" #include "TTree.h" #include <vector> #include <iostream> #include "TH1D.h" #include "TCanvas.h" void mergeOF(TH1D* h){ double lastb = h->GetBinContent(h->GetNbinsX()); h->SetBinContent(h->GetNbinsX(), lastb+h->GetBinContent(h->GetNbinsX()+1)); } int main(int argc, cha...
#include "TString.h" #include "TFile.h" #include "TTree.h" #include <vector> #include <iostream> #include "TH1D.h" #include "TCanvas.h" void mergeOF(TH1D* h){ double lastb = h->GetBinContent(h->GetNbinsX()); h->SetBinContent(h->GetNbinsX(), lastb+h->GetBinContent(h->GetNbinsX()+1)); }
int main(int argc, char* argv[]){ if(argc<2) return -1; TString infile = argv[1]; TFile f(infile, "READ"); TTree * tree = (TTree*) f.Get("Delphes"); if(!tree || tree->IsZombie()){ std::cerr << "tree has a problem" << std::endl; return -1; } std::vector<std::vector<float> >...
function_block-full_function
[ { "content": "//#define GOOGLE_CUDA 1\n\n\n\n#if GOOGLE_CUDA\n\n#define EIGEN_USE_GPU\n\n#define HANDLE_ERROR( err ) ( tensorflow::functor::HandleError( err, __FILE__, __LINE__ ) )\n\n\n\n#include \"slicing_knn_kernel.h\"\n\n#include \"helpers.h\"\n\n#include \"tensorflow/core/util/gpu_kernel_helper.h\"\n\n#inc...
C++
src/platform/threadmgr/ThreadManager.cpp
shorton3/dashingplatforms
f461c967827b92c8bcf872c365afa64e56871aba
#include <iostream> #include <sstream> #include <ace/Thread.h> #include "ThreadManager.h" #include "platform/logger/Logger.h" #include "platform/common/Defines.h" #define THREAD_FUNC_RETRY 5 #define THREAD_MONITOR_PERIOD 2 #define MONITOR_GROUP_ID 17239115 ThreadManager::ThreadsWaitingForRestartMap ThreadMana...
#include <iostream> #include <sstream> #include <ace/Thread.h> #include "ThreadManager.h" #include "platform/logger/Logger.h" #include "platform/common/Defines.h" #define THREAD_FUNC_RETRY 5 #define THREAD_MONITOR_PERIOD 2 #define MONITOR_GROUP_ID 17239115 ThreadManager::ThreadsWaitingForRestartMap ThreadMana...
; ostringstream ostr; ostr << "Thread (" << threadParms->threadName_ << ") restarted with new Thread Id (" << newThreadId << ")" << ends; STRACELOG(DEBUGLOG, THREADLOG, ostr.str().c_str()); ThreadManager::restartMap_.erase(restartMapIterato...
ThreadManager::createThread(threadParms->function_, threadParms->functionArgs_, threadParms->threadName_.c_str(), threadParms->shouldRestart_, threadParms->threadFlags_, threadParms->priority_, threadParms->threadGroup_, threadParms->stackSize_)
call_expression
[ { "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++
fboss/agent/state/tests/NeighborTests.cpp
dgrnbrg-meta/fboss
cde5aa021fbb28e08cc912a7c227e93ed3faefee
#include <fboss/agent/state/ArpResponseEntry.h> #include "fboss/agent/test/TestUtils.h" #include "fboss/agent/state/ArpEntry.h" #include "fboss/agent/state/NdpEntry.h" #include "fboss/agent/state/NeighborEntry.h" #include "fboss/agent/state/NeighborResponseTable.h" #include "fboss/agent/state/Vlan.h" #include <gtes...
#include <fboss/agent/state/ArpResponseEntry.h> #include "fboss/agent/test/TestUtils.h" #include "fboss/agent/state/ArpEntry.h" #include "fboss/agent/state/NdpEntry.h" #include "fboss/agent/state/NeighborEntry.h" #include "fboss/agent/state/NeighborResponseTable.h" #include "fboss/agent/state/Vlan.h" #include <gtes...
TEST(NdpTable, serialize) { NdpTable table; table.addEntry( IPAddressV6("2401:db00:21:70cb:face:0:96:0"), MacAddress("01:01:01:01:01:01"), PortDescriptor(PortID(10)), InterfaceID(10), NeighborState::REACHABLE); table.addEntry( IPAddressV6("2401:db00:21:70cb:face:0:96:1"), ...
TEST(ArpTable, serialize) { ArpTable table; table.addEntry( IPAddressV4("192.168.0.1"), MacAddress("01:01:01:01:01:01"), PortDescriptor(PortID(10)), InterfaceID(10), NeighborState::REACHABLE); table.addEntry( IPAddressV4("192.168.0.2"), MacAddress("01:01:01:01:01:02"), ...
function_block-full_function
[ { "content": "class MacEntry\n\n : public ThriftyBaseT<state::MacEntryFields, MacEntry, MacEntryFields> {\n\n public:\n\n MacEntry(\n\n folly::MacAddress mac,\n\n PortDescriptor portDescr,\n\n std::optional<cfg::AclLookupClass> classID = std::nullopt,\n\n MacEntryType type = MacEntryType...
C++
src/hermite.cpp
azurite/AST-245-N-Body
cc3e3acd61f62415c1e5f40c8aba5b93703837fa
#include <iostream> #include <fstream> #include <chrono> #include <hermite.hpp> Hermite::Hermite() { t = .0; dt = 0.01; eps = 0.01; N = 0; filename = ""; lean = false; blockSize = 1; } void Hermite::enableLean() { if(!lean) lean = true; } void Hermite::disableLean() { if(lean) lean = false;...
#include <iostream> #include <fstream> #include <chrono> #include <hermite.hpp> Hermite::Hermite() { t = .0; dt = 0.01; eps = 0.01; N = 0; filename = ""; lean = false; blockSize = 1; } void Hermite::enableLean() { if(!lean) lean = true; } void Hermite::disableLean() { if(lean) lean = false;...
std::ofstream file_energy(filename + ".output_energy.txt"); for(int i = 0; i <= energy.size() - blockSize; i += blockSize) { file_energy << energy(i) << " "; } file_energy << std::endl; std::ofstream file_meta(filename + ".output_meta.txt"); file_meta << N << " " << dt << " " << (numSteps * dt)...
if(!lean) { std::ofstream file_pos(filename + ".output_pos.txt"); for(int i = 0; i < totalData.rows(); i++) { for(int j = 0; j < totalData.cols(); j++) { file_pos << totalData(i, j) << " "; } file_pos << std::endl; } }
if_condition
[ { "content": " VectorXd energy;\n\n std::string filename;\n\n bool lean; // if set to true solver will not write position files because they can get quite large\n\n int blockSize;\n\n Matrix<double, 3, Dynamic> totalData; // positions of all particles over all time steps\n\n\n\n void computeEnergy(int ste...
C++
sandbox/rootfs.cc
Codu-LLC/sandbox
f78cb0fb8705904ffcda370f3395ca134d5fd87e
#include "debug.h" #include "rootfs.h" #include "sandbox.h" #include "util.h" #include <fcntl.h> #include <iostream> #include <sys/types.h> #include <sys/mount.h> #include <sys/stat.h> #include <unistd.h> int setup_rootfs(Sandbox *ptr) { if (mount(ptr->get_src_root_fs_dir().c_str(), ptr->get_target_root_fs_...
#include "debug.h" #include "rootfs.h" #include "sandbox.h" #include "util.h" #include <fcntl.h> #include <iostream> #include <sys/types.h> #include <sys/mount.h> #include <sys/stat.h> #include <unistd.h> int setup_rootfs(Sandbox *ptr) { if (mount(ptr->get_src_root_fs_dir().c_str(), ptr->get_target_root_fs_...
1; } if (umount2("sandbox/put_old", MNT_DETACH) == -1) { print_string(ptr->is_debug(), "Detaching old rootfs failed."); return -1; } if (remove("sandbox/put_old") == -1) { print_string(ptr->is_debug(), "Removing old rootfs failed."); return -1; } if (chdir("san...
EXIST) { print_string(ptr->is_debug(), "Making a directory for sandbox failed"); return -1; } if (mount(ptr->get_sandbox_dir().c_str(), (ptr->get_target_root_fs_dir() + "/sandbox").c_str(), "", MS_BIND, NULL) == -1) { print_string(...
random
[ { "content": "//\n\n// Created by Eugene Junghyun Kim on 1/13/2021.\n\n//\n\n\n\n#include \"cgroup.h\"\n\n#include \"debug.h\"\n\n#include \"execution.h\"\n\n#include \"file.h\"\n\n#include \"limit.h\"\n\n#include <memory>\n\n#include <sched.h>\n\n#include <signal.h>\n\n#include <string>\n\n#include <sys/types....
C++
src/cpp/toHTML/toHTML.cpp
tmadden/asm-dom
5cc18c41ba0da8319280355260d96d58bf67d782
#include "toHTML.hpp" #include "../utils/utils.hpp" #include "../VNode/VNode.hpp" #include "../Config/Config.hpp" #include <emscripten/val.h> #include <unordered_map> #include <string> namespace asmdom { std::unordered_map<std::string, bool> containerElements { {"a", true}, {"defs", true}, {"glyph", true...
#include "toHTML.hpp" #include "../utils/utils.hpp" #include "../VNode/VNode.hpp" #include "../Config/Config.hpp" #include <emscripten/val.h> #include <unordered_map> #include <string> namespace asmdom { std::unordered_map<std::string, bool> containerElements { {"a", true}, {"defs", true}, {"glyph", true...
; #else if (vnode->data.props.count("innerHTML") != 0) { html.append(vnode->data.props.at("innerHTML").as<std::string>()); } else #endif for(Children::size_type i = 0; i != vnode->children.size(); ++i) { toHTML(vnode->children[i], html); } html.append("</" + vnode->sel + ">...
html.append( wstring_to_utf8(emscripten::val::module_property("insertInnerHTML")(reinterpret_cast<std::uintptr_t>(vnode)).as<std::wstring>()) )
call_expression
[ { "content": "const getData = (Module, obj) => {\n\n let hasRaws = obj.raw !== undefined;\n\n let hasEvents = false;\n\n\n\n let ref;\n\n const attrs = new Module.MapStringString();\n\n const raw = obj.raw !== undefined ? obj.raw : {};\n\n const events = {};\n\n\n\n if (typeof obj.className === 'string')...
C++
lite/kernels/cuda/lookup_table_compute_test.cc
jameswu2014/Paddle-Lite
827e349ac8eb769a873fe9b3aa961af8b8b20a96
#include "lite/kernels/cuda/lookup_table_compute.h" #include <gtest/gtest.h> #include <cmath> #include <memory> #include <string> #include <utility> #include <vector> #include "lite/core/op_registry.h" namespace paddle { namespace lite { namespace kernels { namespace cuda { using Tensor = lite::Tensor; void Lookup...
#include "lite/kernels/cuda/lookup_table_compute.h" #include <gtest/gtest.h> #include <cmath> #include <memory> #include <string> #include <utility> #include <vector> #include "lite/core/op_registry.h" namespace paddle { namespace lite { namespace kernels { namespace cuda { using Tensor = lite::Tensor;
TEST(lookup_table_cuda, retrieve_op) { auto lookup_table = KernelRegistry::Global().Create<TARGET(kCUDA), PRECISION(kFloat)>( "lookup_table"); ASSERT_FALSE(lookup_table.empty()); ASSERT_TRUE(lookup_table.front()); } TEST(lookup_table_cuda, init) { LookupTableCompute lookup_table; ASSERT_EQ(...
void LookupTableComputeRef(const operators::LookupTableParam& param) { auto* ids_t = param.Ids; auto* output_t = param.Out; int64_t padding_idx = param.padding_idx; auto* ids = ids_t->data<int64_t>(); int64_t ids_numel = ids_t->dims().production(); auto* table_t = param.W; int64_t row_number = table_t->d...
function_block-full_function
[ { "content": "namespace paddle {\n\nnamespace lite {\n\n\n\ntemplate <typename Dtype>\n\nvoid fill_tensor_host_const_impl(Dtype* dio, Dtype value, int64_t size) {\n\n for (int64_t i = 0; i < size; ++i) {\n\n dio[i] = value;\n\n }\n\n}\n\n/**\n\n * \\brief Fill the host tensor buffer with rand value.\n\n *...
C++
kt-nn/src/main/cpp/LayerImage.cpp
viveret/kotlin-tiny-dnn
0f33d497384fe14b34edaa705642d67a15fadc66
#include "pocketn2.h" extern "C" JNIEXPORT jlong JNICALL Java_com_viveret_tinydnn_data_graphics_LayerImage_jniConstructor( JNIEnv *env, jobject thiz, jlong width, jlong height, jlong depth, tiny_dnn::image_type format) { auto fn = [&]() { auto size = new shape3d(width, height, depth); ret...
#include "pocketn2.h" extern "C" JNIEXPORT jlong JNICALL Java_com_viveret_tinydnn_data_graphics_LayerImage_jniConstructor( JNIEnv *env, jobject thiz, jlong width, jlong height, jlong depth, tiny_dnn::image_type format) { auto fn = [&]() { auto size = new shape3d(width, height, depth); ret...
r); return ret2; } extern "C" JNIEXPORT jint JNICALL Java_com_viveret_tinydnn_data_graphics_LayerImage_jniGetFormat(JNIEnv *env, jobject thiz, jlong handle) { auto fn = [&]() { return ((tiny_dnn::image<unsigned char> *) handle)->type()...
{ ret = std::vector<unsigned char>(0); } jbyte* jbyteBuffer = new jbyte[ret.size()]; std::copy(ret.begin(), ret.end(), jbyteBuffer); jbyteArray ret2 = env->NewByteArray((jsize)ret.size()); env->SetByteArrayRegion(ret2, 0, (jsize)ret.size(), jbyteBuffe
function_block-random_span
[ { "content": "class GeneratePackageAction(val size: Int, val includeFitTo: Boolean, val path: String): ProjectAction {\n\n override val name: String = \"@Generate Package\"\n\n override fun doAction(project: NeuralNetProject): OnSelectedResult { return OnSelectedResult(true) }\n\n}", "file_path": "kt-...
C++
src/core-util/pipe.cpp
rocksat/mLib
1bd996008200b54d0984e957264e03faa24651d2
#ifdef _WIN32 #include <AccCtrl.h> #include <Aclapi.h> namespace ml { Pipe::Pipe() { m_handle = nullptr; } Pipe::~Pipe() { closePipe(); } void Pipe::closePipe() { if(m_handle != nullptr) { FlushFileBuffers(m_handle); DisconnectNamedPipe(m_handle); Cl...
#ifdef _WIN32 #include <AccCtrl.h> #include <Aclapi.h> namespace ml { Pipe::Pipe() { m_handle = nullptr; } Pipe::~Pipe() { closePipe(); } void Pipe::closePipe() { if(m_handle != nullptr) { FlushFileBuffers(m_handle); DisconnectNamedPipe(m_handle); Cl...
m_handle, nullptr, 0, nullptr, &BytesReady, &BytesLeft); return (BytesReady > 0); } bool Pipe::readMessage(std::vector<BYTE> &Message) { MLIB_ASSERT_STR(m_handle != nullptr, "Pipe invalid in Pipe::ReadMessage"); DWORD BytesReady = 0; BOOL s...
d in Pipe::MessagePresent"); DWORD BytesReady = 0; DWORD BytesLeft = 0; BOOL success = PeekNamedPipe(
function_block-random_span
[ { "content": "class Pipe\n\n{\n\npublic:\n\n Pipe();\n\n ~Pipe();\n\n \n\n //\n\n // Connection\n\n //\n\n void closePipe();\n\n void createPipe(const std::string &pipeName, bool block);\n\n void connectToLocalPipe(const std::string &pipeName);\n\n void connectToPipe(const std::str...
C++
libcat/src/cat_storage_resmgr.cpp
shadow-paw/cat
975749c9d716687f1bd74c80d474fed6065768de
#include "cat_storage_resmgr.h" #include <new> #include <string.h> #include <png.h> using namespace cat; ResourceManager::ResourceManager(VFS* vfs) { m_contextready = false; m_vfs = vfs; } ResourceManager::~ResourceManager() { fini(); } bool ResourceManager::init() { return true; } void ResourceMan...
#include "cat_storage_resmgr.h" #include <new> #include <string.h> #include <png.h> using namespace cat; ResourceManager::ResourceManager(VFS* vfs) { m_contextready = false; m_vfs = vfs; } ResourceManager::~ResourceManager() { fini(); } bool ResourceManager::init() { return true; } void ResourceMan...
const Shader* ResourceManager::retain_shader(const std::string& name, const std::unordered_map<int, std::string>& uniforms, const std::unordered_map<int, std::string>& attrs) { Buffer buffer; auto cached = m_shaders.find(name); if (cached!=m_shaders.end()) { auto& pair = cached->second; pa...
bool ResourceManager::context_restored() { if (m_contextready) return true; m_contextready = true; for (auto it: m_shaders) { reload_shader(&it.second.first, it.first); } for (auto it : m_texs) { reload_tex(it.second.first, it.first); } return true; }
function_block-full_function
[ { "content": "namespace cat {\n\n// ----------------------------------------------------------------------------\n\n// UI Event\n\n// ----------------------------------------------------------------------------\n\nstruct TouchEvent {\n\n enum EventType { TouchDown, TouchUp, TouchMove, Scroll };\n\n EventT...
C++
examples/classes/slider/sliderx.cpp
pierrebestwork/owl642
3f4aa9ec0febc52acd3523f0b6ba063d5e388365
#include <owl/applicat.h> #include <owl/framewin.h> #include <owl/slider.h> #include <owl/gauge.h> #include <owl/static.h> using namespace owl; class TMainWindow : public TWindow { public: TMainWindow(); protected: virtual void SetupWindow(); void EvTimer(uint timerId); private: enum { IDC_T...
#include <owl/applicat.h> #include <owl/framewin.h> #include <owl/slider.h> #include <owl/gauge.h> #include <owl/static.h> using namespace owl; class TMainWindow : public TWindow { public: TMainWindow(); protected: virtual void SetupWindow(); void EvTimer(uint timerId); private: enum { IDC_T...
} class THomeHeaterSimulator : public TApplication { public: THomeHeaterSimulator() : TApplication("Home Heater Simulator") {} protected: virtual void InitMainWindow() { TFrameWindow* frame = new TFrameWindow(0, GetName(), new TMainWindow, true); frame->ModifyStyle(WS_SIZEBOX | WS_MAXIMIZE...
if (!IsHeaterOn && Temp <= lowTriggerTemp) IsHeaterOn = true; else if (IsHeaterOn && Temp >= highTriggerTemp) IsHeaterOn = false;
if_condition
[ { "content": "//----------------------------------------------------------------------------\n\nclass OWLEXTCLASS TNotebook : public virtual owl::TWindow {\n\n public:\n\n //--- redefined functions ---\n\n TNotebook(int tabloc = 0);\n\n ~TNotebook();\n\n void SetTabCnt(int tabcnt, int firsttab = 0,...
C++
src/plugins/lackman/packagesmodel.cpp
devel29a/leechcraft
faf5e856010fb785e4bbf3ce7b5c6a5c49f3239a
#include "packagesmodel.h" #include <QIcon> #include <QApplication> #include <util/util.h> #include "core.h" #include "storage.h" #include "pendingmanager.h" namespace LeechCraft { namespace LackMan { PackagesModel::PackagesModel (QObject *parent) : QAbstractItemModel (parent) { } int PackagesModel::columnCoun...
#include "packagesmodel.h" #include <QIcon> #include <QApplication> #include <util/util.h> #include "core.h" #include "storage.h" #include "pendingmanager.h" namespace LeechCraft { namespace LackMan { PackagesModel::PackagesModel (QObject *parent) : QAbstractItemModel (parent) { } int PackagesModel::columnCoun...
int PackagesModel::GetRow (int packageId) const { for (int i = 0, size = Packages_.size (); i < size; ++i) if (Packages_.at (i).PackageID_ == packageId) return i; return -1; } void PackagesModel::Clear () { beginResetModel (); Packages_.clear (); endResetModel (); } void PackagesModel::hand...
ListPackageInfo PackagesModel::FindPackage (const QString& name) const { const auto pos = std::find_if (Packages_.begin (), Packages_.end (), [&name] (const auto& lpi) { return lpi.Name_ == name; }); return pos != Packages_.end () ? *pos : ListPackageInfo {}; }
function_block-full_function
[ { "content": "\tconst struct\n\n\t{\n\n\t\ttemplate<typename Vec>\n\n\t\tauto operator() (Vec&& vec) const\n\n\t\t{\n\n\t\t\tusing std::begin;\n\n\t\t\tusing std::end;\n\n\t\t\tusing MP = typename Vec::value_type;\n\n\t\t\treturn std::accumulate (begin (vec), end (vec), Mzero<MP> (), &operator+<MP>);\n\n\t\t}\n...
C++
pxr/imaging/plugin/hdRpr/rifcpp/rifContext.cpp
MagisterDemens/RadeonProRenderUSD
51d3855b7c1a0cd8dafb5986d5ac4c6eb9df38e2
#include "rifContext.h" #include "rifError.h" #include "RadeonProRender_CL.h" #include "RadeonProRender_GL.h" #include "RadeonImageFilters_cl.h" #include "RadeonImageFilters_gl.h" #include "RadeonImageFilters_metal.h" #include "rprcpp/rprContext.h" #include "rprcpp/rprFramebufferGL.h" #include <vector> #include <cass...
#include "rifContext.h" #include "rifError.h" #include "RadeonProRender_CL.h" #include "RadeonProRender_GL.h" #include "RadeonImageFilters_cl.h" #include "RadeonImageFilters_gl.h" #include "RadeonImageFilters_metal.h" #include "rprcpp/rprContext.h" #include "rprcpp/rprFramebufferGL.h" #include <vector> #include <cass...
ContextMetal::ContextMetal(rpr_context rprContext, std::string const& modelPath) : Context(modelPath) { int deviceCount = 0; RIF_ERROR_CHECK_THROW(rifGetDeviceCount(rifBackendApiType, &deviceCount), "Failed to query device count"); assert(deviceCount != 0); if (0 == deviceCount) RIF_THROW...
undef GPU for (rpr_int i = 0; i < gpu_ids.size(); i++ ) { if ((contextFlags & gpu_ids[i]) != 0) return i; } return -1; }
function_block-function_prefix_line
[ { "content": "class FrameBufferGL : public FrameBuffer {\n\npublic:\n\n FrameBufferGL(rpr_context context, rpr_uint width, rpr_uint height);\n\n FrameBufferGL(FrameBufferGL&& fb) noexcept;\n\n ~FrameBufferGL() override;\n\n\n\n FrameBufferGL const& operator=(FrameBufferGL&& fb) noexcept;\n\n\n\n ...
C++
Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp
aaarsene/o3de
37e3b0226958974defd14dd6d808e8557dcd7345
#include <AzCore/Math/Transform.h> #include <AzCore/Math/TransformSerializer.h> namespace AZ { AZ_CLASS_ALLOCATOR_IMPL(JsonTransformSerializer, AZ::SystemAllocator, 0); JsonSerializationResult::Result JsonTransformSerializer::Load( void* outputValue, [[maybe_unused]] const Uuid& outputValueTypeId, c...
#include <AzCore/Math/Transform.h> #include <AzCore/Math/TransformSerializer.h> namespace AZ { AZ_CLASS_ALLOCATOR_IMPL(JsonTransformSerializer, AZ::SystemAllocator, 0);
JsonSerializationResult::Result JsonTransformSerializer::Store( rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, [[maybe_unused]] const Uuid& valueTypeId, JsonSerializerContext& context) { namespace JSR = AZ::JsonSerializationResult; if (azrtti_...
JsonSerializationResult::Result JsonTransformSerializer::Load( void* outputValue, [[maybe_unused]] const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, JsonDeserializerContext& context) { namespace JSR = JsonSerializationResult; if (azrtti_typeid<AZ::Transform>() != ou...
function_block-full_function
[]
C++
widgets/mainwindow.cpp
AxelLeLouedec/Fitts
23ff29373f6e8cd3bdbe8eaf1f60c9c0808cf44b
#include "./widgets/mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , m_settings(new QSettings("options.ini", QSettings::IniFormat)) { ui->setupUi(this); openHome(); } void MainWindow::onHomeEvent(int val, void *obj) { qDebug() <<...
#include "./widgets/mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , m_settings(new QSettings("options.ini", QSettings::IniFormat)) { ui->setupUi(this); openHome(); } void MainWindow::onHomeEvent(int val, void *obj) { qDebug() <<...
void MainWindow::openHome() { qDebug() << "Opening home"; home = new Home(model); connect(home, SIGNAL(onHomeEvent(int,void*)), this, SLOT(onHomeEvent(int,void*))); this->setCentralWidget(home); } void MainWindow::openResults(FittsModel *model) { qDebug() << "Opening results"; results = n...
ent"; switch(val) { case RESULTS_RESTART: openHome(); break; case RESULTS_EXIT_PRGM: qApp->exit(); default: break; } }
function_block-function_prefixed
[ { "content": "class FittsModel\n\n{\n\npublic:\n\n FittsModel();\n\n\n\n int cibleLeft = 10;\n\n int nbCible = 10;\n\n int minSize = 10;\n\n int maxSize = 150;\n\n\n\n double a = 0.20;\n\n double b = 0.10;\n\n\n\n double ecartType = 0;\n\n double erreurType = 0;\n\n double diffMoy ...
C++
tests/test_address.cc
wavesplatform/wavespp
9505613e01b19e5a73dfb90e9569323be98a3852
#include <cstring> #include <string> #include <iostream> #include <algorithm> #include "../src/address.hpp" #include "../src/utils.hpp" static constexpr auto PUBLIC_KEY_BIN_LEN = wavespp::public_key::PUBLIC_KEY_BIN_LEN; static int test_address_to_base58() { const std::string base58_address = "3MtBqEtkF8cYkNJv85Q...
#include <cstring> #include <string> #include <iostream> #include <algorithm> #include "../src/address.hpp" #include "../src/utils.hpp" static constexpr auto PUBLIC_KEY_BIN_LEN = wavespp::public_key::PUBLIC_KEY_BIN_LEN; static int test_address_to_base58() { const std::string base58_address = "3MtBqEtkF8cYkNJv85Q...
return 0; } static int test_address_from_unsigned_char() { printf("%s\n", __func__); const char* address_base58 = "3ND8YwWJ5XHhYNbLcWv9uZEqVboSU8iyMgu"; const auto expected_address_binary = wavespp::utils::from_base58(address_base58); const std::string input_public_key_str = "Do24gp5eC4HrN6XQkYh...
if (address_binary != expected_address_binary) { fprintf(stderr, "%s: binary address %s != expected_address_binary %s \n", __func__, address_binary.c_str(), expected_address_binary.c_str()); return 1; }
if_condition
[ { "content": "struct address\n\n{\n\n // Length of an address in Base58 format.\n\n static const size_t ADDRESS_B58_LEN = 36;\n\n // Length of an address in binary format.\n\n static constexpr size_t ADDRESS_BIN_LEN = 26;\n\n\n\n address();\n\n address(const char* _str); // from base58\n\n ...
C++
xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp
andoma/pdfium
6c0c0ce4b67502b89edf9c47c7e248328a8d8e9c
#include "xfa/src/foxitlib.h" #include "xfa/src/fwl/src/core/include/fwl_targetimp.h" #include "xfa/src/fwl/src/core/include/fwl_noteimp.h" #include "xfa/src/fwl/src/core/include/fwl_widgetimp.h" #include "xfa/src/fwl/src/core/include/fwl_panelimp.h" #include "xfa/src/fwl/src/core/include/fwl_formimp.h" #include "xfa...
#include "xfa/src/foxitlib.h" #include "xfa/src/fwl/src/core/include/fwl_targetimp.h" #include "xfa/src/fwl/src/core/include/fwl_noteimp.h" #include "xfa/src/fwl/src/core/include/fwl_widgetimp.h" #include "xfa/src/fwl/src/core/include/fwl_panelimp.h" #include "xfa/src/fwl/src/core/include/fwl_formimp.h" #include "xfa...
FWL_ERR CFWL_ToolTipImp::GetClientRect(CFX_RectF& rect) { FX_FLOAT x = 0; FX_FLOAT y = 0; FX_FLOAT t = 0; IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (pTheme) { CFWL_ThemePart part; part.m_pWidget = m_pInterface; x = *static_cast<FX_FLOAT*>( pTheme->GetCapacity(&part,...
return FWL_ERR_Indefinite; } if (!m_pProperties->m_pThemeProvider) { m_pProperties->m_pThemeProvider = GetAvailableTheme(); } UpdateTextOutStyles(); GetClientRect(m_rtClient); m_rtCaption = m_rtClient; return FWL_ERR_Succeeded; }
function_block-function_prefix_line
[ { "content": "class CLST_Rect : public CPDF_Rect {\n\n public:\n\n CLST_Rect() { left = top = right = bottom = 0.0f; }\n\n\n\n CLST_Rect(FX_FLOAT other_left,\n\n FX_FLOAT other_top,\n\n FX_FLOAT other_right,\n\n FX_FLOAT other_bottom) {\n\n left = other_left;\n\n top = o...
C++
qtmultimedia/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp
wgnet/wds_qt
8db722fd367d2d0744decf99ac7bafaba8b8a3d3
#include <QtTest/QtTest> #include <QDebug> #include <QStringList> #include <private/qmediaserviceprovider_p.h> #include <qmediaserviceproviderplugin.h> #include <private/qmediapluginloader_p.h> #include <qmediaobject.h> #include <qmediaservice.h> #include <qmediaplayer.h> #include <qaudiorecorder.h> #include <qcamer...
#include <QtTest/QtTest> #include <QDebug> #include <QStringList> #include <private/qmediaserviceprovider_p.h> #include <qmediaserviceproviderplugin.h> #include <private/qmediapluginloader_p.h> #include <qmediaobject.h> #include <qmediaservice.h> #include <qmediaplayer.h> #include <qaudiorecorder.h> #include <qcamer...
e(), QMediaServiceProviderHint::Device); QCOMPARE(hint.device(), deviceName); QCOMPARE(hint.cameraPosition(), QCamera::UnspecifiedPosition); QVERIFY(hint.mimeType().isEmpty()); QVERIFY(hint.codecs().isEmpty()); QCOMPARE(hint.features(), 0); } { QMediaServiceProvi...
ist()), QMultimedia::ProbablySupported); QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/avi", QStringList() << "mpeg4"), QMultimedia::MaybeSupported); QCOMPARE(provider->hasSupport(QByteArray("non existing serv...
random
[]
C++
main/svl/source/misc/sharecontrolfile.cxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
#include "precompiled_svl.hxx" #include <stdio.h> #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/ucb/InsertCommandArgument.hpp> #include <com/sun/star/ucb/InteractiveIOException.hpp> #include <com/...
#include "precompiled_svl.hxx" #include <stdio.h> #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/ucb/InsertCommandArgument.hpp> #include <com/sun/star/ucb/InteractiveIOException.hpp> #include <com/...
} else { aNewData[nNewInd] = m_aUsersData[nInd]; } nNewInd++; } } if ( !bExists ) aNewData[nNewInd++] = aNewEntry; aNewData.realloc( nNewInd ); SetUsersDataAndStore( aNewData ); return aNewEntry; } bool...
if ( !bExists ) { aNewData[nNewInd] = aNewEntry; bExists = sal_True; }
if_condition
[]
C++
tools/mesh_import/src/core/binary_exporter.cpp
ValtoForks/Terminus-Engine
0c7381af84736ec7b029977843590453cde64b1d
#include <binary_exporter.h> #include <assimp_importer.h> #include <filesystem.h> #include <timer.h> #include <iostream> namespace binary_exporter { void export_mesh(AssimpImportData* data, std::string output, Options options) { std::string meshOutputName = filesystem::get_filename(data->filename); ...
#include <binary_exporter.h> #include <assimp_importer.h> #include <filesystem.h> #include <timer.h> #include <iostream> namespace binary_exporter { void export_mesh(AssimpImportData* data, std::string output, Options options) { std::string meshOutputName = filesystem::get_filename(data->filename); ...
string file, std::string output, Options options) { Timer timer; timer.start(); filesystem::create_directory(output); filesystem::create_directory(output + "/mesh"); filesystem::create_directory(output + "/material"); filesystem::create_directory(output + "/t...
std::string dest_path = output; dest_path += "/"; dest_path += path_in_mat; filesystem::copy_file(sourcePath, dest_path); } else { doc["roughness_value"] = 0.5f; ...
random
[ { "content": "using String = std::string;\n", "file_path": "tools/mesh_import/include/types.h", "rank": 0, "score": 120601.69996484136 }, { "content": "using Json = nlohmann::json;\n", "file_path": "tools/mesh_import/include/types.h", "rank": 1, "score": 120591.52757084777 }, ...
C++
src/EventTraceKit.Etw/EventSession.cpp
ljani/event-trace-kit
59a217fbaecfc87b3915e2494a8d25593d04ae99
#include "Descriptors.h" #include "TraceLog.h" #include "WatchDog.h" #include "InteropHelper.h" #include "etk/ITraceLog.h" #include "etk/ITraceProcessor.h" #include "etk/ITraceSession.h" #include <memory> #include <string> using namespace System; using namespace System::Collections::Generic; using namespace System::...
#include "Descriptors.h" #include "TraceLog.h" #include "WatchDog.h" #include "InteropHelper.h" #include "etk/ITraceLog.h" #include "etk/ITraceProcessor.h" #include "etk/ITraceSession.h" #include <memory> #include <string> using namespace System; using namespace System::Collections::Generic; using namespace System::...
on* kernelSession = nullptr; etk::ITraceProcessor* processor = nullptr; }; static std::wstring LoggerNameBase = L"EventTraceKit_54644792-9281-48E9-B69D-E82A86F98960"; static std::wstring CreateLoggerName() { int pid = System::Diagnostics::Process::GetCurrentProcess()->Id; return LoggerNameBase + L"_" + st...
viderBinary(String^ filePath) { return filePath->EndsWith(L".exe", StringComparison::OrdinalIgnoreCase) || filePath->EndsWith(L".dll", StringComparison::OrdinalIgnoreCase); } template<> inline etk::TraceProviderDescriptor marshal_as(EventProviderDescriptor^ const& provider) { etk::TraceProvider...
random
[ { "content": "namespace EventTraceKit.EventTracing.Schema\n\n{\n\n using System.Xml.Linq;\n\n using EventTraceKit.EventTracing.Schema.Base;\n\n\n\n public static class EventManifestSchema\n\n {\n\n public static readonly XNamespace Namespace =\n\n \"http://schemas.microsoft.com/win...
C++
export/windows/cpp/obj/src/haxe/Timer.cpp
TinyPlanetStudios/Project-Crash-Land
365f196be4212602d32251566f26b53fb70693f6
#include <hxcpp.h> #ifndef INCLUDED_haxe_Log #include <haxe/Log.h> #endif #ifndef INCLUDED_haxe_Timer #include <haxe/Timer.h> #endif #ifndef INCLUDED_openfl__legacy_Lib #include <openfl/_legacy/Lib.h> #endif namespace haxe{ void Timer_obj::__construct(Float time){ HX_STACK_FRAME("haxe.Timer","new",0x41...
#include <hxcpp.h> #ifndef INCLUDED_haxe_Log #include <haxe/Log.h> #endif #ifndef INCLUDED_haxe_Timer #include <haxe/Timer.h> #endif #ifndef INCLUDED_openfl__legacy_Lib #include <openfl/_legacy/Lib.h> #endif namespace haxe{ void Timer_obj::__construct(Float time){ HX_STACK_FRAME("haxe.Timer","new",0x41...
::Dynamic Timer_obj::lime_time_stamp; Timer_obj::Timer_obj() { run = new __default_run(this); } void Timer_obj::__Mark(HX_MARK_PARAMS) { HX_MARK_BEGIN_CLASS(Timer); HX_MARK_MEMBER_NAME(mTime,"mTime"); HX_MARK_MEMBER_NAME(mFireAt,"mFireAt"); HX_MARK_MEMBER_NAME(mRunning,"mRunning"); HX_MARK_MEMBER_NAME(run,"r...
STATIC_HX_DEFINE_DYNAMIC_FUNC0(Timer_obj,_hx___checkTimers,(void)) Float Timer_obj::_hx___nextWake(Float limit){ HX_STACK_FRAME("haxe.Timer","__nextWake",0x0e101148,"haxe.Timer.__nextWake","haxe/Timer.hx",339,0x1a690682) HX_STACK_ARG(limit,"limit") HXLINE( 341) HX_VARI( Float,now) = ::haxe::...
call_expression
[ { "content": "class HXCPP_CLASS_ATTRIBUTES Timer_obj : public hx::Object\n\n{\n\n\tpublic:\n\n\t\ttypedef hx::Object super;\n\n\t\ttypedef Timer_obj OBJ_;\n\n\t\tTimer_obj();\n\n\n\n\tpublic:\n\n\t\tvoid __construct(Float time);\n\n\t\tinline void *operator new(size_t inSize, bool inContainer=true,const char *i...
C++
include/external/urdl/istreambuf.hpp
Ptomaine/nstd
72daa4abab97dc82b407c774b00476459df0730b
#ifndef URDL_ISTREAMBUF_HPP #define URDL_ISTREAMBUF_HPP #include <streambuf> #include "detail/config.hpp" #include "option_set.hpp" #include "url.hpp" #include "detail/abi_prefix.hpp" namespace urdl { class istreambuf : public std::streambuf { public: URDL_DECL istreambuf(); URDL_DECL ~istreambuf(); ...
#ifndef URDL_ISTREAMBUF_HPP #define URDL_ISTREAMBUF_HPP #include <streambuf> #include "detail/config.hpp" #include "option_set.hpp" #include "url.hpp" #include "detail/abi_prefix.hpp" namespace urdl {
fix.hpp" #if defined(URDL_HEADER_ONLY) # include "impl/istreambuf.ipp" #endif #endif
class istreambuf : public std::streambuf { public: URDL_DECL istreambuf(); URDL_DECL ~istreambuf(); template <typename Option> void set_option(const Option& option) { option_set options; options.set_option(option); set_options(options); } URDL_DECL void set_options(con...
random
[ { "content": "*/\n\n\n\n#define URDL_HEADER_ONLY\n\n#define URDL_DISABLE_SSL\n\n#define ASIO_STANDALONE\n\n#define ASIO_HAS_STD_CHRONO\n\n\n\n#include \"external/asio/asio/include/asio.hpp\"\n\n#include \"external/urdl/http.hpp\"\n\n#include \"external/urdl/istream.hpp\"\n\n#include \"external/urdl/istreambuf.h...
C++
src/machine_learning/matrix_factorization.cpp
rafaelppires/rex
4d3c10ba4bde86365090b5c7c5e8de037a1fb885
#include "matrix_factorization.h" #include <utils/time_probe.h> #include <iostream> MatrixFactorizationModel::MatrixFactorizationModel(int rank) : rank_(rank) {} double MatrixFactorizationModel::predict(int user, int item) const { return weights_.predict(user, item); } double MatrixFactorizationModel::rmse(cons...
#include "matrix_factorization.h" #include <utils/time_probe.h> #include <iostream> MatrixFactorizationModel::MatrixFactorizationModel(int rank) : rank_(rank) {} double MatrixFactorizationModel::predict(int user, int item) const { return weights_.predict(user, item); } double MatrixFactorizationModel::rmse(cons...
rank_) + weights_.estimate_serial_size(); } void MatrixFactorizationModel::serialize_append( std::vector<uint8_t> &out) const { const uint8_t *rptr = reinterpret_cast<const uint8_t *>(&rank_); out.insert(out.end(), rptr, rptr + sizeof(rank_)); weights_.serialize_append(out); } size_t MatrixFactorizati...
s.coeffRef(0, index) *= my_weight; factors.col(index) += embedding.col(0); biases.coeffRef(0, index) += bias.coeff(0, 0); ret.insert(index); }); return ret; } std::set<int> MatrixFactorizationModel::metropolis_hastings_users( size_t my_degree, const DegreesAndModels &models) { r...
random
[ { "content": "class meta_sqrt<Y, InfX, SupX, true> { public: enum { ret = (SupX*SupX <= Y) ? SupX : InfX }; };\n\n\n\n\n\n/** \\internal Computes the least common multiple of two positive integer A and B\n\n * at compile-time. It implements a naive algorithm testing all multiples of A.\n\n * It thus works be...
C++
vtkMAF/Testing/vtkMAFVolumeResampleTest.cpp
FusionBox2/MAF2
b576955f4f6b954467021f12baedfebcaf79a382
#include <cppunit/config/SourcePrefix.h> #include "vtkMAFVolumeResampleTest.h" #include "vtkMAFSmartPointer.h" #include "vtkMAFVolumeResample.h" #include "vtkDataSet.h" #include "vtkStructuredPoints.h" #include "vtkRectilinearGridReader.h" #include "vtkRectilinearGrid.h" #include "vtkDataArray.h" #include "vtkPoin...
#include <cppunit/config/SourcePrefix.h> #include "vtkMAFVolumeResampleTest.h" #include "vtkMAFSmartPointer.h" #include "vtkMAFVolumeResample.h" #include "vtkDataSet.h" #include "vtkStructuredPoints.h" #include "vtkRectilinearGridReader.h" #include "vtkRectilinearGrid.h" #include "vtkDataArray.h" #include "vtkPoin...
== volumeOrigin[i]); } resample->Delete(); } void vtkMAFVolumeResampleTest::TestSetGetVolumeAxisX() { double volumeAxisX[3] = {0,0,1}; vtkMAFVolumeResample *resample = vtkMAFVolumeResample::New(); resample->SetVolumeAxisX(volumeAxisX); double checkVolumeAxisX[3] = {0,0,1}; resample->GetVolumeAxisX(ch...
eOrigin[3] = {1,2,3}; resample->GetVolumeOrigin(checkVolumeOrigin); for (int i = 0; i < 3; i++) { CPPUNIT_ASSERT(checkVolumeOrigin[i]
function_block-random_span
[ { "content": "class vtkTransform;\n", "file_path": "Interaction/mafCameraTransform.h", "rank": 0, "score": 127481.85520661279 }, { "content": "class vtkTransform;\n", "file_path": "Testing/Base/mafTransformFrameTest.h", "rank": 1, "score": 124946.89338589914 }, { "content...
C++
Libraries/VtkVgQtSceneUtil/vtkVgCoordinateTransform.cxx
PinkDiamond1/vivia
70f7fbed4b33b14d34de35c69b2b14df3514d720
#include "vtkVgCoordinateTransform.h" #include <vtkVgAdapt.h> #include <vtkMatrix4x4.h> #include <vtkObjectFactory.h> #include <vgl/vgl_homg_point_2d.h> #include <vgl/algo/vgl_h_matrix_2d.h> #include <vgl/algo/vgl_h_matrix_2d_compute_linear.h> vtkStandardNewMacro(vtkVgCoordinateTransform); vtkVgCoordinateTransfo...
#include "vtkVgCoordinateTransform.h" #include <vtkVgAdapt.h> #include <vtkMatrix4x4.h> #include <vtkObjectFactory.h> #include <vgl/vgl_homg_point_2d.h> #include <vgl/algo/vgl_h_matrix_2d.h> #include <vgl/algo/vgl_h_matrix_2d_compute_linear.h> vtkStandardNewMacro(vtkVgCoordinateTransform); vtkVgCoordinateTransfo...
vtkSmartPointer<vtkMatrix4x4> vtkVgCoordinateTransform::GetHomographyMatrix() { std::vector<vgl_homg_point_2d<double> > fromPoints; std::vector<vgl_homg_point_2d<double> > toPoints; for (int i = 0; i < 4; ++i) { vgl_homg_point_2d<double> vglPt2d(this->FromPoint[i][0], this->FromPoint[i][1], 1); ...
this->ToPoint[0][0] = x1; this->ToPoint[0][1] = y1; this->ToPoint[1][0] = x2; this->ToPoint[1][1] = y2; this->ToPoint[2][0] = x3; this->ToPoint[2][1] = y3; this->ToPoint[3][0] = x4; this->ToPoint[3][1] = y4; }
function_block-function_prefix_line
[ { "content": "class QT_TESTINGSUPPORT_EXPORT pqQteDoubleSliderEventPlayer :\n\n public pqWidgetEventPlayer\n\n{\n\n Q_OBJECT\n\n\n\npublic:\n\n pqQteDoubleSliderEventPlayer(QObject* p = 0);\n\n\n\n bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);\n\n\n\nprivate...
C++
kraken/resources/home/dnanexus/jellyfish-1.1.11/jellyfish/stats_main_cmdline.hpp
transcript/DNAnexus_apps
12c2ba6f57b805a9fcf6e1da4f9d64394ef72256
#ifndef __STATS_ARGS_HPP__ #define __STATS_ARGS_HPP__ #include <jellyfish/yaggo.hpp> class stats_args { public: bool recompute_flag; uint64_t lower_count_arg; bool lower_count_given; uint64_t upper_count_arg; b...
#ifndef __STATS_ARGS_HPP__ #define __STATS_ARGS_HPP__ #include <jellyfish/yaggo.hpp> class stats_args { public: bool recompute_flag; uint64_t lower_count_arg; bool lower_count_given; uint64_t upper_count_arg; b...
private: }; #endif
void dump(std::ostream &os = std::cout) { os << "recompute_flag:" << recompute_flag << "\n"; os << "lower_count_given:" << lower_count_given << " lower_count_arg:" << lower_count_arg << "\n"; os << "upper_count_given:" << upper_count_given << " upper_count_arg:" << upper_count_arg << "\n"; os << "verbos...
function_block-full_function
[ { "content": "struct tuple_size<GTEST_1_TUPLE_(T)> { static const int value = 1; };\n\n\n\ntemplate <GTEST_2_TYPENAMES_(T)>\n", "file_path": "kraken/resources/home/dnanexus/jellyfish-1.1.11/unit_tests/gtest/include/gtest/internal/gtest-tuple.h", "rank": 0, "score": 416406.8253525696 }, { "co...
C++
sources/dansandu/ballotin/logging.cpp
dansandu/ballotin
e92aac53153ca85759bc412a86937b28c5dbfc4c
#include "dansandu/ballotin/logging.hpp" #include "dansandu/ballotin/date_time.hpp" #include "dansandu/ballotin/exception.hpp" #include "dansandu/ballotin/file_system.hpp" #include "dansandu/ballotin/string.hpp" #include <algorithm> #include <fstream> using dansandu::ballotin::date_time::getDateTime; using dansandu::...
#include "dansandu/ballotin/logging.hpp" #include "dansandu/ballotin/date_time.hpp" #include "dansandu/ballotin/exception.hpp" #include "dansandu/ballotin/file_system.hpp" #include "dansandu/ballotin/string.hpp" #include <algorithm> #include <fstream> using dansandu::ballotin::date_time::getDateTime; using dansandu::...
void standardOutputHandler(const LogEntry& logEntry) { auto stream = std::stringstream{}; stream << logEntry.timestamp << " " << levelToString(logEntry.level) << " " << logEntry.threadId << " " << logEntry.file << ":" << logEntry.line << " " << logEntry.message << std::endl; const auto string =...
void Logger::log(const Level level, const char* const function, const char* const file, const int line, const std::function<std::string()>& messageSupplier) const { if (level <= getLevel()) { const auto timestamp = getDateTime(); const auto message = messageSupplier(); c...
function_block-full_function
[ { "content": "enum class Level\n\n{\n\n none,\n\n error,\n\n warn,\n\n info,\n\n debug\n\n};\n\n\n\nconstexpr bool operator<(const Level left, const Level right)\n\n{\n\n return static_cast<int>(left) < static_cast<int>(right);\n\n}\n\n\n\nconstexpr bool operator>(const Level left, const Level...
C++
external/opengl/libagl2/src/texture.cpp
gordonjohnpatrick/XobotOS
888ed3b8cc8d8e0a54b1858bfa5a3572545f4d2f
#include "gles2context.h" #define API_ENTRY #define CALL_GL_API(NAME,...) LOGD("?"#NAME); assert(0); #define CALL_GL_API_RETURN(NAME,...) LOGD("?"#NAME); assert(0); return 0; static inline GGLTexture * AllocTexture() { GGLTexture * tex = (GGLTexture *)calloc(1, sizeof(GGLTexture)); tex->minFilter = GGLTexture::...
#include "gles2context.h" #define API_ENTRY #define CALL_GL_API(NAME,...) LOGD("?"#NAME); assert(0); #define CALL_GL_API_RETURN(NAME,...) LOGD("?"#NAME); assert(0); return 0;
void GLES2Context::InitializeTextures() { tex.textures = std::map<GLuint, GGLTexture *>(); tex.tex2D = AllocTexture(); tex.textures[GL_TEXTURE_2D] = tex.tex2D; tex.texCube = AllocTexture(); tex.textures[GL_TEXTURE_CUBE_MAP] = tex.texCube; for (unsigned i = 0; i < GGL_MAXCOMBINEDTEXTUREIMAGEUNITS; i...
static inline GGLTexture * AllocTexture() { GGLTexture * tex = (GGLTexture *)calloc(1, sizeof(GGLTexture)); tex->minFilter = GGLTexture::GGL_LINEAR; tex->magFilter = GGLTexture::GGL_LINEAR; return tex; }
function_block-full_function
[]
C++
activemq-cpp/src/test/activemq/core/ConnectionAuditTest.cpp
novomatic-tech/activemq-cpp
d6f76ede90d21b7ee2f0b5d4648e440e66d63003
#include "ConnectionAuditTest.h" #include <activemq/core/ConnectionAudit.h> #include <activemq/core/Dispatcher.h> #include <activemq/core/ActiveMQMessageAudit.h> #include <activemq/util/IdGenerator.h> #include <activemq/commands/Message.h> #include <activemq/commands/ActiveMQDestination.h> #include <activemq/command...
#include "ConnectionAuditTest.h" #include <activemq/core/ConnectionAudit.h> #include <activemq/core/Dispatcher.h> #include <activemq/core/ActiveMQMessageAudit.h> #include <activemq/util/IdGenerator.h> #include <activemq/commands/Message.h> #include <activemq/commands/ActiveMQDestination.h> #include <activemq/command...
eId> id(new MessageId); id->setProducerId(pid); id->setProducerSequenceId(i); list.add(id); message->setMessageId(id); CPPUNIT_ASSERT(!audit.isDuplicate(dispatcher.get(), message)); } int index = list.size() -1 -audit.getAuditDepth(); for (; index < list.size(); ind...
ucerNumber() == ActiveMQMessageAudit::MAXIMUM_PRODUCER_COUNT); } void ConnectionAuditTest::testConstructor2() { ConnectionAudit audit(100, 200); CPPUNIT_ASSERT(audit.isCheckForDuplicates()); CPPUNIT_ASSERT(audit.getAuditDepth() == 100); CPPUNIT_ASSERT(audit.getAuditMaximumProducerNumber() == 200); } ...
random
[ { "content": " class DECAF_API Reader: public virtual decaf::io::Closeable, public virtual decaf::lang::Readable {\n\n private:\n\n\n\n Reader(const Reader&);\n\n Reader& operator=(const Reader&);\n\n\n\n protected:\n\n\n\n Reader();\n\n\n\n public:\n\n\n\n virtual ~Reade...
C++
PlayTools/mainwindow.cpp
memorywalker/playtools
39441f3df16484a0784a5cc3b62c57af049fdc52
#include "mainwindow.h" #include "firewallrules.h" #include "ui_mainwindow.h" #include <Windows.h> #include "AutoMate.h" #include <QDebug> #include <QHotkey> #include <QSound> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , m_nLuckwheelInteval(4000) { ui->setupUi(t...
#include "mainwindow.h" #include "firewallrules.h" #include "ui_mainwindow.h" #include <Windows.h> #include "AutoMate.h" #include <QDebug> #include <QHotkey> #include <QSound> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , m_nLuckwheelInteval(4000) { ui->setupUi(t...
m_firewallRules.StartProcessOffline(m_GtaProcessPath); } else { m_firewallRules.StopProcessOffine(); } switchOn = !switchOn; if (switchOn) { ui->disconnectProcessButton->setStyleSheet("background-color: rgb(255, 0, 0)"); } else { ui->disconnectProcess...
_FuncHotkeys[FunctionType_Finger]->setShortcut(QKeySequence(strKey), true); conn = QObject::connect(m_FuncHotkeys[FunctionType_Finger], &QHotkey::activated, this, &MainWindow::on_fingerPrintButton_clicked); Q_ASSERT(conn); strKey = ui->lineEditLuckyWheel->text().trimmed().toLower(); m_FuncHotkeys[FunctionType_Luck...
random
[ { "content": "class AutoMate\n\n{\n\npublic:\n\n\tAutoMate();\n\n\t~AutoMate();\n\n\n\n\tvoid SetWindow(QObject* qObj);\n\n\n\n\tvoid SendTestCommand();\n\n\n\n\tvoid SendSnackCmd();\n\n\tvoid SendArmorCmd();\n\n\tvoid SendDoomsDayIICmd();\n\n\tvoid SendDoomsDayIIICmd();\n\n\tvoid SendLuckyWheelCmd(int millisec...
C++
fltl/include/mpl/Static.hpp
iambrosie/Grail-Plus
e102de735e86df241e4311394190ad39181f073b
#ifndef FLTL_STATIC_HPP_ #define FLTL_STATIC_HPP_ #include <new> namespace fltl { namespace mpl { namespace detail { template <typename T> class StaticValue { public: inline static T &default_value(void) throw() { static T val; static bool is...
#ifndef FLTL_STATIC_HPP_ #define FLTL_STATIC_HPP_ #include <new> namespace fltl { namespace mpl { namespace detail { template <typename T> class StaticValue { public: inline static T &default_value(void) throw() { static T val; static bool is...
taticValue<unsigned short> { public: inline static unsigned short &default_value(void) throw() { static unsigned short val(0U); return val; } }; template <> class StaticValue<int> { public: inline static int &de...
public: inline static T *&default_value(void) throw() { static T *val(0); return val; } }; template <> class StaticValue<char> { public: inline static char &default_value(void) throw() { static c...
random
[ { "content": " class IfTrue<true,ThenT,ElseT> {\n\n public:\n\n typedef ThenT type;\n\n };\n\n\n\n template <typename T0, typename T2, typename ThenT, typename ElseT>\n", "file_path": "fltl/include/mpl/If.hpp", "rank": 1, "score": 226457.0076507059 }, { "content": " cla...
C++
src/chwSurfaceTweak.cpp
bradleyhenke/chwtools
733e346b4dc6452954b6ba19899d2ccf0a0cd79f
#include "chwSurfaceTweak.h" const MTypeId chwSurfaceTweak::typeId( 0x89007 ); const MString chwSurfaceTweak::typeName( "chwSurfaceTweak" ); MObject chwSurfaceTweak::aInVert; MObject chwSurfaceTweak::aFalloffMode; MObject chwSurfaceTweak::aFalloffCurve; MObject chwSurfaceTweak::aFalloffRadius; MObject ...
#include "chwSurfaceTweak.h" const MTypeId chwSurfaceTweak::typeId( 0x89007 ); const MString chwSurfaceTweak::typeName( "chwSurfaceTweak" ); MObject chwSurfaceTweak::aInVert; MObject chwSurfaceTweak::aFalloffMode; MObject chwSurfaceTweak::aFalloffCurve; MObject chwSurfaceTweak::aFalloffRadius; MObject ...
void chwSurfaceTweak::postConstructor() { MStatus status; status = postConstructor_initialise_ramp_curve( aFalloffCurve, 0, 0.0f, 1.0f, 2 ); CHECK_MSTATUS(status); status = postConstructor_initialise_ramp_curve( aFalloffCurve, 1, 1.0f, 0.0f, 2 ); CHECK_MSTATUS(status); }
MStatus chwSurfaceTweak::postConstructor_initialise_ramp_curve( MObject &rampObj, int index, float position, float value, int interpolation) { MStatus status; MObject thisNode = this->thisMObject(); MPlug rampPlug( thisNode, rampObj ); MPlug elementPlug = rampPlug.elementByLogicalIndex( index, &status ); MPlug ...
function_block-full_function
[ { "content": "class chwVertexBindData\n\n{\n\n\tpublic:\n\n\t\tMPointArray\t\tm_drvpoints;\n\n\t\tMPointArray\t\tm_defpoints;\n\n\t\tMFloatArray\t\tm_weights;\n\n\t\tMIntArray\t\tm_mapping;\n\n\t\tMMatrix\t\t\tm_localToWorldMatrix;\n\n\t\tfloat\t\t\tm_cutoffDistance;\n\n\t\tfloat\t\t\tm_searchDistance;\n\n};\n\...
C++
src/transpiler/transpiler.cpp
GeminiLab/afbd
6855eedd6e3b1309adea2071074d0ce0003e6079
#include <transpiler/transpiler.h> #include <llvm/IR/TypeBuilder.h> #include <queue> #include <set> #include <sstream> #include <iostream> using namespace std; using namespace afbd; void print_common_header(fstream &fs) { } shared_ptr<set<shared_ptr<Instruction>>> get_all_instrs(shared_ptr<Instruction> root) {...
#include <transpiler/transpiler.h> #include <llvm/IR/TypeBuilder.h> #include <queue> #include <set> #include <sstream> #include <iostream> using namespace std; using namespace afbd; void print_common_header(fstream &fs) { } shared_ptr<set<shared_ptr<Instruction>>> get_all_instrs(shared_ptr<Instruction> root) {...
process_type = llvm::FunctionType::get( voidTy, llvm::ArrayRef<llvm::Type *>{sim_type->getPointerTo()}, false ); set_var_count = llvm::Function::Create( llvm::FunctionType::get( voidTy, llvm::ArrayRef<llvm::Type *>{var...
(x->triggers()->size() > 0) { builder.CreateCall(prepare_wait); for (auto &w: *x->triggers()) { builder.CreateCall( add_wait, llvm::ArrayRef<llvm::Value*> { builder.getInt32(v...
random
[ { "content": "class SigSet<T, typename std::enable_if<!std::is_pointer<T>::value>::type> : public SigSet<T, std::less<T>> {};\n\ntemplate<typename T>\n\nusing sort_by_name_id_guard = typename std::enable_if<std::is_same<T,RTLIL::Cell*>::value>::type;\n\ntemplate<typename T>\n", "file_path": "3rd/yosys/inclu...
C++
Editor/HairParticleWindow.cpp
mewbak/WickedEngine
572bc7836fa14793b1c3b3b4733ddc61f1da5887
#include "stdafx.h" #include "HairParticleWindow.h" using namespace std; using namespace wiECS; using namespace wiScene; HairParticleWindow::HairParticleWindow(wiGUI* gui) : GUI(gui) { assert(GUI && "Invalid GUI!"); float screenW = (float)wiRenderer::GetDevice()->GetScreenWidth(); float screenH = (float)wiRendere...
#include "stdafx.h" #include "HairParticleWindow.h" using namespace std; using namespace wiECS; using namespace wiScene; HairParticleWindow::HairParticleWindow(wiGUI* gui) : GUI(gui) { assert(GUI && "Invalid GUI!"); float screenW = (float)wiRenderer::GetDevice()->GetScreenWidth(); float screenH = (float)wiRendere...
; addButton->SetTooltip("Add new hair particle system."); hairWindow->AddWidget(addButton); meshComboBox = new wiComboBox("Mesh: "); meshComboBox->SetSize(XMFLOAT2(300, 25)); meshComboBox->SetPos(XMFLOAT2(x, y += step)); meshComboBox->SetEnabled(false); meshComboBox->OnSelect([&](wiEventArgs args) { auto hair...
addButton->OnClick([&](wiEventArgs args) { Scene& scene = wiScene::GetScene(); scene.Entity_CreateHair("editorHair"); })
call_expression
[ { "content": "class wiGUI;\n", "file_path": "Editor/HairParticleWindow.h", "rank": 0, "score": 231629.97973045165 }, { "content": "class HairParticleWindow\n\n{\n\npublic:\n\n\tHairParticleWindow(wiGUI* gui);\n\n\t~HairParticleWindow();\n\n\n\n\twiECS::Entity entity;\n\n\tvoid SetEntity(wiEC...
C++
libmarch/include/march/python/wrapper_core.hpp
j8xixo12/solvcon
a8bf3a54d4b1ed91d292e0cdbcb6f2710d33d99a
#pragma once #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <utility> #include <memory> #include <vector> #include <algorithm> #include <cstring> #include "march.hpp" #include "march/python/WrapBase.hpp" namespace march { namespace python { class MARCH_PYTHON_WRAPPER_VISIBILITY WrapBuffer : p...
#pragma once #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <utility> #include <memory> #include <vector> #include <algorithm> #include <cstring> #include "march.hpp" #include "march/python/WrapBase.hpp" namespace march { namespace python { class MARCH_PYTHON_WRAPPER_VISIBILITY WrapBuffer : p...
}, "Ghost-part array.") .def_property( "B", [](LookupTableCore & tbl) { return Table(tbl).body(); }, [](LookupTableCore & tbl, py::array src) { Table::CopyInto(Table(tbl).body(), src); }, "Body-part array.") ; } wrapper_ty...
if (tbl.nghost()) { Table::CopyInto(Table(tbl).ghost(), src); } else { throw py::index_error("ghost is zero"); }
if_condition
[ { "content": "class LookupTable<ElemType, 0>: public LookupTableCore\n\n{\n\n\n\npublic:\n\n\n\n using elem_type = ElemType;\n\n\n\n typedef elem_type (&row_type);\n\n typedef const elem_type (&const_row_type);\n\n\n\n LookupTable() {}\n\n\n\n LookupTable(index_type nghost, index_type nbody)\n\n ...
C++
cpp/mindalpha/dense_tensor.cpp
mindalpha/MindAlpha
5b6fe017a37238884a6e963fd6b0a1492938e186
#include <string.h> #include <json11.hpp> #include <mindalpha/dense_tensor.h> #include <mindalpha/file_utils.h> #include <mindalpha/tensor_utils.h> namespace mindalpha { void DenseTensor::Init(std::function<void()> cb) { PSMessage req = std::make_shared<Message>(); json11::Json json = json11::Json::object ...
#include <string.h> #include <json11.hpp> #include <mindalpha/dense_tensor.h> #include <mindalpha/file_utils.h> #include <mindalpha/tensor_utils.h> namespace mindalpha { void DenseTensor::Init(std::function<void()> cb) { PSMessage req = std::make_shared<Message>(); json11::Json json = json11::Json::object ...
} void DenseTensor::Save(const std::string& dir_path, std::function<void()> cb) { PullMeta([this, dir_path, cb](DenseTensorMeta meta) { std::string meta_path = GetDenseMetaPath(dir_path); std::string str = meta.ToJsonString(); EnsureLocalDirectory(dir_path); StreamWriteAll(meta_pat...
if (keep_meta || agent_->GetAgentRank() != 0) push_data_and_state(); else { meta.SetName(GetMeta().GetName()); meta.SetPartitionCount(agent_->GetServerCount()); PushMeta(meta, push_data_and_state); }
if_condition
[ { "content": "class DenseTensorMeta\n\n{\n\npublic:\n\n const std::string& GetName() const { return name_; }\n\n void SetName(std::string value) { name_ = std::move(value); }\n\n\n\n DataType GetDataType() const { return data_type_; }\n\n void SetDataType(DataType value) { data_type_ = value; }\n\n\...
C++
chrome/browser/ui/views/tabs/color_picker_view.cc
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
#include "chrome/browser/ui/views/tabs/color_picker_view.h" #include <memory> #include <vector> #include "base/bind.h" #include "base/callback.h" #include "base/containers/span.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/ui/tabs/tab_group_theme.h" #include "chrome/browser/ui/view...
#include "chrome/browser/ui/views/tabs/color_picker_view.h" #include <memory> #include <vector> #include "base/bind.h" #include "base/callback.h" #include "base/containers/span.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/ui/tabs/tab_group_theme.h" #include "chrome/browser/ui/view...
void ButtonPressed(Button* sender, const ui::Event& event) override { DCHECK_EQ(this, sender); if (!selected_) { selected_ = true; SchedulePaint(); selected_callback_.Run(this); } } private: void PaintSelectionIndicator(gfx::Canvas* canvas) { if (!selected_) { ...
l_Style); flags.setColor(color); flags.setAntiAlias(true); canvas->DrawCircle(bounds.CenterPoint(), bounds.width() / 2.0f, flags); PaintSelectionIndicator(canvas); }
function_block-function_prefixed
[]
C++
src/libmv/simple_pipeline/camera_intrinsics.cc
Matthias-Fauconneau/libmv
531c79bf95fddaaa70707d1abcd4fdafda16bbf0
#include "libmv/simple_pipeline/camera_intrinsics.h" #include "libmv/numeric/levenberg_marquardt.h" namespace libmv { struct Offset { signed char ix,iy; unsigned char fx,fy; }; CameraIntrinsics::CameraIntrinsics() : K_(Mat3::Identity()), image_width_(0), image_height_(0), k1_(0), k2_(0)...
#include "libmv/simple_pipeline/camera_intrinsics.h" #include "libmv/numeric/levenberg_marquardt.h" namespace libmv { struct Offset { signed char ix,iy; unsigned char fx,fy; }; CameraIntrinsics::CameraIntrinsics() : K_(Mat3::Identity()), image_width_(0), image_height_(0), k1_(0), k2_(0)...
(undistort_,src,dst,width,height); } }
t i = 0; i < N; i++) { dst[(y*width+x)*N+i] = ((s[ i] * (256-offset.fx) + s[ N+i] * offset.fx) * (256-offset.fy) +(s[width*N+i] * (256-offset.fx) + s[width*N+N+i] * offset.fx) * offset.fy) / (256*256); } } } } void CameraIntrinsics::FreeLookupGrid() { ...
random
[ { "content": "struct tuple_size<GTEST_2_TUPLE_(T)> { static const int value = 2; };\n\n\n\ntemplate <GTEST_3_TYPENAMES_(T)>\n", "file_path": "src/third_party/gtest/include/gtest/internal/gtest-tuple.h", "rank": 1, "score": 343036.2119991771 }, { "content": "struct tuple_size<GTEST_0_TUPLE_(T...
C++
tests/experimental/strong_type/strong_type.t.cpp
tobanteAudio/taetl
0aa6365aa156b297745f395882ff366a8626e5e0
#include "etl/experimental/strong_type/strong_type.hpp" #include "etl/cstdint.hpp" #include "etl/type_traits.hpp" #include "testing/testing.hpp" using namespace etl::experimental; template <typename T> constexpr auto test() -> bool { { using Kilogram = strong_type<T, struct Kilogram_tag>; au...
#include "etl/experimental/strong_type/strong_type.hpp" #include "etl/cstdint.hpp" #include "etl/type_traits.hpp" #include "testing/testing.hpp" using namespace etl::experimental; template <typename T> constexpr auto test() -> bool { { using Kilogram = strong_type<T, struct Kilogram_tag>; au...
to const sum = lhs / rhs; assert((sum.raw_value() == T(1))); } { using Hertz = strong_type<T, struct Hertz_tag, skill::comparable>; auto const lhs = Hertz { typename Hertz::value_type(44) }; auto const rhs = Hertz { typename Hertz::value_type(48) }; assert((lhs.raw_...
:is_constructible_v<Kilo>)); assert((etl::is_trivially_constructible_v<Kilo>)); assert((etl::is_nothrow_constructible_v<Kilo>)); assert((etl::is_destructible_v<Kilo>)); assert((etl::is_trivially_destructible_v<Kilo>)); assert((etl::is_nothrow_destructible_v<Kilo>)); ass...
function_block-random_span
[ { "content": "struct auto_reg {\n\n explicit auto_reg(name_and_tags const& sp, test_func_t func)\n\n {\n\n current_session().add_test(sp, func);\n\n }\n\n};\n\n\n\n} // namespace etl::test\n\n\n\n#endif // ETL_EXPERIMENTAL_TESTING_SESSION_HPP\n", "file_path": "etl/experimental/testing/sessio...
C++
tests/benchmark/src/UAutomizerFileReader-test.cpp
typesAreSpaces/AXDInterpolator
e0759c806480ff54b7a4f878e007b534a71dad44
#include "UAutomizerFileReader.h" void UAutomizerFileReader::testAXDInterpolator() const { TEMP_FILE_SETUP; BENCHMARK_COMMAND( z3::solver tseitin_solver(ctx, "QF_AUFLIA"); tseitin_solver.add(z3::mk_and(part_a)); tseitin_solver.add(z3::mk_and(part_b)); axdinterpolator_file << tseitin_solve...
#include "UAutomizerFileReader.h" void UAutomizerFileReader::testAXDInterpolator() const { TEMP_FILE_SETUP; BENCHMARK_COMMAND( z3::solver tseitin_solver(ctx, "QF_AUFLIA"); tseitin_solver.add(z3::mk_and(part_a)); tseitin_solver.add(z3::mk_and(part_b)); axdinterpolator_file << tseitin_solve...
interpolant_from_file += ")\n"; interpolant_from_file += "(check-sat)\n"; system(("rm -rf " + temp_file_name).c_str()); z3::solver smtinterpol_interpolant_parser(ctx, "QF_AUFLIA"); smtinterpol_interpolant_parser.from_string(interpolant_from_file.c_str()); ...
function_block-function_prefix_line
[ { "content": "enum SMT_SOLVER { Z3, MATHSAT, SMTINTERPOL };\n\n\n", "file_path": "tests/benchmark/include/UAutomizerFileReader.h", "rank": 0, "score": 219527.99814903465 }, { "content": "enum BENCHMARK_EXIT_CODE { SUCCESS, FAILED, TIMEOUT };\n", "file_path": "tests/benchmark/include/UAut...
C++
problemes/probleme1xx/probleme185.cpp
ZongoForSpeed/ProjectEuler
2e2d45f984d48a1da8275886c976f909a0de94ce
#include "problemes.h" #include "arithmetique.h" #include <fstream> typedef unsigned long long nombre; typedef std::vector<nombre> vecteur; typedef std::pair<std::string, unsigned short> paire; typedef std::vector<paire> ensemble; namespace { template<typename Iterator> bool cherche_solution(Iterator debut,...
#include "problemes.h" #include "arithmetique.h" #include <fstream> typedef unsigned long long nombre; typedef std::vector<nombre> vecteur; typedef std::pair<std::string, unsigned short> paire; typedef std::vector<paire> ensemble; namespace { template<typename Iterator> bool cherche_solution(Iterator debut,...
} ENREGISTRER_PROBLEME(185, "Number Mind") { std::ifstream ifs("data/p185_number_mind.txt"); ...
if (s.find(essai.first[n]) == s.end()) { test.erase(n); } } if (test.size() < essai.second) return false; if (essai.second == 0) { for (size_t n: test) { solutions[n].erase(essai.first[n]); } return ch...
function_block-function_prefix_line
[ { "content": " class numeric_limits<mpz_nombre> : public numeric_limits<long long> {\n\n public:\n\n static constexpr int digits = INT_MAX;\n\n static constexpr int digits10 = INT_MAX;\n\n\n\n static mpz_nombre max() {\n\n return mpz_nombre::puissance(2, digits);\n\n ...
C++
include/zisa/memory/array_view_impl.hpp
1uc/ZisaMemory
9d9689e46e63629f842b04765bc322f32d91758e
#ifndef ARRAY_VIEW_IMPL_HPP #define ARRAY_VIEW_IMPL_HPP namespace zisa { template <class T> auto raw_ptr(T *a) -> decltype(a) { return a; } template <class T, class Indexing> array_view_base<T, Indexing>::array_view_base(array_view_base::shape_type shape, T *ptr, ...
#ifndef ARRAY_VIEW_IMPL_HPP #define ARRAY_VIEW_IMPL_HPP namespace zisa { template <class T> auto raw_ptr(T *a) -> decltype(a) { return a; } template <class T, class Indexing> array_view_base<T, Indexing>::array_view_base(array_view_base::shape_type shape, T *ptr, ...
int n_dims, template <int> class Indexing> T const *array_view<T, n_dims, Indexing>::cbegin() const { return this->_ptr; } template <class T, int n_dims, template <int> class Indexing> T const *array_view<T, n_dims, Indexing>::cend() const { return this->_ptr + this->size(); } template <class T, int n_dims, templ...
s, template <int> class Indexing> T &array_view<T, n_dims, Indexing>::operator[](array_view::size_type i) const { return this->_ptr[i]; } template <class T, int n_dims, template <int> class Indexing> template <class... Ints> T &array_view<T, n_dims, Indexing>::operator()(Ints... ints) const { auto l = Indexing<n_d...
random
[ { "content": "class array_const_view : public array_view_base<const T, Indexing<n_dims>> {\n\n\n\nprivate:\n\n using super = array_view_base<const T, Indexing<n_dims>>;\n\n using size_type = typename super::size_type;\n\n\n\npublic:\n\n ANY_DEVICE_INLINE\n\n array_const_view(const shape_t<n_dims> &shape,\n\...
C++
src/developer/debug/unwinder/dwarf_cfi.cc
lalrochhara/fuchsia
f56c62fa108cfd72b8034eeddb4e403f1f69fdbd
#include "src/developer/debug/unwinder/dwarf_cfi.h" #include <algorithm> #include <cinttypes> #include <cstdint> #include <map> #include <string> #include "src/developer/debug/unwinder/dwarf_cfi_parser.h" #include "third_party/crashpad/third_party/glibc/elf/elf.h" namespace unwinder { namespace { struct DwarfCie...
#include "src/developer/debug/unwinder/dwarf_cfi.h" #include <algorithm> #include <cinttypes> #include <cstdint> #include <map> #include <string> #include "src/developer/debug/unwinder/dwarf_cfi_parser.h" #include "third_party/crashpad/third_party/glibc/elf/elf.h" namespace unwinder { namespace { struct DwarfCie...
cfi_parser.Snapshot(); if (auto err = cfi_parser.ParseInstructions(elf_, cie.code_alignment_factor, cie.data_alignment_factor, fde.instructions_begin, fde.instructions_end, pc - fde.pc_begin); err.has_err()) { ...
if (auto err = cfi_parser.ParseInstructions(elf_, cie.code_alignment_factor, cie.data_alignment_factor, cie.instructions_begin, cie.instructions_end, -1); err.has_err()) { return err; }
if_condition
[]
C++
Code/trunk/cpp/Geometry/CartesianMesh/CartesianMesh_base.hh
jlconlin/PhDThesis
8e704613721a800ce1c59576e94f40fa6f7cd986
#ifndef CARTESIANMESH_BASE_HH #define CARTESIANMESH_BASE_HH #include <boost/ptr_container/ptr_vector.hpp> #include "Types.hh" #include "Dimension.hh" #include "GeomId.hh" #include "MeshTraits.hh" #include "Assert.hh" #include "GeometricElementConcept.hh" using boost::ptr_vector; template<typename dimension_type, ...
#ifndef CARTESIANMESH_BASE_HH #define CARTESIANMESH_BASE_HH #include <boost/ptr_container/ptr_vector.hpp> #include "Types.hh" #include "Dimension.hh" #include "GeomId.hh" #include "MeshTraits.hh" #include "Assert.hh" #include "GeometricElementConcept.hh" using boost::ptr_vector; template<typename dimension_type, ...
typename Base::const_NodeIterator nodeEnd() const { return typename Base::const_NodeIterator( mNodes, mNodes.end() ); } typename Base::CornerIterator cornerBegin() { return typename Base::CornerIterator( mCorners, mCorners.begin() ); } typename Base::CornerIterator cornerEnd() { r...
return 0; else return mGhostCorners->size(); } typename Base::ZoneIterator zoneBegin() { return typename Base::ZoneIterator( mZones, mZones.begin() ); } typename Base::ZoneIterator zoneEnd() { return typename Base::ZoneIterator( mZones, mZones.end() ); } typen...
random
[ { "content": "class MeshBaseException : public ExceptionBase\n\n{\n\npublic:\n\n /// Imports the \\c LineNumType from the \\c ExceptionBase base class.\n\n\ttypedef ExceptionBase::LineNumType LineNumType;\n\n\n\n\t/*! \\brief Constructor. Takes in the line number and filename where the exception \n\n\t * ...
C++
OpenSees/SRC/element/PFEMElement/TclModelBuilder_addPFEMElement.cpp
kuanshi/ductile-fracture
ccb350564df54f5c5ec3a079100effe261b46650
#include "TclModelBuilder_addPFEMElement.h" #include "PFEMElement2D.h" #include "PFEMElement2DFIC.h" #include "PFEMElement2DCompressible.h" #include "PFEMElement2DBubble.h" #include "PFEMElement2Dmini.h" #include "PFEMElement3D.h" #include <cstring> #include <string> int TclModelBuilder_addPFEMElement2D(ClientData cli...
#include "TclModelBuilder_addPFEMElement.h" #include "PFEMElement2D.h" #include "PFEMElement2DFIC.h" #include "PFEMElement2DCompressible.h" #include "PFEMElement2DBubble.h" #include "PFEMElement2Dmini.h" #include "PFEMElement3D.h" #include <cstring> #include <string>
int TclModelBuilder_addPFEMElement3D(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv, Domain *theDomain, TclModelBuilder *theBuilder) { if(argc < 13) { opserr << "Invalid #args: wan...
int TclModelBuilder_addPFEMElement2D(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv, Domain *theDomain, TclModelBuilder *theBuilder) { if(argc < 11) { opserr << "Invalid #args: want ...
function_block-full_function
[ { "content": " CONST char *string;\t\t/* Last string passed to Tcl_RegExpExec. */\n", "file_path": "OpenSees/SRC/tcl/include/tclRegexp.h", "rank": 0, "score": 183596.33256221714 }, { "content": " public TypedIOPort string;\n", "file_path": "OpenSees/SRC/java/kepler/opensees/StringT...
C++
OpenTES4/bsa.cpp
Cyril-Meyer/OpenTES4Oblivion
dc2791a5a7ea911d0960d79ce0b9445fcbe329ee
#include "bsa.h" BSA::BSA() {} void BSA::summary() { std::cout << "header" << std::endl; std::cout << this->header.fileId << std::endl; std::cout << this->header.version << std::endl; std::cout << this->header.offset << std::endl; std::cout << this->header.archiveFlags << std::endl; std::cout ...
#include "bsa.h" BSA::BSA() {} void BSA::summary() { std::cout << "header" << std::endl; std::cout << this->header.fileId << std::endl; std::cout << this->header.version << std::endl; std::cout << this->header.offset << std::endl; std::cout << this->header.archiveFlags << std::endl; std::cout ...
frb.name = bzs; for (uint32_t j = 0; j < bsa.folderRecords[i].count; ++j) { BSA::FileRecord fr; read(is, &fr.nameHash, sizeof(fr.nameHash)); read(is, &fr.size, sizeof(fr.size)); read(is, &fr.offset, sizeof(fr.offset)); frb.fileRecords.push_...
if (archiveFlags.test(0)) { read(is, &bzs.length, sizeof(bzs.length)); bzs.data = new char[bzs.length]; read(is, bzs.data, bzs.length); if (bzs.data[bzs.length - 1] != '\0') { std::cout << "ERROR : invalid bzstring" << std::endl; ...
if_condition
[ { "content": " def read(self):\n\n # open file\n\n file = open(self.filename, 'rb')\n\n # read file header\n\n self.header = {\n\n \"fileId\": str(file.read(4)),\n\n \"version\": bytes_to_int(file.read(4)),\n\n \"offset\": bytes_to_int(file.read(4)...
C++
libuuidpp/libuuidpp.hpp
dagronf/UUID_Wrapper
6ad8e7390d200bb96ef3e6e815650c2d5a2f886c
#pragma once #include <uuid/uuid.h> #include <string> #include <array> #ifndef __APPLE__ #include <string.h> typedef char __uuid_string_t[37]; typedef __uuid_string_t uuid_string_t; #endif static_assert(16 == sizeof(uuid_t), "uuid_t is of unexpected size"); static_assert(37 == sizeof(uuid_string_t), "Unexpected ...
#pragma once #include <uuid/uuid.h> #include <string> #include <array> #ifndef __APPLE__ #include <string.h> typedef char __uuid_string_t[37]; typedef __uuid_string_t uuid_string_t; #endif static_assert(16 == sizeof(uuid_t), "uuid_t is of unexpected size"); static_assert(37 == sizeof(uuid_string_t), "Unexpected ...
bool uuid::internal_microsoft_create(const char* uuidString, uuid_t& result) { if (is_microsoft_formatted(uuidString)) { char temp[STR_GUID_LEN]; ::memset(temp, 0, STR_GUID_LEN); ::memcpy(temp, uuidString+1, STR_GUID_LEN - 1); if (::uuid_parse(temp, result) != 0) { return false; } return true; } ret...
g != nullptr) { if (internal_microsoft_create(uuidString, result)) { return true; } else if (internal_uuid_create(uuidString, result)) { return true; } } ::uuid_clear(result); return false; }
function_block-function_prefixed
[ { "content": "# libuuidpp - A lightweight C++ UUID class.\n\n\n\nA lightweight C++ class wrapper around the `libuuid` library.\n\n\n\n## Features\n\n\n\n* Compatible with std containers such as `std::vector`, `std::set`, `std::map` etc.\n\n* Handles upper and lower case uuids.\n\n* Automatically handles Microso...
C++
Base/QTGUI/qSlicerExtensionsManagerDialog.cxx
TheInterventionCentre/NorMIT-Plan-App
765ed9a5dccc1cc134b65ccabe93fc132baeb2ea
#include <QPushButton> #include "qSlicerApplication.h" #include "qSlicerExtensionsManagerDialog.h" #include "qSlicerExtensionsManagerModel.h" #include "qSlicerSettingsExtensionsPanel.h" #include "ui_qSlicerExtensionsManagerDialog.h" class qSlicerExtensionsManagerDialogPrivate: public Ui_qSlicerExtensionsManagerDial...
#include <QPushButton> #include "qSlicerApplication.h" #include "qSlicerExtensionsManagerDialog.h" #include "qSlicerExtensionsManagerModel.h" #include "qSlicerSettingsExtensionsPanel.h" #include "ui_qSlicerExtensionsManagerDialog.h" class qSlicerExtensionsManagerDialogPrivate: public Ui_qSlicerExtensionsManagerDial...
lication * coreApp = qSlicerCoreApplication::application(); if (d->PreviousModulesAdditionalPaths != coreApp->revisionUserSettings()->value("Modules/AdditionalPaths").toStringList() || d->PreviousExtensionsScheduledForUninstall != coreApp->revisionUserSettings()->value("Extensions/ScheduledForUninst...
)->revisionUserSettings(); this->PreviousModulesAdditionalPaths = settings->value("Modules/AdditionalPaths").toStringList(); this->PreviousExtensionsScheduledForUninstall = settings->value("Extensions/ScheduledForUninstall").toStringList(); this->PreviousExtensionsScheduledForUpdate = settings->value("Extensions/...
random
[ { "content": "class DiffusionTensor3DTransform : public Object\n\n{\n\npublic:\n\n typedef TData DataType;\n\n typedef double TransformType;\n\n typedef DiffusionTensor3DTransform Self;\n\n typedef Point<TransformType, 3> PointT...
C++
main/sw/source/ui/docvw/SidebarTxtControlAcc.cxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
#include "precompiled_sw.hxx" #include <SidebarTxtControlAcc.hxx> #include <SidebarTxtControl.hxx> #include <svl/brdcst.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> #include <editeng/unoedsrc.hxx> #include <editeng/unoforou.hxx> #include <editeng/unoviwou.hxx> #include <editeng/unoedhlp.hxx> #include <s...
#include "precompiled_sw.hxx" #include <SidebarTxtControlAcc.hxx> #include <SidebarTxtControl.hxx> #include <svl/brdcst.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> #include <editeng/unoedsrc.hxx> #include <editeng/unoforou.hxx> #include <editeng/unoviwou.hxx> #include <editeng/unoedhlp.hxx> #include <s...
} SidebarTextEditSource::~SidebarTextEditSource() { if ( mrSidebarTxtControl.GetTextView() ) { mrSidebarTxtControl.GetTextView()->GetOutliner()->SetNotifyHdl( Link() ); } } SvxEditSource* SidebarTextEditSource::Clone() const { return new SidebarTextEditSource( mrSidebarTxtControl ); } SvxTex...
if ( mrSidebarTxtControl.GetTextView() ) { mrSidebarTxtControl.GetTextView()->GetOutliner()->SetNotifyHdl( LINK(this, SidebarTextEditSource, NotifyHdl) ); }
if_condition
[]
C++
Operations/albaOpExporterAnsysCommon.cpp
IOR-BIC/ALBA
b574968b05d9a3a2756dd2ac61d015a0d20232a4
#include "albaDefines.h" #include "albaOpExporterAnsysCommon.h" #include "albaOpImporterAnsysCommon.h" #include "albaDecl.h" #include "albaGUI.h" #include "albaSmartPointer.h" #include "albaTagItem.h" #include "albaTagArray.h" #include "albaVME.h" #include "albaVMEMesh.h" #include "albaVMEMeshAnsysTextExporter.h"...
#include "albaDefines.h" #include "albaOpExporterAnsysCommon.h" #include "albaOpImporterAnsysCommon.h" #include "albaDecl.h" #include "albaGUI.h" #include "albaSmartPointer.h" #include "albaTagItem.h" #include "albaTagArray.h" #include "albaVME.h" #include "albaVMEMesh.h" #include "albaVMEMeshAnsysTextExporter.h"...
} } ExportElement *albaOpExporterAnsysCommon::CreateExportElements(albaVMEMesh * input, int rowsNumber, vtkUnstructuredGrid * inputUGrid, FILE * file) { vtkIntArray *elementIdArray = input->GetElementsIDArray(); vtkIntArray *nodesIDArray = input->GetNodesIDArray(); vtkIntArray *typeArray = input->G...
if (result < 0) return -1; else if (result > 0) return 1; else { result = a->elementID - b->elementID; if (result < 0) return -1; else if (result > 0) return 1; else assert(0); }
if_condition
[ { "content": " function is of type void *, and returns NULL.\n\n Otherwise the type is void which is correct for WIN32\n\n and SPROC\n\n*/ \n\n#ifdef CMAKE_USE_SPROC_INIT\n\ntypedef int mmuThreadProcessIDType;\n\n#endif\n\n\n\n\n\n#ifdef CMAKE_USE_PTHREADS_INIT\n\ntypedef void *(*mmuInternalThreadFunctionTy...
C++
src/test_suites/oclc/oclc_miscellaneous_vector_functions/src/vec_step.cpp
intel/cassian
8e9594f053f9b9464066c8002297346580e4aa2a
#include <algorithm> #include <cassian/catch2_utils/catch2_utils.hpp> #include <cassian/cli/cli.hpp> #include <cassian/runtime/openclc_type_tuples.hpp> #include <cassian/runtime/runtime.hpp> #include <cassian/test_harness/test_harness.hpp> #include <cassian/utility/metaprogramming.hpp> #include <cassian/utility/utili...
#include <algorithm> #include <cassian/catch2_utils/catch2_utils.hpp> #include <cassian/cli/cli.hpp> #include <cassian/runtime/openclc_type_tuples.hpp> #include <cassian/runtime/runtime.hpp> #include <cassian/test_harness/test_harness.hpp> #include <cassian/utility/metaprogramming.hpp> #include <cassian/utility/utili...
template <typename T> std::string get_build_options() { const std::string clc_data_type = T::device_type; std::string build_options = " -D DATA_TYPE=" + clc_data_type; return build_options; } ca::Kernel create_kernel(const std::string &path, const std::string &name, const std::string &...
int get_reference() { using data_host_type = typename T::host_type; if constexpr (ca::is_vector_v<data_host_type>) { return data_host_type::size_in_memory; } return 1; }
function_block-full_function
[ { "content": "/*\n\n * Copyright (C) 2021 Intel Corporation\n\n *\n\n * SPDX-License-Identifier: MIT\n\n *\n\n */\n\n\n\n#ifndef CASSIAN_VECTOR_VECTOR_HPP\n\n#define CASSIAN_VECTOR_VECTOR_HPP\n\n\n\n#include <algorithm>\n\n#include <array>\n\n#include <cstddef>\n\n#include <functional>\n\n#include <initializer_...
C++
Sankore-3.1/src/gui/UBDownloadWidget.cpp
eaglezzb/rsdc
cce881f6542ff206bf286cf798c8ec8da3b51d50
#include <QDebug> #include <QHeaderView> #include <QStyleOptionProgressBarV2> #include <QApplication> #include "UBDownloadWidget.h" #include "globals/UBGlobals.h" #include "core/UBApplication.h" #include "core/memcheck.h" UBDownloadWidget::UBDownloadWidget(QWidget *parent, const char *name):QWidget(parent) , mp...
#include <QDebug> #include <QHeaderView> #include <QStyleOptionProgressBarV2> #include <QApplication> #include "UBDownloadWidget.h" #include "globals/UBGlobals.h" #include "core/UBApplication.h" #include "core/memcheck.h" UBDownloadWidget::UBDownloadWidget(QWidget *parent, const char *name):QWidget(parent) , mp...
n_Desc, Qt::UserRole, QVariant(actualDL.at(i).id)); mpItem->setIcon(eItemColumn_Close, QIcon(":images/close.svg")); mpTree->addTopLevelItem(mpItem); mpItem = new QTreeWidgetItem(mpTree); mpItem->setData(eItemColumn_Desc, Qt::UserRole, actualDL.at(i).currentSize); mpItem->setData(...
("Cancel"), this); mpCancelBttn->setObjectName("DockPaletteWidgetButton"); mpBttnLayout->addWidget(mpCancelBttn, 0); mpLayout->addLayout(mpBttnLayout); connect(UBDownloadManager::downloadManager(), SIGNAL(fileAddedToDownload()), this, SLOT(onFileAddedToDownload())); connect(UBDownloadManager::downl...
random
[ { "content": "\t\tSSL_CIPHER *new_cipher;\n", "file_path": "Sankore-ThirdParty/openssl/0.9.8i/include/openssl/ssl3.h", "rank": 0, "score": 129144.86743968823 }, { "content": "X509V3_EXT_NEW ext_new;\n", "file_path": "Sankore-ThirdParty/openssl/0.9.8i/include/openssl/x509v3.h", "rank"...
C++
libs/semanticsearch/src/semanticsearch/query/query_executor.cpp
devjsc/ledger
5681480faf6e2aeee577f149c17745d6ab4d4ab3
#include "semanticsearch/query/query_executor.hpp" #include <cassert> namespace fetch { namespace semanticsearch { QueryExecutor::QueryExecutor(SharedSemanticSearchModule instance, ErrorTracker &error_tracker) : error_tracker_(error_tracker) , semantic_search_module_{std::move(instance)} {} void QueryExecutor...
#include "semanticsearch/query/query_executor.hpp" #include <cassert> namespace fetch { namespace semanticsearch { QueryExecutor::QueryExecutor(SharedSemanticSearchModule instance, ErrorTracker &error_tracker) : error_tracker_(error_tracker) , semantic_search_module_{std::move(instance)} {} void QueryExecutor...
; } void QueryExecutor::ExecuteSet(CompiledStatement const &stmt) { using Type = QueryInstruction::Type; std::size_t i = 3; if (stmt.size() < i) { error_tracker_.RaiseSyntaxError("Set statment has incorrect syntax.", stmt[0].token); return; } if (stmt[1].type != Type::IDENTIFIER) { error...
model->VisitSubmodelsWithVocabulary( [this, stmt](std::string, std::string mname, Vocabulary obj) { auto model = semantic_search_module_->GetModel(mname); if (model == nullptr) { error_tracker_.RaiseSyntaxError("Could not find model '" + mname + "'", stmt[1].token); ret...
call_expression
[ { "content": " enum class Type\n\n {\n\n UNKNOWN = 0,\n\n SET_CONTEXT,\n\n PUSH_SCOPE,\n\n POP_SCOPE,\n\n\n\n FUNCTION = 50,\n\n EXECUTE_CALL,\n\n\n\n // Operators come first and are ordered according to precendence\n\n // That is: DO not change the order unless you intensionally\n\n ...
C++
ipc/src/client_endpoint_com.cpp
tyoma/micro-profiler
32f6981c643b93997752d414f631fd6684772b28
#include <ipc/endpoint.h> #include <atlbase.h> #include <common/module.h> #include <common/string.h> #include <ipc/com/init.h> #include <functional> using namespace std; namespace micro_profiler { namespace ipc { namespace com { class inbound_stream : public ISequentialStream { public: inbound_s...
#include <ipc/endpoint.h> #include <atlbase.h> #include <common/module.h> #include <common/string.h> #include <ipc/com/init.h> #include <functional> using namespace std; namespace micro_profiler { namespace ipc { namespace com { class inbound_stream : public ISequentialStream { public: inbound_s...
channel_ptr_t connect_client(const char *destination_endpoint_id, channel &inbound) { return channel_ptr_t(new client_session(destination_endpoint_id, inbound)); } } } }
shared_ptr<void> client_session::lock_activation_context(const shared_ptr<void> &ctx) { ULONG_PTR cookie; return ctx && ::ActivateActCtx(ctx.get(), &cookie) ? shared_ptr<void>(reinterpret_cast<void*>(cookie), bind(&::DeactivateActCtx, 0, cookie)) : shared_ptr<void>(); }
function_block-full_function
[ { "content": "\t\t\tclass session : public ISequentialStream, public IConnectionPoint, public /*outbound*/ ipc::channel,\n\n\t\t\t\tpublic CComObjectRoot\n\n\t\t\t{\n\n\t\t\tpublic:\n\n\t\t\t\tBEGIN_COM_MAP(session)\n\n\t\t\t\t\tCOM_INTERFACE_ENTRY(ISequentialStream)\n\n\t\t\t\t\tCOM_INTERFACE_ENTRY(IConnection...
C++
test/ese/src/devlibtest/stat/statunit/movingavg.cxx
ScriptBox99/Extensible-Storage-Engine
3bcf428c8a041733043e18fd9ae55cffeba307b2
#include "statunittest.hxx" #include "stat.hxx" class MovingAverageTest : public UNITTEST { private: static MovingAverageTest s_instance; protected: MovingAverageTest() {} public: ~MovingAverageTest() {} public: const char * SzName() const; const char * SzDe...
#include "statunittest.hxx" #include "stat.hxx" class MovingAverageTest : public UNITTEST { private: static MovingAverageTest s_instance; protected: MovingAverageTest() {} public: ~MovingAverageTest() {} public: const char * SzName() const; const char * SzDe...
e() ); avgTwoSamples.AddSample( 10 ); TestTest( 10 == avgTwoSamples.GetLastSample() ); TestTest( 30 == avgTwoSamples.GetAverage() ); avgTwoSamples.AddSample( 60 ); TestTest( 60 == avgTwoSamples.GetLastSample() ); TestTest( 35 == avgTwoSamples.GetAverage() ); avgTwoSamples.AddSample( 8...
function_block-function_prefixed
[]
C++
app/DiskFSTree.cpp
Toysoft/ciderpress
640959dad551ba75a48bd3c49629579730ead351
#include "StdAfx.h" #include "DiskFSTree.h" #include "ChooseAddTargetDialog.h" #include "../reformat/Charset.h" using namespace DiskImgLib; bool DiskFSTree::BuildTree(DiskFS* pDiskFS, CTreeCtrl* pTree) { ASSERT(pDiskFS != NULL); ASSERT(pTree != NULL); pTree->SetImageList(&fTreeImageList, TV...
#include "StdAfx.h" #include "DiskFSTree.h" #include "ChooseAddTargetDialog.h" #include "../reformat/Charset.h" using namespace DiskImgLib; bool DiskFSTree::BuildTree(DiskFS* pDiskFS, CTreeCtrl* pTree) { ASSERT(pDiskFS != NULL); ASSERT(pTree != NULL); pTree->SetImageList(&fTreeImageList, TV...
void DiskFSTree::FreeAllTargetData(void) { TargetData* pTarget; TargetData* pNext; pTarget = fpTargetData; while (pTarget != NULL) { pNext = pTarget->pNext; delete pTarget; pTarget = pNext; } fpTargetData = NULL; }
DiskFSTree::TargetData* DiskFSTree::AllocTargetData(void) { TargetData* pNew = new TargetData; if (pNew == NULL) return NULL; pNew->pNext = fpTargetData; fpTargetData = pNew; return pNew; }
function_block-full_function
[ { "content": " uch depth[2*L_CODES+1];\n", "file_path": "zlib/deflate.h", "rank": 0, "score": 93639.98853513303 }, { "content": " uInt insert; /* bytes at end of window left to insert */\n", "file_path": "zlib/deflate.h", "rank": 1, "score": 93630.98532131276 }, ...
C++
include/dll/datasets/imagenet.hpp
jw-j/dll
2a72ec0a5c8d52de5565eb5075bc44f078955fca
#pragma once #include <vector> #include <unordered_map> #include <utility> #include <string> #include <dirent.h> #include <opencv2/highgui/highgui.hpp> namespace dll { namespace imagenet { inline void read_files(std::vector<std::pair<size_t, size_t>>& files, std::unordered_map<size_t, float>& label_map, const s...
#pragma once #include <vector> #include <unordered_map> #include <utility> #include <string> #include <dirent.h> #include <opencv2/highgui/highgui.hpp> namespace dll { namespace imagenet { inline void read_files(std::vector<std::pair<size_t, size_t>>& files, std::unordered_map<size_t, float>& label_map, const s...
l_iterator&& rhs) = default; label_iterator& operator++(){ ++index; return *this; } label_iterator operator++(int){ auto it = *this; ++index; return it; } float operator*() const { return (*labels)[(*files)[index].first]; } bool operator==(...
td::shared_ptr<std::unordered_map<size_t, float>> labels, size_t index) : files(files), labels(labels), index(index) { } label_iterator(const label_iterator& rhs) = default; label_iterator(label_iterator&& rhs) = default; label_iterator& operator=(const label_iterator& rhs) = defa...
random
[ { "content": "struct random_crop : value_pair_conf_elt<random_crop_id, size_t, X, Y> {};\n\n\n\n/*!\n\n * \\brief Elastic distortion\n\n */\n\ntemplate <size_t C, size_t K = 9>\n", "file_path": "include/dll/base_conf.hpp", "rank": 0, "score": 284440.7828568713 }, { "content": "struct convert...
C++
torch/csrc/jit/testing/module_differ.cpp
aaditya-panik/pytorch
731c8255b7e8ed5435bfa09c7e0ad5f60bcc91d4
#include <torch/csrc/jit/testing/module_differ.h> #include <torch/csrc/jit/mobile/interpreter.h> #include <iostream> #include <sstream> #include <string> #include <unordered_map> #include <vector> namespace torch { namespace jit { template <typename It> bool ivalueListEquals( It lbegin, It lend, It rbeg...
#include <torch/csrc/jit/testing/module_differ.h> #include <torch/csrc/jit/mobile/interpreter.h> #include <iostream> #include <sstream> #include <string> #include <unordered_map> #include <vector> namespace torch { namespace jit { template <typename It> bool ivalueListEquals( It lbegin, It lend, It rbeg...
) { std::cout << " pass." << std::endl; } else { std::cout << " fail." << std::endl; return false; } auto type_eq = [](auto t1, auto t2) { return t1->str() == t2->str(); }; auto type_print = [](auto t1) { return t1->str(); }; if (print) { std::cout << "> Diffing types..." << std::...
vectorEqual( lhs_code->debug_handles_, rhs_code->debug_handles_, true, equals, id)
call_expression
[]