text stringlengths 7 961k |
|---|
class Solution {
public:
int timeRequiredToBuy(vector<int>& tickets, int k) {
int ans = tickets[k];
for (int i = 0; i < k; ++i) {
ans += min(tickets[i], tickets[k]);
}
for (int i = k + 1; i < tickets.size(); ++i) {
ans += min(tickets[i], tickets[k] - 1);
... |
#include <iostream>
using namespace std;
int main(){
cout << "********* *** * * " << endl
<< "* * * * *** * * " << endl
<< "* * * * ***** * * " << endl
<< "* * * ... |
// created by Kona @VSCode
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <queue>
#include <vector>
#include <string.h>
#define LOCAL_TEST
typedef long long ll;
using std::cin;
using std::cout;
using std::endl;
using std::map;
using std::queue;
using std::string;
using std::vector;... |
/*************************************************************************************************
* RPC server command of Tkrzw
*
* Copyright 2020 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 ... |
#include "Consumption.h"
#include "pssst.h"
#include "cute.h"
using namespace Pssst;
struct literGas
: strong<double,literGas>
, ops<literGas,Additive,Order,Out>{
};
struct literPer100km
:strong<double,literPer100km>
,ops<literPer100km,Eq,Out>{};
struct kmDriven:strong<double,kmDriven>
,ScalarMultImpl<km... |
/// @file
///
/// Main executable
///
#include <cstring>
#include <map>
#include <string>
#include <vector>
#include <boost/program_options.hpp>
#include "advent/utils/base.hh"
#include "advent/utils/solutions.hh"
#include "advent/utils/timer.hh"
namespace {
///
/// Arguments
///
struct Arguments {
/// Should the... |
// https://www.interviewbit.com/problems/first-missing-integer/
int Solution::firstMissingPositive(vector<int> &A) {
int cnt = 0;
for (int i = 0; i < A.size(); ++i) {
cnt += A[i] > 0;
}
int last = A.size() - 1;
for (int i = 0; i < last; ++i) {
if (A[i] <= 0) {
while (last >= 0 && A[last] <= ... |
#include "software/ai/hl/stp/tactic/chip_tactic.h"
#include <algorithm>
#include "software/ai/hl/stp/action/chip_action.h"
ChipTactic::ChipTactic(const Ball &ball, bool loop_forever)
: ball(ball), Tactic(loop_forever, {RobotCapabilityFlags::Chip})
{
}
std::string ChipTactic::getName() const
{
return "Chip T... |
/*
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related docum... |
/****************************************************************************
*
* Copyright (c) 2017 PX4 Development Team. 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. Redistri... |
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
#include "disjointSet.hpp"
#include <bits/stdc++.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
using namespace index_version;
using namespace std;
struct direction {
int p; /* 水平 */
int q; /* 垂直 */
} direct[4] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
class Solution {
public:
in... |
// Copyright (c) 2014-2015 The ShadowCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
/*
Notes:
Running with -debug could leave to and from address hashes and public keys in the log.
parameters:
... |
//
// Copyright 2012 Christian Henning
//
// 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
//
#ifndef BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_INDEXED_IMAGE_HPP
#define BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_INDEXED_... |
// Copyright 2011 The Goma Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef _WIN32
#error "This is a Windows-only unit test"
#endif
#include "spawner_win.h"
#include "compiler_specific.h"
#include "filesystem.h"
#include "pat... |
#include "CSerialPortHotSwap.h"
#include <tchar.h>
#include <dbt.h>
#include <process.h>//_beginthreadex
#define CLASS_NAME _T("itas109SerialPortChangeWnd")
using namespace itas109;
// TODO: static not best
sigslot::signal2<int, std::string> CSerialPortHotSwap::portChangeSignal;
std::string wstringToString(const ... |
///////////////////////////////////////////////////////////////////////////////
// kernel::scalar::crtp.hpp //
// //
// Copyright 2009 Erwann Rogard. Distributed under the Boost //
... |
#include <openpose/wrapper/wrapperStructInput.hpp>
namespace op
{
WrapperStructInput::WrapperStructInput(const std::shared_ptr<Producer> producerSharedPtr_,
const unsigned long long frameFirst_, const unsigned long long frameLast_,
... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "txdb.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "net.h"
#i... |
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
// (C) Copyright Ion Gaztanaga 2006-2013
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/... |
#ifndef BOOST_STATECHART_TERMINATION_HPP_INCLUDED
#define BOOST_STATECHART_TERMINATION_HPP_INCLUDED
//////////////////////////////////////////////////////////////////////////////
// Copyright 2002-2006 Andreas Huber Doenni
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE... |
/**********************************************************************
* Copyright (c) 2008-2016, Alliance for Sustainable Energy.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by t... |
// 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 "ash/display/resolution_notification_controller.h"
#include <utility>
#include "ash/display/display_info.h"
#include "ash/display/display_manag... |
#include "search_engine_header.h"
#include<iostream>
#include<iomanip>
#include<time.h>
#include<unistd.h>
#include<string.h>
using namespace std;
int main()
{
search_engine A;
int opt;
string val="";
string key="";
char c;
//system("clear");
//cout.width(115);
cout<<"** SEARCH ENGI... |
// matcher.cpp
/* Matcher is our boolean expression evaluator for "where" clauses */
/**
* Copyright (C) 2008 10gen Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software F... |
// Copyright (c) 2016 The Bitcoin Core developers
// Copyright (c) 2017 The BitcoinSubsidium Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bench.h"
#include "key.h"
#if defined(HAVE_CONSENSUS_LIB)
#in... |
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "wallet.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "init.h"
#in... |
// 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 "chrome/browser/chromeos/ui/request_system_proxy_credentials_view.h"
#include <string>
#include <utility>
#include "base/bind.h"
#include "base... |
/* 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... |
// Copyright (c) 2020-present, Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.
#include "Definition.hpp"
#include "DefinitionRegistry.hpp"... |
//gyrating cat enthusiast
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <string>
#include <utility>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <vector>
#include <random>
#include <chrono>
#include <queue>
#include <set>
#include <stack>
#define ll long long... |
// Copyright 2014 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "packager/file/udp_file.h"
#if defined(OS_WIN)
#include <windows.h>
#include <ws2tcpip.... |
//---------------------------------------------------------------------------
// File: BSTree.cpp
// Author: Snehal Jogdand
// Date: 11/21/2019
// Program 4: Concordance Generator
//
// DESCRIPTION:
// BSTree:
// The cpp file for BSTree class
// Provides the set of variables and functions to process
// a Binary Se... |
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Softwa... |
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.or... |
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
/*
* Copyright (c) 2018-2019, The Aonecoin Developers.
* Portions Copyright (c) 2012-2017, The CryptoNote Developers, The Bytecoin Developers.
*
* This file is part of Aonecoin.
*
* This file is subject to the terms and conditions defined in the
* file 'LICENSE', which is part of this source code package.
*/
#... |
// MainFrm.cpp : implementation of the CMainFrame class
//
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic d... |
/*
* Copyright(C) 2015, Blake C. Lucas, Ph.D. (img.science@gmail.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 the Software without restriction, including without limitation the rights
* to... |
// Copyright (c) 2011-2013 The Bitcoin developers
// Copyright (c) 2017-2018 The C0 developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "transactionview.h"
#include "addresstablemodel.h"
#include "bitcoinuni... |
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE 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 app... |
/* -*-C++-*-
*****************************************************************************
*
* File: <file>
* Description:
*
*
* Created: 7/10/95
* Language: C++
*
*
// @@@ START COPYRIGHT @@@
//
// Licensed to the Apache Software Foundation (ASF) under one
// ... |
#include "WSEFloatingPointOperationsContext.h"
#include <cmath>
#include <random>
#include "WSE.h"
#include "warband.h"
void FLd(WSEFloatingPointOperationsContext *context)
{
int freg;
float value;
context->ExtractRegister(freg);
context->ExtractFixedPoint(value);
context->m_float_registers[freg] = value;
}
v... |
#include "compat.h"
#include "base58.h"
#include "cpubkey.h"
#include "serialize.h"
#include "chashwriter.h"
#include "util.h"
#include "cautofile.h"
#include "cdatastream.h"
#include "cstealthaddress.h"
CStealthAddress::CStealthAddress()
{
options = 0;
}
unsigned int CStealthAddress::GetSerializeSize(int nType, i... |
#include "ConfigWindow.h"
#include <imgui.h>
#include <thread>
#include "SortAlgs.h"
void ConfigWindow::showConfigWindow(bool isSorting)
{
ImGuiWindowFlags winFlags;
winFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags... |
/* Siconos is a program dedicated to modeling, simulation and control
* of non smooth dynamical systems.
*
* Copyright 2016 INRIA.
*
* 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
*
*... |
#pragma once
#include <string>
#include <numeric>
#include "Math.hpp"
#include "GUIRenderer.hpp"
#include "InputManager.hpp"
#include "Utils.hpp"
#include "ColorRGBA8.hpp"
class GUIInput {
public:
void init(const math::vec4& destRect,
const ColorRGBA8& backgroundColor=ColorRGBA8(150, 150, 150, 255),
... |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009, 2010 MIRKO BANCHI
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program i... |
/*************************************************************************/
/* texture_region_editor_plugin.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... |
#pragma once
#include <nlohmann/json.hpp>
#include <unordered_map>
#define TYPE_TO_OBJ_NODE(class_name) \
{#class_name, [](){ return std::make_unique<class_name>(); }}
namespace transport
{
template <typename T>
class FactoryBase
{
public:
using TypePtr = std... |
#define LOG_TAG "win_surface"
#include <cutils/memory.h>
#include <utils/Log.h>
#include <android/native_window.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
#define GL_GLEXT_PROTOTYPES
#inclu... |
/*
* Copyright (C) 2009 Apple Inc. 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
* notice, this list of conditions a... |
#ifndef DATE_TIME_DATE_GENERATOR_PARSER_HPP__
#define DATE_TIME_DATE_GENERATOR_PARSER_HPP__
/* Copyright (c) 2005 CrystalClear Software, Inc.
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
* Au... |
#ifndef LLAMA_CPP_SRC_SORT_MERGESORT_H_
#define LLAMA_CPP_SRC_SORT_MERGESORT_H_
#include <algorithm>
#include <utility>
#include <vector>
#include "Sort.h"
namespace llama {
template <class T> class MergeSort : public Sort<T> {
public:
MergeSort() {}
explicit MergeSort(std::vector<T> *inputArray) { this->pe... |
// -*- C++ -*-
/*!
* @file ROSInPort.cpp
* @brief ROSInPort class
* @date $Date: 2019-01-31 03:08:03 $
* @author Nobuhiko Miyamoto <n-miyamoto@aist.go.jp>
*
* Copyright (C) 2019
* Nobuhiko Miyamoto
* Robot Innovation Research Center,
* National Institute of
* Advanced Industrial Scienc... |
/*
Copyright 2018 <Pierre Constantineau>
3-Clause BSD License
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 notice, this list of conditions and the follow... |
#include "RemoveExtraSpaces.h"
using namespace std;
std::string RemoveExtraSpaces(std::string const& arg)
{
std::string result;
size_t lastNotSpacePosition = arg.find_last_not_of(' ');
if (lastNotSpacePosition != string::npos)
{
size_t firstNotSpacePosition = arg.find_first_not_of(' ');
... |
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or t... |
// Copyright 2016, Tobias Hermann.
// https://github.com/Dobiasd/frugally-deep
// Distributed under the MIT License.
// (See accompanying LICENSE file or at
// https://opensource.org/licenses/MIT)
#pragma once
#include "fdeep/convolution.hpp"
#include "fdeep/filter.hpp"
#include "fdeep/shape2.hpp"
#include "fdeep/te... |
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickWindow>
#include "helloitem.h"
int main(int argc, char *argv[])
{
#ifdef Q_OS_WIN
// Select between OpenGL and OpenGL ES (Angle)
//QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
QCoreApplication::setAttribute(Qt::AA_UseDesktop... |
//===-- ProcessKDPLog.cpp -------------------------------------------------===//
//
// 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
//
//===---------------------------... |
#ifndef _SMP_SAMPLER_TRAJECTORY_BIAS_HPP_
#define _SMP_SAMPLER_TRAJECTORY_BIAS_HPP_
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <smp/components/samplers/trajectory_bias.h>
#include <smp/components/samplers/base.hpp>
#include <smp/common/region.hpp>
#include <smp/planner_utils/trajectory.hpp>
t... |
#include <iostream>
#include "behavioral_patterns/iterator/BookShelf.h"
#include "behavioral_patterns/iterator/Book.h"
#include "behavioral_patterns/iterator/Iterator.h"
using namespace std;
/*
Add books in a bookshelf and display the names of the book in turn.
*/
int main() {
unique_ptr<BookShelf> book_shelf(new ... |
// Include standard headers
#include <windows.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <complex>
// Include GLEW
//#define GLEW_STATIC
#include <GL/glew.h>
// Include GLFW
#include <GLFW/glfw3.h>
#define GLM_FORCE_RADIANS
#define GLM_SWIZZLE //vec3 v3 = v4.xyz();
#include <glm/glm.hpp>
... |
/***************************************************************************
* This file is part of the CuteReport project *
* Copyright (C) 2012-2014 by Alexander Mikhalov *
* alexander.mikhalov@gmail.com *
* ... |
//
// Created by chenqwwq on 2022/5/16.
//
#include "stdc++.h"
#include "common.h"
using namespace std;
// 状态压缩
class Solution {
public:
int minStickers(vector<string> &ss, string t) {
int n = (int) t.length();
int maxn = 1 << n,INF = 0x3f3f3f3f;
vector<int> memo(maxn, -1);
func... |
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
template<c... |
/* 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... |
//==============================================================================
// Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// Se... |
/*
***********************************************************
Implementation of AliReducedVarManager
Contact: iarsene@cern.ch
2015/04/16
*********************************************************
*/
#ifndef ALIREDUCEDVARMANAGER_H
#include "AliReducedVarManager.h"
#endif
#include <iostream>
using std::cout;
us... |
#ifndef SHIVLIB_ARRAY_HPP
#define SHIVLIB_ARRAY_HPP
#include "../cstddef.hpp"
#include <cassert>
#include <iterator>
namespace shiv {
template<typename T, size_t num_of_elems>
struct array{ // all public with no constuctor for aggregate initialization
using value_type = T;
using iterator = T*;
using const... |
// Copyright (c) 2018, The TurtleCoin Developers
// Copyright (c) 2019, The GalacticBits Developers
//
// Please see the included LICENSE file for more information.
/////////////////////////////
#include <zedwallet++/Sync.h>
/////////////////////////////
#include <Common/SignalHandler.h>
#include <config/WalletConf... |
#pragma once
#include <vector>
#include <ostream>
#include <cassert>
template <typename T>
class QSMatrix
{
private:
std::vector<T> _data;
unsigned _rows;
unsigned _cols;
typedef std::initializer_list<std::initializer_list<T>> initializer_list_type_t;
public:
/// @brief Construct a new QSMatrix ... |
/*! \file boost_variant.hpp
\brief Support for boost::variant
\ingroup OtherTypes */
/*
Copyright (c) 2014, Randolph Voorhies, Shane Grant
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
... |
////////////////////////////////////////////////////////////////
// Orkid Media Engine
// Copyright 1996-2020, Michael T. Mayers.
// Distributed under the Boost Software License - Version 1.0 - August 17, 2003
// see http://www.boost.org/LICENSE_1_0.txt
////////////////////////////////////////////////////////////////
... |
//
// Copyright (c) 2008-2017 the Urho3D project.
//
// 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, m... |
#include "passwordinput.h"
PasswordInput* PasswordInput::instalce = NULL;
PasswordInput::PasswordInput(LocalManDialog *parent)
: LocalManDialog(parent)
{
ui.setupUi(this);
using namespace Qt;
auto remove = WindowTitleHint;
auto add = FramelessWindowHint | WindowMinMaxButtonsHint;
setAttribute... |
#include <iostream>
#include <stdint.h>
#include <atomic>
#include <thread>
#include <signal.h>
#include "JobSystem.h"
#include "Profiling.h"
#ifdef _WIN32
#include <windows.h>
#elif __linux__
#include <pthread.h>
#endif
//Yeah we're just going to unoptimize this whole class. Stupid? Probably, but also have no idea wh... |
// 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 "platform_verification_flow.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "ba... |
#include <sstream>
#include <iostream>
#include <ydk/entity_util.hpp>
#include "bundle_info.hpp"
#include "generated_entity_lookup.hpp"
#include "Cisco_IOS_XE_native_62.hpp"
#include "Cisco_IOS_XE_native_63.hpp"
using namespace ydk;
namespace cisco_ios_xe {
namespace Cisco_IOS_XE_native {
Native::Interface::TwentyFi... |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*=============================================================
**
** Source: pal_get_stdout.c
**
** Purpose: Positive test the PAL_get_stdout API.
** Call PAL_get_stdout to... |
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person ... |
#include "../header.h"
class Solution {
public:
int atMostNGivenDigitSet(vector<string>& digits, int n) {
sort(digits.begin(), digits.end());
int ans = 0;
int D = digits.size();
string s = to_string(n);
int len = s.size();
for (int i = 1; i < len; i++) {
... |
#include "PbbamInternalConfig.h"
#include <pbbam/PbiRawData.h>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <map>
#include <tuple>
#include <type_traits>
#include <boost/numeric/conversion/cast.hpp>
#include <pbbam/BamFile.h>
#include <pbbam/BamRecord.h>
#include <pbbam/RecordType.h>
#include... |
#include "StdAfx.h"
#include "Wrapper.h"
#include "DXGISwapChainWrapper.h" |
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define INF 1 << 30
#define MOD 1000000007
#define rint(x) scanf("%d", &(x))
#define rlong(x) scanf("%lld", &(x))
#define SIZE 100005
#define l(x) x << 1
#define r(x) x << 1 | 1
#define m(x, y) (x + y) / 2
using namespace std;
typedef long long ll;
t... |
#include "node_internals.h"
#include "node_watchdog.h"
namespace node {
namespace util {
using v8::ALL_PROPERTIES;
using v8::Array;
using v8::Boolean;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::IndexFilter;
using v8::Integer;
using v8::Isolate;
using v8::KeyCollectionMode;
using ... |
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015-2019 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 "PickupHandler.h"
void PickupHandler::Setup(UStaticMeshComponent *Mesh)
{
StaticMeshComponent = Mesh;
RootComponent = StaticMeshComponent->GetAttachmentRoot();
bSimulatePhyscis = StaticMeshComponent->BodyInstance.bSimulatePhysics;
}
void PickupHandler::Pickup(USceneComponent *AttachTo) const
{
const FAtt... |
#pragma once
#include "custom-types/shared/macros.hpp"
#include "monkecomputer/shared/ViewLib/View.hpp"
#include "monkecomputer/shared/InputHandlers/UISelectionHandler.hpp"
DECLARE_CLASS_CODEGEN(MonkeSkies, BackgroundListViewController, GorillaUI::Components::View,
DECLARE_METHOD(void, DidActivate, bool firstActi... |
// Copyright 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 w... |
#pragma once
#include "imgproc/segmentation/permutohedral_common.h"
template<int FeatureDim>
float surfelwarp::permutohedral_scale_factor(const int index) {
return (FeatureDim + 1) * sqrtf((1.0f / 6.0f) / ((index + 1) * (index + 2)));
}
template<int FeatureDim>
unsigned surfelwarp::LatticeCoordKey<FeatureDim>::hash... |
// -----------------------------------------------------------------------------------------------------
// Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
// Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
// This file may be used, modified and/or redistributed under the terms of th... |
// Copyright (c) 2015, Baidu.com, 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 "proto/rpc_client.h"
namespace tera {
sofa::pbrpc::RpcChannelOptions RpcClientBase::channel_options_;
std::map<std::string, sofa::pbrpc::RpcChann... |
#include <stdlib.h>
#include <iostream>
using namespace std;
int compare(const void *x, const void *y) {
return ((*(int *)x) - (*(int *)y));
}
int main(int argc, char **argv) {
if (argc != 2) {
cout << "Usage: " << argv[0] << " <n> " << endl;
exit(1);
}
int n = atoi(argv[1]);
int... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "OeipManager.h"
#include <vector>
using namespace std::placeholders;
OeipManager *OeipManager::singleton = nullptr;
OeipManager::OeipManager() {
std::function<void(int, const char*)> logHandle = std::bind(&OeipManager::onLogMes... |
#include "QVTKApplication.h"
#include "GUI4.h"
int main(int argc, char** argv)
{
QVTKApplication app(argc, argv);
GUI4 widget;
widget.show();
return app.exec();
} |
/***********************************************************************
The cct 4D Transformation program
************************************************************************
cct is a 4D equivalent to the "proj" projection program.
cct is an acronym meaning "Coordinate Conversion and Transform... |
// RUN: %clang_cl_asan -O0 %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
#include <malloc.h>
int main() {
char *buffer = (char*)realloc(0, 42);
buffer[42] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
// CHECK-NEXT: {{#0 .... |
#include "my_application.h"
#include <flutter_linux/flutter_linux.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include "flutter/generated_plugin_registrant.h"
struct _MyApplication {
GtkApplication parent_instance;
char** dart_entrypoint_arguments;
};
G_DEFINE_TYPE(MyApplication, my_application, GT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.