text
string
size
int64
token_count
int64
#include <iostream> #include <memory> #include "adapter.hpp" int main(int argc, const char *argv[]) { auto legacy = std::make_unique<legacy_rect>(1, 2, 3, 4); // x1 x2 y1 y2 auto modern = std::make_unique<rect_adapter>(1, 2, 3, 4); // x y w h legacy->legacy_print(); // prints 1 3 2 4 modern...
376
153
#include <iostream> #include <string.h> #include <exception> using namespace std; class ExcecaoCustomizada : public exception { protected: char msg[100]; public: ExcecaoCustomizada(const char* e) { strcpy(msg, e); } virtual const char* what() { ...
887
324
//===- XTenDialect.cpp ------------------------------------------*- C++ -*-===// // // This file is licensed 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 // // (c) Copyright 2021 Xilinx Inc. //...
765
286
#include "foobarnowplayingannouncer.h" #include <QDebug> #include <QThread> #include <QFile> // This should be more than enough, since the struct is smaller #define BUFSIZE 2048 struct songInfo { // These are in UTF-8; use QString::fromUtf8() to create a QString char artist[512]; char title[512]; char...
3,136
985
/* Amine Rehioui Created: May 1st 2010 */ #include "Shoot.h" #include "Color.h" namespace shoot { // static variables initialization Color Color::Red = Color(1.0f, 0.0f, 0.0f, 1.0f); Color Color::Green = Color(0.0f, 1.0f, 0.0f, 1.0f); Color Color::Blue = Color(0.0f, 0.0f, 1.0f, 1.0f); Color Color::White = C...
1,179
590
#include <queue> #include <M5Stack.h> #include <time.h> #include <WiFi.h> #include <WiFiMulti.h> #include <Ethernet.h> #include <Wire.h> #include <BME280_t.h> // import BME280 template library #include "InfluxDb.h" #include "smartmeter.h" #include "config.h" #include "debugView.h" #include "FunctionButton.h" #include "...
9,846
4,260
/** * @file llri.cpp * @copyright 2021-2021 Leon Brands. All rights served. * @license: https://github.com/Legion-Engine/Legion-LLRI/blob/main/LICENSE */ #include <llri/llri.hpp> namespace llri { [[nodiscard]] implementation getImplementation() { return implementation::DirectX12; } }
311
117
#include <iostream> #include <mosquitto_transport/a_transport_manager.hpp> #include <so_5/all.hpp> using namespace std::chrono_literals; void do_test() { mosquitto_transport::lib_initializer_t mosq_lib; so_5::launch( [&mosq_lib]( auto & env ) { env.introduce_coop( [&mosq_lib]( so_5::coop_t & coop ) { using ...
958
458
#ifndef __clang__ export module abuild.cache:abi; export import astl; #endif namespace abuild { //! The `ABI` represent the compiler toolchain //! application binary interface. export struct ABI { //! Processor architecture. enum class Architecture { //! ARM ARM, //! Intel x86 ...
867
269
#include <iostream> #include <tuple> #include <vector> #include <queue> using namespace std; vector<pair<int, int>> graph[10001]; int visited[10001]; int main() { cin.tie(NULL)->sync_with_stdio(false); int V, E; cin >> V >> E; for (int i = 0; i < E; i++) { int s, e, w; cin >> s >>...
1,201
486
#include "Engine.h" #include "D11Graphics.h" Engine::Engine() { } Engine::~Engine() { } void Engine::Initialize() { assetManager = new AssetManager(); graphics = new D11Graphics(); // Create whichever graphics system we're using and initialize it graphics->Initialize(); GameSetup(); __int64 perfFreq; Que...
12,337
4,756
#include "basic/types_bucket/types_bucket.h" // IWYU pragma: associated #include <base/memory/singleton.h> #include <base/no_destructor.h> #include <base/task/post_task.h> #include <base/threading/sequence_local_storage_slot.h> #include <base/threading/sequenced_task_runner_handle.h> #include <base/memory/ptr_util.h> ...
475
182
#include<iostream> #include<cstring> using namespace std; int note_zero[41]; int note_one[41]; void dp() { for (int i = 2; i < 41; ++i) { note_zero[i] = note_zero[i - 2] + note_zero[i - 1]; note_one[i] = note_one[i - 2] + note_one[i - 1]; } } int main(void) { ios::sync_with_stdio(false); memset(note_zero, -1, ...
607
314
/********************************************************************* ** Program Filename: Canteen.cpp ** Author: Diana Bacon ** Date: 2015-12-05 ** Description: Definition of the Canteen class. Functions and data ** related to the derived class for Canteen spaces. ********************************************...
666
186
// -*- C++ -*- // // ---------------------------------------------------------------------- // // Brad T. Aagaard, U.S. Geological Survey // Charles A. Williams, GNS Science // Matthew G. Knepley, University of Chicago // // This code was developed as part of the Computational Infrastructure // for Geodynamics (http://...
2,430
857
/** * > Author: UncP * > Github: www.github.com/UncP/Mushroom * > License: BSD-3 * > Time: 2018-7-28 15:33:00 **/ #ifndef _BATCH_HPP_ #define _BATCH_HPP_ #include "../include/utility.hpp" namespace Mushroom { class KeySlice; class Batch : private NoCopy { public: static uint32_t Si...
567
258
#include <cmath> #include <iostream> #include <mpi.h> #include "tclap/CmdLine.h" #include "typedefs.h" #include "Simulator.h" #include "Grid.h" #include "InitialCondition.h" #include "RankDependentOutput.h" #include "GlobalMatrices.h" #include "microkernels.h" void computeAuxMatrices(GlobalConstants& globals) { d...
10,980
4,377
#include "testcommon.h" #include "fitnessfunction.h" class RosenbrockFitness : public FitnessFunction { public: RosenbrockFitness() {} double eval(const RealGenotype &g) { double dx1 = g.gene[0]*g.gene[0]-g.gene[1]; double dx2 = 1.0 - g.gene[0]; return 100.0*dx1*dx1+dx2*dx2; ...
912
386
#include "Sys_Headers_Precompiled.h" //#include "Sys_Output_Flag_Dia.h" // Constructor Sys_Output_Flag_Dia::Sys_Output_Flag_Dia(QWidget *parent) : QDialog(parent){ this->old_flag=false; this->new_flag=false; ui.setupUi(this); ui.checkBox->setChecked(this->old_flag); QObject::connect(ui.okButton, SIGNAL(clicked...
3,369
1,379
#include "ServiceImpl.hpp" namespace dependent { TestBundleDSDependentOptionalImpl::TestBundleDSDependentOptionalImpl( const std::shared_ptr<test::TestBundleDSUpstreamDependency>& c) : test::TestBundleDSDependent() , ref(c) {} TestBundleDSDependentOptionalImpl::~TestBundleDSDependentOptionalImpl() = default; ...
322
104
/* * Institute of Automation - University of Bremen *BLOCKTRIX GAME AUTO PLAYER * GROUP MEMBERS: * ERIC GAMOR * JIBIN JOHN * SAMUEL APRAKU * */ #include "Player.h" void Player::Play(IBoard *pBoard) { playerBoard = dynamic_cast<BlockTrixBoard *>(pBoard); // cast pBoard to BlockTrixBoard playerBoard->...
373
140
// Copyright (C) 2007-2008 Ruben Smits <ruben dot smits at mech dot kuleuven dot be> // Copyright (C) 2008 Mikael Mayer // Copyright (C) 2008 Julia Jesse // Version: 1.0 // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be> // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be...
3,581
1,208
// Copyright (c) 2019-2020 Dr. Colin Hirsch and Daniel Frey // Please see LICENSE for license or visit https://github.com/taocpp/config/ #include <tao/config.hpp> #include <tao/config/schema.hpp> int main() { const auto tcs = tao::config::schema::from_file( "tests/schema.tcs" ); const auto data = tao::config::f...
505
195
#include "Corona.h" #include "CoronaRoundCorners.h" #include <maya/MFnDependencyNode.h> #include "utilities/attrTools.h" #include "world.h" #include "renderGlobals.h" RoundCorners::RoundCorners(MObject shaderObject) { MFnDependencyNode depFn(shaderObject); radius = getFloatAttr("radius", depFn, 0.0f); samplesCount ...
1,467
558
/** * Created by Xiaozhong on 2020/8/22. * Copyright (c) 2020/8/22 Xiaozhong. All rights reserved. */ #include "string" #include "vector" #include "iostream" #include "algorithm" using namespace std; class Solution { public: string thousandSeparator(int n) { if (n == 0) return "0"; if (n < 1000...
842
317
/***************************************************************************** / BR.cpp / / Copyright (c) 2012-2014 Dominik Martin Drzic / http://forum.cockos.com/member.php?u=27094 / https://code.google.com/p/sws-extension / / Permission is hereby granted, free of charge, to any person obtaining a copy / of th...
46,960
15,977
/// @file character.hpp /// @brief Define all the methods need to manipulate a character. /// @details It's the master class for both Player and Mobile, here are defined /// all the common methods needed to manipulate every dynamic living /// beeing that are playing. /// @author Enrico Fraccar...
21,707
6,109
//DebugWindow.hpp #pragma once #include <sstream> namespace bjoernligan { class DebugWindow : public sf::Drawable { private: DebugWindow(const bool &p_bActive); DebugWindow(const DebugWindow&); DebugWindow& operator=(const DebugWindow&); public: typedef std::unique_ptr<DebugWindow> Ptr; static Ptr Crea...
760
291
// Copyright (c) 2005-2009 Jaroslav Gresula // // Distributed under the MIT license (See accompanying file // LICENSE.txt or copy at http://jagpdf.org/LICENSE.txt) // #include "precompiled.h" #include "page_tree.h" #include "page_tree_node.h" #include "page_object.h" #include <core/generic/refcountedimpl.h> #include ...
2,512
893
/* * Matrix Market I/O library for ANSI C * * See http://math.nist.gov/MatrixMarket for details. * * */ #ifndef PAR_MM_IO_H #define PAR_MM_IO_H #include "matrix_market.hpp" #include "core/types.hpp" #include "core/par_matrix.hpp" using namespace raptor; /* high level routines */ ParCSRMatrix* read_par_mm(cons...
402
166
#pragma once #include <cstdint> #include <array> #include <limits> namespace Basic3D { //! Provides a basic z-buffer template<int WIDTH, int HEIGHT, typename Depth = std::uint16_t> class ZBuffer { public: typedef Depth depth_t; private: std::array<depth_t, WIDTH ...
867
303
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), le...
1,331
426
// included by rem_factorial_custom.tpp (in case we want to change the file location) #include <cassert> #include <NTL/ZZ_pX.h> #include <NTL/matrix.h> #include "../elements/element.hpp" #include "factorial_engine.hpp" using NTL::ZZ; using NTL::ZZ_p; using NTL::ZZ_pX; using NTL::Mat; Elt<ZZ> calculate_factorial(l...
2,353
847
#include <fstream> #include <boost/format.hpp> #include "DelaunayTriangulation.h" #include "DT_Circle.h" bool isContained(Triangle * t, Vertex * p); bool inCircle(Triangle *a, Vertex * pr); bool inCircle(Vertex * a, Vertex * b, Vertex * c, Vertex * d); Circle circleForPoints(Vertex * a, Vertex * b, Verte...
9,032
3,744
#include <algorithm> #include <iostream> #include <vector> using namespace std; inline void use_io_optimizations() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } inline void solve_with_four_left_boxes(const vector<unsigned int>& boxes) { if ((3 * boxes[0] == boxes[3]) && (boxes[1] + boxes[2] == ...
2,363
898
#include "ClosestBinarySearchTreeValue.hpp" #include <cmath> using namespace std; int ClosestBinarySearchTreeValue::closestValue(TreeNode *root, double target) { int closest = root->val; while (root) { if (abs(root->val - target) < abs(closest - target)) closest = root->val; root ...
396
124
/**************************************************************************** ** ** Copyright (C) 2011-2012 Denis Shienkov <denis.shienkov@gmail.com> ** Copyright (C) 2011 Sergey Belyashov <Sergey.Belyashov@gmail.com> ** Copyright (C) 2012 Laszlo Papp <lpapp@kde.org> ** Contact: http://www.qt-project.org/legal ** ** Th...
11,084
2,630
#include <vector> #include <map> #include<bits/stdc++.h> using namespace std; long long int max_frequency(vector<long long int> const& v) { map<long long int, long long int> frequencyMap; long long int maxFrequency = 0; long long int mostFrequentElement = 0; for (long long int x : v) { lo...
764
268
/* Upper case conversion School Accuracy: 72.51% Submissions: 1152 Points: 0 Given a string str, convert the first letter of each word in the string to uppercase. Example 1: Input: str = "i love programming" Output: "I Love Programming" Explanation: 'I', 'L', 'P' are the first letters of the three word...
1,077
385
/** * @file sample2.cpp * @author Soultatos Stefanos (stefanoss1498@gmail.com) * @brief Contains sample code for the filters * @version 2.0 * @date 2021-10-29 * * @copyright Copyright (c) 2021 * */ #include "preconditions/filters.hpp" #include <array> #include <string> namespace { // Instead of: // // if (b....
2,133
762
#include "OdysseyVulkanCore/OdysseyVulkanCore/Initialize/SubmitClasses/ImmediateSubmit.h" #include "OdysseyVulkanCore/OdysseyVulkanCore/Initialize/SubmitClasses/Exceptions.h" #include "OdysseyVulkanCore/OdysseyVulkanCore/Initialize/CreateInfo.h" #include "OdysseyVulkanCore/OdysseyVulkanCore/Utility/Macros.h" #include <...
1,899
689
/* * Copyright 2016 Alex Andres * * 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...
7,925
3,029
#include <iostream> #include <algorithm> using namespace std; bool vh[51], vv[51]; int main() { ios::sync_with_stdio(false); int n; cin >> n; for (int i = 1; i <= n*n; i++) { int h, v; cin >> h >> v; if (!vh[h] && !vv[v]) { vh[h] = vv[v] = true; cout << i << ' '; } } }
313
163
#include<iostream> using namespace std; int binary_search(int arr[],int n,int key) { int s=0; int e=n-1; while(s<=e) { int mid=(s+e)/2; if(arr[mid]==key) { return mid; } if(arr[mid]>key) { e=mid-1; } else if(arr[mid]<key) { s=mid+1; } else return -1 ; } return -1; } int main() { int n; cin>>n...
433
225
// ObjOne.cpp : implementation file // // This is a part of the Active Template Library. // Copyright (c) Microsoft Corporation. All rights reserved. // // This source code is only intended as a supplement to the // Active Template Library Reference and related // electronic documentation provided with the library. //...
2,585
973
/* * gstcreator * ExportToDotDialog.cpp * * Created on: 24 sty 2014 * Author: Marcin Kolny <marcin.kolny@gmail.com> */ #include "ExportToDotDialog.h" #include "ui_ExportToDotDialog.h" #include <QCheckBox> #include <QFileDialog> #include <cstdlib> ExportToDotDialog::ExportToDotDialog(QWidget *parent) : ...
954
378
#include "shared.h" using namespace syslib; using namespace syslib::android; namespace { typedef void (*sighandler_t)(int); sighandler_t prev_segv_handler = 0; //предыдущий обработчик сигнала SEGV // дамп карты памяти void dump_maps () { static char line [256]; FILE *fp = fopen ("/proc/self...
1,191
484
/* * Copyright (C) 2005-2013 Team XBMC * http://xbmc.org * * 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, or (at your option) * any later version. * * ...
1,532
517
#include "pch.h" #include "inc/DisjointBufferHelpers.h" namespace _winml { static void LoadOrStoreDisjointBuffers( bool should_load_buffer, size_t num_buffers, std::function<gsl::span<byte>(size_t)> get_buffer, gsl::span<byte>& buffer_span) { auto size_in_bytes = buffer_span.size_bytes(); auto buf...
1,528
554
#include "FHE.h" #include <timing.h> #include <EncryptedArray.h> #include <NTL/lzz_pXFactoring.h> #include <vector> #include <cassert> #include <cstdio> #include <iostream> #include <string> #include <string.h> #include <fstream> #include <vector> #include "NTL/ZZ_p.h" #include <NTL/ZZ_pX.h> #include <NTL/vec_ZZ_p.h> #...
726
292
#include <iostream> #include <functional> #include <future> #include <thread> #include <curl/curl.h> void GetResponse(std::future<char*> &fut) { CURL *curl; CURLcode res; char *url = fut.get(); curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_seto...
793
314
#include <bits/stdc++.h> using namespace std; const int maxN = 1e3; int n, m, q, si = 0, sj = 0; char grid[maxN][maxN + 1]; int dist[maxN][maxN], dy[4] = {0, 0, 1, -1}, dx[4] = {1, -1, 0, 0}; int valid(int i, int j) { return(!(i < 0 || i >= n || j < 0 || j >= m)); } void bfs() { memset(dist, -1, sizeof(dist)); ...
984
500
// Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #include <Rcpp.h> using namespace Rcpp; #ifdef RCPP_USE_GLOBAL_ROSTREAM Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(...
6,306
2,574
#include "CaesarCipher.hpp" #include <fstream> #include <iostream> #include <string> #include <vector> // #include "RunCaesarCipher.hpp" // #include "RunCaesarCipher.cpp" CaesarCipher::CaesarCipher(const std::string &caesar_key) : caesar_key_{std::stoul(caesar_key)} {} CaesarCipher::CaesarCipher(const size_t &caes...
1,534
469
/** * The MIT License (MIT) * * Copyright (c) 2014 Anton Dukeman * * 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 ...
2,512
803
//////////////////////////////////////////////////////////////////////////////// // Name: test-vcs.cpp // Purpose: Implementation for wex unit testing // Author: Anton van Wezenbeek // Copyright: (c) 2021 Anton van Wezenbeek //////////////////////////////////////////////////////////////////////////////// #in...
1,836
731
/* This file is part of TON Blockchain Library. TON Blockchain Library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later ver...
2,219
739
//================================================================================================================================= // Joe Schutte //================================================================================================================================= #include "BuildCommon/BakeModel.h" #incl...
3,229
840
#include <sstream> #include "assert.h" #include "test_assert.h" using std::cerr; using std::endl; using std::ostringstream; using test::fixture::Assert; START_TEST(should_not_output_when_true) { ostringstream os; Assert(true, 1, 2, os); if (os.str() != "") cerr << "should_not_output_when_true" << endl; } END_TES...
1,037
418
/* * Copyright (C) 2016 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...
1,071
416
#include "ServiceControlManager.h" #include "GetErrorMessage.h" #include <stdexcept> ServiceControlManager::ServiceControlManager() : SCM(OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS)) { if (this->SCM == nullptr) { throw std::runtime_error( "Failed In OpenSCManager Function\n" + GetErrorMessage...
432
155
#include "Arg.hpp" #include <sstream> using std::istringstream; #include <set> using std::set; #include <algorithm> using std::any_of; #include <iostream> using std::cout; using std::endl; Arg::Arg(int argc, char **argv):argc(argc),argv(argv){ programName = "Default Name"; helpSetted = false; } void Arg::...
4,415
1,383
#include <iostream> #include <vector> #include "statsapi.h" using namespace std; void main(int argc, char* argv[]) { statsAPI* api = NULL; vector<CString> args; if ((argc < 2) || (argc > 21)) return; args.resize(argc - 1); for(unsigned int i = 1; i < argc; i++) args[i - 1] = argv[i]; api = new statsAPI...
5,240
2,094
// // SortTests.hpp // tests // // Created by tuRen on 2021/5/17. // #ifndef SortTests_hpp #define SortTests_hpp #include <stdio.h> #endif /* SortTests_hpp */
165
75
#include <qubus/isl/flow.hpp> namespace qubus { namespace isl { union_access_info::union_access_info(isl_union_access_info* handle_) : handle_(handle_) { } union_access_info::union_access_info(const union_access_info& other) : handle_(isl_union_access_info_copy(other.native_handle())) { } union_access_info::~union_...
2,921
1,042
#include "productlist.h" #include "product.h" #include <sstream> #include <string> #include <vector> ProductList::ProductList(QString productClass) { utilities = new Utilities; QString filePath = utilities->generateFilePathForProduct(productClass); productsInfo = utilities->readFileByWord(filePath, true)...
3,876
1,071
#ifndef SIMSYNC_THREAD_START_HPP #define SIMSYNC_THREAD_START_HPP #include <simsync/synchronization/event.hpp> namespace simsync { class thread_start : public event { public: explicit thread_start(int32_t thread_id, thread_model &tm); transition synchronize() override; private: void print(std::ostream &stream...
378
137
// Jason Brillante "Damdoshi" // Hanged Bunny Studio 2014-2018 // // Lapin library #include "lapin_private.h" void bunny_memswap(void *a, void *b, size_t s) { void *c = bunny_alloca(s); memcpy(c, a, s); memcpy(a, b, s); memcpy(b, c, s); bunny_freea(c); }
296
163
// Copyright (c) 2015-2016 Vittorio Romeo // License: Academic Free License ("AFL") v. 3.0 // AFL License page: http://opensource.org/licenses/AFL-3.0 // http://vittorioromeo.info | vittorio.romeo@outlook.com #pragma once #include "./base.hpp" #define ECST_IMPL_DP_BASE_TEMPLATE \ templat...
4,534
1,481
// 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 "media/audio/audio_output_dispatcher.h" #include "base/bind.h" #include "base/compiler_specific.h" #include "base/message_loop.h" #include "...
4,784
1,560
#include "app.hpp" /// App #include "imgui.h" #include "imgui-SFML.h" #include "alloc.hpp" #include "particlefx.hpp" #include "particle_editor.hpp" #include "vec2.hpp" #define MAX_PARTICLES 32 #define P_RADIUS 10 #define P_SQRADIUS P_RADIUS*P_RADIUS LinearAllocator* allocator; std::vector<ParticleEmitter*> particl...
3,589
1,277
#ifndef LODTALK_MATH_HPP #define LODTALK_MATH_HPP #include "Lodtalk/ObjectModel.hpp" namespace Lodtalk { inline SmallIntegerValue divideRoundNeg(SmallIntegerValue dividend, SmallIntegerValue divisor) { // This algorithm was taken from the Squeak VM. assert(divisor != 0); if (dividend >= 0) { ...
1,503
482
#pragma once #include <string> #include <regex> #include <memory> class SwcNode { public: int id; int type; float x; float y; float z; float raidus; int parent; std::unique_ptr<SwcNode> child; std::unique_ptr<SwcNode> next; static bool try_parse(const std::string &s, std::uniq...
1,669
587
/*! \file generator_python.inl \brief Fast binary encoding Python generator inline implementation \author Ivan Shynkarenka \date 24.04.2018 \copyright MIT License */ namespace FBE { inline GeneratorPython::GeneratorPython(const std::string& input, const std::string& output, int indent, char space)...
436
137
// 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 "base/bind.h" #include "base/command_line.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_lo...
7,724
2,769
void ApplyCustomReader(vtkAlgorithm* reader, const std::string&) const override { vtkExodusIIReader* exReader = vtkExodusIIReader::SafeDownCast(reader); exReader->UpdateInformation(); exReader->SetAllArrayStatus(vtkExodusIIReader::NODAL, 1); exReader->SetAllArrayStatus(vtkExodusIIReader::ELEM_BLOCK, 1); }
315
116
/* * class: * MaterialsReq (Needed to process) = Array - Format -> {{"ITEM CLASS",HOWMANY}} * MaterialsGive (Returned items) = Array - Format -> {{"ITEM CLASS",HOWMANY}} * Text (Progess Bar Text) = Localised String * NoLicenseCost (Cost to process w/o license) = Scalar * * Example for multip...
5,254
1,991
// Copyright (c) 2005, 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 condi...
64,799
24,022
#include "VulkanObjModel.h" #include <unordered_map> #include <filesystem> #include <iostream> #include <glm/glm.hpp> #include <glm/gtx/string_cast.hpp> #define TINYOBJLOADER_IMPLEMENTATION #include <tiny_obj_loader.h> #include "../VulkanMesh.h" #include "../scene/Scene.h" #include "PbrMaterial.h" static std::stri...
3,955
1,768
/* * 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 ...
2,321
775
#include "vector.h" #include "matrix.h" #define VTYPE float Vector3DF &Vector3DF::operator*= (const MatrixF &op) { double *m = op.GetDataF (); float xa, ya, za; xa = x * float(*m++); ya = x * float(*m++); za = x * float(*m++); m++; xa += y * float(*m++); ya += y * float(*m++); za += y * float(*m++); m++; xa += ...
3,375
1,747
#include "add.cpp" #include <iostream> int main(){ wrapped_int a = 3; long long b = 2; std::cout << a[b].val << std::endl; wrapped_int &temp = a[b]; std::cout << temp.val << std::endl; }
198
83
/** * @file main.cpp * @author Shivam Akhauri (Driver),Toyas Dhake (Navigator), * @date 20 October 2019 * @copyright 2019 Toyas Dhake, Shivam Akhauri * @brief Main file for implementation of the Depth Perception project. */ #include <dlib/opencv.h> #include <dlib/gui_widgets.h> #include <dlib/image_processing/frontal_...
2,280
679
/* This file forms part of hpGEM. This package has been developed over a number of years by various people at the University of Twente and a full list of contributors can be found at http://hpgem.org/about-the-code/team This code is distributed using BSD 3-Clause License. A copy of which can found below. Copyr...
5,608
1,872
/** * @brief extended gcd * @description for given a and b, find x, y and gcd(a, b) such that ax + by = 1 * @note O(log n) * @see https://topcoder.g.hatena.ne.jp/spaghetti_source/20130126/1359171466 */ tuple<ll, ll, ll> extgcd(ll a, ll b) { ll x = 0, y = 1; for (ll u = 1, v = 0; a; ) { ll q = b / a...
2,408
1,147
// Copyright (C) 2019 Vladislav Nikonov <mail@pacmancoder.xyz> // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt) #include <exl/mixed.hpp> #include <termination_test.hpp> void termination_test() { exl::mixed<char, i...
355
144
// Project: libv.diff, File: src/libv/diff/diff.hpp, Author: Császár Mátyás [Vader] #pragma once // libv #include <libv/utility/bytes/input_bytes.hpp> #include <libv/utility/bytes/output_bytes.hpp> // std #include <optional> #include <string> #include <vector> namespace libv { namespace diff { // -----------------...
5,812
1,834
#include <fstream> #include <cctype> #include "Multiseq.h" #include "util.h" namespace loon { void Fasta::save_fasta(std::ostream& out) { out << ">" << tag << tag_remaining << std::endl; for(size_t i = 0; i < seq.length(); i += 80) out << seq.substr(i, 80) << std::endl; } char Fasta::base_rc(char c) ...
2,690
976
#include "global.h" #include "GLUtils.h" #include "GLShaderObject.h" #include "TextureManager.h" #include "Texture.h" #include "TextureAtlas.h" #include "VertexArray.h" #include "VertexBuffer.h" #include "SceneGraphNode.h" #include "ScreenObj.h" #include "VideoManeger.h" #include "DrawablePrimitive.h" CGLUtils* CGLUti...
14,696
7,002
// 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/media/router/mojo/media_router_mojo_metrics.h" #include "base/version.h" #include "testing/gtest/include/gtest/gtest.h" namespa...
2,165
671
#include <iostream> using namespace std; int main(){ int nu; cin>>nu; int t,p; cin>>t>>p; int mem, memp; int max = 0; for (int i = 0; i < nu-1; i++) { mem = t; memp = p; cin>>t>>p; if((p - memp)/(t-mem)>max){ max = (p - memp)/(t-mem); ...
377
157
#pragma once #include <string> using std::string; #include <vector> using std::vector; #include <map> using std::map; #include <sstream> using std::istringstream; using std::ostringstream; #include <iostream> using std::cout; using std::cerr; using std::cin; using std::endl; #include <fstream> using std::ifstream...
876
293
#pragma once #include <cstdint> namespace lio { enum MemArgs : uint8_t { USAGE = 0b001, COUNT = 0b010, PEAK = 0b100 }; extern size_t memory_count; extern size_t memory_used; extern size_t memory_peak; void print_mem_isage(uint8_t args = USAGE); }
263
130
/* * * * * * * * * * * * * Author's note * * * * * * * * * * * *\ * _ _ _ _ _ _ _ _ _ _ _ _ * * |_| |_| |_| |_| |_|_ _|_| |_| |_| _|_|_|_|_| * * |_|_ _ _|_| |_| |_| |_|_|_|_|_| |_| |_| |_|_ _ _ * * |_|_|_|_|_| |_| |_| |_| |_| |_| |_| |_| |_...
4,798
2,180
/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or...
10,767
4,930
#include "ui/inspectMode.hpp" #include "ui/LSSApp.hpp" #include "ui/fragment.hpp" #include "lss/generator/room.hpp" #include "lss/utils.hpp" #include "ui/utils.hpp" auto F = [](std::string c) { return std::make_shared<Fragment>(c); }; bool InspectMode::processKey(KeyEvent event) { switch (event.getCode()) { case ...
13,332
4,639
#include "pac_datadep.h" #include "pac_expr.h" #include "pac_id.h" #include "pac_type.h" DataDepElement::DataDepElement(DDE_Type type) : dde_type_(type), in_traversal(false) { } bool DataDepElement::Traverse(DataDepVisitor *visitor) { // Avoid infinite loop if ( in_traversal ) return true; if ( ! visitor->...
1,551
614
// This file is part of ViViA, and is distributed under the // OSI-approved BSD 3-Clause License. See top-level LICENSE file or // https://github.com/Kitware/vivia/blob/master/LICENSE for details. #include "vgSwatchCache.h" #include <QCache> #include <QColor> #include <QPixmap> QTE_IMPLEMENT_D_FUNC(vgSwatchCache) /...
1,296
439
// Copyright 2014-2015 Project Vogue. 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 <sstream> #include <string> #include <utility> #include <vector> #include "elang/compiler/analysis/analysis.h" #include "elan...
21,272
7,629
#include "globimap/counting_globimap.hpp" #include "globimap_test_config.hpp" #include <algorithm> #include <chrono> #include <filesystem> #include <fstream> #include <iostream> #include <limits> #include <math.h> #include <string> #include <highfive/H5File.hpp> #include <tqdm.hpp> #include <boost/geometry.hpp> #incl...
9,649
3,589