text
stringlengths
7
961k
// Objective: find two numbers that sum to target // Key: use hashmap to keep track of values indices // do subtraction to find complementary value class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> map; for (int i = 0; i < nums.size(); ++i) { con...
/**************************************************************************** * Copyright (c) 2018 by the Cabana authors * * All rights reserved. * * * * This ...
/* link: https://practice.geeksforgeeks.org/problems/count-squares3649/1 */ #include "CppUnitTest.h" #include <iostream> #include <algorithm> #include <vector> using namespace std; using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace LoveBabbar450InCPPTest { TEST_CLASS(SearchSort) { ...
/* * Copyright (C) 2017 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...
#include "cmib_sequencer.hpp" #include "cmib_parser.hpp" const char split_declarations_regexp[] = R"(\s*\w(?:.*?(OBJECT-TYPE).*\n(?:.*\n)*?.*::=.*?\n)|(?:(.*)?:=(.*\n)+?\n))"; int CmibFileSequencer::parse_all(const std::string& str) { static const std::regex regexp(split_declarations_regexp); std::for_each(st...
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/policy/core/browser/url_blacklist_policy_handler.h" #include <memory> #include <utility> #include "base/values.h" #include "compone...
/*========================================================================* * * * Distributed by Whiteley Research Inc., Sunnyvale, California, USA * * http://wrcad.com * * Copyright (C...
/* This is the subclass graphics library for all our displays, providing a common set of graphics primitives (points, lines, circles, etc.) Adafruit invests time and resources providing this open source code, please support Adafruit & open-source hardware by purchasing products from Adafruit! Based on ESP8266 library...
#include "VkPipeline.h" #include <array> #include "VkBuffer.h" #include "VkDevice.h" #include "VkContext.h" namespace Lumen::Graphics::Vulkan { namespace { Pipeline* CreateFuncVulkan(const PipelineInitInfo& initInfo) { const VkShader& shader = *dynamic_cast<VkShader*>(initInfo.Shader); const auto render...
#pragma once // Based on `boost` library (https://www.boost.org) // // DO NOT REMOVE, exists to avoid private/public headers mixing! #ifndef TACKLE_COMPRESSED_PAIR_HPP #define TACKLE_COMPRESSED_PAIR_HPP #include <tacklelib/tacklelib.hpp> #include <tacklelib/utility/platform.hpp> #include <tacklelib/utility/static_a...
// Generated by Haxe 3.3.0 #include <hxcpp.h> #ifndef INCLUDED_cpp_vm_Mutex #include <cpp/vm/Mutex.h> #endif namespace cpp{ namespace vm{ void Mutex_obj::__construct(){ HX_STACK_FRAME("cpp.vm.Mutex","new",0xabb3ca05,"cpp.vm.Mutex.new","C:\\Haxe\\haxe\\std/cpp/vm/Mutex.hx",28,0x6028f39a) HX_...
/*========================================================================= * * Copyright Insight Software Consortium * * 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 * * h...
#pragma once // This file is generated from the Game's Reflection data #include <cstdint> #include <RED4ext/Common.hpp> #include <RED4ext/ISerializable.hpp> namespace RED4ext { namespace anim { struct BoneTraceCondition : ISerializable { static constexpr const char* NAME = "animBoneTraceCondition"; static c...
/*************************************************************************** qgslayoutmodel.cpp ------------------ begin : October 2017 copyright : (C) 2017 by Nyall Dawson email : nyall dot dawson at gmail dot com *...
// Copyright (c) 1992-2003. Ken Kahn, Animated Programs, All rights reserved. #if !defined(__TT_DEFS_H) #include "defs.h" #endif #if !defined(__TT_STRINGS_H) #include "strings.h" #endif #if !defined(__TT_SPRITE_H) #include "sprite.h" #endif #if !defined(__TT_TOOLS_H) #include "tools.h" #endif ...
/* CPL_SHA256* functions derived from http://code.google.com/p/ulib/source/browse/trunk/src/base/sha256sum.c?r=39 */ /* The MIT License Copyright (C) 2011 Zilong Tan (tzlloch@gmail.com) Copyright (C) 2015 Even Rouault <even.rouault at spatialys.com> Permission is hereby granted, free of charge, to any perso...
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2017 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include <config/bitcoin-config.h> #endif #include <i...
/* * Copyright (c) 2019 Opticks Team. All Rights Reserved. * * This file is part of Opticks * (see https://bitbucket.org/simoncblyth/opticks). * * 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 ...
// Copyright (c) 2016-2020 The BitcoinCore developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include <config/fujicoin-config.h> #endif #include <chainparams.h> #include <chainparamsbase.h> #...
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file notify.cxx * @author d...
// Copyright John McFarlane 2018. // 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 <cnl/_impl/type_traits/identical.h> #include <cnl/elastic_integer.h> #include <cnl/fraction.h> ...
/* Copyright (c) 2010, 2014-2020, Arvid Norberg Copyright (c) 2016-2017, Alden Torres 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 copyrigh...
/** * @file io/cxx/ImageBmpFile.cc * @date Wed Nov 28 15:36:00 2012 +0200 * @author Laurent El Shafey <laurent.el-shafey@idiap.ch> * @author Manuel Gunther <siebenkopf@googlemail.com> * * @brief Implements an image format reader/writer for BMP files. * * Copyright (C) 2011-2013 Idiap Research Institute, Martign...
// 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 "src/ui/a11y/lib/util/util.h" namespace a11y { zx_koid_t GetKoid(const fuchsia::ui::views::ViewRef& view_ref) { return fsl::GetKoid(view_ref.r...
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/cloudformation/model/StackInstanceFilterName.h> #include <aws/core/utils/HashingUtils.h> #include <aws/core/Globals.h> #include <aws/core/utils/EnumParseOverflowContainer.h> using names...
#include "DomainBehaviour.h" namespace alica { DomainBehaviour::DomainBehaviour(string name) : BasicBehaviour(name) {} DomainBehaviour::~DomainBehaviour() {} } /* namespace alica */
/***************************************************************************** * * This file is part of Mapnik (c++ mapping toolkit) * * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as p...
// 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 "google_apis/gaia/oauth2_api_call_flow.h" #include <string> #include <vector> #include "base/strings/stringprintf.h" #include "google_apis/...
//----------------------------------------------------------------------------// // // // ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation // // and distributed under the MIT License (MIT). ...
#include <iostream> #include <cassert> #include "Viewport.h" #include <algorithm> Viewport::Viewport(const dcomplex& center, double breadth) : center(center), breadth(breadth) {} const dcomplex& Viewport::getCenter() const { return center; } double Viewport::getBreadth() const { return breadth; } vo...
//IN DIRECTED GRAPH - DON'T ADD parent[src] != x CONDITION [ LINE 9] //IN UNDIRECTED GRAPH - ADD ABOVE void dfs(int src, vector<int> &color, vector<int> adj[], vector<int> &parent, bool &flag) { if (flag) { return; } color[src] = 1; //JUST DISCOVERED for (auto x : adj[src]) { if (color[...
/* changed by eQ-3 Entwicklung GmbH 2006 */ #include "XmlRpcClient.h" #include "XmlRpcSocket.h" #include "XmlRpc.h" #include "XmlRpcServerConnection.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #if defined(_WINDOWS) # include <winsock2.h> #else # include <netinet/in.h> #endif using namespace Xml...
// Copyright 2013 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 "cc/test/test_context_support.h" #include "base/bind.h" #include "base/message_loop/message_loop.h" namespace cc { TestContextSupport::TestCon...
#include <boost/json.hpp> using namespace boost::json; #include <string> #include <iostream> int main() { object obj; obj[ "pi" ] = 3.141; obj[ "happy" ] = true; obj[ "name" ] = "Boost"; obj[ "nothing" ] = nullptr; obj[ "answer" ].emplace_object()["everything"] = 42; obj[ "list" ] = { 1, 0...
// Copyright 2015 fotono Development Foundation and contributors. Licensed // under the Apache License, Version 2.0. See the COPYING file at the root // of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 #include "historywork/GzipFileWork.h" #include "util/Fs.h" namespace fotono { GzipFileWork::Gz...
{{symbol}} = new {{call_constructor}};
// Copyright 2020 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 "storage/browser/quota/quota_client_type.h" #include "base/no_destructor.h" namespace storage { const QuotaClientTypes& AllQuotaClientTypes() ...
#include<bits/stdc++.h> using namespace std; char s[1100][1100]; int huo[1100][1100]; int vis[1100][1100]; int dis[4][2] = {{0,1},{1,0},{0,-1},{-1,0}}; int main(){ std::ios::sync_with_stdio(false); int T; scanf("%d",&T); while(T--){ int n,m;int yn = 0; scanf("%d%d",&n,&m); for(int i = 0;i<n;i++)scanf(...
#pragma once #include <chrono> #include <utility> template<typename TickType = std::chrono::nanoseconds> struct Benchmark { template<typename F, typename ...Args> static TickType Run(F func, Args&&... args) { auto StartPoint = std::chrono::system_clock::now(); func(std::forward<Args>(args)...); auto Duratio...
/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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 applic...
// // main.cpp // HelloTriangle // // Created by yingliang on 2/17/16. // Copyright © 2016 yingliang. All rights reserved. // #include <iostream> #include <cmath> #include <GL/glew.h> #include <GLFW/glfw3.h> GLfloat vertices[] = { // Postions // Colors -0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0....
// This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com /** Copyright (c) 2017 Roman Katuntsev <sbkarr@stappler.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and...
/* * BSD LICENSE * Copyright (c) 2021 Samsung Electronics 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 th...
#pragma once #include <boxpp/base/streams/Stream.hpp> #include <boxpp/base/systems/AtomicBarrior.hpp> #include <boxpp/base/tpls/traits/Movable.hpp> namespace boxpp { class BOXPP FMemoryStream : public IStream { private: enum { MEMFL_READ_ONLY = 1, MEMFL_NO_DELETE = 2 }; public: FMemoryStream(size_t I...
#include <iostream> #include "patchcache.h" REMESHER_NAMESPACE_BEGIN PatchCache::PatchCache (void) { this->cache_size = 0; this->max_cache_size = REMESHER_PATCH_CACHE_SIZE; #if REMESHER_FAST_PATCH_LOOKUP this->clock = 0; #endif this->clear_statistics(); } /* -----------------------------------------------...
/* file: reshape_layer_forward_dense_default_batch_fpt_cpu.cpp */ /******************************************************************************* * Copyright 2014-2017 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License...
#pragma once #include "core/all.hpp" inline namespace queue_tools { /** * @brief Queue adaptor, creates a queue using two Stacks left, right * If there are at least two elements, left and right are not empty. * If there is one element, it is in left. * */ template <typename Stack> class QueueAdaptor { public...
//===- JumpThreading.cpp - Thread control through conditional blocks ------===// // // 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 // //===---------------------------...
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file pandaNode.cxx * @autho...
/* * Copyright (c) 2013, 2018-2019 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 o...
/* * Copyright (c) 2016, Juniper Networks, Inc. * All rights reserved. */ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // http://code.google.com/p/protobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are per...
// ----------------------------------------------------------------------------------------------------- // 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...
// Copyright (C) 2012 The Libphonenumber Authors // // 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 o...
// Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "leveldb/db.h" #include "leveldb/filter_policy.h" #include "db/db_impl.h" #include "db/filenam...
#ifndef MENUMAINH #define MENUMAINH #include "menugeneric.hpp" /*class CL_StyleManager; class MenuMain : public MenuGeneric { public: MenuMain(CL_StyleManager*); ~MenuMain(); private: }; */ #endif
// 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 "ash/display/screen_position_controller.h" #include "ash/display/display_manager.h" #include "ash/screen_util.h" #include "ash/shell.h" #inc...
/* * @Description: IMU-lidar fusion for localization workflow * @Author: Ge Yao * @Date: 2020-11-12 15:14:07 */ #ifndef LIDAR_LOCALIZATION_FILTERING_KITTI_FILTERING_HPP_ #define LIDAR_LOCALIZATION_FILTERING_KITTI_FILTERING_HPP_ #include <deque> #include <unordered_map> #include <Eigen/Dense> #include <yaml-cpp/ya...
// Copyright (C) 2018 Jonathan Müller <jonathanmueller.dev@gmail.com> // This file is subject to the license terms in the LICENSE file // found in the top-level directory of this distribution. #include <foonathan/tiny/tiny_type.hpp> #include <catch.hpp> #include <foonathan/tiny/tiny_bool.hpp> #include <foonathan/tin...
#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" #include "SimPPS/RPDigiProducer/plugins/RPLinearChargeDivider.h" #include "SimPPS/RPDigiProducer/plugins/RPHitChargeConverter.h" #include "SimPPS/RPDigiProducer/plugins/RPLinearChargeCollectionDrifter....
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/es/model/UpgradeHistory.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace E...
#include <Eigen/Core> #include <numpy_eigen/boost_python_headers.hpp> Eigen::Matrix<boost::uint8_t, Eigen::Dynamic, Eigen::Dynamic> test_uchar_D_D(const Eigen::Matrix<boost::uint8_t, Eigen::Dynamic, Eigen::Dynamic> & M) { return M; } void export_uchar_D_D() { boost::python::def("test_uchar_D_D",test_uchar_D_D); }
// 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...
#include "stdafx.h" #include <strsafe.h> #include <winternl.h> #include <TlHelp32.h> int RunPortableExecutable(void* Image) { IMAGE_DOS_HEADER* DOSHeader; // For Nt DOS Header symbols IMAGE_NT_HEADERS* NtHeader; // For Nt PE Header objects & symbols IMAGE_SECTION_HEADER* SectionHeader; PROCESS_INFORMATION PI; ...
/*========================================================================= * * Copyright Insight Software Consortium * * 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 * * h...
// // Copyright 2019 Luma Pictures // // 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 t...
/**************************************************************************************** * @author: kzvd4729 created: 2020-02-12 17:39:01 * solution_verdict: Wrong Answer language: C++ * run...
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "include/codec/SkAndroidCodec.h" #include "src/android/SkBitmapRegionCodec.h" #include "src/android/SkBitmapRegionDecoderPriv.h" #include "src/codec/SkCodecPriv.h" S...
/*=================================================================== 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...
#include "StdAfx.h" #include "PlayFabDataApi.h" #include "PlayFabSettings.h" using namespace PlayFabComboSdk; // PlayFabData Api PlayFabDataApi::PlayFabDataApi() {} void PlayFabDataApi::AbortFileUploads( DataModels::AbortFileUploadsRequest& request, ProcessApiCallback<DataModels::AbortFileUploadsResponse> ca...
/****************************************************************** * File: docqual.cpp (Formerly docqual.c) * Description: Document Quality Metrics * Author: Phil Cheatle * * (C) Copyright 1994, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not u...
// Copyright (c) 2009-2012 The Narcanisum developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <openssl/bn.h> #include <openssl/ecdsa.h> #include <openssl/rand.h> #include <openssl/obj_mac.h> #include "key.h"...
// Copyright 2001-2017 Crytek GmbH / Crytek Group. All rights reserved. #include "StdAfx.h" #include "RcCaller.h" #include <CryCore/ToolsHelpers/ResourceCompilerHelper.h> // TODO: Consider moving this to implementation file. #include <CryCore/ToolsHelpers/ResourceCompilerHelper.inl> #include <CryCore/ToolsHelpers/...
// Copyright (c) 2004-present, Facebook, Inc. // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. #include "JSBundleType.h" #include <folly/Bits.h> namespace facebook { namespace react { static uint32_t constexpr RAMBundleMagicNumber = 0xFB0...
// Copyright (c) 2017-2019 The EXCL developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "libzerocoin/Denominations.h" #include "libzerocoin/CoinSpend.h" #include "libzerocoin/Accumulator.h" #include "zexcl/zeroco...
#include "common/network/address_impl.h" #include "common/stream_info/utility.h" #include "test/mocks/stream_info/mocks.h" #include "gmock/gmock.h" #include "gtest/gtest.h" using testing::_; using testing::NiceMock; using testing::Return; namespace Envoy { namespace StreamInfo { namespace { TEST(ResponseFlagUtilsT...
// Copyright 2017 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
/* Copyright 2014 TeamWin This file is part of TWRP/TeamWin Recovery Project. TWRP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
//================================================================================================== /** Copyright 2016 NumScale SAS Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) **/ //====================================...
/* Function definitions for the 1D Struct-of-Arrays data layout. */ #include "vexs_header.h" /* Create vector of probabilities corresponding to material selection probability */ void data1DSOA::create_probabilities(problem_data problem) { cout << "Creating 1D vector of material probabilities..." << endl; for (aut...
// 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. // TODO(rtenhove) clean up frame buffer size calculations so that we aren't // constantly adding and subtracting header sizes; this is ugly and error-...
#include "planner/plannodes/insert_plan_node.h" #include <map> #include <memory> #include <string> #include <unordered_map> #include <utility> #include <vector> #include "parser/expression/constant_value_expression.h" #include "storage/sql_table.h" #include "type/transient_value_factory.h" namespace terrier::planner {...
//===----------------------------------------------------------------------===// // // 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 // //===---------------------------...
//===-- ARMWinCOFFObjectWriter.cpp - ARM Windows COFF Object Writer -- C++ -==// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
/* * DynamicGenerator.h * * Created on: 03.04.2013 * Author: cls */ #ifndef DYNAMICGRAPHSOURCE_H_ #define DYNAMICGRAPHSOURCE_H_ #include <functional> #include "../dynamics/GraphEventProxy.hpp" namespace NetworKit { /** * @ingroup generators */ class DynamicGraphSource { protected: GraphEventProxy* ...
#ifndef SPROUT_RANGE_ALGORITHM_FIXED_SET_DIFFERENCE_HPP #define SPROUT_RANGE_ALGORITHM_FIXED_SET_DIFFERENCE_HPP #include <sprout/config.hpp> #include <sprout/container/traits.hpp> #include <sprout/container/functions.hpp> #include <sprout/algorithm/fixed/result_of.hpp> #include <sprout/algorithm/fixed/set_difference.h...
// Copyright (c) 2017 Google 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...
#include <iostream> #include <NTL/ZZX.h> #include <random> #include <cmath> using namespace std; using namespace NTL; ZZX final; //在范围n之间生存生成随机数 inline int RandomNum() { std::random_device rd; std::mt19937 rng(rd()); //在这里取到一个范围在0~2q的随机 数字 //在取一个矩阵的时候mod q 取四舍五入 std::uniform_int_distributi...
// Copyright (c) 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 "net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.h" #include <cstddef> #include <memory> #include <string> #in...
#include "BWT_decode.h" string invert(string &BWTArray, long long index) { int BWTLength = BWTArray.size(); vector<unsigned char> BWTSortedArray(BWTLength); for (size_t i = 0; i < BWTLength; i++) BWTSortedArray[i] = (reinterpret_cast<unsigned char &>(BWTArray[i])); vector<int> shift; // Index at which ...
/**************************************************************************** * * Copyright (c) 2015 Estimation and Control Library (ECL). All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: ...
#include "context.hpp" #include <cassert> #include <cstddef> #include <json/writer.h> namespace splitwisecpp { Context::Context(const Configuration* config_) : oauth_consumer(config_->consumer_key, config_->consumer_secret), oauth_token(config_->oauth1_token, config_->oauth1_token_secret) { oauth_client...
#include "signverifymessagedialog.h" #include "ui_signverifymessagedialog.h" #include "addressbookpage.h" #include "base58.h" #include "guiutil.h" #include "init.h" #include "main.h" #include "optionsmodel.h" #include "walletmodel.h" #include "wallet.h" #include <QClipboard> #include <string> #include <vector> Sign...
/* * Copyright 2009-2017 Alibaba Cloud 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...
#include <iostream> using std::cout; using std::cin; using std::endl; using std::string; int main() { string s1, s2; cin >> s1 >> s2; if (s1 == s2) cout << s1 << " == " << s2 << endl; else if (s1 > s2) cout << s1 << " > " << s2 << endl; else cout << s1 << " < " << s2 << endl...
// 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 "jingle/glue/thread_wrapper.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/lazy_instance.h" #include "base/threadin...
#include <iostream> using namespace std; class Solution { public: long long squaresInChessBoard(long long N) { return N * (N + 1) * (2*N + 1) / 6; } };
// Copyright Louis Dionne 2013-2017 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/assert.hpp> #include <boost/hana/experimental/printable.hpp> #include <boost/hana/integral_constant.hpp> #include <boo...
/* 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...
#include "CFracao.h" #include <iostream> using namespace std; // // M�todos Protegidos da classe CFracao // CFracao CFracao::Reduzida(void) { int gcd = 1; int minimo = m_numerador; if (m_numerador > m_denominador) minimo = m_denominador; for (int i = 1; i <= minimo; i++) { if ((m_numerador % i == 0) && (m_deno...
// Copyright (c) 2011-2017 The Cryptonote developers // Copyright (c) 2014-2017 XDN developers // Copyright (c) 2016-2017 BXC developers // Copyright (c) 2017 UltraNote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.ph...