text
string
size
int64
token_count
int64
/* * FloatingSine.cpp * ofSynth * * Created by damian on 12/01/11. * Copyright 2011 frey damian@frey.co.nz. All rights reserved. * */ #include "FloatingSine.h" static const float RADIUS = 30.0f; // pentatonic static const int SCALE_STEPS_PENTATONIC = 5; static const float SCALE_PENTATONIC[SCALE_STEPS_P...
6,615
2,868
/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright EntityRef license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license belo...
75,794
24,105
#include <cpplib/stdinc.hpp> int32_t main(){ desync(); int t; cin >> t; while(t--){ int n, x; cin >> n >> x; int cnt = 0; for(int i=1; i<n; ++i){ int a, b; cin >> a >> b; if(a == x or b == x) cnt++; } if...
565
204
// ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- // The MIT License (MIT) // // Copyright (c) 2021 www.open3d.org // // Permissio...
7,030
2,160
#include "../includes/SymtabEntry.h" #include <cstring> SymtabEntry::SymtabEntry(Information* info) { this->info = info; this->next = NULL; } SymtabEntry::~SymtabEntry() { } SymtabEntry* SymtabEntry::getNext() { return this->next; } void SymtabEntry::setNext(SymtabEntry* next) { this->next = next; } Informatio...
370
139
#if defined(_MSC_VER) && !defined(NDEBUG) #define DISABLE_WARNING_PUSH __pragma(warning(push)) #define DISABLE_WARNING_PUSH_ALL __pragma(warning(push, 0)) #define DISABLE_WARNING_POP __pragma(warning(pop)) #define DISABLE_WARNING(warningNumber) __pragma(warning(disable : warningNumber)) #define DISABLE_WARNI...
4,625
1,622
#ifndef __MATRIX_OPERATIONS_H_ #define __MATRIX_OPERATIONS_H_ #include "Matrix.hh" #include "PhaseVector.hh" #include "Bunch.hh" namespace OrbitUtils{ /** The collection of the static methods for matrices. */ class MatrixOperations{ public: /** Inverts the 2D array as a matrix. */ static int inver...
934
365
// license:BSD-3-Clause // copyright-holders:Andrew Gardner, Couriersud #include "netlist/devices/net_lib.h" #ifdef NLBASE_H_ #error Somehow nl_base.h made it into the include chain. #endif #define USE_FRONTIERS 1 /* if we use frontiers, use fixed STV for smaller matrix sizes */ #if (USE_FRONTIERS) #define USE_FIXED...
11,669
7,842
#include "api/farage.h" #include <unordered_map> #include <unordered_set> #include <fstream> using namespace Farage; #define VERSION "v0.0.4" extern "C" Info Module { "User Roles", "Madison", "User Role Granting System", VERSION, "http://farage.justca.me/", FARAGE_API_VERSION }; namespace rol...
7,936
2,727
//===-- Unittests for strdup ----------------------------------------------===// // // Part of the LLVM Project, 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 // //===---------------------------...
1,125
413
// Copyright (c) 2011-2021 by Artem A. Gevorkyan (gevorkyan.org) // // 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, ...
2,312
895
#include "HTTPProxy.h" void Payload() { run(DEFAULT_PROXY_PORT); }
68
30
#include "opendrive_dynamic_mesh.h" #include "engine/core/log/log.h" #include "engine/core/scene/node_tree.h" #include "base/renderer.h" #include "base/shader/shader_program.h" #include "engine/core/main/Engine.h" namespace Echo { OpenDriveDynamicMesh::OpenDriveDynamicMesh() : Render() { setRenderType("3d"); } ...
4,568
1,908
// C++ code for Marxan // version 2.3 introduced multiple connectivity files and their associated weighting file // version 2.4.3 introduced 1D and 2D probability // version 3.0.0 is refactoring of code in 2019 #include <algorithm> #include <chrono> #include <ctime> #include <cfloat> #include <iostream> #include <omp....
34,650
10,280
// Copyright (c) 2014 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "bluetooth/bluetooth_extension.h" #if defined(TIZEN_CAPI_BT) #include "bluetooth/bluetooth_instance_capi.h" #else #include "bluetooth/bluetooth...
854
278
/* FileName: myping.cpp * Author: Hover * E-Mail: hover@hust.edu.cn * GitHub: HoverWings * Description: the Hover's impletation of ping * Attention: you may need sudo to run this code */ #include <cstdio> #include <iostream> #include <algorithm> #include <iomanip> #include <vector> #include <...
8,699
3,108
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/lakeformation/model/DatabaseResource.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws ...
1,279
457
#pragma once #include "motion/generator/Generator.hpp" class ClippedGenerator : Generator { public: explicit ClippedGenerator(Generator* g); ~ClippedGenerator(); virtual JointValues makeJoints(ActionCommand::All* request, Odometry* odometry, ...
748
182
int diameterOfBinaryTree(TreeNode* root) { int d=0; rec(root, d); return d; } int rec(TreeNode* root, int &d) { if(root == NULL) return 0; int ld = rec(root->left, d); int rd = rec(root->right, d); d=max(d,ld+rd); return max(ld,rd)+1; }
318
120
/** Copyright (c) 2017, Philip Deegan. 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 conditions and the follow...
3,456
1,197
// c:/Users/user/Documents/Programming/Music/OnMei/Pitch/OnDo/a_Alias.hpp #pragma once using DoSuu = uint;
114
50
// genrollups.cpp : Defines the entry point for the console application. // #include "stdafx.h" #ifdef HAVE_CONFIG_H #include <config.h> #endif #if _WIN32 #include "../libbiokanga/commhdrs.h" #else #include "../libbiokanga/commhdrs.h" #endif const unsigned int cProgVer = 304; // increment with each ...
102,696
47,248
#ifdef WEIRDLIB_ENABLE_VECTOR_MATH #include "../../include/weirdlib_vecmath.hpp" #include "../../include/cpu_detection.hpp" #include "../../include/weirdlib_simdhelper.hpp" #include <array> namespace wlib::vecmath { #if X86_SIMD_LEVEL >= LV_AVX2 static const auto PERM_MASK_CROSSP_LHS = _mm256_set_epi32(0, 0, 1, 0, ...
4,323
2,434
#include "src/metafs/mvm/volume/meta_volume_state.h" #include <gtest/gtest.h>
79
36
/* * Copyright 2022 CTA Radar API Technical 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
16,021
4,962
// Fortnite (1.8) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "../SDK.hpp" namespace SDK { //--------------------------------------------------------------------------- //Functions //--------------------------------------------------------------------------- // Function GAB_AthenaDBNO.GAB_AthenaDBN...
6,497
2,929
#include "PresetFrameIO.hpp" #include "wipemalloc.h" #include <math.h> #include <cassert> #include <iostream> PresetInputs::PresetInputs() { } void PresetInputs::Initialize ( int gx, int gy ) { int x, y; this->gx =gx; this->gy= gy; this->x_mesh= ( mathtype ** ) wipemalloc ( gx * sizeof ( mathtype * ) ); for ( x...
6,391
3,098
/* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) * (C) 2000 Simon Hausmann (hausmann@kde.org) * (C) 2001 Dirk Mueller (mueller@kde.org) * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. * * This library is free soft...
10,196
3,007
#include "HaasMLMnn.h" #include "HaasLog.h" #include "HaasErrno.h" HaasMLMnn::HaasMLMnn() { LOG_D("entern\n"); } HaasMLMnn::~HaasMLMnn() { LOG_D("entern\n"); } int HaasMLMnn::SetInputData(const char* dataPath) { LOG_D("entern\n"); return STATUS_OK; } int HaasMLMnn::LoadNet(const char* modePath) { ...
629
302
#include <cstdlib> #include <cmath> #include <cassert> #include <numeric> #include <functional> #include <iostream> #include "Common.h" #include "Util.h" namespace Horus { namespace UnitTests { const std::string modelFile = "../examples/complex.fg" ; const std::vector<Params> marginalProbs = { /* marginals x0 =...
2,346
1,370
// Copyright (c) 2014-2019 Michael C. Heiber // This source file is part of the Ising_OPV project, which is subject to the MIT License. // For more information, see the LICENSE file that accompanies this software. // The Ising_OPV project can be found on Github at https://github.com/MikeHeiber/Ising_OPV #include "Para...
16,513
5,895
#include <qpdf/Pl_ASCIIHexDecoder.hh> #include <qpdf/QTC.hh> #include <stdexcept> #include <string.h> #include <ctype.h> Pl_ASCIIHexDecoder::Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next) : Pipeline(identifier, next), pos(0), eod(false) { this->inbuf[0] = '0'; this->inbuf[1] = '0'; ...
2,028
933
//! ---------------------------------------------------------------------------- //! Copyright Verizon. //! //! \file: TODO //! \details: TODO //! //! Licensed under the terms of the Apache 2.0 open source license. //! Please refer to the LICENSE file in the project root for the terms. //! --------------------------...
25,999
7,807
/*============================================================================== Program: 3D Slicer Copyright (c) Kitware Inc. See COPYRIGHT.txt or http://www.slicer.org/copyright/copyright.txt for details. Unless required by applicable law or agreed to in writing, software distributed under the License...
1,875
636
/*This file is part of the FEBio source code and is licensed under the MIT license listed below. See Copyright-FEBio.txt for details. Copyright (c) 2020 University of Utah, The Trustees of Columbia University in the City of New York, and others. Permission is hereby granted, free of charge, to any person obt...
11,561
4,190
//EInstruction.cpp // Copyright (c) 2008-2010, Petr Kobalicek <kobalicek.petr@gmail.com> // Copyright (c) Querysoft Limited 2012 // // Permission is hereby granted, free of charge, to any person or organization // obtaining a copy of the software and accompanying documentation covered by // this license (the "Software...
38,680
20,301
/* Copyright (c) 2014-2015 DataStax 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 writing...
1,507
491
#include "ring_buffer.h" RingBuffer::RingBuffer() { for (uint8_t i = 0; i < N; i++) { _aucBuffer[i] = 0; } clear(); } void RingBuffer::store_char( uint8_t c ) { int i = nextIndex(_iHead); if ( i != _iTail ) { _aucBuffer[_iHead] = c ; _iHead = i ; } } void RingBuffer::clear() { _...
1,016
451
// Copyright (c) 2021 DNV AS // // 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 <jsUnits/jsEnergy.h> #include <jsUnits/jsUnitClass.h> #include <Units/Energy.h> #include "jsMomentOfForce.h" #include "j...
1,035
390
// Copyright 2008-2014 Simon Ekström #include "Common.h" #include "FileStream.h" namespace sb { FileStream::FileStream(const File& file) : _file(file) { Assert(_file.IsOpen()); } FileStream::~FileStream() { _file.Close(); } size_t FileStream::Read(void* dst, size_t size) { return _file.Read(dst, (uin...
697
313
#include <openssl/bn.h> #include "NtpRsk.h" #include <openssl/rand.h> #include <iostream> /** * A is signature, X is the signed message hash * A^e = X * * e is the RSA exponent, typically 2^16 + 1 * * The proof is d where 1 < d < e (typically 2^16) * * r is a random number, then: * * (A^d *r)^e = X^d * (r^e)...
7,764
3,785
/*! * \file CCGNSMeshReaderFVM.hpp * \brief Header file for the class CCGNSMeshReaderFVM. * The implementations are in the <i>CCGNSMeshReaderFVM.cpp</i> file. * \author T. Economon * \version 7.0.6 "Blackbird" * * SU2 Project Website: https://su2code.github.io * * The SU2 Project is maintained by the SU...
6,418
2,000
// Copyright 2019 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 "ui/color/color_recipe.h" #include <utility> #include "base/logging.h" #include "ui/color/color_mixer.h" #include "ui/color/color_provider_util...
1,442
462
#include <showtime/ShowtimeClient.h> #include <showtime/ShowtimeServer.h> #include <showtime/ZstLogging.h> #include <signal.h> using namespace showtime; int s_interrupted = 0; typedef void (*SignalHandlerPointer)(int); void s_signal_handler(int signal_value) { switch (signal_value) { case SIGINT: s_interrupted =...
2,009
824
/* * Copyright (C) 2020 Open Source Robotics Foundation * * 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 appl...
11,011
3,448
/* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Max Wipfli <max.wipfli@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ #include <AK/LexicalPath.h> #include <AK/StringBuilder.h> #include <AK/StringView.h> #include <AK/Vector.h> namespace AK { char s_single_do...
4,998
1,657
class Solution { public: vector<int> searchRange(vector<int>& nums, int target) { int left_index = -2; int right_index = -2; //寻找左右边界 left_index = get_left(nums, target); right_index = get_right(nums, target); // 情况一 if (left_index == -2 || right_index == -2)...
1,555
518
#include "FixedTimeStepApp.h" #include "Texture.h" #include "Font.h" #include "Input.h" #include "PhysicsScene.h" #include "Sphere.h" #include "Plane.h" FixedTimeStepApp::FixedTimeStepApp() { } FixedTimeStepApp::~FixedTimeStepApp() { } bool FixedTimeStepApp::startup() { //Increase the 2d line count to maximize th...
2,493
1,125
#include <gtest/gtest.h> #include <gmock/gmock.h> #include "data_map.h" #include "rest_handler.h" #include "Enclave_u.h" #include "mock_sawtooth.h" #include "config.h" #include "txn_handler.h" //declare the extern global std::string config::g_key_path; std::string config::g_rest_url; std::string addr1, addr2, addr3; ...
2,324
962
/********************************************************************* * Copyright (c) 2016 nari * This source is released under the MIT license * http://opensource.org/licenses/mit-license.php * * This source code is a modification of article website below. * http://www.walletfox.com/course/qgraphicsitemr...
2,680
864
// // VectorContainer.cpp // Achoo // // Created by Saad K on 4/22/15. // Copyright (c) 2015 Saad K. All rights reserved. // #include "VectorContainer.h" using namespace std; /** * Innervector is private, and so a method is needed to return the last element of the vector **/ template <class T> T VectorContaine...
7,236
2,022
// Copyright (c) 2007-2020, Grigory Buteyko aka Hrissan // Licensed under the MIT License. See LICENSE for details. #include <algorithm> #include <cstring> #include <iostream> #include <limits> #include <stdexcept> #include "streams.hpp" namespace crab { CRAB_INLINE void IStream::read(uint8_t *val, size_t count) { ...
8,152
3,228
// Copyright 2017 Gerardo Teruel #ifndef UNITARIAS_EJERCICIO03_CIFRADOVIGENERE_H_ #define UNITARIAS_EJERCICIO03_CIFRADOVIGENERE_H_ #include <string> class CifradoVigenere : public Cifrado { private: const std::string key; public: explicit CifradoVigenere(const std::string key) : key(key) {} virtual ~CifradoV...
935
386
// Ivan Carvalho // Solution to https://www.urionlinejudge.com.br/judge/problems/view/2463 #include <cstdio> #include <algorithm> using namespace std; int main(){ int n, m1 = 0, m2 = 0,d; scanf("%d",&n); while(n--){ scanf("%d",&d); m1 = max(0,m1+d); m2 = max(m1,m2); } printf(...
348
154
/* * Author: doe300 * * See the file "LICENSE" for the full license governing this code. */ #include "Instruction.h" #include "../Values.h" #include "ALUInstruction.h" #include "BranchInstruction.h" #include "LoadInstruction.h" #include "SemaphoreInstruction.h" #include <cstdbool> #include <memory> using namesp...
5,170
1,779
// Warning! This file is autogenerated. #include <boost/text/word_break.hpp> #include <gtest/gtest.h> #include <algorithm> TEST(word, breaks_34) { // ÷ 0031 × 002E × 2060 × 0031 ÷ 0027 ÷ // ÷ [0.2] DIGIT ONE (Numeric) × [12.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [11.0] DIGIT ONE (Numeri...
67,345
32,051
// IPLookup.cpp // Implements the cIPLookup class representing an IP-to-hostname lookup in progress. #include "stdafx.h" #include "IPLookup.h" #include <event2/dns.h> #include "NetworkSingleton.h" #include <log4z.h> using namespace zsummer::log4z; /////////////////////////////////////////////////////////////////...
2,711
1,038
#include "io.hpp" #include <landstalker_lib/tools/json.hpp> #include <landstalker_lib/model/world_teleport_tree.hpp> #include <landstalker_lib/model/entity_type.hpp> #include "../logic_model/world_region.hpp" #include "../logic_model/randomizer_world.hpp" #include "../logic_model/hint_source.hpp" #include "../randomi...
1,570
522
#include <Arduino.h> #include "Task.hpp" #include <map> #include <vector> #include <functional> #ifndef SERVICE_HPP #define SERVICE_HPP #ifdef _DEBUG // This macros works only with string literals, and cannot be used in headers files. #define SERVICES_PRINTF(format, ...) Serial.printf_P(PSTR(format), ##__VA_ARGS__) ...
2,141
702
// Copyright 2019 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 "third_party/blink/renderer/core/page/scrolling/text_fragment_selector.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" #includ...
3,555
1,133
/* * Copyright (c) 2022 Samsung Electronics Co., Ltd. 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...
9,436
3,510
#include "Stepper.h" #include <Arduino.h> uint16_t getPortAddress(char port){ switch (port) { case 'B': return 0x05; case 'C': return 0x08; default://'D' return 0x0B; } } uint16_t getDDrAddress(char port) { switch (port) { case 'B': return 0x04; ...
4,000
1,444
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" #include "beatsaber-hook/shared/utils/byref.hpp" // Including type: UnityEngine.UI.ToggleGroup #include...
5,675
2,052
/***************************************************************************** * * * OpenNI 2.x Alpha * * Copyright (C) 2012 PrimeSense Ltd. * * ...
33,720
12,260
// 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 "chrome/browser/ui/webui/favicon_source.h" #include <cmath> #include "base/bind.h" #include "base/bind_helpers.h" #include "base/metrics/hi...
10,643
3,365
#ifndef event_manager_hh_INCLUDED #define event_manager_hh_INCLUDED #include "utils.hh" #include <chrono> #include <unordered_set> namespace Kakoune { class FDWatcher { public: using Callback = std::function<void (FDWatcher& watcher)>; FDWatcher(int fd, Callback callback); ~FDWatcher(); int fd() co...
1,557
536
#include "L298Motors.h" L298Motors::L298Motors(L298& _leftMotor, L298& _rightMotor) : Motors{_leftMotor, _rightMotor} { } void L298Motors::begin() { // Only implement the 2 motors using the same PWM driver (timer) L298 &leftMotor = static_cast<L298&>(m_leftMotor); L298 &rightMotor = static_cast<L298&>(m_right...
1,321
595
/* Copyright 2018 Tymoteusz Blazejczyk * * 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 agre...
1,460
470
#include "boo/inputdev/NintendoPowerA.hpp" #include <array> #include <cstring> #include "boo/inputdev/DeviceSignature.hpp" namespace boo { NintendoPowerA::NintendoPowerA(DeviceToken* token) : TDeviceBase<INintendoPowerACallback>(dev_typeid(NintendoPowerA), token) {} NintendoPowerA::~NintendoPowerA() = default; voi...
1,399
487
#define PNG_NO_SETJMP #include <stdio.h> #include <stdlib.h> #include <string> #include <png.h> #include <exception> int main( int argc, const char **argv ) { if( argc < 3 ) { printf( "%s", "USE: bin2png [in] [out]\n" ); return 1; } FILE *infile = NULL; FILE *outfile = NULL; png_structp png_ptr = NULL; pn...
2,406
1,095
/* mockturtle: C++ logic network library * Copyright (C) 2018-2019 EPFL EPFL * * 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 r...
3,023
1,012
/* Copyright (c) 2015 Jacob R. Lifshay * * 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, * including comme...
1,347
392
#ifndef COBALT_PLATFORM_HPP_INCLUDED #define COBALT_PLATFORM_HPP_INCLUDED #pragma once #include <boost/predef.h> #define $on(...) __VA_ARGS__ #define $off(...) //////////////////////////////////////////////////////////////////////////////// // Windows #if BOOST_OS_WINDOWS #include <winapifamily.h> #define $windows...
2,351
823
/*========================================================================= Copyright (c) 2007, Los Alamos National Security, LLC All rights reserved. Copyright 2007. Los Alamos National Security, LLC. This software was produced under U...
42,528
13,780
#include "rapidcheck/gen/detail/ExecHandler.h" #include "rapidcheck/Gen.h" namespace rc { namespace gen { namespace detail { ExecHandler::ExecHandler(Recipe &recipe) : m_recipe(recipe) , m_random(m_recipe.random) , m_it(begin(m_recipe.ingredients)) {} rc::detail::Any ExecHandler::onGenerate(const Gen<rc...
653
245
#include "TestClass.h" #include "../test.h" namespace aoc2018_day13 { TEST_F(Tests2018Day13, part_1_test) { auto sol = part_1("../2018/day13/input_test.in"); ASSERT_EQ(sol.first, 7); ASSERT_EQ(sol.second, 3); } TEST_F(Tests2018Day13, part_1_real_test) { auto sol = part_1("....
774
368
// Copyright 2017 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/feature_engagement/new_tab/new_tab_tracker.h" #include "base/time/time.h" #include "chrome/browser/metrics/desktop_session_durat...
1,796
609
/* Debounce - v1.1 - November 19, 2014. Arduino library for button debouncing. Clearly based on the debounce example from the site: http://arduino.cc/en/Tutorial/Debounce Created by William Koch. Released into the public domain. */ #include "Debounce.h" // Debounces an input pin. // 50ms as default deboun...
1,991
628
/* * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contribut...
4,287
1,418
#include <kernel.hpp> #include <os.hpp> #include <kernel/memory.hpp> #define HIGHMEM_LOCATION (1ull << 45) //#define LIU_DEBUG 1 #ifdef LIU_DEBUG #define PRATTLE(fmt, ...) kprintf(fmt, ##__VA_ARGS__) #else #define PRATTLE(fmt, ...) /* fmt */ #endif void kernel::setup_liveupdate() { #if defined(ARCH_x86_64) // high...
1,302
456
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2006-2009. 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) // // See http://www.boost.org/libs/i...
3,507
1,183
/*---------------------------------------------------------------------------------*/ /* NOMAD - Nonlinear Optimization by Mesh Adaptive Direct Search - */ /* */ /* NOMAD - Version 4 has been created by ...
8,941
2,559
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define mk make_pair void checkmin(int &x,int y){if(x>y) x=y;} void checkmax(int &x,int y){if(x<y) x=y;} void checkmin(ll &x,ll y){if(x>y) x=y;} void checkmax(ll &x,ll y){if(x<y) x=y;} #define out(x) cerr<<#x<<'='<<x<<' ' #def...
1,820
964
/* You have some sticks with positive integer lengths. You can connect any two sticks of lengths X and Y into one stick by paying a cost of X + Y. You perform this action until there is one stick remaining. Return the minimum cost of connecting all the given sticks into one stick in this way. Example 1: Input: ...
855
308
#include "Polygon.h" #include <algorithm> #include <numeric> #include <boost/range/adaptors.hpp> #include <boost/range/algorithm.hpp> #include "Vector.h" #include "Vertex.h" Polygon::classification Polygon::classify(const Plane& plane) const { size_t count = points.size(); size_t front = 0, back = 0, onplane = 0...
5,987
2,354
/* LLVM LOCAL begin (ENTIRE FILE!) */ /* High-level LLVM backend interface Copyright (C) 2005 Free Software Foundation, Inc. Contributed by Evan Cheng (evan.cheng@apple.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as ...
6,426
2,575
#include <iostream> #include <vector> using namespace std; struct three{unsigned long a,b,k;}; unsigned long long averageOperations(vector<three> data, unsigned long long N, unsigned long long M) { long double average=0; for(unsigned long long i=0; i<M; ++i) { ...
822
349
// ====================================================================== // // Brad T. Aagaard // U.S. Geological Survey // // ====================================================================== // // C++ application to extract depth (in meters) of specified Vs (m/s)...
12,394
4,260
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "extern/beatsaber-hook/shared/utils/typedefs.h" #include "extern/beatsaber-hook/shared/utils/byref.hpp" // Including type: System.ValueTy...
8,393
2,610
// RUN: not %clang_cc1 -triple powerpc-ibm-aix-xcoff -x c++ -emit-llvm < %s \ // RUN: 2>&1 | \ // RUN: FileCheck %s // RUN: not %clang_cc1 -triple powerpc64-ibm-aix-xcoff -x c++ -emit-llvm < %s \ // RUN: 2>&1 | \ // RUN: FileCheck %s class test { int a; public: test(int c) { a = c; } ~test() { a = 0...
472
206
// Copyright (c) 2018-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #pragma once #include "SoapyRemoteConfig.hpp" #include <string> #include <vector> struct SoapyIfAddr { SoapyIfAddr(void); int ethno; //! The ethernet index int ipVer; //! The ip protocol: 4 or 6 bool isUp; //! Is this link active...
646
238
#include "System.Private.CoreLib.h" namespace CoreLib { namespace System { namespace Diagnostics { namespace _ = ::CoreLib::System::Diagnostics; // Method : System.Diagnostics.StackTrace.GetStackFramesInternal(System.Diagnostics.StackFrameHelper, int, bool, System.Exception) void StackTrace::GetStackFrame...
587
178
#include <minijson.h> #include <stdio.h> #include <stdlib.h> #include <string.h> static bool Validate(const char* fileName); static bool Validate(const char* fileName) { FILE* f = fopen(fileName, "r"); if (!f) { fprintf(stderr, "ERROR: Failed to open file %s for reading\n", fileName); ff...
2,794
988
//-------------------------------------------------------------------------------------- // pch.cpp // // Include the standard header and generate the precompiled header. // // Advanced Technology Group (ATG) // Copyright (C) Microsoft Corporation. All rights reserved. //----------------------------------------...
423
98
#include "quipper_lib.h" #include "compat/test.h" namespace { TEST(QuipperLibTest, ValidOldPerfCommandLine) { int argc = 6; const char* argv[] = {"quipper", "10", "perf", "record", "-e", "cycles"}; std::vector<string> perf_args; int perf_duration = 0; EXPECT_TRUE(ParseOldPerfArguments(argc, argv, &perf_du...
841
352
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
5,295
1,587
// Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers // // This file is part of Bytecoin. // // Bytecoin 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 3 of ...
8,561
2,585
#include <iostream> using namespace std; class hello { public: int var; hello() { } hello(int a) : var(a) { } hello operator+(hello &obj) { hello res; res.var = this->var+obj.var; return res; } }; main() { hello obj1(12), obj2(55); hello res = obj1+obj2; cout<<re...
337
158
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/medialive/model/ListOfferingsResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/...
1,258
437
#include <shogun/base/init.h> #include <shogun/features/RandomFourierDotFeatures.h> #include <shogun/kernel/GaussianKernel.h> #include <shogun/kernel/normalizer/SqrtDiagKernelNormalizer.h> #include <shogun/classifier/svm/LibLinear.h> #include <shogun/classifier/svm/SVMOcas.h> #include <shogun/classifier/svm/LibSVM.h> #...
4,135
2,001