text
string
size
int64
token_count
int64
#include <bits/stdc++.h> using namespace std ; int main() { stack <char> data; char input[500005]; int n ; scanf("%d", &n); map <int , int> marking ; int balanced= 0 ; long long int ans = 0 ; for(int i = 0 ; i < n ; i++) { scanf("%s", input); int...
2,184
641
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define lson(x) ((x)<<1) #define rson(x) (((x)<<1)+1) const int maxn = 100005; typedef long long ll; struct Node { int l, r; ll sum, add; void set (int l, int r, ll sum, ll add) { this->l = l; this->r = r; this->sum = sum; thi...
1,769
987
//Print all the ancestors of a given node #include<iostream> using namespace std; struct Node { int data; Node *left; Node *right; }; //creates a node Node* create(int data) { try { Node *node=new Node; node->data=data; node->left=NULL; node->right=NULL; return node; } catch(bad_alloc xa) { cout<<...
871
375
// 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) #ifndef SGE_RUCKSACK_TESTBED_OBJECT_IMPL_FWD_HPP_INCLUDED #define SGE_RUCKSACK_TESTBED_OBJECT_IMPL_...
404
179
// // Created by manuelrenz on 12.04.18. // #include "WinKeyReducerEval.h" /* ----------------------------------------- * specialized for yahoo -- using normal hashtable * NB: we have to do full specialization per C++ * ----------------------------------------- */ // using MyWinKeyReduerEval = WinKeyReducerEval<...
835
291
#ifndef THREADPOOL_HPP_INCLUDED #define THREADPOOL_HPP_INCLUDED #include"Condition.hpp" #include<queue> #include<iostream> //参考他人博客,仅再度抽象封装 //原地址 https://www.cnblogs.com/yangang92/p/5485868.html typedef struct task { void *(*job)(void *args); void *arg; }Task; void * ThreadManager(void *arg); class ThreadPool {...
3,113
984
#include<bits/stdc++.h> using namespace std; #define MOD 786433 int main() { long long n; long long a[10002]; scanf("%lld",&n); for(int i=0;i<=n;i++) scanf("%lld",&a[i]); long long q; scanf("%lld",&q); while(q--) { long long x; scanf("%lld",&x); ...
554
234
#include <unordered_map> #include <iostream> #include <string> int lengthOfLongestSubstring(std::string s){ std::unordered_map<char, int> smap; int n = s.length(); int max_length = 0; if(n<2){ return n; } for(int i=0,j=0;j<n;++j){ char c = s.at(j); if(smap.count(c)){ i=smap[c]>i?smap[c]:i;...
594
290
#define CATCH_CONFIG_RUNNER #include <catch.hpp> #include "faabric_utils.h" #include <faabric/util/logging.h> #include <faabric/util/testing.h> struct LogListener : Catch::TestEventListenerBase { using TestEventListenerBase::TestEventListenerBase; void testCaseStarting(Catch::TestCaseInfo const& testInfo) o...
794
248
#include <boost/fusion/view/filter_view/filter_view.hpp>
57
22
#include <bits/stdc++.h> using namespace std; int main() { int ni, ncase = 1; while(cin >> ni && ni) { map<int, vector<pair<int, int> > > graph; // from -> [to, cost] for(int i = 1; i <= ni; i++) { int roads; cin >> roads; while (roads > 0) ...
1,938
649
#include "gesture-sensor.h" #include "Gesture_PAJ7620/paj7620.h" /** Initialiazes gesture sensor **/ unsigned int gestureInit() { paj7620Init(); } /** Reads gesture sensor and returns value of gesture (or 0 if no gesture detected) For more info see: http://wiki.seeedstudio.com/Grove-Gesture_v1.0/ @returns data = ...
1,162
456
// Copyright 2021 The Fuchsia 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 "src/sys/fuzzing/framework/engine/adapter-client.h" #include <fuchsia/fuzzer/cpp/fidl.h> #include <string> #include <vector> #include <gtest/gt...
3,009
1,029
#include <cstring> #include <ctime> #include <fstream> #include <iostream> using namespace std; void usage() { cout << "para is error." << endl; cout << "example: a.out in out pwd" << endl; } std::chrono::steady_clock::time_point now() { return std::chrono::steady_clock::now(); } long long subSecond(std...
2,744
970
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <strin...
1,560
667
// ================================================================= /** * @file OC_Endpoint_Selector_Loader.cpp * * $Id: OC_Endpoint_Selector_Loader.cpp 91628 2010-09-07 11:11:12Z johnnyw $ * * @author Phil Mesnier <mesnier_p@ociweb.com> * */ // ================================================================= ...
732
288
#include <iostream> #include <string> using namespace std; class Human { private: string Name; int Age; public: Human(string InputName = "Adam", int InputAge = 22) :Name(InputName), Age(InputAge) { cout << "Constructed a Human called " << Name; cout << ", " << Age << " years old" << endl; } }; i...
398
150
//--------------------------------------------------------------------- // <copyright file="e2e_test_case.cpp" company="Microsoft"> // Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. // </copyright> //------------------------------------------...
375
85
#include <iostream> #include "Logger.h" #include <fstream> using std::thread; using std::cout; using std::endl; using std::cerr; using std::unique_lock; using std::mutex; using std::ofstream; //Logger::Logger() //{ // // Start background thread // mThread = thread{ &Logger::processEntries, this }; //} //void Log...
2,505
1,000
/* * File: UnitTest.cpp * Author: kwt * * Created on July 28, 2013, 11:18 AM */ #include "UnitTest.h" UnitTest::UnitTest() { //Test Illumina PE //Test Illumina SE //Test overlap Illumins } UnitTest::UnitTest(const UnitTest& orig) { } UnitTest::~UnitTest() { } void UnitTest::Te...
17,601
6,244
/* * Copyright (C) 2021 The Android Open Source Project * * 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 app...
13,752
4,245
// Copyright 2016 The Fuchsia 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 <algorithm> #include <limits> #include <fbl/algorithm.h> #include <zxtest/zxtest.h> namespace { TEST(AlgorithmTest, RoundUp) { EXPECT_EQ(fbl:...
2,662
1,461
// DelProtect2Config.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include "stdafx.h" #include "..\DelProtect2\DelProtectCommon.h" #include <iostream> int Error(const char* text) { printf("%s (%d)\n", text, ::GetLastError()); return 1; } int PrintUsage() { printf("Usage...
2,375
938
#pragma once #include "core/coredefs.hpp" namespace pilo { namespace core { namespace threading { class read_write_lock { public: #ifdef WINDOWS read_write_lock() { ::InitializeSRWLock(&m_lock); ...
907
248
// Unit tests for profiling_annotations.h. #include "caffe2/contrib/prof/profiling_annotations.h" #include <gtest/gtest.h> namespace caffe2 { namespace contrib { namespace prof { namespace { TEST(TwoNumberStatsTest, ComputeAndGetOpStatsSummary) { // e.g., 2 and 3 TwoNumberStats stats; stats.addPoint(2); stat...
1,256
455
#pragma once #include "proxy.hpp" #include "topology.hpp" namespace face_vertex { inline bool is_valid(VertexProxy vp) { return is_valid(topology(vp)); } }
164
64
/* Buddy Strings https://leetcode.com/problems/buddy-strings/ Given two strings A and B of lowercase letters, return true if you can swap two letters in A so the result is equal to B, otherwise, return false. Swapping letters is defined as taking two indices i and j (0-indexed) such that i != j and swapping the chara...
1,461
567
#include "logging_backend.h" #include <boost/filesystem/fstream.hpp> #include <base/util/format.h> #include <base/exception/exception.h> namespace logging { struct logging_backend::implementation { boost::filesystem::path root_path_; boost::filesystem::ofstream file_; uintmax_t written_; implementation(cons...
2,159
907
/* (c)2012 BlueBolt Ltd. All rights reserved. * * GpuCacheTranslator.cpp * * Created on: 20 Jul 2012 * Author: ashley-r */ #include <maya/MFnDagNode.h> #include <maya/MBoundingBox.h> #include <maya/MPlugArray.h> #include <maya/MTypes.h> #include "gpuCacheTranslator.h" /* * Return a new string with all o...
24,249
7,368
// // Copyright (c) 2019 Martim Brandão martim@robots.ox.ac.uk, Omer Burak Aladag aladagomer@sabanciuniv.edu, Ioannis Havoutis ioannis@robots.ox.ac.uk // As a part of Dynamic Robot Systems Group, Oxford Robotics Institute, University of Oxford // // This software is provided 'as-is', without any express or implied // w...
3,415
1,076
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (C) 2008-2016 Ryo Suzuki // // Licensed under the MIT License. // //----------------------------------------------- # pragma once # include "Texture.hpp" namespace s3d { class RenderTexture : public Textur...
1,352
469
// Copyright 2021 The Fuchsia 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 "src/graphics/bin/vulkan_loader/loader.h" #include <lib/fdio/directory.h> #include <lib/fdio/io.h> LoaderImpl::~LoaderImpl() { app_->RemoveObser...
2,096
739
/** \file criteria_a_opt.hpp \brief A-optimality (uncertainty) based criteria */ /* ------------------------------------------------------------------------- This file is part of BayesOpt, an efficient C++ library for Bayesian optimization. Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es> ...
1,803
574
#include "selfdrive/common/params.h" #include <cstring> static const char* const kUsage = "%s: read|write|read_block params_path key [value]\n"; int main(int argc, const char* argv[]) { if (argc < 4) { printf(kUsage, argv[0]); return 0; } Params params(argv[2]); const char* key = argv[3]; if (strc...
1,831
709
/* * MPAOFactory.cpp * * Created on: 21 March 2015 * Author: cyosp */ #include <com/cyosp/mpa/api/rest/v1/MPAOFactory.hpp> namespace mpa_api_rest_v1 { // Initialize static member MPAOFactory * MPAOFactory::mpaofactory = NULL; MPAOFactory * MPAOFactory::getInstance() { if( mpaofact...
7,517
2,355
/* * (C) Copyright 2013 ECMWF. * * This software is licensed under the terms of the Apache Licence Version 2.0 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. * In applying this licence, ECMWF does not waive the privileges and immunities * granted to it by virtue of its status as an intergo...
3,141
1,044
/*********************************************************\ * File: SPK_PLLineRenderer.cpp * * * Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/) * * This file is part of PixelLight. * * Permission is hereby granted, free of charge, to any person obtaining a co...
4,176
1,188
#include "include/fbr.h" #include "Player.h" using namespace std; using namespace fbr; int main(){ Player *p = new Player(); BaseTask *printHP = new TaskArgs<>(&Player::printHp, p); TaskArgs<int> *taskArg = new TaskArgs<int>(&Player::addHp, p); int a = 20; taskArg->setArgs(a); TaskArgs<int, bool> *test = new...
1,803
678
#include <cstdint> #include <iostream> #include <utility> #include "continued_fraction.h" #include "largeint.h" using uInt = std::uint_fast32_t; using LInt = Euler::LargeInt<uInt>; using Fraction = std::pair<LInt, LInt>; // first: 分子, second: 分母 using namespace Euler::ContinuedFraction; int main(void) { constexp...
898
432
/***************************************************************************** XFadeShape.cpp Author: Laurent de Soras, 2017 --- Legal stuff --- This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the ...
3,385
1,518
// Nova project - Gwennaël Arbona #include "NovaDestination.h" #include "Nova/Nova.h"
93
41
#include"core.h" Collision::Collision() {} void Collision::init(std::string filename) { std::ifstream inFile; this->center_point = glm::vec2(22.5, 31.0); this->player_position.push_back(glm::vec4(0, 0, 0, 0)); this->player_position.push_back(glm::vec4(0, 0, 0, 0)); std::vector<unsigned int> vert...
5,536
2,118
/* ** Author: Samuel R. Blackburn ** Internet: wfc@pobox.com ** ** Copyright, 1995-2019, Samuel R. Blackburn ** ** "You can get credit for something or get it done, but not both." ** Dr. Richard Garwin ** ** BSD License follows. ** ** Redistribution and use in source and binary forms, with or without ** modification, a...
6,944
2,163
#include "sram.h" #include <Arduino.h> #include <freemem.h> #include <mdisplay.h> #include <stdint.h> SRam::SRam() { } SRam::~SRam() { this->close(); } char *dtoc(double d) { char *value = reinterpret_cast<char *>(&d); return value; } double ctod(char *data) { double resp = *reinterpret_cast<double *co...
14,571
5,109
#include "Game.hpp" #include "RectangleFunctions.hpp" #include "Renderer.hpp" namespace TappyPlane { using namespace SDLW::Video; using namespace SDLW::Events; constexpr auto backgroundSpritesheetHandle = "background"; constexpr auto backgroundBounds = canvasBounds; constexpr auto backgroundScrollSpeed = 0.5f; con...
3,341
1,124
/*****************************************************************************/ /* SOURCE CONTROL VERSIONS */ /*---------------------------------------------------------------------------*/ /* ...
24,449
9,661
#pragma once #include "generic_attribute.hpp" #include "../util/observer.hpp" #include <emscripten/val.h> #include <functional> #include <iostream> namespace CppDom::Attributes { template <typename ValueT> class Attribute : public GenericAttribute { public: Attribute(std::str...
3,199
938
#include "msgpack_server.hpp" #include <msgpack.hpp> typedef long ssize_t; typedef std::basic_string<TCHAR> tstring; inline void operator<<(tstring &t, const std::string &s) { #ifdef _UNICODE if (s.size() > 0) { t.resize(s.size() + 1); size_t length = 0; mbstowcs_s(&length, &t[0], t.size(...
3,431
1,233
#include "flare_skia/skr_actor_star.hpp" using namespace flare; SkrActorStar::SkrActorStar() : SkrActorBasePath(this) {} void SkrActorStar::invalidateDrawable() { m_IsPathValid = false; }
190
74
// 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 "content/renderer/pepper/ppb_tcp_socket_private_impl.h" #include "content/common/pepper_messages.h" #include "content/renderer/pepper/host_g...
4,965
1,761
/* =========================================================================== * * This file is part of HISE. * Copyright 2016 Christoph Hart * * HISE 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,...
11,602
4,902
#include "rolestoryfb.hpp" #include "obj/character/role.h" #include "config/logicconfigmanager.hpp" #include "other/vip/vipconfig.hpp" #include "other/fb/storyfbconfig.hpp" #include "servercommon/errornum.h" #include "protocal/msgfb.h" #include "other/event/eventhandler.hpp" #include "monster/monsterpool.h" #include "...
7,330
3,313
// Copyright Ennis Massey 18/12/16 // // Created by Ennis Massey on 18/12/16. // #include "parsing.h" uint32_t midiparser::ParseUint32(std::ifstream &input_file) { // If the file isn't open, return 0 if (!input_file.is_open()) { return (uint32_t) 0; } // Create buffer char buffer[4]; ...
4,120
1,758
#include "protocol.h" //#123:123,123; Protocol::Protocol(address_t addr){ _buf = malloc(PROTOCOL_BUF_SIZE); _address = addr; _command = Protocol::VERB::IDLE; } Protocol::inputData(size_t len, char* data){ } Protocol::setAddress(address_t addr){ _address = addr; } Protocol::stateMachine(char data){ switch...
1,165
462
#pragma once #include <natus/memory/allocator.hpp> #include <vector> namespace natus { namespace ntd { //template< typename T > //using vector = ::std::vector< T, natus::memory::allocator<T> > ; // for now, we use the default allocator template< typename T > using vec...
354
114
#include "camera.hpp" Camera::Camera(glm::vec3 position, glm::vec3 up, float yaw, float pitch) : front_(glm::vec3(0.0f, 0.0f, -1.0f)), speed_(initial_speed), mouse_sensitivity_(init_sensitivity), zoom_(init_zoom) { position_ = position; world_up_ = up; yam_ = yaw; pitch_ = pitch; update_c...
2,276
869
#include "reply.hh" using namespace eclipse::messages; std::string Reply::get_type() const { return "Reply"; }
112
37
#ifndef ZELTALIB_LAYER_HPP #define ZELTALIB_LAYER_HPP #include <vector> #include <SFML/Graphics/Drawable.hpp> // Base class: sf::Drawable #include <SFML/Graphics/RenderTarget.hpp> namespace zt { /** * @brief Container for drawable objects. * This class allows you to group sf::Drawable elements such as...
1,994
561
#include <hiptf/device.hpp> #include <hiptf/rsmi.hpp> #include "gpu_monitor_hip.hpp" void mtk::gpu_monitor::gpu_monitor_hip::init() { HIPTF_CHECK_ERROR(rsmi_init(0)); } void mtk::gpu_monitor::gpu_monitor_hip::shutdown() { } std::size_t mtk::gpu_monitor::gpu_monitor_hip::get_num_devices() const { return hiptf::devi...
1,127
511
/** * \example strand.cpp * Simple \ref Strand examples */ #include <yaclib/executor/strand.hpp> #include <yaclib/executor/thread_pool.hpp> #include <iostream> #include <gtest/gtest.h> using namespace yaclib; TEST(Example, Strand) { std::cout << "Strand" << std::endl; auto tp = MakeThreadPool(4); auto s...
935
366
/** ** Copyright (c) 2014 Illumina, Inc. ** ** This file is part of Illumina's Enhanced Artificial Genome Engine (EAGLE), ** covered by the "BSD 2-Clause License" (see accompanying LICENSE file) ** ** \description Generation of random/uniform intervals with precise boundaries ** Based on: ** [1] Jon Louis...
12,142
3,314
/****************************************************************************** ** ** Copyright (C) 2009-2011 Kyle Lutz <kyle.r.lutz@gmail.com> ** All rights reserved. ** ** This file is a part of the chemkit project. For more information ** see <http://www.chemkit.org>. ** ** Redistribution and use in source and binar...
4,791
1,472
// Implementation of Common library #include "UIOverlay.h"
60
20
#include "mpegts_muxer.h" #include "simple_buffer.h" #include "ts_packet.h" #include "crc.h" #include <string.h> #include "common.h" static const uint16_t MPEGTS_NULL_PACKET_PID = 0x1FFF; static const uint16_t MPEGTS_PAT_PID = 0x00; static const uint16_t MPEGTS_PMT_PID = 0x100; static const uint16_t MPEGTS_P...
10,614
4,305
/* * Dynamic Bitset Class powered by Mingz & Frank * Version 1.0 */ #ifndef DYNAMICBITSET_H #define DYNAMICBITSET_H #include <iostream> #include <cstring> #include <cstdlib> #include <cmath> using namespace std; #define BIT_PER_DATASET_TYPE 8 typedef unsigned char dataset_t; class DynamicBitset { public: Dyna...
632
231
#include "log.hpp" namespace FE { std::shared_ptr<spdlog::logger> Log::s_core_logger; std::shared_ptr<spdlog::logger> Log::s_client_logger; void Log::init() { // See spdlog [wiki](https://github.com/gabime/spdlog/wiki) for more pattern settings // ^ - start color range // T - ISO 8601 time format // n - ...
694
283
/****************************** LICENSE ******************************* * (C) Copyright 1996-2017 ECMWF. * * This software is licensed under the terms of the Apache Licence Version 2.0 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. * In applying this licence, ECMWF does not waive the pr...
1,842
684
//+------------------------------------------------------------------------- // // Microsoft Windows // Copyright (C) Microsoft Corporation, 1992 - 1994. // // File: interop.hxx // // Contents: Common definitions for the interop project // // History: 18-Feb-94 DrewB Created // //----...
8,677
3,030
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/cloudtrail/model/ListEventDataStoresResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #includ...
1,362
459
#include "ns/RegistCallback.h" #include "ns/CompSerializer.h" #include "ns/CompNoSerialize.h" #include "ns/N0CompComplex.h" #include <node0/CompComplex.h> #include "ns/N2CompAnim.h" #include <node2/CompAnim.h> #include "ns/N2CompColorCommon.h" #include <node2/CompColorCommon.h> #include "ns/N2CompColorMap.h" #include...
2,954
1,237
0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x02, 0x0A, 0x03, 0x00, 0x02, 0x0A, 0x05, 0x00, 0x02, 0x03, 0x07, 0x00, 0x02, 0x0A, 0x09, 0x00, 0x02, 0x03
145
146
/*************************************************************************** qgspostgresprojectstorage.cpp --------------------- begin : April 2018 copyright : (C) 2018 by Martin Dobias email : wonder dot sk at gmail dot com *********************************...
12,800
4,066
/** * Copyright 2021 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...
16,851
6,958
#include "chess-application.h" #include <GLFW/glfw3.h> #include <chrono> #include <iostream> #include <random> #include "selection-rendering-stage.h" using namespace bembel; ChessApplication::ChessApplication() : kernel::Application() { this->graphic_system = this->kernel->addSystem<graphics::GraphicSystem>()...
2,406
804
#include <iostream> #include "init_6he_ds.hpp" #include "TChain.h" void hdraw(TTree& tree, TString name, TString draw_cmd, TString binning, TCut cuts = "", TString title = "", TString xaxis_title = "", TString yaxis_title = "", TString draw_opts = "colz") { TString hstr = TString::...
14,693
6,784
/*************************************************************************** Millipede memory map (preliminary) 0400-040F POKEY 1 0800-080F POKEY 2 1000-13BF SCREEN RAM (8x8 TILES, 32x30 SCREEN) 13C0-13CF SPRITE IMAGE OFFSETS 13D0-13DF SPRITE HORIZONTAL OFFSETS 13E0-13EF SPRITE VER...
10,557
5,772
/* Copyright (C) 1996-1997 Id Software, Inc. 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 program is distributed in th...
9,600
4,246
#include "doctest.h" #include "model/vehicle.hpp" TEST_CASE("testing vehicle") { model::Vehicle v; v.brand = "x"; v.cost = 10.0; v.weight = 5.0; CHECK(v.cost_per_kg() == 2.0); }
196
97
#include<iostream> #include<vector> #include<climits> using namespace std; int solve(vector<vector<int>>&res, int b,int l){ if(l<=0||b<=0) return 0; if(l==b) return 0; if(res[b][l]!=INT_MAX) return res[b][l]; for(int i =1;i<=min(b,l);i++){ int p1v=solve(res,b-i...
1,106
541
#include <iostream> using namespace std; void reverseArray(int [], int); int main() { const int size = 6; int list[size] = { 1,6,7,9,2,5 }; reverseArray(list, size); cout << list[0]; for (int i = 1; i < size; i++) { cout << "," << list[i]; } cout << endl; return 0; } void reverseArray(int list[], int size) ...
451
204
/** * Demonstrates assigning values to references in C++. * * @author Erel Segal-Halevi * @since 2018-02 */ #include <iostream> using namespace std; int main() { int* p1; //int& r1; // compile error int num = 1, num2 = 999; cout << "Pointer:" << endl; int* pnum = &num; cout << "pnum = ...
1,115
433
// 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 "chrome/chrome_cleaner/mojom/typemaps/string16_embedded_nulls_mojom_traits.h" namespace mojo { using chrome_cleaner::mojom::NullValueDataView; ...
2,347
816
#include "WallManager.h" #include "GameEngine/GameEngineMain.h" #include "Game/GameEntities/WallEntity.h" using namespace Game; WallManager* WallManager::sm_instance = nullptr; WallManager::WallManager(){ wasMouseDown = true; } WallManager::~WallManager(){ } void WallManager::Update(){ //spawn wall on mo...
838
271
#include <ESOData/Filesystem/DataFileHeader.h> #include <ESOData/Serialization/SerializationStream.h> #include <stdexcept> namespace esodata { SerializationStream &operator <<(SerializationStream &stream, const DataFileHeader &header) { stream << DataFileHeader::Signature; stream << header.version; stream <<...
735
237
#pragma once #include<../thirdparty/tinyxml/tinyxml.h> #include<memory> #include<fstream> namespace tutorial { class XMLAttribute { public: XMLAttribute() : _attrib(nullptr) {} XMLAttribute(TiXmlAttribute *attrib) : _attrib(attrib) {} bool is_empty() const { return _attrib == nullptr; } const char* name()...
3,225
1,270
/* * Copyright 2014-2020 Real Logic Limited. * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
14,417
4,997
#include <fstream> #include <utility> #include "blockManager.hpp" #include "eventManager.hpp" #include "global.hpp" #include "levelManager.hpp" #include "utilities.hpp" void LevelManager::setBlockHere(std::map<Point, std::unique_ptr<Block>>& currentMap, BlockId idOfBlock, int xBlock, i...
6,237
1,823
// Copyright © 2016 Venture Media Labs. // // This file is part of mxml. The full mxml copyright notice, including // terms governing use, modification, and redistribution, is contained in the // file LICENSE at the root of the source code distribution tree. #include "MordentHandler.h" #include "EmptyPlacementHandler....
955
283
////////////////////////////////////////////////////////////////////////// // Mapper068 SunSoft (After Burner II) // ////////////////////////////////////////////////////////////////////////// void Mapper068::Reset() { reg[0] = reg[1] = reg[2] = reg[3] = 0; coin = 0; SetPROM_...
2,714
1,604
#define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN #include <Windows.h> #include <cstdint> #include <string> #include <WinSock2.h> // DO NOT ENABLE THIS! THE CODE FOR THIS DOES NOT WORK YET. #define EXTENDED_HOOK 0 const std::uintptr_t find_costume_mesh_addr = 0xC8CC0U; const std::uintptr_t ech_read_meshes_addr = 0xDA...
3,976
2,079
// HttpDownloader.cpp: implementation of the CHttpDownloader class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "HttpDownloader.h" #include "Resource.h" #include "GlobalFunction.h" #include "atlenc.h" #ifdef _DEBUG #undef THIS_FILE static char T...
14,637
6,492
/* * Copyright 2019 curoky(cccuroky@gmail.com). * * 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 l...
1,012
334
// Copyright 2016 Google Inc. 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 applicable...
8,813
2,873
/*! @file TrickHLA/Interaction.cpp @ingroup TrickHLA @brief This class represents an HLA Interaction that is managed by Trick. @copyright Copyright 2019 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. No copyright is claimed in the United States under ...
51,310
17,309
/* Ray3D.cpp Written by Matthew Fisher a 3D ray represented by an origin point and a direction vector. */
111
39
#include "borrowing/borrowing.h" #include <chrono> #include <iostream> #include <thread> int main() { using borrowing::Borrowable; using borrowing::Borrowed; // Turn the string into "Hello World" const std::string goal = "Hello world"; Borrowable<std::string> str_owner("Hi"); auto change_string = [&](c...
1,126
407
#include "qquicknativeview_p.h" #include <QtCore/qbasicatomic.h> #include <QtGui/private/qhighdpiscaling_p.h> #include <QtAndroidExtras/qandroidfunctions.h> #include <QtAndroidExtras/qandroidjnienvironment.h> #include <QtAndroidExtras/qandroidjniobject.h> QT_BEGIN_NAMESPACE static QBasicAtomicInteger<uint> s_id = ...
4,541
1,316
/*============================================================================= FrTabControl.cpp: Tab control widget. Copyright Jul.2016 Vlad Gordienko. =============================================================================*/ #include "GUI.h" /*----------------------------------------------------------...
10,750
4,724
// Include the headers #include "blocks/c_code_generator.h" #include "builder/static_var.h" #include "builder/dyn_var.h" #include "blocks/extract_cuda.h" #include <iostream> // Include the BuildIt types using builder::dyn_var; using builder::static_var; static void bar(dyn_var<int*> buffer) { builder::annotate(CUDA_K...
880
378
//////////////////////////////////////////////////////////////////////////// // Module : ui.cpp // Created : 12.11.2004 // Modified : 12.11.2004 // Author : Dmitriy Iassenev // Description : User interface //////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #...
336
113