text
string
size
int64
token_count
int64
/* * Copyright (c) 2012-2018 ARM Limited * All rights reserved. * * The license below extends only to copyright in the software and shall * not be construed as granting a license to any other intellectual * property including but not limited to intellectual property relating * to a hardware implementation of the...
12,906
4,456
#include <iostream> #include <fstream> using namespace std; ifstream ifs; struct node { int data; node *next; }; node *createLinkList(int n) { node *head = new node; node *current = head; int dat = 0; for (int i = 0; i < n; i += 1) { ifs >> dat; current->data = dat; if (i != n - 1) { node *next = ...
1,349
621
#include "gl/viewer.hpp" #include "gl/glMap.h" #include "utils/mapEdit.h" void makeMapBorder(Walls& walls) { Wall border; border.emplace_back(1200, 0, 0); border.emplace_back(0, 0, 0); border.emplace_back(0, 900, 0); border.emplace_back(1200, 900, 0); border.emplace_back(30, 30, 0); border...
740
334
#include "HMDDevice.hpp" #include <Windows.h> PoseVRDriver::HMDDevice::HMDDevice(std::string serial):serial_(serial) { } std::string PoseVRDriver::HMDDevice::GetSerial() { return this->serial_; } void PoseVRDriver::HMDDevice::Update() { if (this->device_index_ == vr::k_unTrackedDeviceIndexInvalid) re...
7,960
2,936
/* * 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 ...
4,902
1,652
/*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS...
3,658
1,072
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "configdatabuffer.h" #include <vespa/vespalib/data/slime/slime.h> namespace config { ConfigDataBuffer::ConfigDataBuffer() : _slime(std::make_unique<vespalib::Slime>()) { } ConfigDataBuffer::~ConfigD...
359
122
// ----------------------------------------------------------------------------------------------------- // Copyright (c) 2006-2019, Knut Reinert & Freie Universität Berlin // Copyright (c) 2016-2019, Knut Reinert & MPI für molekulare Genetik // This file may be used, modified and/or redistributed under the terms of th...
28,338
7,852
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #include "EpicSynth1PresetBank.h" #include "SynthComponents/EpicSynth1Component.h" #include "UObject/ObjectMacros.h" #include "UObject/Object.h" UClass* FAssetTypeActions_ModularSynthPresetBank::GetSupportedClass() const { return UModularSynthPresetBank::S...
902
329
/* Copyright 2005-2016 Intel Corporation. All Rights Reserved. This file is part of Threading Building Blocks. Threading Building Blocks is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundat...
5,231
1,520
// // BasicEventTest.cpp // // $Id: //poco/1.4/Foundation/testsuite/src/BasicEventTest.cpp#2 $ // // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "BasicEventTest.h" #include "DummyDelegate.h" #include "CppUnit/TestCalle...
10,546
3,817
#include "cs.h" /* x=A\b where A is symmetric positive definite; b overwritten with solution */ CS_INT cs_cholsol(CS_INT order, const cs* A, CS_ENTRY* b) { CS_ENTRY* x; css* S; csn* N; CS_INT n, ok; if (!CS_CSC(A) || !b) { return (0); } /* check inputs */ n = A->n; S = cs_schol(o...
842
349
#include "gtest/gtest.h" #include <string> TEST(FooTest, Foo) { std::string foo("foo"); EXPECT_STREQ("foo", foo.c_str()); } int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
234
99
#include <moja/datarepository/landunitinfo.h> #include <moja/test/mockaspatialtileinfo.h> #include <boost/test/unit_test.hpp> using moja::datarepository::LandUnitInfo; using moja::test::MockAspatialTileInfo; BOOST_AUTO_TEST_SUITE(LandUnitInfoTests); BOOST_AUTO_TEST_CASE(datarepository_LandUnitInfo_Const...
887
349
/********************************************************************** * Copyright (c) 2008-2014, Alliance for Sustainable Energy. * All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as publishe...
12,541
4,588
// // code_1.cpp // Algorithm // // Created by Mohd Shoaib Rayeen on 23/11/18. // Copyright © 2018 Shoaib Rayeen. All rights reserved. // #include <iostream> using namespace std; int kthSmallest(int arr[], int n, int k) { sort(arr, arr+n); return arr[k-1]; } int main() { int n; cout << "\nEnter ...
638
271
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { private: vector<TreeNode*> constructTree(int l, int r) { vector<TreeNode*> ans; if (l > r) { ...
925
329
#include <gtest/gtest.h> #include <entt/core/hashed_string.hpp> #include <entt/meta/container.hpp> #include <entt/meta/factory.hpp> #include <entt/meta/meta.hpp> #include <entt/meta/resolve.hpp> struct MetaContainer: ::testing::Test { static void SetUpTestCase() { entt::meta<double>().conv<int>(); ...
11,865
4,921
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2005-2013. 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/contain...
4,925
1,550
#include "Slider.h" #include "QHBoxLayout" #include "QVBoxLayout" #include "UI/Config/Config.h" #include "Common/AppBase.h" Slider::Slider(AppListInterface * pList, QWidget *parent) : AppBase(pList, parent),m_iPos(0),m_bDynamic(false) { InitLayout(); connect(&m_timer,SIGNAL(timeout()),this,SLOT(ti...
7,234
2,780
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * 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...
32,821
11,192
/******************************************************************************* * Copyright 2021-2022 Intel Corporation * * 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.apa...
47,612
18,351
#pragma once #include "appplex-conf.hxx" #ifdef MOD_SWS_DROP_DOWN_LIST_TST #include "mws-mod.hxx" class mod_sws_drop_down_list_tst : public mws_mod { public: static mws_sp<mod_sws_drop_down_list_tst> nwi(); virtual void build_sws() override; private: mod_sws_drop_down_list_tst(); }; #endif
307
142
/*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) 2021 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 obtaining a...
5,349
2,064
// Copyright (c) 2013 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "atom/browser/net/url_request_string_job.h" #include <string> #include "atom/common/atom_constants.h" #include "net/base/net_errors.h" namespace atom { URLRequestStringJob...
1,722
575
/* Copyright 2019 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 law or a...
7,141
2,384
#include "Venda.h" Venda::Venda(uint cID, string client, uint eID, string empreg, string farm, string time) : idCliente(cID), nomeCliente(client), idEmpregado(eID), nomeEmpregado(empreg), nomeFarmacia(farm) { preco = 0; if (time == "") { this->timestamp_venda = Timestamp(); } else { this->timestamp_venda = Ti...
3,650
1,478
/*========================================================================= * * Copyright NumFOCUS * * 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.or...
14,767
4,879
/* * Copyright © 2012, 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...
9,708
3,111
// MIT Licensed (see LICENSE.md). #include "Precompiled.hpp" namespace Zero { namespace PropertyViewUi { const cstr cLocation = "EditorUi/PropertyView"; Tweakable(float, ObjectSize, Pixels(24), cLocation); // Size of objects Tweakable(float, PropertySize, Pixels(20), cLocation); // Size of each property wid...
7,909
2,461
/* * timer.cpp * * Created on: 2015年9月3日 * Author: gavinlli */ #include "timer.h" #include <stdio.h> timer::timer() { // TODO Auto-generated constructor stub start(); } timer::~timer() { // TODO Auto-generated destructor stub } void timer::start() { gettimeofday( &m_start, NULL); } int timer::get_ti...
486
209
// Copyright (c) Facebook, Inc. and its affiliates. // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. #include "PbrDrawable.h" #include <Corrade/Containers/ArrayViewStl.h> #include <Corrade/Utility/FormatStl.h> #include <Magnum/GL/Renderer.h>...
8,220
2,533
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #include <gtest/gtest.h> #include "framework/integration_framework/integration_test_framework.hpp" #include "integration/acceptance/acceptance_fixture.hpp" using namespace integration_framework; using namespace shared...
5,326
1,645
/* ************************************************************************ * Copyright (c) 2019 Advanced Micro Devices, Inc. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code m...
15,342
6,022
#include "../methods.h" #include "../template/out_in.h" // static const struct luaL_Reg helper_methods[] = { OUTIN_ARG(cast, af_dtype), OUTIN(isinf), OUTIN(iszero), { NULL, NULL } }; int Helper (lua_State * L) { luaL_register(L, NULL, helper_methods); return 0; }
273
119
#include "game_code/puzzle_data.hpp" #include "game_code/game.hpp" #include "game_code/grid.hpp" #include "game_code/card.hpp" #include "game_code/puzzle.hpp" #include "game_code/alien.hpp" #include "game_code/walking_alien.hpp" #include "game_code/black_bird.hpp" #include "game_code/butterfly.hpp" #include "game_code/...
18,616
6,120
//============================================================================================================= /** * @file networkmaterial.cpp * @author Lorenz Esch <Lorenz.Esch@tu-ilmenau.de>; * Matti Hamalainen <msh@nmr.mgh.harvard.edu> * @version 1.0 * @date January, 2017 * * @section LICENSE ...
4,950
1,336
#include "com/mapswithme/maps/Framework.hpp" #include "com/mapswithme/core/jni_helper.hpp" #include "partners_api/taxi_provider.hpp" namespace { jclass g_productClass; jclass g_taxiManagerClass; jclass g_taxiInfoClass; jclass g_taxiInfoErrorClass; jmethodID g_taxiInfoConstructor; jmethodID g_taxiInfoErrorConstructor;...
6,304
2,124
#pragma once #include <vector> #include "lve_device.hpp" #define GLM_FORCE_RADIANS #define GLM_FORCE_DEPTH_ZERO_TO_ONE #include <glm/glm.hpp> namespace lve { class LveDevice; class LveModel { public: struct Vertex { glm::vec3 position; glm::vec3 color; static std::vector<VkVertexInputBindingDescri...
921
320
/* *********************************************************************************************************************** * * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associ...
21,511
6,149
// Copyright 2018 The Fuchsia 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 <lib/ftl/ndm-driver.h> #include <stdarg.h> #include <zircon/assert.h> #include <memory> #include <optional> #include "ftl.h" #include "ftl_priva...
11,689
4,393
#ifndef BOOST_ATOMIC_DETAIL_BASE_HPP #define BOOST_ATOMIC_DETAIL_BASE_HPP // Copyright (c) 2009 Helge Bahmann // // 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) // Base class definition and fallback implemen...
12,684
4,252
#pragma once #include "Object.hpp" #include <vector> class KeyValueDatabase : public Object { public: KeyValueDatabase(const std::string& name, const std::string& location, const std::string& extension); void add_entry(const std::pair<std::string, int>& entry); int get_value(const std::string& key) cons...
911
272
#include<iostream> using namespace std; int main(int argc, char *argv[]) { int c; cin>>c; int r = 3; for(int i=1; i<=r; i++){ for(int j=1; j<=c; j++){ if((j+i)%4==0){ cout<<"*"; } else if((j%4==0 && i==2)){ cout<<"*"; } else{ cout<<" "; } } cout<<endl; } return 0; }
320
191
#pragma once #include <type_traits> #include <riw/concepts/integral.hpp> namespace riw { template <class Type> concept signed_integral = riw::integral<Type> && std::is_signed_v<Type>; }
189
73
/** * Copyright (c) 2017-present, Facebook, 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.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
8,940
3,101
// <Snippet3> #using <System.dll> #using <System.Messaging.dll> using namespace System; using namespace System::Messaging; // placeholder; see complete definition elsewhere in this section public ref class Order { public: int itemId; int quantity; String^ address; void ShipItems(){} }...
979
314
// Copyright 2018 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/apps/app_service/built_in_chromeos_apps.h" #include <utility> #include <vector> #include "ash/public/cpp/app_list/app_list_metr...
6,978
2,350
// 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: HMUI.CircleSli...
11,302
3,674
#include "MapSpin.hpp" #include <wx/spinctrl.h> MapSpin::MapSpin() { //ctor } MapSpin::~MapSpin() { //dtor }
119
61
//============================================================================== // Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II // Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI // // Distributed under the Boost Software License, Version 1.0. // Se...
5,365
1,882
/* * OutputStream.cpp * * Created on: 2018/04/19 * Author: iizuka */ #include "debug/debugMacros.h" #include "OutputStream.h" namespace alinous { OutputStream::OutputStream() { } OutputStream::~OutputStream() { } void OutputStream::write(const char* buffer, int size) { write(buffer, 0, size); } }...
345
127
#include "index_hash_calcer.h" #include "projection.h" #include <util/generic/utility.h> #include <util/generic/xrange.h> using namespace NCB; void CalcHashes( const TProjection& proj, const TQuantizedForCPUObjectsDataProvider& objectsDataProvider, const TFeaturesArraySubsetIndexing& featuresSubsetInd...
16,471
4,651
#include <bits/stdc++.h> const int N = 1e5 + 5; int arr[N]; // arr, [start, end], k int quickSelection(int *arr, int start, int end, int k) { // exit condition if (start >= end) return arr[start]; int left = start - 1, right = end + 1; int pivot = arr[(left + right) >> 1]; while (left <...
901
349
/* 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 law or a...
8,707
2,806
// // NALUnit.cpp // // Implementation of Basic parsing of H.264 NAL Units // // Geraint Davies, March 2004 // // Copyright (c) GDCL 2004-2008 http://www.gdcl.co.uk/license.htm #include "LFNALUnit.h" // --- core NAL Unit implementation ------------------------------ LFNALUnit::LFNALUnit() : m_pStart(NULL), ...
10,662
4,011
/* Copyright (C) 2013-2014 by Kristina Simpson <sweet.kristas@gmail.com> 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 pur...
7,243
2,905
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #include "OperatorResult.h" #include "ActiveObjects.h" #include "ModuleFactory.h" #include "ModuleManager.h" #include "ModuleMolecule.h" #include <vtkDataObject.h> #include <vtk...
3,378
1,127
typedef double (*Callback)( void *apply, const double &x ); void function( Callback callback, void *apply, const double *x, double *y, int n );
207
51
// 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 "base/memory/scoped_ptr.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/prefs/session_startup_p...
5,570
1,889
/* * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "runtime/helpers/get_info.h" #include "runtime/mem_obj/image.h" #include "runtime/sharings/gl/gl_texture.h" #include "test.h" #include "unit_tests/libult/create_command_stream.h" #include "unit_tests/libult/ult_command_s...
14,303
5,033
#include "MySphere.h" #include "MyIncludes.h" MySphere::MySphere(MyIndexedVertexArray *vertexArray, MyVector3D & position, MyVector3D & scale, MyVector3D & rotation) : MyGraphicsObject3D(vertexArray, position, scale, rotation) { } MySphere::~MySphere() { }
261
101
#include "InputSample.h" InputSample::InputSample() { } InputSample::~InputSample() { } void InputSample::Draw() const { // Note: This code was based on VitaTester (hence the code inside the Draw function instead of the respective event functions). // https://github.com/SMOKE5/VitaTester // // You can however ...
5,781
2,432
// // CSprite.hpp // TimGameLib // // Created by Tim Brier on 18/10/2014. // Copyright (c) 2014 tbrier. All rights reserved. // #ifndef __TimeGameLib__CSprite__ #define __TimeGameLib__CSprite__ // ============================================================================= // Include files // -------------------...
811
228
// Question: // 0 - 1 Knapsack Problem : // You are given weights and values of N items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack. // Note that we have only one quantity of each item. // Example 1: // Input: // N = 3 // W = 4 // values[] = {1,2,3} // weight[] = {4,...
3,005
1,035
#ifndef MEASURE_HPP #define MEASURE_HPP #include "Node.hpp" #include <Image.hpp> #include "Interpolator.hpp" namespace measure{ /** * A Context holds time-local variables necessary for locally * computing a measure and its gradients. **/ struct Context{ /** * \param timesteps The number of tim...
3,674
1,062
///////////////////////////////////////////////////////////////////////// // $Id: cdrom.cc,v 1.91 2008/02/15 22:05:41 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. // // MandrakeSoft S.A. // 43, rue d'Aboukir // 75002 Paris...
42,515
17,223
/* Copyright 2018, 2019 Intel Corporation * * 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 a...
6,854
2,141
/* The commented line must have the same line number in the other "thefile.c". */ #define WANT_F2 #include "../../lspec.h" static int dupname(int y) { label: return y; } static int twodup () { return 0; } int n(int y) { int v = dupname(y) - 23; /* thefile breakpoint */ return v + twodup (); /* after dup...
392
160
#include <QApplication> #include <QQuickView> #include <QQmlEngine> #include "Scene.hpp" #include "LogTrackSceneCameraManipulator.hpp" #include "LineStrip.hpp" class Helper : public QObject { Q_OBJECT public: enum Direction { Horizontal = 0x1, Vertical = 0x2 }; Q_DECLARE_FLAGS(Di...
3,594
1,218
/*============================================================================== 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...
3,509
926
/********************************************************************************* * * Inviwo - Interactive Visualization Workshop * * Copyright (c) 2017-2021 Inviwo Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided th...
3,383
1,130
#include "shear_prod2D.h" void shear_prod2D(real4d &def2) { YAKL_SCOPE( dx , :: dx ); YAKL_SCOPE( dz , :: dz ); YAKL_SCOPE( adz , :: adz ); YAKL_SCOPE( adzw , :: adzw ); YAKL_SCOPE( u , :: u ); YAKL_SCOPE( v , :: v ); YAKL_SCOPE( w ...
5,329
3,022
/******************************************************************************* * tlx/string/compare_icase.cpp * * Part of tlx - http://panthema.net/tlx * * Copyright (C) 2007-2017 Timo Bingmann <tb@panthema.net> * * All rights reserved. Published under the Boost Software License, Version 1.0 *****************...
2,317
830
#define PROBLEM "https://judge.yosupo.jp/problem/frequency_table_of_tree_distance" #include "GraphTheory/CentroidDecomposition.hpp" #include "Convolution/FastFourierTransform.hpp" #include "Algorithm/frequency_table_of_tree_distance.hpp" #include <cstdio> #include <vector> int main() { int N; scanf("%d"...
697
299
#include <KrisLibrary/Logger.h> #include "vectorfunction.h" #include "metric.h" #include "indexing.h" #include <errors.h> #include <iostream> using namespace Math; using namespace std; std::string NormScalarFieldFunction::Label() const { if(degree == Two) return "L2Norm"; else if(degree == One) return "L1Norm"; ...
15,572
6,445
/****************************************************************************** QtAV: Multimedia framework based on Qt and FFmpeg Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com> * This file is part of QtAV (from 2016) This library is free software; you can redistribute it and/or modify it unde...
6,224
2,451
#include "global.h" /** * @brief * SYNTAX: LOAD relation_name */ bool syntacticParseLOADMATRIX() { logger.log("syntacticParseLOADMATRIX"); if (tokenizedQuery.size() != 3) { cout << "SYNTAX ERROR PLEASE SPECIFY MATRIX NAME" << endl; return false; } parsedQuery.queryTy...
1,225
406
/* * GridTools * * Copyright (c) 2014-2019, ETH Zurich * All rights reserved. * * Please, refer to the LICENSE file in the root directory. * SPDX-License-Identifier: BSD-3-Clause */ #include <vector> #include <gtest/gtest.h> #include <gridtools/stencil_composition/cartesian.hpp> #include <gridtools/tools/car...
1,502
550
#ifndef SINGULARITY_HPP #define SINGULARITY_HPP #include <graphene/singularity/emission.hpp> #include <graphene/singularity/gravity_index_calculator.hpp> #include <graphene/singularity/activity_index_calculator.hpp> #endif
226
88
// These violate our poisons so have to happen first #include "llvm/IR/DIBuilder.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/Support/Host.h" #include "llvm/Transforms/Utils/Cloning.h" #include "absl/cleanup/cleanup.h" #include "absl/strings/str_split.h"...
17,985
5,081
/********************************************************************* Matt Marchant 2016 http://trederia.blogspot.com tmxlite - Zlib license. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. ...
2,757
735
#include <iostream> using namespace std; int main() { int T; cin >> T; while (T--) { int N, half, flag = 0; cin >> N; int arr[N]; for (int i = 0; i < N; i++) { cin >> arr[i]; } int count = 0; if (arr[N / 2] == 7 && arr[0] == 1) ...
751
272
#pragma once #include <bitset> #include <cstdint> #include <functional> #include <unordered_map> #include <vector> using std::uint16_t; using std::uint8_t; using std::int8_t; using std::int16_t; /* 寻址方式 6502为小端 */ enum class AddressMode { // accumulator impiled single byte instruction // operand is AC (implied s...
6,023
2,665
#ifndef BIT_HPP #define BIT_HPP /* Bit abstraction library * Author: Yago T. de Mello * e-mail: yago.t.mello@gmail.com * Version: 2.6.0 2021-11-24 * License: Apache 2.0 * C++20 */ /* Copyright 2021 Yago Teodoro de Mello Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file...
7,105
2,148
/* * Copyright (c) 2003-2016, John Wiegley. 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 c...
15,689
5,364
/* * Copyright 2019 Mathieu Nassar * * 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 ...
3,098
913
///////////////////////////////////////////////////////////////////////////// // // BSD 3-Clause License // // Copyright (c) 2019, The Regents of the University of California // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the...
7,330
2,589
#ifndef Books_ElementsOfProgrammingInterviews_reference_ch16_hpp #define Books_ElementsOfProgrammingInterviews_reference_ch16_hpp #include "Common/Tree.hpp" #include <array> #include <cstdlib> #include <memory> #include <sstream> #include <stack> #include <string> #include <vector> namespace reference { extern v...
1,796
622
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: Worker.cpp * Author: rafa * * Created on January 14, 2018, 3:42 PM */ #include <thread> #include <Zelta/Concurre...
1,504
459
/* $Id: AutoCaller.cpp $ */ /** @file * * VirtualBox object state implementation */ /* * Copyright (C) 2006-2014 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify ...
15,738
4,572
#include <stdlib.h> class Matrix { public: size_t n; double** d; Matrix(int n); ~Matrix(); }; Matrix::Matrix(int n) { n = n; d = (double**)malloc(n * sizeof(double*)); for (int i = 0; i < n; ++i) { d[i] = (double*)calloc(n, sizeof(double)); } } Matrix::~Matrix() { for (int i = 0; i < n; ++i)...
1,265
672
// // main.cpp // 804_uniqueMorseRepresentations // // Created by bella on 2020/7/13. // Copyright © 2020 bella. All rights reserved. // #include <iostream> #include <vector> #include <set> using namespace std; class Solution { public: int uniqueMorseRepresentations(vector<string>& words) { const strin...
1,207
438
// Copyright 2020 Google LLC. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #include "packager/media/formats/ttml/ttml_generator.h" #include "packager/base/base64.h" #includ...
8,416
2,793
/* This file is part of the GSM3 communications library for Arduino -- Multi-transport communications platform -- Fully asynchronous -- Includes code for the Arduino-Telefonica GSM/GPRS Shield V1 -- Voice calls -- SMS -- TCP/IP connections -- HTTP basic clients This library has been developed by Telefónica Digital - P...
10,942
4,590
/* Copyright (c) 2009-2016, Jack Poulson All rights reserved. This file is part of Elemental and is under the BSD 2-Clause License, which can be found in the LICENSE file in the root directory, or at http://opensource.org/licenses/BSD-2-Clause */ #ifndef EL_LDL_PIVOTED_BUNCHKAUFMAND_HPP #define EL_LDL...
8,363
3,447
class Solution { public: int maximalPathQuality(vector<int>& values, vector<vector<int>>& edges, int maxTime) { const int n = values.size(); int ans = 0; vector<vector<pair<int, int>>> graph(n); vector<int> seen(n); seen[0] = 1; for (const auto& e : edges) { co...
1,070
378
/** \file "sim/prsim/Cause.hh" Structure of basic node event. $Id: Cause.hh,v 1.5 2009/02/01 07:21:35 fang Exp $ */ #ifndef __HAC_SIM_PRSIM_CAUSE_H__ #define __HAC_SIM_PRSIM_CAUSE_H__ #include <iosfwd> #include "sim/common.hh" #include "sim/prsim/enums.hh" #include "util/utypes.h" #include "sim/prsim/devel_swit...
4,353
1,805
#pragma once #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <unistd.h> #include <stdlib.h> #include <iostream> #include <stdio.h> #include <strings.h> #include <string> #include <exception> #include <cstring> #define KINET_DEFAULT_PORT 42069 #define KINET_DEFAULT_BU...
7,488
2,290
/* * gogh::disassembler * * The class is just a wrapper for capstone disassembler. * `gogh` will use its own instruction decoder/disassembler. * */ #include <capstone/capstone.h> namespace gogh { class disassembler { public: disassembler() { if (cs_open( ...
1,547
439