text
string
size
int64
token_count
int64
/* * PlanetMapTile.cpp * NFSpace * * Created by Steven Wittens on 26/11/09. * Copyright 2009 __MyCompanyName__. All rights reserved. * */ #include "PlanetMapTile.h" #include "Utility.h" namespace NFSpace { PlanetMapTile::PlanetMapTile(QuadTreeNode* node, TexturePtr heightTexture, Image heightImage...
2,770
820
/* octree_tests.cpp Author: Andrea Ferrario Some quick and simple tests for the octree data structure and its methods. They mostly rely on Octree's internal verify() method to check the results (or I ran them with the debugger and checked manually - no time to write better checks...) */ #include <iostream> #...
3,424
1,671
#include <bits/stdc++.h> using namespace std; const int N = 2020, inf = INT_MAX; vector<pair<int, int> > g[N]; int dist[N], par[N], n, m; bool used[N]; vector<int> path; void init(int s) { for (int i = 0; i < N; i++) dist[i] = inf; dist[s] = 0; } void dijkstra(int s) { init(s); for (int i = 0; i < n; i++) { ...
1,579
777
// https://github.com/mrdoob/three.js/blob/r129/src/renderers/webgl/WebGLClipping.js #ifndef THREEPP_GLCLIPPING_HPP #define THREEPP_GLCLIPPING_HPP #include "GLProperties.hpp" #include "threepp/cameras/Camera.hpp" #include "threepp/math/Plane.hpp" #include "threepp/core/Uniform.hpp" namespace threepp::gl { str...
5,107
1,396
#include "environmentTerrainValleys.h" #include "environment/terrain/terrainValleys.h" using namespace LGen; const std::string Command::Environment::Terrain::Valleys::KEYWORD = "valleys"; const std::string Command::Environment::Terrain::Valleys::FILE_HELP = "text/helpEnvironmentTerrainValleys.txt"; Command::Environm...
960
349
#pragma once #include "Engine/General/Core/EngineCommon.hpp" #include "Engine/Renderer/General/RenderCommon.hpp" #include "Engine/Math/Objects/AABB3.hpp" class TextureBuffer; class Material; class Framebuffer; const float MIN_EXPOSURE = 1.6f; const float MAX_EXPOSURE = 6.f; ////////////////////////////////////////...
3,214
1,009
/* MIT License Copyright(c) 2020 Evgeny Pereguda 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, ...
18,965
9,579
/*---------------------------------------------------------------------------------------------- * Copyright (c) 2020 - present Alexander Voitenko * Licensed under the MIT License. See License.txt in the project root for license information. *------------------------------------------------------------------------...
11,634
3,673
//!clang++ -std=c++1z -Weverything -Wno-c++98-compat 24a-cpp17-auto-template-parameter.cpp -o z24a.out && ./z24a.out // WARNING: bleeding edge. tested in gcc 7, possibly clang 4 // This file is optional. It's a side note about C++17 auto template parameters. // It requires clang 4 or GCC 7 to compile. // When C++17 a...
1,840
587
#include <iostream> class Circle { private: const double PI = 3.1415926; public: double m_r; double calculateZC() { return 2 * PI * m_r; } }; int main() { Circle c1; c1.m_r = 10; std::cout << "The raius of our circle = " << c1.calculateZC() << std::endl; re...
330
140
// File to test main functions #include <iostream> #include <fstream> #include <iomanip> #include <vector> #include <math.h> #include <cmath> #include <assert.h> #include <string> #include "Vector3D.hpp" #include "SimpleParticleList.hpp" #include "Spring1DForce.hpp" #include "LatticeParticleList.hpp" #include "Lattice...
2,885
1,026
/*bai 16 1325A*/ #include<stdio.h> int main(){ int T; scanf("%d",&T); while (T--) { int x; scanf("%d",&x); printf("1 %d\n",x-1); } }
169
90
// Copyright 2022 The Chromium Authors. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <ios> #include <utility> #include <vector> #include <windows.h> #include <sddl.h> #include "common/utils_win.h" #include "agent_utils_win.h" #include "agent_win.h"...
15,198
4,867
/* * AssistantPage.cpp * * Created on: Mar 20, 2022 * Author: magnus */ #include "AssistantPage.h" #include <iostream> AssistantPage::AssistantPage(const Glib::ustring &resourcePath) : m_assistantPage(nullptr), m_refBuilder(Gtk::Builder::create()) { try { m_refBuilder->add_from_resource(resourcePath...
1,119
436
/* * Copyright (c) 2016, University of Virginia * 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...
16,734
4,320
#include <vector> using namespace std; class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { vector<int> nums3(m + n, 0); int idx1 = 0, idx2 = 0, idx3 = 0; while (idx1 < m && idx2 < n) { if (nums1[idx1] <= nums2[idx2]) nums3[idx3++] = nums1[idx1++]; else...
539
254
// license [ // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. // Distributed under the MIT license. Text available here at // https://github.com/vlmillet/phantom // ] #include "Project.h" #include "CompiledSource.h" #include "Compiler.h" #include "Solution.h" #include <fstream> #includ...
8,478
2,769
// chobo-vector-view v1.01 // // A view of a std::vector which makes it look as a vector of another type // // MIT License: // Copyright(c) 2016 Chobolabs Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files(the // "Software"), to...
19,986
7,012
// Given a string containing just the characters '(' and ')', find the // length of the longest valid (well-formed) parentheses substring. // Example 1: // Input: s = "(()" // Output: 2 // Explanation: The longest valid parentheses substring is "()". // Example 2: // Input: s = ")()())" // Output: 4 // ...
1,014
346
#include <iostream> #include <vector> #include <random> #include <algorithm> #include <queue> #include <limits> void printVector(std::vector<int> array){ for (auto v:array){ std::cout << v << " "; } std::cout << std::endl; } int next_power_of_two(int v){ v--; v |= v >> 1; v |= v >> 2; ...
3,057
1,021
#include "StdAfx.h" #include "BSSynchronizedClipGenerator_1.h" #include <Common/Serialize/hkSerialize.h> #include <Common/Serialize/Util/hkSerializeUtil.h> #include <Common/Serialize/Version/hkVersionPatchManager.h> #include <Common/Serialize/Data/Dict/hkDataObjectDict.h> #include <Common/Serialize/Data/Native/hkDataO...
5,323
2,200
#define CLIENT "ClientB" #include "ClientBody.cpp"
54
23
#include <iostream> #include <time.h> #include <common/numeric.hpp> #include <common/camera_radial.hpp> #include <common/local_affine_frame.hpp> #include <common/pose_estimation.hpp> using namespace OneACPose; void compute_synthetic_LAF( const Mat34& P, const common::CameraPtr& cam, const Vec3& X, const Mat32& d...
4,003
1,398
#include "cpu.h" #include "fontset.h" #include <stdio.h> #include <stdlib.h> #include <random> // Default constructor Chip8::Chip8() {} // Default destructor Chip8::~Chip8() {} // Init registers and memory void Chip8::initialize() { // Reset registers opcode = 0; I = 0; sp = 0; // Program counter reset pc = 0...
8,979
4,858
void MDSpiImpl::OnFrontConnected() { SOIL_FUNC_TRACE; } void MDSpiImpl::OnFrontDisconnected( int nReason) { SOIL_FUNC_TRACE; SOIL_DEBUG_PRINT(nReason); } void MDSpiImpl::OnHeartBeatWarning( int nTimeLapse) { SOIL_FUNC_TRACE; SOIL_DEBUG_PRINT(nTimeLapse); } void MDSpiImpl::OnRspAuthenticate( CThostFtdcRspAu...
28,342
14,008
#include "widgetopengldraw.h" WidgetOpenGLDraw::WidgetOpenGLDraw(QWidget *parent) : QOpenGLWidget(parent) { setMouseTracking(true); updateCameraFront(); std::random_device rd; rng = std::mt19937(rd()); } WidgetOpenGLDraw::~WidgetOpenGLDraw() { // Clean state gl.glDeleteProgram(programShaderID...
34,419
12,196
/*************************************************************************** * Copyright (C) 2008 by Mikhail Zaslavskiy * * mikhail.zaslavskiy@ensmp.fr * * * * This program is free software; you can redistribute it and/or modify * *...
4,419
1,748
#include "port_io.hpp" void portWriteByte(unsigned short portAddress, unsigned char data) { __asm__ __volatile__("out %%al, %%dx" :: "a"(data), "d"(portAddress)); } unsigned char portReadByte(unsigned short portAddress) { unsigned char result; __asm__ __volatile__("in %%dx, %%al" : "=a"(result) : "d"(port...
683
234
#pragma once #include <type_traits> namespace candy { template <bool B, class T = void> using EnableIf = typename std::enable_if<B, T>::type; template <class T> using ResultOf = typename std::result_of<T>::type; template <class Base, class Derived> inline constexpr bool isBaseOf() { return std::is_base_of<Base...
459
158
#include "http_secure_args.h" namespace http { namespace { namespace ssl = boost::asio::ssl; ssl::context init_context(const https_config& conf) { int proto = conf.security_type(); if (proto == -1) { proto = ssl::context_base::sslv23; } ssl::context ctx((ssl::context::method)proto); if (...
5,731
1,918
/* * $Id: EditListEditor.cpp 2326 2013-03-21 12:41:26Z aleksoid $ * * (C) 2006-2013 see Authors.txt * * This file is part of MPC-BE. * * MPC-BE 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 v...
15,415
7,409
// // Created by zeph on 11/25/16. // /** * Combination Sum IV Difficulty: Medium Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. Example: nums = [1, 2, 3] target = 4 The possible combination ways are: (1, 1, 1,...
1,801
629
/** * Copyright (C) 2018-present MongoDB, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the Server Side Public License, version 1, * as published by MongoDB, Inc. * * This program is distributed in the hope that it will be useful, * but W...
5,625
1,828
// Fortnite (1.8) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "../SDK.hpp" namespace SDK { //--------------------------------------------------------------------------- //Functions //--------------------------------------------------------------------------- // Function QuestUpdatesLog.QuestUpdates...
7,064
2,254
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #define NDEBUG #include <cassert> #include "SingleInstance.h" #pragma package(smart_init) //--------------------------------------------------------------------------- // ValidCtrCheck is used to a...
12,766
3,817
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually #pragma once #include <common/common.h> #include <_attack_selfdestruction_result_zocl.hpp> START_ATF_NAMESPACE namespace Info { using _attack_selfdestruction_result_zoclctor__attack_s...
996
352
#include "Game.hpp" #include "Logging.hpp" #include "systems/ControlByPlayer.hpp" #include "systems/Move.hpp" #include "systems/Collide.hpp" #include "systems/FireLaser.hpp" #include "systems/ReduceLifeTime.hpp" #include "systems/SplitAsteroid.hpp" #include "systems/RemoveDead.hpp" #include "components/Motion.hpp" #...
3,264
1,166
/* ============================================================================== synthManager.cpp Created: 6 Jul 2014 10:01:40pm Author: yvan ============================================================================== */ #include "synthManager.h" #include "../internalHeaders.h" YSE::SYNTH::mana...
1,240
372
#include "commands.hpp" TInt64 CliTask::command_less(TInt ac, char **av) { if (ac != 2) { return Error("%s requires 1 argument", av[0]); } FileDescriptor *fd; fd = OpenFile(av[1]); if (!fd) { return Error("Could not open %s", av[1]); } else { char buf[512]; TInt count = 0; for (;;) {...
789
306
#ifndef __ARM_FIREWALL_HPP__ #define __ARM_FIREWALL_HPP__ #include "ros/ros.h" #include "siar_driver/SiarArmCommand.h" #include "siar_driver/SiarStatus.h" #include <boost/array.hpp> class ArmFirewall { public: static bool checkJointLimits(const boost::array<int16_t, 5> joint_values) { bool ret_val = (joint_v...
1,346
569
#include "stdafx.h" #include "DX11VertApi.h" #ifdef USE_DX11_GPUAPI ID3D11InputLayout* DX11Vertex_Pos::inputLayout = 0; ID3D11InputLayout* DX11Vertex_PosCol::inputLayout = 0; ID3D11InputLayout* DX11Vertex_PosNor::inputLayout = 0; ID3D11InputLayout* DX11Vertex_PosNorTex::inputLayout = 0; bool DX11_VertApi::InitInputL...
2,210
887
#include<iostream> using namespace std; struct graphNode { int vertex; struct graphNode* next; }; class graph { private: static const int NUM_VERTEX = 10; graphNode* V[NUM_VERTEX]; int numEdges[NUM_VERTEX]; bool visited[NUM_VERTEX]; graphNode* createNode(int verte...
2,106
656
//********************************************************* // LinkDelay.cpp - manipulate the link delay file //********************************************************* #include "LinkDelay.hpp" char * LinkDelay::PREVIOUS_LINK_DELAY_FILE = "PREVIOUS_LINK_DELAY_FILE"; char * LinkDelay::PREVIOUS_LINK_DELAY_FORMAT = "P...
2,712
1,042
#include <iostream> #include <stack> #include <string> using namespace std ; int main() { string stI, stO ; int j = 0 ; cin >> stI ; cin >> stO ; stack <char> S ; // S.push(stI[0]) ; for(int i = 0; i < stI.length() ; i++) { if(stO[j] == S.top()) { S.pop() ; j++ ; } else ...
475
220
#include "gtest/gtest.h" #include "util/math/matrix.h" TEST(Matrix, sum_1by1) { Matrix m1(std::vector<double>{0.5}, 1, 1); Matrix m2(std::vector<double>{91.2}, 1, 1); Matrix calculated = m1.plus(m2); Matrix actual(std::vector<double>{91.7}, 1, 1); ASSERT_EQ(actual.get(0, 0), calculated.get(0, 0)); } TEST...
2,050
1,243
void insert(int *arr, int len) { int i, j, t; for (i = 1; i < len; ++i) // 从第二个数开始(索引1),一共 len - 1 轮 { t = arr[i]; for (j = i - 1; j >= 0 && t < arr[j]; --j) arr[j + 1] = arr[j]; arr[j + 1] = t; } }
212
136
#include <iostream> #include <fstream> using namespace std; int main() { ifstream fin("cowsignal.in"); ofstream fout("cowsignal.out"); int m, n, k; fin >> m >> n >> k; char arr[m*n]; string temp = ""; char ans[(m*k)*(n*k)]; for(int a=0; a<m*n; a++){ fin >> arr[a]; } for(int a=0; a<=m*n; a++){ ...
623
282
#ifndef PLANETS_HPP #define PLANETS_HPP #include <memory> #include <map> #include <glbinding/gl/gl.h> #include <glm/gtc/type_precision.hpp> #include <glm/gtc/matrix_transform.hpp> #define GLFW_INCLUDE_NONE #include <GLFW/glfw3.h> // use gl definitions from glbinding using namespace gl; struct Planet{ Planet(glm::f...
1,396
557
std::unordered_map<std::string, std::string> healthItems = { { "544fb45d4bdc2dee738b4568", "Salewa"}, };
106
55
// Copyright Carl Philipp Reh 2006 - 2019. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <sge/renderer/dim2.hpp> #include <sge/renderer/pixel_rect.hpp> #include <sge/renderer/pixe...
2,009
731
/* Copyright 2021 The Silkworm 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 agreed ...
5,648
1,773
#include "ConeWithFalloff.h" #include <GTSL/Math/Math.hpp> ConeWithFalloff::ConeWithFalloff(const float Radius, const float Length) : Cone(Radius, Length) { } ConeWithFalloff::ConeWithFalloff(const float Radius, const float Length, const float ExtraRadius) : Cone(Radius, Length), ExtraRadius(ExtraRadius) { } float ...
438
168
#include "PhysXScene.h" #include "PhysXStaticBody.h" #include "PhysXDynamicBody.h" #include "../../Core/Unused.h" #include "PhysXCollider.h" #pragma warning(disable: 26812) namespace Jimara { namespace Physics { namespace PhysX { namespace { #define JIMARA_PHYSX_LAYER_COUNT 256 #define JIMARA_PHYSX_LAYER_DATA_B...
28,086
11,523
/** * \file gauss_lobatto.hpp * \author Bryan Flynt * \date Sep 02, 2021 * \copyright Copyright (C) 2021 Bryan Flynt - All Rights Reserved */ #pragma once #include <cassert> #include <vector> #include "polycalc/parameters.hpp" #include "polycalc/polynomial/jacobi.hpp" namespace polycalc { names...
3,916
1,406
#include "ColorConditionPosition.h" #include "renderer/PMOptixRenderer.h" #include <QLocale> #include <QVector> #include <QColor> ColorConditionPosition::ColorConditionPosition(const QString& node, const optix::float3& hsvColor) : m_node(node), m_hsvColor(hsvColor) { } /// adapted from http://www.cs.rit.edu/~ncs/c...
1,277
468
// Copyright(c) 2021 Hansen Audio. #include "ha/dsp_tool_box/filtering/one_pole.h" #include "gtest/gtest.h" using namespace ha::dtb::filtering; /** * @brief one_pole_test */ TEST(one_pole_test, test_one_pole_initialisation) { auto one_pole = OnePoleImpl::create(); EXPECT_FLOAT_EQ(one_pole.a, 0.9); EXPE...
470
192
#include <iostream> #include <map> #include <string> #include <set> using namespace std; /** Напишите функцию BuildMapValuesSet, принимающую на вход словарь map<int, string> и возвращающую множество значений этого словаря: */ set <string> BuildMapValuesSet(const map<int, string>& m) { set <string> res; for(au...
376
140
/* * Copyright 2012 Rolando Martins, CRACS & INESC-TEC, DCC/FCUP * * 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 * * Unle...
12,094
4,557
// This file is distributed under the BSD 3-Clause License. See LICENSE for details. #include "pass_bitwidth.hpp" #include <algorithm> #include <cmath> #include <vector> #include "bitwidth_range.hpp" #include "lbench.hpp" #include "lgedgeiter.hpp" #include "lgraph.hpp" // Useful for debug //#define PRESERVE_ATTR_NO...
28,297
11,090
/* Copyright (c) <2003-2021> <Newton Game Dynamics> * * 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, * includi...
10,292
4,298
// B. MEXor Mixup #include <iostream> using namespace std; // Method to calculate xor int computeXOR(int n) { // Source - https://www.geeksforgeeks.org/calculate-xor-1-n/ // If n is a multiple of 4 if (n % 4 == 0) { return n; } // If n%4 gives remainder 1 if (n % 4 == 1) { r...
944
360
#include "stdafx.h" #include "netdata/fragments_server.h" namespace serverdata { static const fragmentCollection_t fragments[] = { COLLECTION_ELEMENT(Array), COLLECTION_ELEMENT(ArrayPacked), COLLECTION_ELEMENT(GameinfoSet), COLLECTION_ELEMENT(AccInfo), COLLECTION_ELEMEN...
2,081
716
#include <motor_manager.h> #include <thread> #include <motor_subscriber.h> int main() { MotorSubscriber<MotorStatus> sub; while(1) { MotorStatus status = sub.read(); std::vector<MotorStatus> statuses(1, status); std::cout << statuses << std::endl; std::this_thread::sleep_for(st...
359
129
//Language: GNU C++ //In the name of God #include <iostream> #include <algorithm> #include <vector> #include <cstdlib> #include <map> #include <cstdio> using namespace std; #define mp make_pair #define X first #define Y second #define lol long long const int MAXN=510; lol dis[MAXN][MAXN],a[MAXN],ans[MAXN]; int mai...
775
393
#pragma once #include "Layer.h" #include "Map.h" #include "TileSet.h" Layer::Layer() { } Layer::Layer(Map * map) : map(map) { } Layer::~Layer() { } void Layer::DrawRect(SDL_Rect* srcRect, SDL_Texture* texture, SDL_Rect* destRect, SDL_Renderer& ren) { SDL_RenderCopy(&ren, texture, srcRect, destRect); } void Layer...
450
201
// ################################################################################## // // UDMlib - Unstructured Data Management Library // // Copyright (C) 2012-2015 Institute of Industrial Science, The University of Tokyo. // All rights reserved. // // Copyright (c) 2015 Advanced Institute for Computational Science,...
79,644
32,496
/* * PackageLicenseDeclared: Apache-2.0 * Copyright (c) 2015 ARM 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unles...
2,567
874
/** * @author : archit * @GitHub : archit-1997 * @Email : architsingh456@gmail.com * @file : russianDollEnvelopes.cpp * @created : Friday Aug 20, 2021 19:49:02 IST */ #include <bits/stdc++.h> using namespace std; bool compare(const vector<int> &a,const vector<int> &b){ if(a[0]==b[...
981
358
// Include file and line numbers for memory leak detection for visual studio in debug mode // NOTE: The current implementation of C++11 shipped with Visual Studio 2012 will leak a single // 44-byte mutex (at_thread_exit_mutex) internally if any threads have been created. This // will show up in the output window wi...
6,160
2,051
#include "class_6.h" #include "class_0.h" #include "class_8.h" #include "class_5.h" #include "class_7.h" #include "class_4.h" #include <lib_8/class_9.h> #include <lib_13/class_3.h> #include <lib_13/class_2.h> #include <lib_0/class_0.h> #include <lib_11/class_6.h> class_6::class_6() {} class_6::~class_6() {}
310
156
/*++ Copyright (c) 2002 Microsoft Corporation Module Name: SecurityDatabase.cpp Abstract: Implementation of CSecurityDatabase interface SecurityDatabase is a COM interface that allows users to perform basic operations on SCE security databases such as analysis, import and ex...
8,922
2,929
#include "surfmesher_predefined.h" #include "../../MeshHandler/chi_meshhandler.h" #include "../../Region/chi_region.h" #include "../../Boundary/chi_boundary.h" #include<iostream> #include <chi_log.h> extern ChiLog& chi_log; void chi_mesh::SurfaceMesherPredefined::Execute() { chi_log.Log(LOG_0VERBOSE_1) << "Surface...
1,538
475
/* Library for RGB and HSV colour settings of two LEDs. Input is in form of a struct, {R, G, B, H, S, V, end} */ #include "WProgram.h" #include "Colour.h" #include "MyTypes.h" // Code that gets called on import of colour class Colour::Colour(byte pointless) // needs an input { // prepare pins for output - DO...
4,299
2,352
class Solution { public: bool isPalindrome(string s) { if (s.size() == 0) { return true; } vector<char> v; for (int i = 0; i < s.size(); ++i) { if (isalnum(s[i])) { v.push_back(s[i]); // cout << s[i]...
1,034
366
#ifndef KING_VECTORTYPE_HPP #define KING_VECTORTYPE_HPP namespace king { // Vectors Types Predefinition template <typename T> class Vector2; template <typename T> class Vector3; template <typename T> class Vector4; // Most Commom Vectors Types typedef Vector2<float> Vector2f; typedef Vector2<int> Vector2i;...
476
184
#include <string> #include <iostream> void startHeader(std::string locationName){ std::cout << "**********" << locationName << "**********\n"; } void finishHeader(std::string locationName){ std::cout << "**********"; for(unsigned int i=0;i<locationName.length();i++){ std::cout << "*"; } st...
1,961
660
// // Kiwi_External.h // Kiwi_External // // Created by Pierre on 04/04/2018. // Copyright © 2018 Pierre. All rights reserved. // #pragma once #include <cstdlib> #include <stdexcept> #include <string> #include <vector> //#include <variant> #ifdef _WIN32 #ifdef KIWI_LIBRARY_EXPORTS #define KIWI_LIBRARY_EXTERN __d...
4,026
1,143
#include "iostream" using namespace std; namespace one { void fun() { cout << "echo one func()\n"; } }
123
42
// Copyright 2013 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 "chromeos/dbus/shill/fake_modem_messaging_client.h" #include <algorithm> #include <string> #include <vector> #include "base/callback.h" #includ...
2,550
786
#include "../../include/types/Criteria.h" #include "../../include/types/Criterion.h" #include "../../include/utils.h" #include <algorithm> #include <iostream> #include <numeric> #include <string> #include <vector> Criteria::Criteria(std::vector<Criterion> &criterion_vect) { std::vector<std::string> crit_id_vect; f...
4,157
1,516
/* Sirikata * Meshdata.hpp * * Copyright (c) 2010, Daniel B. Miller * 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 copy...
15,144
4,714
#include <iostream> #include <cfloat> #include "cxxprintf.hh" int main(){ std::cout << putf("%3d\n", 23) << putf("%a\n", 256.); std::cerr << putf("%Le\n", LDBL_MAX) << putf("%p", NULL); }
191
91
// // Created by Shuhao Zhang on 3/3/20. //https://stackoverflow.com/questions/275004/timer-function-to-provide-time-in-nano-seconds-using-c/11485388#11485388 #include "clock.h" #include <iostream> #include <thread> int x::test_clock() { // Define real time units typedef std::chrono::duration<unsigned long l...
1,040
382
/****************************************************************************** Module: MMFSparse.cpp Notices: Copyright (c) 2000 Jeffrey Richter ******************************************************************************/ #include "..\CmnHdr.h" /* See Appendix A. */ #include <tchar.h> #include <Windo...
8,616
2,952
#include <iostream> #include "Tree.h" using namespace std; Tree::Tree() { root = NULL; } void Tree::insert(double value) { Tnode* ptr = new Tnode(value); Tnode* temp = root; if (root == NULL) { root = ptr; } else { while (temp != NULL) { if (temp->data > value && temp->left == NULL...
1,565
683
#include <SFML/Graphics.hpp> #include <unistd.h> #include <cmath> #include <iostream> void drawLineRed(int x1, int y1, int x2, int y2, sf::RenderWindow &window) { const int deltaX = abs(x2 - x1); const int deltaY = abs(y2 - y1); const int signX = x1 < x2 ? 1 : -1; const int signY = y1 < y2 ? 1 : -1; int error = ...
4,865
2,278
#include "SceneGame.h" CSceneGame::CSceneGame() { } CSceneGame::~CSceneGame() { } bool CSceneGame::Load() { return false; } void CSceneGame::Initialize() { m_Game.Initialize(); } void CSceneGame::Update() { FadeInOut(); if (m_bEndStart) { return; } m_Game.Update(); // if (g_pInput->IsKeyPush(MOFKEY_F2)) { i...
780
369
#include "root.h"
18
9
// Thermistor utility functions // // Author: Matthew Knight // File Name: util.hpp // Date: 2019-08-12 #pragma once #include <iterator> namespace Thermistor { // constexpr range checker. predicate is used to compare every element and // its predesesor template <typename Iterator, typename Predicate> constexpr b...
1,448
487
#ifndef CLICK_AUTODPAINT_HH #define CLICK_AUTODPAINT_HH #include <click/element.hh> CLICK_DECLS /* =c AutoDPaint(COLORANGE,OPERATIONCOLOR) =s autoDpaint sets packet two layers' autodpaint annotations =d The first layer Paint is to protect the consistency of the packet copys: Sets each packet's first Paint annota...
1,306
478
#include <iostream> using namespace std; int main() { float n; float pi; cin>>n; int i=0; int n1=n; while(n>0) { pi=(float)22/7; cout.precision(n); cout<<pi; while(i) { cout<<'*'; i--; } i=n1-n+1; n--; cout<<endl; } cout<<"3"<<endl<<"Fill Setting:*"; ...
388
186
{std::array<float,2>{0.407800078f, 0.8442536f}, std::array<float,2>{0.587527096f, 0.23548229f}, std::array<float,2>{0.978728712f, 0.646827936f}, std::array<float,2>{0.130732656f, 0.300448418f}, std::array<float,2>{0.103660405f, 0.522768974f}, std::array<float,2>{0.782684922f, 0.481478781f}, std::array<float,2>{0.713951...
200,731
147,484
// // This file is a part of UERANSIM open source project. // Copyright (c) 2021 ALİ GÜNGÖR. // // The software and all associated files are licensed under GPL-3.0 // and subject to the terms and conditions defined in LICENSE file. // #pragma once #include <string> #include <vector> namespace io { void CreateDirect...
1,206
389
#include "LargeMap.hpp" LargeMap::Map LargeMap::_map{ {"foo", {{"bar42", 42}, {"bar43", 43}, } }, };
136
62
#ifndef TRK_DATA_LOG_HH #define TRK_DATA_LOG_HH #include <stdio.h> // FILE #include <stdint.h> // Requires C99 #include <string> #include <vector> #include "LogFormatter.hh" #include "ParamDescription.hh" class TRK_DataLog { public: static const int LittleEndian; static const int BigEndian; std::vec...
1,183
378
#pragma once #include <dunatk/map/map.hpp> #include <dunatk/map/tile.hpp> #include <dunatk/map/tileblock.hpp> namespace eXl { class MapSet : public HeapObject { MapSet(); public: IntrusivePtr<SpriteDesc const> texFloor; IntrusivePtr<SpriteDesc const> texFloorBorder; IntrusivePtr<SpriteDesc const...
1,095
449
#include "step_rain_of_chaos_game_test_ActorMoveScene.h" #include <new> #include <numeric> #include "2d/CCLabel.h" #include "2d/CCLayer.h" #include "base/CCDirector.h" #include "base/CCEventDispatcher.h" #include "base/CCEventListenerKeyboard.h" #include "base/ccUTF8.h" #include "cpg_SStream.h" #include "cpg_StringT...
5,735
2,446
#include <iostream> #include <map> #include <vector> using namespace::std; class Solution { public: int removeDuplicates(vector<int>& nums) { int cur=0; map<int,int>m; for (int i = 0; i < nums.size(); i++) { if (m.find(nums[i])==m.end()) { //...
451
165
/* author Oliver Blaser date 17.12.2021 copyright MIT - Copyright (c) 2021 Oliver Blaser */ #include <algorithm> #include <string> #include <vector> #include "omw/defs.h" #include "omw/io/serialPort.h" #include "omw/string.h" #include "omw/windows/windows.h" namespace { #ifdef OMW_PLAT_WI...
2,957
1,108
// Copyright (c) 2022, Hoang Giang Nguyen - Institute for Artificial Intelligence, University Bremen #include "Controllers/RobotController.h" #include "Animation/SkeletalMeshActor.h" DEFINE_LOG_CATEGORY_STATIC(LogRobotController, Log, All); URobotController::URobotController() { } void URobotController::...
531
200