text
string
size
int64
token_count
int64
/* * test_AMA.cpp * * Created on: 2013-4-10 * Author: fasiondog */ #include "doctest/doctest.h" #include <fstream> #include <hikyuu/StockManager.h> #include <hikyuu/indicator/crt/UPNDAY.h> #include <hikyuu/indicator/crt/CVAL.h> #include <hikyuu/indicator/crt/KDATA.h> using namespace hku; /** * @defgroup ...
1,478
626
#include "report/report.hpp" #include "report/summary.hpp" #include "common/common.hpp" #include "yaml-cpp/yaml.h" #include <string> using namespace std; using namespace sc_core; namespace { const char * const MSGID{ "/Doulos/Example/yaml" }; } string nodeType( const YAML::Node& node ) { string result; switch (...
2,501
970
/* Copyright (c) 2016, Project OSRM contributors 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 f...
3,606
1,146
#include "quad_3D.h" quad_3D::quad_3D(glm::vec3 const & p1, glm::vec3 const & p2, glm::vec3 const & p3, glm::vec3 const & p4) : verts { p1, p2, p3, p4 } { } auto quad_3D::create(resource_handler & rh) -> void { vertex_buffer.create(); vertex_buffer.fill(verts.size() * sizeof(glm::vec3), verts.data(), GL_STATIC_D...
523
234
#include "SubMesh.hpp" namespace Ilum { SubMesh::SubMesh(std::vector<Vertex> &&vertices, std::vector<uint32_t> &&indices, uint32_t index_offset, scope<material::DisneyPBR> &&material) : vertices(std::move(vertices)), indices(std::move(indices)), index_offset(index_offset), material(*material) { for (a...
1,115
405
#include <iostream> #include <cmath> #define N 100000 typedef long long value_type; int n, m, chunkLen; value_type values[N], chunk[400]; auto rangeAdd(int begin, int end, value_type value) -> void { for (int i = 0; i < n; ++ i) { values[i] += value; } for (int i = begin / chunkLen + 0.5; i < end / chunkLen +...
461
216
// Copyright 2004-present Facebook. All Rights Reserved. #include "fboss/platform/helpers/utils.h" #include <fcntl.h> #include <glog/logging.h> #include <sys/mman.h> #include <iostream> namespace facebook::fboss::platform::helpers { /* * execCommand * Execute shell command and return output and exit status */ std...
3,510
1,359
/// After /// A very fast and crude implementation for a memory compressed /// boolean array. Please note that std::vector already has this /// impl, but I needed a stack alloc array #include <type_traits> #include <iterator> #include <vector> namespace ari { // extends https://github.com/aryan-gupta/libari ////...
1,961
678
// ====================================================================== /*! * \brief Implementation of namespace NFmiInterpolation */ // ====================================================================== /*! * \namespace NFmiInterpolation * * \brief Interpolation tools * * Namespace NFmiInterpolation conta...
25,911
7,691
#include <algorithm> #include <cstdlib> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <numeric> #include <opencv2/core/matx.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/opencv.hpp> #include <vector> using namespace std; using namespace cv; #define STEP 5 #define JITTER...
2,486
963
#include "flyMS/ready_check.h" #include <chrono> #include "rc/dsm.h" #include "rc/start_stop.h" #include "rc/led.h" // Default Constructor ReadyCheck::ReadyCheck() { is_running_.store(true); } // Desctuctor ReadyCheck::~ReadyCheck() { is_running_.store(false); rc_dsm_cleanup(); } int ReadyCheck::WaitForSta...
2,131
828
#include <iostream> #include <stdlib.h> #include "ResultDatabase.h" #include "OptionParser.h" #include "Utility.h" using namespace std; //using namespace SHOC; #include <cuda.h> #include <cuda_runtime.h> void addBenchmarkSpecOptions(OptionParser &op); void RunBenchmark(ResultDatabase &resultDB, ...
5,270
1,584
#include <Arduino.h> #include "music.h" #include "tunes.h" const uint8_t mario[] MUSICMEM = { 0x50, 0x72, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x20, 0x33, 0x2e, 0x35, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0...
156,823
151,972
#include <windows.h> #include <stdio.h> #include <shlwapi.h> #include <shlobj.h> #include "ntdll.h" #include "rc4.h" #include "secconfig.h" #include "inet.h" #include "utils.h" #include "splice.h" #include "spooler/spooler.h" #include "spooler/antiav.h" #include "ms10_092/ms10_092.h" #include "ms10_0...
10,896
5,027
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { vector<int>n; string s; cin>>s; for(int i=s.size()-1;i>=0;--i) n.push_back(s[i]-'0'); while(cin>>s) { if(s=="0")break; for(int i=s.size()-1;i>=0;i--) {...
714
308
#include <cstdlib> #include <cstring> #include <cstdio> #include <ctime> #include <iostream> #include <NetworkKit.h> #include <SupportKit.h> using std::cout; using std::endl; void stressTest(int32 domainNumber, int32 totalCookies, char** flat, ssize_t* size) { char **domains = new char*[domainNumber]; cout << "...
2,289
971
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) 2012-2014 Chuan Ji <ji@chu4n.com> * * * * ...
3,765
1,034
/* Copyright (c) 1996-2004, Adaptec Corporation * 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...
3,609
1,295
// Copyright 2019 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 <fcntl.h> #include <fuchsia/hardware/goldfish/llcpp/fidl.h> #include <fuchsia/sysmem/llcpp/fidl.h> #include <lib/fdio/directory.h> #include <lib/f...
55,763
20,556
//===------------------------------------------------------------*- C++ -*-===// // // Ripples: A C++ Library for Influence Maximization // Marco Minutoli <marco.minutoli@pnnl.gov> // Pacific Northwest National Laboratory // //===-------------------------------------------...
7,972
2,856
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/amplify/model/CustomRule.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace ...
1,761
651
//===-- Propagators.cpp - Propagators for LLVM Instructions -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
17,876
6,518
class Solution { private: bool isPredecessor(const string &x, const string &y) { if (y.size() - x.size() != 1) return false; if (y.substr(1) == x || y.substr(0, x.size()) == x) return true; for (int i = 0; i < y.size() - 1; ++i) { if (y.substr(0, i) + y.substr(i + 1) == x) ret...
913
337
/****************************************************************************** * $Id$ * * Project: libLAS - http://liblas.org - A BSD library for LAS format data. * Purpose: LAS index class * Author: Gary Huber, gary@garyhuberart.com * ***********************************************************************...
30,780
10,127
/* * Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" fil...
14,615
5,046
#include"../../BaseIncluder/ChBase.h" #include"../ChTextObject/ChTextObject.h" #include"../ChModel/ChModelObject.h" #include"ChModelLoader.h" /////////////////////////////////////////////////////////////////////////////////////// //ChModelLoader Method// //////////////////////////////////////////////////////////////...
996
277
/*Finding common elements between two arrays in which the elements are distinct. Eg: 1 2 3 4 5 12 8 6 7 3 4 2 9 11 1 2 3 4 5 8 12 2 3 4 6 7 9 11 O/P: 2 3 4 */ #include<algorithm> #include<iostream> #include<vector> using namespace std; int main(int argc, char const *argv[]) { int n1,n2,a; cin>>n1; v...
916
428
#include <bits/stdc++.h> int main() { int n, l, c; scanf("%d %d %d\n", &n, &l, &c); int wordsSize[n], inLine = 0, lines = 1, pages = 1, first = 1; char words[n][c + 1]; for (int i = 0; i < n; i ++) { scanf("%s", words[i]); getchar(); wordsSize[i] = strlen(words[i]); inLine += (!first) + wordsSize...
543
245
#pragma once #include "VEC.hpp" #include <deque> class CMD; typedef std::deque<CMD> CMD_DEQUE; typedef int BOOL; enum CMD_ENUM { MOVE, LASER, WAIT }; class __declspec(dllexport) CMD { public: CMD(); CMD(CMD &cpy); CMD(CMD_ENUM &e, BOOL &b); CMD(CMD_ENUM &e, VEC &v); CMD(CMD_ENUM &e, NUM &n); ~CMD()...
394
204
/* * Player - One Hell of a Robot Server * Copyright (C) 2000 * Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; e...
2,875
1,156
/* Copyright (c) 2015, Project OSRM contributors 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 f...
25,384
7,170
#include "RecoVertex/KinematicFitPrimitives/interface/KinematicPerigeeConversions.h" #include "TrackingTools/TrajectoryState/interface/PerigeeConversions.h" ExtendedPerigeeTrajectoryParameters KinematicPerigeeConversions::extendedPerigeeFromKinematicParameters( const KinematicState& state, const GlobalPoint& point...
6,318
2,132
#include "./matrix-ops.hpp" namespace matrixOps = pobr::imgProcessing::utils::matrixOps; const cv::Mat& matrixOps::forEachPixel( const cv::Mat& img, const std::function<void(const uint64_t& x, const uint64_t& y)>& operation ) { for (uint64_t x = 0; x < img.cols; x++) { for (uint64_t y = 0; y < img...
398
157
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "UploadPicturesPg.h" #include "PhotoDataPg.h" #include <WebInit.h> #include <WebReq.hpp> #include <WebCntxt.hpp> #include <WebFact.hpp> #include <Jpeg.hpp> #include <IBQuery.hpp> //----...
4,849
1,454
#include "gamewindow.h" #include "cardgroups.h" #include <algorithm> #include <QPainter> #include <QDebug> #include <QPalette> #include <QMessageBox> const QSize GameWindow::gameWindowSize = QSize(1200, 800); const int GameWindow::cardWidthSpace = 35; const int GameWindow::cardHeightSpace = 20; //TODO c...
28,347
9,135
#include "foundation/string.h" #include "platform/call_stack.h" #include <sstream> #define WINDOWS_LEAN_AND_MEAN #include <Windows.h> namespace hg { void win32_trigger_assert(const char *source, int line, const char *function, const char *condition, const char *message) { std::ostringstream description; descripti...
793
274
// © 2022. Triad National Security, LLC. All rights reserved. This // program was produced under U.S. Government contract // 89233218CNA000001 for Los Alamos National Laboratory (LANL), which // is operated by Triad National Security, LLC for the U.S. // Department of Energy/National Nuclear Security Administration. A...
1,466
510
/** Fio system contract file * Description: fio.system contains global state, producer, voting and other system level information along with * the operations on these. * @author Adam Androulidakis, Casey Gardiner, Ed Rotthoff * @file fio.system.hpp * @license FIO Foundation ( https://github.com/fioprotocol/fi...
19,441
6,643
// 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 "services/ui/ws/video_detector_impl.h" #include "components/viz/host/host_frame_sink_manager.h" namespace ui { namespace ws { VideoDetectorImp...
846
281
#include "main.hpp" #include "Utils/WebUtils.hpp" #include "libcurl/shared/curl.h" #include "libcurl/shared/easy.h" #include <filesystem> #include <sstream> #define TIMEOUT 10 #define USER_AGENT std::string(ID "/" VERSION " (BeatSaber/" + GameVersion + ") (Oculus)").c_str() #define X_BSSB "X-BSSB: ✔" namespace WebU...
18,918
5,470
/*************************************************************************** * protocols.cc -- Functions relating to the protocol scan and mapping * * between IPproto Number <-> name. * * * **********...
11,608
3,162
// // Copyright (c) 2020 Carl Chen. All rights reserved. // #include "LoongEditorTreeNodeWidget.h" #include <imgui.h> namespace Loong::Editor { void EditorTreeNodeWidget::DrawImpl() { bool prevOpened = isOpened_; if (shouldOpen_) { ImGui::SetNextTreeNodeOpen(true); shouldOpen_...
1,384
464
// ____ ______ __ // / __ \ / ____// / // / /_/ // / / / // / ____// /___ / /___ PixInsight Class Library // /_/ \____//_____/ PCL 2.4.9 // ---------------------------------------------------------------------------- // Standard Global Process Module Version 1.3.0 // -----------------------------...
17,227
4,896
/** * @file src/llvmir2hll/config/config.cpp * @brief Implementation of the base class for all configs. * @copyright (c) 2017 Avast Software, licensed under the MIT license */ #include "retdec/llvmir2hll/config/config.h" namespace retdec { namespace llvmir2hll { /** * @brief Constructs the exception with the given e...
620
206
/** * Copyright 2020 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...
9,086
3,295
// Includes #include "LightBulbApp/TrainingPlans/Preferences/PredefinedPreferenceGroups/Supervised/GradientDescentLearningRulePreferenceGroup.hpp" #include "LightBulbApp/TrainingPlans/Preferences/ChoicePreference.hpp" #include "LightBulbApp/TrainingPlans/Preferences/PredefinedPreferenceGroups/Supervised/GradientDescen...
4,850
1,554
/// \copyright Tobias Hienzsch 2019-2021 /// Distributed under the Boost Software License, Version 1.0. /// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt #ifndef TETL_TYPE_TRAITS_INVOKE_RESULT_HPP #define TETL_TYPE_TRAITS_INVOKE_RESULT_HPP #include "etl/_type_traits/bool_constant.hpp" #inc...
3,224
1,199
#pragma once namespace Fade { class ISerializable { //virtual void Deserialize(FArchive& a_Archive); //virtual void Serialize(FArchive& a_Archive); }; }
157
58
/// \file storage.cc /// \author Marshall Asch <masch@uoguelph.ca> /// \brief Storage driver for the RHPMAN data storage scheme. /// /// /// Copyright (c) 2021 by Marshall Asch <masch@uoguelph.ca> /// Permission to use, copy, modify, and/or distribute this software for any /// purpose with or without fee is hereby gran...
2,975
988
// Copyright 2014 Samsung Electronics Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "media/base/tizen/demuxer_stream_player_params_tizen.h" namespace media { DemuxerConfigs::DemuxerConfigs() : audio_codec(kUnknownAudioCo...
791
287
// // ami_cs.cpp,v 1.27 2000/11/16 03:51:19 bala Exp // // ============================================================================ // // = LIBRARY // TAO IDL // // = FILENAME // ami_cs.cpp // // = DESCRIPTION // Visitor generating code for Operation in the stubs file. // // = AUTHOR // ...
17,760
6,065
#include <named_types/named_tuple.hpp> #include <type_traits> #include <string> #include <iostream> #include <vector> using namespace named_types; namespace { size_t constexpr operator "" _h(const char* c, size_t s) { return const_hash(c); } template <size_t HashCode> constexpr named_tag<std::integral_constant<size_t,...
983
410
//------------------------------------------------------------------------------ // transformnode.cc // (C)2017-2020 Individual contributors, see AUTHORS file //------------------------------------------------------------------------------ #include "render/stdneb.h" #include "transformnode.h" #include "coregraphics/tra...
2,913
924
/*MIXTURES - Mixtures #dynamic-programming Harry Potter has n mixtures in front of him, arranged in a row. Each mixture has one of 100 different colors (colors have numbers from 0 to 99). He wants to mix all these mixtures together. At each step, he is going to take two mixtures that stand next to each other and mix ...
2,976
987
#pragma once #include <map> #include <new> #include <ostream> #include "IMemoryManager.hpp" #include "portable.hpp" namespace My { ENUM(MemoryType){CPU = "CPU"_i32, GPU = "GPU"_i32}; std::ostream& operator<<(std::ostream& out, MemoryType type); class MemoryManager : _implements_ IMemoryManager { public: ~Mem...
732
240
/** * Copyright (c) 2017-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #include "../engi...
2,692
1,152
// Copyright (C) 2002-2009 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIWindow.h" #ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUISkin.h" #include "IGUIEnvironment.h" #include "IVideoDriver.h" #include "IGUIBut...
10,074
4,067
/** * \file GeodesicExact.hpp * \brief Header for GeographicLib::GeodesicExact class * * Copyright (c) Charles Karney (2012-2013) <charles@karney.com> and licensed * under the MIT/X11 License. For more information, see * http://geographiclib.sourceforge.net/ *****************************************************...
34,438
11,328
#ifndef OPTIONS_HPP #define OPTIONS_HPP #include <cinttypes> #include <fstream> #include <stdexcept> #include <vector> #include "Arrays.hpp" #include "Real.hpp" namespace trinom { enum class SortType : char { WIDTH_DESC = 'W', WIDTH_ASC = 'w', HEIGHT_DESC = 'H', HEIGHT_ASC = 'h', NONE = '-' }; ...
2,900
993
#pragma once #include <cstdint> namespace NWNXLib { namespace API { struct ZSTD_optimal_t { int32_t price; uint32_t off; uint32_t mlen; uint32_t litlen; uint32_t rep[3]; }; } }
203
97
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. // // Tencent is pleased to support the open source community by making WeChat QRCode available. // Copyright (C) 2020 THL A29...
2,006
651
#include "stdafx.h" void Gui::init() { //CHANGE ME } void Gui::draw() { //CHANGE ME ImGui::Begin("Hello world window"); ImGui::Text("Hello world!"); ImGui::End(); } void Gui::deinit() { //CHANGE ME }
210
95
//! @file //! @author cli2cpp.py - CLI library 2.9 (Alexis Royer, http://alexis.royer.free.fr/CLI/) //! @date 2018-03-14T19:03:42.485341 //! @warning File auto-generated by 'cli2cpp.py' - Do not edit! // ----- Pre-compiled headers ----- #include "cli/pch.h" // ----- Extra cpp (option='head') ----- // ----- Includes ...
2,712
920
/****************************************************************************** Copyright (c) 2017, Alexander W. Winkler. 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...
3,355
1,151
// SPDX-License-Identifier: Apache-2.0 // Copyright 2021 - 2021, the Anboto author and contributors #ifdef _WIN32 #include <Core/Core.h> using namespace Upp; #include <Functions4U/Functions4U.h> #include "OfficeAutomation.h" #include "OfficeAutomationBase.h" OfficeDoc::OfficeDoc() { Ole::Init(); } OfficeDoc::~O...
2,977
992
// 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 "device/bluetooth/test/fake_radio_winrt.h" #include <utility> #include "base/bind.h" #include "base/test/bind_test_util.h" #include "base/threa...
4,641
1,509
#ifndef RAYTRACER_SHAPE_HPP #define RAYTRACER_SHAPE_HPP #include <string> #include <ostream> #include "color.hpp" #include "ray.hpp" #include "hitpoint.hpp" #include <glm/vec3.hpp> #include <glm/glm.hpp> #include <memory> class Shape { public: Shape(); Shape(std::string const &name, std::shared_ptr<Material>...
1,203
430
#include "Hardware.h" Hardware Hardware::hw = Hardware(); void Hardware::init() { for(int i = 0; i < GATE_OUTPUTS; i++) { gateOutputs[i]->init(); } for(int i = 0; i < GATE_OUTPUTS; i++) { gateOutputs[i]->digitalWrite(false); } mcp23s17Device.gpioPortUpdate(); // TODO move to send...
570
229
/** * @file src/fileinfo/file_information/file_information_types/relocation_table/relocation.cpp * @brief Class for one relocation. * @copyright (c) 2017 Avast Software, licensed under the MIT license */ #include "fileinfo/file_information/file_information_types/relocation_table/relocation.h" #include "fileinfo/fi...
2,433
730
//===================================================================== // (c) Copyright EFC of NICS; Tsinghua University. All rights reserved. // Author : Kai Zhong // Email : zhongk15@mails.tsinghua.edu.cn // Create Date : 2019.06.10 // File Name : process.cpp // Description : read pairs of picture name ...
22,168
8,048
#include "HCGenerator.h" void HCGen::generate() { while(true){ sc_uint <15> res; sc_uint <11> tmp; bool p1, p2, p3, p4; //parity bits din_rdy.write(1); do{ wait(); }while(! din_vld.read()); tmp=din.read(); din_rdy.write(0); p1= tmp.bit(10-0)^tmp.bit(10-1)^tmp.bit(10-3)^tmp.bit(10-4)^tmp.bit...
1,363
747
#include <iostream> #include <algorithm> #include <vector> #include <string> using namespace std; bool myfunction(string i, string j) { return (i.length() < j.length()); } int main(void) { string myints[] = {"hello", "world", "i", "love"}; vector<string> myvec(myints, myints + 4); sort(myvec.begin(),...
497
180
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2014 Torus Knot Software Ltd Permission is hereby granted, free of charge, to any person ...
50,956
13,160
// OJ: https://leetcode.com/problems/trapping-rain-water/ // Author: github.com/lzl124631x // Time: O(N) // Space: O(N) class Solution { public: int trap(vector<int>& A) { int N = A.size(), ans = 0; vector<int> left(N, 0), right(N, 0); for (int i = 1; i < N; ++i) left[i] = max(l...
1,088
467
#include "SceneObject.hpp" #include "CommandBuffer.hpp" #include "Material.hpp" #include "RenderWindow.hpp" #include "Scene.hpp" #include "StandardMesh.hpp" #include <iostream> namespace cdm { SceneObject::Pipeline::Pipeline(Scene& s, StandardMesh& mesh, MaterialInterface...
29,399
11,177
// // Copyright 2020 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in // compliance with the Apache License and the following modification to it: // Section 6. Trademarks. is deleted and replaced with: // // 6. Trad...
8,283
2,407
#include "QuadratureUtil.h" #include <iostream> #include <math.h> #include <assert.h> using namespace std; void getGaussPoints1D(int ngp, vector<double>& gausspoints, vector<double>& gaussweights) { //cout << " ngp = " << ngp << endl; gausspoints.resize(ngp); gaussweights.resize(ngp); switch(ngp) { ...
33,645
21,468
#include "IntaRNA/InteractionEnergyVrna.h" #include <cassert> #include <set> // ES computation extern "C" { #include <ViennaRNA/fold_vars.h> #include <ViennaRNA/fold.h> #include <ViennaRNA/part_func.h> #include <ViennaRNA/structure_utils.h> #include <ViennaRNA/utils.h> } namespace IntaRNA { //////////////////...
7,155
2,808
#include "Calculadora.h" Calculadora::Calculadora(int n1, int n2) { num1 = n1; num2 = n2; } int Calculadora::somar() { return num1 + num2; } int Calculadora::subtrair() { return num1 - num2; }
199
87
class Solution { public: int arrayNesting(vector<int>& nums) { int res = 0; for (int i = 0; i < nums.size(); i ++ ) { if (nums[i] != -1) { int j = i, s = 0; // 对没遍历过的点遍历一下环 while (nums[j] != -1) { s ++ ; int next = n...
497
181
#include "connection.h" #include "dronecore_impl.h" #include "mavlink_channels.h" #include "global_include.h" namespace dronecore { Connection::Connection(DroneCoreImpl &parent) : _parent(parent), _mavlink_receiver() {} Connection::~Connection() { // Just in case a specific connection didn't call it alre...
1,050
349
/* * Copyright 2019 Xilinx 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 law or agreed to ...
3,255
1,105
#include "core/connection.h" #include "user_profile_request_handler.h" #include "index_service.h" #include "query_service.h" #include "userprofile.pb.h" void UserProfileRequestHandler::DoGet(RedisRequest* request, Connection* conn) { auto& uid = request->arguments(0); auto& qs = QueryService::Instance(); RecoUs...
1,115
404
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "net/tools/transport_security_state_generator/spki_hash.h" #include <string> #include "base/base64.h" #include "base/logging.h" #include "base/...
1,187
439
#include <iostream> #include <autodiff/forward/real.hpp> #include <autodiff/forward/real/eigen.hpp> #include <Eigen/Dense> #include <Eigen/Core> #include "rotation.hpp" // using namespace autodiff; using namespace Eigen; class Object { public: Object(); virtual autodiff::real U(const autodiff::...
606
227
#include <tokentransactionrecord.h> #include <base58.h> #include <consensus/consensus.h> #include <validation.h> #include <timedata.h> #include <wallet/wallet.h> #include <stdint.h> /* * Decompose CWallet transaction to model transaction records. */ QList<TokenTransactionRecord> TokenTransactionRecord::decomposeTr...
3,027
995
/** * @file r_tree_descent_heuristic.hpp * @author Andrew Wells * * Definition of RTreeDescentHeuristic, a class that chooses the best child of a * node in an R tree when inserting a new point. * * mlpack is free software; you may redistribute it and/or modify it under the * terms of the 3-clause BSD license. ...
2,124
685
#include "run/jobs/SimulationJobs.h" #include "gravity/AggregateSolver.h" #include "io/LogWriter.h" #include "io/Logger.h" #include "io/Output.h" #include "run/IRun.h" #include "run/SpecialEntries.h" #include "sph/solvers/StabilizationSolver.h" NAMESPACE_SPH_BEGIN /// \todo generailize, add generic triggers to UI cla...
27,585
9,080
/* * Copyright (c) 2000 - 2015 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 ...
2,535
860
// --- Caliper continuous integration test app for basic trace test #define _XOPEN_SOURCE #include <unistd.h> /* usleep */ #include "caliper/cali.h" #include "caliper/cali-manager.h" #include <string> // test C and C++ macros void foo(int count, int sleep_usec) { CALI_CXX_MARK_FUNCTION; CALI_MARK_BEGIN("p...
1,453
653
#include "time_line.hpp" TimeLine applyDurations(const DifTimeLine& dtline, Time start) { TimeLine rv{start}; for (auto duration: dtline.durations) { start += duration; rv.push_back(start); } return rv; }
242
87
#include <iostream> using namespace std; int main (void){ double up,qty,discr,total,disct,payable; int width =20; cout.width(width); cout.setf(ios::left); return 0; cout << "Enter Unit Price" << ": "; cin >> up; cout.width(width); cout.setf(ios::left); cout << "Enter Quantity" << ":...
1,224
496
// // Copyright 2016 The ANGLE 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. // // DisplayVkWin32.cpp: // Implements the class methods for DisplayVkWin32. // #include "libANGLE/renderer/vulkan/win32/DisplayVkWin32.h" #in...
6,051
2,030
/* * This C++ source file was generated by the Gradle 'init' task. */ #include <iostream> #include <stdlib.h> #include "cpplib.h" std::string jniexample::Greeter::greeting() { return std::string("Hello, World! From C++"); }
232
83
// Copyright (c) 2018-present Baidu, Inc. 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 b...
31,985
12,143
/** * Copyright (c) 2016 SQLines * * 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 ...
44,745
19,227
#include<bits/stdc++.h> using namespace std; int main(){ double raio, pi, area; pi = 3.14159; scanf("%lf",&raio); area = pi * raio * raio; printf("A=%.4lf\n", area); return 0; }
202
101
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
8,739
2,718
#ifndef CONNECTIONLINEPREPROCESSOR_HPP_ #define CONNECTIONLINEPREPROCESSOR_HPP_ #include <math.h> constexpr osmium::object_id_type DUMMY_ID = 0; // maximum length of a connection line (given in degrees) // the given value is not a strict limit: some connection lines may be longer (up to a factor of maybe 1.5) // ap...
15,520
6,159
/* * Copyright (c) 2020, The OpenThread Authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * n...
3,129
1,070