lang
stringclasses
10 values
seed
stringlengths
5
2.12k
cpp
getline(cin, tmp); sscanf(tmp.c_str(), "%d %d", &M, &N); for (int i = 1; i <= M; i++) getline(cin, names1[i]); for (int i = 1; i <= N; i++) getline(cin, names2[i]); S.clear();
cpp
FileEntry entry; for (struct dirent* ent = readdir(dir); nullptr != ent; ent = readdir(dir)) { String fileOrDirName = ent->d_name; if (fileOrDirName == "." || fileOrDirName == "..") { continue; // just skip. faster work less bugs } entry.name = fileOrDirName; entry.path = path + entry.name; if (ent->d_type != DT_DIR && ent->d_type != DT_REG)
cpp
m_context->UpdateProcClipAimingRequest( false ); } virtual void Update( float timePassed ) {
cpp
#include "lue/framework/benchmark/algorithm_benchmark_result.hpp" #include "lue/framework/benchmark/hpx_main.hpp" #include "lue/framework/benchmark/model_benchmark.hpp" #include "lue/framework/benchmark/regex.hpp" #include "lue/docopt.hpp" #include <regex> namespace {
cpp
int main() { try { TinyCLexer lexer(std::cin); TinyCParser parser(lexer); parser.program(); } catch(std::exception& e) { std::cerr << "exception: " << e.what() << std::endl; } return 0; }
cpp
440.0, 493.8833012561241, 261.6255653005986, 293.6647679174076, 329.6275569128699, 349.2282314330039, 391.99543598174927, }; if (finished() || --_cur_ms > 0)
cpp
} void RPCInverseLBLinkMapESProducer::fillDescriptions(edm::ConfigurationDescriptions& _descs) { edm::ParameterSetDescription _desc; _descs.add("RPCInverseLBLinkMapESProducer", _desc); } void RPCInverseLBLinkMapESProducer::setupRPCLBLinkMap(RPCLBLinkMapRcd const& _rcd, RPCInverseLBLinkMap* inverse_linkmap) { RPCInverseLBLinkMap::map_type& _inverse_map(inverse_linkmap->getMap()); _inverse_map.clear();
cpp
*/ bool process(const uint8_t * data, const uint64_t override_ts) override { if (!_fullRotationAccumulator->isBatchReady()) { return true; } _pub->publish(
cpp
return m_Position + velocity; } void FreeViewCamera::AddRotationSpeed (float _x, float _y, float _z) { m_RollSpeed += _z; m_PitchSpeed += _x; m_YawSpeed += _y;
cpp
S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; } } std::variant<blake2b_error, bytes> blake2b(uint32_t _rounds, const bytes& _h, const bytes& _m, const bytes& _t0_offset, const bytes& _t1_offset, bool _f, const yield_function_t& yield) { // EIP-152 [4 bytes for rounds][64 bytes for h][128 bytes for m][8 bytes for t_0][8 bytes for t_1][1 byte for f] : 213 // [------------------][64 bytes for h][128 bytes for m][8 bytes for t_0][8 bytes for t_1][------------] : 208 // * rounds and final indicator flag are not serialized if (_h.size() != 64 || _m.size() != blake2b_wrapper::BLAKE2B_BLOCKBYTES || _t0_offset.size() != 8 || _t1_offset.size() != 8) {
cpp
ThreadData( GenericImage<P>& a_image, const Convolution& a_convolution, size_type a_count ) : AbstractImage::ThreadData( a_image, a_count ), image( a_image ), convolution( a_convolution ) { } GenericImage<P>& image; const Convolution& convolution;
cpp
pBookText->m_String = ""; pBookText->m_DynamicString = ConfigManager::GetLocalizedString( BookString, "" ); } else { pBookText->m_String = ConfigManager::GetLocalizedString( BookString, "" ); pBookText->m_DynamicString = ""; } pBookText->Reinitialize(); pUIStack->Push( pBookScreen ); }
cpp
Analyzer::DeliverPacket(len, data, orig, seq, ip, caplen); interp->NewData(orig, data, data + len); } // void Syslog_Analyzer::ExpireTimer(double t) // { // // The - 1.0 in the following is to allow 1 second for the // // common case of a single request followed by a single reply,
cpp
fake_user_manager->AddKioskAppUser("<EMAIL>"); fake_user_manager->LoginUser("<EMAIL>"); chromeos::ScopedUserManagerEnabler scoped_user_manager(fake_user_manager); EXPECT_TRUE(InstallExtension(crx_path, 1)); #endif }
cpp
typedef TCntPtr<TRemChatClientProxy> TChatClient; typedef TCntPtr<TRemSerialSrvClientProxy> TSerialPortClient; } // --------------------------------------------------------------------------- // Include our headers, in the needed order. // --------------------------------------------------------------------------- #include "CQCRPortClient_PortFactory.hpp" #include "CQCRPortClient_ThisFacility.hpp" // ---------------------------------------------------------------------------
cpp
#include "dearpygui.h" #include "mvContext.h" #include <Windows.h> #include <iostream> #include <fstream> #include <string> #include <sstream> #include <filesystem>
cpp
} /*******************************************************************\ Function: make_assertions_false
cpp
outputText << allCornersFound.size() << " chessboards found and used."; putText(displayImage, outputText.str(), cv::Point(50, 50), 1, 1.0, cv::Scalar(255,0,0)); // Display the image. cv::imshow(calibrationWindowName, displayImage); // Wait 10 ms for a key to be pressed. lastKey=cv::waitKey(10); switch(lastKey) { // If the 'a' key was pressed. case 'a': takeFrame=true;
cpp
"KERNEL", // SM_KERNEL "MD", // SM_MD "ME", // SM_ME "EXPRESS", // SM_EXPRESS "OPTIMIZER", // SM_OPTIMIZER "PARALLEL", // SM_PARALLEL "PARSER", // SM_PARSER
cpp
{ int i,j,a,b,c; cin>>a>>b>>c; for(i=0;a*i<=c;i++) { for(j=0;a*i+b*j<=c;j++) { if(a*i+b*j==c) goto here; } }
cpp
AZ::Vector3 center = AZ::Vector3(0.0f, 50.0f, 25.0f); AZ::IntersectResult result = testFrustum2.IntersectAabb(center - AZ::Vector3(1.0f), center + AZ::Vector3(1.0f)); AZ_TEST_ASSERT(result == AZ::IntersectResult::Overlaps); } } TEST(MATH_Frustum, TestFrustumAabbIntersectBottom) { // Test an AABB on the bottom clip plane
cpp
namespace { static llvm::cl::opt<bool> instrumentDebug("instrument-debug", llvm::cl::desc("Instrument the IR for debugging"), llvm::cl::init(false), llvm::cl::Hidden); static llvm::cl::opt<bool> optimizeIR("optimize-ir", llvm::cl::desc("Enable IR optimizations"), llvm::cl::init(true), llvm::cl::Hidden); static llvm::cl::opt<bool> dumpIR("dump-ir",
cpp
#include <fstream> const int STR_BUFF_SIZE = 512; //Static Array Size int main(){ std::ifstream input; std::ofstream output; char buff[STR_BUFF_SIZE] = "";
cpp
/////////////////////////////////////////////////////////////////////////////// void GrGammaEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const { GrGLGammaEffect::GenKey(*this, caps, b); } GrGLSLFragmentProcessor* GrGammaEffect::onCreateGLSLInstance() const { return new GrGLGammaEffect(); } const GrFragmentProcessor* GrGammaEffect::Create(GrTexture* texture, SkScalar gamma) { return new GrGammaEffect(texture, gamma); }
cpp
template <typename Alloc> class basic_allocation_arena : public block_owner { public: basic_allocation_arena() = default; template <typename... P>
cpp
// Raster32PMyPaintSurface::Internal // //======================================================= class Raster32PMyPaintSurface::Internal : public mypaint::helpers::SurfaceCustom<readPixel, writePixel, askRead, askWrite> { public:
cpp
template<typename T, GPUFlag F> cpptorch::Tensor<T, F> cpptorch::nn::Inception<T, F>::forward(const cpptorch::Tensor<T, F> &input) const { if (input.dim() == 3) { return fromBatch(Decorator<T, F>::forward(toBatch(input))); } else { return Decorator<T, F>::forward(input); } }
cpp
found in linking. So have this short function here. Only do this when building with element libraries. */ static void preload_symbols(void) {
cpp
ManagerTf() ; ros::NodeHandlePtr _nh; std::string uav_base_frame, ugv_base_frame; double initial_pos_ugv_x, initial_pos_ugv_y, initial_pos_ugv_z, initial_pos_ugv_yaw, initial_pos_ugv_pitch, initial_pos_ugv_roll, pos_uav_above_ugv; void initializationTf(); void tfBroadcaster(const double _x,const double _y,const double _z,const double _R,const double _P,const double _Y, std::string _from, std::string _to); protected: }; #endif
cpp
phone_number->set_type(tutorial::Person::WORK); } else { cout << "Unknown phone type. Using default." << endl; } } } // Main function: Reads the entire address book from a file, // adds one person based on user input, then writes it back out to the same // file. int main(int argc, char* argv[]) {
cpp
CGPoint position; CTRunGetGlyphs (run, glyphRange, &glyph); CTRunGetPositions (run, glyphRange, &position); CGPathRef letter = CTFontCreatePathForGlyph (runFont, glyph, nullptr); CGAffineTransform t = CGAffineTransformMakeTranslation (position.x, position.y); t = CGAffineTransformScale (t, 1, -1); t = CGAffineTransformTranslate (t, 0, static_cast<CGFloat> (-capHeight)); CGPathAddPath (textPath, &t, letter); CGPathRelease (letter);
cpp
try { Calculator<int> calc(argv[1]); std::cout << calc.run() << std::endl; } catch (std::exception& expr) { std::cerr << "error" << std::endl; //std::cerr << expr.what() << std::endl; return 1;
cpp
const int N_MAX = 1002; int N, M; char A[N_MAX], B[N_MAX]; int f[N_MAX][N_MAX]; int main() { strcpy(A, "abcde"); strcpy(B, "ace"); N = strlen(A); M = strlen(B); for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { // 先取 [01, 10] 两种情况的 MAX f[i][j] = max(f[i - 1][j], f[i][j - 1]);
cpp
static void initArray() { lomp::mlfsr32 rn(42); /* 42 is "the answer to life, the universe, and everything." */ for (int i = 0; i < DIM; i++) { for (int j = 0; j < DIM; j++) { array[i][j] = rn.getNext() % 5000; }
cpp
auto tmp = b * b - 4.f * a * c; if (tmp < 0.f) return false; if (!tmp) t = (-b + sqrtf(tmp)) / (2.f * a); else { auto t1 = (-b + sqrtf(tmp)) / (2.f * a);
cpp
void Calculate(AnimationTimeInterval const& time, Detail::Skeletal2D::AnimationGraphWeightCollection const& weights, Skeleton const& skeleton, SkeletonPose & skeletonPose) const override; float Weight() const; void Weight(float amount); AnimationTimeInterval Length() const override; std::unique_ptr<AnimationNode> const& Base() const { return base; }
cpp
&feedback_request); break; } case kRtpExtensionPlayoutDelay: PlayoutDelay playout; packet.GetExtension<PlayoutDelayLimits>(&playout); break; case kRtpExtensionVideoContentType: VideoContentType content_type; packet.GetExtension<VideoContentTypeExtension>(&content_type);
cpp
const std::string m_input_name = ""; const int m_input_index = -1; }; /// \brief Specifies a single node output by the name or index. /// For a node test_node, with 2 outputs: /// /// +-----------+ ---(out1)---> /// ----(in_A)----> | test_node | /// +-----------+ ---(out2)---> /// You can indicate out2 as EditorOutput("out2") or EditorOutput(1) struct EditorOutput {
cpp
int m, n; cin>>m>>n;   int ack[4][20000]; memset(ack,0,sizeof(ack));
cpp
PriceCalculatorFW::PriceCalculatorFW(ExcessDemandCalculator* excessDemandCalculator, Price* price, ExcessDemand* excessDemand, double mu, AgentFW::SwitchingStrategy switchingStrategy): PriceCalculator(excessDemandCalculator, price, excessDemand), mu(mu), switchingStrategy(switchingStrategy) { } void PriceCalculatorFW::stepCalculate() { // updated from variables at time t-1. excessDemandCalculator->stepCalculate(); double new_price = 0; if(switchingStrategy == AgentFW::SwitchingStrategy::TPAC || switchingStrategy == AgentFW::SwitchingStrategy::TPACI) { throw "Current unpublished research...";
cpp
: m_onInit{std::move(onInit)}, m_onEnd{std::move(onEnd)} { AddRequirements(requirements); } StartEndCommand::StartEndCommand(const StartEndCommand& other) : CommandHelper(other) { m_onInit = other.m_onInit; m_onEnd = other.m_onEnd; } void StartEndCommand::Initialize() { m_onInit(); }
cpp
KmlFactory* factory = KmlFactory::GetFactory(); FeaturePtr feature = factory->CreatePlacemark(); TestVisitor visitor; feature->Accept(&visitor); EXPECT_TRUE(visitor.visit_element_was_called_);
cpp
#include "DiabloUI/fonts.h" #include "DiabloUI/text.h" #include "DiabloUI/ui_item.h" #include "DiabloUI/ttf_render_wrapped.h" #include "display.h" namespace dvl { extern SDL_Surface *pal_surface;
cpp
return _centralMeridian; } double MapProjection5Parameters::originLatitude() const { return _originLatitude; } double MapProjection5Parameters::scaleFactor() const {
cpp
} void ExtractorBase::pauseRequestSlot(ServiceState* state) { Q_CHECK_PTR(state); emit this->pauseRequest(state); } const QString& ExtractorBase::extractorId() const { return this->_extractorId; } const QString& ExtractorBase::fileExtention() const {
cpp
{ throw std::exception(); } if (firstRandom) { std::srand((int)(std::time(nullptr)));
cpp
class NoOp : public OpKernel { public: Status Init(OpKernelConstruction* ctx) override { return Status::Ok(); } Status Compute(OpKernelContext* ctx) override { return Status::Ok(); } private:
cpp
{ } QStackedLayoutSlots::~QStackedLayoutSlots() { } void QStackedLayoutSlots::setCurrentIndex( int index ) { QObject *object = qobject_cast<QObject *>(sender()); PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "setCurrentIndex(int)" );
cpp
* Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "modules/audio_processing/aec3/aec3_common.h" #include BOSS_WEBRTC_U_typedefs_h //original-code:"typedefs.h" // NOLINT(build/include) #include BOSS_WEBRTC_U_system_wrappers__include__cpu_features_wrapper_h //original-code:"system_wrappers/include/cpu_features_wrapper.h"
cpp
#include "iostream" int main() { // TODO:read standard input // TODO:process // TODO:write standard output // TODO:fflush(stdout); return 0; }
cpp
if (!eckey) return 0; const EC_GROUP *group = EC_KEY_get0_group(eckey); if ((ctx = BN_CTX_new()) == NULL) goto err;
cpp
#include <shared.hpp> #pragma once void raptor_search(search_arguments const & arguments);
cpp
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, last_error_num, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, sizeof(last_error_msg) / sizeof(TCHAR), NULL); log_message(LOG_TYPE_ERROR, LOG_ITEM_LOG_PRIO, (longlong)ERROR_LEVEL, LOG_ITEM_LOG_LOOKUP, ER_NPIPE_CANT_CREATE, "LookupAccountName failed", last_error_msg); return true; } // sid_name_use is SidTypeAlias when group_name is a local group if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) { log_message(LOG_TYPE_ERROR, LOG_ITEM_LOG_PRIO, (longlong)ERROR_LEVEL,
cpp
location_handler_type location_handler{index}; osmium::apply(my_reader, my_handler, location_handler); //osmium::io::Reader my_reader = osmium::io::Reader(my_file); //osmium::io::ReaderWithProgressBar my_reader = osmium::io::ReaderWithProgressBar(true, my_file);
cpp
} private: const NodeExecStats expected_; }; inline ::testing::PolymorphicMatcher<NodeStatsMatcher> EqualsNodeStats( const NodeExecStats& expected) { return ::testing::MakePolymorphicMatcher(NodeStatsMatcher(expected)); } TEST(HostTracerTest, CollectsTraceMeEventsAsRunMetadata) { int32 thread_id = Env::Default()->GetCurrentThreadId();
cpp
// Frame x y z r g b a auto values = split_copy(line, " "); if (values.size() == 8) { float x = std::stof(values[1]); float y = std::stof(values[2]); float z = std::stof(values[3]); // Negative values indicate missing color information, use fuchsia if (float r = std::stof(values[4]); r < 0.0f) { data.emplace_back(x + 30.0f, y + 625.0f, z - 128.0f, 1.0f, 0.0f, 1.0f, 1.0f); } else { float g = std::stof(values[5]); float b = std::stof(values[6]); float a = std::stof(values[7]);
cpp
// http://www.boost.org/LICENSE_1_0.txt) #include <boost/utility/swap.hpp> #include <boost/core/lightweight_test.hpp> #define BOOST_CHECK BOOST_TEST #define BOOST_CHECK_EQUAL BOOST_TEST_EQ //Put test class in the global namespace #include "./swap_test_class.hpp" //Provide swap function in gloabl namespace void swap(swap_test_class& left, swap_test_class& right) {
cpp
// At this point, theArray[n+1-pass..n−1] is sorted // and all of its entries are > the entries in theArray[0..n–pass] sorted = true; // Assume sorted for (int index = 0; index < n − pass; index++) { // At this point, all entries in theArray[0..index–1] // are <= theArray[index] int nextIndex = index + 1; if (theArray[index] > theArray[nextIndex]) { // Exchange entries
cpp
#include "mediasoupclient.hpp" #include <catch.hpp> #include <string> int main(int argc, char* argv[]) { mediasoupclient::Logger::LogLevel logLevel{ mediasoupclient::Logger::LogLevel::LOG_NONE }; rtc::LoggingSeverity webrtcLogLevel{ rtc::LoggingSeverity::LS_NONE };
cpp
#endif // Read the query packet int i = 0; while (len-- > 0 && i < SSDP_RX_PACKET_MAX_SIZE && _httpClient.available()) { _rxPacketBuffer[i++] = _httpClient.read(); } #if SSDP_SERIAL_DEBUG_LEVEL > 1 Serial.println("SSDP: /-------------------------------"); Serial.println(_rxPacketBuffer); Serial.println("SSDP: -------------------------------/");
cpp
int digit = c - '0'; product *= digit; sum += digit; } return product - sum; } }; int main() {
cpp
\endverbatim */ class XSEC_EXPORT XENCEncryptedKey : public virtual XENCEncryptedType, public DSIGKeyInfo {
cpp
int main() { //Init OpenVR vr::EVRInitError vr_error; vr::IVRSystem* vr_system = vr::VR_Init(&vr_error, vr::VRApplication_Background);
cpp
{ time_ = std::chrono::steady_clock::now(); } std::chrono::duration<float, std::milli> Stopwatch::getElapsedSystemTimeInSeconds() { return getElapsedSystemTimeInMillis() * 0.001F; }
cpp
return {}; } } [[nodiscard]] Val BinaryTree::min() const { return min(root)->value; } [[nodiscard]] Val BinaryTree::max() const { auto node = root; while (node->right != nullptr) { node = node->right; }
cpp
TEST_CASE("Majority Element II") { MajorityElementII s; SECTION("Sample tests") { vector<int> nums1{1, 2, 3, 4}; REQUIRE(s.majorityElement(nums1).empty()); vector<int> nums2{0, 3, 4, 0}; vector<int> expected2{0}; vector<int> result2 = s.majorityElement(nums2); REQUIRE(expected2 == result2); }
cpp
*/ /*===========================================================================*/ int main( int argc, char** argv ) { kvs::Application app( argc, argv ); kvs::Screen screen( &app ); screen.setGeometry( 0, 0, 512, 512 ); screen.setTitle( "PointRenderer" ); screen.create();
cpp
default: break; } } else if(OKTOQUIT)
cpp
// Test for object non-existence. ARROW_CHECK_OK(client_.Get(&object_id, 1, 0, &object_buffer)); ASSERT_EQ(object_buffer.data_size, -1); // Test for the object being in local Plasma store. // First create object. int64_t data_size = 4; uint8_t metadata[] = {5};
cpp
} } while (nbytes > 0); tls_close(tls); tls_free(tls); tls_config_free(tls_config); return 0; } int server(int fd_read, int fd_write) { static char buf[1024] = {0}; struct tls *tls;
cpp
{ return GSpan(*type_, buffer_, size_); } const CPPType &type() const { return *type_;
cpp
auto retCode = nebula::error(ret); if (retCode != nebula::cpp2::ErrorCode::E_KEY_NOT_FOUND) { LOG(ERROR) << "Sign in fulltext failed, error: " << apache::thrift::util::enumNameSafe(retCode); handleErrorCode(retCode);
cpp
s = fmod(s, max_s); double x = spline_x(s) + d * spline_dx(s); double y = spline_y(s) + d * spline_dy(s); return {x,y}; } */ vector<double> JMT(vector< double> start, vector <double> end, double T) { /* Calculate the Jerk Minimizing Trajectory that connects the initial state
cpp
// Private static error exit. // void cEventHdlr::on_null_ptr() { fprintf(stderr, "Singleton class cEventHdlr used before instantiated.\n"); exit(1); } //-----------------------------------------------------------------------------
cpp
for (int i = 3; i < MAX && k < 100000; i+=2) if (!ifc(i) && !ifc(i+2)) pr[k++] = i; } int main() {
cpp
ASSERT_NO_ERROR(fs::remove(Twine(RootDir) + "/a")); ASSERT_NO_ERROR(fs::remove(Twine(RootDir) + "/b")); ASSERT_NO_ERROR(fs::remove(Twine(RootDir))); } #endif TEST_F(FileSystemTest, Remove) { SmallString<64> BaseDir; SmallString<64> Paths[4];
cpp
#include <ulmblas/level1/axpy.h> #include <ulmblas/level2/splr.h> namespace ulmBLAS {
cpp
{ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType; DE_NULL, // pNext; 0, // srcAccessMask; VK_ACCESS_TRANSFER_WRITE_BIT, // dstAccessMask; oldImageLayout, // oldLayout; VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // newLayout; VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex; VK_QUEUE_FAMILY_IGNORED, // dstQueueFamilyIndex; image, // image subresourceRange // subresourceRange }; const VkBufferMemoryBarrier bufferBarrier =
cpp
if (op == 'e') { cin >> element; ptr = (int*)malloc(sizeof(int)); *ptr = element; pthread_rwlock_fcfs_queue_enqueue(queue, ptr); } else if (op == 'd') { ptr = (int *)pthread_rwlock_fcfs_queue_dequeue(queue); if (ptr == NULL) { cout << "Queue is empty!\n"; } else
cpp
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
cpp
LogTrace(mlDqmClient_) << "Present values for ISHA/VFS of APV " << bin.str() << " : " << static_cast<uint16_t>(desc->getIsha()) << " " << static_cast<uint16_t>(desc->getVfs()); } allowSelectiveUpload_ = this->pset().existsAs<bool>("doSelectiveUpload") ? this->pset().getParameter<bool>("doSelectiveUpload") : false; if (allowSelectiveUpload_) LogTrace(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]" << " Enabling selective update of FED parameters.";
cpp
RocksDBRestWalHandler::RocksDBRestWalHandler(application_features::ApplicationServer& server, GeneralRequest* request, GeneralResponse* response) : RestBaseHandler(server, request, response) {} RestStatus RocksDBRestWalHandler::execute() { std::vector<std::string> const& suffixes = _request->suffixes(); if (suffixes.size() != 1) { generateError(rest::ResponseCode::BAD, TRI_ERROR_HTTP_BAD_PARAMETER, "expecting /_admin/wal/<operation>"); return RestStatus::DONE; }
cpp
// Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifdef _WIN32
cpp
#include <eosio/chain/block_state.hpp> #include <eosio/chain/exceptions.hpp> namespace eosio { namespace chain { block_state::block_state( const block_header_state& prev, block_timestamp_type when ) :block_header_state( prev.generate_next( when ) ), block( std::make_shared<signed_block>() ) { static_cast<block_header&>(*block) = header; } block_state::block_state( const block_header_state& prev, signed_block_ptr b ) :block_header_state( prev.next( *b )), block( move(b) ) { }
cpp
kPlanningParamModule, collect, target_point_lowpass_gain, 0.8, "Gain on the averaging function to smooth the target point to intercept (unitless)"); // How much of the ball seed to contact the ball with // before slowing down to dampen the initial hit DEFINE_NS_FLOAT64(kPlanningParamModule, settle, ball_speed_percent_for_dampen, 0.1, "How much of the ball seed to contact the ball with before slowing down to " "dampen the initial hit (unitless)")
cpp
p[i][steps] += p[j][steps - 1] * (1.0 / W); } } } double answer = 0; for(int i = K; i <= N; ++i){ for(int steps = 1; steps <= K; ++steps){ answer += p[i][steps]; } } return answer; } };
cpp
line = trim(line); if ( line == ngram_line ) break; } while (getline(in, line)); if ( in.eof() )
cpp
// // Created by nalle on 8/1/2017. // #include "ASTVisitor.h"
cpp
// 2. Save configuration to the configuration file // Truncate file first if (::ftruncate(m_writeFd, 0) != 0) { return false; } int written = ::write(m_writeFd, str.data(), str.size()); if (written < 0) { return false;
cpp
return head; } }; int main() { Solution sol; auto head = new ListNode{1,2,3,4}; cout << leetcode::to_string(head) << endl; head = sol.swapPairs(head);
cpp
current_offset += old_details.field_width_in_words(); } Descriptor d(handle(GetKey(i), isolate_), MaybeObjectHandle(old_descriptors_->GetValue(i), isolate_), old_details); new_descriptors->Set(i, &d); }
cpp
// status leds groups[STATUS_RCS] = (StatusGroup){ 23, 1 }; // 0, 0 groups[STATUS_SAS] = (StatusGroup){ 25, 1 }; // 1, 0 groups[STATUS_STAGE] = (StatusGroup){ 27, 1 }; // 1, 2 groups[STATUS_STAGE_ARMED] = (StatusGroup){ 29, 1 }; // 1, 3 groups[STATUS_THROTTLE] = (StatusGroup){ 33, 1 }; // 0, 2 groups[5] = (StatusGroup){ 35, 1 }; // 0, 3
cpp
#include "Basics/Clipper.h" #include "Basics/Plane.h" #include "Basics/SysTools.h" // for Paper Hack file log #include "Controller/Controller.h" #include "Controller/StackTimer.h" #include "IO/TransferFunction1D.h" #include "IO/TransferFunction2D.h" #include "IO/FileBackedDataset.h" #include "IO/LinearIndexDataset.h"
cpp
else { ImGui::Text("pos : "); ImGui::SameLine(); ImGui::SliderFloat3("##1", _positionInput,-2.f,2.f); ImGui::Text("rot : "); ImGui::SameLine(); ImGui::SliderFloat4("##2", _rotationInput,0.f,3.141592f); ImGui::Text("scl : "); ImGui::SameLine(); ImGui::SliderFloat3("##3", _scaleInput,0.1f,5.f);
cpp
typedef opengm::BlackBoxTestStar<GraphicalModelType> StarTest; typedef opengm::BlackBoxTestGrid<GraphicalModelType2> GridTest2; opengm::InferenceBlackBoxTester<GraphicalModelType> minTester; minTester.addTest(new GridTest(4, 4, 2, false, true, GridTest::POTTS, opengm::OPTIMAL, 1)); minTester.addTest(new GridTest(3, 3, 2, false, true, GridTest::POTTS, opengm::OPTIMAL, 3)); minTester.addTest(new GridTest(3, 3, 2, false, false,GridTest::POTTS, opengm::OPTIMAL, 3)); minTester.addTest(new StarTest(5, 2, false, true, StarTest::POTTS, opengm::OPTIMAL, 3));
cpp
#include "variables.h" const double tax_rate = 0.0675; double get_sales_tax_amount(double meal_amount) { return meal_amount * tax_rate; } double get_tip_amount(double meal_amount, double tip_rate) { return meal_amount * tip_rate ; }
cpp
* received, removed from this buffer, and handled appropriately. * * @param[out] message * This is where to store the next message received from the * Twitch server.
cpp
using ImageType = itk::Image<PixelType, Dimension>; using ReaderType = itk::ImageFileReader<ImageType>;
cpp
public: SkChannelMaskColorFilter(U8CPU redMask, U8CPU greenMask, U8CPU blueMask) { fMask = SkPackARGB32(0xFF, redMask, greenMask, blueMask); } virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[]) { SkPMColor mask = fMask; for (int i = 0; i < count; i++) result[i] = src[i] & mask; }
cpp
while (insert_head != nullptr) { auto const x = spsc_queue::advance_(insert_head); node_alloc_traits::destroy(alloc_(), std::addressof(x->data)); node_alloc_traits::deallocate(alloc_(), x, 1); }