lang
stringclasses
3 values
file_path
stringlengths
5
150
repo_name
stringlengths
6
110
commit
stringlengths
40
40
file_code
stringlengths
1.52k
18.9k
prefix
stringlengths
82
16.5k
suffix
stringlengths
0
15.1k
middle
stringlengths
121
8.18k
strategy
stringclasses
8 values
context_items
listlengths
0
100
C++
src/devices/bin/driver_host/driver_host_context.cc
casey/fuchsia
2b965e9a1e8f2ea346db540f3611a5be16bb4d6b
#include "driver_host_context.h" #include <stdio.h> #include <fbl/auto_lock.h> #include <fs/vfs.h> #include "log.h" void DriverHostContext::PushWorkItem(const fbl::RefPtr<zx_device_t>& dev, Callback callback) { auto work_item = std::make_unique<WorkItem>(dev, std::move(callback)); fbl::AutoLock al(&lock_); ...
#include "driver_host_context.h" #include <stdio.h> #include <fbl/auto_lock.h> #include <fs/vfs.h>
nst zx_packet_signal_t* signal) { if (status != ZX_OK) { log(ERROR, "driver_host: event waiter error: %d\n", status); return; } if (signal->observed & ZX_USER_SIGNAL_0) { event_waiter->InvokeCallback(); BeginWait(std::move(event_waiter), dispatcher); } else { printf("%s: invalid signals %x\...
#include "log.h" void DriverHostContext::PushWorkItem(const fbl::RefPtr<zx_device_t>& dev, Callback callback) { auto work_item = std::make_unique<WorkItem>(dev, std::move(callback)); fbl::AutoLock al(&lock_); work_items_.push_back(std::move(work_item)); if (!event_waiter_->signaled()) { event_waite...
random
[]
C++
src/render/MCPT_EL.cc
ppwwyyxx/Ray-Tracing-Engine
af3ec164d6b5e5b592a54a75282432d610423ffb
#include "render/MCPT_EL.hh" using namespace std; Color MCPT_EL::do_trace(const Ray& ray, int depth, int use_emission) const { if (depth > max_depth) return Color::BLACK; m_assert(fabs(ray.dir.sqr() - 1) < EPS); auto first_trace = find_first(ray, true); if (!first_trace) return Color::BLACK; Vec norm = firs...
#include "render/MCPT_EL.hh" using namespace std; Color MCPT_EL::do_trace(const Ray& ray, int depth, int use_emission) const { if (depth > max_depth) return Color::BLACK; m_assert(fabs(ray.dir.sqr() - 1) < EPS); auto first_trace = find_first(ray, true); if (!first_trace) return Color::BLACK; Vec norm = firs...
} real_t r1 = 2 * M_PI * drand48(), r2 = drand48(), r2s = sqrt(r2); Vec u = ((fabs(norm.x) > 0.1 ? Vec(0, 1, 0) : Vec(1, 0, 0)).cross(norm)).get_normalized(), v = norm.cross(u); Vec d = ((u * cos(r1)) * r2s + v * sin(r1) * r2s + norm * (sqrt(1 - r2))).get_normalized(); real_t diffuse_weight =...
if (drand48() < max_color_comp) diffu = diffu * (1.0 / max_color_comp); else return surf->emission * use_emission;
if_condition
[ { "content": "class Color {\n\n\tpublic:\n\n\t\treal_t r = 0, g = 0, b = 0;\n\n\n\n\t\tColor():\n\n\t\t\tColor(EPS, EPS, EPS) { }\n\n\n\n\t\texplicit Color(real_t _r, real_t _g, real_t _b):\n\n\t\t\tr(_r), g(_g), b(_b) {}\n\n\n\n\t\texplicit Color(const Vec& v):\n\n\t\t\tr(v.x), g(v.y), b(v.z) {}\n\n\n\n\t\tsta...
C++
src/xcorr_engine.cpp
dev0x13/ust_x
d030ee40462933b645cee417856306f62cf37a28
#include <xcorr_engine.h> #include <XCorr.h> #include <HilbertTransformer.h> #include <algorithm> static const size_t defects = 14; UST::XCorrEngine::XCorrEngine(size_t window_size_axial_, size_t window_size_lateral_, size_t size1_, size_t size2_) : window_size_axial(window_size_axial_), window_size_lateral...
#include <xcorr_engine.h> #include <XCorr.h> #include <HilbertTransformer.h> #include <algorithm> static const size_t defects = 14; UST::XCorrEngine::XCorrEngine(size_t window_size_axial_, size_t window_size_lateral_, size_t size1_, size_t size2_) : window_size_axial(window_size_axial_), window_size_lateral...
void UST::XCorrEngine::calcShift( short **sig1, short **sig2, double **out) { this->out = out; this->tp.startTaskBlock(numThreads); for (size_t i = 0; i < numThreads; ++i) { auto begin = i * pieceSize, end = begin + pieceSize; this->tp.runTask(&UST::XCorrEngine::hilbertTask, this, ...
for (long j = (long)n - window_size_by_2_lateral; j < (long)n + window_size_by_2_lateral; ++j) { for (long k = (long)m - window_size_by_2_axial; k < (long)m + window_size_by_2_axial; ++k) { auto realJ = std::min((long)size1 - 1, std::max(j, (long)0)); auto realK = std::min((long)size2 - 1, s...
function_block-function_prefix_line
[ { "content": "struct static_const\n\n{\n\n static constexpr T value{};\n\n};\n\n\n\ntemplate<typename T>\n\nconstexpr T static_const<T>::value;\n\n} // namespace detail\n\n} // namespace nlohmann\n\n\n\n// #include <nlohmann/detail/meta/type_traits.hpp>\n\n\n\n\n\n#include <limits> // numeric_limits\n\n#in...
C++
centreon-engine/test/commands/raw_run_async.cc
centreon/centreon-collect
e63fc4d888a120d588a93169e7d36b360616bdee
#include <cstdlib> #include <cstring> #include <exception> #include "com/centreon/engine/commands/raw.hh" #include "com/centreon/engine/commands/set.hh" #include "com/centreon/engine/exceptions/error.hh" #include "com/centreon/engine/globals.hh" #include "com/centreon/process.hh" #include "test/commands/wait_process....
#include <cstdlib> #include <cstring> #include <exception> #include "com/centreon/engine/commands/raw.hh" #include "com/centreon/engine/commands/set.hh" #include "com/centreon/engine/exceptions/error.hh" #include "com/centreon/engine/globals.hh" #include "com/centreon/process.hh" #include "test/commands/wait_process....
d::shared_ptr<raw> cmd( new raw(__func__, "\"./bin_test_run\" \"--timeout\"=\"off\"")); wait_process wait_proc(cmd.get()); set::instance().add_command(cmd); nagios_macros mac; unsigned long id(cmd->run(cmd->get_command_line(), mac, 0)); wait_proc.wait(); result const& res = wait_proc.get_resul...
ble_environment_macros(true); nagios_macros mac; char const* argv = "default_arg"; mac.argv[0] = new char[strlen(argv) + 1]; strcpy(mac.argv[0], argv); std::shared_ptr<raw> cmd(new raw(__func__, "./bin_test_run --check_macros")); wait_process wait_proc(cmd.get()); set::instance().add_command(cmd);...
random
[ { "content": "class timeout : public std::exception {\n\n public:\n\n timeout() noexcept : std::exception() {}\n\n timeout& operator=(const timeout&) = delete;\n\n};\n\n} // namespace exceptions\n\n\n\nCCB_END()\n\n\n\n#endif // !CCB_EXCEPTIONS_TIMEOUT_HH\n", "file_path": "centreon-broker/core/inc/com/c...
C++
core/indigo-core/molecule/src/molecule_inchi_utils.cpp
khyurri/Indigo
82f9ef9f43ca605f7265709e7a9256f1ff468d6c
#include "molecule/molecule_inchi_utils.h" #include "base_cpp/os_sync_wrapper.h" #include "molecule/elements.h" #include "molecule/molecule.h" #include "molecule/molecule_cis_trans.h" using namespace indigo; Array<int> MoleculeInChIUtils::_atom_lables_sorted; Array<int> MoleculeInChIUtils::_atom_lables_ranks; IMP...
#include "molecule/molecule_inchi_utils.h" #include "base_cpp/os_sync_wrapper.h" #include "molecule/elements.h" #include "molecule/molecule.h" #include "molecule/molecule_cis_trans.h" using namespace indigo; Array<int> MoleculeInChIUtils::_atom_lables_sorted; Array<int> MoleculeInChIUtils::_atom_lables_ranks; IMP...
_initializeAtomLabels(); } } void MoleculeInChIUtils::_initializeAtomLabels() { _atom_lables_sorted.reserve(ELEM_MAX); for (int i = ELEM_MIN; i < ELEM_MAX; i++) _atom_lables_sorted.push(i); _atom_lables_sorted.qsort(_compareAtomLabels, NULL); _atom_lables_ranks.resize(ELEM_MAX); _a...
eLabelsInitialized() { if (_atom_lables_sorted.size() == 0) { static ThreadSafeStaticObj<OsLock> lock; OsLocker locker(lock.ref()); if (_atom_lables_sorted.size() == 0)
function_block-random_span
[ { "content": " final Indigo indigo;\n", "file_path": "api/java/indigo-inchi/src/main/java/com/epam/indigo/IndigoInchi.java", "rank": 0, "score": 207685.95766331634 }, { "content": "char *inchi__strnset( char *s, int val, size_t length )\n\n{\n\n char *ps = s;\n\n while (length-- && ...
C++
libcore/include/sirikata/core/trace/Trace.hpp
sirikata/sirikata
3a0d54a8c4778ad6e25ef031d461b2bc3e264860
#ifndef _SIRIKATA_CORE_TRACE_HPP_ #define _SIRIKATA_CORE_TRACE_HPP_ #include <sirikata/core/util/Platform.hpp> #include <sirikata/core/util/Thread.hpp> #include <sirikata/core/util/AtomicTypes.hpp> #include <sirikata/core/network/ObjectMessage.hpp> #include <sirikata/core/trace/BatchedBuffer.hpp> namespace Sirikata...
#ifndef _SIRIKATA_CORE_TRACE_HPP_ #define _SIRIKATA_CORE_TRACE_HPP_ #include <sirikata/core/util/Platform.hpp> #include <sirikata/core/util/Thread.hpp> #include <sirikata/core/util/AtomicTypes.hpp> #include <sirikata/core/network/ObjectMessage.hpp> #include <sirikata/core/trace/BatchedBuffer.hpp> namespace Sirikata...
ObjectMessagePort optionalMessageDestPort=0); CREATE_TRACE_DECL(timestampMessage, const Time&t, uint64 packetId, MessagePath path); void writeRecord(uint16 type_hint, BatchedBuffer::IOVec* data, uint32 iovcnt); template<typename T> void writeRecord(uint16 type_hint, const T& pl) { i...
DROPPED_DURING_FORWARDING_ROUTING, DROPPED_AT_SPACE_ENQUEUED, DROPPED_CSFQ_OVERFLOW, DROPPED_CSFQ_PROBABILISTIC, NUM_DROPS }; uint64 d[NUM_DROPS]; const char*n[NUM_DROPS]; Drops() { memset(d,0,NUM_DROPS*sizeof(uint64)); memset(n,0,NUM_DROPS*sizeof(cons...
random
[ { "content": "struct Batch {\n\n static const uint16 max_size = 65535;\n\n uint16 size;\n\n T items[max_size];\n\n\n\n Batch() : size(0) {}\n\n\n\n bool full() const {\n\n return (size >= max_size);\n\n }\n\n\n\n uint32 avail() const {\n\n return max_size - size;\n\n }\n\n}...
C++
source/MaterialXContrib/MaterialXMaya/ShadingNodeOverrides.cpp
muenstc/MaterialX
b8365086a738fddae683065d78f65410aacd0dc4
#include "ShadingNodeOverrides.h" #include "MaterialXNode.h" #include "Plugin.h" #include "MaterialXUtil.h" #include "MayaUtil.h" #include <maya/MDGModifier.h> #include <maya/MGlobal.h> #include <maya/MShaderManager.h> #include <maya/MPxShadingNodeOverride.h> #include <maya/MPxSurfaceShadingNodeOverride.h> #include <...
#include "ShadingNodeOverrides.h" #include "MaterialXNode.h" #include "Plugin.h" #include "MaterialXUtil.h" #include "MayaUtil.h" #include <maya/MDGModifier.h> #include <maya/MGlobal.h> #include <maya/MShaderManager.h> #include <maya/MPxShadingNodeOverride.h> #include <maya/MPxSurfaceShadingNodeOverride.h> #include <...
template class ShadingNodeOverride<MHWRender::MPxShadingNodeOverride>; template class ShadingNodeOverride<MHWRender::MPxSurfaceShadingNodeOverride>; MHWRender::MPxSurfaceShadingNodeOverride* SurfaceOverride::creator(const MObject& obj) { std::cout.rdbuf(std::cerr.rdbuf()); return new SurfaceOverride(obj); } ...
xWrap; if (samplingProperties.vaddressMode != mx::ImageSamplingProperties::AddressMode::UNSPECIFIED) { samplerDescription.addressV = addressModes[static_cast<int>(samplingProperties.vaddressMode)]; } samplerDescripti...
function_block-function_prefixed
[ { "content": "/// @class FileSearchPath\n\n/// A sequence of file paths, which may be queried to find the first instance\n\n/// of a given filename on the file system.\n\nclass MX_FORMAT_API FileSearchPath\n\n{\n\n public:\n\n using Iterator = FilePathVec::iterator;\n\n using ConstIterator = FilePathVec:...
C++
tutorials/Embedding/word2vec.hpp
ChanhyoLee/TextDataset
397571f476a89ad42ef3ed77b82c76fc19ac3e33
#include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <ctime> #include <cstdlib> #include "../../WICWIU_src/Tensor.hpp" #include "../../WICWIU_src/DataLoader.hpp" #define NUMOFWORD 71291 //text8에서 단어의 개수! using namespace std; enum OPTION { TESTING, TR...
#include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <ctime> #include <cstdlib> #include "../../WICWIU_src/Tensor.hpp" #include "../../WICWIU_src/DataLoader.hpp" #define NUMOFWORD 71291 //text8에서 단어의 개수! using namespace std; enum OPTION { TESTING, TR...
template<typename DTYPE> std::vector<Tensor<DTYPE> *> *TextDataSet<DTYPE>::GetData(int idx) { std::vector<Tensor<DTYPE> *> *result = new std::vector<Tensor<DTYPE> *>(0, NULL); Tensor<DTYPE> *image = Tensor<DTYPE>::Zeros(1, 1, 1, 1, m_dimOfInput); Tensor<DTYPE> *label = Tensor<DTYPE>::Zeros(1,...
i]) { delete[] m_aaLabel[i]; m_aaLabel[i] = NULL; } } delete m_aaLabel; m_aaLabel = NULL; } }
function_block-function_prefixed
[ { "content": "class NEG : public LossFunction<DTYPE>{\n\nprivate:\n\n DTYPE m_epsilon = 1e-6f; // for backprop\n\n\n\npublic:\n\n\n\n NEG(Operator<DTYPE> *pOperator, Operator<DTYPE> *pLabel, int epsilon = 1e-6f) : LossFunction<DTYPE>(pOperator, pLabel) {\n\n #ifdef __DEBUG__\n\n std::cout <...
C++
include/GafferBindings/SignalBinding.inl
ddesmond/gaffer
4f25df88103b7893df75865ea919fb035f92bac0
#ifndef GAFFERBINDINGS_SIGNALBINDING_INL #define GAFFERBINDINGS_SIGNALBINDING_INL #include "IECorePython/ExceptionAlgo.h" #include "IECorePython/ScopedGILLock.h" #include "IECorePython/ScopedGILRelease.h" #include "boost/signals.hpp" #include "boost/version.hpp" namespace GafferBindings { namespace Detail { temp...
#ifndef GAFFERBINDINGS_SIGNALBINDING_INL #define GAFFERBINDINGS_SIGNALBINDING_INL #include "IECorePython/ExceptionAlgo.h" #include "IECorePython/ScopedGILLock.h" #include "IECorePython/ScopedGILRelease.h" #include "boost/signals.hpp" #include "boost/version.hpp" namespace GafferBindings { namespace Detail { temp...
GAFFERBINDINGS_API boost::python::object pythonConnection( const boost::signals::connection &connection, bool scoped ); template<typename Signal, typename SlotCaller> boost::python::object connect( Signal &s, boost::python::object &slot, bool scoped ) { return pythonConnection( s.connect( Slot<Signal, SlotCaller>( ...
t(), weakMethod.ptr() ) ) { boost::python::object self = boost::python::object( slot.m_slot ).attr( "instance" )(); boost::python::extract<Trackable &> e( self ); if( e.check() ) { boost::visit_each( visitor, e(), 0 ); } } }
function_block-function_prefixed
[]
C++
Sandbox2D/src/2dapp.cpp
dovker/Rosewood
5131a061632732222ce68e5da5a257b8bda36ea5
#include "Rosewood.h" #include "Rosewood/Core/EntryPoint.h" #include "imgui.h" #include "Sofa.h" #include "2DCameraController.h" const std::string Rosewood::FileSystem::ProjectRoot = "../../../Sandbox2D/"; class ExampleLayer : public Rosewood::Layer { public: unsigned int scrWidth = Rosewood::Application::Get().GetW...
#include "Rosewood.h" #include "Rosewood/Core/EntryPoint.h" #include "imgui.h" #include "Sofa.h" #include "2DCameraController.h" const std::string Rosewood::FileSystem::ProjectRoot = "../../../Sandbox2D/"; class ExampleLayer : public Rosewood::Layer { public: unsigned int scrWidth = Rosewood::Application::Get().GetW...
bool OnKeyReleasedEvent(Rosewood::KeyReleasedEvent& e) { return false; } bool OnWindowResizeEvent(Rosewood::WindowResizeEvent& e) { scrWidth = e.GetWidth(); scrHeight = e.GetHeight(); camera.ProcessScreenResize(glm::vec2(scrWidth, scrHeight)); Rosewood::GraphicsCommand::SetViewport(0, 0, scrWidt...
n::Get().GetWindow().LockCursor(); else if (key == KEY_T) Rosewood::Application::Get().GetWindow().UnlockCursor(); else if (key == KEY_F) sound->Play(); return false; }
function_block-function_prefixed
[ { "content": "\tclass KeyEvent : public Event\n\n\t{\n\n\tpublic:\n\n\t\tinline int GetKeyCode() const { return m_KeyCode; }\n\n\n\n\t\tEVENT_CLASS_CATEGORY(EventCategoryKeyboard | EventCategoryInput)\n\n\tprotected:\n\n\t\tKeyEvent(int keycode)\n\n\t\t\t: m_KeyCode(keycode) {}\n\n\n\n\t\tint m_KeyCode;\n\n\t};...
C++
eip_device/src/eip_device_node.cpp
wpmccormick/eip_device
808628a7ede642eead1ed9b81db34c0c73ff8b5c
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <sys/capability.h> #include <sys/capability.h> extern "C" { #include "trace.h" #include "opener_api.h" #include "cipcommon.h" #include "trace.h" #include "POSIX/networkconfig.h" #include "doublylinkedlist.h" #include "cipconnectionobject...
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <sys/capability.h> #include <sys/capability.h> extern "C" { #include "trace.h" #include "opener_api.h" #include "cipcommon.h" #include "trace.h" #include "POSIX/networkconfig.h" #include "doublylinkedlist.h" #include "cipconnectionobject...
if (-1 == cap_set_proc(capabilities) ) { cap_free(capabilities); ROS_ERROR("Could not push CAP_NET_RAW capability to process"); exit(0); } if (-1 == cap_free(capabilities) ) { ROS_ERROR("Could not free capabilites value"); exit(0); } DoublyLinkedListInitialize(&connection_list, ...
if (-1 == cap_set_flag(capabilities, CAP_EFFECTIVE, 1, capabilies_list, CAP_SET) ) { cap_free(capabilities); ROS_ERROR("Could not set CAP_NET_RAW capability"); exit(0); }
if_condition
[ { "content": "#ifndef EIP_DEVICE_H\n\n#define EIP_DEVICE_H\n\n\n\n#define INPUT_ASSEMBLY_BUFFER_SIZE 32\n\n#define OUTPUT_ASSEMBLY_BUFFER_SIZE 32\n\n#define CONFIG_ASSEMBLY_BUFFER_SIZE 10\n\n#define EXPLICIT_ASSEMBLY_BUFFER_SIZE 32\n\n\n\n#include <iostream>\n\n#include <string>\n\n#include<memory>\n\n\n\ne...
C++
src/Plugins/TundraLogic/Client.cpp
realXtend/tundra-urho3d
436d41c3e3dd1a9b629703ee76fd0ef2ee212ef8
#include "StableHeaders.h" #include "Client.h" #include "UserConnectedResponseData.h" #include "TundraLogic.h" #include "KristalliProtocol.h" #include "SyncManager.h" #include "SyncState.h" #include "MsgLogin.h" #include "MsgLoginReply.h" #include "Framework.h" #include "Scene.h" #include "SceneAPI.h" #include "Asset...
#include "StableHeaders.h" #include "Client.h" #include "UserConnectedResponseData.h" #include "TundraLogic.h" #include "KristalliProtocol.h" #include "SyncManager.h" #include "SyncState.h" #include "MsgLogin.h" #include "MsgLoginReply.h" #include "Framework.h" #include "Scene.h" #include "SceneAPI.h" #include "Asset...
SetLoginProperty("protocol", String(SocketTransportLayerToString(protocol).c_str()).ToLower()); SetLoginProperty("address", address); SetLoginProperty("port", port); SetLoginProperty("client-version", "2.5.4.1"); SetLoginProperty("client-name", "Name"); SetLoginProperty("client-organi...
if (protocol == kNet::InvalidTransportLayer) { LogInfo("Client::Login: No protocol specified, using the default value."); protocol = kristalli->defaultTransport; }
if_condition
[ { "content": "/// Implements kNet protocol -based server and client functionality.\n\nclass TUNDRALOGIC_API KristalliProtocol : public Object, public kNet::IMessageHandler, public kNet::INetworkServerListener\n\n{\n\n URHO3D_OBJECT(KristalliProtocol, Object);\n\n\n\npublic:\n\n KristalliProtocol(TundraLog...
C++
Audio/src/Windows/AudioOutput_WASAPI.cpp
Pants/unnamed-sdvx-clone
28a4b537e40bfe45a48c63c20f5dc4ae5702feab
#include "stdafx.h" #include "AudioOutput.hpp" #include "Shared/Thread.hpp" #ifdef _WIN32 #include "Audioclient.h" #include "Mmdeviceapi.h" #include "comdef.h" #include "Functiondiscoverykeys_devpkey.h" #define REFTIME_NS (100) #define REFTIMES_PER_MICROSEC (1000/REFTIME_NS) #define REFTIMES_PER_MILLISEC (REFTIMES_PE...
#include "stdafx.h" #include "AudioOutput.hpp" #include "Shared/Thread.hpp" #ifdef _WIN32 #include "Audioclient.h" #include "Mmdeviceapi.h" #include "comdef.h" #include "Functiondiscoverykeys_devpkey.h" #define REFTIME_NS (100) #define REFTIMES_PER_MICROSEC (1000/REFTIME_NS) #define REFTIMES_PER_MILLISEC (REFTIMES_PE...
; res = m_audioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, mixFormat, NULL); attemptingFormat++; if (attemptingFormat >= allFormats.size()) { break; } } if (res == S_OK) Log("Format successful", Logger::Info); else Log("No accepted format found", Logger::...
Logf("Attempting exclusive mode format:\nSample Rate: %dhz,\nBit Depth: %dbit,\nFormat: %s\n-----", Logger::Info, mixFormat->nSamplesPerSec, mixFormat->wBitsPerSample, mixFormat->wFormatTag == WAVE_FORMAT_PCM ? "PCM" : "IEEE FLOAT" )
call_expression
[ { "content": "struct StaticBinding : public IFunctionBinding<R, A...>\n\n{\n\n\tStaticBinding(R(*func)(A...)) : func(func) {};\n\n\tvirtual R Call(A... args) override\n\n\t{\n\n\t\treturn (*func)(args...);\n\n\t}\n\n\tR(*func)(A...);\n\n};\n\n\n\n/* Lambda function binding */\n\ntemplate<typename T, typename R,...
C++
src/local_edge.cc
yjxiong/convnet
f51261942ce5121255c7edd61ce1a589509e76e5
#include "local_edge.h" #include "cudamat_conv.cuh" #include <iostream> LocalEdge::LocalEdge(const config::Edge& edge_config) : EdgeWithWeight(edge_config), kernel_size_(edge_config.kernel_size()), stride_(edge_config.stride()), padding_(edge_config.padding()) {} void LocalEdge::SetTiedTo(Edge* e) { EdgeWit...
#include "local_edge.h" #include "cudamat_conv.cuh" #include <iostream> LocalEdge::LocalEdge(const config::Edge& edge_config) : EdgeWithWeight(edge_config), kernel_size_(edge_config.kernel_size()), stride_(edge_config.stride()), padding_(edge_config.padding()) {} void LocalEdge::SetTiedTo(Edge* e) { EdgeWit...
} void LocalEdge::SetImageSize(int image_size) { Edge::SetImageSize(image_size); num_modules_ = (image_size + 2 * padding_ - kernel_size_) / stride_ + 1; } void LocalEdge::AllocateMemoryFprop() { int input_size = kernel_size_ * kernel_size_ * num_input_channels_ * num_modules_ * num_modules_...
if (img_display_ != NULL) { weights_.CopyToHost(); img_display_->DisplayWeights(weights_.GetHostData(), kernel_size_, num_output_channels_, 250, false); }
if_condition
[ { "content": "#include \"conv_edge.h\"\n\n#include \"cudamat_conv.cuh\"\n\n#include <iostream>\n\n\n\nConvEdge::ConvEdge(const config::Edge& edge_config) :\n\n EdgeWithWeight(edge_config),\n\n kernel_size_(edge_config.kernel_size()),\n\n stride_(edge_config.stride()),\n\n padding_(edge_config.padding()),\n\...
C++
coursework/os/code/src/emsh/fs/stream.cpp
huaouo/history_code
475193986caf025c9569fb0690a12bed0cf630b4
#include <math.h> #include <string.h> #include "stream.h" #include "lnkblk.h" namespace emsh::fs { Stream::Stream(const uint16_t iaddr) : io(IO::get_instance()), fs(FS::get_instance()), iaddr(iaddr), inode(fs.read_inode(iaddr)), read_pos(0), write_pos(0) {} bool Stream::truncate(size_t len) { if (len > ...
#include <math.h> #include <string.h> #include "stream.h" #include "lnkblk.h" namespace emsh::fs { Stream::Stream(const uint16_t iaddr) : io(IO::get_instance()), fs(FS::get_instance()), iaddr(iaddr), inode(fs.read_inode(iaddr)), read_pos(0), write_pos(0) {} bool Stream::truncate(size_t len) { if (len > ...
memcpy(data + data_pos, (char *) &blk + offset, read_cycle_size); read_pos += read_cycle_size; data_pos += read_cycle_size; } return data_pos; } void Stream::seekw(size_t pos) { if (pos > inode.size) pos = inode.size; write_pos = pos; } void Stream::seekr(size_t pos) { if (pos >= inode.siz...
if (blk_index < INODE_DJADDR_BLK_CNT) { Blk _j_blk = io.read_block(inode.j_addr); auto j_blk = (LnkBlk *) &_j_blk; blk = io.read_block(j_blk->addr[blk_index - INODE_DADDR_BLK_CNT]); } else { auto blk_index_remain = static_cast<uint16_t>(blk_index - INODE_DJADDR_BLK_CNT); auto blk_index...
if_condition
[]
C++
example/m5stack/transmitter/src/main.cpp
yukima77/EnOceanModule
c4d2cdf8738890333085980afb66478f499d21aa
#include <M5Stack.h> #include <SoftwareSerial.h> #define SYNC 0x55 // SYNC SoftwareSerial enoceanSerial(21, 22); const byte CRC8Table[256] = { 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48,...
#include <M5Stack.h> #include <SoftwareSerial.h> #define SYNC 0x55 // SYNC SoftwareSerial enoceanSerial(21, 22); const byte CRC8Table[256] = { 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48,...
enoceanSerial.write(data, len_raw_data + 2); byte crc8d = 0; for (i = 0; i < (len_raw_data + 2); i++) { crc8d = CRC8Table[crc8d ^ data[i]]; }; enoceanSerial.write(crc8d); } M5.Lcd.setCursor(5, 5); M5.update(); delay(100); }
if (data[5] == 0x09) { data[5] = 0x08; Serial.println("Open"); M5.Lcd.clear(BLACK); M5.Lcd.setTextSize(5); M5.Lcd.println("Open"); }
if_condition
[ { "content": "#include <M5Stack.h>\n\n#include <SoftwareSerial.h>\n\n\n\n#define LCDHIGH 240\n\n#define LCDWIDTH 320\n\n\n\n#define TEMPID 0x05002729 // EnOceanモジュールID\n\n#define SYNC 0x55 // SYNCバイト\n\n\n\nSoftwareSerial enoceanSerial(21, 22); // RX, TX\n\n\n\nvoid setup()\n\n{\n\n M5.begin();\n\n\n\n...
C++
src/appleseed/foundation/array/meshalgorithm.cpp
jaichhabra/appleseed
bc952ad860ca6f93bfe4cdd2b966acac4cb42e20
#include "foundation/array/applyvisitor.h" #include "foundation/array/array.h" #include "foundation/array/arrayview.h" #include "foundation/array/exception.h" #include "foundation/array/meshalgorithm.h" #include <algorithm> #include <cstdint> namespace foundation { namespace { struct ComputeBBoxVisitor { ...
#include "foundation/array/applyvisitor.h" #include "foundation/array/array.h" #include "foundation/array/arrayview.h" #include "foundation/array/exception.h" #include "foundation/array/meshalgorithm.h" #include <algorithm> #include <cstdint> namespace foundation { namespace { struct ComputeBBoxVisitor { ...
m_stats.m_max_face_sides = std::max( m_stats.m_max_face_sides, static_cast<size_t>(n)); } } }; } AABB3f compute_bounding_box(const Array& vertices) { ComputeBBoxVisitor v; apply_visitor(vertices, v); return v.m_bbox; } AABB3...
if (n < 3) m_stats.m_invalid_count++; else if (n == 3) m_stats.m_triangle_count++; else if (n == 4) m_stats.m_quad_count++; else m_stats.m_ngon_count++;
if_condition
[ { "content": "class Matrix<T, N, N>\n\n{\n\n public:\n\n // Types.\n\n typedef T ValueType;\n\n typedef Matrix<T, N, N> MatrixType;\n\n\n\n // Dimensions and number of components.\n\n static const size_t Rows = N;\n\n static const size_t Columns = N;\n\n static const size_t Components = N ...
C++
apps/vdcwizard/dataholder.cpp
yyr/vapor
cdebac81212ffa3f811064bbd7625ffa9089782e
#include <stdlib.h> #include <stdio.h> #include <sstream> #include <iterator> #include <cstdio> #include <QDebug> #include <QString> #include <vapor/WrfVDFcreator.h> #include <vapor/vdfcreate.h> #include <vapor/Copy2VDF.h> #include <vapor/MetadataVDC.h> #include <vapor/WaveCodecIO.h> #include <vapor/DCReader.h> #incl...
#include <stdlib.h> #include <stdio.h> #include <sstream> #include <iterator> #include <cstdio> #include <QDebug> #include <QString> #include <vapor/WrfVDFcreator.h> #include <vapor/vdfcreate.h> #include <vapor/Copy2VDF.h> #include <vapor/MetadataVDC.h> #include <vapor/WaveCodecIO.h> #include <vapor/DCReader.h> #incl...
string DataHolder::getPopDataCmd() { vector<std::string> argv; if (getFileType() == "ROMS") argv.push_back("roms2vdf"); else if (getFileType() == "GRIB") argv.push_back("grib2vdf"); else if (getFileType() == "CAM") argv.push_back("cam2vdf"); else if (getFileType() == "WRF") argv.push_back("wrf2vdf"); else argv....
e()=="WRF") argv.push_back("-vdc2"); if (VDFSBFactor != "") { argv.push_back("-bs"); argv.push_back(VDFSBFactor); } if (VDFcomment != "") { argv.push_back("-comment"); argv.push_back(VDFcomment); } if (VDFcrList != "") { argv.push_back("-cratios"); argv.push_back(VDFcrList); } if (VDFPeriod...
function_block-function_prefixed
[ { "content": " class DerivedVarElevation : public NetCDFCollection::DerivedVar {\n\n public:\n\n DerivedVarElevation(\n\n NetCDFCollection *ncdfcf, float grav\n\n );\n\n virtual ~DerivedVarElevation();\n\n\n\n virtual int Open(size_t ts);\n\n virtual int ReadSlice(float *slice, int );\n\n virtual int R...
C++
TinySTL/set.hpp
syn1w/TinySTL
04961c8fcec560d23cb99d049d44ff1b88113118
 #pragma once #include "rbtree.hpp" namespace tiny_stl { template <typename Key, typename Compare = tiny_stl::less<Key>, typename Alloc = tiny_stl::allocator<Key>> class set : public RBTree<Key, Compare, Alloc, false> { public: using allocator_type = Alloc; private: using Base = RBTree<Key, Compa...
 #pragma once #include "rbtree.hpp" namespace tiny_stl { template <typename Key, typename Compare = tiny_stl::less<Key>, typename Alloc = tiny_stl::allocator<Key>> class set : public RBTree<Key, Compare, Alloc, false> { public: using allocator_type = Alloc; private: using Base = RBTree<Key, Compa...
ltiset<Key, Compare, Alloc>& rhs) noexcept(noexcept(lhs.swap(rhs))) { lhs.swap(rhs); } }
l::allocator<Key>> class multiset : public RBTree<Key, Compare, Alloc, false> { public: using allocator_type = Alloc; private: using Base = RBTree<Key, Compare, allocator_type, false>; using AlTraits = allocator_traits<allocator_type>; using AlNode = typename Base::AlNode; using AlNodeTraits = typen...
random
[ { "content": "class unordered_set : public HashTable<Key, Hash, KeyEqual, Alloc, false> {\n\npublic:\n\n using allocator_type = Alloc;\n\nprivate:\n\n using Base = HashTable<Key, Hash, KeyEqual, Alloc, false>;\n\n using AlTraits = allocator_traits<allocator_type>;\n\n\n\npublic:\n\n using key_type =...
C++
parallel/SolverConfiguration.cc
jiriklepl/glucose-syrup-4.1
3a444d2cde0fbb1538e7965410db67db27940c09
#include "glucose/parallel/MultiSolvers.h" #include "glucose/core/Solver.h" #include "glucose/parallel/SolverConfiguration.h" using namespace Glucose; void SolverConfiguration::configure(MultiSolvers *ms, int nbsolvers) { for(int i = 1;i<nbsolvers;i++) { ms->solvers[i]->randomizeFirstDescen...
#include "glucose/parallel/MultiSolvers.h" #include "glucose/core/Solver.h" #include "glucose/parallel/SolverConfiguration.h" using namespace Glucose; void SolverConfiguration::configure(MultiSolvers *ms, int nbsolvers) { for(int i = 1;i<nbsolvers;i++) { ms->solvers[i]->randomizeFirstDescen...
if (nbsolvers < 11 ) return; double noisevar_decay = 0.005; int noiseReduceDB = 50; for (int i=10;i<nbsolvers;i++) { ms->solvers[i]-> var_decay = ms->solvers[i%8]->var_decay; ms->solvers[i]-> max_var_decay = ms->solvers[i%8]->max_var_decay; ms->solvers[i]-> firstReduceDB= ms->solve...
function_block-function_prefix_line
[ { "content": "struct IntRange {\n\n int begin;\n\n int end;\n\n IntRange(int b, int e) : begin(b), end(e) {}\n\n};\n\n\n", "file_path": "utils/Options.h", "rank": 0, "score": 30383.65854647451 }, { "content": "class IntOption : public Option\n\n{\n\n protected:\n\n IntRange range...
C++
aesxx/utils/encrypt_block.cpp
egor-tensin/aesni
76ae97ff1434941dcf0c6bf1679146dcb28718aa
#include "block_cmd_parser.hpp" #include "block_dumper.hpp" #include "block_input.hpp" #include <aesxx/all.hpp> #include <boost/program_options.hpp> #include <exception> #include <iostream> #include <stdexcept> #include <string> namespace { template <aes::Algorithm algorithm, aes::Mode mode> void encrypt_...
#include "block_cmd_parser.hpp" #include "block_dumper.hpp" #include "block_input.hpp" #include <aesxx/all.hpp> #include <boost/program_options.hpp> #include <exception> #include <iostream> #include <stdexcept> #include <string> namespace { template <aes::Algorithm algorithm, aes::Mode mode> void encrypt_...
} } catch (const aes::Error& e) { std::cerr << e; return 1; } catch (const std::exception& e) { std::cerr << e.what() << "\n"; return 1; } return 0; }
if (settings.use_boxes) { encrypt_using_boxes( settings.algorithm, settings.mode, input); } else { encrypt_using_cxx_api( settings.algorithm, ...
if_condition
[ { "content": " AES_BoxBlock iv;\n", "file_path": "aes/include/aes/box_data.h", "rank": 0, "score": 107986.0012956743 }, { "content": " const AES_BoxAlgorithmInterface* algorithm;\n", "file_path": "aes/include/aes/box_data.h", "rank": 1, "score": 107862.82410899692 }, { ...
C++
src/particle_filter.cpp
siva1729/CarND-Kidnapped-Vehicle-T2P3
3021d48321f7c907a0aace54f23ff892e1eea3db
#include <random> #include <algorithm> #include <iostream> #include <numeric> #include <math.h> #include <iostream> #include <sstream> #include <string> #include <iterator> #include "particle_filter.h" using namespace std; #define NUM_PARTICLES 50 #define EPS 0.001 void dbg_pp (Particle &particle) ...
#include <random> #include <algorithm> #include <iostream> #include <numeric> #include <math.h> #include <iostream> #include <sstream> #include <string> #include <iterator> #include "particle_filter.h" using namespace std; #define NUM_PARTICLES 50 #define EPS 0.001 void dbg_pp (Particle &particle) ...
void ParticleFilter::resample() { random_device rd; default_random_engine gen(rd()); vector<Particle> resampled_particles; resampled_particles.resize(particles.size()); discrete_distribution<int> dist_resample(weights.begin(), weights.end()); for (int i = 0; i < particles.size(); i++) { resampled_...
d_i, mx, my}); } } vector<LandmarkObs> mapped_observations; for (int j = 0; j < observations.size(); j++) { double mapx = cos(par_t) * observations[j].x - sin(par_t) * observations[j].y + par_x; double mapy = sin(par_t) * observations[j].x + cos(par_t) * observations[j].y + par_y; mapped_observa...
function_block-function_prefixed
[ { "content": " class iter_impl : public std::iterator<std::random_access_iterator_tag, U>\n\n {\n\n /// allow basic_json to access private members\n\n friend class basic_json;\n\n\n\n // make sure U is basic_json or const basic_json\n\n static_assert(std::is_same<U, basic_json>...
C++
source/grid/setup_grid_NG_MPI.cpp
jfbucas/PION
e0a66aa301e4d94d581ba4df078f1a3b82faab99
#include "defines/functionality_flags.h" #include "defines/testing_flags.h" #include "tools/reporting.h" #include "tools/command_line_interface.h" #include "raytracing/raytracer_SC.h" #include "grid/setup_grid_NG_MPI.h" #include "grid/uniform_grid.h" #include "grid/uniform_grid_pllel.h" #include "spatial_solvers/s...
#include "defines/functionality_flags.h" #include "defines/testing_flags.h" #include "tools/reporting.h" #include "tools/command_line_interface.h" #include "raytracing/raytracer_SC.h" #include "grid/setup_grid_NG_MPI.h" #include "grid/uniform_grid.h" #include "grid/uniform_grid_pllel.h" #include "spatial_solvers/s...
setup_cell_extra_data(SimPM); double dx=(SimPM.Xmax[XX]-SimPM.Xmin[XX])/SimPM.NG[XX]; CI.set_nlevels(dx,SimPM.grid_nlevels); CI.set_ndim(SimPM.ndim); CI.set_nvar(SimPM.nvar); CI.set_xmin(SimPM.Xmin); #ifdef TESTING cout <<"(setup_grid_NG_MPI::setup_grid) Setting up grid....
if (SimPM.spOOA==OA2) {SimPM.Nbc = 6; SimPM.Nbc_DD = 4;} else if (SimPM.spOOA==OA1) {SimPM.Nbc = 4; SimPM.Nbc_DD = 2;} else rep.error("unhandles spatial order of accuracy",SimPM.spOOA);
if_condition
[ { "content": " // Else, make a vector of structs with a list of cells contained\n\n // in each coarse cell (2,4,or 8) of the parent grid. This grid\n\n // is (by design) entirely contained within the parent.\n\n class GridBaseClass *grid = par.levels[l].grid;\n\n int nc=1; // number of fine cel...
C++
milk/supervised/_lasso.cpp
aflaxman/milk
252806fd081dc1b3c7fe34b14f9e7a4b646e0b49
#include <iostream> #include <memory> #include <cmath> #include <random> #include <cassert> #include <queue> #include <eigen3/Eigen/Dense> using namespace Eigen; extern "C" { #include <Python.h> #include <numpy/ndarrayobject.h> } namespace { template <typename T> int random_int(T& random, const int max) {...
#include <iostream> #include <memory> #include <cmath> #include <random> #include <cassert> #include <queue> #include <eigen3/Eigen/Dense> using namespace Eigen; extern "C" { #include <Python.h> #include <numpy/ndarrayobject.h> } namespace { template <typename T> int random_int(T& random, const int max) {...
- B*X; } else { sweep = false; } changed = false; } if (!sweep && B(i,j) == 0.0) continue; const float prev = B(i,j); assert(Y.cols() == W.cols()); ass...
sweep = false; bool changed = false; assert(!has_nans(X)); assert(!has_nans(Y)); assert(!has_nans(B)); for (int it = 0; it != max_iter; ++it) { this->next_coords(i, j); if (i == 0 && j == 0) { if (sweep && !changed) { re...
random
[ { "content": "struct Kmeans_Exception {\n\n Kmeans_Exception(const char* msg): msg(msg) { }\n\n const char* msg;\n\n\n\n};\n\nvoid assert_type_contiguous(PyArrayObject* array,int type) { \n\n if (!PyArray_Check(array) ||\n\n PyArray_TYPE(array) != type ||\n\n !PyArray_ISCONTIGUOUS(array))...
C++
MsgParser.cpp
fri000/MsgParser
edbc48e664416f144e00712d879a45298d8728d2
#include <avr/pgmspace.h> #include <inttypes.h> #include <string.h> #include <stdlib.h> #include "MsgParser.h" MsgParser::MsgParser() { m_BufferWriteIndex = 0; m_pRead = m_pInputBuffer; m_pMsgParserCommand = NULL; m_msgStartByte = '/'; m_msgEndByte ...
#include <avr/pgmspace.h> #include <inttypes.h> #include <string.h> #include <stdlib.h> #include "MsgParser.h" MsgParser::MsgParser() { m_BufferWriteIndex = 0; m_pRead = m_pInputBuffer; m_pMsgParserCommand = NULL; m_msgStartByte = '/'; m_msgEndByte ...
e == true) { m_state = WAITING_FOR_START_BYTE; } else { m_state = READING_MESSAGE; } } else { } } ...
} } clearTheBuffer(); } else { m_pInputBuffer[m_BufferWriteIndex] = newByte; m_BufferWriteIndex++; if(m_BufferWriteIndex == MSGPARSER_INPUT_BUF...
random
[ { "content": " const char* pCmdString; //pointer to a null terminated char array\n\n const char* pDescString; //Short help text about this command. Pointer to a null terminated char array\n\n FuncPtr_t pFunc; //pointer to a function\n\n\n\n}FuncEntry_t;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "file_...
C++
ModelsAPI/DependentValues.cpp
FlowsheetSimulation/Dyssol-open
557d57d959800868e1b3fd161b26cad16481382b
#include "DependentValues.h" #include "ContainerFunctions.h" #include "StringFunctions.h" #include <ostream> #include <sstream> #include <numeric> CDependentValues::CDependentValues(const std::vector<double>& _params, const std::vector<double>& _values) { SetValues(_params, _values); } bool CDependentValues::IsEmp...
#include "DependentValues.h" #include "ContainerFunctions.h" #include "StringFunctions.h" #include <ostream> #include <sstream> #include <numeric> CDependentValues::CDependentValues(const std::vector<double>& _params, const std::vector<double>& _values) { SetValues(_params, _values); } bool CDependentValues::IsEmp...
irAt(size_t _index) { if (_index >= m_values.size()) return; m_params.erase(m_params.begin() + _index); m_values.erase(m_values.begin() + _index); } std::vector<double> CDependentValues::GetParamsList() const { return m_params; } std::vector<double> CDependentValues::GetValuesList() const { return m_values; } v...
gin() + std::distance(m_params.begin(), pos)); m_params.erase(pos); } } double CDependentValues::GetParamAt(size_t _index) const { if (_index >= m_params.size()) return {}; return m_params[_index]; } double CDependentValues::GetValueAt(size_t _index) const { if (_index >= m_values.size()) return {}; return m_v...
random
[ { "content": "// Description of a constant property of a pure compound.\n\nclass CConstProperty : public CBaseProperty\n\n{\n\n\tdouble m_defaultValue;\t// Default value.\n\n\tdouble m_dValue;\t\t// Current value of the constant property.\n\n\n\npublic:\n\n\tCConstProperty(unsigned _nProperty, const std::string...
C++
frameworks/base/media/agifencoder/jni/agifencoder_jni.cpp
touxiong88/92_mediatek
5e96a7bb778fd9d9b335825584664e0c8b5ff2c7
#include <jni.h> #include <utils/Log.h> #include <stdio.h> #include <stdlib.h> #include "SkBitmap.h" #include "GraphicsJNI.h" #include "SkPixelRef.h" #include <cutils/xlog.h> #define LOG_TAG "AGIF_ENCODER_JNI" #if 0 #include "SkMovie.h" #include "SkStream.h" #include "GraphicsJNI.h" #include "SkTemplates.h" #incl...
#include <jni.h> #include <utils/Log.h> #include <stdio.h> #include <stdlib.h> #include "SkBitmap.h" #include "GraphicsJNI.h" #include "SkPixelRef.h" #include <cutils/xlog.h> #define LOG_TAG "AGIF_ENCODER_JNI" #if 0 #include "SkMovie.h" #include "SkStream.h" #include "GraphicsJNI.h" #include "SkTemplates.h" #incl...
m; return true ; } return true ; } static int agifenc_encodeFrameCount(JNIEnv* env, jobject movie) { XLOGI("AGIFE::agifenc_encodeFrameCount, go L:%d!!\n", __LINE__); NPE_CHECK_RETURN_ZERO(env, movie); AGifEncoder* m = J2AGifEncoder(env, movie); return m->getGifTo...
ceptionClear(); SkDebugf("--- write:SetByteArrayElements threw an exception\n"); return false; } fEnv->CallVoidMethod(fJavaOutputStream, gOutputStream_writeMethodID, storage, 0, requested); if (env->ExceptionCheck()) {...
random
[]
C++
src/network-container.cc
imonlius/interactive-neurons
da8cbdad8cf5595a2be1b48125ecad5e6c802f2c
#include "neurons/network-container.h" #include "neurons/utilities.h" namespace neurons { NetworkContainer::NetworkContainer(NodeDeque& nodes, const std::deque<Link>& links) : links_(links) { if (!utilities::NodesAndLinksConsistent(nodes, links)) { throw std::invalid_argument("Passed nodes and links ...
#include "neurons/network-container.h" #include "neurons/utilities.h" namespace neurons { NetworkContainer::NetworkContainer(NodeDeque& nodes, const std::deque<Link>& links) : links_(links) { if (!utilities::NodesAndLinksConsistent(nodes, links)) { throw std::in
std::vector<fl::Variable> Add(const std::vector<fl::Variable>& lhs, const std::vector<fl::Variable>& rhs) { if (lhs.size() != rhs.size()) { throw std::invalid_argument("Vector sizes do not match!"); } std::vector<fl::Variable> result; for (size_t i = 0; i < lhs.size(); ++i) { result.push_back(lh...
valid_argument("Passed nodes and links are inconsistent."); } if (utilities::CountConnectedComponents(nodes, links) != 1) { throw std::invalid_argument("Graph does not consist of 1 component."); } if (utilities::ContainsDirectedCycle(nodes, links)) { throw std::invalid_argument("Graph contains a directe...
function_block-function_prefixed
[ { "content": "class Link {\n\n\n\n public:\n\n\n\n // Public member variables.\n\n std::shared_ptr<Node> input_;\n\n std::shared_ptr<Node> output_;\n\n\n\n // Get link ID.\n\n [[nodiscard]] size_t GetId() const;\n\n\n\n // Public constructor. Pass shared_ptr by value as Links will share ownership.\n\n Li...
C++
src/elements/areas/AreaProduction.cpp
FlorianEith/rcll_status_board
2358ca07d72ad090408c0810071b95c03416b02c
#include <AreaProduction.h> rcll_draw::AreaProduction::AreaProduction(){ hp_header = HeaderPanel("LOGISTICS LEAGUE", rcll_draw::NO_TEAM); thp_team_header_cyan = TeamHeaderPanel(); thp_team_header_magenta = TeamHeaderPanel(); vsp_gameinfo = VStatusPanel(rcll_draw::NO_TEAM); pi_productinfo_cyan = P...
#include <AreaProduction.h> rcll_draw::AreaProduction::AreaProduction(){ hp_header = HeaderPanel("LOGISTICS LEAGUE", rcll_draw::NO_TEAM); thp_team_header_cyan = TeamHeaderPanel(); thp_team_header_magenta = TeamHeaderPanel(); vsp_gameinfo = VStatusPanel(rcll_draw::NO_TEAM); pi_productinfo_cyan = P...
, show_element_borders); mip_machineinfo_magenta.draw(mat, show_element_borders); gf_gamefield.draw(mat, show_element_borders); blbl_text.draw(mat); }
); allow_paging_by_move &= !pi_productinfo_cyan.move(); allow_paging_by_move &= !pi_productinfo_magenta.move(); } else { allow_paging_by_move = true; ri_robotinfo_cyan.draw(mat, show_element_borders); ri_robotinfo_magenta.draw(mat, show_element_borders); } if (allow_...
function_block-random_span
[ { "content": " class MachineInfoProduction {\n\n public:\n\n MachineInfoProduction();\n\n MachineInfoProduction(Team team);\n\n ~MachineInfoProduction();\n\n\n\n void setShortDisplay(bool short_display);\n\n void setGeometry(int x, int y, double scale);\n\n\n\n in...
C++
WithComments/grid.cc
RootofalleviI/Reversi
e52bf7ead191568114504945b62c7b955a2074a5
#include <string> #include <sstream> #include "grid.h" using namespace std; void Grid::init(size_t n) { dim = n; if (td) delete td; td = new TextDisplay(n); theGrid.clear(); for (size_t i=0; i<dim; ++i) { theGrid.emplace_back(vector<Cell>()); for (size_t j=0; j<dim; ++j)...
#include <string> #include <sstream> #include "grid.h" using namespace std; void Grid::init(size_t n) { dim = n; if (td) delete td; td = new TextDisplay(n); theGrid.clear(); for (size_t i=0; i<dim; ++i) { theGrid.emplace_back(vector<Cell>()); for (size_t j=0; j<dim; ++j)...
void Grid::updateCounter() { stringstream ss; ss << *td; string s = ss.str(); black = count(s, 'B'); white = count(s, 'W'); } void Grid::toggle(size_t r, size_t c) { theGrid[r][c].toggle(); } bool Grid::isFull() const { return (white+black == dim*dim); } Grid::~Grid() { delete td; } Colour Grid:...
int count(string s, char c) { size_t x = 0, len = s.size(); for (size_t i=0; i<len; ++i) { if (s[i] == c) ++x; } return x; }
function_block-full_function
[ { "content": " Colour colour; \n", "file_path": "state.h", "rank": 0, "score": 67877.03442930145 }, { "content": " Colour colour; \n", "file_path": "WithComments/state.h", "rank": 1, "score": 65354.836290758016 }, { "content": " Colour colour;\n", "file_path": ...
C++
src/control.hpp
Gypsophino-dev/Gypsophino
484325bd5db36d99cdc13048646695b94f656111
#pragma once #include "const.hpp" #include "shape.hpp" #include <array> #include <raylib.h> #include <string> #include <utility> #include <vector> namespace gyp { enum button_status { normal, hover, pressed }; template <class callback_type> class button : public rectangle { private: button_status status{}; std:...
#pragma once #include "const.hpp" #include "shape.hpp" #include <array> #include <raylib.h> #include <string> #include <utility> #include <vector> namespace gyp { enum button_status { normal, hover, pressed }; template <class callback_type> class button : public rectangle { private: button_status status{}; std:...
template <class callback_type> callback_type button<callback_type>::interact(Vector2 mouse) { int mx = static_cast<int>(mouse.x); int my = static_cast<int>(mouse.y); if (mx > x && mx < x + width && my > y && my < y + height) { status = hover; for (int i = 0; i <= 2; i++) { if (IsMouseButtonRe...
void button<callback_type>::draw(button_status stat) { DrawRectangle(x, y, width, height, color.at(stat)); Vector2 text_size = MeasureTextEx(font, text.at(stat).c_str(), font_size, spacing); text_size.x /= -2; text_size.y /= -2; text_size.x += x + width / 2; text_size.y += y + height / 2; DrawTextEx...
function_block-full_function
[ { "content": "class playground : public std::vector<track>, public rectangle {\n\nprivate:\n\n // Geometry\n\n int track_number;\n\n\n\n // Playground style\n\n Color outline;\n\n int thick;\n\n\n\n int current_time;\n\n int speed;\n\n const song_map *song;\n\n Music music;\n\n playground_status statu...
C++
include/amtrs/.driver/win32-g3d-device-opengl.hpp
isaponsoft/libamtrs
5adf821ee15592fc3280985658ca8a4b175ffcaa
 #ifndef __libamtrs__g3d__device__win32__opengl__hpp #define __libamtrs__g3d__device__win32__opengl__hpp #pragma comment(lib, "user32.lib") #pragma comment(lib, "gdi32.lib") #pragma comment(lib, "opengl32.lib") #include ".api-windows.hpp" #include <GL/gl.h> #include <GL/glext.h> #include <GL/wglext.h> #include "openg...
 #ifndef __libamtrs__g3d__device__win32__opengl__hpp #define __libamtrs__g3d__device__win32__opengl__hpp #pragma comment(lib, "user32.lib") #pragma comment(lib, "gdi32.lib") #pragma comment(lib, "opengl32.lib") #include ".api-windows.hpp" #include <GL/gl.h> #include <GL/glext.h> #include <GL/wglext.h> #include "openg...
rtExtAPI = false; }; AMTRS_WIN32_OPENGL_NAMESPACE_END AMTRS_G3D_NAMESPACE_BEGIN template<class BitmapT> inline ref<device> device::create(BitmapT* _bitmap) { using namespace os::win32; class device : public win32::opengl::device { public: using _base_type = win32::opengl::device; device(BitmapT* _bmp) ...
; if (!mGLRC) { throw std::system_error(make_last_error_code(), "wglCreateContext()"); } wglMakeCurrent(_hdc, mGLRC); mDC = _hdc; auto wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB"); if (wglCreateContextAttribsARB) { static const ...
random
[ { "content": "// ============================================================================\n\n//! 標準ファイルシステムに対するインターフェース\n\n// ----------------------------------------------------------------------------\n\n//! std::filesystem を仮想化します。\n\n// -------------------------------------------------------------------...
C++
CrescentEngine/Models/Mesh.cpp
xRiveria/Crescent-Engine
b6512b6a8dab2d27cf542c562ccc28f21bf2345d
#include "CrescentPCH.h" #include "Mesh.h" #include "GL/glew.h" #include <glm/gtc/type_ptr.hpp> #include <algorithm> namespace Crescent { Mesh::Mesh() { } Mesh::Mesh(std::vector<glm::vec3> positions, std::vector<unsigned int> indices) { m_Positions = positions; m_Indices = indices; } Mesh::Mesh(std::vect...
#include "CrescentPCH.h" #include "Mesh.h" #include "GL/glew.h" #include <glm/gtc/type_ptr.hpp> #include <algorithm> namespace Crescent { Mesh::Mesh() { } Mesh::Mesh(std::vector<glm::vec3> positions, std::vector<unsigned int> indices) { m_Positions = positions; m_Indices = indices; } Mesh::Mesh(std::vect...
; auto left_ptr = right_ptr - 1; float factor = (ticks - left_ptr->mTime) / (right_ptr->mTime - left_ptr->mTime); return mat4_from_aivector3d(left_ptr->mValue * (1.0f - factor) + right_ptr->mValue * factor); } glm::mat4 Mesh::InterpolateRotationMatrix(aiQuatKey* keys, uint32_t n, double ticks) { static aut...
std::upper_bound(keys, keys + n, anchor, [](const aiVectorKey& a, const aiVectorKey& b) { return a.mTime < b.mTime; })
call_expression
[ { "content": "struct aiMeshKey\n\n{\n\n /** The time of this key */\n\n double mTime;\n\n\n\n /** Index into the aiMesh::mAnimMeshes array of the\n\n * mesh corresponding to the #aiMeshAnim hosting this\n\n * key frame. The referenced anim mesh is evaluated\n\n * according to the rules d...
C++
src/common/partial.hh
sergeyfilip/objectstore
e2d0c86134c46c77fb143f7198d13fab7f5b1ea5
#ifndef COMMON_PARTIAL_HH #define COMMON_PARTIAL_HH template <typename R> class BindBase { public: virtual R operator()() const = 0; virtual ~BindBase() { } virtual BindBase* clone() const = 0; }; template <typename R, typename Obj> class BindBaseM { public: virtual R operator()(Obj&) const = 0; virtual ~...
#ifndef COMMON_PARTIAL_HH #define COMMON_PARTIAL_HH template <typename R> class BindBase { public: virtual R operator()() const = 0; virtual ~BindBase() { } virtual BindBase* clone() const = 0; }; template <typename R, typename Obj> class BindBaseM { public: virtual R operator()(Obj&) const = 0; virtual ~...
*fun)(bound1,bound2,bound3); } Closure0B3c<InstanceT,Out,Bound1,Bound2,Bound3>* clone() const { return new Closure0B3c<InstanceT,Out,Bound1,Bound2,Bound3>(*this); } private: const InstanceT *instance; Out (InstanceT::*fun)(Bound1,Bound2,Bound3) const; Bound1 bound1; Bound2 bound2; Bound3 bound3; }; t...
n> papply(Out (Obj::*f)(In), In in) { return Bind1M<Out, Obj, In>(f, in); } template <class Out, class In1, class In2> inline Bind2<Out,In1,In2> papply(Out (*f)(In1,In2), In1 in1, In2 in2) { return Bind2<Out,In1,In2>(f, in1, in2); } template <class Out, class Obj, class In1, class In2> inline Bind2M<Out, Obj, In1...
random
[]
C++
server/modules/routing/binlogrouter/blr_event.cc
tut-blog/MaxScale
cabd6dba0665cb8025c694acf98cffaa68d10de0
#include "blr.hh" #include <inttypes.h> #include <maxscale/alloc.h> bool blr_handle_one_event(MXS_ROUTER* instance, REP_HEADER& hdr, uint8_t* ptr, uint32_t len, int semisync) { ROUTER_INSTANCE* router = static_cast<ROUTER_INSTANCE*>(instance); router->lastEventReceived = hdr.event_type; router->lastEve...
#include "blr.hh" #include <inttypes.h> #include <maxscale/alloc.h> bool blr_handle_one_event(MXS_ROUTER* instance, REP_HEADER& hdr, uint8_t* ptr, uint32_t len, int semisync) { ROUTER_INSTANCE* router = static_cast<ROUTER_INSTANCE*>(instance); router->lastEventReceived = hdr.event_type; router->lastEve...
if (strncmp(statement_sql, "COMMIT", 6) == 0) { router->pending_transaction.state = BLRM_COMMIT_SEEN; } if (router->pending_transaction.state > BLRM_NO_TRANSACTION && router->pending_transaction.standalone) ...
if (strncmp(statement_sql, "BEGIN", 5) == 0) { if (router->pending_transaction.state > BLRM_NO_TRANSACTION) { MXS_ERROR("A transaction is already open " "@ %lu and a new one starts @ %lu", router-...
if_condition
[ { "content": "#define GTID_MAX_LEN 64\n\n\n", "file_path": "include/maxscale/mysql_binlog.h", "rank": 0, "score": 229626.218827728 }, { "content": " struct mxs_router* router_instance; /**< The router instance for this\n", "file_path": "include/maxscale/service.h", "ra...
C++
game/src/main/cpp/game/Particles/Splash.cpp
zorin-egor/PingPongGame
fc4084f4e0efaa8d24605e7ae00b630c2ae984b7
#include "Splash.h" Splash::Splash(GLuint count, GLuint lifeTime, GLuint programID, GLuint textureID, GLuint positionAttr, GLuint colorStartAttr, GLuint colorEndAttr, GLuint deltaAttr, GLuint sizeUni...
#include "Splash.h" Splash::Splash(GLuint count, GLuint lifeTime, GLuint programID, GLuint textureID, GLuint positionAttr, GLuint colorStartAttr, GLuint colorEndAttr, GLuint deltaAttr, GLuint sizeUni...
void Splash::setSplashPosition(GLfloat x, GLfloat y) { m_nLifeTime = TOTAL_LIFE_TIME; for (int i = 0; i < m_nCount; i++) { m_pPositionArray[i * 2] = x; m_pPositionArray[i * 2 + 1] = y; } } void Splash::setValues() { m_nLifeTime--; for (int i = 0; i < m_nCount; i++) { ...
void Splash::initArrays() { m_pPositionArray = new GLfloat[m_nCount * 2]; Methods::fillArray(m_pPositionArray, 0.0f, m_nCount * 2); m_pDeltaArray = new GLfloat[m_nCount]; m_pColorStartArray = new GLfloat[m_nCount * 4]; Methods::fillArray(m_pColorStartArray, 0.0f, m_nCount * 4); ...
function_block-full_function
[ { "content": "def APP_CODE = 2\n", "file_path": "game/build.gradle", "rank": 0, "score": 19471.39118875441 }, { "content": " m_nColorResetTimer = COLOR_INITIAL_TIMER;\n\n m_bIsColorReset = true;\n\n}\n\n\n\nvoid Shape::setParticlesCount(GLuint count) {\n\n m_nCount = count > 5000 &&...
C++
media/gpu/chromeos/platform_video_frame_utils.cc
Ron423c/chromium
2edf7b980065b648f8b2a6e52193d83832fe36b7
#include "media/gpu/chromeos/platform_video_frame_utils.h" #include <drm_fourcc.h> #include <xf86drm.h> #include <limits> #include "base/bind.h" #include "base/callback_helpers.h" #include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/scoped_file.h" #include "base/no_destructor.h" #inc...
#include "media/gpu/chromeos/platform_video_frame_utils.h" #include <drm_fourcc.h> #include <xf86drm.h> #include <limits> #include "base/bind.h" #include "base/callback_helpers.h" #include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/scoped_file.h" #include "base/no_destructor.h" #inc...
fx::Size& natural_size, base::TimeDelta timestamp, gfx::BufferUsage buffer_usage) { base::ScopedClosureRunner destroy_cb((base::DoNothing())); auto gmb_handle = AllocateGpuMemoryBufferHandle(factory, pixel_format, coded_size, visible_rect, buffer_usage, destroy_cb);...
Wrapper& operator=(const GbmDeviceWrapper&) = delete; static GbmDeviceWrapper* Get() { static base::NoDestructor<GbmDeviceWrapper> gbm_device_wrapper; return gbm_device_wrapper.get(); } gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( gfx::BufferFormat format, const gfx::Size& size, ...
random
[]
C++
projects/client/gui/bloom/source/bloom/Garden.cpp
silentorb/mythic-cpp
97319d158800d77e1a944c47c13523662bc07e08
#include "Garden.h" #include "clienting/Mythic_Client.h" #include "haft/Input_State.h" #include "lookinglass/Lookinglass_Resources.h" #include <iostream> #include <bloom/layout/Axis.h> #include <bloom/flowers/Group.h> #include "framing/Frame_Info.h" #include "bloom/flowers/Flower.h" #include <bloom/flowers/Roo...
#include "Garden.h" #include "clienting/Mythic_Client.h" #include "haft/Input_State.h" #include "lookinglass/Lookinglass_Resources.h" #include <iostream> #include <bloom/layout/Axis.h> #include <bloom/flowers/Group.h> #include "framing/Frame_Info.h" #include "bloom/flowers/Flower.h" #include <bloom/flowers/Roo...
void Garden::update_layout() { auto dimensions = draw.get_frame().get_dimensions(); converter.set_pixel_dimensions(dimensions); Axis_Values_Old base_axis_values{ converter.get_axis_values<Horizontal_Axis>(), converter.get_axis_values<Vertical_Axis>() }; auto pixel_dimens...
void Garden::update_input(haft::Input_State &input_state) { auto input_result = garden_input.update_input(input_state); { flowers::Flower &start = get_event_root(); if (input_result.mouse_click) { auto &position = input_state.get_position(); if (start.check_event({Events::a...
function_block-full_function
[ { "content": " class Root;\n\n }\n\n\n", "file_path": "projects/client/gui/bloom/source/bloom/Garden.h", "rank": 0, "score": 198418.698124333 }, { "content": " class Garden {\n\n// shared_ptr<Style> default_style;\n\n unique_ptr<flowers::Root> root;\n\n unique_ptr<haft::A...
C++
ProjectLunarFront/LogSystem.hpp
Edgaru089/ProjectLunarFront
bf59c6dec36e0576082acf3c72abf3c82bc92241
#pragma once #include <iostream> #include <string> #include <ctime> #include <cstring> #include <cstdio> #include <functional> #include <vector> #include <mutex> #include "StringParser.hpp" using namespace std; #define AUTOLOCK(a) lock_guard<mutex> __mutex_lock(a) #ifndef DISABLE_ALL_LOGS class Log { public: cons...
#pragma once #include <iostream> #include <string> #include <ctime> #include <cstring> #include <cstdio> #include <functional> #include <vector> #include <mutex> #include "StringParser.hpp" using namespace std; #define AUTOLOCK(a) lock_guard<mutex> __mutex_lock(a) #ifndef DISABLE_ALL_LOGS class Log { public: cons...
template<typename... Args> void logf(LogLevel level, wstring format, Args... args) { wchar_t buf[2560]; wsprintf(buf, format.c_str(), args...); log(wstring(buf), level); } void operator() (const wstring& content, LogLevel level = Info) { log(content, level); } void addOutputStream(wostream& output) { ...
void log(const wstring& content, LogLevel level = Info) { if (level <= ignoreLevel) return; time_t curtime = time(NULL); wchar_t buffer[64] = {}; wcsftime(buffer, 63, L"[%T", localtime(&curtime)); wstring final = wstring(buffer) + L" " + logLevelName[level] + L"] " + content + L'\n'; lock.lock(); buffers....
function_block-full_function
[ { "content": "class StringDatabase :public Lockable {\n\npublic:\n\n\n\n\tbool initializeWithFolder(const fs::path& dbFolder);\n\n\n\n\tUuid insert(const string& contents);\n\n\tbool remove(Uuid id);\n\n\n\n\tconst StringDBObject& get(Uuid id) {\n\n\t\tlock_guard<Lockable>(*this);\n\n\t\tauto i = objs.find(id);...
C++
src/HistTool.cpp
xzf89718/bbtautau-hists
3f20c9d9cf82149df12aef155c6dd148a367aece
#include "HistTool.h" #include <exception> #include <algorithm> #include <vector> #include <iostream> #include <fstream> #include <sstream> #include <set> #include <map> #include <iomanip> using namespace std; # define FOUR_COLUMN_TABLE(A, B, C, D) \ std::left << setw(36) << A \ << std::left << setw(15) <...
#include "HistTool.h" #include <exception> #include <algorithm> #include <vector> #include <iostream> #include <fstream> #include <sstream> #include <set> #include <map> #include <iomanip> using namespace std; # define FOUR_COLUMN_TABLE(A, B, C, D) \ std::left << setw(36) << A \ << std::left << setw(15) <...
oid HistToolHelper::rebinByNRebin(const Config* c) { vector<ProcessInfo*>* ps = c->processes->content(); for_each(ps->begin(), ps->end(), [&c](ProcessInfo* p) { p->histogram->Rebin(c->current_variable->n_rebin); for (auto& pp : p->systematic_histograms) { pp.second->Rebin(c->...
< 1) { cerr << "FAIL: empty input\n"; return false; } return true; } void HistTool::manipulate(Config* c) { c->setManipulated(true); vector<ProcessInfo*>* ps_in_c = c->processes->content(); clog << "INFO: merging\n"; map<eProcess, vector<ProcessInfo*>> procs; for_each...
random
[ { "content": "class BasicInfo\n\n{\n\npublic:\n\n BasicInfo(const string& ecm, const string& lumi) noexcept;\n\n\n\npublic:\n\n string ecm;\n\n string luminosity;\n\n};\n\n\n\n\n", "file_path": "src/Config.h", "rank": 0, "score": 76141.76415751204 }, { "content": "class Config\n\n{\...
C++
src/GRCPrinter.cpp
dilawar/cec-esteral
c21ed6dea7392a3c4553d304eeeaaee188a6f567
#include "GRCPrinter.hpp" #include <cassert> namespace GRCDot { void GRCDP::visit_cfg(GRCNode *n) { assert(n); if (reached.find(n) == reached.end()) { reached.insert(n); assert(cfgnum.find(n) != cfgnum.end()); mynum = cfgnum[n]; o << 'n' << mynum << ' '; n->wel...
#include "GRCPrinter.hpp" #include <cassert> namespace GRCDot { void GRCDP::visit_cfg(GRCNode *n) { assert(n); if (reached.find(n) == reached.end()) { reached.insert(n); assert(cfgnum.find(n) != cfgnum.end()); mynum = cfgnum[n]; o << 'n' << mynum << ' '; n->wel...
Status GRCDP::visit(DefineSignal &s){ o << "[label=\""; if (!clean) o << mynum << " DefS\\n"; o << s.signal->name << "\" shape=house orientation=90]\n"; return Status(); } void GRCDP::visit_st(STNode *n) { assert(n); mynum = stnum[n]; o << 'n' << mynum << ' '; n->welcome(*...
Status GRCDP::visit(Nop &s){ o << "[label=\""; if (!clean) o << mynum << " "; if (s.isflowin()) o << "*"; else if (s.isshortcut()) o << "#"; else o << "\\n" << s.code; o << "\" shape=circle]\n"; return Status(); }
function_block-function_prefix_line
[ { "content": " class Sync;\n", "file_path": "src/AST.hpp", "rank": 0, "score": 85744.66952829852 }, { "content": " class Fork;\n", "file_path": "src/AST.hpp", "rank": 1, "score": 85739.77028225773 }, { "content": " class Action;\n", "file_path": "src/AST.hpp", ...
C++
src/nlr/LPFormulator.cpp
yuvaljacoby/Marabou-1
553b780ef2e2cfe349b3954adc433a27af37a50f
#include "GurobiWrapper.h" #include "InfeasibleQueryException.h" #include "LPFormulator.h" #include "Layer.h" #include "MStringf.h" #include "NLRError.h" #include "TimeUtils.h" namespace NLR { LPFormulator::LPFormulator( LayerOwner *layerOwner ) : _layerOwner( layerOwner ) , _cutoffInUse( false ) , _cut...
#include "GurobiWrapper.h" #include "InfeasibleQueryException.h" #include "LPFormulator.h" #include "Layer.h" #include "MStringf.h" #include "NLRError.h" #include "TimeUtils.h" namespace NLR { LPFormulator::LPFormulator( LayerOwner *layerOwner ) : _layerOwner( layerOwner ) , _cutoffInUse( false ) , _cut...
rapper::Term> terms; terms.append( GurobiWrapper::Term( 1, Stringf( "x%u", targetVariable ) ) ); gurobi.addEqConstraint( terms, 0 ); } else { List<GurobiWrapper::Term> terms; terms.appe...
%u", variable ); ub = solveLPRelaxation( layers, MinOrMax::MAX, variableName, layer->getLayerIndex() ); if ( ub < currentUb ) { if ( FloatUtils::...
random
[ { "content": "class Stringf : public String\n\n{\n\npublic:\n\n enum {\n\n MAX_STRING_LENGTH = 10000,\n\n };\n\n\n\n Stringf( const char *format, ... )\n\n {\n\n va_list argList;\n\n va_start( argList, format );\n\n\n\n char buffer[MAX_STRING_LENGTH];\n\n\n\n vspri...
C++
cpp/meta/typelist.hpp
so61pi/examples
38e2831cd6517864fc05f499f72fbb4ff6ae27c0
#ifndef TYPELIST_HPP #define TYPELIST_HPP #include <cstddef> #include <type_traits> namespace tl { template<typename... Ts> struct typelist; template<typename T, typename... Ts> struct typelist<T, Ts...> { using first_type = T; using next = typelist<Ts...>; using size = std::integral_constant<std::size...
#ifndef TYPELIST_HPP #define TYPELIST_HPP #include <cstddef> #include <type_traits> namespace tl { template<typename... Ts> struct typelist; template<typename T, typename... Ts> struct typelist<T, Ts...> { using first_type = T; using next = typelist<Ts...>; using size = std::integral_constant<std::size...
late<typename Left, typename Right> struct concat { TYPELIST_ASSERT(Left) TYPELIST_ASSERT(Right) private: using newLeft = typename push_back<Left, typename Right::first_type>::type; using newRight = typename Right::next; public: using type = typename concat<newLeft, newRight>::type; }; templa...
:type; }; template<typename TypeList, typename IntegralIndex> using remove_t = typename remove<TypeList, IntegralIndex>::type; template<typename TypeList, std::size_t Index> using remove_c = remove<TypeList, std::integral_constant<std::size_t, Index>>; template<typename TypeList, std::size_t Index> using remove_c_t ...
random
[ { "content": "struct lambda<std::integral_constant<std::size_t, Index>> {\n\n using type =\n\n struct {\n\n template<typename... Xs>\n\n struct apply {\n\n static_assert(Index < sizeof...(Xs), \"index out of range\");\n\n \n\n using ty...
C++
cplusplus/call/src/alignment_functions.cpp
erasmus-center-for-biomics/Nimbus
bbf7ca288d798d8f1c6156ddf45fed31892bd557
#include <cstdlib> #include <string> #include <sstream> #include <iostream> #include <vector> #include <algorithm> #include <sam.h> #include <alignment_functions.h> #include <cigar.h> #include <sample.h> namespace nimbus { std::string alignment_sequence( const bam1_t* alignment, int start, int end ) { ...
#include <cstdlib> #include <string> #include <sstream> #include <iostream> #include <vector> #include <algorithm> #include <sam.h> #include <alignment_functions.h> #include <cigar.h> #include <sample.h> namespace nimbus { std::string alignment_sequence( const bam1_t* alignment, int start, int end ) { ...
std::string Strand( const bam1_t* alignment ) { return bam_is_rev(alignment) ? "reverse" : "forward" ; } std::string Amplicon( const bam1_t* alignment ) { uint8_t* p = bam_aux_get( alignment, "am" ) ; if( p ) { return std::string( bam_aux2Z(p) ) ; } return "unknown" ; } }
std::string rval = "unknown" ; if( label.size() != 2 ) return rval ; uint8_t* p = bam_aux_get( alignment, label.c_str() ) ; if( p ) { rval = std::string( bam_aux2Z(p) ) ; } return rval ; }
function_block-function_prefix_line
[ { "content": "\tclass CigarOperation {\n\n\t\tchar _operation ;\n\n\t\tstd::size_t _runlength ;\n\n\n\n\tpublic:\n\n\t\tCigarOperation() {\n\n\t\t\t_operation = '?' ;\n\n\t\t\t_runlength = 0 ;\n\n\t\t}\n\n\n\n\t\tCigarOperation( char o, std::size_t n ) {\n\n\t\t\tset( o, n ) ;\n\n\t\t}\n\n\n\n\t\tvoid set( char...
C++
software/src/master/src/vca_sample_distribution_server/vca_sample_distribution_server.cpp
c-kuhlman/vision
46b25f7c0da703c059acc8f0a2eac1d5badf9f6d
#include "Vk.h" #include "Vca_VOneAppMain_.h" #include "Vca_VServerApplication.h" #include "Vca_VLineGrabber.h" #include "vca_samples_ipublication.h" #include "vca_samples_isubscription.h" namespace VcaSamples { class ThisApp : public Vca::VServerApplication { DECLARE_CONCRETE_RTT (ThisApp, Vca::VServerAp...
#include "Vk.h" #include "Vca_VOneAppMain_.h" #include "Vca_VServerApplication.h" #include "Vca_VLineGrabber.h" #include "vca_samples_ipublication.h" #include "vca_samples_isubscription.h" namespace VcaSamples { class ThisApp : public Vca::VServerApplication { DECLARE_CONCRETE_RTT (ThisApp, Vca::VServerAp...
bool VcaSamples::ThisApp::start_() { if (!BaseClass::start_()) return false; if (offerSelf ()) getStandardInput (); else { fprintf (stderr, "Usage: No address to offer object.\n"); setExitStatus (ErrorExitValue); } return isStarting (); } void VcaSamples::ThisApp::onStandardInput (Vca::VB...
void VcaSamples::ThisApp::Subscribe ( IPublication *pRole, ISubscriber *pSubscriber, IRecipient *pRecipient, bool bSuspended ) { if (pSubscriber) { Subscription::IRecipient::Reference pMessageReceiver ( dynamic_cast<Subscription::IRecipient*>(pRecipient) ); if (pMessageReceiver.isNil ()) pSubscribe...
function_block-full_function
[ { "content": "\t class Property_<void (Container_T::*)(IVReceiver<Value_T>*) const> : public Property {\n\n\tpublic:\n\n\t typedef void (Container_T::*accessor_t)(IVReceiver<Value_T>*) const;\n\n\t typedef Property_<accessor_t> this_t;\n\n\t DECLARE_CONCRETE_RTTLITE (this_t, Property);\n\n\n\n\t// ...
C++
nestedtensor/csrc/nested_tensor_impl.cpp
jbschlosser/nestedtensor
29d58d85ccd2c1b47fc40f2786f08c713f49acc6
#include <ATen/ATen.h> #include <ATen/NamedTensorUtils.h> #include <ATen/WrapDimUtils.h> #include <ATen/core/op_registration/op_registration.h> #include <nestedtensor/csrc/nested_tensor_impl.h> #include <nestedtensor/csrc/utils/nested_node_functions.h> #include <torch/csrc/jit/runtime/operator.h> #include <torch/librar...
#include <ATen/ATen.h> #include <ATen/NamedTensorUtils.h> #include <ATen/WrapDimUtils.h> #include <ATen/core/op_registration/op_registration.h> #include <nestedtensor/csrc/nested_tensor_impl.h> #include <nestedtensor/csrc/utils/nested_node_functions.h> #include <torch/csrc/jit/runtime/operator.h> #include <torch/librar...
}, self); } Tensor& NestedTensor_squeeze_(Tensor& self) { self = _NestedTensor_squeeze_(self, c10::nullopt); return self; } Tensor& NestedTensor_squeeze__dim(Tensor& self, int64_t dim) { self = _NestedTensor_squeeze_(self, dim); return self; } Tensor NestedTensor_squeeze_dim(const Tensor& self, int64_...
return wrap_buffer(get_buffer(self_cont), get_efficient_nested_size(self), new_strides); } TORCH_CHECK(false, "Given memory format ", memory_format, " not supported by NestedTensor_contiguous."); return self; } bool NestedTensor_is_pinned(const Tensor& self, c10::optional<Device> device) { TORCH_CHECK( ...
random
[ { "content": " int64_t height() const {\n\n return _height;\n", "file_path": "nestedtensor/csrc/storage/EfficientSizeNode.h", "rank": 0, "score": 146452.20706677216 }, { "content": " int64_t dim() const {\n\n return _sizes.dim() > 0 ? _height + _sizes.size(1) : _height;\n", "file...
C++
GDADPRG_Courseware/TextureManager.cpp
NeilDG/GDADPRG-GDPARCM_Courseware
771509ec7b3eb6d6375807819ca9da957dd22641
#include <stddef.h> #include <iostream> #include "TextureManager.h" TextureManager* TextureManager::sharedInstance = NULL; TextureManager* TextureManager::getInstance() { if (sharedInstance == NULL) { sharedInstance = new TextureManager(); } return sharedInstance; } void TextureManager::loadAll() { sf::Tex...
#include <stddef.h> #include <iostream> #include "TextureManager.h" TextureManager* TextureManager::sharedInstance = NULL; TextureManager* TextureManager::getInstance() { if (sharedInstance == NULL) { sharedInstance = new TextureManager(); } return sharedInstance; } void TextureManager::loadAll() { sf::Tex...
sf::Texture* TextureManager::getTextureAt(TextureManager::AssetType assetType, int index) { if (!this->textureMap[assetType].empty()) { return this->textureMap[assetType][index]; } else { cout << "No texture found for " << assetType; return NULL; } } int TextureManager::getTextureLength(TextureManager::Ass...
h_back(texture); texture = new sf::Texture(); texture->loadFromFile("Media/Textures/coin0005.png"); this->textureMap[Coin].push_back(texture); texture = new sf::Texture(); texture->loadFromFile("Media/Textures/coin0006.png"); this->textureMap[Coin].push_back(texture); texture = new sf::Texture(); texture->lo...
function_block-function_prefixed
[ { "content": "class RenderTexture;\n", "file_path": "SFML-2.5.1/include/SFML/Graphics/Texture.hpp", "rank": 0, "score": 96601.72563755105 }, { "content": " class RenderTextureImpl;\n\n}\n\n\n", "file_path": "SFML-2.5.1/include/SFML/Graphics/RenderTexture.hpp", "rank": 1, "scor...
C++
src/tests/test_fixedindexarray.cpp
P-Sc/Pirateers
440e477d33bbbcd79d291700c369f74fd0a6cc7d
#include "test_fixedindexarray.h" #include "utils/fixedindexarray.h" void Test_FixedIndexArray::test1() { currentTestCase = 1; log("Testing: add() and getSize()"); for (unsigned int i = 50; i < 150; i++) { fixArray1->add(i); fixArray2->add(i); } if (fixArray1->getSize() == 100 && ...
#include "test_fixedindexarray.h" #include "utils/fixedindexarray.h" void Test_FixedIndexArray::test1() { currentTestCase = 1; log("Testing: add() and getSize()"); for (unsigned int i = 50; i < 150; i++) { fixArray1->add(i); fixArray2->add(i); } if (fixArray1->getSize() == 100 && ...
void Test_FixedIndexArray::test3() { currentTestCase = 3; log("Testing: get()"); for (unsigned int i = 100; i < 205; i++) { fixArray1->add(i); fixArray2->add(i); } for (unsigned int i = 0; i < 100; i++) { if (fixArray1->get(i) != i+100 || fixArray2->get(i) != i+100) { ...
i++) { fixArray1->add(i); fixArray2->add(i); } for (unsigned int i = 0; i < 250; i++) { fixArray1->erase(2*i); fixArray2->erase(2*i); } if (fixArray1->getSize() != 250 || fixArray2->getSize() != 250) reportFailure(); for (unsigned int i = 0; i < 50; i++) { ...
function_block-function_prefixed
[ { "content": "#include \"fixedindexarray.h\"\n\n#include <stdexcept>\n\n#include <cassert>\n\n\n\nusing std::list;\n\n\n\n/**\n\n * @brief Vergrößert das Array um stepSize (Standard: 100)\n\n */\n\nvoid FixedIndexArray::appendStepSize() {\n\n // unusedPosition anpassen\n\n for (unsigned int i = 0; i < ste...
C++
code/tool/edges-master/piotr_toolbox/matlab/private/dijkstra1.cpp
hyliang96/interpretableCNN_matlab
611e52a1aa25434ab058303c0287634767327da3
#if (_MSC_VER >= 1600) #define __STDC_UTF_16__ typedef unsigned short char16_t; #endif #include "mex.h" #include "fibheap.h" #define DIJKSTRA_CPP class HeapNode : public FibHeapNode { double N; long int IndexV; public: HeapNode() : FibHeapNode() { N = 0; }; virtual void operator =(FibHeapNode& RHS); ...
#if (_MSC_VER >= 1600) #define __STDC_UTF_16__ typedef unsigned short char16_t; #endif #include "mex.h" #include "fibheap.h" #define DIJKSTRA_CPP class HeapNode : public FibHeapNode { double N; long int IndexV; public: HeapNode() : FibHeapNode() { N = 0; }; virtual void operator =(FibHeapNode& RHS); ...
void dijkstra( long int n, long int nSrc, double *sources, double *D, double *P, const mxArray *G ) { double *Gpr = mxGetPr(G); mwIndex *Gir = mxGetIr(G); mwIndex *Gjc = mxGetJc(G); double *D1 = (double *) mxCalloc( n , sizeof( double )); double *P1 = (double *) mxCalloc( n , sizeof( double )); ...
void dijkstra1( long int n, long int s, double *D1, double *P1, double *Gpr, mwIndex *Gir, mwIndex *Gjc) { int finished; long int i, startInd, endInd, whichNeigh, nDone, closest; double closestD, arcLength, INF, SMALL, oldDist; HeapNode *A, *hnMin, hnTmp; FibHeap *heap; INF=mxGetInf(); SMALL=mxGetEps()...
function_block-full_function
[ { "content": " class MexContext : public Context\n\n {\n\n public:\n\n MexContext() ;\n\n ~MexContext() ;\n\n\n\n protected:\n\n#if ENABLE_GPU\n\n vl::ErrorCode initGpu() ;\n\n vl::ErrorCode validateGpu() ;\n\n mxArray * canary ; // if it breathes, the GPU state is valid\n\n bool gpuIsInit...
C++
ios/samples/hello-ar/hello-ar/FilamentArView/FilamentApp.cpp
andykit/filament
f4f9f331c0882db6b58d1ec5ea2bb42ae9baf1d4
#include "FilamentApp.h" #include <filament/Camera.h> #include <filament/IndexBuffer.h> #include <filament/LightManager.h> #include <filament/Material.h> #include <filament/TransformManager.h> #include <filament/VertexBuffer.h> #include <filament/Viewport.h> #include <filameshio/MeshReader.h> #include <geometry/Sur...
#include "FilamentApp.h" #include <filament/Camera.h> #include <filament/IndexBuffer.h> #include <filament/LightManager.h> #include <filament/Material.h> #include <filament/TransformManager.h> #include <filament/VertexBuffer.h> #include <filament/Viewport.h> #include <filameshio/MeshReader.h> #include <geometry/Sur...
void FilamentApp::setupMesh() { MeshReader::Mesh mesh = MeshReader::loadMeshFromBuffer(engine, RESOURCES_CUBE_DATA, nullptr, nullptr, app.materialInstance); app.materialInstance->setParameter("baseColor", RgbType::sRGB, {0.71f, 0.0f, 0.0f}); app.renderable = mesh.renderable; scene->addEnt...
void FilamentApp::setupMaterial() { app.mat = Material::Builder() .package(RESOURCES_CLEAR_COAT_DATA, RESOURCES_CLEAR_COAT_SIZE) .build(*engine); app.materialInstance = app.mat->createInstance(); }
function_block-full_function
[]
C++
ReactNativeFrontend/ios/Pods/boost/boost/contract/detail/decl.hpp
Harshitha91/Tmdb-react-native-node
e06e3f25a7ee6946ef07a1f524fdf62e48424293
#ifndef BOOST_CONTRACT_DETAIL_DECL_HPP_ #define BOOST_CONTRACT_DETAIL_DECL_HPP_ #include <boost/contract/detail/tvariadic.hpp> #if !BOOST_CONTRACT_DETAIL_TVARIADIC #include <boost/contract/core/config.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/preprocessor/tuple/elem.hpp> ...
#ifndef BOOST_CONTRACT_DETAIL_DECL_HPP_ #define BOOST_CONTRACT_DETAIL_DECL_HPP_ #include <boost/contract/detail/tvariadic.hpp> #if !BOOST_CONTRACT_DETAIL_TVARIADIC #include <boost/contract/core/config.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/preprocessor/tuple/elem.hpp> ...
\ BOOST_PP_REPEAT_ ## z( \ BOOST_PP_INC(BOOST_CONTRACT_MAX_ARGS), \ BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_, \ ( 0, O, VR, F, C, Args, v, r, f, obj, args) \ ) \ BOOST_PP_REPEAT_ ## z( \ BOOST_PP_INC(BOOST_CONTRACT_MAX_ARGS), ...
ult_O_R_F_C_Args_v_r_f_obj_args), \ BOOST_PP_TUPLE_ELEM(11, 3, result_O_R_F_C_Args_v_r_f_obj_args), \ BOOST_PP_TUPLE_ELEM(11, 4, result_O_R_F_C_Args_v_r_f_obj_args), \ BOOST_PP_TUPLE_ELEM(11, 5, result_O_R_F_C_Args_v_r_f_obj_args), \ BOOST_PP_TUPLE_ELEM(11, 6, result_O_R_...
random
[]
C++
sdk/rms_sdk/Platform/Http/HttpClientQt.cpp
AzureAD/rms-sdk-for-cpp
0e5d54a030008c5c0f70d8d3d0695fa0722b6ab6
#ifdef QTFRAMEWORK #include "HttpClientQt.h" #include <QThread> #include <QMutex> #include <QEventLoop> #include <QCoreApplication> #include <QTimer> #include <QNetworkProxyFactory> #include "../Logger/Logger.h" #include "../../ModernAPI/RMSExceptions.h" #include "mscertificates.h" #include "HttpClientQt.h" using ...
#ifdef QTFRAMEWORK #include "HttpClientQt.h" #include <QThread> #include <QMutex> #include <QEventLoop> #include <QCoreApplication> #include <QTimer> #include <QNetworkProxyFactory> #include "../Logger/Logger.h" #include "../../ModernAPI/RMSExceptions.h" #include "mscertificates.h" #include "HttpClientQt.h" using ...
)); QObject::connect(lastReply_, SIGNAL(finished()), &loop, SLOT(quit())); QObject::connect(lastReply_, &QNetworkReply::sslErrors, [ = ](QList<QSslError>errorList) { for (auto& error : errorList) { Logger::Error("QSslError: %s", error.errorString()....
shared_ptr<std::atomic<bool> >cancelState) { Logger::Info("==> GetWithCoreAppContext %s", url.data()); this->request_.setUrl(QUrl(url.c_str())); Logger::Hidden("==> Request headers:"); foreach(const QByteArray &hdrName, this->request_.rawHeaderList()) { QByteArray hdrValue = this->request_.rawHeader(hdrN...
random
[ { "content": "namespace rmscore { namespace restclients {\n\n\n\nvoid HandleRestClientError(platform::http::StatusCode httpStatusCode, rmscore::common::ByteArray &sResponse);\n\n\n\n} // namespace restclients\n", "file_path": "sdk/rms_sdk/RestClients/RestClientErrorHandling.h", "rank": 0, "score": 1...
C++
rocsolver/clients/gtest/getri_gtest.cpp
eidenyoshida/rocSOLVER
1240759207b63f8aeba51db259873141c72f9735
#include "testing_getri.hpp" using ::testing::Combine; using ::testing::TestWithParam; using ::testing::Values; using ::testing::ValuesIn; using namespace std; typedef vector<int> getri_tuple; const vector<vector<int>> matrix_size_range = { {0, 1}, {-1, 1}, {20, 5}, {32, 32}, {50, 50}, ...
#include "testing_getri.hpp" using ::testing::Combine; using ::testing::TestWithParam; using ::testing::Values; using ::testing::ValuesIn; using namespace std; typedef vector<int> getri_tuple; const vector<vector<int>> matrix_size_range = { {0, 1}, {-1, 1}, {20, 5}, {32, 32}, {50, 50}, ...
TEST_P(GETRI, __float_complex) { Arguments arg = getri_setup_arguments(GetParam()); if (arg.N == 0) testing_getri_bad_arg<false,false,rocblas_float_complex>(); arg.batch_count = 1; testing_getri<false,false,rocblas_float_complex>(arg); } TEST_P(GETRI, __double_complex) { Arguments arg =...
TEST_P(GETRI, __double) { Arguments arg = getri_setup_arguments(GetParam()); if (arg.N == 0) testing_getri_bad_arg<false,false,double>(); arg.batch_count = 1; testing_getri<false,false,double>(arg); }
function_block-full_function
[ { "content": "class RocBLAS_Test : public testing::TestWithParam<Arguments>\n\n{\n\nprotected:\n\n // This template functor returns true if the type arguments are valid.\n\n // It converts a FILTER specialization to bool to test type matching.\n\n template <typename... T>\n\n struct type_filter_func...
C++
Servers/ServerManager/vtkSMNewWidgetRepresentationProxy.cxx
utkarshayachit/ParaView
7bbb2aa16fdef9cfbcf4a3786cad905d6770771b
#include "vtkSMNewWidgetRepresentationProxy.h" #include "vtkAbstractWidget.h" #include "vtkClientServerInterpreter.h" #include "vtkCommand.h" #include "vtkObjectFactory.h" #include "vtkProcessModule.h" #include "vtkPVGenericRenderWindowInteractor.h" #include "vtkSmartPointer.h" #include "vtkSMDoubleVectorProperty.h" ...
#include "vtkSMNewWidgetRepresentationProxy.h" #include "vtkAbstractWidget.h" #include "vtkClientServerInterpreter.h" #include "vtkCommand.h" #include "vtkObjectFactory.h" #include "vtkProcessModule.h" #include "vtkPVGenericRenderWindowInteractor.h" #include "vtkSmartPointer.h" #include "vtkSMDoubleVectorProperty.h" ...
Prop2D"); } if (!this->RepresentationProxy) { vtkErrorMacro( "A representation proxy must be defined as a Prop (or Prop2D) sub-proxy"); return; } this->RepresentationProxy->SetServers( vtkProcessModule::RENDER_SERVER | vtkProcessModule::CLIENT); this->WidgetProxy = this->GetSubProxy...
h" #include "vtkWeakPointer.h" #include "vtkWidgetRepresentation.h" #include <vtkstd/list> vtkStandardNewMacro(vtkSMNewWidgetRepresentationProxy); class vtkSMNewWidgetRepresentationObserver : public vtkCommand { public: static vtkSMNewWidgetRepresentationObserver *New() { return new vtkSMNewWidgetRepresentati...
random
[ { "content": "def get_include():\n\n \"\"\"\n\n Return the directory in the package that contains header files.\n\n\n\n Extension modules that need to compile against mpi4py should use\n\n this function to locate the appropriate include directory. Using\n\n Python distutils (or perhaps NumPy dist...
C++
torch/lib/THD/master_worker/master/generic/THDStorage.cpp
DavidKo3/mctorch
53ffe61763059677978b4592c8b2153b0c15428f
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "master_worker/master/generic/THDStorage.cpp" #else using namespace thd; using namespace rpc; using namespace master; static THDStorage* THDStorage_(_alloc)() { THDStorage* new_storage = new THDStorage(); std::memset(reinterpret_cast<void*>(new_storage), 0, sizeof(n...
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "master_worker/master/generic/THDStorage.cpp" #else using namespace thd; using namespace rpc; using namespace master; static THDStorage* THDStorage_(_alloc)() { THDStorage* new_storage = new THDStorage(); std::memset(reinterpret_cast<void*>(new_storage), 0, sizeof(n...
void THDStorage_(setFlag)(THDStorage *storage, const char flag) { storage->flag |= flag; } void THDStorage_(clearFlag)(THDStorage *storage, const char flag) { storage->flag &= ~flag; } void THDStorage_(retain)(THDStorage *storage) { if (storage && (storage->flag & TH_STORAGE_REFCOUNTED)) storage->refcount...
1, real value2, real value3, real value4) { RPCType type = type_traits<real>::type; THDStorage *storage = THDStorage_(_alloc)(); storage->size = 4; masterCommandChannel->sendMessage( packMessage( Functions::storageNewWithSize1, type, storage, value1, value2, value3, ...
function_block-function_prefixed
[ { "content": " ptrdiff_t size;\n", "file_path": "torch/lib/THD/master_worker/master/generic/THDStorage.h", "rank": 0, "score": 379224.93917560467 }, { "content": " ptrdiff_t storageOffset;\n", "file_path": "torch/lib/THD/master_worker/master/generic/THDTensor.h", "rank": 1, "sc...
C++
cpp/fntest/pubnub_fntest_runner.cpp
mrtryhard/c-core
4c3c7009a133bf770c255243a2fc580f1629110e
#include "pubnub_fntest_basic.hpp" #include "pubnub_fntest_medium.hpp" #include <iostream> #include <functional> #include <condition_variable> #include <thread> #include <cstdlib> #include <cstring> #if defined _WIN32 #include "windows/console_subscribe_paint.h" #else #include "posix/console_subscribe_paint.h" #end...
#include "pubnub_fntest_basic.hpp" #include "pubnub_fntest_medium.hpp" #include <iostream> #include <functional> #include <condition_variable> #include <thread> #include <cstdlib> #include <cstring> #if defined _WIN32 #include "windows/console_subscribe_paint.h" #else #include "posix/console_subscribe_paint.h" #end...
; notify(aTest[i], TestResult::pass); } catch (std::exception &ex) { std::cout << std::endl; paint_text_white_with_background_red(); std::cout << " !! " << i+1 << ". test '" << aTest[i...
aTest[i].pf(pubkey.c_str(), keysub.c_str(), origin.c_str(), cannot_do_chan_group)
call_expression
[ { "content": "enum class TestResult { fail, pass, indeterminate };\n\nQ_DECLARE_METATYPE(TestResult);\n\n\n\nusing TestFN_T =\n\n std::function<void(std::string const&, std::string const&, std::string const&, bool const&)>;\n\n\n", "file_path": "qt/fntest/pubnub_fntest_runner.cpp", "rank": 0, "sc...
C++
RecoEgamma/EgammaTools/plugins/HGCalPhotonIDValueMapProducer.cc
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
#include <memory> #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/inter...
#include <memory> #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/inter...
HGCalPhotonIDValueMapProducer::HGCalPhotonIDValueMapProducer(const edm::ParameterSet& iConfig) : photonsToken_(consumes<edm::View<reco::Photon>>(iConfig.getParameter<edm::InputTag>("photons"))), radius_(iConfig.getParameter<double>("pcaRadius")) { for(const auto& key : valuesProduced_) { maps_[key] = {}; ...
const std::vector<std::string> HGCalPhotonIDValueMapProducer::valuesProduced_ = { "seedEt", "seedEnergy", "seedEnergyEE", "seedEnergyFH", "seedEnergyBH", "pcaEig1", "pcaEig2", "pcaEig3", "pcaSig1", "pcaSig2", "pcaSig3", "sigmaUU", "sigmaVV", "sigmaEE", "sigmaP...
assignment_statement
[]
C++
google/cloud/dialogflow_cx/internal/flows_logging_decorator.cc
GoogleCloudPlatform/google-cloud-cpp
c4fc35de9e15f95b1dbf585f1c96de5dba609e2b
#include "google/cloud/dialogflow_cx/internal/flows_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" #include <google/cloud/dialogflow/cx/v3/flow.grpc.pb.h> #include <memory> namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CP...
#include "google/cloud/dialogflow_cx/internal/flows_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" #include <google/cloud/dialogflow/cx/v3/flow.grpc.pb.h> #include <memory> namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CP...
text, google::cloud::dialogflow::cx::v3::ExportFlowRequest const& request) { return google::cloud::internal::LogWrapper( [this]( google::cloud::CompletionQueue& cq, std::unique_ptr<grpc::ClientContext> context, google::cloud::dialogflow::cx::v3::ExportFlowRequest const& request...
ntext, google::cloud::dialogflow::cx::v3::DeleteFlowRequest const& request) { return google::cloud::internal::LogWrapper( [this]( grpc::ClientContext& context, google::cloud::dialogflow::cx::v3::DeleteFlowRequest const& request) { return child_->DeleteFlow(context, request); ...
random
[ { "content": "// A generic request. Fields with a \"testonly_\" prefix are used for testing but\n\n// are not used in the real code.\n\nstruct Request {\n\n std::string testonly_page_token;\n\n void set_page_token(std::string token) {\n\n testonly_page_token = std::move(token);\n\n }\n\n};\n\n\n", "fi...
C++
source/XMPFiles/FileHandlers/TIFF_Handler.cpp
maemo-foss/maemo-package-exempi
684c589c987a1b9f01a1d60114363ce8326c2be5
#include "TIFF_Handler.hpp" #include "TIFF_Support.hpp" #include "PSIR_Support.hpp" #include "IPTC_Support.hpp" #include "ReconcileLegacy.hpp" #include "MD5.h" using namespace std; bool TIFF_CheckFormat ( XMP_FileFormat format, XMP_StringPtr filePath, LFA_FileRef f...
#include "TIFF_Handler.hpp" #include "TIFF_Support.hpp" #include "PSIR_Support.hpp" #include "IPTC_Support.hpp" #include "ReconcileLegacy.hpp" #include "MD5.h" using namespace std; bool TIFF_CheckFormat ( XMP_FileFormat format, XMP_StringPtr filePath, LFA_FileRef f...
TIFF_MetaHandler::~TIFF_MetaHandler() { if ( this->psirMgr != 0 ) delete ( this->psirMgr ); if ( this->iptcMgr != 0 ) delete ( this->iptcMgr ); } void TIFF_MetaHandler::CacheFileData() { LFA_FileRef fileRef = this->parent->fileRef; XMP_PacketInfo & packetInfo = this->packetInfo; XMP_AbortProc abor...
TIFF_MetaHandler::TIFF_MetaHandler ( XMPFiles * _parent ) : psirMgr(0), iptcMgr(0) { this->parent = _parent; this->handlerFlags = kTIFF_HandlerFlags; this->stdCharForm = kXMP_Char8Bit; }
function_block-full_function
[ { "content": "\tclass ScanError : public std::logic_error {\n\n\tpublic:\n\n\t\tScanError() throw() : std::logic_error ( \"\" ) {}\n\n\t\texplicit ScanError ( const char * message ) throw() : std::logic_error ( message ) {}\n\n\t\tvirtual ~ScanError() throw() {}\n\n\t};\n\n\n\nprivate:\t// XMPScanner\n\n\t\n", ...
C++
tests/test_cases/one_hot_gpu_test.cpp
intel/clDNN
c4ef3bd7b707fc386655cccf90e6c0420d1efec7
#include <gtest/gtest.h> #include <api/CPP/engine.hpp> #include <api/CPP/input_layout.hpp> #include <api/CPP/memory.hpp> #include <api/CPP/one_hot.hpp> #include <api/CPP/topology.hpp> #include <api/CPP/network.hpp> #include "test_utils/test_utils.h" #include <cstddef> using namespace cldnn; using namespace ::test...
#include <gtest/gtest.h> #include <api/CPP/engine.hpp> #include <api/CPP/input_layout.hpp> #include <api/CPP/memory.hpp> #include <api/CPP/one_hot.hpp> #include <api/CPP/topology.hpp> #include <api/CPP/network.hpp> #include "test_utils/test_utils.h" #include <cstddef> using namespace cldnn; using namespace ::test...
TEST(one_hot_error, basic_error_wrong_axis) { const auto& engine = get_test_engine(); auto input = memory::allocate(engine, { data_types::i32, format::bfyx,{ 1, 1, 1, 1 } }); topology topology; topology.add(input_layout("input", input.get_layout())); topology.add(one_hot("output", "input", tenso...
layout())); topology.add(one_hot("output", "input", tensor(10, 1, 1, 50), 2)); std::string msg_to_find = "Incorrect parameters configuration: input batch size should be equal to 1."; EXPECT_ANY_THROW(check_exception_massage(engine, topology, msg_to_find)); }
function_block-function_prefixed
[ { "content": "#include \"api/CPP/scale_grad_input.hpp\"\n\n#include <api/CPP/topology.hpp>\n\n#include <api/CPP/network.hpp>\n\n#include <api/CPP/engine.hpp>\n\n#include \"test_utils/test_utils.h\"\n\n\n\n#include <iostream>\n\n\n\nusing namespace cldnn;\n\nusing namespace tests;\n\n\n\nTEST(scale_grad_input_gp...
C++
qt-creator-opensource-src-4.6.1/src/libs/qmljs/qmljsutils.cpp
kevinlq/Qt-Creator-Opensource-Study
b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f
#include "qmljsutils.h" #include "parser/qmljsast_p.h" #include <QColor> #include <QDir> #include <QRegularExpression> using namespace QmlJS; using namespace QmlJS::AST; namespace { class SharedData { public: SharedData() { validBuiltinPropertyNames.insert(QLatin1String("action")); validBu...
#include "qmljsutils.h" #include "parser/qmljsast_p.h" #include <QColor> #include <QDir> #include <QRegularExpression> using namespace QmlJS; using namespace QmlJS::AST; namespace { class SharedData { public: SharedData() { validBuiltinPropertyNames.insert(QLatin1String("action")); validBu...
for (UiObjectMemberList *iter = initializer->members; iter; iter = iter->next) { if (UiScriptBinding *script = cast<UiScriptBinding*>(iter->member)) { if (!script->qualifiedId) continue; if (script->qualifiedId->next) continue; if (script...
if (!initializer) { initializer = cast<UiObjectInitializer *>(object); if (!initializer) return QString(); }
if_condition
[]
C++
MouseToVJoy/cInputDevices.cpp
R1PeR/MouseToVJoy
c5487f6bf6e3db8ac41478a612a6c2642c69b7af
#include "input.h" void CInputDevices::getData(LPARAM lParam) { UINT bufferSize; GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &bufferSize, sizeof(RAWINPUTHEADER)); if (bufferSize <= 40) GetRawInputData((HRAWINPUT)lParam, RID_INPUT, (LPVOID)_buffer, &bufferSize, sizeof(RAWINPUTHEADER)); RAWINPUT *...
#include "input.h" void CInputDevices::getData(LPARAM lParam) { UINT bufferSize; GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &bufferSize, sizeof(RAWINPUTHEADER)); if (bufferSize <= 40) GetRawInputData((HRAWINPUT)lParam, RID_INPUT, (LPVOID)_buffer, &bufferSize, sizeof(RAWINPUTHEADER)); RAWINPUT *...
yState == false) { if (isLastKeyState == true) { return true; } else { return true; } } else if (isThisKeyState == true) { if (isLastKeyState == false) { return false; } else return false; } }
&& bStateUp == false) { _isLeftMouseButtonPressed = true; _isKeyboardButtonPressed[0x01] = true; } if (bStateUp == true) { _isLeftMouseButtonPressed = false; _isKeyboardButtonPressed[0x01] = false; } bool bStateDownTwo = raw->data.mouse.usButtonFlags & RI_MOUSE_RIGHT_BUTTON_DOWN; bool bStat...
random
[ { "content": "#include <windows.h>\n\n#include <string>\n\n#include \"forcefeedback.h\"\n\n\n\nusing namespace std;\n\n// Convert Packet type to String\n\nBOOL ForceFeedBack::packetType2Str(FFBPType type, LPTSTR outStr)\n\n{\n\n\tBOOL stat = TRUE;\n\n\tLPTSTR Str = \"\";\n\n\n\n\tswitch (type)\n\n\t{\n\n\tcase ...
C++
include/bunsan/config/traits.hpp
sarum9in/bunsan_common
1d113259e2e53de025ba28bd9df485d75f437921
#pragma once #include <boost/unordered_map.hpp> #include <boost/unordered_set.hpp> #include <deque> #include <list> #include <map> #include <set> #include <string> #include <type_traits> #include <unordered_map> #include <unordered_set> #include <vector> namespace bunsan { namespace config { namespace traits { temp...
#pragma once #include <boost/unordered_map.hpp> #include <boost/unordered_set.hpp> #include <deque> #include <list> #include <map> #include <set> #include <string> #include <type_traits> #include <unordered_map> #include <unordered_set> #include <vector> namespace bunsan { namespace config { namespace traits { temp...
: std::integral_constant<bool, true> {}; template <typename Key, typename Tp, typename Compare, typename Alloc> struct is_map<std::multimap<Key, Tp, Compare, Alloc>> : std::integral_constant<bool, true> {}; template <typename Value, typename Hash, typename Pred, typename Alloc> struct is_set<std::unordered_set<V...
e Compare, typename Alloc> struct is_set<std::multiset<Key, Compare, Alloc>> : std::integral_constant<bool, true> {}; template <typename Key, typename Tp, typename Compare, typename Alloc> struct is_map<std::map<Key, Tp, Compare, Alloc>>
random
[ { "content": "struct load_variant;\n\n\n\n/// Implementation.\n\ntemplate <typename Arg, typename... Args>\n", "file_path": "include/bunsan/config/input_archive.hpp", "rank": 22, "score": 164930.03404454674 }, { "content": "struct load_variant<> {\n\n template <typename Archive, typename Va...
C++
components/agro_mesh/net/resources/app.cpp
rnascunha/agro_mesh
f4d1c49cdbd3d61086c1dcd79143d30ec54d4871
#include "esp_log.h" #include <stdio.h> #include <string.h> #include "../coap_engine.hpp" #include "../../modules/app/app.hpp" extern const char* RESOURCE_TAG; static char* make_name(char* name, const void* data, unsigned name_size) noexcept { std::memcpy(name, data, name_size); name[name_size] = '\0'; return na...
#include "esp_log.h" #include <stdio.h> #include <string.h> #include "../coap_engine.hpp" #include "../../modules/app/app.hpp" extern const char* RESOURCE_TAG; static char* make_name(char* name, const void* data, unsigned name_size) noexcept { std::memcpy(name, data, name_size); name[name_size] = '\0'; return na...
static void put_app_handler(engine::message const& request, engine::response& response, void*) noexcept { ESP_LOGD(RESOURCE_TAG, "Called put app handler"); if(!request.payload || !request.payload_len || request.payload_len <= sizeof(std::int32_t)) { response .code(CoAP::Message::code::precondition_fa...
n - 32), static_cast<const std::uint8_t*>(request.payload))) { response .code(CoAP::Message::code::internal_server_error) .payload("app other loading") .serialize(); return; } response .code(CoAP::Message::code::changed) .serialize(); }
function_block-function_prefixed
[ { "content": "struct app{\n\n\tchar\t\tname[app_max_name_size + 1];\n\n\tunsigned \tsize = 0;\n\n};\n\n\n", "file_path": "components/agro_mesh/modules/app/app.hpp", "rank": 0, "score": 77485.24550976587 }, { "content": "const char* get_scheduler_status_string(Scheduler::status_t status);\n",...
C++
ccl/src/dev/Morpheus_Ccl_DenseVector.hpp
morpheus-org/morpheus-interoperability
66161199fa1926914e16c1feb02eb910ffef5ed4
#ifndef MORPHEUS_CCL_DEV_DENSEVECTOR_HPP #define MORPHEUS_CCL_DEV_DENSEVECTOR_HPP #include <Morpheus_Ccl_Types.hpp> #include <dev/fwd/Morpheus_Ccl_Fwd_DenseVector.hpp> #ifdef __cplusplus extern "C" { #endif void ccl_dvec_dense_v_create_default(ccl_dvec_dense_v** v); void ccl_dvec_dense_v_create(ccl_dvec_dense_v*...
#ifndef MORPHEUS_CCL_DEV_DENSEVECTOR_HPP #define MORPHEUS_CCL_DEV_DENSEVECTOR_HPP #include <Morpheus_Ccl_Types.hpp> #include <dev/fwd/Morpheus_Ccl_Fwd_DenseVector.hpp> #ifdef __cplusplus extern "C" { #endif void ccl_dvec_dense_v_create_default(ccl_dvec_dense_v** v); void ccl_dvec_dense_v_create(ccl_dvec_dense_v*...
_dvec_dense_v_hostmirror_values_at( ccl_dvec_dense_v_hostmirror* v, ccl_index_t i); void ccl_dvec_dense_v_hostmirror_set_values_at(ccl_dvec_dense_v_hostmirror* v, ccl_index_t i, ccl_value_t val); void ccl_dvec_dense_i_hostmirror_create_default( ccl_dvec_dense_i_h...
ccl_dvec_dense_v** dst); void ccl_dvec_dense_v_allocate_from_dvec_dense_v(ccl_dvec_dense_v* src, ccl_dvec_dense_v* dst); void ccl_dvec_dense_v_assign(ccl_dvec_dense_v* v, ccl_index_t n, ccl_value_t val); void ccl_dvec_de...
random
[ { "content": "#ifdef __cplusplus\n\nextern \"C\" {\n\n#endif\n\n\n\nvoid ccl_initialize(int* argc, char** argv[]);\n\nvoid ccl_initialize_without_args(void);\n\nvoid ccl_finalize(void);\n\nvoid ccl_print_configuration(const char* prepend_name_in,\n\n const char* file_name_in);\n\n\n\...
C++
CC2500.cpp
RoXXoR/CC2500
7a07566dd2342a1b21bcdc9beb30b0ff3e6cdba6
#include "CC2500.h" CC2500::CC2500() { CC2500(DEVADDR, CHANNEL); } CC2500::CC2500(uint8_t deviceAddress) { CC2500(deviceAddress, CHANNEL); } CC2500::CC2500(uint8_t deviceAddress, uint8_t channel) { _deviceAddress = deviceAddress; _channel = channel; _gdo0 = GDO0; } void CC2500::setDeviceAddress(uint8_t device...
#include "CC2500.h" CC2500::CC2500() { CC2500(DEVADDR, CHANNEL); } CC2500::CC2500(uint8_t deviceAddress) { CC2500(deviceAddress, CHANNEL); } CC2500::CC2500(uint8_t deviceAddress, uint8_t channel) { _deviceAddress = deviceAddress; _channel = channel; _gdo0 = GDO0; } void CC2500::setDeviceAddress(uint8_t device...
8_t *rxBuffer, uint8_t size) { uint8_t pktLength; uint8_t rxInfo[2]; if (readStatusRegister(CC2500_RXBYTES)&CC2500_NUM_RXBYTES) { pktLength = readRegister(CC2500_RX_FIFO); if (pktLength <= size) { readRegisterBurst(CC2500_RX_FIFO, rxBuffer, pktLength); } else { readRegisterBurst(CC2500_RX_FIFO, rxBuffer...
IGH); return recv; } void CC2500::readRegisterBurst(uint8_t saddr, uint8_t *data, uint8_t size) { digitalWrite(SS,LOW); SPI.transfer(saddr|CC2500_READ_BURST); while (size > 0) { *data++ = SPI.transfer(0x00); size--; } digitalWrite(SS,HIGH); } void CC2500::execStrobeCommand(uint8_t command) { digitalWrite(S...
random
[ { "content": "#define CC2500_ADDR\t\t0x09\t// Device Address\n", "file_path": "cc2500_defines.h", "rank": 0, "score": 19030.082185654213 }, { "content": "\tvoid writeRegisterBurst(uint8_t saddr, uint8_t *data, uint8_t size);\n\n\tuint8_t readRegister(uint8_t addr);\n\n\tvoid readRegisterBurs...
C++
rcnn/backbone.hpp
GaoLon/tensorrtx
67bd89f27c4bcaf99c3ff50317c035b60bdce58e
#pragma once #include <vector> #include <map> #include <string> #include "common.hpp" enum RESNETTYPE { R18 = 0, R34, R50, R101, R152 }; const std::map<RESNETTYPE, std::vector<int>> num_blocks_per_stage = { {R18, {2, 2, 2, 2}}, {R34, {3, 4, 6, 3}}, {R50, {3, 4, 6, 3}}, {R101, {3, 4...
#pragma once #include <vector> #include <map> #include <string> #include "common.hpp" enum RESNETTYPE { R18 = 0, R34, R50, R101, R152 }; const std::map<RESNETTYPE, std::vector<int>> num_blocks_per_stage = { {R18, {2, 2, 2, 2}}, {R34, {3, 4, 6, 3}}, {R50, {3, 4, 6, 3}}, {R101, {3, 4...
int out_channels = res2_out_channels; ITensor* out = nullptr; auto stem = BasicStem(network, weightMap, "backbone.stem", input, stem_out_channels); out = stem->getOutput(0); for (int i = 0; i < 3; i++) { int dilation = (i == 3) ? res5_dilation : 1; int first_stride = (i ...
if (resnet_type == R18 || resnet_type == R34) { assert(res2_out_channels == 64); assert(res5_dilation == 1); }
if_condition
[]
C++
media/jni/audioeffect/android_media_SourceDefaultEffect.cpp
rio-31/android_frameworks_base-1
091a068a3288d27d77636708679dde58b7b7fd25
#define LOG_TAG "SourceDefaultEffect-JNI" #include <utils/Errors.h> #include <utils/Log.h> #include <jni.h> #include <nativehelper/JNIHelp.h> #include <android_runtime/AndroidRuntime.h> #include "media/AudioEffect.h" #include <nativehelper/ScopedUtfChars.h> #include "android_media_AudioEffect.h" using namespace a...
#define LOG_TAG "SourceDefaultEffect-JNI" #include <utils/Errors.h> #include <utils/Log.h> #include <jni.h> #include <nativehelper/JNIHelp.h> #include <android_runtime/AndroidRuntime.h> #include "media/AudioEffect.h" #include <nativehelper/ScopedUtfChars.h> #include "android_media_AudioEffect.h" using namespace a...
; if (lStatus != NO_ERROR) { ALOGE("setup: Error adding SourceDefaultEffect"); goto setup_exit; } nId[0] = static_cast<jint>(id); setup_exit: if (nId != NULL) { env->ReleasePrimitiveArrayCritical(jId, nId, 0); nId = NULL; } if (uuidStr != NULL) { ...
AudioEffect::addSourceDefaultEffect(typeStr, String16(opPackageNameStr.c_str()), uuidStr, priority, static_cast<audio_so...
call_expression
[]
C++
zircon/system/uapp/iotime/iotime.cc
opensource-assist/fuschia
66646c55b3d0b36aae90a4b6706b87f1a6261935
#include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <block-client/client.h> #include <fuchsia/hardware/block/c/fidl.h> #include <lib/fzl/fdio.h> #include <lib/zx/channel.h> #include <lib/zx/fifo.h> #include <lib/zx/vmo.h> #include <ramdevice-c...
#include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <block-client/client.h> #include <fuchsia/hardware/block/c/fidl.h> #include <lib/fzl/fdio.h> #include <lib/zx/channel.h> #include <lib/zx/fifo.h> #include <lib/zx/vmo.h> #include <ramdevice-c...
r, "error: out of memory\n"); return ZX_TIME_INFINITE; } zx_time_t t0 = zx_clock_get_monotonic(); size_t n = total; const char* fn_name = is_read ? "read" : "write"; while (n > 0) { size_t xfer = (n > bufsz) ? bufsz : n; ssize_t r = is_read ? read(fd, buffer, xfer) : write(fd, buffer, xfer); ...
err, "%g %s/s\n", rate, unit); } static zx_duration_t iotime_posix(int is_read, int fd, size_t total, size_t bufsz) { void* buffer = malloc(bufsz); if (buffer == NULL) { fprintf(stder
random
[]
C++
old/v2/src/sim/Maze.cpp
qiuwenhui/micromouse_-simulator
6625b2814b8281a0db5d4e9d57ae8881ff31fed0
#include "Maze.h" #include <queue> #include <set> #include <vector> #include "../maze/IMazeAlgorithm.h" #include "../maze/MazeAlgorithms.h" #include "Assert.h" #include "Directory.h" #include "Logging.h" #include "MazeChecker.h" #include "MazeFileType.h" #include "MazeFileUtilities.h" #include "MazeInterface.h" #incl...
#include "Maze.h" #include <queue> #include <set> #include <vector> #include "../maze/IMazeAlgorithm.h" #include "../maze/MazeAlgorithms.h" #include "Assert.h" #include "Directory.h" #include "Logging.h" #include "MazeChecker.h" #include "MazeFileType.h" #include "MazeFileUtilities.h" #include "MazeInterface.h" #incl...
} } return rotated; } std::vector<std::vector<Tile>> Maze::setTileDistances(std::vector<std::vector<Tile>> maze) { int width = maze.size(); int height = maze.at(0).size(); auto getNeighbor = [&maze, &width, &height](int x, int y, Direction direction) { switch (direction) {...
mazeWidth, int mazeHeight) { std::vector<std::vector<BasicTile>> blankMaze; for (int x = 0; x < mazeWidth; x += 1) { std::vector<BasicTile> column; for (int y = 0; y < mazeHeight; y += 1) { BasicTile tile; for (Direction direction : DIRECTIONS) { tile.wall...
random
[ { "content": "class Test : public IMouseAlgorithm {\n\n\n\npublic:\n\n std::string mouseFile() const;\n\n std::string interfaceType() const;\n\n void solve(\n\n int mazeWidth, int mazeHeight, bool isOfficialMaze,\n\n char initialDirection, sim::MouseInterface* mouse);\n\n\n\n};\n\n\n\n} /...
C++
libc/winsup/cygwin/fhandler_procsys.cc
The0x539/wasp
5f83aab7bf0c0915b1d3491034d35b091c7aebdf
#include "winsup.h" #include <stdlib.h> #include "cygerrno.h" #include "security.h" #include "path.h" #include "fhandler.h" #include "dtable.h" #include "cygheap.h" #include <winioctl.h> #include "ntdll.h" #include "tls_pbuf.h" #include <dirent.h> const char procsys[] = "/proc/sys"; const size_t procsys_len = sizeo...
#include "winsup.h" #include <stdlib.h> #include "cygerrno.h" #include "security.h" #include "path.h" #include "fhandler.h" #include "dtable.h" #include "cygheap.h" #include <winioctl.h> #include "ntdll.h" #include "tls_pbuf.h" #include <dirent.h> const char procsys[] = "/proc/sys"; const size_t procsys_len = sizeo...
; if (!NT_SUCCESS (status)) goto unreadable; RtlInitEmptyUnicodeString (&target, tp.w_get (), (NT_MAX_PATH - 1) * sizeof (WCHAR)); status = NtQuerySymbolicLinkObject (h, &target, NULL); NtClose (h); if (!NT_SUCCESS (status)) goto unreadable; len = sys_wcstombs (NULL, 0, target.Buffer, target...
US_SHARING_VIOLATION) return virt_fsfile; if (status == STATUS_OBJECT_PATH_NOT_FOUND || status == STATUS_OBJECT_NAME_NOT_FOUND) return virt_fsfile; if (status >= STATUS_PIPE_NOT_AVAILABLE && status <= STATUS_PIPE_BUSY) return virt_pipe; if (status == STATUS_ACCESS_DENIED && !internal) ...
random
[ { "content": "struct __sFILE64 *fopen64 (const char *, const char *);\n", "file_path": "libc/winsup/cygwin/winsup.h", "rank": 0, "score": 303894.749413499 }, { "content": "struct passwd *getpwnam (const char *);\n", "file_path": "libc/winsup/cygwin/winsup.h", "rank": 1, "score": ...
C++
iverilog-parser/IRStmtVisitor.cc
gokhankici/xenon
d749abd865f2017cda323cf63cf38b585de9e7af
#include <sstream> #include "IRExporter.h" #include "IRStmtVisitor.h" #include "IRExprVisitor.h" using namespace std; void IRStmtVisitor::visit(PGAssign *ga) { if (ga->delay_count() != 0) { cerr << "continuous assignment has a delay:" << endl; ga->dump(cerr,0); cerr << endl; } if...
#include <sstream> #include "IRExporter.h" #include "IRStmtVisitor.h" #include "IRExprVisitor.h" using namespace std; void IRStmtVisitor::visit(PGAssign *ga) {
if (ga->pin_count() != 2 || ga->pin(0) == NULL || ga->pin(1) == NULL) { cerr << "NOT SUPPORTED: PrologExporter@PGAssign: sth wrong with pins" << endl; exit(1); } irStmt = doAssignment(IRStmt_AssignmentType::CONTINUOUS, ga->pin(0), ga->pin(1)); } void IRStmtVisitor::visit(PGBuiltin *gb) {...
if (ga->delay_count() != 0) { cerr << "continuous assignment has a delay:" << endl; ga->dump(cerr,0); cerr << endl; }
if_condition
[ { "content": "extern DLLEXPORT void (*vlog_startup_routines[])(void);\n", "file_path": "iverilog-parser/vpi_user.h", "rank": 0, "score": 98623.54510942122 }, { "content": "static void do_include();\n", "file_path": "iverilog-parser/ivlpp/lexor.c", "rank": 1, "score": 54072.917652...
C++
examples/12-fonts/src/Main.cpp
szszszsz/blue
a6a93d9a6c7bda6b4ed4fa3b9b4b01094c4915b8
#include <blue/Context.hpp> #include <blue/Timestep.hpp> #include <blue/ShaderUtils.h> #include <blue/TextureUtils.hpp> #include <blue/camera/OrthographicCamera.hpp> #include <blue/FontUtils.hpp> #include <atomic> #include <string> #include <cstdint> #include <cstdlib> namespace Sample { const std::uint16_t window_w...
#include <blue/Context.hpp> #include <blue/Timestep.hpp> #include <blue/ShaderUtils.h> #include <blue/TextureUtils.hpp> #include <blue/camera/OrthographicCamera.hpp> #include <blue/FontUtils.hpp> #include <atomic> #include <string> #include <cstdint> #include <cstdlib> namespace Sample { const std::uint16_t window_w...
view() }); auto font = FontUtils::read_ttf_relative("resources/Lato-Black.ttf"); auto create_texture_entity = FontUtils::create_text(font, "The quick brown fox jumps over the lazy dog.", Sample::window_width, Sample::window_height, 22); auto texture = blue::Context::gpu_system().submit(create_texture_entity).get(...
array = blue::Context::gpu_system().submit(CreateMeshEntity{ vertices, indices, attributes, static_cast<std::uint32_t>(indices.size()) }).get(); auto environment = blue::Context::gpu_system().submit(CreateEnvironmentEntity{}).get(); OrthographicCamera camera(OrthographicCamera::Mode::SCREEN_SPACE, blue::Conte...
random
[ { "content": "struct ShaderAttribute\n\n{\n", "file_path": "include/blue/gpu/GpuEntities.hpp", "rank": 0, "score": 105984.379388146 }, { "content": "\tenum class Model : int\n\n\t{\n\n\t\tPINE_TREE = 0,\n\n\t\tHURDLE = 1,\n\n\t\tWHEAT = 2,\n\n\t\tBOULDER = 3,\n\n\t\tSMALL_BOULDER = 4,\n\n\t\...
C++
Code/Engine/Animation/Graph/Nodes/Animation_RuntimeGraphNode_Parameters.cpp
JuanluMorales/KRG
f3a11de469586a4ef0db835af4bc4589e6b70779
#include "Animation_RuntimeGraphNode_Parameters.h" namespace KRG::Animation::GraphNodes { void ControlParameterBoolNode::Settings::InstantiateNode( TVector<GraphNode*> const& nodePtrs, GraphDataSet const* pDataSet, InitOptions options ) const { auto pNode = CreateNode<ControlParameterBoolNode>( nodePtr...
#include "Animation_RuntimeGraphNode_Parameters.h" namespace KRG::Animation::GraphNodes { void ControlParameterBoolNode::Settings::InstantiateNode( TVector<GraphNode*> const& nodePtrs, GraphDataSet const* pDataSet, InitOptions options ) const { auto pNode = CreateNode<ControlParameterBoolNode>( nodePtr...
void VirtualParameterTargetNode::ShutdownInternal( GraphContext& context ) { KRG_ASSERT( m_pChildNode != nullptr ); m_pChildNode->Shutdown( context ); TargetValueNode::ShutdownInternal( context ); } void VirtualParameterTargetNode::GetValueInternal( GraphContext& context, void...
void VirtualParameterTargetNode::InitializeInternal( GraphContext& context ) { KRG_ASSERT( m_pChildNode != nullptr ); TargetValueNode::InitializeInternal( context ); m_pChildNode->Initialize( context ); }
function_block-full_function
[]
C++
chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc
hujiajie/pa-chromium
1816ff80336a6efd1616f9e936880af460b1e105
#include "base/command_line.h" #include "chrome/browser/devtools/devtools_window.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/singleton_tabs.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_switches.h" #inclu...
#include "base/command_line.h" #include "chrome/browser/devtools/devtools_window.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/singleton_tabs.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_switches.h" #inclu...
RenderViewHost* FindFirstDevToolsHost() { content::RenderProcessHost::iterator hosts = content::RenderProcessHost::AllHostsIterator(); for (; !hosts.IsAtEnd(); hosts.Advance()) { content::RenderProcessHost* render_process_host = hosts.GetCurrentValue(); DCHECK(render_process_host); if (!render_p...
int RenderProcessHostCount() { content::RenderProcessHost::iterator hosts = content::RenderProcessHost::AllHostsIterator(); int count = 0; while (!hosts.IsAtEnd()) { if (hosts.GetCurrentValue()->HasConnection()) count++; hosts.Advance(); } return count; }
function_block-full_function
[]
C++
src/material/material_mixture.cpp
Luvideria/lightmetrica-v3
3e83db59998e79648047bac29c37d8eb18d7600d
#include <pch.h> #include <lm/core.h> #include <lm/material.h> #include <lm/surface.h> LM_NAMESPACE_BEGIN(LM_NAMESPACE) class Material_ConstantWeightMixture_RR final : public Material { private: struct Entry { Material* material; Float weight; template <typename Archive> void se...
#include <pch.h> #include <lm/core.h> #include <lm/material.h> #include <lm/surface.h> LM_NAMESPACE_BEGIN(LM_NAMESPACE) class Material_ConstantWeightMixture_RR final : public Material { private: struct Entry { Material* material; Float weight; template <typename Archive> void se...
group.dist.add(entry.weight); } group.dist.norm(); dist_.add(weight_sum); } dist_.norm(); } virtual ComponentSample sample_component(const ComponentSampleU& u, const PointGeometry&, Vec3) const override { const int comp = dist_.sample(u.uc[0]); ...
for (auto& entry : prop) { auto* mat = json::comp_ref<Material>(entry, "material"); const auto weight = json::value<Float>(entry, "weight"); if (mat->is_specular_component({})) { material_groups_.emplace_back(); material_gro...
random
[ { "content": "class Material_Glossy final : public Material {\n\nprivate:\n\n Vec3 Ks_; // Specular reflectance\n\n Float ax_, ay_; // Roughness (anisotropic)\n\n\n\npublic:\n\n LM_SERIALIZE_IMPL(ar) {\n\n ar(Ks_, ax_, ay_);\n\n }\n\n\n\npublic:\n\n virtual void construct(const Jso...
C++
example/add2/addserver.cc
walterzhaoJR/braft_walter
bba0afae3b28e9446e4ecc44e0b2b8baac1c4780
#include <map> #include <string> #include <fstream> #include <gflags/gflags.h> #include <brpc/controller.h> #include <brpc/server.h> #include <braft/raft.h> #include <braft/util.h> #include <braft/storage.h> #include <butil/sys_byteorder.h> #include "add.pb.h" DEFINE_int32(port, 8100, "Li...
#include <map> #include <string> #include <fstream> #include <gflags/gflags.h> #include <brpc/controller.h> #include <brpc/server.h> #include <braft/raft.h> #include <braft/util.h> #include <braft/storage.h> #include <butil/sys_byteorder.h> #include "add.pb.h" DEFINE_int32(port, 8100, "Li...
int AddStateMachine::start(int id){ id_ = id; butil::EndPoint addr(butil::my_ip(), FLAGS_port); braft::Node* node = new braft::Node(FLAGS_group, braft::PeerId(addr,id)); braft::NodeOptions node_options; stringstream data_path_stream; data_path_stream << FLAGS_data_path << id; string data_path = ...
h(); snapshot_path.append("/data"); std::ifstream is(snapshot_path.c_str()); string key ; int64_t value = 0; while (is >> key >> value) { LOG(DEBUG) << "key:" << key << ",value:" << value; number_map_[key] = value; } return 0; }
function_block-function_prefixed
[]
C++
Wargame/Auth/Session.hpp
N00byEdge/best-wargame
35af9e00bad31c31eed4b902266e24dbf33a42ef
#pragma once #include <array> #include <random> #include <queue> #include "Wargame/Web/Network.hpp" #include "Wargame/Util.hpp" namespace Wargame { struct User; } namespace Auth { auto sessionTimeoutDuration = std::chrono::hours{24*7}; using SessionKey = std::array<char, 40>; constexpr char sessionChars[] ...
#pragma once #include <array> #include <random> #include <queue> #include "Wargame/Web/Network.hpp" #include "Wargame/Util.hpp" namespace Wargame { struct User; } namespace Auth { auto sessionTimeoutDuration = std::chrono::hours{24*7}; using SessionKey = std::array<char, 40>; constexpr char sessionChars[] ...
return session; } void updateSession(ActiveSession const *ptr, UserPtr user) { activeSessions.update<ActiveSession::UserIndex>(ptr, user); ptr->lastActiveAt = std::chrono::system_clock::now(); } void updateSession(ActiveSession const *ptr) { updateSession(ptr, ptr->user); } ActiveSession...
if(session) { auto timeSinceOnline = std::chrono::system_clock::now() - session->lastActiveAt; if(timeSinceOnline > sessionTimeoutDuration) activeSessions.erase(std::exchange(session, nullptr)); }
if_condition
[ { "content": "#pragma once\n\n\n\n#include \"Wargame/Auth/Passwords.hpp\"\n\n\n\nnamespace Auth {\n\n struct UserAuth {\n\n bool authenticate(std::string password) {\n\n auto attemptedHash = Auth::hashPassword(password, salt, hashIterations);\n\n return attemptedHash == passwordHash;\n\n }\n\n\...
C++
requests/requestexecutor.cpp
aghoward/dbpp
b55f1f3d70ea3f0a8d6058ab0ba3b4d5a568b802
#include "requests/requestexecutor.h" #include <algorithm> #include <cstdio> #include <memory> #include <optional> #include <string> #include <vector> #include <cpr/cpr.h> #include "parameters/arguments.h" #include "multi-threading/threadpool.h" #include "multi-threading/workqueue.h" #include "requests/executioncont...
#include "requests/requestexecutor.h" #include <algorithm> #include <cstdio> #include <memory> #include <optional> #include <string> #include <vector> #include <cpr/cpr.h> #include "parameters/arguments.h" #include "multi-threading/threadpool.h" #include "multi-threading/workqueue.h" #include "requests/executioncont...
std::shared_ptr<WorkQueue<std::string>> RequestExecutor::create_work_queue(std::size_t queue_size) const { auto word_list = get_word_list(_args.wordlist_file); auto work_pool = std::make_shared<WorkQueue<std::string>>(queue_size); work_pool->add_items(word_list.begin(), word_list.end()); return work_p...
std::vector<std::string> RequestExecutor::execute(const std::string& item) { auto results = std::vector<std::string>(); for (const auto& request_template : _context->request_templates) { auto result = execute(item, request_template); if (result) results.push_back(result.value());...
function_block-full_function
[ { "content": "#include \"support/template_formatting.h\"\n\n\n\n#include <string>\n\n#include <map>\n\n#include <utility>\n\n\n\nnamespace impl\n\n{\n\n std::string format_single(const std::string& _template, const std::pair<std::string, std::string>& replacement)\n\n {\n\n auto result = _template;...
C++
SurgSim/Graphics/RenderTests/OsgPointCloudRepresentationRenderTests.cpp
dbungert/opensurgsim
bd30629f2fd83f823632293959b7654275552fa9
#include <gtest/gtest.h> #include <memory> #include <vector> #include "SurgSim/DataStructures/Vertices.h" #include "SurgSim/Framework/Runtime.h" #include "SurgSim/Framework/Scene.h" #include "SurgSim/Graphics/OsgBoxRepresentation.h" #include "SurgSim/Graphics/OsgManager.h" #include "SurgSim/Graphics/OsgMaterial.h" ...
#include <gtest/gtest.h> #include <memory> #include <vector> #include "SurgSim/DataStructures/Vertices.h" #include "SurgSim/Framework/Runtime.h" #include "SurgSim/Framework/Scene.h" #include "SurgSim/Graphics/OsgBoxRepresentation.h" #include "SurgSim/Graphics/OsgManager.h" #include "SurgSim/Graphics/OsgMaterial.h" ...
TEST_F(OsgPointCloudRepresentationRenderTests, StaticRotate) { std::shared_ptr<PointCloudRepresentation> representation = makeCloud(makeCube()); runtime->start(); EXPECT_TRUE(graphicsManager->isInitialized()); EXPECT_TRUE(viewElement->isInitialized()); boost::this_thread::sleep(boost::posix_time::milliseconds...
viewElement->addComponent(representation); runtime->start(); EXPECT_TRUE(graphicsManager->isInitialized()); EXPECT_TRUE(viewElement->isInitialized()); boost::this_thread::sleep(boost::posix_time::milliseconds(500)); for (size_t i = 0; i < vertices.size(); ++i) { pointCloud->addVertex(PointCloud::VertexType(...
function_block-function_prefix_line
[ { "content": "struct OsgVectorFieldRepresentationRenderTests : public SurgSim::Graphics::RenderTest\n\n{\n\nprotected:\n\n\t// A point is a location (X,Y,Z) in 3D space\n\n\tstd::vector<Vector3d> makeStartingPoints()\n\n\t{\n\n\t\tstd::vector<Vector3d> points(8);\n\n\t\tpoints[0] = Vector3d(1.0, 0.0, 0.0);\n\n\...
C++
Utilities/itkSplitAlternatingTimeSeriesImageFilter.hxx
KevinScholtes/ANTsX
5462269c0c32e5d65560bae4014c5a05cb02588d
#ifndef __itkSplitAlternatingTimeSeriesImageFilter_hxx #define __itkSplitAlternatingTimeSeriesImageFilter_hxx #include "itkSplitAlternatingTimeSeriesImageFilter.h" #include "itkProgressReporter.h" #include "itkImageRegionIterator.h" #include "itkImageRegionConstIterator.h" namespace itk { template< typename TInputIm...
#ifndef __itkSplitAlternatingTimeSeriesImageFilter_hxx #define __itkSplitAlternatingTimeSeriesImageFilter_hxx #include "itkSplitAlternatingTimeSeriesImageFilter.h" #include "itkProgressReporter.h" #include "itkImageRegionIterator.h" #include "itkImageRegionConstIterator.h" namespace itk { template< typename TInputIm...
if ( numComponents != outputPtr1->GetNumberOfComponentsPerPixel() ) { outputPtr1->SetNumberOfComponentsPerPixel( numComponents ); } } template< typename TInputImage, typename TOutputImage > void SplitAlternatingTimeSeriesImageFilter< TInputImage, TOutputImage > ::ThreadedGenerateData(const OutputImageRe...
if ( numComponents != outputPtr0->GetNumberOfComponentsPerPixel() ) { outputPtr0->SetNumberOfComponentsPerPixel( numComponents ); }
if_condition
[ { "content": "class ITK_TEMPLATE_EXPORT SimulatedDisplacementFieldSource:\n\n public ImageSource<TOutputImage>\n\n{\n\npublic:\n\n ITK_DISALLOW_COPY_AND_ASSIGN( SimulatedDisplacementFieldSource );\n\n\n\n /** Standard class type aliases. */\n\n using Self = SimulatedDisplacementFieldSource;\n\n using Super...
C++
searchlib/src/tests/features/subqueries/subqueries_test.cpp
amahussein/vespa
29d266ae1e5c95e25002b97822953fdd02b1451e
#include <vespa/vespalib/testkit/test_kit.h> #include <vespa/searchlib/features/setup.h> #include <vespa/searchlib/fef/test/indexenvironment.h> #include <vespa/searchlib/fef/test/indexenvironmentbuilder.h> #include <vespa/searchlib/fef/test/queryenvironment.h> #include <vespa/searchlib/features/subqueries_feature.h> #...
#include <vespa/vespalib/testkit/test_kit.h> #include <vespa/searchlib/features/setup.h> #include <vespa/searchlib/fef/test/indexenvironment.h> #include <vespa/searchlib/fef/test/indexenvironmentbuilder.h> #include <vespa/searchlib/fef/test/queryenvironment.h> #include <vespa/searchlib/features/subqueries_feature.h> #...
())); EXPECT_FALSE(((Blueprint&)f1).setup(f2.indexEnv, {"unknown"})); } TEST_F("require that not searching a field will give it 0 subqueries", RankFixture(0, 3)) { EXPECT_EQUAL(0, f1.getSubqueries(10)); } TEST_F("require that subqueries can be obtained", RankFixture(1, 0)) { f1.setFooSubqueries(0, ...
oo"})); } TEST_FF("require that setup can be done on attribute field", SubqueriesBlueprint, IndexFixture) { DummyDependencyHandler deps(f1); f1.setName(vespalib::make_string("%s(bar)", f1.getBaseName().c_str())); EXPECT_TRUE(((Blueprint&)f1).setup(f2.indexEnv, {"bar"})); } TEST_FF("require that se...
random
[]
C++
Engine/src/CotQuaternion.cpp
TeamNut/CotEngine
d7f8c39715b8828eb8b4295c8ad844bdc7ab6849
#include "math/CotQuaternion.h" #include "math/CotVec3.h" #include "math/CotVec4.h" namespace Cot { Quaternion::Quaternion() : x(0.0f), y(0.0f), z(0.0f), w(1.0f) { } Quaternion::Quaternion(const float value) : x(value), y(value), z(value), w(value) { } Quaternion::Quaternion(const float xx, const float yy,...
#include "math/CotQuaternion.h" #include "math/CotVec3.h" #include "math/CotVec4.h" namespace Cot { Quaternion::Quaternion() : x(0.0f), y(0.0f), z(0.0f), w(1.0f) { } Quaternion::Quaternion(const float value) : x(value), y(value), z(value), w(value) { } Quaternion::Quaternion(const float xx, const float yy,...
Quaternion& Quaternion::operator-=(const float value) { x -= value; y -= value; z -= value; w -= value; return *this; } Quaternion& Quaternion::operator*=(const float value) { x *= value; y *= value; z *= value; w *= value; return *this; } Quaternion& Quaternion::operator/=(const float va...
Quaternion& Quaternion::operator+=(const float value) { x += value; y += value; z += value; w += value; return *this; }
function_block-full_function
[ { "content": "\tclass Vec4;\n", "file_path": "Engine/include/math/CotQuaternion.h", "rank": 0, "score": 178629.8132119183 }, { "content": "\tclass Vec3;\n", "file_path": "Engine/include/math/CotQuaternion.h", "rank": 1, "score": 178621.05006660835 }, { "content": "\tclass...
C++
trunk/third_party/webrtc/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
goddino/libjingle
9516bee51c73af4c3082e74b88ed1198a0eb2bb1
#include <algorithm> #include <vector> #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h" #include "webrtc/common_types.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" using namespace w...
#include <algorithm> #include <vector> #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h" #include "webrtc/common_types.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" using namespace w...
160; timeStamp += 160) { EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, timeStamp, -1, test, 4)); fake_clock.AdvanceTimeMilliseconds(20); module1->Process(); } }
)); EXPECT_EQ(0, module1->SetStartTimestamp(test_timestamp)); EXPECT_EQ(0, module1->SetSendingStatus(true)); voiceCodec.pltype = 127; voiceCodec.plfreq = 8000; memcpy(voiceCodec.plname, "RED", 4); EXPECT_EQ(0, module1->SetSendREDPayloadType(voiceCodec.pltype)); int8_t red = 0; EXPECT_EQ(0, module1->Se...
random
[]
C++
lib/fiber/element_pair_topology.hpp
nicolas-chaulet/bempp
0f5cc72e0e542437e787db5704978456b0ad9e35
#ifndef fiber_element_pair_topology_hpp #define fiber_element_pair_topology_hpp #include "../common/common.hpp" #include "../common/armadillo_fwd.hpp" #include <cassert> #include <iostream> #include <boost/tuple/tuple_comparison.hpp> namespace Fiber { struct ElementPairTopology { ElementPairTopology() : ...
#ifndef fiber_element_pair_topology_hpp #define fiber_element_pair_topology_hpp #include "../common/common.hpp" #include "../common/armadillo_fwd.hpp" #include <cassert> #include <iostream> #include <boost/tuple/tuple_comparison.hpp> namespace Fiber { struct ElementPairTopology { ElementPairTopology() : ...
+testV) if (testElementCornerIndices(testV) == trialElementCornerIndices(trialV)) { testSharedVertices[hits] = testV; trialSharedVertices[hits] = trialV; ++hits; break; } if (hits == 0) { ...
ther) const { return type == other.type && testVertexCount == other.testVertexCount && trialVertexCount == other.trialVertexCount && testSharedVertex0 == other.testSharedVertex0 && testSharedVertex1 == other.testSharedVertex1 && tri...
random
[ { "content": "enum CallVariant\n\n{\n\n TEST_TRIAL = 0,\n\n TRIAL_TEST = 1\n\n};\n\n\n\ntypedef int LocalDofIndex;\n\nconst LocalDofIndex ALL_DOFS = -1;\n\n\n\n}\n\n\n\n#endif\n", "file_path": "lib/fiber/types.hpp", "rank": 0, "score": 187458.7934374725 }, { "content": "enum Geometrica...
C++
src/automaton/core/testnet/testnet.cc
sept-en/automaton
b7448dfe578cf52df37ec7c86536d1e51017c548
#include "automaton/core/testnet/testnet.h" #include <set> #include "automaton/core/io/io.h" #include "automaton/core/node/node.h" namespace automaton { namespace core { namespace testnet { static const uint32_t STARTING_PORT = 12300; std::unordered_map<std::string, std::shared_ptr<testnet>> testnet::testnets; bo...
#include "automaton/core/testnet/testnet.h" #include <set> #include "automaton/core/io/io.h" #include "automaton/core/node/node.h" namespace automaton { namespace core { namespace testnet { static const uint32_t STARTING_PORT = 12300; std::unordered_map<std::string, std::shared_ptr<testnet>> testnet::testnets; bo...
= ""; uint32_t port = 0; if (network_type == network_protocol_type::localhost) { address = "tcp://127.0.0.1:"; port = STARTING_PORT; } else { address = "sim://100:10000:"; } for (uint32_t i = 1; i <= number_nodes; ++i) { std::string node_id = network_id + "_" + std::to_string(i); bool res ...
[id] = std::move(net); return true; } void testnet::destroy_testnet(const std::string& id) { auto it = testnets.find(id); if (it != testnets.end()) { testnets.erase(it); } } std::shared_ptr<testnet> testnet::get_testnet(const std::string& id) { auto it = testnets.find(id); if (it != testnets.end()) { ...
random
[ { "content": "class testnet {\n\n public:\n\n enum network_protocol_type {\n\n localhost = 1,\n\n simulation = 2\n\n };\n\n\n\n ~testnet();\n\n\n\n static bool create_testnet(const std::string& node_type, const std::string& id, const std::string& smart_protocol_id,\n\n network_protocol_type ntype...
C++
include/SctpSocket.hpp
GaborTimko/lsctp
cdc89010b1afcc2ed9cd811a61256749938a54dd
#ifndef LSSOCKET_HPP #define LSSOCKET_HPP #include <vector> #include <cstring> #include <cerrno> #include <type_traits> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/sctp.h> #include <arpa/inet.h> #include <unistd.h> #include <fcntl.h> #include "Lua/Lua.hpp" namespace Sctp { namespace Socket { ...
#ifndef LSSOCKET_HPP #define LSSOCKET_HPP #include <vector> #include <cstring> #include <cerrno> #include <type_traits> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/sctp.h> #include <arpa/inet.h> #include <unistd.h> #include <fcntl.h> #include "Lua/Lua.hpp" namespace Sctp { namespace Socket { ...
template<> inline auto Base<6>::pushIPAddress(Lua::State* L, AddressArray& addrs, const char* ip, uint16_t port, int idx) noexcept -> int { addrs[idx].sin6_family = AF_INET6; addrs[idx].sin6_port = port; int conversion = ::inet_pton(AF_INET6, ip, &addrs[idx].sin6_addr); return checkIPConversionResult(L, ip,...
inline auto Base<4>::pushIPAddress(Lua::State* L, AddressArray& addrs, const char* ip, uint16_t port, int idx) noexcept -> int { addrs[idx].sin_family = AF_INET; addrs[idx].sin_port = port; int conversion = ::inet_pton(AF_INET, ip, &addrs[idx].sin_addr); return checkIPConversionResult(L, ip, conversion); }
function_block-full_function
[ { "content": "class Server final : public Base<IPVersion> {\n\npublic:\n\n static constexpr int DefaultBackLogSize = 1000;\n\n static const char* MetaTableName;\n\npublic:\n\n Server() : Base<IPVersion>() {}\n\npublic:\n\n auto listen(Lua::State*) noexcept -> int;\n\n auto accept(Lua::State*) noexcept -> i...
C++
SM_RayIntersect.cpp
xzrunner/sm
e31351c4fcd4470efa4dbec5bb6ee02c21ae42f8
#include "SM_RayIntersect.h" namespace sm { bool ray_ray_intersect(const Ray& ray0, const Ray& ray1, vec3* cross) { auto& da = ray0.dir; auto& db = ray1.dir; auto dc = ray1.origin - ray0.origin; auto cross_ab = da.Cross(db); if (fabs(dc.Dot(cross_ab)) > SM_LARGE_EPSILON) { return false; } float d = cross_ab...
#include "SM_RayIntersect.h" namespace sm { bool ray_ray_intersect(const Ray& ray0, const Ray& ray1, vec3* cross) { auto& da = ray0.dir; auto& db = ray1.dir; auto dc = ray1.origin - ray0.origin; auto cross_ab = da.Cross(db); if (fabs(dc.Dot(cross_ab)) > SM_LARGE_EPSILON) { return false; } float d = cross_ab...
bool ray_triangle_intersect_both_faces(const mat4& mat, const vec3& v0, const vec3& v1, const vec3& v2, const Ray& ray, vec3* cross) { auto _v0 = mat * v0; auto _v1 = mat * v1; auto _v2 = mat * v2; auto e1 = _v1 - _v0; auto e2 = _v2 - _v0; auto p = ray.dir.Cross(e2);; auto...
auto q = s.Cross(e1); cross->y = f * ray.dir.Dot(q); if (cross->y < 0.0f) { return false; } if (cross->y + cross->x > 1.0f) { return false; } cross->z = f * e2.Dot(q); return cross->z >= 0.0f; }
function_block-function_prefix_line
[ { "content": "struct sm_vec3* sm_vec3_vector(struct sm_vec3* v, const struct sm_vec3* p1, const struct sm_vec3* p2)\n\n{\n\n\t*(vec3*)v = (*(const vec3*)p1) - (*(const vec3*)p2);\n\n\treturn v;\n\n}\n\n\n\nextern \"C\"\n", "file_path": "sm_c_vector.cpp", "rank": 0, "score": 127451.4694807237 }, ...
C++
Source/VoxelWorld/World/Chunk/ChunkLoader.cpp
AirGuanZ/VoxelWorld
8defdee9e2b8fb20607d33ba0f3a316b95273693
#include <algorithm> #include <cassert> #include <Utility\HelperFunctions.h> #include <World\Land\V0\LandGenerator_V0.h> #include <World\Land\V1\LandGenerator_V1.h> #include <World\Land\V2\LandGenerator_V2.h> #include <World\Land\V3\LandGenerator_V3.h> #include "ChunkLoader.h" #include "ChunkManager.h" #include "Ch...
#include <algorithm> #include <cassert> #include <Utility\HelperFunctions.h> #include <World\Land\V0\LandGenerator_V0.h> #include <World\Land\V1\LandGenerator_V1.h> #include <World\Land\V2\LandGenerator_V2.h> #include <World\Land\V3\LandGenerator_V3.h> #include "ChunkLoader.h" #include "ChunkManager.h" #include "Ch...
{ if(infoMgr.GetBlockInfo(GetType(cks, x, y, z)).lightDec < LIGHT_COMPONENT_MAX) { TryAsSource(x - 1, y, z); TryAsSource(x + 1, y, z); TryAsSource(x, y - 1, z); TryAsSource(x, y + ...
r::TaskThreadEntry(void) { while(running_) { ChunkLoaderTask *task = nullptr; { std::lock_guard<std::mutex> lk(taskQueueMutex_); if(loaderTasks_.Size()) { task = loaderTasks_.Back(); loaderTasks_.PopBack(); } ...
random
[ { "content": "class BasicBufferSetter<true> : public BasicBufferView\n\n{\n\npublic:\n\n bool SetData(const void *data, int byteSize)\n\n {\n\n assert(data && byteSize > 0);\n\n\n\n D3D11_MAPPED_SUBRESOURCE rsc;\n\n HRESULT hr = Window::GetInstance().GetD3DDeviceContext()\n\n ...
C++
src/classical/aig.hpp
eletesta/cirkit
6d0939798ea25cecf92306ce796be154139b94f5
#ifndef AIG_HPP #define AIG_HPP #include <iostream> #include <map> #include <vector> #include <boost/dynamic_bitset.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/property_map/property_map.hpp> #include <core/properties.hpp> #include <core/utils/graph_utils.hpp> #include <classical/traits.hpp> nam...
#ifndef AIG_HPP #define AIG_HPP #include <iostream> #include <map> #include <vector> #include <boost/dynamic_bitset.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/property_map/property_map.hpp> #include <core/properties.hpp> #include <core/utils/graph_utils.hpp> #include <classical/traits.hpp> nam...
onst std::string& name ); void aig_remove_po( aig_graph& aig ); aig_function aig_create_ci( aig_graph& aig, const std::string& name ); void aig_create_co( aig_graph& aig, const aig_function& f ); aig_function aig_create_and( aig_graph& aig, const aig_function& left, const aig_function& right ); aig_function aig_create_...
detail::edge_properties_t, detail::graph_properties_t>; using aig_node = vertex_t<aig_graph>; using aig_edge = edge_t<aig_graph>; void aig_initialize( aig_graph& aig, const std::string& model_name = std::string() ); aig_function aig_get_constant( aig_graph& aig, bool ...
random
[ { "content": "struct store_info<std::vector<aig_node>>\n\n{\n\n static constexpr const char* key = \"gates\";\n\n static constexpr const char* option = \"gate\";\n\n static constexpr const char* mnemonic = \"\";\n\n static constexpr const char* name = \"gate\";\n\n static constexpr c...
C++
src/orbital/software/self.cpp
Klern28/orbital
3e0a669e550e1d9a36eef24c9e77f40782bc5381
#include "self.h" #include <orbital/crypto_ps4.h> #include <zlib.h> #include <stdexcept> constexpr U32 SELF_MAGIC = '\x4F\x15\x3D\x1D'; enum SelfEndian { LITTLE = 1, }; enum ProgramAuthID : U64 { PAID_KERNEL = UINT64_C(0x3C00000000000001), }; enum ProgramType : U64 { PTYPE_FAKE = 0x1, P...
#include "self.h" #include <orbital/crypto_ps4.h> #include <zlib.h> #include <stdexcept> constexpr U32 SELF_MAGIC = '\x4F\x15\x3D\x1D'; enum SelfEndian { LITTLE = 1, }; enum ProgramAuthID : U64 { PAID_KERNEL = UINT64_C(0x3C00000000000001), }; enum ProgramType : U64 { PTYPE_FAKE = 0x1, P...
d_segment(index); const auto& segment = segments[segment_idx]; const auto& meta = metas[segment_idx]; s.seek(segment.offset, StreamSeek::Set); Buffer buffer = s.read_b(segment.mem_size); if (segment.is_encrypted()) { decrypt(buffer, meta); } if (segment.is_compressed()) { co...
to = ps4Crypto(); s.seek(0, StreamSeek::Set); header = s.read_t<SelfHeader>(); assert(header.magic == SELF_MAGIC); assert(header.version == 0); assert(header.mode == 1); assert(header.endian == SelfEndian::LITTLE); assert(header.attr == 0x12); segments.resize(header.segment_c...
random
[ { "content": "struct Key {\n\n enum Type {\n\n NONE,\n\n AES_128_EBC,\n\n AES_128_CBC,\n\n } type;\n\n\n\n Botan::SymmetricKey key;\n\n Botan::InitializationVector iv;\n\n\n\n Key() : type(NONE) {}\n\n Key(Type type, const void* key_buf, size_t key_len, const void* iv_buf,...
C++
include/svg_reader.hpp
phonxvzf/svg2scad
eb458df6cee6a65fbabbe5a5600f50551532adb4
#ifndef SVG_READER_HPP #define SVG_READER_HPP #include <string> #include <memory> #include "svgpp/svgpp.hpp" #include "rapidxml_ns/rapidxml_ns_utils.hpp" #include "svgpp/policy/xml/rapidxml_ns.hpp" #include "math/util.hpp" namespace svg { using namespace math; namespace action { enum type { ACTION_MO...
#ifndef SVG_READER_HPP #define SVG_READER_HPP #include <string> #include <memory> #include "svgpp/svgpp.hpp" #include "rapidxml_ns/rapidxml_ns_utils.hpp" #include "svgpp/policy/xml/rapidxml_ns.hpp" #include "math/util.hpp" namespace svg { using namespace math; namespace action { enum type { ACTION_MO...
} class reader { private: class context { private: std::vector<std::shared_ptr<action::base>> m_actions; public: context() = default; ~context(); const std::vector<std::shared_ptr<action::base>>& actions() const; void path_...
O; if (dynamic_cast<line_to*>(base_ptr)) return ACTION_LINE_TO; if (dynamic_cast<quadratic_bezier_to*>(base_ptr)) return ACTION_QUAD_BEZIER_TO; if (dynamic_cast<cubic_bezier_to*>(base_ptr)) return ACTION_CUBIC_BEZIER_TO; if (dynamic_cast<elliptic_arc_to*>(base_ptr)) return AC...
function_block-function_prefixed
[ { "content": "struct value_parser<tag::type::string, SVGPP_TEMPLATE_ARGS_PASS>\n\n{\n\n template<class AttributeTag, class Context, class AttributeValue, class PropertySource>\n\n static bool parse(AttributeTag tag, Context & context, AttributeValue const & attribute_value, \n\n ...
C++
src/graphics/examples/vkproto/cmd-buf-benchmark/main.cc
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
#include <unistd.h> #include <memory> #include <vector> #include "src/graphics/examples/vkproto/common/command_buffers.h" #include "src/graphics/examples/vkproto/common/command_pool.h" #include "src/graphics/examples/vkproto/common/debug_utils_messenger.h" #include "src/graphics/examples/vkproto/common/device.h" #i...
#include <unistd.h> #include <memory> #include <vector> #include "src/graphics/examples/vkproto/common/command_buffers.h" #include "src/graphics/examples/vkproto/common/command_pool.h" #include "src/graphics/examples/vkproto/common/debug_utils_messenger.h" #include "src/graphics/examples/vkproto/common/device.h" #i...
vkp::PhysicalDevice vkp_physical_device(vkp_instance.shared()); RTN_IF_MSG(1, !vkp_physical_device.Init(), "Phys Device Initialization Failed.\n"); vkp::Device vkp_device(vkp_physical_device.get()); RTN_IF_MSG(1, !vkp_device.Init(), "Logical Device Initialization Failed.\n"); std::shared_ptr<vk::Devi...
if (kEnableValidation) { vkp::DebugUtilsMessenger vkp_debug_messenger(vkp_instance.shared()); RTN_IF_MSG(1, !vkp_debug_messenger.Init(), "Debug Messenger Initialization Failed.\n"); }
if_condition
[]
C++
src/resources/track.hpp
mnewhouse/tselements
bd1c6724018e862156948a680bb1bc70dd28bef6
#pragma once #include "tile_library.hpp" #include "terrain_library.hpp" #include "texture_library.hpp" #include "path_library.hpp" #include "track_layer.hpp" #include "start_point.hpp" #include "control_point.hpp" #include "track_path.hpp" #include "utility/vector2.hpp" #include <boost/range/iterator_range.hpp> #i...
#pragma once #include "tile_library.hpp" #include "terrain_library.hpp" #include "texture_library.hpp" #include "path_library.hpp" #include "track_layer.hpp" #include "start_point.hpp" #include "control_point.hpp" #include "track_path.hpp" #include "utility/vector2.hpp" #include <boost/range/iterator_range.hpp> #i...
ult; Track& operator=(const Track&) = default; Track(Track&&) = default; Track& operator=(Track&&) = default; void set_path(const std::string& path); const std::string& path() const noexcept; void set_author(std::string author); const std::string& author() const noexcept; ...
cstdint> #include <cstddef> #include <map> namespace ts { namespace resources { namespace detail { struct ConstPathRangeTransform { const resources::TrackPath* operator()(const std::unique_ptr<TrackPath>& p) const { return p.get(); } }; struct Path...
random
[ { "content": "/*\n\n * Created by Phil on 5/11/2010.\n\n * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.\n\n *\n\n * Distributed under the Boost Software License, Version 1.0. (See accompanying\n\n * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n\n */\n\n#ifndef TWOBLUECUB...
C++
Samples/cuSolverDn_LinearSolver/cuSolverDn_LinearSolver.cpp
rob-opsi/cuda-samples
32943424ed7023f9168266d9fb7b76e8566fd054
#include <assert.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cuda_runtime.h> #include "cublas_v2.h" #include "cusolverDn.h" #include "helper_cuda.h" #include "helper_cusolver.h" template <typename T_ELEM> int loadMMSparseMatrix(char *filename, char elem_type, bool cs...
#include <assert.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cuda_runtime.h> #include "cublas_v2.h" #include "cusolverDn.h" #include "helper_cuda.h" #include "helper_cusolver.h" template <typename T_ELEM> int loadMMSparseMatrix(char *filename, char elem_type, bool cs...
int main(int argc, char *argv[]) { struct testOpts opts; cusolverDnHandle_t handle = NULL; cublasHandle_t cublasHandle = NULL; cudaStream_t stream = NULL; int rowsA = 0; int colsA = 0; int nnzA = 0; int baseA = 0; int lda = 0; int *h_csrRowPtrA = NULL; int *h_csrColIndA = NULL;...
function_block-full_function
[ { "content": "// structure defining the properties of a single buffer\n\nstruct bufferConfig {\n\n string name;\n\n GLenum format;\n\n int bits;\n\n};\n\n\n", "file_path": "Common/rendercheck_gl.h", "rank": 0, "score": 201948.48625693982 }, { "content": "class ArrayFileWriter<int> {\n\n p...
C++
common/sockets.cpp
kkamagui/TPM2.0-TSS
106e914dd285f1b152c127f1cad564744596cf2f
#include <tcti/tcti_socket.h> #include "debug.h" #include "sockets.h" #ifndef _WIN32 void WSACleanup() {} int WSAGetLastError() { return errno; } #endif void CloseSockets( SOCKET otherSock, SOCKET tpmSock) { closesocket(otherSock); closesocket(tpmSock); } TSS2_RC recvBytes( SOCKET tpmSock, unsigned char *dat...
#include <tcti/tcti_socket.h> #include "debug.h" #include "sockets.h" #ifndef _WIN32 void WSACleanup() {} int WSAGetLastError() { return errno; } #endif void CloseSockets( SOCKET otherSock, SOCKET tpmSock) { closesocket(otherSock); closesocket(tpmSock); } TSS2_RC recvBytes( SOCKET tpmSock, unsigned char *dat...
bind to IP address:port: %s:%d\n", hostName, port + 1 ); } iResult = listen( *otherSock, 4 ); if (iResult == SOCKET_ERROR) { SAFE_CALL( debugfunc, data, NO_PREFIX, "listen failed with error %u\n", WSAGetLastError()); closesocket(*otherSock); ...
if (iResult == SOCKET_ERROR) { SAFE_CALL( debugfunc, data, NO_PREFIX, "bind failed with error %u\n", WSAGetLastError()); closesocket(*otherSock); WSACleanup(); return 1; } else { SAFE_CALL( debugfunc, ...
function_block-random_span
[ { "content": " uint16_t port;\n", "file_path": "include/tcti/tcti_socket.h", "rank": 0, "score": 158306.02717439883 }, { "content": " const char *hostname;\n", "file_path": "include/tcti/tcti_socket.h", "rank": 1, "score": 127279.91855985833 }, { "content": " voi...
C++
src/add-ons/media/media-add-ons/dvb/DVBCard.cpp
Kirishikesan/haiku
835565c55830f2dab01e6e332cc7e2d9c015b51e
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <errno.h> #include <OS.h> #include "DVBCard.h" DVBCard::DVBCard(const char *path) : fInitStatus(B_OK) , fDev(-1) { printf("DVBCard opening %s\n", path); fDev = open(path, O_RDWR); ...
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <errno.h> #include <OS.h> #include "DVBCard.h" DVBCard::DVBCard(const char *path) : fInitStatus(B_OK) , fDev(-1) { printf("DVBCard opening %s\n", path); fDev = open(path, O_RDWR); ...
return B_OK; } int DVBCard::do_ioctl(int fDev, ulong op, void *arg) { int res = 0; int i; for (i = 0; i < 20; i++) { res = ioctl(fDev, op, arg); if (res >= 0) break; } if (i != 0) printf("ioctl %lx repeated %d times\n", op, i); return res; }
pe) { dvb_interface_info_t info; if (do_ioctl(fDev, DVB_GET_INTERFACE_INFO, &info) < 0) { printf("DVB_GET_INTERFACE_INFO failed with error %s\n", strerror(errno)); return errno; } if (info.version < 1) { printf("DVBCard::GetCardInfo wrong API version\n"); return B_ERROR; } *type = info.type; return B...
random
[]
C++
cpdp/src/v20190820/model/CreateInvoiceItem.cpp
li5ch/tencentcloud-sdk-cpp
12ebfd75a399ee2791f6ac1220a79ce8a9faf7c4
#include <tencentcloud/cpdp/v20190820/model/CreateInvoiceItem.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Cpdp::V20190820::Model; using namespace rapidjson; using namespace std; CreateInvoiceItem::CreateInvoiceItem() : m_nameHasBeenSet(false), m_taxCodeHasBeenSet(false), m_...
#include <tencentcloud/cpdp/v20190820/model/CreateInvoiceItem.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Cpdp::V20190820::Model; using namespace rapidjson; using namespace std; CreateInvoiceItem::CreateInvoiceItem() : m_nameHasBeenSet(false), m_taxCodeHasBeenSet(false), m_...
void CreateInvoiceItem::ToJsonObject(Value &value, Document::AllocatorType& allocator) const { if (m_nameHasBeenSet) { Value iKey(kStringType); string key = "Name"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, Value(m_name.c_str(), allocator).Move(), allocator...
CoreInternalOutcome CreateInvoiceItem::Deserialize(const Value &value) { string requestId = ""; if (value.HasMember("Name") && !value["Name"].IsNull()) { if (!value["Name"].IsString()) { return CoreInternalOutcome(Error("response `CreateInvoiceItem.Name` IsString=false incorrect...
function_block-full_function
[]
C++
src/tracking/multi_tracker.cpp
PPokorski/laser_object_tracker
bc967459218b417c7e0e97603464e77f110e25ef
#include "laser_object_tracker/tracking/multi_tracker.hpp" #include <numeric> namespace laser_object_tracker { namespace tracking { MultiTracker::MultiTracker(DistanceFunctor distance_calculator, std::unique_ptr<data_association::BaseDataAssociation> data_association, ...
#include "laser_object_tracker/tracking/multi_tracker.hpp" #include <numeric> namespace laser_object_tracker { namespace tracking { MultiTracker::MultiTracker(DistanceFunctor distance_calculator, std::unique_ptr<data_association::BaseDataAssociation> data_association, ...
void MultiTracker::handleRejectedTracks() { auto trackers_it = trackers_.cbegin(); auto rejectors_it = trackers_rejections_.cbegin(); for (; trackers_it != trackers_.cend(); ) { const auto& tracker = **trackers_it; const auto& rejector = **rejectors_it; if (rejector.invalidate(tracker)) { trac...
void MultiTracker::handleNotUpdatedTracks(const Eigen::VectorXi& assignment_vector) { std::vector<int> trackers_indices(trackers_.size()); std::iota(trackers_indices.begin(), trackers_indices.end(), 0); std::vector<int> updated_trackers(assignment_vector.data(), assignment_vector.data() + assignment_vector.size(...
function_block-full_function
[ { "content": "*\n\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n\n* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\n* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n\n* DISCLAIMED. IN NO EVENT SHALL THE COPYRIG...
C++
src/rendering/ui.cpp
hyp/Arpheg
78d142c15028da7c0c2ef4503bed6bcfd1ced67d
#include <limits> #include <string.h> #include "../core/assert.h" #include "../core/allocatorNew.h" #include "../core/bufferArray.h" #include "../services.h" #include "rendering.h" #include "ui.h" #include "../data/font/font.h" #include "2d.h" #include "text.h" #include "opengl/gl.h" namespace rendering { namespace ui...
#include <limits> #include <string.h> #include "../core/assert.h" #include "../core/allocatorNew.h" #include "../core/bufferArray.h" #include "../services.h" #include "rendering.h" #include "ui.h" #include "../data/font/font.h" #include "2d.h" #include "text.h" #include "opengl/gl.h" namespace rendering { namespace ui...
; core::bufferArray::nth<BatchImpl>(batches_,id).font = font; BatchFontMapping map = {font,id}; core::bufferArray::add<BatchFontMapping>(fontBatches_,map); return id; } Batch::Geometry Service::allocate(uint32 layerId,const data::Font* font,uint32 vertexCount,uint32 indexCount) { uint32 batchId = 0xFFFF; using...
registerBatch(batch, font->renderingType() == text::fontType::Outlined? OutlinedTextPipeline : TextPipeline, font->renderingType() == text::fontType::Outlined? OutlinedTextGeometry : TextGeometry)
call_expression
[ { "content": "struct Batch {\n\n\tenum { kMaxLayer = 0xFF };\n\n\tenum { kMaxDepth = 0xFF };\n\n\n\n\ttypedef batching::Geometry Geometry;\n\n\n\n\tsize_t verticesSize,indicesSize;\n\n\ttopology::Primitive primitive;\n\n\tconst char* name;\n\n\tuint32 layer,depth;//Batches are sorted by depth and layers.\n\n\n\...