text
string
size
int64
token_count
int64
#include <gtest/gtest.h> extern "C" { #include "max_points_on_a_line.h" } #define ARR_SIZE(a) (sizeof(a) / sizeof((a)[0])) typedef struct Point point; static point point_create(int x, int y) { point p; p.x = x; p.y = y; return p; } TEST(max_points_on_a_line_test, maxPoints_149_1) { point points...
781
326
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "third_party/blink/renderer/modules/mediastream/input_device_info.h" #include <algorithm> #include "third_party/blink/renderer/modules/mediastre...
5,266
1,615
// TODO: FIX ME! Does not handle delta between dates correctly. // // main.cpp // // This program exercises the Calendar interface exported in calendar.h. // // -------------------------------------------------------------------------- // Attribution: "Programming Abstractions in C++" by Eric Roberts // Chapter 6, Exe...
2,966
1,033
// // Copyright (c) 2016 - 2017 Mesh Consultants Inc. // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, mod...
8,702
3,722
/************************************************************************** ** This file is a part of our work (Siggraph'16 paper, binary, code and dataset): ** ** Roto++: Accelerating Professional Rotoscoping using Shape Manifolds ** Wenbin Li, Fabio Viola, Jonathan Starck, Gabriel J. Brostow and Neill D.F. Campbell *...
8,195
2,881
#include "foointerface.h" #include <QDir> #include <QGuiApplication> #include <QPluginLoader> #include <QQmlApplicationEngine> #include <QTimer> #include <QTranslator> int main(int argc, char *argv[]) { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif...
2,251
718
struct ezJniModifiers { enum Enum { PUBLIC = 1, PRIVATE = 2, PROTECTED = 4, STATIC = 8, FINAL = 16, SYNCHRONIZED = 32, VOLATILE = 64, TRANSIENT = 128, NATIVE = 256, INTERFACE = 512, ABSTRACT = 1024, STRICT = 2048, }; }; ezJniObject::ezJniObject(jobject object, ezJn...
54,260
18,771
// // Coypright (c) 2021 Singular Inversions Inc. (facegen.com) // Use, modification and distribution is subject to the MIT License, // see accompanying file LICENSE.txt or facegen.com/base_library_license.txt // #include "stdafx.h" #include "FgSerial.hpp" #include "FgCommand.hpp" using namespace std; ...
3,458
1,370
// (C) Copyright 2016 - 2018 Christopher Beck // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma once #include <new> #include <strict_variant/mpl/max.hpp> #include <strict_variant/mpl/typelist.hpp> #include <stri...
3,544
1,181
// WARNING: This file is machine generated by fidlgen. #include <fuchsia/blobfs/llcpp/fidl.h> #include <memory> namespace llcpp { namespace fuchsia { namespace blobfs { namespace { [[maybe_unused]] constexpr uint64_t kCorruptBlobHandler_CorruptBlob_Ordinal = 0x432ee88e00000000lu; [[maybe_unused]] constexpr uint64_...
25,689
9,144
/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to y...
5,772
1,842
// // CShaderProgramOGLES1_0.h // OpenJam // // Created by Yevgeniy Logachev // Copyright (c) 2014 yev. All rights reserved. // #if defined(RENDER_OGLES1_0) #include "CShaderProgramOGLES1_0.h" using namespace jam; // ***************************************************************************** // Constants // **...
6,850
2,509
// Generated by Haxe 4.0.0-preview.5 #include <hxcpp.h> #ifndef INCLUDED_zpp_nape_geom_ZPP_CutVert #include <hxinc/zpp_nape/geom/ZPP_CutVert.h> #endif #ifndef INCLUDED_zpp_nape_util_ZNPList_ZPP_CutVert #include <hxinc/zpp_nape/util/ZNPList_ZPP_CutVert.h> #endif #ifndef INCLUDED_zpp_nape_util_ZNPNode_ZPP_CutVert #inclu...
38,496
21,493
/* Copyright (C) * 2019 - Hu Ren, rh890127a@163.com * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This pr...
7,961
2,862
#include "viewport.hpp" #include <glm/gtc/matrix_transform.hpp> #include <glm/gtx/transform.hpp> #include <glm/gtx/quaternion.hpp> #include "render_target.hpp" namespace Manta::Rendering { void Viewport::UpdateViewport() { float aspect = (float)rect.width / (float)rect.height; perspective = glm::...
417
149
// vim: sw=4 expandtab #ifndef CUBE_HPP_ #define CUBE_HPP_ #include "MeshItem.hpp" #include <glm/vec3.hpp> #include <cstdint> namespace game { class Cube : public MeshItem { public: static void genGraphics(); void draw(); }; } #endif
270
109
#include <unistd.h> #include "file_descriptor.hpp" FileDescriptor::FileDescriptor(int fd) noexcept : fd_(fd) {} FileDescriptor::~FileDescriptor() noexcept { close(fd_); } FileDescriptor::operator int() const noexcept { return fd_; }
240
89
#pragma once // ARKSurvivalEvolved (329.9) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "ARKSurvivalEvolved_Deinonychus_AnimBP_classes.hpp" namespace sdk { //--------------------------------------------------------------------------- //Parameters //---------------------------------------------------...
12,855
4,954
#include "p2Defs.h" #include "p2Log.h" #include "j1App.h" #include "j1Input.h" #include "j1Textures.h" #include "j1Audio.h" #include "j1Render.h" #include "j1Window.h" #include "j1Map.h" #include "j1Scene.h" #include "j1FadeToBlack.h" #include "j1Pathfinding.h" #include "j1EntityManager.h" #include "j1Player.h" #includ...
6,663
2,922
/* Required defines: MENU_sizeEx - Menu text size (height) */ // place the menu outside of the visible area #define MENU_X safeZoneXAbs + safeZoneWAbs #define MENU_Y safeZoneY + safeZoneH #define MENU_maxChars 12 // used to determine the necessary width of the menu #define MENU_wPerChar MENU_sizeEx * 3/4 * 0.5 // ass...
612
243
//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. //See LICENSE in the project root for license information. #include "pch.h" #include "GazeStats.h" using namespace Platform::Collections; BEGIN_NAMESPACE_GAZE_INPUT GazeStats::GazeStats(int maxHistoryLen) { _maxHistoryLen = maxHisto...
983
373
#include "Game/Game.h" #include "Systems/CameraMovementSystem.h" #include "Systems/NameSystems/NameSelectKeyboardControlSystem.h" int main() { if (!Registry::Instance()->HasSystem<SoundFXSystem>()) Registry::Instance()->AddSystem<SoundFXSystem>(); if (!Registry::Instance()->HasSystem<MusicPlayerSystem>()) Regi...
833
253
/****************************************************************************** * Author(s): Christopher J. Havlicek * * See LICENSE and CONTACTS. ******************************************************************************/ #pragma once #ifndef KMAP_CMD_DEFINITION_HPP #define KMAP_CMD_DEFINITION_HPP #i...
725
238
/*================================================================================ code generated by: java2cpp author: Zoran Angelov, mailto://baldzar@gmail.com class: android.os.Process ================================================================================*/ #ifndef J2CPP_INCLUDE_IMPLEMENTATIO...
14,241
6,605
/* * @file DoMergeAlg.cxx * * @brief Decides whether or not to read an overlay event * * @author Tracy Usher * * $Header: /nfs/slac/g/glast/ground/cvs/GlastRelease-scons/Overlay/src/MergeAlgs/DoMergeAlg.cxx,v 1.4 2011/11/03 18:13:50 usher Exp $ */ #include "GaudiKernel/Algorithm.h" #include "GaudiKernel/MsgSt...
5,591
1,854
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #ifndef IROHA_SHARED_MODEL_PROTO_UTIL_HPP #define IROHA_SHARED_MODEL_PROTO_UTIL_HPP #include <google/protobuf/message.h> #include <vector> #include "cryptography/blob.hpp" namespace shared_model { namespace proto {...
672
250
#include "ball.hpp" #include <SFML/Audio.hpp> #include <SFML/Window.hpp> #include "gameStates.hpp" #include "headers.hpp" #include "mainMenu.hpp" Ball::Ball(std::shared_ptr<Paddle> player1, std::shared_ptr<Paddle> player2, std::shared_ptr<Score> scorePlayer1, std::shared_ptr<Score> scorePlayer2) { this->player1_ =...
2,765
1,016
/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to y...
2,306
727
#include <SimpleAmqpClient/SimpleAmqpClient.h> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/gpu/gpu.hpp> #include <opencv2/opencv.hpp> #include <boost/lexical_cast.hpp> #include <boost/uuid/uuid_io.hpp> #include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid_generat...
3,145
1,082
#include "favicondownloader.h" #include <QUrl> #include <QNetworkAccessManager> #include <QNetworkReply> #include <QNetworkRequest> #include <QFileInfo> #include <QDir> FaviconDownloader::FaviconDownloader(QString iconPath, QString urlPath) { this->iconPath = iconPath; QUrl url = QUrl(urlPath); url.setPat...
1,861
656
#include <iostream> #include <cstdio> #include <cstring> #include <cassert> #include <cctype> using namespace std; typedef long long lint; #define cout cerr #define ni (next_num<int>()) template<class T>inline T next_num(){ T i=0;char c; while(!isdigit(c=getchar())&&c!='-'); bool neg=c=='-'; neg?c=getchar():0; whi...
2,407
1,492
// Copyright Carl Philipp Reh 2006 - 2019. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <sge/input/capabilities_field.hpp> #include <sge/input/processor.hpp> #include <sge/input/...
2,630
908
/** * Copyright Soramitsu Co., Ltd. 2017 All Rights Reserved. * http://soramitsu.co.jp * * Licensed under the Apache License, Version 2.0 (the "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/LICENS...
12,642
4,344
///////////////////////////////////////////////////////////// // // // Copyright (c) 2003-2017 by The University of Queensland // // Centre for Geoscience Computing // // http://earth.uq.edu.au/centre-geoscience-computing // // ...
2,481
743
//【P1968】美元汇率 - 洛谷 - 10 #include <iostream> #include <cstdio> #include <iomanip> #include <algorithm> struct Income { double dollar, mark; Income() {} } *f; int n, *a; void input() { std::cin >> n; a = new int[n + 1]; for (int i = 1; i <= n; ++i) { std::cin >> a[i]; } } int main() { input(); f = new Incom...
1,112
656
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PA...
2,158
668
#include "Tutorial01.h" int main( int argc, char ** argv ) { ApiWithoutSecrets::OS::Window window; ApiWithoutSecrets::Tutorial01 tutorial01; // window creation if(! window.Create("01-The Beginning") ) { return -1; } // Vulkan preparations and initialization if( !tutorial01.PrepareVulkan() ) { return ...
425
181
#ifndef LIBSTL_UTLITIES_STRING_HPP #define LIBSTL_UTLITIES_STRING_HPP #include <array> #include <string> #include <vector> namespace libstl { namespace utilities { namespace string { std::string erase(const std::string& string, const std::string& substring) { std::string s = string; return s.erase(string.f...
1,583
516
#include "LiveDelegate.hpp" #include "jet/live/CompileCommandsCompilationUnitsParser.hpp" #include "jet/live/DefaultProgramInfoLoader.hpp" #include "jet/live/DepfileDependenciesHandler.hpp" #include "jet/live/Utility.hpp" namespace jet { void LiveDelegate::onLog(LogSeverity, const std::string&) {} void LiveD...
2,148
613
#include<bits/stdc++.h> using namespace std; using LL = long long; int main(){ //freopen("in","r",stdin) std::ios::sync_with_stdio(false);std::cin.tie(nullptr); int n; cin>>n; LL a[n]; for(int i=0;i<n;++i) cin>>a[i]; sort(a,a+n); LL b[n]={LL(2e18)}; for(int i=1;i<n;++i) b[i] = a[i]-a[i-1]; sort(b,b+n); LL ...
620
363
#include "Hero.h" Hero::Hero(int attack, int defense, int life) { this->attack = attack; this->defense = defense; this->life = life; this->debuffAttack = 0; this->debuffDefense = 0; } Hero::~Hero() { }
209
94
// Hi, I'm Yanzhan. For more algothmic problems, visit my Youtube Channel (Yanzhan Yang's Youtube Channel) : https://www.youtube.com/channel/UCDkz-__gl3frqLexukpG0DA?view_as=subscriber or my Twitter Account (Yanzhan Yang's Twitter) : https://twitter.com/YangYanzhan or my GitHub HomePage (Yanzhan Yang's GitHub HomePage)...
938
311
// // Created by Jesson on 2020/7/18. // #include <cstdio> //#include <malloc.h> #include <cstdlib> #include "JavaObject.h" void objectRetain(JavaObject *obj) { obj->retainCount ++; printf("retain计数+1 = %d\n",obj->retainCount); } void objectRelease(JavaObject *obj) { obj->retainCount --; if (obj->r...
494
206
#pragma once namespace gfx { namespace generic { template <typename float_system> class range_space : public object { public: typedef float_system float_system_t; typedef typename float_system_t::float_t float_t; public: dynamic_reflectible(range_space, {}); }; } }
281
89
/* ************************************************************************************************* * * (c) Copyright 2019 Jonas Bjurel (jonasbjurel@hotmail.com) * * * * Licensed...
6,622
2,289
// Copyright 2020 The TensorStore Authors // // Licensed under the Apache License, Version 2.0 (the "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 ...
32,363
10,445
#include "zoo.h" #include <gtest/gtest.h> #include <iostream> using namespace std; class ZooTest : public ::testing::Test { protected: ZooTest(){} }; TEST(ZooTest, Test1) { string filename="map.txt"; Zoo Z; Z.ReadZoo(filename.c_str()); ASSERT_EQ(21,Z.GetWidth()); ASSERT_EQ(21,Z.GetLength()); cout<<"wi...
864
373
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "constant_of_shape.h" #include "core/providers/common.h" #include "gsl/gsl" using namespace ::onnxruntime::common; using namespace ONNX_NAMESPACE; namespace onnxruntime { namespace cuda { ONNX_OPERATOR_KERNEL_EX(...
1,819
640
#ifndef __CACHE_CPP #define __CACHE_CPP /*++ Copyright (C) 1996-2001 Microsoft Corporation Module Name: Thread.cpp Abstract: Enhancements to current functionality: Timeout mechanism should track across waits. AddRef/Release on task when scheduling. Enhancement Ticker logic. History: ...
20,770
7,468
#include "pushmi/o/just.h" #include "pushmi/o/on.h" #include "pushmi/o/transform.h" #include "pushmi/o/tap.h" #include "pushmi/o/via.h" #include "pushmi/o/submit.h" #include "pushmi/trampoline.h" #include "pushmi/new_thread.h" #include "pool.h" using namespace pushmi::aliases; struct countdownsingle { countdowns...
2,545
975
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "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 ...
35,044
12,860
/* * unimodal.cc * * Copyright (C) 2013 Diamond Light Source * * Author: James Parkhurst * * This code is distributed under the BSD license, a copy of which is * included in the root directory of this package. */ #include <boost/python.hpp> #include <boost/python/def.hpp> #include <dials/algorithms/image/t...
701
228
/* * Copyright (c) 2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "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 ...
6,668
2,031
#ifdef WIN32 #include "Core/IO/icFile.h" /*! Function converts ICE file modes to Microsoft flags * * @param u8Mode 8-bit mask of ICFILEMODE flags * @param[out] pAccess Pointer for access rights * @param[out] pCreateD Pointer for creation disposition * @param[out] pFandA Pointer for fl...
9,872
3,367
#include <bits/stdc++.h> using namespace std; int N, M, T; int main() { cin >> T; while(T--){ cin >> N >> M; vector<int> V; int sum = 0; for(int i = 1 ; i <= M ; i++){ int a; cin >> a; sum += a; V.push_back(a); ...
634
237
/* * Player - One Hell of a Robot Server * Copyright (C) 2000-2003 * Brian Gerkey * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at...
31,404
12,192
/** ** Copyright (c) 2011-2014 Illumina, Inc. ** ** This file is part of the BEETL software package, ** covered by the "BSD 2-Clause License" (see accompanying LICENSE file) ** ** Citation: Markus J. Bauer, Anthony J. Cox and Giovanna Rosone ** Lightweight BWT Construction for Very Large String Collections. ** ...
18,473
5,702
#include <QApplication> #include <QLabel> #include <QPixmap> int main(int argc, char **argv) { QApplication app(argc, argv); QLabel* lb = new QLabel("", 0); lb->setPixmap(QPixmap("mandrill.jpg")); lb->show(); return app.exec(); }
253
103
#include <fwog/Common.h> #include <fwog/Timer.h> #include <numeric> namespace Fwog { TimerQuery::TimerQuery() { glGenQueries(2, queries); glQueryCounter(queries[0], GL_TIMESTAMP); } TimerQuery::~TimerQuery() { glDeleteQueries(2, queries); } uint64_t TimerQuery::GetTimestamp() { int co...
2,575
900
// This code is based on Sabberstone project. // Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva // RosettaStone is hearthstone simulator using C++ with reinforcement learning. // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon #ifndef ROSETTASTONE_PLAYMODE_PLAY_HISTORY_HPP #define ROSETTA...
1,295
434
#include "Ball.h" using namespace std; void Ball::inputPos () { double xPos; double yPos; cin >> xPos; cin >> yPos; setXPos(xPos); setYPos(yPos); } void Ball::inputVel () { double xVel; double yVel; cin >> xVel; cin >> yVel; setXVel(xVel); setYVel(yVel); }
293
140
/* * RemoteAccessWidget.cpp - widget containing a VNC-view and controls for it * * Copyright (c) 2006-2021 Tobias Junghans <tobydox@veyon.io> * * This file is part of Veyon - https://veyon.io * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public Lic...
13,076
4,803
#include "ndarray.h" #include "ndatest.h" CPPUNIT_TEST_SUITE_REGISTRATION(NDATest); void NDATest::setUp() { } void NDATest::tearDown() { } void NDATest::testConstructor() { NDArray<uint32_t>::ShapeType shape = {2,2}; NDArray<uint32_t> ndarr(shape); CPPUNIT_ASSERT(ndarr.size() == 4); } void NDATest::testGett...
838
420
#include <llvmsym/llvmwrap/Instructions.h> #include <llvmsym/llvmwrap/Constants.h> #include <llvmsym/stanalysis/inputvariables.h> #include <llvmsym/cxa_abi/demangler.h> namespace { bool _is_nonconstant_pointer( const llvm::Value *val ) { return ( val->getType()->isPointerTy() && !llvm::isa< llvm::Con...
6,641
1,972
/**************************************************************************** * * Copyright (c) 2022 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistri...
3,224
1,113
#include "RawlogHelper.hpp" //MRPT redefinition so they work without using mrpt namepase (more general) #ifndef CLASS_ID_ #define CLASS_ID_(class_name, space_name) static_cast<const mrpt::utils::TRuntimeClassId*>(&space_name::class_name::class##class_name) #endif #ifndef IS_CLASS_ #define IS_CLASS_( ptrObj, c...
2,604
897
#include "d3.h" void Namespace::Function() {}
48
21
#include "incommingPacket.hpp" #include <cassert> namespace network { void IncommingPacket::reset() { assert(mHandled && "You are resetting a not handled packet!"); mPacket.clear(); mReadPos = 0; mHandled = false; } aw::uint8* IncommingPacket::reserve(size_t bytes) { mPacket.clear(); mPacket.writeToPayl...
475
181
#include <bits/stdc++.h> using namespace std; int main() { // #ifndef ONLINE_JUDGE // freopen("/home/shiva/Learning/1.txt", "r", stdin); // freopen("/home/shiva/Learning/2.txt", "w", stdout); // #endif int arr[10] = {0}; int t; cin >> t; long long b; string a; for (int x = 0; x < t; x++) { memset(arr, 0, sizeof...
613
311
/* * Copyright 1999-2019 Alibaba Cloud All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "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...
1,084
347
#pragma once #include <vector> #include <utility> #include <stdint.h> #include <limits.h> class Graph { public: Graph(uint32_t vertecies = 0) : graph(vertecies) { } void SetVertex(uint32_t vertex, std::vector<std::pair<uint32_t, uint32_t>> next) { graph[vertex] = std::move(next); } void AddEdgeToVertex(uin...
984
468
//================================================================== // Author : Pointner Sebastian // Company : Johannes Kepler University // Name : SMT Macro Placer // Workfile : components.hpp // // Date : 19. May 2020 // Compiler : gcc version 9.3.0 (GCC) // Copyright : Johanne...
828
248
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chromecast/device/bluetooth/le/le_scan_manager_impl.h" #include <algorithm> #include <utility> #include "base/stl_util.h" #include "chromecast...
4,746
1,546
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "unique_store_buffer_type.hpp" #include "unique_store_entry.h" namespace vespalib::datastore { template class BufferType<UniqueStoreEntry<int8_t>>; template class BufferType<UniqueStoreEntry<int16_t>>; t...
1,045
331
#include "msg_format.hpp" namespace nocc { using namespace nocc::util; namespace rtx { struct BatchOpCtrlBlock { char *req_buf_; char *req_buf_end_; char *reply_buf_; std::set<int> mac_set_; int batch_size_; inline BatchOpCtrlBlock(char *req_buf,char *res_buf) : batch_size_(0), req_buf_(re...
2,411
937
#include "zaf/actor_behavior.hpp" #include "zaf/actor_system.hpp" #include "gtest/gtest.h" namespace zaf { GTEST_TEST(ActorBehavior, Basic) { ActorSystem actor_system; ActorBehavior actor1; actor1.initialize_actor(actor_system, actor_system); ActorBehavior actor2; actor2.initialize_actor(actor_system, act...
1,115
418
/* * Copyright (c) 2016 Primo Software. All Rights Reserved. * * 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. */ #include "stdafx.h" #include "util.h" #include "options.h" using namespace primo::codecs; usi...
4,619
1,600
// Copyright 2009-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 #include "Importer.h" #include "sg/visitors/PrintNodes.h" #include "../JSONDefs.h" namespace ospray { namespace sg { OSPSG_INTERFACE std::map<std::string, std::string> importerMap = { {"obj", "importer_obj"}, {"gltf", "importer_...
6,590
1,952
#include <assert.h> bool vitalsRangeIsOk(float value,int lowerLimit,int upperLimit) { return (value >= lowerLimit && value <= upperLimit); } bool vitalsAreOk(float bpm, float spo2, float respRate) { return (vitalsRangeIsOk(bpm,70,150) && vitalsRangeIsOk(spo2,90,100) && vitalsRangeIsOk(respRate,30,95)); }...
639
291
#include <CtrlLib/CtrlLib.h> #include <RichText/RichText.h> #include <Web/Web.h> using namespace Upp; #define TOPICFILE <RichHtml/tst.tpp/all.i> #include <Core/topic_group.h> GUI_APP_MAIN { Index<String> css; VectorMap<String, String> links; String qtf = GetTopic("topic://RichHtml/tst/Topic$en-us"); String html ...
514
213
#include <bits/stdc++.h> void rotate(std::vector<std::vector<int> > &A) { // Do not write main() function. // Do not read input, instead use the arguments to the function. // Do not print the output, instead return values as specified // Still have a doubt. Checkout www.interviewbit.com/pages/sample_co...
774
295
#include <fstream> // ifstream #include <iostream> // cout #include <string> // string, stoi #include <string_view> // string_view #include <chrono> // high_resolution_clock, duration_cast, nanoseconds #include <sstream> // stringstream #include <vector> // подключаем алгоритм #include "algo...
2,784
935
/* ------------------------------------------------------------------------------------------ Copyright (c) 2014 Vinyl Games Studio Author: Mikhail Kutuzov Date: 10/7/2014 5:45:48 PM ------------------------------------------------------------------------------------------ */ #include "Stats.h...
2,128
651
#include "FileUtil.h" #include "StringUtil.h" #include "FindSettings.h" namespace cppfind { FindSettings::FindSettings() { m_in_archiveextensions = {}; m_in_archivefilepatterns = {}; m_in_dirpatterns = {}; m_in_extensions = {}; m_in_filepatterns = {}; m_in_filetypes ...
9,191
2,915
// Copyright (c) 2021 Thomas Kaldahl #include "qecvec.hpp" // Constructors Vec3f::Vec3f( float x, float y, float z ) { this->x = x; this->y = y; this->z = z; } Vec3f::Vec3f(float val) : Vec3f(val, val, val) {} Vec3f::Vec3f() : Vec3f(0) {} Vec3f::Vec3f(Vec2f v, float z) : Vec3f(v.x, v.y, z) {} Vec3f::Vec3f(flo...
3,190
1,494
/*** *mbsdec.c - Move MBCS string pointer backward one charcter. * * Copyright (c) Microsoft Corporation. All rights reserved. * *Purpose: * Move MBCS string pointer backward one character. * *******************************************************************************/ #ifndef _MBCS #error This file...
3,806
1,104
#include <iostream> #include <vector> #include <algorithm> using namespace std; int smallest = 0; int largest = 0; void max_heapify(vector<int> &v, int i, int *n) { int left = 2*i; int right = 2*i+1; if(left <= *n && v[left] > v[i]) largest = left; else largest = i; if(right <= *n && v[right] > v[largest]) ...
1,678
874
/////////////////////////////////////////////////////////////////////////////////////////////////// // // Idlib: A C++ utility library // Copyright (C) 2017-2018 Michael Heilmann // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any dama...
4,785
2,228
#ifndef HPP_LUA_OBJECT #define HPP_LUA_OBJECT #include <string> #include <memory> #include "xd/vendor/sol/forward.hpp" class Lua_Object { public: Lua_Object(); virtual ~Lua_Object(); void set_lua_property(const std::string& name, sol::stack_object value); sol::main_object get_lua_property(...
446
167
#include <cstdio> #include <string> #include <map> using namespace std; typedef long long ll; int main(){ map<char, int> charPrice; char artLine[10100]; int T; scanf("%d\n", &T); int N; ll totalCents; while(T--){ totalCents=0; charPrice.clear(); ...
838
283
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. #include "content/public/common/url_constants.h" namespace chrome { // Used by ClearOnExitPolicy const char kHttpScheme[] = "http...
507
161
#include "Encoder.h" #define CURRENT_VERSION 1 Encoder::Encoder() : gem::Encoder(CURRENT_VERSION) { } gem::ConfigTable Encoder::GetDefault() const { gem::ConfigTable defaultConfig; defaultConfig.SetValue("version", CURRENT_VERSION); // Any default values for a new asset can be added to metadata here. return d...
1,000
316
#include <FEM/FEM1DApp.hpp> Float StaticFEM1DApp::GradientSelfInnerProduct(int i, int j) { std::vector<int> i_id, j_id; auto i_mesh = IdxToMesh(i, i_id); auto j_mesh = IdxToMesh(j, j_id); Float ret = 0; for (int a = 0; a < i_mesh.size(); ++a) { for (int b = 0; b < j_mesh.size(); ++b) { if (i_mesh[a] == ...
3,742
1,874
// smtc_PrintNsFuncDefn.cpp // #include "smtc_PrintNsFuncDefn.h" // semantic #include "smtc_FuncDefn.h" #include "smtc_IsNameQual.h" #include "smtc_IsNsEnclUnmd.h" #include "smtc_Output.h" #include "smtc_PrintFuncDefn.h" // config #include "conf_Config.h" #define LZZ_INLINE inline namespace { using namespace smtc; ...
2,396
881
// Copyright 2022 Open Source Robotics Foundation, Inc. // // Licensed under the Apache License, Version 2.0 (the "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 appli...
33,476
11,682
// // chaoticOscillator.cpp // example-basic // // Created by Eduard Frigola Bagué on 02/03/2020. // #include "chaoticOscillator.h" void chaoticOscillator::setup(){ color = ofColor(0, 200, 255); oldPhasor = vector<float>(1, 0); seedChanged = vector<bool>(true); baseChOsc.resize(1); result.resiz...
8,056
2,824
#include "common.h" #include "sdl_viewer.h" #include "image.h" constexpr int w = 640; constexpr int h = 480; int main(void) { SDLViewer viewer("Hello World", w, h); Image img(w, h); img.SetAll({248, 240, 227}); // Honda championship white background bool quit = false; int i = 0; while (!quit) { /...
709
300
/* * Copyright (c) 2015, msyksphinz * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditi...
3,757
1,465
#include "binaryninjaapi.h" using namespace BinaryNinja; using namespace std; class LinuxX86Platform: public Platform { public: LinuxX86Platform(Architecture* arch): Platform(arch, "linux-x86") { Ref<CallingConvention> cc; cc = arch->GetCallingConventionByName("cdecl"); if (cc) { RegisterDefaultCalling...
9,001
3,368
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int T; cin>>T; while(T--) { int n1,n2; cin>>n1>>n2; int arr1[n1],arr2[n2]; for(int i=0;i<n1;i++) { cin>>arr1[i]; } for(int i=0;i<n2;i++) { ci...
593
290