text
string
size
int64
token_count
int64
#include "../../utils/testing/test-wrapper.cpp" #include "main.cpp" void test() { test_int128(); //test_float128(); test_clock(); test_rd(); test_policy(); }
164
69
/* ======================================================================= Copyright (c) 2011-2014, Institute for Microelectronics, Institute for Analysis and Scientific Computing, TU Wien. ----------------- Vie...
3,588
1,243
#define __USE_MINGW_ANSI_STDIO 0 #include <iostream> #include <iomanip> #include <stdio.h> #include <stdlib.h> #include <vector> #include <algorithm> #include <queue> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <stack> #include <deque> #include <string.h> #include <sstream> ...
2,367
1,081
#ifndef Request_hpp_INCLUDED #define Request_hpp_INCLUDED #include "Semaphore.hpp" class Request { protected: Semaphore returnSema; public: virtual void execute() = 0; virtual bool shouldTerminate() = 0; void waitReturn(); virtual ~Request(); }; #endif
277
100
// Copyright 2019 Google LLC & Bastiaan Konings // 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 o...
1,699
482
/* * test.cpp * * Created on: 27 avr. 2010 * Author: mfe */ #include <windows.h> #include <winbase.h> #include <stdio.h> #include <conio.h> #include <string.h> #include <cmath> #include "K10.h" #include <iostream> using namespace std; int main() { string port = K10::isConnected(); cout...
719
313
#include "clock.h" #include "receiver.h" #include "sender.h" //############################ Configurations ############################### int IPMODE; // msg_stdout_freq: the sender/receiver sends the message to stdout once every // msg_stdout_freq messages. uint64_t msg_stdout_freq; // Sender configuration // send_i...
3,216
1,131
/** * Copyright (C) 2022-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...
18,358
4,801
#pragma once #include "GameStateManager.h" #include "IGameState.h" #include <assert.h> GameStateManager::GameStateManager() { } GameStateManager::~GameStateManager() { for (auto iter = m_registeredStates.begin(); iter != m_registeredStates.end(); iter++) delete iter->value; m_registeredStates.clear(); } void Gam...
2,556
961
#include<iostream> #include<cmath> #include<vector> #include<map> #include<algorithm> #include <sstream> using namespace std; bool is_prime(int n){ for(int i=2; i*i<=n; i++) if(n%i==0)return false; return true; } string toString(int a){ ostringstream oss; oss << a; return oss.str(); } int toInt(...
861
383
#include "Connection.h" Connection::Connection(SOCKET socket, Recipient recipient) : _socket(socket), _recipient(recipient) { } Connection::~Connection() { } SOCKET Connection::socket() const { return _socket; } void Connection::setSocket(const SOCKET &socket) { _socket = socket; } Recipient Conn...
467
166
#if !defined(DOUBLETAKE_THREADMAP_H) #define DOUBLETAKE_THREADMAP_H /* * @file threadmap.h * @brief Mapping between pthread_t and internal thread information. * @author Tongping Liu <http://www.cs.umass.edu/~tonyliu> */ #include <assert.h> #include <pthread.h> #include <stdint.h> #include <stdlib.h> #include ...
5,418
1,776
#ifndef APP_H #define APP_H #include "sampleslib/app.hpp" namespace chalet { class App : public sampleslib::App { public: App(); private: }; } #endif // !APP_H
193
77
#include <iostream> #include <cmath> using namespace std; float qual_seno_do_angulo(float x, int n); int qual_o_fatorial(int y); int main() { float alfa; int num_termos; cin >> alfa >> num_termos; cout << qual_seno_do_angulo(alfa, num_termos); return 0; } int qual_o_fatorial(int y){ int j, ...
659
290
/************************************************************************ * * * Copyright (C) 2007 Christina Warrender and Drew Levin * * * * This file is part of ...
19,537
6,654
#include "clang/Driver/CompilationInfo.h" #include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/Driver.h" using namespace clang::compilationinfo; namespace { const char ellcc_linux[] = "global:\n" " static_default: true\n" "compiler:\n" " cxx_include_dirs:\n" " - $R/include/c++\n" "assemb...
14,943
6,582
#include <iostream> #include <fstream> using namespace std; int main() { ifstream fin("input.txt"); int n1, n2; fin >> n1; fin >> n2; bool** mas = new bool*[n1]; for (int i = 0; i < n1; i++) mas[i] = new bool[n1]; for (int i = 0; i < n1; i++) { for (int j = 0; j < n1; j++) { mas[i][j]...
797
421
/* * Copyright (c) 2014, Freescale Semiconductor, Inc. * Copyright 2016-2017 NXP * All rights reserved. * * * SPDX-License-Identifier: BSD-3-Clause */ #include "erpc_basic_codec.h" #include <cassert> using namespace erpc; //////////////////////////////////////////////////////////////////////////////// // Code...
7,093
2,512
//------------------------------------------------------------------------------ // Capnp2DbEngine.cpp // (C) 2016 n.lee //------------------------------------------------------------------------------ #include "Capnp2DbEngine.h" #include <capnp/schema-parser.h> #include <capnp/message.h> #include <capnp/serialize-p...
15,603
6,127
/* * StdStringFile.cpp * */ #include "StdStringFile.h" #include <string.h> #include <assert.h> namespace Npfs { StdStringFile::StdStringFile(const char* filename, Npfs::Directory* parent, std::string& storage, uint16_t umask) : Npfs::Resource(filename, parent), fileData(storage), updateHandler(0), changeHandl...
3,978
1,399
#include "Pot.h" Pot::Pot(unsigned int pin, unsigned int offset) : _pin(pin), _offset(1023 - offset){ assert(pin >= 14 && pin <= 19); //Analog pins range from 14-19 assert(offset < 1023); //Offset must be less than 1023 } Pot::~Pot(){} int Pot::value(){ return analogRead(_pin) - _offset; } unsigned int Pot:...
439
164
#include "util.h" #include "log.h" void throwIfNotOk(HRESULT result, const char* message) { if(result != S_OK) { LOG(ERROR) << "result (=0x" << std::hex << result << ") != S_OK, " << message; throw message; } } void throwIfNull(void* ptr, const char* message) { if(ptr == nullptr) { LOG(ERROR) << "ptr == null...
361
147
/* Global constraint circuit using "orbits" in Gecode. The following model implements the constraint circuit using permutation orbits of the first element in the array (x). (It was created when playing around with some other problem in MiniZinc.) For more about the circuit constraint, see the Global C...
3,119
1,217
#ifndef LLW_TOOL_HPP #define LLW_TOOL_HPP #include "lunarlady/math/vec2.hpp" #include "wx.hpp" #include "WorldEditor/ToolAction.hpp" class WorldView; class World; class Tool { public: Tool(WorldView* iWorldView, ToolAction iToolAction); virtual ~Tool() {} virtual bool onInput(const ::lunarlady::math::vec2& moveme...
518
192
#include <fstream> #include <iostream> #include <cassert> #include "mdReader.h" namespace sp{ MDReader::MDReader(std::string path){ this->path = path; std::ifstream fin(path); if(!fin.is_open()){ std::cout << "app file not opened." << std::endl; } assert(fin.is_open()); char c; cha...
6,365
2,118
#include "dodopch.h" #include "Renderer.h" using namespace Dodo::Environment; bool Dodo::Rendering::CRenderer::m_bFramebufferResized = false; DodoError Dodo::Rendering::CRenderer::Initialize(std::shared_ptr<VKIntegration> _integration, std::shared_ptr<CWindow> _window) { m_pIntegration = _integration; m_pWindow ...
63,015
25,606
#include "voronoi/delaunay/delaunay.hpp" vo::delaunay::triangulation vo::delaunay::triangulate(const std::vector<math::point2d>& points) { (void)points; // TODO(kyle): implement return {}; }
204
81
// Copyright (C) 2015 Elviss Strazdins // This file is part of the Ouzel engine. #include "stdafx.h"
102
43
#include<iostream> using namespace std; int binsrch(int low,int high,int a[],int no) { if ( low <= high ) { int mid=(low+high)/2; if(no==a[mid]) { return mid; } else if(no<a[mid]) { return binsrch(low,mid-1,a,no); } else if(no>a[mid]) { ...
665
276
#include "FilmHandlers.h" #include "../exceptions/BadRequest.h" #include "../exceptions/PermissionDenied.h" #include "../models/Comment.h" #include "../models/Film.h" #include <sstream> #include <vector> using namespace std; map<string, string> ShowCreateFilm::handle(Request *req) { map<string, string> context; ...
17,945
5,903
#include <iostream> #include <PcapFileDevice.h> int main() { std::cout << pcap_lib_version() << '\n'; pcpp::PcapNgFileReaderDevice input_file("/Users/nanxiao/Downloads/capture.pcapng"); if (input_file.open()) { std::cout << "Open successfully\n"; } else { std::cerr << "Open failed\n"; return 1; } std::cou...
770
323
#include "FBStateNormal.h" #define OWN_DISTANCE = 13 FBStateNormal::FBStateNormal(FootsketBall& gameObject):_GameObject(gameObject) { } bool FBStateNormal::Update(unsigned milis) { return true; }
203
77
/* Copyright 2016 Adam Smith & Fabio Caraffini (Original Java version) 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...
1,178
442
// mymain.cc: // To simulate particle events with their transverse momentum and energy // Created By: Milan Ganai // December 2017 #include "Pythia8/Pythia.h" #include "Pythia8Plugins/FastJet3.h" using namespace Pythia8; //========================================================================== // Method to pick...
4,535
1,780
#include <string> int main() { int* p; p = new int; // allocate a single int, uninitialized delete p; // deallocate it p = new int(2); // allocate a single int, initialized with 2 delete p; // deallocate it std::string* p2; p2 = new std::string; // allocate a single string, default-ini...
632
207
/*++ Copyright (c) 1996-2000 Microsoft Corporation Module Name: sdchk.cxx Abstract: This module implements Security Descriptors Checking. Author: Daniel Chan (danielch) 30-Sept-96 --*/ #include <pch.cxx> #define _NTAPI_ULIB_ #define _UNTFS_MEMBER_ //#define TIMING_ANALYSIS ...
82,726
21,456
#include <iostream> #include <tuple> #include <cmath> #include <climits> #ifdef LONGNUM #include <boost/multiprecision/cpp_int.hpp> namespace mp = boost::multiprecision; #endif //LONGNUM template<typename T> constexpr size_t bit_size() { return sizeof(T) * CHAR_BIT; } template <typename Tnum> std::tuple<Tnu...
5,940
2,697
#include "test.h" #ifndef DISABLE_CPP11 #include "../../main/cpp/thread_map.h" #include <memory> #include <thread> #include <vector> #define ptr() std::unique_ptr<JNIEnv>((JNIEnv *)new int(0)) TEST(ThreadMapPutGetDeleteTest) { ThreadMap map; auto p1 = ptr(); auto pid = 999; auto name = "name321"; // map...
4,102
1,732
#include <pybind11/numpy.h> #include <pybind11/pybind11.h> #include "uniform_boundaries.h" using namespace pybind11::literals; PYBIND11_MODULE(boundaries, m) { m.doc() = R"pbdoc( Uniform boundaries and mixture supermartingales. See package documentation at https://github.com/gostevehoward/confseq. All...
4,895
1,726
/* * Copyright 2011 Steven Gribble * * This file is part of the UW CSE 333 course project sequence * (333proj). * * 333proj 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 3 of the ...
5,990
2,190
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; bool check(const string& _a, const string& _b) { // O(n*m) lol no thanks // more like O(n+m+52) bool arr[52] = {false}; for(auto& a : _a) arr[a - 'a'] = true; for(auto& b : _b)...
654
272
// **************************************************************************** // // Copyright (c) 2014, Seth Billings, Russell Taylor, Johns Hopkins University // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the ...
13,301
4,953
#include "Engine/Physics/GravityForceGenerator.hpp" #include "Engine/Math/Vector2.hpp" #include "Engine/Physics/RigidBody.hpp" GravityForceGenerator::GravityForceGenerator(const Vector2& gravity) noexcept : ForceGenerator() , m_g(gravity) { /* DO NOTHING */ } void GravityForceGenerator::notify([[maybe_unused]] T...
615
222
// Copyright 2020 Christopher A. Taylor /* Binary serialization tools */ #pragma once #include "kvm_core.hpp" #include <string.h> namespace kvm { //------------------------------------------------------------------------------ // Byte Order // Swaps byte order in a 16-bit word CORE_INLINE u...
16,140
6,528
#include<bits/stdc++.h> using namespace std; int main(){ int T; cin>>T; while(T>0){ int N,ele; cin>>N; vector<vector<int>>vec; for(int i=0;i<N;i++){ vector<int>vec2; for(int j=0;j<N;j++){ cin>>ele; vec2.push_back(el...
757
284
//////////////////////////////////////////////////////////////////////////////// /// Modern OpenGL Wrapper /// /// Copyright (c) 2015 Thibault Schueller /// This file is distributed under the MIT License /// /// @file shader.hpp /// @author Thibault Schueller <ryp.sqrt@gmail.com> ///////////////////////////////////////...
1,357
384
#include "Calibration/EcalTBTools/interface/TB06Reco.h" /* */ // FIXME ClassImp (TB06Reco) void TB06Reco::reset() { run = 0; event = 0; tableIsMoving = 0; S6ADC = 0; MEXTLindex = 0; MEXTLeta = 0; MEXTLphi = 0; MEXTLenergy = 0.; beamEnergy = 0.; for (int eta = 0; eta < 7; ++eta) for (int ph...
561
308
/** * * Author: Juarez Paulino(coderemite) * Email: juarez.paulino@gmail.com * */ #include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> #include <cmath> #include <string> #include <algorithm> #include <sstream> #include <map> #include <set> #include <queue> using namespace std; const int MAX...
1,150
533
/********************************************************************* (c) Matt Marchant 2017 - 2021 http://trederia.blogspot.com xygineXT - Zlib license. 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 thi...
1,683
463
#pragma once #include <functional> #include <map> #include "waitqueue/waitqueue.hpp" #include "log/log.hpp" using namespace util::memorypool; using namespace util::buffer; using namespace util::mt; class BufferPool::Impl { using BufferDescriptorQueue = WaitQueue<BufferDescriptor*>; public: Impl() = default; ~I...
2,378
860
#ifndef TIKSRV_INTEROP_PLUGIN_HPP #define TIKSRV_INTEROP_PLUGIN_HPP #include "interop/command.hpp" #include "services/services_manager.hpp" #include <cstdint> #include <functional> #include <memory> #include <string> #include <vector> namespace ts::interop { class plugin { public: using export_func = std::fu...
804
283
#include <iostream> using namespace std; int main() { int t = 1; while(true){ int io,jo; cin >> io >> jo; if( io == 0 && jo == 0) return 0; if(t != 1) cout << endl; cout << "Field #" << t << ":" << endl; t ++; char m[io][jo]; ...
1,183
417
/* * 6502 cpu stuff */ #include <stdio.h> #include "cpu.h" #include "logger.h" #include "machine.h" extern Logger l; CPU::CPU() { using c = CPU; lookupTable = { // CHECKED and OK! // clang-format off { 0x00, "BRK", &c::Implied , 1, 7, }, { 0x01, "ORA", &c::IndirectX, 2, 6,...
47,660
21,590
#include "regexwrappers.hpp" #include "regexes.hpp" #include "utils.hpp" #include <fmt/core.h> inline int svtoi(const std::string_view sv) { return std::atoi(sv.data()); } std::pair<int, int> AsmParser::AssemblyTextParserUtils::getSourceRef(const std::string_view line) { const auto match = AsmParser::Regexes:...
16,150
5,126
#pragma once #include "murk/data.hpp" #include "murk/flows/bytes.hpp" namespace murk::crypto::aes { constexpr uint8_t sbox[256] = {0x63 ,0x7c ,0x77 ,0x7b ,0xf2 ,0x6b ,0x6f ,0xc5 ,0x30 ,0x01 ,0x67 ,0x2b ,0xfe ,0xd7 ,0xab ,0x76 ,0xca ,0x82 ,0xc9 ,0x7d ,0xfa ,0x59 ,0x47 ,0xf0 ,0xad ,0xd...
8,837
5,099
#include "lexer.h" #include <sstream> #include <cassert> using namespace riddle; void test_lexer_0() { std::stringstream ss("real a = 5 + 2;\nfalse;"); lexer l(ss); token *t0 = l.next(); assert(t0->sym == REAL_ID); token *t1 = l.next(); assert(t1->sym == ID_ID); token *t2 = l.next(); a...
822
352
#include "InputManager.hpp"
28
10
#ifndef CEREAL_DLL_USE #define CEREAL_DLL_MAKE #endif #include "derived.hpp" template void Derived::serialize<cereal::XMLOutputArchive> ( cereal::XMLOutputArchive & ar, const std::uint32_t version ); template void Derived::serialize<cereal::XMLInputArchive> ( cereal::XMLInputArchive & ar, const std::uint32_t ...
331
124
// Copyright Carl Philipp Reh 2009 - 2016. // 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 FCPPT_LOG_ENABLED_LEVELS_HPP_INCLUDED #define FCPPT_LOG_ENABLED_LEVELS_HPP_INCLUDED #incl...
813
327
/* * 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 ...
3,407
1,105
#include <Arc.h> #include <Arc/Core/EntryPoint.h> #include "EditorLayer.h" namespace ArcEngine { class Arcanist : public Application { public: Arcanist() : Application("Arcanist") { PushLayer(new EditorLayer()); } ~Arcanist() { } }; Application* CreateApplication() { return new Arcanist(...
329
141
/** * 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...
21,560
5,964
#include <algorithm> #include <vector> #include <math.h> #include <iostream> #include <stdio.h> #include <climits> using namespace std; int n, k; int grid[1002][1002]; void setIO(string name, bool includeout=false) { // name is nonempty for USACO file I/O ios_base::sync_with_stdio(0); cin.tie(0); // see Fast Inp...
1,353
535
#include "packing.hh" #include <typelib/typemodel.hh> #include <typelib/typevisitor.hh> #include <boost/lexical_cast.hpp> #include <typelib/typedisplay.hh> //////////////////////////////////////////////////////////////////////////////// // // Check some assumptions we make in the packing code // #include <boost/mpl/...
8,473
2,688
//! \file Tests for various supporting GUI methods. Doesn't actually //! try any rendering or anything like that #include "GUI/VideoPlayer.h" #include "../PartialEngine.h" #include "catch.hpp" using namespace Leviathan; using namespace Leviathan::Test; using namespace Leviathan::GUI; TEST_CASE("Leviathan VideoPla...
927
308
//+--------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation, 1992 - 1999 // // File: titletag.cxx // // Contents: Parsing algorithm for title tag in Html // // Subclassed from CPropertyText, so as to emit a third copy // of the chun...
2,926
901
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // // =========================================================================== // File: ReadyToRunInfo.cpp // // // Runtime support for Ready to Run // =========...
8,833
3,115
#include "backtrace.hpp" #include <fmt/os.h> void d20::print_backtrace() noexcept { backtrace_data data; try { data = get_backtrace(); for (auto trace:data) { fmt::print("{}\n", trace); } } catch (const exception& e) { puts(e.what()); } }
304
106
#include "assem.h" using namespace assem; /** * Instructions * **/ void Oper::output(std::ostream& os, temp::TempMap temp_map) const { std::string result; for ( auto it = assm.cbegin(); it != assm.cend(); ++it ) { if ( *it == '\'' ) { switch ( *(++it) ) { case 's': { ...
3,872
1,177
/* Angie Engine Source Code MIT License Copyright (C) 2017-2021 Alexander Samusev. This file is part of the Angie Engine Source Code. 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 re...
8,710
2,953
// #include <Common/MyInitGuid.h> #define INITGUID // #include <7zip/Archive/IArchive.h> // #include <7zip/IStream.h> // #include <7zip/ICoder.h> #include "guid.h"
164
74
#include "Precompiled.hpp" #include "CollisionSystem.hpp" #include "CollisionComponent.hpp" #include "Common/Services.hpp" #include "Game/Event/EventDefinitions.hpp" #include "Game/Event/EventSystem.hpp" #include "Game/Entity/EntitySystem.hpp" #include "Game/Component/ComponentSystem.hpp" #include "Game/Transform/Tran...
7,506
2,065
/*ckwg +5 * Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #include "vtkVgQtUtil.h" #include <QApplication> #include <QThreadStorage> #include <vtkEve...
2,111
625
#include "gtest/gtest.h" #include "test_macro.cpp" #include "pangenome/ns.cpp" #include "pangenome_graph_class.h" #include "pangenome/pannode.h" #include "pangenome/panread.h" #include "pangenome/pansample.h" #include "minihit.h" #include "localPRG.h" #include <cstdint> #include <iostream> #include "test_helpers.h" us...
56,752
24,651
/* MIT License Copyright (c) 2021 jp-96 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, distribu...
2,639
1,057
#include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> #include <iostream> #include "filter.h" using namespace std; using namespace cv; // constructor Filter::Filter(cv::Mat input_img, int size) { input_image = input_img; if (size % 2 == 0) size++; filter_size =...
1,471
519
/* This file is part of cellarium library * Copyright 2020 Andrei Ilin <ortfero@gmail.com> * * 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 limita...
8,130
2,590
#include <algorithm> #include <functional> #include <iostream> #include <string> #include <memory> #include <boost/bind.hpp> #include <boost/ptr_container/ptr_deque.hpp> #include "FWCore/Framework/interface/InputSourceMacros.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/E...
7,153
2,426
/*******************************<GINKGO LICENSE>****************************** Copyright (c) 2017-2019, the Ginkgo authors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source co...
11,811
4,214
#ifndef NAMESPACE_HPP #define NAMESPACE_HPP #include "Interfaces.hpp" #include <map> #include "AReference.hpp" #include "Symbol.hpp" class Namespace : public AReference, public IReference_inherit<Namespace>, public std::enable_shared_from_this<Namespace> { public: const std::shared_ptr<const Symbol> name; vir...
1,074
380
//Лазарев Алексей //Вместо того чтобы использовать постоянное значение для заполнения //контейнера, иногда желательно вычислить свое значение для каждого элемента //Это можно сделать с помощью алгоритма generate(породить). #include <iostream> #include <string> #include <algorithm> #include <iterator> #include <list> ...
1,151
443
#pragma once #ifndef QUATERNIONFILTER_H #define QUATERNIONFILTER_H void sep_(String type = "\t"){ Serial.print(type); } class QuaternionFilter { float GyroMeasError = PI * (40.0f / 180.0f); // gyroscope measurement error in rads/s (start at 40 deg/s) float GyroMeasDrift = PI * (0.0f / 180.0f); // gyro...
9,647
4,493
class Solution { public: vector<int> GetLeastNumbers_Solution(vector<int> input, int k) { if (input.empty() || k == 0 || k > input.size()) return vector<int>(); int left = 0, right = input.size() - 1; int index = Partition(input, left, right); while (index != (k-1)) { if...
1,133
351
#ifndef _ASSERT_UTILITIES_H_ #define _ASSERT_UTILITIES_H_ //================================================================================== // File: UtilityAssert.h // Desc: //================================================================================== //======================================================...
3,363
741
// $Header: /nfs/slac/g/glast/ground/cvs/GlastRelease-scons/gui/src/PSdraw.cxx,v 1.1.1.1 2001/01/04 01:01:11 burnett Exp $ // PostScript drawer imlementation // created by Hardy, 28 Mar 94 #include "PSdraw.h" #include "gui/DisplayRep.h" #include <cstring> #include <iostream> #include <iomanip> namespace gui { sta...
7,615
2,986
#include "SVIWizzleEffector.h" #include "SVITransitionEffector.h" #include "../SVIKeyFrameAnimation.h" namespace SVI{ static const SVIBool DEBUG = SVIFALSE; SVIWizzleEffector::SVIWizzleEffector(SVIGLSurface *surface): SVITransitionEffector(surface), mSetEffectTime(0){ } void SVIWizzleEffector::setAnimation()...
3,159
1,406
#include "driver/HiggsTDMA.hpp" #include <iostream> void HiggsTDMA::reset() { std::cout << "HiggsTDMA reset\n"; found_dead = 0; sent_tdma = 0; lifetime_tx = 0; lifetime_rx = 0; fudge_rx = 0; needs_fudge = 0; epoc_tx = 0; } bool HiggsTDMA::needsUpdate() const { return ((lifetime_tx...
353
163
#ifndef OPENGL_CUBEMAP_HPP #define OPENGL_CUBEMAP_HPP #include "Merlin/Render/cubemap.hpp" #include <stdint.h> namespace Merlin { class OpenGLCubemap : public Cubemap { uint32_t m_channel_count; uint32_t m_resolution; uint32_t m_id; public: OpenGLCubemap(const std::vector<s...
792
283
#include "menu.h" int main() { Menu_t menu; menu.start(); return 0; }
73
36
#include "defs.h" #include <windowsx.h> #ifndef VK_BROWSER_BACK #define VK_BROWSER_BACK 0xa6 #define VK_BROWSER_FORWARD 0xa7 #define VK_BROWSER_REFRESH 0xa8 #define VK_BROWSER_STOP 0xa9 #define VK_BROWSER_SEARCH 0xaa #define VK_BROWSER_FAVORITES 0xab #define VK_BROWSER_HOME ...
14,211
5,766
/* * TreeBuilderManager.cpp * * Created on: Feb 7, 2016 * Author: michel */ #include "TreeBuilderManager.hpp" #define LINUX 1 #ifdef LINUX #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #endif //standard constructor TreeBuilderManager::TreeBuilderManager(std::string method, std::string ...
6,224
2,454
// Voxel Art Plugin 2021 ~ Copyright Limit #include "Editor/VoxelModificationWorld.h" #include "Editor/VoxelEditorData.h" #include "DrawDebugHelpers.h" #include "Kismet/KismetMathLibrary.h" //#include "Noise/SimplexNoiseBPLibrary.h" #include "Helpers/VoxelTools.h" #include "Helpers/VoxelSDFUtilities.h" #include "He...
9,918
4,446
/* * Copyright (c) 1993-2017, NVIDIA CORPORATION. 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 ...
975
363
class Solution { public: int XXX(TreeNode* root) { if (root == nullptr) return 0; queue<pair<TreeNode*, int>> Q; Q.push(make_pair(root, 1)); while (!Q.empty()) { auto p = Q.front(); Q.pop(); TreeNode* node = p.first; int height = p.second; if (node -> lef...
580
198
/** SPDX-License-Identifier: MIT Licensed under the MIT License <http://opensource.org/licenses/MIT>. 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 l...
2,169
791
/* * This file is a part of Pocket Heroes Game project * http://www.pocketheroes.net * https://code.google.com/p/pocketheroes/ * * Copyright 2004-2010 by Robert Tarasov and Anton Stuk (iO UPG) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in comp...
5,231
2,516
#include "pch.h" #pragma hdrstop #include "CNATDynamicPortMappingService.h" CNATDynamicPortMappingService::CNATDynamicPortMappingService() { m_pEventSink = NULL; m_pHNetConnection = NULL; } HRESULT CNATDynamicPortMappingService::FinalConstruct() { HRESULT hr = S_OK; return hr; } ...
2,435
871
//===--------------------------------------------------------------------------------*- C++ -*-===// // _ _ // | | | | // __ _| |_ ___| | __ _ _ __ __ _ // / _` | __/ __| |/ _` | '_ \ / _` | // | (_| | || (_...
3,076
994
#include "gfx/gfx_objects.h" #include <vector> #include <string_view> #include <iostream> void LittleGFXAdapter::queryProperties() { vkPhysDeviceProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; vkGetPhysicalDeviceProperties2(vkPhysicalDevice, &vkPhysDeviceProps); std::cout << vkPhysDeviceProps...
10,438
4,151
#include <string> #include <unordered_map> #include <vector> using namespace std; /* Solution: inspired by this blog post --> https://leetcode.com/problems/exclusive-time-of-functions/discuss/1889699/CPP-O(n)-time-using-stack Time complexity: O(n) [where n is the length of logs] Space complexity: O(n) */ class Solut...
2,169
535