lang
stringclasses
10 values
seed
stringlengths
5
2.12k
cpp
VPHELPER(VP_X_PARK_POS, &mks_park_pos.x, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Y_PARK_POS, &mks_park_pos.y, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Z_PARK_POS, &mks_park_pos.z, ScreenHandler.GetParkPos_MKS, Screen...
cpp
#include "Parser.hpp" void Run_crauler(int argc, char* argv[]) { prepare_command_line(argc, argv); printParametrs(); Downloader d(parametrs.downloader_threads); Parser p(parametrs.parser_threads); d.downloading(parametrs.url, parametrs.depth, p); }
cpp
} for (auto&& requirement : command->GetRequirements()) { requirement->SetCurrentCommand(nullptr); } command->Removed(); } void Scheduler::Impl::ProcessCommandAddition(Command* command) {
cpp
//--------------------------------------------------------------------------- #pragma package(smart_init) namespace Reinit { //-- type declarations ------------------------------------------------------- //-- var, const, procedure --------------------------------------------------- extern PACKAGE int __fast...
cpp
if (m_RawOutput) { m_Result << "Current waitsnc setting: " << (thisAgent->waitsnc ? "enabled" : "disabled"); } else { AppendArgTagFast(sml_Names::kParamWaitSNC, sml_Names::kTypeBoolean, thisAgent->waitsnc ? sml_Names::kTrue : sml_Names::kFalse); } ...
cpp
dropdown->AddItem(getItem("140", 140)); dropdown->AddItem(getItem("144", 144)); switch (GetSubsystem<Options>()->GetMaxFps()) { case 200: case 0: dropdown->SetSelection(0); break; case 30: dropdown->SetSelection(1); ...
cpp
int main () { float a, b, c; while (a != 0){ float b = 1.60934; float c = 0; cout << "Berechnungsprogramm Meilen in Kilometer\n"; cout << "Eingabe Meilen :\n"; cin >> a; c = a * b;
cpp
#define ll long long int #define ld long double int main(){ ll t; cin>>t;
cpp
struct Message { virtual ~Message() = default; explicit Message(unsigned short id) : Message(id, 0U) {} explicit Message(unsigned short id, unsigned short family) : id(id), family(family) {} // Computes the unique identifier when requested unsigned int uid() const { static int bits = sizeof(unsigned sh...
cpp
} Element::Content::Content() { m_elements.reset(::new Elements); }
cpp
* @param msg_id The id of the message * @return std::string The message */ std::string get_message(const uint msg_id) { // If the id we search is smaller than the oldest message from the // queue, it means we can find it in the file std::string first_msg = messages.front(); ...
cpp
#include <iostream> using namespace std; int main(){ try{ string var = "hello"; if (var >= "world"){ cout << "your code is daijobou";
cpp
int main(){ int n1, n2; int divisores; cout << "Introduzca dos números: "; cin >> n1 >> n2; divisores = divisoresMenores(n1, n2);
cpp
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
cpp
MethodBinder::bind_method(D_METHOD("get_drive"), &AudioEffectDistortion::get_drive); MethodBinder::bind_method(D_METHOD("set_post_gain", {"post_gain"}), &AudioEffectDistortion::set_post_gain); MethodBinder::bind_method(D_METHOD("get_post_gain"), &AudioEffectDistortion::get_post_gain); ADD_PROPERTY(Pro...
cpp
m_Types[typeIndex].inner = &m_Types[(size_t)typ.ops[0]]; m_Types[typeIndex].addrSpace = Type::PointerAddrSpace(typ.ops[1]); typeIndex++; } else if(IS_KNOWN(typ.id, TypeRecord::OPAQUE)) { // pretend opaque types are empty structs ...
cpp
const int cols = Load<int>(fin); const int nonzeros_num = Load<int>(fin); SparseMatrixElements nonzeros(nonzeros_num); for (int i = 0; i < nonzeros_num; ++i) { const int row = Load<int>(fin); const int col = Load<int>(fin); const real value = Load<real>(fin); nonzeros[i] ...
cpp
// // Copyright (c) 2017, <NAME> // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: //
cpp
if (!foundNode) previous = last; else if (!next) next = last; return false; }); if (!next) next = first;
cpp
{ template<class Archive, typename T> void serialize(Archive& archive, Vector3<T>&vec) { archive(vec.x, vec.y, vec.z);
cpp
if (!catcher.GetNextResult()) FAIL() << catcher.message(); } } // namespace extensions
cpp
uint64_t ntp_client::roundtrip_delay(array<ntp_timestamp_format_t,4> tstamps){ static moving_average<uint64_t,11> ma;//~3min static median_filter<uint64_t,5> mf; Math::OverflowSafe::ovf_save ofs;
cpp
task_->GetLogin(user, password); return true; } bool ChromeosRPCTaskDBusAdaptor::notify(brillo::ErrorPtr* /*error*/, const string& reason, const map<string, string>& dict) { SLOG(this, 2) << __func__ << ": " << reason; task_->Notif...
cpp
{ int err = GIF_OK; m_Gif = DGifOpen(m_Source, gifRead, &err); if( err != GIF_OK ) { return false; }
cpp
0x2bfa6547, 0xc4ca0e5e, 0xf076c584, 0x1f46ae9d, 0x990f5230, 0x763f3929, 0x4283f2f3, 0xadb399ea, 0x1c08b7d6, 0xf338dccf, 0xc7841715, 0x28b47c0c, 0xaefd80a1, 0x41cdebb8, 0x75712062, 0x9a414b7b, 0x7c0eafc9, 0x933ec4d0, 0xa7820f0a, 0x48b26413, 0xcefb98be, 0x21cbf3a7, 0x1577387d, 0xfa475364, 0xdc048...
cpp
bool f[MAXL]; priority_queue<long, vector<long>, greater_equal<long>> solve; long last = 0; long penalty = 0; int main() { int n, k;
cpp
#include "test_macros.h" TEST_SUITE(directory_entry_obs_testsuite) TEST_CASE(signatures) { using namespace fs; { const fs::directory_entry e = {}; std::error_code ec;
cpp
*********************************************************************/ #include <BladePCH.h> #include <parallel/ParaStateDef.h> namespace Blade
cpp
namespace net { P256KeyExchange::P256KeyExchange(EC_KEY* private_key, const uint8* public_key) : private_key_(private_key) { memcpy(public_key_, public_key, sizeof(public_key_)); } P256KeyExchange::~P256KeyExchange() {}
cpp
// Test the elasticsearch recordable object TEST(ElasticsearchLogsExporterTests, RecordableCreation) { // Create an elasticsearch exporter auto exporter = std::unique_ptr<sdklogs::LogExporter>(new logs_exporter::ElasticsearchLogExporter);
cpp
#if !defined(USE_ADPVM) void function_minimizer::pvm_slave_mcmc_routine(void){} #else void function_minimizer::pvm_slave_mcmc_routine(void) { int nvar=initial_params::nvarcalc(); do { int iflag=get_int_from_master(); if (!iflag) break;
cpp
#include "mux.h"
cpp
#include "llvm/IR/Function.h" #include "llvm/IR/InstrTypes.h" #include <llvm/IR/InstVisitor.h> #include "llvm/IR/Instruction.h" #include <llvm/PassRegistry.h> #include "common/LLVMWarningsPop.hpp"
cpp
{"\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1","DOC"}, {"%PDF","PDF"},{"\xFF\xFE\x00\x00","32 Bit UTF encoded Text"}, {"\x52\x61\x72\x21\x1A\x07","RAR"},{"BZh","Bzip"}, {"\x50\x4B\x03\x04\x14\x00\x08\x00\x08\x00","Java ByteCode"},{"\xFF\xD8","Jpeg"}}; QString searchString = QString::fromLocal8Bit( fileString, fileSize );...
cpp
EXPECT_EQ(27, mg->get_degree(75)) ; mg->remove_vertex(35); EXPECT_EQ(0, mg->get_degree(35)) ; EXPECT_EQ(27, mg->get_degree(75)) ;
cpp
#include "__icalls.hpp" #include "Resource.hpp" namespace godot { VisualScriptPreload::___method_bindings VisualScriptPreload::___mb = {};
cpp
///////////////////////// Document::unlock_exclusive //////////////////////// void Document::unlock_exclusive(bool changed) { assert((m_locked -= 1) == 0); assert((m_exclusive -= 1) == 0); m_lock.writerelease();
cpp
{ class RandomCuration : public Curation { public: RandomCuration(size_t max_chain_size, Random &random); float CalculateScore(const std::vector<Kernel *> &chain) const override; Kernel *GetFirstNoteworthyEvent(const std::vector<Kernel *> &chain) const override; Kernel...
cpp
{ // Stock impl that just logs to file // Hook up UI logs for each platform based on platform specific UI display calls char message[8000] = {};
cpp
boolean puzzle_ok(PuzzleLoadStatus status) { return(status != NO_PUZZLE_FILE && status != PUZZLE_FILE_BAD); }; PuzzleLoadStatus next_puzzle(boolean reset_old, boolean save_robots) { if (next_puzzle_name()) { last_puzzle_reset_old = reset_old; release_puzzle_data(FALSE); empty_counter = 0;
cpp
pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne; ne.setInputCloud(cloud); //创建一个空的KdTree对象,并把它传递给法线估计向量 //基于给出的输入数据集,KdTree将被建立 pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ> ()); ne.setSearchMethod(tree);
cpp
* @param count The number of spacecraft contained in pos * * @return true on success, false on failure */ //----------------------------------------------------------------------------- bool AtmosphereModel::Wind(Real *position, Real* wind, Real ep, Integer count) {
cpp
pq.push(indices(i),priorities(i)); } } template<class T,class COMP> void defineChangeablePriorityQueue(const std::string & clsName){
cpp
("output,f", po::value<std::string>(&outputFile)->default_value("image.hdf5"), "Output filename") ("prior,P", po::value<std::string>(),"Prior image filename") ("prior-weight,k",po::value<float>(),"Weight of the prior image") ("device",po::value<int>(&device)->default_value(0),"Number of the device to use (0...
cpp
MatrixXd m(2, 2); m(0, 0) = 3; m(1, 0) = 2.5; m(0, 1) = -1; m(1, 1) = m(1, 0) + m(0, 1); std::cout << "Here is the matrix m:\n" << m << std::endl; VectorXd v(2); v(0) = 4;
cpp
// ::color::operation::floor( result, right ) // ::color::operation::floor( result, left, right )
cpp
// set the backlight to a value between 0 and 255 // the backlight is driven via PWM and is gamma corrected by our // library to give a gorgeous linear brightness range. pico_explorer.set_backlight(100); pico_explorer.set_pen(255, 0, 0); while(true) { pico_explorer.pixel(point(0, 0));
cpp
Vector2 t = (line->from - line->to).normalized().tangent() * line->width * 0.5; Vector2 verts[4] = { line->from - t, line->from + t, line->to + t, line->to - t, }; //glLineWidth(line->width); _draw_gui_primitive(4, verts, NULL, NULL);
cpp
_count += 1; TimeT time = TimeT(_count) / TimeT(_steps); this->update(time); if (_count == _steps) {
cpp
//------------------------------------------------------------------------------ ctkDICOMObjectModel::~ctkDICOMObjectModel() { } //------------------------------------------------------------------------------ void ctkDICOMObjectModel::setFile(const QString &fileName) { Q_D(ctkDICOMObjectModel); OFCondition statu...
cpp
class vvValidator* pValidator, const wxString& sMessage ) { this->mcMessages.AddMessage(true, pValidator->GetLabel(), sMessage); } void vvValidatorMessageBoxReporter::ReportError( class vvValidator* pValidator, const wxString& sMessage
cpp
/*************************************************************************/ // Retrieve two points from scalar opacity transfer function double v1, v2; v1 = myTransferFunction->GetScalarOpacityFunction()->GetValue(3.0); v2 = myTransferFunction->GetScalarOpacityFunction()->GetValue(10.0); MITK_TEST_COND...
cpp
{ // make an initial logger to create the first output file auto logger = spdlog::rotating_logger_mt("logger", basename, max_size, 2, true); for (int i = 0; i < 10; ++i) { logger->info("Test message {}", i); } // drop causes the logger destructor to be ca...
cpp
{ PlainOldClass poc; Base* pb = new CoolClass; poc.set(42);
cpp
} else { std::cout << "dir not exist" << std::endl; } EXPECT_TRUE(true); } /* TEST(file, validityDetectedFinancialFiles) { Broker::clearVector(); bool test2 = true; std::vector<std::string> vect = { "broker:ib account:00100001 files:48 lastdate:20181018",
cpp
} template <typename... Args> operator std::function<void (Args...)>() const { return [](Args...) { }; } // keep clang happy: see CWG issue #253, // http://open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#253
cpp
// Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/common/widevine_cdm_constants.h" #include "build/build_config.h" #include "ppapi/shared_impl/ppapi_permissions.h"
cpp
using namespace Esri::ArcGISRuntime; DisplayMap::DisplayMap(QQuickItem* parent) : QQuickItem(parent) { } DisplayMap::~DisplayMap() = default; void DisplayMap::init()
cpp
EEPROM.commit(); } //screen functions void timeScreen() { // time screen currentCPUtime = millis()/1000; if (currentCPUtime - timeTakenAt >= timeout) { if (WiFi.status() != WL_CONNECTED) { connectToWiFi(); } else if (WiFi.status() == WL_CONNECTED) { setupLocalTime(); firstScan = fals...
cpp
} auto AuthenticationToken::setExpiresOn( const boost::posix_time::ptime &mExpiresOn) -> void { expires_on_ = mExpiresOn; } auto AuthenticationToken::Refresh() const -> void { auto auth_token_future = stlab::async( stlab::default_executor, Authentication::GetAccessToken, refresh_token_);
cpp
break; } } }
cpp
void print() { for (int i=0; i<5; ++i) cout << num[i] << " "; cout << '\n'; }
cpp
if(dfs()) return 1; for( int j=L[i]; j!=i; j=L[j] ) resume(C[j]); used[ROW[i]]=0; } resume(c); return 0; } int exact_cover(int n,int m){
cpp
} return 0; } c.create(w, h, elemsize, elempack, opt.blob_allocator); if (c.empty())
cpp
for(const auto&val : joint_pose){ if(std::isnan(val)){ return true; } } return false; }
cpp
Lagrangian1D::Lagrangian1D(bool rigid_walls): rigid_walls_(rigid_walls) {} double Lagrangian1D::CalcVelocity (int i, vector<double> const& /*vp*/, vector<Primitive> const& hv) const { if(i==0){ if(rigid_walls_) return 0; else
cpp
current=menu;} if(x<500) GL::drawTexture((Util::nTRectangleSet(0,600,800,0,0,0)),Util::nTColorSet(1,1,1,1),GL::getTextureByName("legalNote"),1); if(x>=500&&x<1000){ x-=500; GL::drawTexture((Util::nTRectangleSet(0,600,800,0,0,0)),Util::nTColorSet(1,1,1,1-x/500),GL::getTextureByName("legalNote"),1); ...
cpp
const char *backendStr_, const char *dtypeStr_) : aDims{m, n}, cDims{m, n}, numLayers_(numLayers_), asyncLaunchSize_(asyncLaunchSize_), numCores_(numCores_), backendStr_(backendStr_), dtypeStr_(dtypeStr_) {} void setup() override { // Setup host manager std::vector<...
cpp
{ for(size_t ii = 0; ii < vec.size(); ii = ii + 1) { vec[ii] = ii; } return vec; } int main() {
cpp
m_singleton->getTrackerTrackPropagator() : m_singleton->getTrackPropagator(); TEveRecTrack t; t.fBeta = 1; t.fP = TEveVector( iData.px(), iData.py(), iData.pz() ); t.fV = TEveVector( iData.vertex().x(), iData.vertex().y(), iData.vertex().z() ); t.fSign = iData.charge(); TEv...
cpp
#include <string> #include <set> #include <ngraph/node.hpp> #include <ngraph/variant.hpp> #include <openvino/core/rtti.hpp> #include <ngraph/attribute_visitor.hpp>
cpp
unsigned getFeatures() const override { return Broker::Feature_Metadata; } }; } // end anonymous namespace extern "C" ::llvm::mcad::BrokerPluginLibraryInfo LLVM_ATTRIBUTE_WEAK mcadGetBrokerPluginInfo() { return { LLVM_MCAD_BROKER_PLUGIN_API_VERSION, "TracerBroker", "v0.1",
cpp
str::stream() << "Error converting UTF-8 string: " << u_errorName(error), U_SUCCESS(error)); ret.resize(len); return ret; } std::string toUTF8() const { UErrorCode error = U_ZERO_ERROR;
cpp
const int height= 512; std::unique_ptr<Matrix> char_img = Matrix::makeMatrix(Dimension{.rows = height, .cols = width}, 1); std::unique_ptr<Matrix> clone = char_img->clone(); int num_tiles = width/tile_width; // 3x3 kernel to 13x13 for(int pad_size = 1; pad_size < 7; pad_size++) { clone->reorder_with_p...
cpp
// Date: 17/1/2010 // --------------------------------------------------------------------------- bool apComputeContextDeletedEvent::writeSelfIntoChannel(osChannel& ipcChannel) const { // Write the OpenGL Server context id: ipcChannel << _contextId; // Call my parent class's version of this function...
cpp
Luau::SourceModule* sm = frontend.getSourceModule(name); Luau::ModulePtr m = frontend.moduleResolver.getModule(name); Luau::attachTypeData(*sm, *m);
cpp
{ init_put_area(); } if (!traits_type::eq_int_type(c, traits_type::eof())) { if (output_buffered()) {
cpp
My_ds_full_cell> My_tds; \ test<My_tds>(DIM, string("mirror&dynamic")+string(#DIM)) ;} */ template< int D > void go(int N) { typedef CGAL::Epick_d<CGAL::Dimension_tag<D> > K; //typedef CGAL::Epick_d<CGAL::Dynamic_dimension_tag> K; typedef CGAL::Triangu...
cpp
#pragma once #include <mbgl/util/feature.hpp> namespace mbgl { namespace style { template <class T> class IdentityStops { public: optional<T> evaluate(const Value&) const;
cpp
RealImage output; RealImage gradX; RealImage gradY; RealImage gradZ; double voxelx, voxely, voxelz; double dx, dy, dz;
cpp
void TooltipWindow::setMillisecondsBeforeTipAppears (const int newTimeMs) noexcept { millisecondsBeforeTipAppears = newTimeMs; } void TooltipWindow::paint (Graphics& g) { getLookAndFeel().drawTooltip (g, tipShowing, getWidth(), getHeight()); } void TooltipWindow::mouseEnter (const MouseEvent&) {
cpp
public: int getMinimum(int nextCost, int prevCost, string start, string goal) { int n = start.size(); for (int i=0; i<n; ++i) { for (int j=0; j<n; ++j) { if (i!=j && intersects(start[i], goal[i], start[j], goal[j])) { return -1; }
cpp
std::string emission_idx_str; if (state_idx < hmm.states.size()-1) { std::ostringstream ss; ss << hmm.states[state_idx+1].model; emission_idx_str = ss.str(); } else { // Last state, no emission from this triphone emission_idx_str = ","; ...
cpp
caffe_copy(count, top_diff, bottom_diff); } else { caffe_cpu_scale(count, coeffs_[i], top_diff, bottom_diff); } break; case EltwiseParameter_EltwiseOp_MAX: mask = max_idx_.cpu_data();
cpp
private: friend class FuncTable; // other funcs void _plusRef(){++_refs;} int _minusRef(){return --_refs;} private:
cpp
if (transformation_context->GetFactManager()->IdIsIrrelevant( message_.fresh_id())) { return; } // Add synonym facts relating the defined elements of the shuffle result to // the vector components that they come from. for (uint32_t component_index = 0; component_index < static_cast<uint3...
cpp
opt._listsFlag= false; opt._wsListFlag= false; if (opt._default_lef_rules) { // minWidth, minSpacing, minThickness, pitch multiplied by grid_list // user sets default_flag and grid_list multipliers if (in_args->grid_list()==NULL) { opt._gridTable.add(1.0); } else { parser.mkWords(in_args->grid_list());...
cpp
* CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE * AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER * WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, * INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES, * DUTIES OR CONDITIONS OF MERCH...
cpp
}tr[N << 2]; void push_up(Node &root, Node &left, Node &right) { root.sum = left.sum + right.sum; int mid_max = left.suf_max + right.pre_max; int left_max = left.t_max;
cpp
layoutParameters.isLastNewParagraph = TextAbstraction::IsNewParagraph( *( utf32Characters.Begin() + ( numberOfCharacters - 1u ) ) ); // The initial glyph and the number of glyphs to layout. layoutParameters.startGlyphIndex = 0u; layoutParameters.numberOfGlyphs = numberOfGlyphs; layoutParameters.startLineInde...
cpp
boost::thread reader(simple_reading_thread(rw_mutex,finish_mutex,unblocked_mutex,unblocked_count)); boost::thread::sleep(delay(1)); CHECK_LOCKED_VALUE_EQUAL(unblocked_mutex,unblocked_count,1u); boost::system_time const start=boost::get_system_time(); boost::system_time const timeout=start+boos...
cpp
TEST_F(FtpDirectoryListingParserNetwareTest, Bad) { const char* bad_cases[] = { " foo", "garbage", "d [] ftpadmin 512 Jan 29 2004 pub",
cpp
voxomap::updateSide(it, it.node->findRelativeVoxel(x + 1, y, z), SideEnum::XPOS, SideEnum::XNEG); voxomap::updateSide(it, it.node->findRelativeVoxel(x, y - 1, z), SideEnum::YNEG, SideEnum::YPOS); voxomap::updateSide(it, it.node->findRelativeVoxel(x, y + 1, z), SideEnum::YPOS, SideEnum::YNEG); voxomap::u...
cpp
QSharedMemoryPrivate::QSharedMemoryPrivate() : QObjectPrivate(), memory(0), size(0), error(QSharedMemory::NoError), #ifndef QT_NO_SYSTEMSEMAPHORE systemSemaphore(QString()), lockedByMe(false), #endif unix_key(0) { } void QSharedMemoryPrivate::setErrorString(const QString &function) { Q_UNUSED(func...
cpp
tempo1 = magma_sync_wtime( queue ); magma_z_vtransfer(b_h, &b, Magma_CPU, Magma_DEV, queue); tempo2 = magma_sync_wtime( queue ); t_transfer += tempo2-tempo1;
cpp
// pas directement inclus par des fichiers '.cc' pour s'assurer que // les symboles externes sont bien définis. #include "arccore/message_passing/MessagePassingGlobal.h" #include "arccore/message_passing/ITypeDispatcher.h" #include "arccore/message_passing/Dispatchers.h" #include "arccore/message_passing/IMessagePassin...
cpp
* "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an
cpp
} this->Interpreter->ReleaseControl(); this->MultilineStatement = false; } ~pqImplementation() { this->VTKConnect->Disconnect(); this->VTKConnect->Delete(); this->destroyInterpretor(); } void destroyInterpretor()
cpp
#include "common/engine/system/fixedstring.hpp" ////////////////////////////////////////////////////// // DEFINES ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// // FORWARD DECLARATION ////////////////////////////////////////////////////// //////////////...
cpp
#include <os/open.hxx>