text
string
size
int64
token_count
int64
// // PostTreatUtils.cpp // MNNConverter // // Created by MNN on 2019/01/31. // Copyright © 2018, Alibaba Group Holding Limited // #include "PostTreatUtils.hpp" #include <iostream> using namespace MNN; static bool _OpNeedContent(OpType type, int index) { switch (type) { case OpType_Shape: case ...
38,240
12,380
// Copyright 2010-2016, 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 condit...
6,076
2,641
#include <fstream> #include <iostream> #include <string> #include <vector> #include "../Header/DotCloud.h" using namespace std; using namespace dt; vector<Vector3D*> DotCloudReader::GetDotCloud() { vector<Vector3D*> dots = vector<Vector3D*>(); string filename; cout << "Enter name of file in resource dire...
787
288
// 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 "net/http/transport_security_state.h" #include <algorithm> #include <memory> #include <string> #include <vector> #include "base/base64.h" #...
143,462
49,602
#include <iostream> #include "validate.h" #include "ogr_spatialref3D.h" using namespace std; void proj_mgi_to_geoc_etrs() { double *r0 = (double*)CPLMalloc(sizeof(double)*num_data); double *r1 = (double*)CPLMalloc(sizeof(double)*num_data); double *r2 = (double*)CPLMalloc(sizeof(double)*num_data); double *r3 = (...
16,901
7,946
#include <example_add.hpp> Integer::Integer(unsigned _x): x(_x) {} std::unique_ptr<Example_result> Integer::clone() const { return std::make_unique<Integer>(x); } unsigned Integer::hash() const { return x; } std::unique_ptr<Example_job> Add::clone() const { return std::make_unique<Add>(); } std::u...
635
223
//#include<bits/stdc++.h> #include<iostream> #include<stdio.h> #include<cstring> #include<string.h> #include<algorithm> #define N 1010 using namespace std; int n,m; int a[N][N]; int stk[N],top; int L[N][N],R[N][N],U[N][N],D[N][N]; int readint() { char c; while((c=getchar())&&!(c>='0' && c<='9')); int...
1,915
1,150
/** * Copyright (C) 2022 Elisha Riedlinger * * This software is provided 'as-is', without any express or implied warranty. In no event will the * authors be held liable for any damages arising from the use of this software. * Permission is granted to anyone to use this software for any purpose, including co...
7,592
3,331
/* * This file belongs to the Galois project, a C++ library for exploiting * parallelism. The code is being released under the terms of the 3-Clause BSD * License (a copy is located in LICENSE.txt at the top-level directory). * * Copyright (C) 2018, The University of Texas at Austin. All rights reserved. * UNIVER...
2,043
734
/* * Copyright 2009-2017 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...
2,637
895
#include "stdafx.h" #include "InputSystem.h" InputSystem::ResizeEventData InputSystem::resizeEvent; InputSystem::KeyTypedData InputSystem::keyTypedEvent; bool InputSystem::addCubeButton; bool InputSystem::removeCubeButton; void InputSystem::Initialize(void) { // Setup all the event handlers to indicate that nothi...
2,727
870
// 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 "ui/events/keycodes/dom/dom_keyboard_layout_map_base.h" #include <cstdint> #include <memory> #include <string> #include "base/logging.h" #inclu...
2,255
767
#pragma once #include <azure_entity.h> #include <cpprest/http_msg.h> #include <cpprest/json.h> #include <permissions.hpp> using namespace web; using namespace bolt::storage; class AzureHandler { public: AzureHandler(const http::http_request &request, http::method method); void InitializeHandlers(); void HandleGe...
568
185
/****************************************************************************** * * Project: VSI Virtual File System * Purpose: Implementation of caching IO layer. * Author: Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 2...
17,889
5,039
#include "envoy/extensions/filters/network/direct_response/v3/config.pb.h" #include "envoy/extensions/filters/network/local_ratelimit/v3/local_rate_limit.pb.h" #include "envoy/extensions/filters/network/thrift_proxy/v3/thrift_proxy.pb.h" #include "extensions/filters/common/ratelimit/ratelimit_impl.h" #include "extensi...
9,535
2,733
// Copyright 2012 Cloudera 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 applicable law or agreed to in wr...
3,984
1,409
//////////////////////////////////////////////////////////////////////// // $Id: ret_far.cc,v 1.20 2008/06/13 08:02:22 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2005 Stanislav Shwartsman // Written by Stanislav Shwartsman [sshwarts at sourcef...
8,054
3,230
// 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/common/extensions/api/extension_action/action_info.h" #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" #i...
4,326
1,316
// Ordered slots hello world example for Boost.Signals2 // Copyright Douglas Gregor 2001-2004. // Copyright Frank Mori Hess 2009. // // Use, modification and // distribution is subject to the Boost Software License, Version // 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.tx...
1,350
478
/* Copyright (c) Günter Woigk 1994 - 2021 mailto:kio@little-bat.de This file is free software This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Permission to use, copy, modify,...
20,958
8,998
class Solution { public: int removeElement(vector<int>& nums, int val) { int n = nums.size(); int k{0}; for(int i=0;i<n;i++){ if(nums[i] != val){ nums[k] = nums[i]; k++; } } return k; } };
293
102
/* * 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 ...
2,956
1,035
/* * 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...
19,031
7,535
#include <stdio.h> #include <algorithm> #include <map> #include <set> using namespace std; int a[1005][4]; int siz[1005]; int n; int r[4]; class Event { public: int t, L, R, v; Event(int tt=0, int ll=0, int rr=0, int vv=0) { t = tt; L = ll; R = rr; v=vv; } bool operator<(const Event &e) const ...
3,104
1,588
#include "mex.h" #include <iostream> #include "drakeMexUtil.h" #include <Eigen/Dense> #include "RigidBodyConstraint.h" #include "RigidBodyManipulator.h" #include "constructPtrRigidBodyConstraint.h" #include <cstdio> using namespace Eigen; using namespace std; void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const...
21,317
6,729
#pragma once #include "screen.hpp" class EndScreen : public Screen { sf::Sprite &background_sp; public: EndScreen(const sf::Font &font, sf::Sprite &background_sp, const sf::Color &fillColor, const sf::Color &outlineColor); virtual void processEvent(const sf::Event &event); private: virtual void draw...
382
121
#include <any> #include <complex> #include <iostream> #include <string> #include <type_traits> #include <utility> /** * C++17 adds `std::any` - a value type that's able to change its type, but while still having * type safety. std::any accepts an arbitrary type - it holds the contained value and the * `typeid` of i...
6,230
1,814
// Copyright 2021 Xilinx 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 applicable law or agreed to in...
2,294
738
//===-- SBFrame.cpp -------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
39,046
12,979
//<Snippet1> using namespace System; using namespace System::Threading; public ref class Example { private: // The EventWaitHandle used to demonstrate the difference // between AutoReset and ManualReset synchronization events. // static EventWaitHandle^ ewh; // A counter to make sure all th...
3,964
1,129
#include <trees/nodes.h> #include <trees/trees.h> #include <analysis/x86_analysis.h> #include <utility/defines.h> #include <utility/print_helper.h> #include <common/utilities.h> #include <cassert> #include <fstream> #include <iostream> using namespace std; Comp_Abs_Tree::Comp_Abs_Tree() : Tree() { } Comp_Abs...
9,874
3,884
// Copyright 2015 Twin Oaks Computing, Inc. // Modifications copyright (C) 2017-2018 Twin Oaks Computing, 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....
2,463
898
#ifndef COAP_TE_TRANSMISSION_RELIABLE_CONNECTION_LIST_VECTOR_HPP__ #define COAP_TE_TRANSMISSION_RELIABLE_CONNECTION_LIST_VECTOR_HPP__ #include "defines/defaults.hpp" #include <vector> namespace CoAP{ namespace Transmission{ namespace Reliable{ #if COAP_TE_RELIABLE_CONNECTION == 1 template<typename Connection> class...
999
365
// Project: libv.update, File: src/libv/update/resource_server/resource_server_state.cpp, Author: Császár Mátyás [Vader] // hpp #include <libv/update/resource_server/resource_server_state.lpp> // libv //#include <libv/mt/worker_thread_pool.hpp> #include <libv/algo/linear_find.hpp> // pro //#include <libv/update/log.hp...
2,503
907
/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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 applic...
26,474
9,937
/* * * Tencent is pleased to support the open source community by making * Hippy available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. * 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. *...
10,792
3,507
//===-- UnixSignals.cpp ---------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
11,683
4,062
#pragma once #include <kizunano/lib/errors.hpp> namespace nano { class jsonconfig; class tomlconfig; class opencl_config { public: opencl_config () = default; opencl_config (unsigned, unsigned, unsigned); nano::error serialize_json (nano::jsonconfig &) const; nano::error deserialize_json (nano::jsonconfig &); na...
512
188
#ifndef OBJECT_COUNTER_H #define OBJECT_COUNTER_H #include <cstddef> /** * @brief Template class for couynting the number of objects of type T created and * currently allocated (a.k.a. the number of objects that are "alive"). */ template< class T > class ObjectCounter { public: ObjectCounter() { ...
1,029
362
//===- bugpoint.cpp - The LLVM Bugpoint utility ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
7,066
2,284
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "SkGLContext.h" SkGLContext::SkGLContext() : fFBO(0) , fGL(NULL) { } SkGLContext::~SkGLContext() { SkSafeUnref(fGL); } bool SkGLContext::init(int width...
3,271
981
// This file is part of VSTGUI. It is subject to the license terms // in the LICENSE file found in the top-level directory of this // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE #include "../../unittests.h" #include "../../../../uidescription/uiviewfactory.h" #include "../../../../uidescriptio...
3,924
1,278
// File: Text.hpp // Author: Bob Rubbens - Knights of the Compiler // Creation date: 2014-07-21 // Contact: http://plusminos.nl - @broervanlisa - gmail (bobrubbens) #ifndef NNB_TEXT_HPP #define NNB_TEXT_HPP // Public #include <SDL2/SDL.h> #include <SDL2/SDL_ttf.h> #include <string> #include <memory> //...
1,695
736
#pragma once #include <fstream> #include <string> #include "simeng/version.hh" #include "yaml-cpp/yaml.h" namespace simeng { class SpecialFileDirGen { public: /** Construct a SpecialFileDirGen class by reading in the YAML file and * running it through checks and formatting. */ SpecialFileDirGen(YAML::Node co...
1,196
380
/************************************************************************* * * * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * * All rights reserved. Email: russ@q12.org Web: www.q12.org * * ...
14,493
6,456
/**************************************************************************** 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...
12,838
4,147
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------...
1,466
492
#include "menuItem.hpp" #include "../common.hpp" #include "../gfx.hpp" void MenuItem::draw(Common& common, int x, int y, bool selected, bool disabled, bool centered, int valueOffsetX) { int wid = common.font.getDims(string); int valueWid = common.font.getDims(value); if(centered) x -= (wid >> 1); ...
997
454
//======================================================================= // Copyright (c) 2013-2020 Baptiste Wicht. // Distributed under the terms of the MIT License. // (See accompanying file LICENSE or copy at // http://opensource.org/licenses/MIT) //=================================================================...
844
249
// Copyright 2016 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/android/webapk/webapk_metrics.h" #include "base/metrics/histogram_macros.h" #include "base/time/time.h" #include "chrome/browser...
1,544
543
// Copyright (c) 2018 PaddlePaddle Authors. 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...
18,259
6,977
/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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 applic...
20,338
7,851
/* ** EPITECH PROJECT, 2020 ** B-CPP-300-LYN-3-1-CPPD13- ** File description: ** Woody.hpp */ #ifndef WOODY_HPP_ #define WOODY_HPP_ #include "Toy.hpp" class Woody : public Toy { public: Woody(std::string const &, std::string const &); Woody(Woody const &); virtual...
417
168
// Copyright (c) 2016 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 "net/third_party/quiche/src/quic/core/frames/quic_new_connection_id_frame.h" #include "net/third_party/quiche/src/quic/core/quic_constants.h"...
1,407
472
//=========================================================================== #include "Assets.h" //=========================================================================== const unsigned char PROGMEM titleSprite_plus_mask[] = { // width, height, 88, 49, // FRAME 00 0x00, 0x00, 0x00, 0x00, 0x0...
14,900
13,549
#include "SimpleBrush3D.hpp" #include "Color.hpp" #include <cstring> #include "Vulkan.hpp" namespace lw { void SimpleBrush3D::setColor(const Color& color) { m_mainColor = color; } void SimpleBrush3D::setColor(f32 r, f32 g, f32 b, f32 a /*= 1.f*/) { m_mainColor = { r, g, b, a }; } void SimpleBrush3D:...
7,859
3,523
// Copyright 2018 Google LLC // // 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 agreed to in w...
2,021
639
// ObserverPattern.cpp : Defines the entry point for the console application. // //#include "stdafx.h" #include <iostream> #include <vector> using namespace std; class IDisplayObserver { public: virtual void update(int t, int p, int h) {} }; class CWeatherData { int nTemp{ 0 }; int nPressure{ 0 }; int nHumidity...
2,324
1,077
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. #include "precomp.h" #include "inc/Viewport.hpp" using namespace Microsoft::Console::Types; Viewport::Viewport(const SMALL_RECT sr) noexcept : _sr(sr) { } Viewport::Viewport(const Viewport& other) noexcept : _sr(other._...
45,523
12,990
// // detail/reactive_socket_service_base.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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_...
7,570
2,775
// Copyright 2016 The SwiftShader Authors. 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 b...
3,133
1,129
// 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 "chrome/browser/password_manager/chrome_password_manager_client.h" #include "base/command_line.h" #include "base/strings/string16.h" #include "b...
15,304
4,666
#include <nan.h> // pulls in Nan and v8 namespaces #include <cmath> // std::ceil #include <algorithm> // std::max #include <cstdlib> // std::malloc std::realloc #include "fastlz.h" // fastlz_* NAN_METHOD(CompressSync) { if (info.Length() == 2 && node::Buffer::HasInstance(info[0]) && info[1]->IsUint32()) { v8::Lo...
1,641
523
// Copyright 2014 Stellar Development Foundation and contributors. Licensed // under the Apache License, Version 2.0. See the COPYING file at the root // of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 #include "main/Config.h" #include "StellarCoreVersion.h" #include "crypto/Hex.h" #include "cry...
24,185
7,493
#include <stan/math/rev/mat.hpp> // FIX ME - more specific #include <stan/math/torsten/PKModel/Pred/Pred1_mix2.hpp> #include <stan/math/torsten/PKModel/functors/mix2_functor.hpp> #include <gtest/gtest.h> struct ODE_functor { template <typename T0, typename T1, typename T2, typename T3> inline std::vector<typena...
3,115
1,348
#include <torch/extension.h> #include <pybind11/pybind11.h> #include <iostream> #include <vector> std::tuple<torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor> sample_adj(torch::Tensor indptr, torch::Tensor indices, torch::Tensor node_idx, int64_t num_neighbors, bool replace) { auto indptr_data = indptr.d...
9,997
3,838
// Copyright (C) 2018-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #include <gtest/gtest.h> #include "common_test_utils/test_common.hpp" #include <string> #include <sstream> #include <fstream> #include <memory> #include <queue> #include <map> #include <ngraph/function.hpp> #include <ngraph/opsets...
12,354
4,424
class Solution { int helper(TreeNode *root, int M) { if(!root) return 0; int good = root->val >= M; if(good) M = root->val; return good + helper(root->left, M) + helper(root->right, M); } public: int goodNodes(TreeNode* root) { return helper(ro...
343
112
#include "ComparacionAviones.h" CompRetorno ComparacionAviones::Comparar(const CostoArco& t1, const CostoArco& t2) const { if (t1.aviones > t2.aviones) return MAYOR; if (t1.aviones < t2.aviones) return MENOR; if (t1.tiempo > t2.tiempo) return MAYOR; if (t1.tiempo < t2.tiempo) return MENOR; return IGUALES; }
318
151
class Solution { public: double myPow(double x, int n) { if (n == 0) return 1; if (n < 0) return (1.0 / x) / (myPow(x, -(n + 1))); double half = myPow(x, n / 2); if (n % 2) return half * half * x; else return half * half; } };
275
111
// STL includes. #include <string> #include <vector> #include <utility> #include <cstdlib> #include <fstream> #include <iostream> #include <iterator> // CGAL includes. #include <CGAL/Timer.h> #include <CGAL/property_map.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Shape_detection/...
4,755
1,657
/* * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/gmm_helper/gmm_interface.h" #include "shared/source/gmm_helper/resource_info.h" #include "s...
16,671
5,423
#include <nano/lib/errors.hpp> #include <nano/lib/threading.hpp> #include <nano/lib/utility.hpp> #include <nano/node/cli.hpp> #include <nano/node/ipc/ipc_server.hpp> #include <nano/rpc/rpc.hpp> #include <nano/rpc/rpc_request_processor.hpp> #include <nano/secure/utility.hpp> #include <boost/filesystem.hpp> #include <bo...
4,835
1,895
/** @file A brief file description @section license License 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 und...
14,146
4,435
#include "Collision.h" namespace Collision { bool rectRectIntersect(Vec2 posBoxA, Vec2 dimBoxA, Vec2 posBoxB, Vec2 dimBoxB) { if (posBoxA.x <= (posBoxB.x + dimBoxB.x) && posBoxA.y <= (posBoxB.y + dimBoxB.y) && posBoxB.x <= (posBoxA.x + dimBoxA.x) && posBoxB.y <= (posBoxA.y + dimBoxA.y)) { return tru...
6,154
2,874
#pragma once #include "types.hpp" #include "reg/peripheral_operations.hpp" #include "board/regmap/uart.hpp" #include "reg/set.hpp" #include "reg/write.hpp" #include "reg/apply.hpp" namespace drivers::uart { namespace detail { using board::uart::CR1::PsVal; using board::uart::CR1::MVal; ...
2,423
818
#include <EnginePluginAssetsPCH.h> #include <EnginePluginAssets/TextureCubeAsset/TextureCubeContext.h> #include <EnginePluginAssets/TextureCubeAsset/TextureCubeView.h> #include <EditorEngineProcessFramework/EngineProcess/EngineProcessMessages.h> #include <GameEngine/GameApplication/GameApplication.h> #include <Render...
2,574
847
// Time: O(n) // Space: O(|V|+|E|) = O(26 + 26^2) = O(1) // BFS solution. class Solution { public: string alienOrder(vector<string>& words) { unordered_set<char> nodes; unordered_map<char, unordered_set<char>> in_degree, out_degree; queue<char> zero_in_degree_queue; for (const auto...
6,955
2,153
#include <iostream> #include <vector> using namespace std; class A { static int count; public: // 在此处补充你的代码 A () { count++; } static int theNumberOfA() { return count; } }; int A::count = 0; int main() { vector<A> v; for(int i = 0; i < 3; i++) { { ...
450
179
/* * Mark Benjamin 6th March 2019 * Copyright (c) 2019 Mark Benjamin */ #ifndef FASTRL_MDP_CORE_OO_STATE_EXCEPTIONS_UNKNOWN_OBJECT_EXCEPTION_HPP #define FASTRL_MDP_CORE_OO_STATE_EXCEPTIONS_UNKNOWN_OBJECT_EXCEPTION_HPP class UnknownObjectException { }; #endif //FASTRL_MDP_CORE_OO_STATE_EXCEPTIONS_UNKNOWN_OBJECT_...
334
164
#include "tls.h" using namespace std; void tls_init() { sem_init(&mutex_sem, 0, 1); sem_wait(&mutex_sem); PAGESIZE = getpagesize(); sem_post(&mutex_sem); struct sigaction sigact; sigemptyset(&sigact.sa_mask); /* SA_SIGINFO will help to distinguish between page fault and normal SegFault *...
9,536
3,370
// 210-Evt-EventListeners.cpp // Contents: // 1. Printing of listener data // 2. My listener and registration // 3. Test cases #include <catch2/catch_test_macros.hpp> #include <catch2/reporters/catch_reporter_event_listener.hpp> #include <catch2/reporters/catch_reporter_registrars.hpp> #include <catch2/catch_test_cas...
14,900
4,930
//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except...
46,661
15,933
#ifndef DNS_data_parser_HPP #define DNS_data_parser_HPP #include "./libs/logger/easylogging++.h" #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> #include "libs/jzon/Jzon.h" class audioObject { public: audioObject (); float distance; float angle; }; class s...
958
316
#include <gtest/gtest.h> #include "distribution/Distribution.h" TEST(DistributionTest, RandomTest) { auto value = Distribution::random(0.0, 1.0); EXPECT_TRUE(value <= 1 && value >= -1); } TEST(DistributionTest, RandomTest2) { auto value = Distribution::random(1.0); EXPECT_TRUE(value <= 1 && value >= 0); }
313
120
#include <at_tests> #include "argparser.h" void test_args() { const char* args[] = {"", "arg1", "-notarg", "--notarg", "arg2", "-not=arg", "--not=arg"}; ArgParser a = ArgParser(7, args); ASSERT(a.num_arguments() == 2); ASSERT(a.get_argument(0) == "arg1"); ASSERT(a.get_argument(1) == "arg2"); ...
2,225
919
/** * @file * * @brief * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) */ #include <merge.hpp> #include <cmdline.hpp> #include <kdb.hpp> #include <keysetio.hpp> #include <modules.hpp> #include <iostream> #include <string> #include <mergehelper.hpp> #include <merging/metamergestrategy...
2,423
1,001
/* Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Gabriel Ebner */ #include "library/library_task_builder.h" #include "library/message_builder.h" namespace lean { struct library_scopes_imp : public delegating_task_imp { i...
2,157
704
// Boost.Function library // Copyright Douglas Gregor 2001-2003. Use, modification and // distribution is subject to 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) // For more information, see http://www.boost.org/libs/functio...
2,200
842
// Created by: Peter KURNEV // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free S...
11,329
3,433
#define PROBLEM "https://yukicoder.me/problems/no/306" #define ERROR 1e-6 #include <cstdio> #include <cmath> #include "algorithm/ternary_search.cpp" int main() { long double xa, ya, xb, yb; scanf("%Lf %Lf %Lf %Lf", &xa, &ya, &xb, &yb); auto f = [&](auto y) { return std::hypot(xa, y-ya) + std::hypot(xb, yb-y);...
421
211
// // Created by sokol on 02.10.19. // #include "path_finder/routing/Dijkstra.h" #include <queue> pathFinder::Dijkstra::Dijkstra(const pathFinder::Graph &graph) : graph(graph) { costs.reserve(graph.numberOfNodes); previousNode.reserve(graph.numberOfNodes); while (costs.size() < graph.numberOfNodes) { costs.e...
1,430
487
#include <iostream> #include <vector> #include<list> using namespace std; #define ll long long int #define OJ \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); #define FIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
1,077
421
/* * Copyright 2019 Xilinx, 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 applicable law or agreed to...
4,871
1,960
//***************************************************************************** // Copyright 2017-2020 Intel 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://w...
2,590
694
// Copyright 2012 The Avalon Project Authors. All rights reserved. // Use of this source code is governed by the Apache License 2.0 // that can be found in the LICENSE file. // Author: grundmann@google.com (Steffen Grundmann) #include "common/point_of_sail.h" #include <algorithm> #include <math.h> #include <stdio.h> ...
7,031
2,338
/***************************************************************************** * * This file is part of Mapnik (c++ mapping toolkit) * * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as p...
1,537
512
/* * refit/scan/common.c * * Copyright (c) 2006-2010 Christoph Pfisterer * 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 cop...
14,646
5,307
#define __STDC_FORMAT_MACROS 1 #include <algorithm> #include <cassert> #include <cinttypes> #include <cstdint> #include <cstring> #include <queue> #include <memory> #include <map> #include <set> #include <stdexcept> #include <unordered_set> #include <unordered_map> #include <vector> extern "C" { #include <libvex.h> #...
94,900
38,469
/* * Copyright (c) 2000, 2020, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ #ifndef COH_ACCEPT_CHANNEL_RESPONSE_HPP #define COH_ACCEPT_CHANNEL_RESPONSE_HPP #include "private/coherence/component/net/extend/AbstractPofRe...
1,625
504