text
string
size
int64
token_count
int64
/* * PROGRAM: Decimal 64 & 128 type. * MODULE: DecFloat.cpp * DESCRIPTION: Floating point with decimal exponent. * * The contents of this file are subject to the Initial * Developer's Public License Version 1.0 (the "License"); * you may not use this file except in compliance with the * License. You may ...
24,442
10,410
#include "shortest_path_graphics_item.h" #include "algorithms/controlled_dijkstra_algorithm.h" #include "graph/graph.h" #include "graph/node.h" #include "functions.h" #include "colors.h" #include <QGraphicsScene> static const qreal Y_SPACING = 1.2; // same as vtable_graphics_item.cpp ShortestPathGraphicsItem::Shorte...
2,037
682
#include <iostream> #include <string> #include <vector> using namespace ::std; class Solution { public: bool divisorGame(int N) { //N=1 必败 //N=2 必胜 //本题有数学证明,但个人想用动归解 //return N%2==0; //dp为1维,找到<i 的false(必输局面即可获胜)若找不到,则必输 //状态转换公式为:i % j == 0 && f[i - j] == false...
705
300
/* ** JointLoadMeasure.cpp ** ** Copyright (C) 2013-2019 Thomas Geijtenbeek and contributors. All rights reserved. ** ** This file is part of SCONE. For more information, see http://scone.software. */ #include "JointLoadMeasure.h" #include "scone/model/Model.h" namespace scone { JointLoadMeasure::JointLoadMeasure( ...
1,161
429
// Ivan Carvalho // Solution to https://www.spoj.com/problems/TWOPATHS/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e5 + 10; vector<int> grafo[MAXN]; int maior_dist[MAXN][3],maior_diam[MAXN][2]; int temporario_diametro[MAXN],temporario_dist[MAXN],N; ll melhor_produto; void calc...
2,870
1,517
// This file is part of the dune-xt-la project: // https://github.com/dune-community/dune-xt-la // Copyright 2009-2018 dune-xt-la developers and contributors. All rights reserved. // License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) // or GPL-2.0+ (http://opensource.or...
20,328
7,801
#include "texture_sampler.hpp" #include "utils.hpp" namespace my_vulkan { texture_sampler_t::texture_sampler_t(VkDevice device, filter_mode_t filter_mode) : _device{device} { VkFilter filter; switch(filter_mode) { case filter_mode_t::linear: filter = VK_F...
2,277
801
//#pragma once //#pragma execution_character_set("utf-8") //#pragma warning (disable:4819) #include "dialog.h" #include "ui_dialog.h" #include <QMessageBox> #include <QProcess> #include <QDir> #include <string> #include <iostream> #include <QUrl> #include <QTextBlock> #include <QTextCursor> #include <QFileDialog> #i...
13,275
4,764
/* epoll_test.cc Wolfgang Sourdeau, 17 November 2014 Copyright (c) 2014 Datacratic. All rights reserved. Assumption tests for epoll */ #define BOOST_TEST_MAIN #define BOOST_TEST_DYN_LINK #include <fcntl.h> #include <unistd.h> #include <sys/epoll.h> #include <atomic> #include <iostream> #include <thread> ...
5,624
2,153
/* Implementation of LCS problem using Dynamic Programming*/ #include <bits/stdc++.h> using namespace std; void lcs(string X, string Y){ int m = X.length(); int n = Y.length(); int L[m+1][n+1]; for (int i=0; i<=m; i++){ for (int j=0; j<=n; j++){ if (i == 0 || j == 0) L[i][j] = 0; else...
887
434
#include "steamwrap.h" /* vdynamic *CallbackHandler::EncodeDownloadItem(int *d) { return nullptr; } vdynamic *CallbackHandler::EncodeItemInstalled(int *d) { return nullptr; } */ HL_PRIM varray *HL_NAME(get_subscribed_items)(){ printf("%s\n", __func__); return nullptr; } HL_PRIM int HL_NAME(get_item_state)(vuid ...
8,227
3,312
#include "FontType.hpp" #include <tiny_msdf.hpp> #include <ft2build.h> #include FT_FREETYPE_H #include "Files/Files.hpp" #include "Resources/Resources.hpp" #include "Graphics/Graphics.hpp" namespace acid { static const std::wstring_view NEHE = L" \t\r\nABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"...
3,617
1,471
/* 求四名同学在三次考试中的成绩 */ #include <stdio.h> void mat_add(const int a[4][3], const int b[4][3], int c[4][3]); void mat_print(const int m[4][3]); int main(void) { int sore1[4][3] = { {23, 13,23}, {23, 67, 89}, {34, 56, 67}, {89,98, 32} }; int sore2[4][3] = { {93, 43,33}, {23, 63, 82}, {34, 66, 87}, {69,93, 39} }; ...
855
528
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: prio/jni/message.proto #include "prio/jni/message.pb.h" #include <algorithm> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/extension_set.h> #include <google/protobuf/wire_format_lite.h> #include <google/protobuf/descripto...
45,431
16,435
// Copyright 2014 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 "google_apis/gaia/ubertoken_fetcher.h" #include <vector> #include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "base/ra...
4,961
1,625
// 2021 John Lees, Gerry Tonkin-Hill, Zhirong Yang // See LICENSE files #include "pairsnp.hpp" #include "sound.hpp" #include "wtsne.hpp" #include <pybind11/stl.h> namespace py = pybind11; PYBIND11_MODULE(SCE, m) { m.doc() = "Stochastic cluster embedding"; m.attr("version") = VERSION_INFO; // Results class (ne...
3,273
1,222
#pragma once #ifndef BE_CORE_VERSION_HPP_ #define BE_CORE_VERSION_HPP_ #include "macros.hpp" #define BE_CORE_VERSION_MAJOR 0 #define BE_CORE_VERSION_MINOR 1 #define BE_CORE_VERSION_REV 32 /*!! include('common/version', 'BE_CORE', 'bengine') !! 6 */ /* ################# !! GENERATED CODE -- DO NOT MODIFY !! #########...
897
367
/**************************************************************************** Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org 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 Sof...
26,546
8,467
/* Ray3D.cpp Written by Matthew Fisher a 3D ray represented by an origin point and a direction vector. */
106
35
// Generated by Haxe 4.1.4 #include <hxcpp.h> #ifndef INCLUDED_IntIterator #include <IntIterator.h> #endif #ifndef INCLUDED_Reflect #include <Reflect.h> #endif #ifndef INCLUDED_Std #include <Std.h> #endif #ifndef INCLUDED_Type #include <Type.h> #endif #ifndef INCLUDED_haxe_Exception #include <haxe/Exception.h> #endif ...
87,738
46,235
/* * Copyright 2014 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "gm.h" #include "SkMatrixImageFilter.h" #include "SkRandom.h" #define WIDTH 640 #define HEIGHT 480 #define RESIZE_FACTOR SkIntToScalar(2) namespace skiagm { class...
2,451
771
/** * @file */ #include "src/visitor/ScopedModifier.hpp" birch::ScopedModifier::ScopedModifier(Package* currentPackage, Class* currentClass) : ContextualModifier(currentPackage, currentClass), inMember(0), inGlobal(0) { if (currentPackage) { scopes.push_back(currentPackage->scope); if (curr...
3,998
1,567
// Copyright (c) 2015-present, Qihoo, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. #include <unistd.h> #inclu...
3,380
1,733
/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman 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) AUTOGENERATED. DO NOT EDIT!!! ======...
34,122
30,771
#include <iostream> #include <map> using namespace std; map<string, string> s; string represent(string n1) { if (s[n1].empty() || s[n1] == n1) { s[n1] = n1; } else { s[n1] = represent(s[n1]); } return s[n1]; } void merge(string n1, string n2) { s[represent(n1)] = represent(n2); }...
677
287
// Copyright by Contributors #include <xgboost/metric.h> #include "../helpers.h" TEST(Metric, UnknownMetric) { EXPECT_ANY_THROW(xgboost::Metric::Create("unknown_name")); EXPECT_NO_THROW(xgboost::Metric::Create("rmse")); EXPECT_ANY_THROW(xgboost::Metric::Create("unknown_name@1")); EXPECT_NO_THROW(xgboost::Metr...
348
148
/** * @file Scalar.hpp * * Defines conversion of matrix to scalar. * * @author James Goppert <james.goppert@gmail.com> */ #pragma once #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include <math.h> #include "math.hpp" namespace matrix { template<typename Type> class Scalar {...
737
294
#include "../SDK/foobar2000.h" #include "SoundTouch/SoundTouch.h" #include "dsp_guids.h" #define MYVERSION "0.42" static pfc::string_formatter g_get_component_about() { pfc::string_formatter about; about << "A special effect DSP for foobar2000.\n"; about << "Written by mudlord (mudlord@protonmail.com).\n"; about <...
767
303
#include "Context.h" #include "OpenGLContext/opengl_ContextImpl.h" using namespace graphics; Context gfxContext; bool Context::Multisampling = false; bool Context::BlitFramebuffer = false; bool Context::WeakBlitFramebuffer = false; bool Context::DepthFramebufferTextures = false; bool Context::ShaderProgramBinary = f...
7,804
2,657
#include <bits/stdc++.h> #define each(i, c) for (auto& i : c) #define unless(cond) if (!(cond)) using namespace std; typedef long long int lli; typedef unsigned long long ull; typedef complex<double> point; template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first <<...
975
441
/* Hanoh Haim Cisco Systems, Inc. */ /* Copyright (c) 2015-2015 Cisco Systems, 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 require...
14,532
5,040
#include <Bindings/obe/Input/Input.hpp> #include <Input/InputAction.hpp> #include <Input/InputButton.hpp> #include <Input/InputButtonMonitor.hpp> #include <Input/InputButtonState.hpp> #include <Input/InputCondition.hpp> #include <Input/InputManager.hpp> #include <Input/InputType.hpp> #include <Bindings/Conf...
11,207
3,109
/** * @file MeterTeros11.cpp * @copyright 2020 Stroud Water Research Center * Part of the EnviroDIY ModularSensors library for Arduino * @author Written By: Anthony Aufdenkampe <aaufdenkampe@limno.com> * Edited by Sara Geleskie Damiano <sdamiano@stroudcenter.org> * * @brief Implements the MeterTeros11 class. */...
4,229
1,501
// Copyright (c) 2012 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 "chrome/browser/service_process/service_process_control.h" #include <utility> #include "base/bind.h" #include "base/bind_helpers.h" #includ...
13,675
4,275
// Copyright 2021 The WebNN-native 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 ...
53,797
16,792
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'diagonalDifference' function below. * * The function is expected to return an INTEGER. * The function accepts 2D_INTEGER_ARRAY arr as parameter. */ ...
2,217
832
#include <iostream> #include <string> void answer(const std::string& v) { std::cout << v << '\n'; } void solve(std::string& a) { const size_t n = a.length(); size_t i = 0; while (i < n && a[i] == '1') ++i; if (i == n) a.pop_back(); else a.erase(i, 1); answer(a); ...
407
177
// Copyright (c) 2018 Microsoft Corporation // Licensed under the MIT license. // Author: Paul Koch <code@koch.ninja> #include "PrecompiledHeader.h" #include "ebm_native.h" // IntEbmType #include "EbmInternal.h" // INLINE_ALWAYS #include "RandomStream.h" // I generated these as purely random numbers from 0 to 2^64-1...
7,185
3,646
#include "Board.hpp" #include "Zobrist.hpp" #include "Rook.hpp" #include "Bishop.hpp" #include "Queen.hpp" #include "Knight.hpp" #include "King.hpp" #include "Pawn.hpp" #include <iostream> #include <stdexcept> #include <iomanip> #include <sstream> /// Defines the number of squares the king travels to cast...
35,596
11,288
// Copyright 2014 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 "sandbox/mac/os_compatibility.h" #include <servers/bootstrap.h> #include <stddef.h> #include <stdint.h> #include <unistd.h> #include "base/logg...
5,971
2,233
// Copyright (c) 2012 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 "extensions/browser/api/web_request/web_request_api_helpers.h" #include <stddef.h> #include <stdint.h> #include <algorithm> #include <cmath...
67,660
19,610
#pragma once #include <forward_list> #include <memory> namespace nonstd { template<typename T> class memory_pool { public: using size_type = std::size_t; static constexpr auto default_page_size = 512u; private: union block { alignas(T) cha...
3,048
909
#include "check_mem.h" #include "mem_access.h" //#include "list.h" void print_num_of_readers(MemAccess_t *mem) { uint32_t counter = 0; while (mem != NULL) { counter++; mem = mem->next; } fprintf(stderr, "# of readers: %u\n", counter); } void report_race() { // to-do: report race here } void handle_write(...
5,700
2,121
/// source: KACTL // ways to permute v[i] ll multinomial(vi &v) { ll c = 1, m = v.empty() ? 1 : v[0]; for (int i = 1; i < v.size(); i++) for (int j = 0; i < v[i]; j++) c = c * ++m / (j + 1); return c; }
214
108
/* * invokehelper.cpp * * Created on: 2016/02/15 * Author: CORDEA */ #include <src/invokehelper.h> #include <bb/system/InvokeRequest> #include <bb/system/InvokeManager> using namespace bb::system; InvokeHelper::InvokeHelper(QObject *parent) : QObject(parent) { // TODO Auto-generated construct...
621
215
#include "stdafx.h" #include "oepOGRFeatureSourceOptions.h" using namespace gEarthPack; using namespace osgEarth::Drivers; oepOGRFeatureSourceOptions::oepOGRFeatureSourceOptions() { bind(new OGRFeatureOptions(),true); } void gEarthPack::oepOGRFeatureSourceOptions::binded() { _geometryConfig = gcnew oepConfig(); ...
3,064
1,134
// Copyright 2014 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. // This file implements the native methods of // org.content.chromium.app.LinkerTests // Unlike the content of linker_jni.cc, it is part of the content li...
6,064
1,873
/* 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, modify, merge, publish, distribute, sublicense, and/or sell copies of t...
8,949
3,929
#include <map> #include <string> #include <vector> // TODO make this a map so one can give a dict in python struct bunchParameters { // bucket number int bucket; // atomic mass number double atomNumber; // particle charge int charge; // number of macro particle to use int nMacro; // real number of pa...
2,112
681
// Copyright 2020 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/platform/mojo/heap_mojo_associated_receiver.h" #include "base/test/null_task_runner.h" #include "mojo/public/cpp/bind...
7,847
2,448
#include "LittleFile1.hpp" #include <limits> #include <stdexcept> #include <system_error> #include "LittleFSErrorCategory.hpp" LittleFile1::LittleFile1(lfs1_t & filesystem, std::string const & path, int flags) : _filesystem(&filesystem), _file(), _open(false) { auto const result = lfs1_file_open(_fi...
2,149
789
// // "$Id: BarGroup.cxx 5895 2007-06-08 18:17:53Z spitzak $" // // Copyright 1998-2006 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public // License as published by the Free Software Foundation; either // versio...
4,887
1,880
#include "stdafx.h" #include "Test_Registry.h" #include "TUtils.h" #include "TConstants.h" using namespace std; using namespace WinReg; using namespace TConst; TEST_F(Test_Registry_SetSBinaryValue, when_calling_setbinaryvalue_with_valid_parameters_values_expect_no_exception) { try { Registry::SetBinaryValue(eHKey...
1,764
771
#include <bits/stdc++.h> using namespace std; int main() { int i,j; for (i = 7; i >=1; i--) { for (j = 1; j <= i; j++) { cout<<'S'; } cout<<endl; } for(i = 2; i <= 7; i++) { for (j = 1;j <= i; j++) { cout<<'...
367
150
#include "omnicore/mdex.h" #include "omnicore/errors.h" #include "omnicore/log.h" #include "omnicore/omnicore.h" #include "omnicore/rules.h" #include "omnicore/sp.h" #include "omnicore/tx.h" #include "omnicore/uint256_extensions.h" #include "arith_uint256.h" #include "chain.h" #include "tinyformat.h" #include "uint25...
93,533
33,172
#include "nau/geometry/box.h" #include "nau/math/vec3.h" #include "nau/geometry/vertexData.h" #include "nau/material/materialGroup.h" using namespace nau::geometry; using namespace nau::math; using namespace nau::render; using namespace nau::material; Box::Box(void) : Primitive() { float n = 1.0f; std::shared_...
11,050
5,944
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "gm.h" #include "Resources.h" #include "SkCodec.h" #include "SkColorSpace_Base.h" #include "SkImage.h" #include "SkImagePriv.h" sk_sp<SkImage> make_raster_image(cons...
3,616
1,278
#include "./INCLUDE/Segment.h" #include "./INCLUDE/LKH.h" /* The Improvement function is used to check whether a done move * has improved the current best tour. * If the tour has been improved, the function computes the penalty gain * and returns 1. Otherwise, the move is undone, and the function returns 0. */ i...
1,129
421
#ifndef KERNELS_BACKEND_CUDA_IMAGE_HPP #define KERNELS_BACKEND_CUDA_IMAGE_HPP #include "kernels/backend/common/image.hpp" namespace nova { using image2d_read_t = cudaTextureObject_t; using image2d_write_t = cudaSurfaceObject_t; using image2d_array_read_t = cudaTextureObject_t; template <typename W, AddressMode A = ...
1,513
568
// Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. // Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the Licens...
16,690
5,650
#include "DQM/EcalCommon/interface/MESetMulti.h" namespace ecaldqm { MESetMulti::MESetMulti(MESet const& _seed, ReplCandidates const& _replCandidates) : MESet(_seed), current_(0), sets_(), replCandidates_(_replCandidates) { PathReplacements replacements; std::map<std::string, unsigned> indi...
4,904
1,836
#include <Windows.h> #include <stdio.h> #include <stdlib.h> //####USING#### #pragma comment(lib, "ntdll") //####DEFINE#### //####CODE#### int Inject(int pid) { const unsigned char raw[] = ####SHELLCODE####; int length = sizeof(raw); unsigned char* encoded = (unsigned char*)malloc(sizeof(unsigned char) * length...
1,855
690
// -*-c++-*- /*! \file say_message_parser.cpp \brief player's say message parser Source File */ /* *Copyright: Copyright (C) Hidehisa AKIYAMA This code is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Found...
46,915
15,880
/* * GeneralFileReader_compatibility.h * * Created on: Mar 16, 2010 * Author: dberrios */ #include "GeneralFileReader_f.h" #include <ccmc/wrappers/c/GeneralFileReader_c.h> #include <ccmc/GeneralFileReader.h> #include <ccmc/Kameleon.h> #include <string> #include <string.h> #include <iostream> using namespace...
2,195
749
// ================================================================ // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved // ================================================================ // ================================================================ // Given a pair of `.tmk` files (see sectio...
2,907
1,011
///////////////////////////////////////////////////////////////////////////// // Name: src/common/checkboxcmn.cpp // Purpose: wxCheckBox common code // Author: Julian Smart // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence //...
3,188
1,085
// This is a part of the Microsoft Foundation Classes C++ library. // Copyright (C) Microsoft Corporation // All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sourc...
4,805
1,567
/* * Copyright 2021 Aaron Bamberger * Licensed under BSD 2-clause license * See LICENSE file at root of source tree, * or https://opensource.org/licenses/BSD-2-Clause */ #ifndef _CREATION_DATE_ATTRIBUTE_H #define _CREATION_DATE_ATTRIBUTE_H #include "Attributes/StandardAttribute.hh" #include "Util/ValueWithLocati...
1,329
514
#include <iostream> using namespace std; int main(int argc, char** argv) { int number = 5; int* pNumber = &number; cout << "The value of number: " << number << "\n"; cout << "The address of number: " << &number << "\n"; number++; cout << "The value of number after first increasing: " << number << "\n"; cout <<...
573
182
/* $Id$ */ /* * This file is part of OpenTTD. * OpenTTD 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, version 2. * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without...
2,848
1,122
// MusicXML Class Library // Copyright (c) by Matthew James Briggs // Distributed under the MIT License #include "../impl/EncodingFunctions.h" #include "../core/Date.h" #include "../core/elements/Encoder.h" #include "../core/elements/Encoding.h" #include "../core/elements/Encoding.h" #include "../core/elements/Encodin...
7,956
1,773
<?hh // partial namespace Test\DBAL; use Decouple\Test\TestCase; use Decouple\DBAL\DPDO\DPDOMySQLDriver; use Decouple\Common\Contract\DB\Schema; class SchemaTest extends TestCase { public function execute() : void { $driver = new DPDOMySQLDriver(); $connected = $driver->connect(Map { "dbname" => "decoup...
584
199
/* * Copyright (C) 2009 Advanced Micro Devices, Inc. All Rights Reserved. */ /* Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the F...
10,353
3,949
#include <Servo.h> #include "Arduino.h" #include "./Robot.h" #define IR A3 // define signal pin #define MOTOR1 {8, 9, 10} #define MOTOR2 {7, 6, 5} Robot robot(IR, 3, MOTOR1, MOTOR2); void setup () { Serial.begin(9600); // setup serial robot.Init(); } void loop () { robot.Act(); delay(50); } ...
1,403
557
#include <SepantaFollow.h> actionlib::SimpleActionClient<sepanta_msgs::MasterAction> * ac; SepantaFollowEngine::SepantaFollowEngine() : App_exit(false), _thread_Logic(&SepantaFollowEngine::logic_thread,this), _thread_10hz_publisher(&SepantaFollowEngine::scan10hz_thread,this), it(nh) { init(); } SepantaFollowEng...
9,401
3,368
#include "bits/stdc++.h" using namespace std; const std::pair<int, int> moves[] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}}; /* for(auto [dx, dy]: moves) { // Here nr and nc are what comes into the queue - i & j dx += nr; dy += nc; } */ vector<vector<int>> getNeighbours(int r, int c, int R, int C) { vect...
1,215
496
// Copyright Nathaniel Christen 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 "application-model/application-config-model.h" #include "config-dialog/config-dialog.h" #inc...
2,072
894
#include "include/tencent_trtc_cloud/tencent_trtc_cloud_plugin.h" // This must be included before many other Windows headers. #include <windows.h> // For getPlatformVersion; remove unless needed for your plugin implementation. #include <VersionHelpers.h> #include <flutter/method_channel.h> #include <flutter/plugin_re...
16,303
5,528
/**************************************************************************************** * @author: kzvd4729 created: Jul/09/2019 19:04 * solution_verdict: Time limit exceeded on test 3 language: GNU C++14 * run...
1,468
680
//-------------------------------------------------- // Atta Math // matrix.inl // Date: 2021-04-09 // By Breno Cunha Queiroz //-------------------------------------------------- namespace atta { template <typename T> matrix<T>::matrix(size_t _nrows, size_t _ncols): nrows(_nrows), ncols(_ncols) { ...
4,813
1,726
#include <sstream> #include "file_interpreter.hpp" #include "interpreter.hpp" using namespace cuttle; namespace fs = boost::filesystem; void fileui::interpret_file(compile_state_t &state, vm::context_t &context, const fs::path &file_path, std::deque<vm::value_t> &arg_stack) { if (state.cached_files.count(file_pa...
901
290
// 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 you under the Apache License, Version 2.0 (the // "License"); you may...
5,854
1,928
//----------------------------------- // Copyright Pierric Gimmig 2013-2017 //----------------------------------- #include "ConnectionManager.h" #include "TcpClient.h" #include "TcpServer.h" #include "TimerManager.h" //----------------------------------------------------------------------------- ConnectionManager::Co...
1,952
474
/* ** EPITECH PROJECT, 2019 ** bomberman ** File description: ** Bedrock.hpp */ #ifndef BOMBERMAN_BEDROCK_HPP #define BOMBERMAN_BEDROCK_HPP #include "../Entity.hpp" namespace ECS { class Bedrock : public Entity { public: explicit Bedrock(unsigned id, Ressources &ressources); }; } #endif //BOMBERMAN_BEDROCK_H...
323
137
//$Id$ //------------------------------------------------------------------------------ // ClassName //------------------------------------------------------------------------------ // GMAT: General Mission Analysis Tool // // Copyright (c) 2002 - 2015 United States Government as represented by ...
21,461
5,178
// Implementation of Andrew's monotone chain 2D convex hull algorithm. #include <algorithm> #include <vector> using namespace std; typedef int coord_t; // coordinate type typedef long long coord2_t; // must be big enough to hold 2*max(|coordinate|)^2 struct Point { coord_t x, y; bool operator <(const P...
1,377
574
// Copyright (C) 2018-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #pragma once #include <ngraph/function.hpp> #include "template_config.hpp" #include "template_infer_request.hpp" #include "template_async_infer_request.hpp" #include <cpp_interfaces/impl/ie_executable_network_thread_safe_default....
2,218
597
#include "bytearray.h" #include "endian.h" #include "log.h" #include "socket.h" #include <cmath> #include <cstddef> #include <cstdint> #include <cstring> #include <endian.h> #include <fstream> #include <iomanip> #include <memory> #include <sstream> #include <stdexcept> #include <string> namespace cool { static cool::...
13,625
5,867
// =========================================================================== // This is an open source non-commercial project. // Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: // http://www.viva64.c...
966
271
#include "../header/world.h" #include "../header/WorldProgram/sphereProgram.h" #include "../header/WorldProgram/triangleProgram.h" #include "../header/Shape/shape.h" #include "../header/Math/intersection.h" World::World(const glm::vec3& color) { backgroundColor = color; } World::~World() { for (const ShapeProgram* ...
5,263
1,950
// https://codeforces.com/contest/1253/problem/E #include <bits/stdc++.h> using namespace std; using ii = tuple<int, int>; using vi = vector<int>; using vii = vector<ii>; int main() { int n, m, x, s, l, r; cin >> n >> m; vii a(n); for (int i = 0; i < n; i++) { cin >> x >> s; a[i] = { x - s, x + s }; ...
666
330
../../../recipe-07/cxx-example/src/main.cpp
43
19
/** * Copyright 2019 Huawei Technologies 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...
7,461
2,647
#include "DenoiseSystem.h" #include "../Components/DenoiseData.h" #include <_deps/imgui/imgui.h> #include <spdlog/spdlog.h> #include <cmath> #include <algorithm> using namespace Ubpa; void DenoiseSystem::OnUpdate(Ubpa::UECS::Schedule& schedule) { schedule.RegisterCommand([](Ubpa::UECS::World* w) { auto data = w...
4,944
2,535
/* * Copyright (C) 2012 Google Inc. 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 conditio...
5,331
1,763
#include "lxgui/gui_statusbar.hpp" #include "lxgui/gui_frame.hpp" #include "lxgui/gui_manager.hpp" #include "lxgui/gui_texture.hpp" #include "lxgui/gui_out.hpp" #include "lxgui/gui_alive_checker.hpp" #include "lxgui/gui_uiobject_tpl.hpp" #include <sstream> namespace lxgui { namespace gui { std::array<flo...
9,667
3,540
#ifndef INCLUDE_APG_CORE_APGCOMMON_HPP_ #define INCLUDE_APG_CORE_APGCOMMON_HPP_ #include <memory> #include <glm/vec2.hpp> #include <glm/vec4.hpp> namespace APG { struct Vertex { float x; float y; float c; float u; float v; }; static constexpr const int VERTEX_SIZE = 5; namespace internal { static constexpr...
564
243
#include<iostream> using namespace std; long long used[100]={0},n,a[100]={0},c[100]={0},i; string s; void PL(int k) { int i; if(k>n) {for(i=1;i<k;i++)cout<<a[i]<<" ";cout<<endl;return;} for(i=1;i<=n;i++) { if(used[i]==0) { a[k]=c[i]; used[i]=1; PL(k+1); used[i]...
454
239
// Copyright 2017 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 "flutter/flow/matrix_decomposition.h" namespace flow { static inline SkVector3 SkVector3Combine(const SkVector3& a, ...
3,837
1,718
#include <cedar/3d/mpi/plane_mempool.h> #include <cedar/3d/mpi/plane_mpi.h> #include <cedar/3d/mpi/relax_planes.h> namespace cedar { namespace cdr3 { namespace mpi { template<relax_dir rdir> std::shared_ptr<grid_topo> planes<rdir>::slice_topo(const grid_topo & topo3) { auto igrd = std::make_shared<std::vector<len_t...
8,608
3,756