text stringlengths 7 961k |
|---|
/*
* Copyright 2010-2017 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... |
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
* Copyright (c) QuantStack *
* *
* Distribute... |
#pragma once
#include <steem/chain/steem_object_types.hpp>
#include <boost/multi_index/composite_key.hpp>
namespace steem { namespace plugins { namespace follow {
using namespace std;
using namespace steem::chain;
using chainbase::t_vector;
#ifndef STEEM_FOLLOW_SPACE_ID
#define STEEM_FOLLOW_SPACE_ID 8
#endif
enum... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2016-2017 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "txmempool.h"
#include "clien... |
#include<stack>
#include<algorithm>
#include<iostream>
using namespace std;
class MyQueue {
stack<int> s1, s2;
int front;
public:
/** Initialize your data structure here. */
MyQueue() {}
/** Push element x to the back of queue. */
void push(int x) {
if (s1.empty())
... |
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file was generated by Djinni from yaml-test.djinni
#include "NativeExternInterface1.hpp" // my header
#include "NativeClientInterface.hpp"
#include "NativeClientReturnedRecord.hpp"
#include "NativeColor.hpp"
namespace djinni_generated {
em::val NativeExternInterface1::... |
#include "MatlabNeedleController.h"
#include "ConfigurationSpace/Cfg.h"
#include "MPProblem/Robot/Actuator.h"
#include "MPProblem/Robot/Robot.h"
#include "Simulator/MatlabMicroSimulator.h"
#include "Utilities/XMLNode.h"
#include "nonstd/container_ops.h"
#include <algorithm>
/*------------------------------ Constru... |
// This program will read in the quarterly sales transactions for a given number
// of years. It will print the year and transactions in a table format.
// It will calculate year and quarter total transactions.
// Ryan Lockman: 101430670
#include <iostream>
#include <iomanip>
using namespace std;
// Global Constants
... |
//==================================================================================================
/*!
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)
*/
//====================================... |
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Copyright (c) 2021 The Dollar Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <txdb.h>
#include <cha... |
#ifndef STAN_MATH_REV_MAT_FUN_POSITIVE_ORDERED_CONSTRAIN_HPP
#define STAN_MATH_REV_MAT_FUN_POSITIVE_ORDERED_CONSTRAIN_HPP
#include <stan/math/rev/meta.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/rev/mat/functor/adj_jac_apply.hpp>
#include <tuple>
#include <vector>
namespace stan {
namespace m... |
#include<cstdio>
const int M=10001,z=9792;
int pow(int n,int k)
{
if(!k)return 1;
if(k%2)return 1ll*n*pow(n,k-1)%M;
n=pow(n,k/2);
return n*n%M;
}
int n,s[M];
int sol(int a,int x)
{
for(int i=0;i<M;i++)
if(a*i%M==x)return i;
return -1;
}
char test(int a)
{
int x=(s[2]-1ll*a*a*s[0]+M)%... |
/**
* @file clustering.hpp
* @brief Perform a phase correlation matching.
*
* @section LICENSE
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ... |
// This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#include "login_enum_cluster.h"
#include "swganh_core/login/login_client_interface.h"
using namespace swganh::login;
using namespace swganh::messages;
using namespace std;
LoginEnumCluster ... |
#include "muscle.h"
#if !defined(__linux__) && !defined(_MSC_VER) && !defined(__MACH__)
double GetNAN()
{
return 0.0;
}
double g_dNAN = GetNAN();
void chkmem(const char szMsg[])
{
}
void Break()
{
}
char szCmdLine[4096];
const char *GetCmdLine()
{
return "muscle";
}
double GetMemUseMB()
{
return 10... |
#include "include/blake3/blake3_plugin.h"
#include <flutter_linux/flutter_linux.h>
#include <gtk/gtk.h>
#include <sys/utsname.h>
#include <cstring>
#define BLAKE3_PLUGIN(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), blake3_plugin_get_type(), \
Blake3Plugin))
struct _Blake3Plugin {
GObj... |
// 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... |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE563_Unused_Variable__unused_uninit_variable_char_81a.cpp
Label Definition File: CWE563_Unused_Variable__unused_uninit_variable.label.xml
Template File: source-sinks-81a.tmpl.cpp
*/
/*
* @description
* CWE: 563 Unused Variable
* BadSource: Initialize data
* Sinks:
*... |
/*
This utility is just a hack to extract a monospaced bitmap font from an
image file and outputing it as C code.
Windows building:
coin-config --build extractfont extractfont.cpp -lsimage1
*/
#include <cassert>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cctype>
#define SIMAGE_DLL
... |
// Copyright John Maddock 2006.
// Copyright Paul A. Bristow 2007, 2009
// Use, modification and distribution are subject to 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)
#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
#... |
#include "json.hpp"
using json = nlohmann::json;
int main()
{
// create JSON values
json array = {1, 2, 3, 4, 5};
json null;
// print values
std::cout << array << '\n';
std::cout << null << '\n';
// add values
array.emplace_back(6);
null.emplace_back("first");
null.emplace_ba... |
#ifndef STATIC_LINK
#define IMPLEMENT_API
#endif
#include <hx/CFFI.h>
#include "MobilePrefs.h"
#include <stdio.h>
using namespace mobileprefs;
#ifdef IPHONE
value mobileprefs_set_user_preference(value inId,value inValue)
{
bool result = SetUserPreference(val_string(inId),val_string(inValue));
return alloc_boo... |
/* Masstree
* Eddie Kohler, Yandong Mao, Robert Morris
* Copyright (c) 2012-2013 President and Fellows of Harvard College
* Copyright (c) 2012-2013 Massachusetts Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation... |
#include "cetlib/quiet_unit_test.hpp"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Core/SharedAnalyzer.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Services/System/TriggerNamesService.h"
#include "canvas/Utilities/InputTag.h"
... |
//@zgui_packer:ignore
#include "../zgui.hh"
using namespace zgui::globals;
//@zgui_packer:resume
// ========================================================================
bool zgui::begin_window(std::string_view title, const vec2 default_size, const unsigned long font, const int flags) {
if (!input_loop_started... |
// Copyright 2019 GurumNetworks, 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 agree... |
// Copyright (c) 2013 The Chromium OS 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 "mist/config_loader.h"
#include <fcntl.h>
#include <utility>
#include <base/files/file_path.h>
#include <base/files/scoped_file.h>
#inc... |
#include "rocket/UnitTest.h"
#include "rocket/Core/debug.h"
#include "Network.h"
using namespace Rocket::Core;
using namespace Rocket::Network;
Rocket_UnitTest ( Network_TCP ) {
// Setup local server
Network * server = new Network( (int)NetworkSettings::TCP_ListeningEnabled | (int)NetworkSettings::TCP_Enabled, 10... |
// Copyright (c) 2015-2017, RAPtor Developer Team
// License: Simplified BSD, http://opensource.org/licenses/BSD-2-Clause
#include "gtest/gtest.h"
#include "raptor.hpp"
#include "tests/hypre_compare.hpp"
#include <iostream>
#include <fstream>
using namespace raptor;
void form_hypre_weights(double** weight_ptr, int ... |
#include <iostream>
#include <map>
#include <vector>
using namespace std;
inline int alpha(const string &tmp)
{
int ret = 0;
bool visit[26] = {false, };
for (auto c : tmp) {
if (c == ' ' || visit[c-'A'])
continue;
visit[c-'A'] = true;
++ret;
}
return ret;
}
int... |
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/fnet/frt/frt.h>
#include <mutex>
#include <condition_variable>
struct RPC : public FRT_Invokable
{
void GetInfo(FRT_RPCRequest *req)
{... |
#include <iostream>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "rt", stdin);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
unsigned long requests;
unsigned long k;
cin >> requests >> k;
unsigned long value;
unsigned long passed = 0;;
fo... |
#pragma once
#include "exception.hpp"
#include <SDL_pixels.h>
#include <ostream>
namespace sdl
{
///C++ wrapping around the SDL_Color structure
class Color : public SDL_Color
{
public:
///Construct an sdl::Color object. Color will be black by default
constexpr Color() : SDL_Color{0, 0, 0, 255} {}
///Construct an ... |
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "extern/beatsaber-hook/shared/utils/typedefs.h"
#include "extern/beatsaber-hook/shared/utils/byref.hpp"
// Including type: System.Int32
#include... |
/**
* Copyright 2011-2015 Quickstep Technologies LLC.
* Copyright 2015-2016 Pivotal Software, 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.apach... |
/**
******************************************************************************
* File Name : TouchGFXHAL.hpp
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center... |
#pragma once
#include <string_view>
#include "Runtime/GCNTypes.hpp"
#include "Runtime/World/CActor.hpp"
namespace metaforce {
class CScriptCameraWaypoint : public CActor {
float xe8_hfov;
u32 xec_;
public:
CScriptCameraWaypoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTrans... |
// Copyright (c) 2013-2015 Vittorio Romeo
// License: Academic Free License ("AFL") v. 3.0
// AFL License page: http://opensource.org/licenses/AFL-3.0
#ifndef HG_GLOBAL_COMMON
#define HG_GLOBAL_COMMON
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include... |
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2019-2020 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in... |
#include "config.h"
#include "nextpnr.h"
NEXTPNR_NAMESPACE_BEGIN
namespace BaseConfigs {
void config_empty_lfe5u_25f(ChipConfig &cc)
{
cc.chip_name = "LFE5U-25F";
cc.tiles["CIB_R49C3:CIB_PLL3"].add_enum("CIB.JA3MUX", "0");
cc.tiles["CIB_R49C3:CIB_PLL3"].add_enum("CIB.JB3MUX", "0");
cc.tiles["CIB_R49C42... |
/*=============================================================================
Copyright (c) 2006-2007 Tobias Schwinger
Use modification and distribution are subject to 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).
... |
/*
* Copyright 2010-2017 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... |
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2017 The TRAFICOIN developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "core_io.h"
#include "base58.h"
#include "primitives/transaction.h"
#... |
// The MIT License (MIT)
// Copyright (c) 2014 Mohammad Dashti
// (www.mdashti.com - mohammad.dashti [at] epfl [dot] ch - mdashti [at] gmail [dot] com)
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in... |
// Copyright 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https:www.apache.org/licenses/LICENSE-2.0... |
/*
* Copyright (c) 2017, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, ... |
// Generic Geometry2 Library
// Unit Test
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014, 2017.
// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, mod... |
#include <stdlib.h>
#include "Application.h"
#include "p2Log.h"
// This is needed here because SDL redefines main function
// do not add any other libraries here, instead put them in their modules
#include "Brofiler\Brofiler.h"
#pragma comment( lib, "Brofiler/ProfilerCore32.lib" )
#include "SDL/include/SDL.h"
#prag... |
#pragma onece
#include<array>
#include<random>
#include<vector>
#include<../include/params.hpp>
#include<../include/tfhe++.hpp>
namespace myTFHE{
//void gen_Key_Switching_Key(KeySwitchingKey &ksk,const lwekeylvl1 &keylvl1, const lwekeylvl0 &keylvl0);
void Id_Key_Switch(TLWElvl0 &res_tlwe0,const TLWElvl1 tlwe1... |
/**********************************************************************
Audacium: A Digital Audio Editor
CommandManager.cpp
Brian Gunlogson
Dominic Mazzoni
*******************************************************************//**
\class CommandManager
\brief CommandManager implements a system for organizing ... |
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2019, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,... |
/* Copyright (c) 2021 PaddlePaddle 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... |
///////////////////////////////////////////////////////////////////////////////
// Name: tests/image/image.cpp
// Purpose: Test wxImage
// Author: Francesco Montorsi
// Created: 2009-05-31
// Copyright: (c) 2009 Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////... |
#pragma once
// Fortnite (1.8) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass ShutterHouse_WindowC.Shu... |
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
2020, 2021, 2022 Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files ... |
#include "StdAfx.h"
#include "AckTimerLayer.h"
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define HASH_SIZE 16
namespace acktl {
// AckTimer Layer variables
typedef struct _FLOW_STRUCTURE
{
DWORD m_dwIP;
DWORD m_dwAdapterHandle;
USHORT m_usPeerTCPPort;
USHORT m_usLocalTCPPort;
DWORD m_dw... |
#pragma once
#include <fstream>
#include <iostream>
#include <optional>
#include <string>
#include <thread>
#include <CLI/CLI.hpp>
#include <range/v3/view/getlines.hpp>
#include <range/v3/view/transform.hpp>
#include <spdlog/spdlog.h>
#include "io.hpp"
#include "query/queries.hpp"
#include "scorer/scorer.hpp"
#inclu... |
//
// Copyright 2019 ZetaSQL 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 or agree... |
#include "space_age.h"
#include <map>
namespace space_age {
Periods planets;
space_age::space_age(long age) : age_seconds(age) {}
long space_age::seconds() const { return age_seconds; }
double space_age::age_conversion(double planet_period) const {
return on_earth() / planet_period;
}
double space_age::on... |
#pragma once
#include "core.hpp"
namespace Mystery {
class MYSTERY_API Input {
public:
inline static bool IsKeyPressed(int keycode) { return s_Instance->IsKeyPressedImpl(keycode); }
inline static bool IsMouseButtonPressed(int button) { return s_Instance->IsMouseButtonPressedImpl(button); }
inline static std... |
/**
* @file
* @copyright defined in eos/LICENSE
*/
#pragma once
#include <hawknwk/hawknwk.hpp>
#include <vector>
class [[hawknwk::contract]] deferred_test : public hawknwk::contract {
public:
using hawknwk::contract::contract;
[[hawknwk::action]]
void defercall( hawknwk::name payer, uint64_t sender_id,... |
/*************************************************************************
* Copyright (C) [2021] by Cambricon, 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 a... |
/****************************************************************************/
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
// Copyright (C) 2002-2020 German Aerospace Center (DLR) and others.
// This program and the accompanying materials are made available under the
// terms of the Ecli... |
/*
* Copyright (c) 2016, Ford Motor Company
* 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 condit... |
// Copyright 2010-2021 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... |
#include <iostream>
#include <map>
#include <queue>
#include <set>
#define STEPS 100
#define SIZE 10
using namespace std;
int main() {
// When do we expect i,j to flash?
int step[SIZE][SIZE];
// What octopi do we expect to flash at step i?
map<int, set<pair<int, int>>> to_flash;
char cur;
for (int i = 0... |
#include "BuildingPlacer.h"
#include <BWAPI/Unitset.h>
bool BuildingPlacer::canBuildHereWithSpace(BWAPI::TilePosition position, BWAPI::UnitType type, int buildDist)
{
//returns true if we can build this type of unit here with the specified amount of space.
//space value is stored in this->buildDistance.
//if w... |
//=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ... |
#ifndef BOOST_THREAD_CONCURRENT_DEQUE_BASE_HPP
#define BOOST_THREAD_CONCURRENT_DEQUE_BASE_HPP
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Vicente J. Botet Escriba 2014. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE... |
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "extern/beatsaber-hook/shared/utils/typedefs.h"
#include "extern/beatsaber-hook/shared/utils/byref.hpp"
// Including type: System.Exception
#inc... |
/*Created by Lakshay Goel
Github Profile link: https://github.com/MrLakshay
Question link: https://leetcode.com/problems/search-a-2d-matrix/
Problem statement : Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are s... |
/****************************************************************************
** Meta object code from reading C++ file 'gameplayer.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.3)
**
** WARNING! All changes made in this file will be lost!
*********************************************************... |
#include "connector_manager.h"
#include "message/connector_messages.h"
#include "include/ref.h"
#include "thread_lib/thread/thread_manager.h"
ConnectorManager::ConnectorManager()
{
ManagersContainer::GetInstance().AddManager(static_cast<IManager*>(this));
}
ConnectorManager::~ConnectorManager()
{
}
void Connector... |
// (C) Copyright Gennadiy Rozental 2001.
// 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/test for the library home page.
//
///@file
/// Defines specific generators
// *****... |
/*
* Copyright (c) 2015, The Regents of the University of California (Regents).
* 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 a... |
// Copyright (c) 2017 Carmelo Evoli - MIT License
#include "XS4GCR/spallation/ghost_tree.h"
#include <fstream>
#include <iostream>
#include <limits>
#include <string>
#include <utility>
namespace XS4GCR {
GhostTree::GhostTree() {}
GhostTree::GhostTree(std::string filename_) : filename(filename_) {
read_ghosts()... |
/* C O M B . C P P
* BRL-CAD
*
* Copyright (c) 2013-2014 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as pu... |
/*
* MIT License
*
* Copyright (c) 2018-2020 Arthur Brainville (Ybalrid) and with the help of
* Comunity Contributors!
*
* Copyright (c) 2022 by Torsten Stuehn, of extensions and changes
* for the ftrobopy_server project
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* o... |
#include <iostream>
#include <ctime>
using namespace std;
//==========================================
#include <string>
struct student
{
string name;
int sc1, sc2;
bool b1, b2;
int cnt;
friend istream& operator>>(istream& is, student& s)
{
is>>s.name>>s.sc1>>s.sc2;
char c1, c2;
... |
/**
* @file
*/
#ifndef DEVICE_LED_CONTROLLER_HPP_
#define DEVICE_LED_CONTROLLER_HPP_
#include <stdint.h>
namespace device
{
/**
* @brief Object handling the communication with WS2812B LEDs
*/
class LedController
{
public:
/**
* @brief Initialize the LED state storage and hardware necessary to
* ... |
// Copyright 2013 Daniel Parker
// Distributed under Boost license
#if defined(_MSC_VER)
#include "windows.h" // test no inadvertant macro expansions
#endif
#include <jsoncons/json.hpp>
#include <jsoncons/json_encoder.hpp>
#include <catch/catch.hpp>
#include <sstream>
#include <vector>
#include <utility>
#include <cti... |
/*!
* Copyright (c) 2017 by Contributors
* \file bilinear_sampler.cc
* \brief
* \author Xu Dong
*/
#include "./bilinear_sampler-inl.h"
namespace mshadow {
template<typename DType>
bool between(DType value, int lowerBound, int upperBound) {
return (value >= lowerBound && value <= upperBound);
}
template<typename... |
/**
* UGENE - Integrated Bioinformatics Tools.
* Copyright (C) 2008-2020 UniPro <ugene@unipro.ru>
* http://ugene.net
*
* 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; either version 2
* of the L... |
////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
//
// All rights reserved.
//
// Module Name:
//
// MSIDataLock.cpp
//
// Abstract:
//
// definitions of lock for msi handles
//
////////////////////////... |
#include <iostream>
using namespace std;
int main()
{
string str[10], temp;
cout << "Enter 10 words: " << endl;
for(int i = 0; i < 10; ++i)
{
getline(cin, str[i]);
}
// Use Bubble Sort to arrange words
for (int i = 0; i < 9; ++i) {
for (int j = 0; j < 9 - i; ++j) {
... |
/* Copyright 2018 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... |
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <shellapi.h> // For CommandLineToArgvW
#include "../resource.h"
// The min/max macros conflict with like-named member functions.
// Only use std::min and std::max defined in <algorithm>.
#if defined(min)
#undef min
#endif
#if defined(max)
#undef max
#endif
//... |
/*
// Copyright (c) 2018 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... |
// https://www.hackerrank.com/challenges/tree-coordinates
#include "common/graph/graph/distance.h"
#include "common/graph/tree.h"
#include "common/graph/tree/deep.h"
#include "common/graph/tree/lca.h"
#include "common/stl/base.h"
int main_tree_coordinates() {
unsigned n, m;
cin >> n >> m;
TreeGraph t(n);
t.Re... |
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2017, Image Engine. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributi... |
/**************************************************************************
*
* list.cpp - Example program of list class.
*
* $Id$
*
***************************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreeme... |
/*
* Copyright (c) 2015 Andrew Kelley
*
* This file is part of zig, which is MIT licensed.
* See http://opensource.org/licenses/MIT
*/
#include "analyze.hpp"
#include "ast_render.hpp"
#include "codegen.hpp"
#include "error.hpp"
#include "ir.hpp"
#include "ir_print.hpp"
#include "os.hpp"
#include "parser.hpp"
#inc... |
#ifndef _ACF_PROCESS_APU_CANNY_CREATE_IMAGE_NATIVE_KERNEL_WRAPPER
#define _ACF_PROCESS_APU_CANNY_CREATE_IMAGE_NATIVE_KERNEL_WRAPPER
#include <CANNY_CREATE_IMAGE.hpp>
//structure encapsulating the information ACF requires for each I/O
typedef struct _acf_io_info {
int32_t ... |
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001-2017 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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 Sof... |
/* Copyright 2015 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... |
/**
* Author : Deep Raval
* There are no two words in the English language more harmful than "good job".
* 1729 0_0
**/
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#inc... |
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
Doom 3 BFG Edition Source Code is free... |
//【CF991D】Bishwock - 洛谷 - Ac
#include <string>
#include <iostream>
int main()
{
int ans = 0;
std::string s1, s2;
std::cin >> s1 >> s2;
for (unsigned i = 0; i < s1.size(); ++i)
{
// 1
if (s1[i] == 48 and s2[i] == 48 and s1[i + 1] == 48 and s2[i + 1] != 0)
{
++ans;
s1[i] = s2[i] = s1[i + 1] = 88;
... |
/************************************************************************************
*
* D++, A Lightweight C++ library for Discord
*
* Copyright 2021 Craig Edwards and D++ contributors
* (https://github.com/brainboxdotcc/DPP/graphs/contributors)
*
* Licensed under the Apache License, Version 2.0 (the "License... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.