text
string
size
int64
token_count
int64
//------------------------------------------------------------------------------ /// @file /// @brief HPCSimulation.hpp の実装 /// @author ハル研究所プログラミングコンテスト実行委員会 /// /// @copyright Copyright (c) 2015 HAL Laboratory, Inc. /// @attention このファイルの利用は、同梱のREADMEにある /// 利用条件に従ってください //------------------------...
8,294
2,620
// // Copyright 2016 Jeff Bush // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
998
321
/////////////////////////////////////////////////////////////////////////// // C++ code generated with wxFormBuilder (version Sep 8 2010) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "OGLCanvas.hpp" #include...
100,646
39,191
// license:BSD-3-Clause // copyright-holders:Carl, Miodrag Milanovic #include "emu.h" #include "osdnet.h" device_network_interface::device_network_interface(const machine_config &mconfig, device_t &device, float bandwidth) : device_interface(device, "network") { m_promisc = false; m_bandwidth = bandwidth; set_mac(...
1,069
456
#include "../include/Item.h" ItemType Item::GetItemType() const { return itemType; }
90
33
#include "bolt.h" #include "gfxlib.h" #include "gfx/mesh.h" #include "gfxlib_struct.h" #include <vector> #include <string> #include <algorithm> #include "unit_generic.h" #include "configxml.h" GFXVertexList*bolt_draw::boltmesh = NULL; bolt_draw::~bolt_draw() { unsigned int i; for (i = 0; i < balls.size(); i++...
1,259
508
/* Copyright 2019 Parakram Majumdar 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, distribute, ...
4,385
1,449
/* * RotationPricer.cpp * * Created on: 2015-03-02 * Author: legraina */ #include "RotationPricer.h" #include "BcpModeler.h" /* namespace usage */ using namespace std; ////////////////////////////////////////////////////////////// // // R O T A T I O N P R I C E R // ////////////////////////////////////...
14,748
5,591
//-------------------------------------------------------------------------------- //This is a file from Arkengine // // //Copyright (c) arkenthera.All rights reserved. // //BasicRenderWindow.cpp //-------------------------------------------------------------------------------- #include "Core/YumeHeaders.h" #include ...
4,741
1,895
#include "cmost.h" #include <string.h> #include <stdio.h> #include <stdlib.h> #include <hls_stream.h> #include "merlin_type_define.h" #include "__merlinhead_kernel_top.h" #include <chrono> #include <iostream> void __merlinwrapper_conv_3d_kernel(float data_in[DATA_IN_LENGTH], floa...
8,810
3,203
// Copyright 2020 Makani Technologies LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ...
49,789
17,703
/* * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA) * * This file is part of Open-Sankoré. * * Open-Sankoré 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 Found...
4,547
1,470
#include "components/RectComponent.h" #include "Renderer.h" #include "components/Transforms.h" #include "TexCoords.h" #include "Texture.h" #include "SpriteAnimation.h" RectComponent::RectComponent(const RectTransform *transform, const glm::vec4& color) : m_quadTransform(transform), m_color(color) { } RectComp...
1,917
615
/* * The MIT License (MIT) * * Copyright (C) 2020 CELLINK AB <info@cellink.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 limitation the ...
5,067
1,686
//-------------------------------------------------------------------------- // Copyright (C) 2014-2018 Cisco and/or its affiliates. All rights reserved. // Copyright (C) 2012-2013 Sourcefire, Inc. // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public...
13,416
4,492
#include <iostream> #include <vector> #include <algorithm> class GTx { public: GTx(size_t val = 0): bound{val} {} bool operator()(const std::string &s) { return s.size() >= bound; } private: std::string::size_type bound; }; int main() { std::vector<std::string> words{"function","objects","are","fun"}; st...
539
194
#include <opentracing/dynamic_load.h> #include <iostream> #include "tracer.h" #include "tracer_factory.h" #include "version_check.h" int OpenTracingMakeTracerFactory(const char* opentracing_version, const void** error_category, void** tracer_factory) try { if (!datadog::opentracing::...
1,052
348
/* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is also distributed with certai...
12,410
4,967
#include <iostream> #include <vector> #include <string> #include "internal/_ftoken.hpp" #include "fstate.hpp" #include "flexer.hpp" void flexer::lex(fstate *state, fparser &parser) { lex(state, parser.tokens); } void flexer::lex(fstate *state, std::vector<_ftoken*> &tokens) { std::stack<_ftoken*> fstack; bool ...
6,663
2,057
#if COMPILATION_INSTRUCTIONS mpic++ -O3 -std=c++14 -Wall -Wfatal-errors $0 -o $0x.x && time mpirun -n 2 $0x.x $@ && rm -f $0x.x; exit #endif // © Copyright Alfredo A. Correa 2018-2020 #include "../../mpi3/main.hpp" #include "../../mpi3/communicator.hpp" namespace mpi3 = boost::mpi3; int mpi3::main(int, char*[], mpi3...
1,212
627
// 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_RESOURCE_TREE_DETAIL_STRIP_PATH_PREFIX_HPP_INCLUDED #define SGE_RESOURCE_TREE_DETAIL_ST...
764
313
//Copyright (c) 2013-2020, The MercuryDPM Developers Team. All rights reserved. //For the list of developers, see <http://www.MercuryDPM.org/Team>. // //Redistribution and use in source and binary forms, with or without //modification, are permitted provided that the following conditions are met: // * Redistributions ...
3,114
1,077
// #include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> using namespace std; #define FOR(i, j, k, l) for (s32 i = j; i < k; i += l) #define RFOR(i, j, k, l) for (s...
1,572
779
#include "scatterplot.h" #include <algorithm> #include <cmath> #include <limits> #include <QSGGeometryNode> #include <QSGSimpleRectNode> #include "continuouscolorscale.h" #include "geometry.h" // Glyphs settings static const QColor DEFAULT_GLYPH_COLOR(255, 255, 255); static const float DEFAULT_GLYPH_SIZE = 8.0f; st...
22,430
7,847
#include <cstdio> #include <iostream> #include <algorithm> #include <time.h> #include <stdlib.h> using namespace std; #pragma region 建立顺序存储的线性表 #define MAX 30 #define _for(i,a,b) for( int i=(a); i<(b); ++i) #define _rep(i,a,b) for( int i=(a); i<=(b); ++i) typedef struct { int data[MAX]; int length; }List; void ...
2,187
1,234
#include "Fixed.hpp" int main() { Fixed a; Fixed const b(Fixed(5.05f) * Fixed(2)); std::cout << a << std::endl; std::cout << ++a << std::endl; std::cout << a << std::endl; std::cout << a++ << std::endl; std::cout << a << std::endl; std::cout << b << std::endl; std::cout << Fixed::m...
359
145
#include<bits/stdc++.h> #define mt make_tuple #define mp make_pair #define pu push_back #define INF 1000000001 #define MOD 1000000007 #define ll long long int #define ld long double #define vi vector<int> #define vll vector<long long int> #define sc(n) scanf("%d",&n); #define scll(n) scanf("%lld",&n); #define scld(n) s...
1,569
845
/***************************************************************************** * cmd_playtree.cpp ***************************************************************************** * Copyright (C) 2005 the VideoLAN team * $Id: 626ba09b03156290eba9bc3bb654ec031a8f75de $ * * Authors: Antoine Cellerier <dionoea@videolan....
1,769
557
// AllTests.cpp #include <gtest/gtest.h> #include <Library/Framework.hpp> TEST(SubtractTest1, SubtractTwoNumbers) { Library::print(); EXPECT_EQ(5, 5); } int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
271
111
class Solution { public: bool canPermutePalindrome(string s) { unordered_map<char, int>m; int odd = 0; for(auto c: s) (m[c]++ % 2) ? odd-- : odd++; return odd <= 1; } };
210
81
/// Copyright (c) 2021 Shaye Garg. #include "Core/Types/Time.h" #include "Core/Platform/Platform.h" #ifdef PLATFORM_WINDOWS # include <Windows.h> #endif namespace Ignis { #ifdef PLATFORM_WINDOWS Time Time::Now() { SYSTEMTIME time; GetLocalTime(&time); return Time{ .Year = time.wYear, .Month = u8(time.wMonth)...
520
242
/***************************************************** * Partial Class: CommandHelper * Members: Command Buffer Bindings/Overloads (Private) *****************************************************/ #include "VKHelpers/Command.hpp" using namespace sdfRay4d::vkHelpers; /** * * @param[in] _material */ void CommandH...
1,485
500
#include "buzzer.h" Buzzer::Buzzer(volatile uint8_t *port, volatile uint8_t *dir, uint8_t mask){ this->port = port; this->dir = dir; this->mask = mask; } void Buzzer::init(){ *(this->dir) |= 1 << this->mask; // output pin } void Buzzer::beep(){ this->toggle(); _delay_ms(_O_BUZZER_DELAY_MS); this->toggle();...
389
172
#include<bits/stdc++.h> using namespace std; const int N = 3e3 + 9, mod = 998244353; template <int32_t MOD> struct modint { int32_t value; modint() = default; modint(int32_t value_) : value(value_) {} inline modint<MOD> operator + (modint<MOD> other) const { int32_t c = this->value + other.v...
4,891
2,130
#include ".\decryption.h" // Required for file input #include "..\commonFiles\aesFileIO.h" // Required for the hash function #include "..\libExcerpt\mbedtls\sha512.h" // Required for std::equal #include <algorithm> // Required for file input #include <fstream> // Required for error handling #include <stdexcept> b...
1,025
368
#include<cstdio> #include<iostream> using namespace std; template <typename T> void pT(T *A, int d){//d for depth int sum=0; cout<<"------tree starts\n"; for(int i=0;i<d;i++){ cout<<i+1<<':'; for(int j=0;j<1<<i;j++){ cout<<*(A+sum++)<<' '; } cout<<endl; } cout<<"------tree ends\n"; } template <typename ...
465
231
// SPDX-FileCopyrightText: 2021 Open Energy Solutions Inc // // SPDX-License-Identifier: Apache-2.0 #include "sub/QualityTemplatesConfigReader.h" #include "ConfigStrings.h" #include <adapter-util/util/YAMLUtil.h> #include <adapter-util/config/YAMLGetters.h> namespace adapter { namespace goose { QualityTemplatesConf...
2,623
801
/* * Copyright (c) 2009-2020, Albertas Vyšniauskas * 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...
12,751
4,738
#include "vld.h" #include "game.h" int main() { game game; return game.run(); }
83
39
//========================================================================= // Copyright (C) 2012 The Elastos 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 // // ...
13,660
4,537
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "newest_replica.h" #include <ostream> namespace storage::distributor { std::ostream& operator<<(std::ostream& os, const NewestReplica& nr) { os << "NewestReplica(timestamp " << nr.timestamp << ...
464
156
#include <QApplication> #include <QQmlApplicationEngine> #include <qqml.h> #include <QResource> #include <QDebug> #include <graphblocks.h> int main(int argc, char *argv[]) { QApplication app(argc, argv); GraphblocksContext* gbctx = initializeGraphBlocks(); QQmlApplicationEngine engine; addGraphBlocks...
507
180
#include "zScript.h"
20
9
#include <thread> #include <fstream> #include "AppProcess.h" #include "LinuxCgroup.h" #include "../Configuration.h" #include "../ResourceLimitation.h" #include "../../common/Utility.h" #include "../../common/DateTime.h" #include "../../common/os/pstree.hpp" #define CLOSE_ACE_HANDLER(handler) \ do ...
9,097
3,597
#include "SMACS.h" // Initialize the instance SMACS* SMACS::s_instance = 0; SMACS::SMACS(){} SMACS* SMACS::instance(){ if(!s_instance) s_instance = new SMACS; return s_instance; } void SMACS::pushWithMutex(Behavior* b){ // Check if behavior is null. If it is then do not put anything on stack ...
4,507
1,412
/** * Calculator Comrade Library * License: https://github.com/DmitryDzz/calculator-comrade-lib/blob/master/LICENSE * Author: Dmitry Dzakhov * Email: info@robot-mitya.ru */ #include <gmock/gmock.h> #include "calculator/calculator.h" #include "calculator/button.h" #include "calculator/operation.h" #include "calc_h...
7,947
3,358
/************************************************************************************** Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.ap...
3,539
1,094
#include "catch2/catch.hpp" #include "utils.h" #include <algorithm> #include <array> SCENARIO("An array of values needs to be sorted", "") { GIVEN("An an unsorted arry a1") { std::array<int, 10> a1 = {5, 10, 1, 2, 8, 3, 7, 9, 4, 6}; WHEN("Array a1 is passed to bubble sort.") { BubbleSort(a1.begin(), ...
1,571
690
#include "barelymusician/dsp/one_pole_filter.h" #include <algorithm> namespace barelyapi { double OnePoleFilter::Next(double input) noexcept { output_ = coefficient_ * (output_ - input) + input; if (type_ == FilterType::kHighPass) { return input - output_; } return output_; } void OnePoleFilter::Reset()...
578
202
/* * Copyright © 2015, United States Government, as represented by the * Administrator of the National Aeronautics and Space Administration. * All rights reserved. * * The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed * under the Apache License, Version 2.0 (the "License"); * you may not use t...
10,906
3,941
#include<iostream> using namespace std; int n; void back(int st[], int k) { int i,ev,j; if(k==n+1) { for(int i = 1; i < k; i++) cout << st[i] << " "; cout << endl; } else for(int i = 1; i <= n; i++) { st[k] = i; ev=1; for(j = 1; j < k; j++) if(st[j] == st[k]) ev=0; if(ev) back(...
415
249
<?hh // partial namespace Test\CLI; use Decouple\CLI\App; use Decouple\CLI\Request\Request; use Decouple\Decoupler\Decoupler; use Decouple\Registry\Paths; use Decouple\CLI\Console; class AppTest extends \Decouple\Test\TestCase { public function execute() : void { Console::output('Testing CLI bootstrap (version)')...
1,829
613
/* * Copyright 2016 Aaron Barany * * 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...
14,229
6,464
#include <iostream> #include <cstdlib> #include <ctime> #include <time.h> #include <stdio.h> using namespace std; const int neg_infinity = 0xFFFFFFFF ; const int pos_infinity = 0x7FFFFFFF ; void print_array ( int* array , int num ) ; void diff_array ( int* array, int* diff_array ) ; void max_cross_subarray ( int* ...
4,139
1,439
// 2019/09/01 Hiroyuki Ogasawara // vim:ts=4 sw=4 noet: #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <cctf/CCTFSystem.h> using namespace cctf; //----------------------------------------------------------------------------- class MySystemAPI : public CCSystemAPI { public: size_t AllocCount= 0...
785
303
#include <cstdlib> #include <cstdio> #include <cctype> #include <vector> #include <stack> #include <utility> #include <iostream> #include <sstream> #include <string> #include <ctype.h> #include <locale> #include <list> using namespace std; //split the string in vector of type string vector<string> split(const string...
4,959
2,010
#include <QtCore> #include <QtSql> #include "asseteditdelegate.h" AssetEditDelegate::AssetEditDelegate(QObject *parent) : QItemDelegate(parent) { } void AssetEditDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { QComboBox *combo = qobject_cast<QComboBox *>(editor); if (!combo) ...
1,579
471
#include <algorithm> #include <functional> #include <limits> #include <boost/format.hpp> #include "StraightSolver.hpp" namespace slide { void StraightSolver::alignRow(AnswerBoard<Flexible>& board) { BOOST_ASSERT(board.height() >= 3 && board.width() >= 2); // 右端2個以外 rep(dstX, board.width()-2){ const Point dst(...
10,971
4,863
/* Copyright 2019 Benjamin Worpitz, René Widera * * This file is part of alpaka. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once #if defined(A...
3,332
957
#include <gtest/gtest.h> #include <yaml/config.hpp> #include <yaml/detail/placeholders.hpp> #include <yaml/arithmetic.hpp> #include <yaml/sequence/filter.hpp> #include "test_utils.hpp" using namespace YAML_NSP; using func = less::ret<_0, std::integral_constant<int, 3>>; using expected = list<std::integral_constant<i...
556
214
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 400; int dfs(int start, vector<int> &dp, set<int> &ng) { if(dp[start] >= 0) { return dp[start]; } if(ng.find(start) != ng.end()) { return dp[start] = INF; } int one = INF, two...
991
451
#ifndef __LinkedListStruct_cpp #define __LinkedListStruct_cpp #include <iostream> template <class T> struct sNode // struct node { T data; sNode<T> *next; }; // Insert template <class T> void push_front(sNode<T> **head, const T &data) { sNode<T> *node = new sNode<T>; node->data = data; node->next =...
4,148
1,539
/************************************************************** * * 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 y...
1,684
540
#include "allocore/protocol/opencl/al_OpenCLProgram.hpp" #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif namespace al { namespace cl { void OpenCLProgram :: create(OpenCLContext &ctx, const char *source) { destroy(); detach(); cl_int res = CL_SUCCESS; cl_program program = clCreateProgramWithSour...
2,585
975
// // Created by Petr Flajsingr on 18/04/2018. // #include "FileStreamThread.h" #include <constants.h> #include <android/log.h> SpeechRecognition::Threads::FileStreamThread::FileStreamThread(std::ifstream& fileStream) : thread(&FileStreamThread::threadFileStream, this) { this->fileStream = &fileStream; }...
1,287
447
Range minimum query. Recibe como parametro en el constructor un array de valores. Las consultas se realizan con el método rmq(indice_inicio, indice_final) y pueden actualizarse los valores con update_point(indice, nuevo_valor) class SegmentTree { private: vector<int> st, A; int n; int left (i...
1,864
863
class Solution { public: vector<int> productExceptSelf(vector<int>& nums) { const size_t n= nums.size(); vector<int>ans(n,1); int answer =1; for(size_t i=0;i<n; ++i){ if(i==0){ ans[i] = nums[i]; }else{ ans[i] = nums[i]*ans[i-1];...
630
221
// #define TIME #include "metriclearning.h" #ifdef TIME #include <chrono> #endif #include <nlopt.hpp> #include "core.h" #include "eigenutility.h" using namespace Eigen; using namespace std; namespace { Core& core = Core::getInstance(); } namespace MetricLearning { struct Arg { Arg(const Core::Distance* D_imag...
3,347
1,129
// Lab 4.cpp : main project file. #include "stdafx.h" #include <iostream> using namespace System; using namespace std; char fName[50]; char lName[50]; char space[10] = " "; int main() { system("color f0"); printf("This program: \n\t(1)Prints an entered first and last name \n\t(2)Prints the number of letters in each...
1,025
408
#include "CppUnitTest.h" #include "Clock.h" #include <chrono> #include <thread> #include <iostream> using namespace Microsoft::VisualStudio::CppUnitTestFramework; using namespace Division; namespace DivisionTest { TEST_CLASS(ClockTest) { public: TEST_METHOD(testClockStart) { Clock clock; clock.start()...
1,784
796
// license:BSD-3-Clause // copyright-holders:David Haywood, Phil Stroffolino /****************************************************************************** Namco C169 (ROZ - Rotate and Zoom) Advanced rotate-zoom chip manages two layers. Each layer uses a designated subset of a master 256x256 tile tilemap (40...
7,810
3,607
#include <algorithm> #include <cmath> // Okay, it's ugly, I get it. // // I didn't use classes or a vector library. I use loops to // 3 everywhere for vector operations, and I even write out dot // products. My intent was to try to build a minimal triangle // raycaster that I could convert simply to BASIC or FORTH o...
5,471
2,326
// PVFilterTest.cpp -- test class for pvoc data filters #include "PVFilterTest.h" #include <stdio.h> #include <ugens.h> PVFilter * PVFilterTest::create() { return new PVFilterTest; } PVFilterTest::PVFilterTest() { } PVFilterTest::~PVFilterTest() { } int PVFilterTest::run(float *pvdata, int nvals) { for (int n = ...
755
334
#include "buffer.hh"
21
9
#pragma once class Drawable { public: virtual void draw() const; };
75
25
/** * 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...
1,327
445
/// \copyright Unlicense #include "rrwindows/console/console_virtual_terminal_sequences.hxx" #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include "rrwindows/debug/error_handling.hxx" using namespace std; namespace rrwindows { RRWINDOWS_API void RRWINDOWS_CALL enable_virtual_terminal_mode() { DWORD dwMode...
2,338
797
#include "clua.h" #include <unordered_map> #include <set> #include <deque> #include <functional> #include <ctime> #define l L.get() void* clua::engine::getModule(clua::lua_t L, const std::string_view& modName, const std::string_view& modNamespace) { if (lua_getglobal(L, modNamespace.data()); lua_istable(L, -1)) {...
14,456
4,954
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ // //=============================================================================// #include "cbase.h" #include "ai_default.h" #include "ai_task.h" #include "ai_schedule.h" #include "ai_nod...
19,985
7,550
/* 2011 Takahiro Harada */ #define PATH "..\\..\\opencl\\primitives\\AdlPrimitives\\Sort\\RadixSort32Kernels" #define RADIXSORT32_KERNEL0 "StreamCountKernel" #define RADIXSORT32_KERNEL1 "PrefixScanKernel" #define RADIXSORT32_KERNEL2 "SortAndScatterKernel" #define RADIXSORT32_KERNEL3 "SortAndScatterKeyValueKernel" #d...
11,202
5,108
#ifndef FILE_SYSTEM_UTILS #define FILE_SYSTEM_UTILS #include <string> #include <vector> namespace FileSystemUtils { inline bool endsWith(std::string const & value, std::string const & ending); void listFiles(std::string dir_path, std::vector<std::string> &files, std::string extension=""); } #endif
310
105
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll solve(int n, vector<ll> a) { ll sum = 0, count = 0; for(int i = 0; i < n; i++) { ll temp = sum + a[i]; if(i % 2 == 0) { if(temp > 0) { sum = temp; continue; } else { ...
1,566
499
/* -------------------------------------------------------------------------- * * Simbody(tm) * * -------------------------------------------------------------------------- * * This is part of the SimTK biosimulation toolkit originating from * ...
7,478
2,492
#include "Factory.h" #include "station.h" //You may add #include statments here using namespace std; /* Unlike all other documents provided, you may modify this document slightly (but do not change its name) */ //======================================================================================= /* createStation...
718
164
#ifndef LHNEUTRONSCINTARRAY_HH #define LHNEUTRONSCINTARRAY_HH #include "KBDetector.hh" class LHNeutronScintArray : public KBDetector { public: LHNeutronScintArray(); virtual ~LHNeutronScintArray() {}; virtual bool Init(); protected: virtual bool BuildGeometry(); virtual bool BuildDetectorPla...
373
146
#include <drivers/Input/PS2MouseDriver.h> using namespace UnifiedOS; using namespace UnifiedOS::Drivers; PS2MouseEventHandler::PS2MouseEventHandler(){ } PS2MouseEventHandler::~PS2MouseEventHandler(){ } void PS2MouseEventHandler::OnMouseDown(uint8_t button){ } void PS2MouseEventHandler::OnMouseUp(uint8_t button){ ...
3,015
1,031
// // Created by madsy on 22.03.17. // #include <algorithm> #include "MidiChannel.h" MidiChannel::MidiChannel() : pChannelIndex(0), pStartTick(0), pEndTick(0) { } MidiChannel::~MidiChannel() { } std::vector<std::shared_ptr<MidiEvent>> MidiChannel::getEventsWithinInterval(unsigned int startTick, unsigned int endTi...
1,677
590
/* Copyright 2016-2017 Felspar Co Ltd. http://odin.felspar.com/ Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt */ #include <odin/odin.hpp> #include <odin/nonce.hpp> #include <fostgres/callback.hpp> ...
1,588
600
#include "cost.h" #include "dali/array/op/binary.h" #include "dali/array/op/unary.h" #include "dali/array/op/gather_from_rows.h" #include "dali/array/op/reducers.h" #include "dali/array/op/softmax.h" #include "dali/tensor/tape.h" #include "dali/utils/make_message.h" #include "dali/tensor/tensor_macros.h" namespace te...
9,543
3,055
#include <mapbox/io.hpp> #include "io_delete.hpp" #include <cassert> #include <string> void deleteTests(const std::string& path, const std::string& copyPath, const std::string& invalidPath) { nonstd::expected<void, std::string> voidExpected; voidExpected = mapbox::base::io::deleteFile(path); assert(void...
593
192
#ifndef __ROBOTOMYREQUESTFORM_H__ #define __ROBOTOMYREQUESTFORM_H__ #include "Form.hpp" class RobotomyRequestForm : public Form { private: // Disabled Operators RobotomyRequestForm& operator=(const RobotomyRequestForm& assign); public: enum Requirement { SIGN = 72, EXEC = 45 }; // Constructors & Destructor...
550
192
__________________________________________________________________________________________________ sample 4 ms submission static int lambda_0 = []() { std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }(); class Solution { public: bool isIsomorphic(string s, string t) { int m1[256] ={0}, m2[256] = ...
1,074
342
/* Copyright (c) 2007-2009 Cyrus Daboo. 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 Unle...
8,484
3,465
/* * Copyright 2011 Nate Koenig & Andrew Howard * * 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,497
488
#include <stan/math/prim.hpp> #include <gtest/gtest.h> TEST(ProbBernoulli, ccdf_log_matches_lccdf) { int n = 1; double theta = 0.3; EXPECT_FLOAT_EQ((stan::math::bernoulli_lccdf(n, theta)), (stan::math::bernoulli_ccdf_log(n, theta))); EXPECT_FLOAT_EQ((stan::math::bernoulli_lccdf<double>(n, th...
400
176
#ifndef AROONOSC_HPP_INCLUDED #define AROONOSC_HPP_INCLUDED #include <string> #include <map> #include <list> #include "../jsmn/jsmn.h" using namespace std; namespace Avapi { class RestClient; //forward declaration enum class Const_AROONOSC_interval{ none, n_1min, n_5min, n_15min, n_30min, n...
5,009
1,668
//--------------------------------------------------------------------------- #include <application/starter.h> //--------------------------------------------------------------------------- #include <X11/X.h> #include <X11/Xlib.h> #include <GL/gl.h> #include <GL/glx.h> #include <GL/glu.h> #include <iostream> //----...
2,489
1,206
#include <scorum/tags/tags_api_objects.hpp> #include <boost/test/unit_test.hpp> #include "tags_common.hpp" using namespace scorum; using namespace scorum::tags::api; using namespace scorum::app; using namespace scorum::tags; BOOST_FIXTURE_TEST_SUITE(get_posts_and_comments_tests, database_fixture::tags_fixture) SCOR...
5,253
2,239
#include <esp_log.h> #include <esp_system.h> #include <sdkconfig.h> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include <sys/param.h> #include <esp32/clk.h> #include "system.h" #define TAG "SYSTEM" void wait_msec(uint16_t v) { vTaskDelay(v / portTICK_PERIOD_MS); } void wait_sec(uint16_t v) { ...
614
271
#pragma once #include <map> #include <utility> #include <vector> #include "SafeInt.hpp" namespace vheis { template <class Group> class geodesic_growth { public: template <class Vector> explicit geodesic_growth(Vector g_set); template <class Iterator> explicit geodesic_growth(Iterator begin, Iterator end);...
1,907
696